Example Of Using Register Banks - NEC PD754144 User Manual

4-bit single-chip microcontrollers
Table of Contents

Advertisement

CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP
<Main program>
SET1 RBE
SEL RB2
RB = 2
If RBS is to be changed in the course of subroutine processing or interrupt servicing, it must be saved or restored
by using the PUSH or POP instruction.
RBE is set by using the SET1 or CLR1 instruction. RBS is set by using the SEL instruction.
RBE ; RBE ← 1
Example
SET1
RBE ; RBE ← 0
CLR1
RB0 ; RBS ← 0
SEL
RB3 ; RBS ← 3
SEL
The general-purpose register area provided in the µ PD754244 can be used not only as 4-bit registers but also
as 8-bit register pairs. This feature allows the µ PD754244 to provide transfer, operation, comparison, and increment/
decrement instructions comparable to those of 8-bit microcontrollers and allows you to program using mainly general-
purpose registers.
46
Figure 3-4. Example of Using Register Banks
<Single interrupt>
<Nesting of two
; RBE = 0
in vector table
RB = 0
RB = 1
RETI
User's Manual U10676EJ3V0UM
<Nesting of three
interrupts> ; RBE = 1
interrupts> ; RBE = 0
in vector table
in vector table
PUSH BS
PUSH rp
SEL
RB1
RB = 0
POP BS
POP rp
RETI
RETI

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd754244

Table of Contents