Author Topic: glPush macro  (Read 4282 times)

Offline Korybut

  • Jr. Member
  • *
  • Posts: 6
glPush macro
« on: February 21, 2021, 02:11:46 PM »
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: [Select]
%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


Is it possible to write a macro that will trasform for example this
Code: [Select]
glpush   1.11111111111111111111
simply into this
Code: [Select]
push   3FF1C71C
push   71C71C72

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
« Last Edit: February 21, 2021, 07:23:17 PM by Korybut »