about assembly and marco [modified]
-
/* 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 -
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 -
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 -
/* 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, 2006songlei 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