EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

status32.htm
Macros
SetSt
RstSt
InvSt
JSt
JNSt

This file can be included to 32bit programs written in Euro Assembler. The library contains OS-independent macroinstructions for easy manipulation with the set of 1..32 boolean flags called Status. Status is usually declared as a static DWORD in data segment, but macros will as well operate with status in stack variable, structure member or when loaded in register. Should 32 flags be not enough, you can declare more Status DWORDs with different names in your program.

Programmer should define a symbol for each flag and equate it with individual weight (power of 2).

Similar macros with identical names for different program width are defined in status16.htm


status HEAD
SetSt Status, Flag
Set the flag bit in Status DWORD to 1.
Input
Status is DWORD [variable] or register.
Flag is constant symbol with value equal to power of two. More than one flag may be set simultaneously, for instance SetSt [EBX],stFlag1 | stFlag2.
Output
Registers unchanged, CF=0.
SetSt %MACRO Status, Flag
        OR %Status,%Flag, DATA=DWORD
      %ENDMACRO SetSt
RstSt Status, Flag
Reset the Flag bit in Status DWORD to 0.
Input
Status is DWORD [variable] or register.
Flag is constant symbol with value equal to power of two. More than one flag may be reset simultaneously.
Output
Registers unchanged, CF=0.
RstSt %MACRO Status, Flag
         AND %Status,~(%Flag), DATA=DWORD,IMM=DWORD
      %ENDMACRO RstSt
InvSt Status, Flag
Invert the Flag bit in Status DWORD.
Input
Status is DWORD [variable] or register.
Flag is constant symbol with value equal to power of two. More than one flag may be inverted simultaneously.
Output
Registers unchanged, CF=0.
InvSt %MACRO Status, Flag
       XOR %Status,%Flag, DATA=DWORD
     %ENDMACRO InvSt
JSt Status, Flag, Target
Jump to the Target if the Status Flag bit is set to 1.
Input
Status is DWORD [variable] or register.
Flag is constant symbol with value equal to power of two.
When more than one ORed flags are specified, the jump is taken if at least one flag is set.
Target is short or near code position (label) to be jumped to.
Output
Registers unchanged, CF=0.
JSt  %MACRO Status, Flag, Target
       TEST %Status,%Flag, DATA=DWORD
       JNZ %Target
     %ENDMACRO JSt
JNSt Status, Flag, Target
Jump to the Target if the Status Flag bit is reset to 0.
Input
Status is DWORD [variable] or register.
Flag is constant symbol with value equal to power of two.
When more than one ORed flags are specified, the jump is taken only if all flags are reset.
Target is short or near code position (label) to be jumped to.
Output
Registers unchanged, CF=0.
JNSt %MACRO Status, Flag, Target
       TEST %Status,%Flag, DATA=DWORD
       JZ %Target
     %ENDMACRO JNSt
 ENDHEAD status

▲Back to the top▲