HMS87C5216 ETC1 [List of Unclassifed Manufacturers], HMS87C5216 Datasheet - Page 18

no-image

HMS87C5216

Manufacturer Part Number
HMS87C5216
Description
CMOS SINGLE-CHIP 8-BIT MICROCONTROLLER FOR UR(Universal Remocon) & WIRELESS KEYBOARD
Manufacturer
ETC1 [List of Unclassifed Manufacturers]
Datasheet
HMS87C5216
9. MEMORY ORGANIZATION
The HMS87C5216 have separate address spaces for Program
memory and Data Memory. Program memory can only be read,
not written to. It can be up to 16K bytes of Program memory.
9.1 Registers
This device has six registers that are the Program Counter (PC),
a Accumulator (A), two index registers (X, Y), the Stack Pointer
(SP), and the Program Status Word (PSW). The Program Counter
consists of 16-bit register.
Accumulator: The Accumulator is the 8-bit general purpose reg-
ister, used for data operation such as transfer, temporary saving,
and conditional judgement, etc.
The Accumulator can be used as a 16-bit register with Y Register
as shown below.
X, Y Registers: In the addressing mode which uses these index
registers, the register contents are added to the specified address,
which becomes the actual address. These modes are extremely ef-
fective for referencing subroutine tables and memory tables. The
index registers also have increment, decrement, comparison and
data transfer functions, and they can be used as simple accumula-
tors.
Stack Pointer: The Stack Pointer is an 8-bit register used for oc-
currence interrupts and calling out subroutines. Stack Pointer
Figure 9-2 Configuration of YA 16-bit Register
Two 8-bit Registers can be used as a “YA” 16-bit Register
PCH
Figure 9-1 Configuration of Registers
Y
A
PSW
PCL
SP
A
X
Y
Y
ACCUMULATOR
X REGISTER
Y REGISTER
STACK POINTER
PROGRAM COUNTER
PROGRAM STATUS
WORD
A
Data memory can be read and written to up to 320 bytes including
the stack area.
identifies the location in the stack to be accessed (save or restore).
Generally, SP is automatically updated when a subroutine call is
executed or an interrupt is accepted. However, if it is used in ex-
cess of the stack area permitted by the data memory allocating
configuration, the user-processed data may be lost.
The stack can be located at any position within 100
the internal data memory. The SP is not initialized by hardware,
requiring to write the initial value (the location with which the use
of the stack starts) by using the initialization routine. Normally,
the initial value of “17F
Note: The Stack Pointer must be initialized by software be-
cause its value is undefined after RESET.
Example: To initialize the SP
Program Counter: The Program Counter is a 16-bit wide which
consists of two 8-bit registers, PCH and PCL. This counter indi-
cates the address of the next instruction to be executed. In reset
state, the program counter has reset routine address (PC
PC
Program Status Word: The Program Status Word (PSW) con-
tains several bits that reflect the current state of the CPU. The
PSW is described in Figure 9-3. It contains the Negative flag, the
Overflow flag, the Break flag the Half Carry (for BCD opera-
tion), the Interrupt enable flag, the Zero flag, and the Carry flag.
[Carry flag C]
This flag stores any carry or borrow from the ALU of CPU after
an arithmetic operation and is also changed by the Shift Instruc-
tion or Rotate Instruction.
[Zero flag Z]
This flag is set when the result of an arithmetic operation or data
transfer is “0” and is cleared by any other result.
L
:0FE
LDX
TXSP
H
15
).
Hardware fixed
Stack Address (100
#07FH
1
H
” is used.
8
7
H
; SP
~17F
SEP. 2004 Ver 1.01
H
SP
)
7F
H
0
H
to 17F
H
:0FF
H
of
H
,

Related parts for HMS87C5216