EasyManua.ls Logo

Hitachi AP1 - Page 96

Hitachi AP1
378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
HMCS46C,HMCS~CL----------------------------------------------
______
_
Branch
to
Bank 0
LAI
16
·--LRA
7
~-.LPU
6
~
BR
3F
J
LAI
16
LBA
·--LRA
7
:
COMB
L-_LPU
31
~
BR
3F
j
R,o
"1"
(R'O
"0"1
BRL 6-3F
(Branch
to
Bank 0 5-3F (6-3FII
R,o ,.
"1"
(R'O "0"1
BRL 31-3F
(Branch
to
Bank 0 31-3F (31-3FII
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.
Branch
to
Bank 1
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
address part
of
the program counter.
LAI
0
r--LRA
7
~-.LPU
16'
BR
3F
J
LAI
0
LTA
.--LRA
7
:
LVI
3
I
XMA
~-·LPU
10
~
BR
2E j
R,o
"0"
(R,o - "1"1
BRL 16-3F
(Branch
to
Bank 1 16-3F (47-3FII
R,o ,.
"0"
(R,o ,. "1"1
BRL 10-2E
(Branch
to
Bank 1 10-2E (42-2EII
Figure 8
BRL
Example
The
HMCS46C
has 4 levels
of
stack
(S1I,
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
"I".
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
R?O
of
the Data
I/O Register
R?O.
This instruction
is
a macro instruction
of
LPU
and CAL
instructions, which
is
divided into two instructions
as
follows.
PC
..
P2
Bank Part
of
PC
after
TBR
1 (Bank
11
1
1
(Bank
1)
0
1 (Bank
11
CALL
a-b_LPU
a
CAL b
1
1
(Bank
11
o (Bank
01
0
o (Bank
01
< SubroutineJump
to
Bank
"R7o
",
a
Page
- b
Address>
SUBROUTINE JUMP
CALL instruction is conditional because
of
characteristics
of
LPU
and CAL instructions, and
is
executed when the Status
F/F
is
"1"
If
the Status
F/F
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.
There are two types
of
subroutine jumps. They are explained
in the following paragraphs.
/ (Page Pard \
Ban~a;
r--
Page Part
~;---
Address Part
~
(PCI PC..
PC..
PC. PC,
PC,
PC.
PC
s
PC.
PC,
PC
2
PC. PC.
'--'-T-
(Modification) I P2
p.
p.
C
B,
B2
B.
B.
I
A,
:
A2
: A. :
A.
I
L _
~
_
~
_
~
__
~
__
L-
__
L-~~~_L-~_~-L_~-L
___
~.
(PC
after
TBR
Instructionl
Figure 9 Modification of Program Counter
by
TBR
Instruction
94