[ros-kernel] NASM hacker needed
Royce Mitchell III
royce3 at ev1.net
Thu Feb 5 18:56:27 CET 2004
I have an .S file I'm trying to get to work. Here is it's entire contents:
%macro TEB_ENTRY 4
TEBOFF_%1 equ ($%3+7C4h)
%endmacro
%include "teblist.mac"
%undef TEB_ENTRY
%macro TEB_ENTRY 4
global %1@%4
%1@%4:
mov eax, [fs:18h] ; obtain a pointer to the TEB
jmp [eax+TEBOFF_%1]
%endmacro
%include "teblist.mac"
%undef TEB_ENTRY
Here's a snippet of teblist.mac:
;TEB_ENTRY name,icdidx,tebidx,stack
TEB_ENTRY glCallList,2,0,4
TEB_ENTRY glCallLists,3,1,12
TEB_ENTRY glBegin,7,2,4
TEB_ENTRY glColor3b,9,3,12
I'm compiling it in VC6 with the following command:
nasmw.exe -fwin32 -o Debug\tebimports.obj $(InputPath)
Here's a snippet of the output I'm getting when trying to link:
tebimports.obj : error LNK2001: unresolved external symbol glCallList at 4
tebimports.obj : error LNK2001: unresolved external symbol glCallLists at 12
tebimports.obj : error LNK2001: unresolved external symbol glBegin at 4
tebimports.obj : error LNK2001: unresolved external symbol glColor3b at 12
Now, if I change the 2nd macro to this:
%macro TEB_ENTRY 4
global _%1@%4
_%1@%4:
mov eax, [fs:18h] ; obtain a pointer to the TEB
jmp [eax+TEBOFF_%1]
%endmacro
I get the following from the linker:
tebimports.obj : error LNK2001: unresolved external symbol _glCallList at 4
tebimports.obj : error LNK2001: unresolved external symbol _glCallLists at 12
tebimports.obj : error LNK2001: unresolved external symbol _glBegin at 4
tebimports.obj : error LNK2001: unresolved external symbol _glColor3b at 12
So whatever I define the function name to be in my .S file, the linker
complains it can't find that function name :(
Thanks,
Royce3
More information about the Ros-kernel
mailing list