I'm trying to build an IDT in x86 assembly but have problems storing function addresses in the data section.
Here's my code:
.text
.globl handler0
.type handler0, @function
.align 2
handler0:
pushl $(0)
jmp _alltraps
.data
.hword (((handler0) >> 16) & 0xFFFF)
.hword 0x8F00
.hword 0x0008
.hword ((handler0) & 0xFFFF)
Assembler messages:
kern/trapentry.S:71: Error: invalid operands (.text and *ABS* sections) for `>>'
kern/trapentry.S:74: Error: invalid operands (.text and *ABS* sections) for `&'
It's required to store the higher and lower bits of function handler0
separately. What is the proper way to achieve this in the assembly?