Reputation: 599
Well, I copied this code exactly from page 17 of
http://www.tutorialspoint.com/assembly_programming/assembly_tutorial.pdf
but when I compiled it with NASM (on windows even though in the pdf they use linux)
using the command nasm -f elf test.asm -o test.com
, and run it it spits this out at me:
16 bit MS-DOS Subsystem dir The NTVDM CPU has encountered an illegal instruction. CS:0000 IP:0077 OP:fo 37 05 0a 02 Choose 'Close' to terminate the application.
where dir
is the location from which I compiled and ran the program (nasm directory). I hope I don't make a total tit out of myself for this, but it really is puzzling me.
Thank you in advance!
Upvotes: 1
Views: 1718
Reputation: 5612
int 0x80 ;call kernel
You're on windows -- dos even. The address you're using in this instruction (0x80
) is Linux/Unix specific.
http://en.wikipedia.org/wiki/INT_(x86_instruction)
Upvotes: 3