Initialize Program Example - Epson E0C6001 Technical Manual

Cmos 4-bit single chip microcomputer
Table of Contents

Advertisement

2.2

Initialize Program Example

The following is a program that clears the RAM and LCD,
resets the flags, registers and timer, and sets the stack
pointer immediately after resetting the system.
Label
Mnemonic/operand
ORG
JP
;
ORG
INIT
RST
;
LD
RAMCLR LDPX
CP
JP
LD
LCDCLR LDPX
CP
JP
;
LD
LD
LD
LD
;
LD
OR
;
LD
OR
;
LD
OR
;
LD
LD
LD
LD
RST
EI
Comment
100H
INIT
;
Jump to "INIT"
110H
F,0011B
;
Interrupt mask, decimal
;
adjustment off
X,0
;
MX,0
;
XH,5H
;
NZ,RAMCLR
;
X,90H
;
MX,0
;
XH,0BH
;
NZ,LCDCLR
;
A,0
;
B,4
;
SPL,A
;
SPH,B
;
X,0F9H
;
MX,0100B
;
X,0EBH
;
MX,0111B
;
X,0E8H
;
MX,1111B
;
X,0
;
Y,0
;
A,0
;
B,0
;
F,0
;
;
Enable interrupt
CHAPTER 2: INITIAL RESET
Clear RAM (00H–4FH)
Clear LCD (90H–AFH)
Set stack pointer to 40H
Reset timer
Enable timer interrupt
Enable input interrupt
(K03–K00)
Reset register flags
II-11

Advertisement

Table of Contents
loading

Table of Contents