🔒 Locked
ASM in C
Advertisement
Original Post
I have a problem using djgpp with the asm command. Here is my code:
asm("mov %ah, 0");
asm("mov %al, 19");
asm("int 16");
when it goes to the int 16 function though, when i compile it it gives me an error that says "error: operands given don't match any known 386 instruction" although int 16 is suppose to be the correct command. Whats up here?
/\/\att
[edited by - mattcarpenter on July 22, 2002 4:00:52 PM]
Here''s a pretty good reference for AT&T assembly and djgpp: Brennan''s Guide to Inline Assembly
Not to say this will actually work, but it will compile:
In AT&T syntax the value of 'mov' goes on the left, and all constant values are in decimal and prefixed with a dollar sign.

[edited by - Null and Void on July 23, 2002 2:37:14 PM]
asm("mov $0, %ah\n"
"mov $19, %al\n"
"int $16\n");
In AT&T syntax the value of 'mov' goes on the left, and all constant values are in decimal and prefixed with a dollar sign.

[edited by - Null and Void on July 23, 2002 2:37:14 PM]
tanx, damn these mosquito bites ITCH! i just went camping for 3 days in the middle of the desert. Wenatchee Confluence State Park in Washington, actually.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement