HMCS47C,HMCS47CL------------------------------------------
__________
___
Branch
to
Bank 0
•
LAI
15
r--LRA
7
~-.LPU
5
~
BR
3F
)
•
LAI
15
LBA
r--LRA
:
COMB
'-.LPU
31'
BR
3F
J'
Branch
to
Bank 1
LAI
0
~--
LRA
7
·-·LPU
15
'
BR
3F
!
LAI
0
LTA
'-"-LRA 7
:
LVI
2
, XMA
~·.LPU
10 '
BR
2E ;
R70
.,
"1"
(R,o ..
"0")
BRL
5-3F
(Branch
to
Bank 0 5·3F (5·3FII
R,o
=
"1"
(R,o =
"0")
BRL
31-3F
(Branch
to
Bank 0 31·3F (31-3FII
R,o =
"0"
(R,o =
"1")
BRL
15-3F
(Branch
to
Bank 1 15-3F (47-3F»
R,o
=
"0"
(R,o =
"1")
BRL
10·2E
(Branch
to
Bank 1 10-2E (42-2EII
Figure 8
BRL
Example
• SUBROUTINE
JUMP
There are two types.
of
subroutine jumps. They are explained
in
the following paragraphs.
•
CAL
By
CAL instruction, subroutine jump
to
the Subroutine
Space
is
performed.
The Subroutine
Space
is
the Bank 0 0
Page
(0 Page).
The address next
to
CAL instruction address
is
pushed onto
the
Stack STl and the contents
of
the stacks
STl,
ST2 and ST3
are pushed onto the stacks ST2, ST3 and ST4 respectively
as
shown in Figure
10.
The bank part
of
the program counter becomes the Bank 0
and the page part becomes the 0 Page. The lower 6 bits (operand
a,
06 to
01)
of
the
ROM
Object Code
is
transferred
to
the
ad-
dress part
of
the program counter.
The
HMCS4
7C
has 4 levels
of
stack
(STl,
ST2, ST3 and ST4)
which allows the programmer to
use
up
to
4 levels
of
subroutine
jumps (including interrupts).
CAL
is
a conditional instruction and executed only when the
Status
F/F
is
"1".
If
the Status
F/F
is
"0",
it
is
skipped and the
Status
F/F
changes
to
"1",
•
CALL
By
CALL instruction, subroutine jump to an address in any
bank and page
is
performed.
Table 4
Bank
Part Truth Table
of
TBR
Instruction
Subroutine jump
to
any address can be implemented by the
subroutine jump
to
the page specified by
LPU
instruction in the
bank designated
by
the reversed-phase signal
R70
of
the Data
I/O Register R
7o
.
PCIt
1 (Bank 1)
o (Bank 0)
P2
Bank Part
of
PC
after
TBR
1
1 (Bank 1)
0
1 (Bank 1)
1
1 (Bank 1)
0
o (Bank
0)
I
(Page
Partl \
This instruction
is
a macro instruction
of
LPU
and CAL
instructions, which
is
divided into two instructions
as
follows.
CALL
a·b - LPU a
CAL
b
< Subroutine Jump
to
Bank
"R
70
",
a
Page
- b Address>
CALL instruction
is
conditional because
of
characteristics of'
LPU
and CAL instructions and
is
executed when the Status F
IF
is
"1".
If
the Status F
IF
is
"0",
the instruction
is
skipped and
the
Status F
/F
changes
to
"1".
The examples
of
CALL instruc-
tion are shown in Figure
11.
Ban~a!\.
r---
Page
Part
~
r---
Address Part
~
(PC)
(PC
after TBR
Instruction)
Figure 9 Modification of Program Counter by
TBR
Instruction
120