The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: jj2007 on July 19, 2008, 08:37:23 PM

Title: OPATTR, ARGSIZE and externdef variables
Post by: jj2007 on July 19, 2008, 08:37:23 PM
.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