Mail Archives: djgpp/1996/09/25/02:13:35
> Gidday,
Look, you may be Australian, but maybe you should get it
right... :) its G'day! Haven't you ever seen the add!!! ;)
> I am trying to get going using inline assembler with DJGPP and I have a
> couple of problems/questions.
Been there, done that...
> Firstly, how do I represent HEX and binary numbers. Normally I would do
> somthinge like 10h(for hex) and 1011001b(for binary). I also
> tried creating a little routine, however it fails to compile :-(
I use 0x10 = 16 decimal
> void setvga(unsigned short mode)
> {
> __asm__ __volatile__(" movw %0, %ax\n
> movb $0, %ah\n
> int $16 "
> :
> : "g" (mode)
> : "ax" );
>
> }
You need TWO % signs to access the registers. ie:
movw %0, %%ax;
movb $0, %%ah;
int 0x10;
Leathal.
- Raw text -