![](http://datasheet.mmic.net.cn/290000/HMS77C2000_datasheet_16134699/HMS77C2000_27.png)
HMS77C2000/2001
24
Nov. 2002 Ver 1.1
9.6.1 EFFECTS OF RESET
The program counter is set upon a RESET, which means
that the PC addresses the last location in the last page i.e.,
the oscillator calibration instruction. After executing
MOVLW XX
, the PC will roll over to location 00
H
, and be-
gin executing user code.
The STATUS register page preselect bits are cleared upon
a RESET, which means that page 0 is preselected.
Therefore, upon a RESET, a
GOTO
instruction will auto-
matically cause the program to jump to page 0 until the val-
ue of the page bits is altered.
9.7 STACK
The HMS77C2000 and HMS77C2001 devices have a 12-
bit wide L.I.F.O. hardware push/pop stack.
A
CALL
instruction will push the current value of stack
into stack 2 and then push the current program counter val-
ue, incremented by one, into stack level 1. If more than two
sequential ‘
CALL
’s are executed, only the most recent two
return addresses are stored.
A
RETLW
instruction will pop the contents of stack level
into the program counter and then copy stack level 2 con-
tents into level 1. If more than two sequential ‘
RETLW
’s
are executed, the stack will be filled with the address pre-
viously stored in level 2. Note that the W register will be
loaded with the literal value specified in the instruction.
This is particularly useful for the implementation of data
look-up tables within the program memory.
Upon any reset, the contents of the stack remain un-
changed, however the program counter (PCL) will also be
reset to 0.
Note:
There are no STATUS bits to indicate stack over-
flows or stack underflow conditions.
There are no instructions mnemonics called PUSH
or POP. These are actions that occur from the exe-
cution of the
CALL
and
RETLW
instructions.
FIGURE 9-9 PROGRAM COUNTER
Bit 9
:
Page select bit, provided by PA0 bit of STATS register (HMS77C2001)
1 = Page 1 (200
H
~ 3FF
H
)
0 = Page 0 (000
H
~ 1FF
H
)
Bit 8
:
Half-page select bit, provided by
GOTO
instruction (HMS77C2000, HMS77C2001)
or cleared when
CALL
or any modify-PCL instruction are executed.
1 = Half page 1 (200
H
~ 2FF
H
)
0 = Half page 0 (000
H
~ 0FF
H
)
Bit 7 ~ 0
:
PCL register
Device
HMS77C2000
HMS77C2001
-
PC8
Bit 9 Bit 8
Bit 7 Bit 6 Bit 5
Bit 4 Bit 3
Bit 2 Bit 1
Bit 0 Value on reset Value after reset
PCL
PCL
01 1111 1111
11 1111 1111
11 1111 1111
11 1111 1111
PC8
PC9