3.2.1 Register Operands

A register operand specifies that the value in a particular register is an operand. Code for the register or registers used in operands is encoded into the instruction at assembly time.

Register operands can be used anywhere you need an operand. The following examples show typical register operands:

mov bx, 10 ; Load constant to BX

add ax, bx ; Add AX and BX

jmp di ; Jump to the address in DI

Summary: Register operands have a specific use related to addresses.

An offset stored in a base or index register is often used as a pointer into memory. An offset can be stored in one of the base or index registers; the register can then be used as an indirect memory operand (see Section 3.2.4). For example:

mov [bx], dl ; Store DL in indirect memory operand

inc bx ; Increment register operand

mov [bx], dl ; Store DL in new indirect memory operand

This example moves the value in DL to two consecutive bytes of a memory location pointed to by BX. Any instruction that changes the register value also changes the data item pointed to by the register.