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. about assembly and marco [modified]

about assembly and marco [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 Posts 3 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.
  • S Offline
    S Offline
    songlei
    wrote on last edited by
    #1

    /* complier: vc6 sp6 */ #include<stdio.h> #define x_x(n) \ __asm mov eax, $ \ __asm mov n, eax int main() { int n; x_x(n); printf("%d\n", n); } /////////// why output is 0? help me... -- modified at 0:20 Thursday 29th June, 2006

    N D 2 Replies Last reply
    0
    • S songlei

      /* complier: vc6 sp6 */ #include<stdio.h> #define x_x(n) \ __asm mov eax, $ \ __asm mov n, eax int main() { int n; x_x(n); printf("%d\n", n); } /////////// why output is 0? help me... -- modified at 0:20 Thursday 29th June, 2006

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      songlei wrote:

      why output is 0?

      the effective assembley lanuage for this will be as shown below 004010F8 mov eax,**0** 004010FD mov dword ptr [ebp-4],eax the $ is replace with 0. why u use $ there? nave

      S 1 Reply Last reply
      0
      • N Naveen

        songlei wrote:

        why output is 0?

        the effective assembley lanuage for this will be as shown below 004010F8 mov eax,**0** 004010FD mov dword ptr [ebp-4],eax the $ is replace with 0. why u use $ there? nave

        S Offline
        S Offline
        songlei
        wrote on last edited by
        #3

        the value of $ is 0 when uses marco. if direct use, ex: int main() { int n _x: __asm mov [n], $ printf("%d", n); } _x == n is true!! (sorry, my engish is poor, maybe...) -- modified at 1:36 Thursday 29th June, 2006

        N 1 Reply Last reply
        0
        • S songlei

          the value of $ is 0 when uses marco. if direct use, ex: int main() { int n _x: __asm mov [n], $ printf("%d", n); } _x == n is true!! (sorry, my engish is poor, maybe...) -- modified at 1:36 Thursday 29th June, 2006

          N Offline
          N Offline
          Naveen
          wrote on last edited by
          #4

          songlei wrote:

          _x == n is true!!

          sorry i didn't understand..Can u plz explain more nave

          1 Reply Last reply
          0
          • S songlei

            /* complier: vc6 sp6 */ #include<stdio.h> #define x_x(n) \ __asm mov eax, $ \ __asm mov n, eax int main() { int n; x_x(n); printf("%d\n", n); } /////////// why output is 0? help me... -- modified at 0:20 Thursday 29th June, 2006

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

            songlei wrote:

            why output is 0?

            What should it be?


            "The largest fire starts but with the smallest spark." - David Crow

            "Judge not by the eye but by the heart." - Native American Proverb

            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