MASM32 Downloads
fSlvB macro Expression:=< >, AuxReg tk_dest TEXTEQU <> tk_exp TEXTEQU <> tk_op TEXTEQU <> tk_op1 = 0 tk_op2 = 0 FORC char,<&Expression> IF tk_op2 EQ 0 tk_switch INSTR 1,<&|^{}>,<&char> IF tk_switch EQ 0 IF tk_op1 EQ 0 tk_dest CATSTR tk_dest,<&char> ELSE tk_switch2 INSTR 1,<=>,<&char> IF tk_switch2 EQ 1 IF tk_op1 EQ 1 tk_op1 = 2 tk_op CATSTR tk_op,<&char> tk_op2 = 1 ELSE .err A2052 invalid compound operator ENDIF ELSE IF tk_op1 EQ 0 tk_dest CATSTR tk_dest,tk_op tk_op TEXTEQU <> tk_dest CATSTR tk_dest,<&char> tk_op1 = 0 ELSE .err A2052 invalid bitwise operator ENDIF ENDIF ENDIF ELSE IF tk_op1 EQ 0 tk_op1 = 1 tk_op CATSTR tk_op,<&char> tk_switch3 = tk_switch ELSE tk_switch2 INSTR 1,<{}>,<&char> IF tk_switch2 GT 0 tk_is INSTR 1, tk_op, <&char> IF tk_is EQ 1 tk_op2 = 1 ELSE .err A2052 invalid compound operator ENDIF ELSE .err A2052 invalid compound operator ENDIF ENDIF ENDIF ELSE tk_exp CATSTR tk_exp,<&char> ENDIF ENDM IF tk_switch3 EQ 1 tk_op3 TEXTEQU <and> ELSEIF tk_switch3 EQ 2 tk_op3 TEXTEQU <or> ELSEIF tk_switch3 EQ 3 tk_op3 TEXTEQU <xor> ELSEIF tk_switch3 EQ 4 tk_op3 TEXTEQU <shl> ELSEIF tk_switch3 EQ 5 tk_op3 TEXTEQU <shr> ENDIF ifnb <&AuxReg> _eax textequ <&AuxReg> else if @WordSize eq 8 _eax textequ <r10> else _eax textequ <eax> endif endif IF (OPATTR(tk_dest)) and 00010000y ;; register tk_op3 tk_dest , tk_exp ELSEIF (OPATTR(tk_dest)) and 00000100y ;; inmediate .err A2052 invalid bit operation on inmediate ELSE mov _eax, tk_dest IF tk_switch3 LT 4 tk_op3 _eax , tk_exp ELSE IF (OPATTR(tk_exp)) and 00000100y ;; inmediate tk_op3 _eax , tk_exp ELSE mov ecx, tk_exp tk_op3 _eax , cl ENDIF ENDIF mov tk_dest, _eax ENDIFendm
item dd 0 res1 dd 0 res2 dw 0 BIT equ 10
fSlvB eax ^= BITxor eax , BIT------------------------------fSlvB res2 &= BIT, dxmov dx, res1and dx , BITmov res1 , dx------------------------------fSlvB res1 |= itemmov eax, res1or eax , itemmov res1 , eax------------------------------fSlvB BIT &= 5... : error A2008: syntax error : invalid bit operation on inmediate
fSlvB eax {{ BITshl eax , BIT ------------------------------fSlvB res1 {{ BITmov eax, res1shl eax , BITmov res1 , eax ------------------------------fSlvB res1 }} itemmov eax, res1mov ecx, itemshr eax , clmov res1 , eax
JJ will start sobbing if you use this notation.
Quote from: hutch-- on July 28, 2020, 12:35:26 PMJJ will start sobbing if you use this notation. Confirmed!
... when I built a wrapper around Vasily's ".if" notation ....
Its really easy to read and completely removes any ugly notation.