This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Getting a 32bit symbol into a 16bit .word directive
- From: MurF <murphyn at microsense dot co dot uk>
- To: binutils at sources dot redhat dot com
- Date: Fri, 18 Jul 2003 15:38:01 +0100
- Subject: Getting a 32bit symbol into a 16bit .word directive
- Reply-to: murphyn at microsense dot co dot uk
Chaps,
I've been using GCC with good results. And I'm slowly finding my way around
the Protected mode of the IA-32 architechture. I've just started looking into
interurpts, and want to write my own IDT for a i486. Problem is I can't get
as to put a 32-bit symbol into a .word directive without getting an error.
I want to do something like this ....
(A bit of code)
.
.
.
int0:
mov $0x0,%eax
mov $0x80,%edx
out %al,%dl
loop0:
jmp loop0
.
.
(A bit of code)
.
.
.globl EXT(idtptr)
EXT(idtptr):
.word 20*8-1
.long idt
idt:
// Offset(15..0) , Segment Selector
// Reserved (4..0), '0'(7..5) '0D110'(12..8), DPL(14..13), P(15)
// offset(31..16)
.word (int0), 0x0010 // Int 0 - Divide Error
.byte 0x00, 0x0e
.word 0x0000
.
.
.
.
.
But when i compile this i get the error 'relocation truncated to fit:
R_386_16 text' and the rest of the compilation fails. This is due to the line
'.word (int0),0x0010)'
If I remove the (int0) and replce with a constant everything works.
Any ideas?