CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP
37
User’s Manual U10676EJ3V0UM
(2) 4-bit direct addressing (mem)
This addressing mode is used to directly address the entire memory space in 4-bit units by using the operand
of an instruction.
Like the 1-bit direct addressing mode, the area that can be addressed is fixed to the data area of addresses
000H to 07FH and the peripheral hardware area of F80H to FFFH in the mode of MBE = 0. In the mode of
MBE = 1, MB = MBS, and the entire data memory space can be addressed.
This addressing mode is applicable to the MOV, XCH, INCS, IN, and OUT instructions.
(3) 8-bit direct addressing (mem)
This addressing mode is used to directly address the entire data memory space in 8-bit units by using the
operand of an instruction.
The address that can be specified by the operand is an even address. The 4-bit data of the address specified
by the operand and the 4-bit data of the address higher than the specified address are used in pairs and
processed in 8-bit units by the 8-bit accumulator (XA register pair).
The memory bank that is addressed is the same as that addressed in the 4-bit direct addressing mode.
This addressing mode is applicable to the MOV, XCH, IN, and OUT instructions.
(4) 4-bit register indirect addressing (@rpa)
This addressing mode is used to indirectly address the data memory space in 4-bit units by using a data pointer
(a pair of general-purpose registers) specified by the operand of an instruction.
As the data pointer, three register pairs can be specified: HL that can address the entire data memory space
by using MBE and MBS, and DE and DL that always address memory bank 0, regardless of the specification
by MBE and MBS. The user selects a register pair depending on the data memory bank to be used in order
to carry out programming efficiently.
When register HL is specified, auto increment/decrement mode can be used. This mode is used to increment
or decrement register L automatically by 1 at the same time as each instruction is executed, therefore it can
reduce the number of program steps.
Example To transfer data 50H to 57H to addresses 60H to 67H
DATA1 EQU 57H
DATA2 EQU 67H
SET1 MBE
SEL MB0
MOV D, #DATA1 SHR4
MOV HL, #DATA2 AND 0FFH ; HL 17H
LOOP : MOV A, @DL ; A (DL)
XCH A, @HL ; A (HL)
DECS L ; L L – 1
BR LOOP
The addressing mode that uses register pair HL as the data pointer is widely used to transfer, operate, compare,
and input/output data. The addressing mode using register pair DE or DL is used with the MOV and XCH instructions.
By using this addressing mode in combination with the increment/decrement instruction of a general-purpose
register or a register pair, the addresses of the data memory can be updated as shown in Figure 3-3.