Don't I just feel like an idiot - need help w/ NASM 16-bit
Posted: Tue Jun 07, 2011 5:43 pm
I know I'm getting frustrated when I finally give in and create an account here (after literally years of lurking).
I'm working on a PXE boot loader for my kernel. I need to use the PXE API to load a few other files from the TFTP server. I've dug through the PXE doc and while it does have useful information, I've run into an odd stumbling block.
It's been so long since I've done 16-bit assembly that I've been unable to figure out the following MASM construct in NASM:
call dword ptr (s_PXE ptr es:[di]).EntryPointSP
What I have done is stored the !PXE entry point (segment and offset) into two memory areas (pxe_seg and pxe_off). I am trying to do something like the following:
mov ax, [pxe_seg]
mov es, ax
mov ax, [pse_off]
call es:ax
I've also tried the form "call es:[pxe_off]"
Both of these forms fail with the following error message from nasm:
pxeboot.asm:145: error: invalid combination of opcode and operands
I've gone back to the Intel manuals and for the life of me cannot find a solution that will work with NASM syntax.
Anyone have any help?
Thanks!
Mike
EDIT: Okay, have tried more experiments and found that the following will work using immediate values:
call 0x9e95:0x0106
I just cannot figure out how to make this work with the NASM syntax
I'm working on a PXE boot loader for my kernel. I need to use the PXE API to load a few other files from the TFTP server. I've dug through the PXE doc and while it does have useful information, I've run into an odd stumbling block.
It's been so long since I've done 16-bit assembly that I've been unable to figure out the following MASM construct in NASM:
call dword ptr (s_PXE ptr es:[di]).EntryPointSP
What I have done is stored the !PXE entry point (segment and offset) into two memory areas (pxe_seg and pxe_off). I am trying to do something like the following:
mov ax, [pxe_seg]
mov es, ax
mov ax, [pse_off]
call es:ax
I've also tried the form "call es:[pxe_off]"
Both of these forms fail with the following error message from nasm:
pxeboot.asm:145: error: invalid combination of opcode and operands
I've gone back to the Intel manuals and for the life of me cannot find a solution that will work with NASM syntax.
Anyone have any help?
Thanks!
Mike
EDIT: Okay, have tried more experiments and found that the following will work using immediate values:
call 0x9e95:0x0106
I just cannot figure out how to make this work with the NASM syntax