News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

OPATTR simple macro USEOPATTR

Started by TouEnMasm, April 20, 2021, 11:38:23 PM

Previous topic - Next topic

TouEnMasm

Hello,
I find this one very more simple than the given by the masm package,There is only one macro and not three
Quote
USEOPATTR MACRO op:REQ
   Local langage,ReExtLab,RelativeSS,NundefNoError,RegisterValue,UseDirectMemAdr
   Local ImmedValue,MemVarRelocDat,CodeLab,valueOpat,resultat
langage       = 11100000000b
ReExtLab       = 00010000000b
RelativeSS       = 00001000000b
NundefNoError   = 00000100000b
RegisterValue   = 00000010000b
UseDirectMemAdr   = 00000001000b
ImmedValue      = 00000000100b
MemVarRelocDat   = 00000000010b
CodeLab      = 00000000001b
   valueOpat = OPATTR (op)
   resultat = valueOpat SHR 8
   if resultat EQ 0
      ECHO op No Langage Type
   elseif resultat EQ 1
      ECHO op C
   elseif resultat EQ 10b
      ECHO op syscall
   elseif resultat EQ 11b
      ECHO op STDCALL
   elseif resultat EQ 100b
      ECHO op PASCAL
   elseif resultat EQ 101b
      ECHO op FORTRAN
   elseif resultat EQ 110b
      ECHO op BASIC
   else
      AFFICHE resultat,%resultat            
   endif
   
   resultat = valueOpat and ReExtLab ;
   if resultat GT 0
      ECHO op 'References an external label'
   endif   
   
   resultat = valueOpat and RelativeSS ;
   if resultat GT 0
      ECHO op 'Is relative to SS'
   endif   
      
   resultat = valueOpat and NundefNoError ;
   if resultat GT 0
      ECHO op 'References had not undefined symbols and is without error'
   endif   

   resultat = valueOpat and RegisterValue;
   if resultat GT 0
      ECHO op 'Is a register value'
   endif      
   resultat = valueOpat and UseDirectMemAdr;
   if resultat GT 0
      ECHO op 'Uses direct memory addressing'
   endif
   resultat = valueOpat and ImmedValue;
   if resultat GT 0
      ECHO op 'Is an immediate value'
   endif
   resultat = valueOpat and MemVarRelocDat;
   if resultat GT 0
      ECHO op 'Is a memory variable or has a relocatable data label'
   endif                                                   
   
   resultat = valueOpat and CodeLab ;ReExtLab
   if resultat GT 0
      ECHO op 'References a code label'
   endif      
      
ENDM
Fa is a musical note to play with CL