NASM Forum > Programming with NASM

glPush macro

(1/1)

Korybut:
Hello!

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]
%else
 jmp %%label
  align 4
%%datum:
 dq %1
%%label:
 push dword [%%datum+4]
 push dword [%%datum]
%endif
%endmacro

--- 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

Navigation

[0] Message Index

Go to full version