c - Simple inline assembly program won't compile -


this driving me insane... i'm sure there's small i'm doing wrong here, can't figure out after trying 30 minutes , googling. trying compile simple c program inline assembly, disassemble it, in order machine code instructions. school programming project. here recent attempt:

int main()  { asm(     "movl   $0x5bc1229f,0x0804c1e8"     "movl   $0x08048f9c,%edx"     "push   %edx"     "ret"       ); } 

when compile this, errors:

/var/folders/ki/kiae03vjfdclyy0r0mmbp++++ti/-tmp-//cc2xknoz.s:9:junk `movl $0x08048f9c' after expression  /var/folders/ki/kiae03vjfdclyy0r0mmbp++++ti/-tmp-//cc2xknoz.s:9:bad register name `%edxpush%edxret' 

thanks :)

try

int main() { asm(     "movl   $0x5bc1229f,0x0804c1e8\n\t"     "movl   $0x08048f9c,%edx\n\t"     "push   %edx\n\t"     "ret\n\t"       ); } 

Comments