NASM Forum > Programming with NASM

glPush macro



As some of you or even all know OperGL requires some parameters to be quad words. Programming for 32 bit system programmers almost always invent some marco operation to deal with this feature (or issue). However the way this macro is realized in NASMX is not very elegant

--- Code: ---%macro gl_dpush 1
%ifid %1
 push dword [%1+4]
 push dword [%1]
 jmp %%label
  align 4
 dq %1
 push dword [%%datum+4]
 push dword [%%datum]

--- End code ---

Is it possible to write a macro that will trasform for example this

--- Code: ---glpush   1.11111111111111111111

--- End code ---
simply into this

--- Code: ---push   3FF1C71C
push   71C71C72

--- End code ---

I've read the preprocessor manual couple of times and some useful examples but unfortuanetly I haven't found the possibility to implement such a macro. Perhaps and I hope  I am missing something


[0] Message Index

Go to full version