27
CHAPTER 3 FEATURES OF THE ARCHITECTURE AND MEMORY MAP
Example 2. Eight-bit data is latched into the serial interface shift register (SIO), and the transfer data
is set at the same time.
SEL MB15 ; MBS <– 15
XCH XA,SIO ; XA <—> (SIO)
(4) 4-bit register indirect addressing (@rpa)
In this addressing mode, the pointer (general register pair) specified in the operand of an instruction
indirectly specifies a data memory space in units of four bits.
There are three types of data pointers. One is the HL register pair, which can specify any area in the data
memory space when MB = MBE·MBS is specified. The other two are the DE register pair and DL register
pair, with which memory bank 0 is always used regardless of how the MBE and MBS are specified. More
efficient programming is possible by selecting a data pointer according to a data memory bank to be used.
When the HL register pair is specified, the L register can be incremented or decremented by one in the
automatic increment or automatic decrement mode each time an instruction is executed, thus simplifying
the program step.
Example The data at 50H to 57H is transferred to 110H to 117H.
DATA1 EQU 57H
DATA2 EQU 117H
SET1 MBE ; MBE <– 1
SEL MB1 ; MBS <– 1
MOV D,#DATA1 SHR4 ; D <– 5
MOV HL,#DATA2 AND 0FFH ; HL <– 17H
LOOP: MOV A,@DL ; A <– (DL)
XCH A,@HL– ; A <—> (HL), L <– L – 1
BR LOOP
The addressing mode using the HL register pair as the data pointer finds a wide range of operations such
as data transfer, operations, comparison, and I/O. The addressing mode using the DE register pair or
DL register pair is applied to the MOV and XCH instructions.
This addressing mode, combined with an increment/decrement instruction for a general register or register
pair, enables data memory space addresses to be freely updated as shown in Figure 3-3.
Example 1. The data at 50H to 57H is compared with the data at 110H to 117H.
DATA1 EQU 57H
DATA2 EQU 117H
SET1 MBE
SEL MB1
MOV D,#DATA1 SHR4
MOV HL,#DATA2 AND 0FFH
LOOP: MOV A,@DL
SKE A,@HL ; A = (HL)?
BR NO ; NO
DECS L ; YES, L <– L – 1
BR LOOP