The Netwide Assembler: NASM

Next Chapter | Previous Chapter | Contents | Index

Chapter 5: Standard Macro Packages

The %use directive (see section 4.6.4) includes one of the standard macro packages included with the NASM distribution and compiled into the NASM binary. It operates like the %include directive (see section 4.6.1), but the included contents is provided by NASM itself.

The names of standard macro packages are case insensitive, and can be quoted or not.

5.1 altreg: Alternate Register Names

The altreg standard macro package provides alternate register names. It provides numeric register names for all registers (not just R8-R15), the Intel-defined aliases R8L-R15L for the low bytes of register (as opposed to the NASM/AMD standard names R8B-R15B), and the names R0H-R3H (by analogy with R0L-R3L) for AH, CH, DH, and BH.

Example use:

%use altreg 

proc: 
      mov r0l,r3h                    ; mov al,bh 
      ret

See also section 11.1.

Next Chapter | Previous Chapter | Contents | Index