Re: Error: suffix or operands invalid for `int'
- From: Tauno Voipio <tauno.voipio@xxxxxxxxxxxxx>
- Date: Thu, 04 Sep 2008 18:29:27 GMT
chiky wrote:
Hey guys,
I was writing a small assembly code in GAS syntax (actually learning
from Linus' first kernel). It is giving me errors like these:
project@BUZZ-SuSE:~/kernel/linux/boot/chiky> as -o b.o b.s
b.s: Assembler messages:
b.s:27: Error: suffix or operands invalid for `int'
b.s:33: Error: suffix or operands invalid for `int'
Here is the program:
.globl begtext, begdata, begbss, endtext, enddata, endbss
.text
begtext:
.data
begdata:
.bss
begbss:
.text
BOOTSEG = 0x07c0
INITSEG = 0x9000
SYSSEG = 0x1000
ENDSEG = SYSSEG + SYSSIZE
start:
mov 0x03, %ah /*read cursor pos*/
xor %bh,%bh
int 0x10
mov $24, %cx
mov 0x0007, %bx # page 0, attribute 7 (normal)
mov msg1, %bp
mov 0x1301, %ax # write string, move cursor
int 0x10
msg1:
.byte 13,10
.ascii "Hello!"
.byte 13,10,13,10
.text
endtext:
.data
enddata:
.bss
endbss:
I tried the '$' suffix in front of the interrupt '0x10', it assembled
but ran with a segmentation fault.
Thanks
Chirag
If you're attempting to run it under Linux kernel,
the segfault is OK - you're not allowed to access
the BIOS from user mode. Actually, there's nothing
useful on the int 0x10 vector to handle the call.
DOS examples must be run on a plain computer without
any real operating system (or in a simulator).
Besides, even on a plain computer, your code will
run off the end after the second int 0x10.
--
Tauno Voipio
tauno voipio (at) iki fi
.
- Follow-Ups:
- Re: Error: suffix or operands invalid for `int'
- From: chiky
- Re: Error: suffix or operands invalid for `int'
- Prev by Date: Re: Error: suffix or operands invalid for `int'
- Next by Date: Re: Error: suffix or operands invalid for `int'
- Previous by thread: Re: Error: suffix or operands invalid for `int'
- Next by thread: Re: Error: suffix or operands invalid for `int'
- Index(es):
Relevant Pages
|
Loading