Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Need help with assembly x86 using C language

Need help with assembly x86 using C language

Scheduled Pinned Locked Moved C / C++ / MFC
algorithmshelplearning
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    a random user
    wrote on last edited by
    #1

    Well after finishing logical gates and making the Computer.hdl (Nand2tetris) We started learning about assembly this is only the second lesson and we learnt so far a bit about offset lea and signed and unsigned i need help solving this exercise and on the way the explenation why and how because iv been searching tyhe web for 2 days now and i got no luck so far ; Print '15', using ONLY 'mov' and 'lea'. ; Do NOT use arithmetic instrutions (add, inc, mul, etc.) PRINTN "Part (C) - should print 15" mov ax,10 mov bx,4 mov cx, lea [ax + bx+1] mov ax,cx call print_num PRINTN

    D D 2 Replies Last reply
    0
    • A a random user

      Well after finishing logical gates and making the Computer.hdl (Nand2tetris) We started learning about assembly this is only the second lesson and we learnt so far a bit about offset lea and signed and unsigned i need help solving this exercise and on the way the explenation why and how because iv been searching tyhe web for 2 days now and i got no luck so far ; Print '15', using ONLY 'mov' and 'lea'. ; Do NOT use arithmetic instrutions (add, inc, mul, etc.) PRINTN "Part (C) - should print 15" mov ax,10 mov bx,4 mov cx, lea [ax + bx+1] mov ax,cx call print_num PRINTN

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      a random user wrote:

      i need help solving this exercise...

      Just curious, but isn't that what the instructor (or the TA) is for? Are instructors these days just off limits to questions?

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

      A 1 Reply Last reply
      0
      • D David Crow

        a random user wrote:

        i need help solving this exercise...

        Just curious, but isn't that what the instructor (or the TA) is for? Are instructors these days just off limits to questions?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        A Offline
        A Offline
        a random user
        wrote on last edited by
        #3

        the instructers are not allowed to help us

        L 1 Reply Last reply
        0
        • A a random user

          the instructers are not allowed to help us

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          But a bunch of strangers are?

          D A 2 Replies Last reply
          0
          • L Lost User

            But a bunch of strangers are?

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Who are you calling strange, Richard? :suss:

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

            1 Reply Last reply
            0
            • L Lost User

              But a bunch of strangers are?

              A Offline
              A Offline
              a random user
              wrote on last edited by
              #6

              indeed

              1 Reply Last reply
              0
              • A a random user

                Well after finishing logical gates and making the Computer.hdl (Nand2tetris) We started learning about assembly this is only the second lesson and we learnt so far a bit about offset lea and signed and unsigned i need help solving this exercise and on the way the explenation why and how because iv been searching tyhe web for 2 days now and i got no luck so far ; Print '15', using ONLY 'mov' and 'lea'. ; Do NOT use arithmetic instrutions (add, inc, mul, etc.) PRINTN "Part (C) - should print 15" mov ax,10 mov bx,4 mov cx, lea [ax + bx+1] mov ax,cx call print_num PRINTN

                D Offline
                D Offline
                David A Gray
                wrote on last edited by
                #7

                As a rule, we don't help with homework. That said, I'll give you a hint; the solution is related to loading ASCII codes for characters into AX.

                A 1 Reply Last reply
                0
                • D David A Gray

                  As a rule, we don't help with homework. That said, I'll give you a hint; the solution is related to loading ASCII codes for characters into AX.

                  A Offline
                  A Offline
                  a random user
                  wrote on last edited by
                  #8

                  well thank you...

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups