News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

OPATTR, ARGSIZE and externdef variables

Started by jj2007, July 19, 2008, 08:37:23 PM

Previous topic - Next topic

jj2007

.data?
FpuRes10   dt ?

Exported and imported as EXTERNDEF FpuRes10:TBYTE

The only problem is that in macros, it behaves as follows:

- if I keep it internal, it yields opattr 42 and argsize 10, which is fine
- if I make it external, opattr is 938 (fine, 938 and 127 = 42) but argsize is 4...

Any error on my part, if not, any workaround?
Thanks, JJ


EDIT: Stupid error on my part, sorry! The red part below was missing, so it assumed size 4

; 76543210
atImmediate equ 36 ; 00100100
atGlobal equ 42 ; 00101010
atRegister equ 48 ; 00110000
atLocal equ 98 ; 01100010


  if ArgType eq atLocal or ArgType eq atGlobal or ArgType eq 938
   ArgSize = SIZEOF vn$   ; 4 for DWORD, 10 for REAL10
  elseif ArgType eq atImmediate
   ArgSize SIZESTR vn$   ; = @SizeStr(vn$) yields always 3
  else
   ArgSize = 4            ; others incl CPU registers
  endif