Skip to content

Latest commit

 

History

History
181 lines (161 loc) · 5.79 KB

operators-reference.md

File metadata and controls

181 lines (161 loc) · 5.79 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: MASM Operators reference
MASM Operators reference
07/15/2020
MASM (Microsoft Macro Assembler), operators reference
operators [MASM]
c069cab7-d6b0-4f82-a6ce-0ca3fc7e6428

MASM Operators reference

Arithmetic

:::row::: :::column span=""::: * (multiply)
+ (add)
- (subtract or negate) :::column-end::: :::column span=""::: . (field)
/ (divide) :::column-end::: :::column span=""::: [] (index)
MOD (remainder) :::column-end::: :::row-end:::

Control Flow

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

Logical and Shift

:::row::: :::column span=""::: AND (bitwise and)
NOT (bitwise not) :::column-end::: :::column span=""::: OR (bitwise or)
SHL (shift bits left) :::column-end::: :::column span=""::: SHR (shift bits right)
XOR (bitwise exclusive or) :::column-end::: :::row-end:::

Macro

:::row::: :::column span=""::: ! (character literal)
% (treat as text) :::column-end::: :::column span=""::: ;; (treat as comment)
< > (treat as one literal) :::column-end::: :::column span=""::: & & (substitute parameter value) :::column-end::: :::row-end:::

Miscellaneous

:::row::: :::column span=""::: ' ' (treat as string)
" " (treat as string)
: (local label definition) :::column-end::: :::column span=""::: :: (register segment and offset)
:: (global label definition) :::column-end::: :::column span=""::: ; (treat as comment)
DUP (repeat declaration) :::column-end::: :::row-end:::

Record

:::row::: :::column span=""::: MASK (get record or field bitmask) :::column-end::: :::column span="2"::: WIDTH (get record or field width) :::column-end::: :::row-end:::

Relational

:::row::: :::column span=""::: EQ (equal)
GE (greater or equal) :::column-end::: :::column span=""::: GT (greater than)
LE (less or equal) :::column-end::: :::column span=""::: LT (less than)
NE (not equal) :::column-end::: :::row-end:::

Segment

:::row::: :::column span=""::: : (segment override)
:: (register segment and offset)
IMAGEREL (image relative offset) :::column-end::: :::column span=""::: LROFFSET (loader resolved offset)
OFFSET (segment relative offset) :::column-end::: :::column span=""::: SECTIONREL (section relative offset)
SEG (get segment) :::column-end::: :::row-end:::

Type

:::row::: :::column span=""::: 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) :::column-end::: :::column span=""::: LOW32 (low 32 bits)
LOWWORD (low 16 bits)
OPATTR (get argument type info)
PTR (pointer to or as type)
SHORT (mark short label type) :::column-end::: :::column span=""::: SIZE (size of type or variable)
SIZEOF (size of type or variable)
THIS (current location)
TYPE (get expression type)
.TYPE (get argument type info) :::column-end::: :::row-end:::

See also

Microsoft Macro Assembler Reference
MASM BNF Grammar