Inline Assembly

Programming, for all ages and all languages.
Post Reply
uSername
Posts: 1
Joined: Thu Mar 29, 2012 12:41 pm

Inline Assembly

Post by uSername »

The 'int' command is not compiling using GCC Inline assembly. Here is my code:

Code: Select all

void uPrint(char uIn){
	__asm__ ("movb $0x0A, %ah\n\t"
		 "movb $uIn, %al\n\t"
		 "int 16");
}
void uMain(){
	uPrint('H');
}
Here is my error:

Code: Select all

operand size mismatch for `int'
Snake
Posts: 19
Joined: Wed Mar 21, 2012 7:38 pm

Re: Inline Assembly

Post by Snake »

Probably it wants

Code: Select all

int $16
User avatar
iansjack
Member
Member
Posts: 4687
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Inline Assembly

Post by iansjack »

Snake is right. Just using "int 16" refers to the address 16, not the constant 16. So you are trying to use a 32-bit or 64-bit (depending upon your OS) number with the "int" instruction, which just won't work.
petergerko
Posts: 1
Joined: Mon Apr 16, 2012 5:22 am
Contact:

Re: Inline Assembly

Post by petergerko »

Is this sign "$" used for both 32 and 64 systems?
read about mobile phone signal booster
I use gsm repeater in my big office. It works.
Post Reply