In NASM, a label is just a name for an offset. Thus, all you would need to do in order to get a function's address is [tt]mov <dest>, dword function_name[/tt]; without the square brackets, the label is treated as an immediate value, rather than an address, you see.
However, descriptors present a problem, in that the offset is split between two non-adjacent words. To deal with this, you have to do something like this:
Code: Select all
; initialize interrupt 0 descriptor
mov eax, isr0 ; without the brackets, this moves the address into eax
mov [int0_descriptor], ax ; save lower half of offset value
shr eax, 16
mov [int0_descriptor + 6], ax ; save upper half of offset value
<additional code>
isr0:
<code>
iret
<more code and data>
;interrupt 0
int0_descriptor:
dw 0x0000 ; lower half of offset
dw 0x0001 ; segment selector
db 0x00 ; dword count
db 0x0E ; P/DPL/DT/type
dw 0x0000 ; upper half of offset
Note that I haven't tried this, and I'm not very familiar with descriptors, so I'm likely to be mistaken on the details of this. I assumed a single code segment in descriptor 0x0001, kernel-level priority (priority 0), and no stack parameters.
BTW it may be wiser to use a struct (or perhaps more than one) in defining descriptors, and perhaps use macros to deal with initializing those parts which can be easily computed at assembly time.