Notes On Using The General-Purpose Register - NEC PD17062 Datasheet

Mos integrated circuit 4-bit single-chip microcontroller containing pll frequency synthesizer and image display controller
Table of Contents

Advertisement

6.4 NOTES ON USING THE GENERAL-PURPOSE REGISTER

This section provides notes on using the general-purpose register, referring to the following example:
Example
AND
RPL,
OR
RPL,
MOV BANK, #0000B
LD
04H, 32H
Executing the above instructions loads the contents of address 32H of BANK0 data memory into address
24H in the general-purpose register of BANK0.
In the above example, the general-purpose register is allocated in row address 2H of BANK0, so that the
address of the general-purpose register specified in r in instruction LD r, m is address 24H of BANK0. The
data memory address specified in m is address 32H of BANK0. (See Fig. 6-5.)
Note that it is necessary to code an actual data memory address, for example, 24H, as the value specified
in r when using the assembler. In this case, only the low-order four bits are needed as the value for r, so the
assembler ignores value 2H, which is a row address. Thus, executing instruction LD 24H, 32H produces the
same result as executing the instruction in the above example.
If, when using the assembler, the address of the general-purpose register is specified directly in an operand
of an instruction, as shown below, an error occurs.
Instruction that causes an error
LD
04H,
Most commonly used method
R1
MEM
M1
MEM
LD
R1,
Executing the following instructions produces the same result as executing the instructions in
R1 and R2 are assigned the same column address.
R2
MEM
M1
MEM
LD
R2,
46
#000B
; RP
0000010B
#0100B
;
; BANK0
32H
; The address of the general-purpose register is coded as 04.
0.04H
;
#
0.32H
;
R1 and M1 are defined as memory-type addresses, and are
M1
;
assigned addresses 04H and 32H of BANK0, respectively.
0.34H
0.32H
M1
PD17062
#
because

Advertisement

Table of Contents
loading

Table of Contents