Samsung KS57C2308 Manual page 12

Single-chip cmos microcontroller
Table of Contents

Advertisement

ADDRESS SPACES
INSTRUCTION REFERENCE AREA
Using 1-byte REF instructions, you can easily reference instructions with larger byte sizes that are stored in
addresses 0020H–007FH of program memory. This 96-byte area is called the REF instruction reference area, or
look-up table. Locations in the REF look-up table may contain two 1-byte instructions, one 2-byte instruction, or
one 3-byte instruction such as a JP (jump) or CALL. The starting address of the instruction you are referencing
must always be an even number. To reference a JP or CALL instruction, it must be written to the reference area
in a two-byte format: for JP, this format is TJP; for CALL, it is TCALL.
By using REF instructions you can execute instructions larger than one byte, In summary, there are three ways
you can use the REF instruction:
— Using the 1-byte REF instruction to execute one 2-byte or two 1-byte instructions,
— Branching to any location by referencing a branch instruction stored in the look-up table,
— Calling subroutines at any location by referencing a call instruction stored in the look-up table.
+ +
PROGRAMMING TIP — Using the REF Look-Up Table
Here is one example of how to use the REF instruction look-up table:
ORG
JMAIN
TJP
KEYCK
BTSF
WATCH
TCALL
INCHL
LD
INCS
HL
ABC
LD
ORG
MAIN
NOP
NOP
REF
REF
REF
REF
REF
2-4
0020H
MAIN
KEYFG
CLOCK
@HL,A
EA,#00H
0080H
KEYCK
JMAIN
WATCH
INCHL
ABC
; 0, MAIN
; 1, KEYFG CHECK
; 2, CALL CLOCK
; 3, (HL)
A
; 47, EA
#00H
; BTSF KEYFG (1-byte instruction)
; KEYFG = 1, jump to MAIN (1-byte instruction)
; KEYFG = 0, CALL CLOCK (1-byte instruction)
; LD @HL,A
; INCS HL
; LD EA,#00H (1-byte instruction)
KS57C2308/P2308/C2316/P2316

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents