NEC PD754144 User Manual page 47

4-bit single-chip microcontrollers
Table of Contents

Advertisement

CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP
(1) To use as 4-bit registers
When the general-purpose register area is used as a 4-bit register area, a total of eight general-purpose
registers, X, A, B, C, D, E, H, and L, specified by RBE and RBS can be used as shown in Figure 3-5. Of these
registers, A plays a central role in transferring, operating, and comparing 4-bit data as a 4-bit accumulator.
The other registers can transfer, compare, and increment or decrement data with the accumulator.
(2) To use as 8-bit registers
When the general-purpose register area is used as an 8-bit register area, a total of eight 8-bit register pairs
can be used as shown in Figure 3-6: register pairs XA, BC, DE, and HL of a register bank specified by RBE
and RBS, and register pairs XA', BC', DE', and HL' of the register bank whose bit 0 is complemented in respect
to the register bank (RB). Of these register pairs, XA serves as an 8-bit accumulator, playing the central role
in transferring, operating, and comparing 8-bit data. The other register pairs can transfer, compare, and
increment or decrement data with the accumulator. The HL register pair is mainly used as a data pointer.
The DE and DL register pairs are also used as auxiliary data pointers.
Examples 1.
INCS
ADDS
SUBC
MOV
MOVT
SKE
2.
To test whether the value of the count register (T0) of timer counter 0 is greater than the value
of register pair BC' and, if not, to wait until it becomes greater
NO :
; Skips if HL ← HL+1, HL=00H
HL
; Skips if XA ← XA+BC and carry occurs
XA, BC
; DE' ← DE' – XA – CY
DE', XA
; XA ← XA'
XA, XA'
XA, @PCDE ; XA ← (PC
11–8
XA, BC
; Skips if XA = BC
CLR1
MBE
MOV
XA, T0
; Reads count register
XA, BC' ; XA ≥ BC' ?
SUBS
BR
YES
; YES
BR
NO
; NO
User's Manual U10676EJ3V0UM
+DE) ROM, table reference
47

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd754244

Table of Contents