MASM Operators Reference

Arithmetic

* (multiply) + (add) - (subtract or negate)
. (field) / (divide) [] (index)
MOD (remainder)

Control Flow

! (runtime logical not) != (runtime not equal) || (runtime logical or)
&& (runtime logical and) < (runtime less than) <= (runtime less or equal)
== (runtime equal) > (runtime greater than) >= (runtime greater or equal)
& (runtime bitwise and)
CARRY? (runtime carry test) OVERFLOW? (runtime overflow test) PARITY? (runtime parity test)
SIGN? (runtime sign test) ZERO? (runtime zero test)

Logical and Shift

AND (bitwise and) NOT (bitwise not) OR (bitwise or)
SHL (shift bits left) SHR (shift bits right) XOR (bitwise exclusive or)

Macro

! (character literal) % (treat as text)
;; (treat as comment) < > (treat as one literal) & & (substitute parameter value)

Miscellaneous

' ' (treat as string) " " (treat as string)
: (local label definition) :: (register segment and offset) :: (global label definition)
; (treat as comment) DUP (repeat declaration)

Record

MASK (get record or field bitmask) WIDTH (get record or field width)

Relational

EQ (equal) GE (greater or equal) GT (greater than)
LE (less or equal) LT (less than) NE (not equal)

Segment

: (segment override) :: (register segment and offset)
IMAGEREL (image relative offset) LROFFSET (loader resolved offset)
OFFSET (segment relative offset) SECTIONREL (section relative offset)
SEG (get segment)

Type

HIGH (high 8 bits of lowest 16 bits) HIGH32 (high 32 bits of 64 bits) HIGHWORD (high 16 bits of lowest 32 bits)
LENGTH (number of elements in array) LENGTHOF (number of elements in array) LOW (low 8 bits)
LOW32 (low 32 bits) LOWWORD (low 16 bits) OPATTR (get argument type info)
PTR (pointer to or as type) SHORT (mark short label type) SIZE (size of type or variable)
SIZEOF (size of type or variable) THIS (current location) TYPE (get expression type)
.TYPE (get argument type info)

See also

Microsoft Macro Assembler Reference