- Joined
- Apr 22, 2005
- Sythe Gold
- 23
- Messages
- 7,825
Made it C-compatible for Darby lawl.
Output should be 11. Note that the syntax:
only works on Visual C++. On GCC/MinGW it's asm("<code>"); or something similar.
Code:
#include <stdio.h>
int main()
{
int x,y,z;
__asm{
MOV x,4 ;make x = 4
MOV y,7 ;make y = 7
MOV EAX,x ;put x in EAX
MOV EBX,y ;put y in EBX
ADD EAX,EBX ;should be self-explanatory...
MOV z,EAX
}
printf("x + y = %i",z);
return 0;
}
Code:
__asm{
; Assembler code
}
















