MOV loc16, #16bit
6-164
MOV loc16, #16bit Save 16-bit Constant
SYNTAX OPTIONS OPCODE OBJMODE RPT CYC
MOV loc16, #16bit 0010 1000 LLLL LLLL
CCCC CCCC CCCC CCCC
X Y N+1
Operands loc16 Addressing mode (see Chapter 5)
#16bit 16-bit constant immediate value
Description Load the location pointed to by the “loc16” addressing mode with the 16-bit
constant immediate value:
[loc16] = 16bit;
Note: For #16bit = #0, see the MOV loc16, #0 instruction on page 6-166.
Smart Encoding:
If loc16 = AL or AH and #16bit is an 8-bit number, then the assembler will
encode this instruction as MOVB AX, #8bit to improve efficiency. To override
this, use the MOVW AX, #16bit alias instruction.
Flags and
Modes
N
If (loc16 = @AX), then the load to AX is tested for a negative condition. The
negative flag bit is set if bit 15 of AX is 1, otherwise it is cleared.
Z
If (loc16 = @AX), then the load to AX is tested for a zero condition. The bit is
set if the result of the operation on the AX register generates a 0 value,
otherwise it is cleared.
Repeat This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
Example
; Initialize the contents of Array1 with 0xFFFF:
; int16 Array1[N];
; for(i=0; i < N; i++)
; Array1[i] = 0xFFFF;
MOVL XAR2,#Array1 ; XAR2 = pointer to Array1
RPT #(N−1) ; Repeat next instruction N times
||MOV *XAR2++,#0xFFFF ; Array1[i] = 0xFFFF,
; i++