Mail Archives: djgpp/1999/04/25/21:35:18
a2o1 AT my-dejanews DOT com wrote:
>
> I'm trying to learn assembly (AT&T) and I finally got a (what I thought was)
> simple switch screen code:
>
> __asm__ __volatile__("
> movl $13, %%ax\n
> int $10\n
> );
>
> This compiles fine with: gcc -g foo.cc -o foo.exe
>
> but when I run the program I get a SIGSERV error... This also occured with
> some code that I had downloaded for the Intel Assembly and converted to AT&T
> (It was a drawing routine). Help!!!
Immediate operands in AT&T assembly follow the same radix rules as C.
(1, 01, 0x1 are decimal, octal, hex.) So you were calling int *decimal*
10, or int 0xa, which is the Invalid TSS exception.
Write `movl $0x13' and `int $0x10' and all should be well.
And note that in the first line, you probably mean `movw'.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -