delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/25/21:35:18

Sender: nate AT cartsys DOT com
Message-ID: <3723C335.7994C459@cartsys.com>
Date: Sun, 25 Apr 1999 18:36:53 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.5 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: SIGSERV Error
References: <7fso1i$6of$1 AT nnrp1 DOT dejanews DOT com>
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019