ST6208C/ST6209C/ST6210C/ST6220C
56/104
9 INSTRUCTIO N SET
9.1 ST6 ARCHITECTURE
The ST6 arch itecture has been designed for max -
imum efficiency while keeping byte usage to a
minimum; in short, to provide byte-efficient pro-
gramming. The ST6 core has the ability to set or
clear any register or RAM location bit in Data
space using a s ingle instruction. Furthermore, pro-
grams can branch to a selected address depend-
ing on the status of any bit in Dat a space.
9. 2 ADDRESSI NG MODES
The ST6 has nine addressing modes, which are
described in the following paragraphs. Three dif-
ferent address spaces are available: Program
space, Data space, and Stack space. Program
space contains t he inst ructions which are to be ex-
ecuted, plus t he data for immedi ate mo de in struc-
tions. Data space contains t he Accumulator, the X,
Y, V and W registers, peripheral and Input/Output
registers, the RA M lo cations and Data ROM l oca-
tions (for storage of tables and constants). Stack
space cont ains six 12-bi t RA M c ells used t o st ack
the return addresses for subroutines and inter-
rupts.
Immediate. In immediate addressing mode, the
operand of t he instruc tion fol lows the opcode loca-
tion. As the operand i s a ROM byte, the immediate
addressing mode is used to access constants
which do not change during program execution
(e.g., a constant used to initialize a loop counter).
Direct. In direct addres sing mode , the address of
the byte which is processed by the instruction is
stored in t he location which follows the opcode. Di-
rect addressing allows the user to directly address
the 256 bytes in Data Space mem ory with a single
two-byte instruction.
Short Direct. The core can address the four RAM
registers X, Y, V, W (locations 80h, 81h, 82h, 83h)
in short-direct addressing mode. In this case, the
instruction is only one byte and the sel ection of t he
location to be processed is contained in the op-
code. Short direct addressing is a su bset of direct
addressing mode. (Note that 80h and 81h are also
indi re ct registers).
Extended. I n extended addressin g mode, the 12-
bit address needed to d efine the instruction is ob-
tained by concatenating the four least significant
bits of the opcode with the byte following the op-
code. The instructions (JP, CALL) which use ex-
tended addressing mode are able to branch to any
address in the 4 Kbyte Program space.
Extended addressing mode instructions are two
bytes long.
Program Counter Relative. Relative addressing
mode is only used in conditional branch instruc-
tions. The instruction is used to perform a test and,
if the condition is true, a branc h with a span of -15
to +16 locations next to the address of the relative
instruction. If the condition is not true, the instruc-
ti o n w h ic h fo l lo ws t h e r el a ti ve i n st r uc t i on is exec ut -
ed. Relative addressing mode instructions are one
byte long. The opcode is obtained by adding the
three most significant bits which characterize the
test condi tion, one bit which determines whether it
is a forward branch (when it is 0) or backward
branch (wh en it is 1) and the fo ur least significant
bits which give the span of the branch (0h to Fh)
which must be added or subtracted from the ad-
dress of the relative instruction to obtain the
branch destinat ion address.
Bit Direct. I n bit direct addressing mode, the bit to
be set or cleared is part of the opcode, and the
byte fo llowing the opc od e points to the add ress of
the byte in which the specified bit must be set or
cleared. T hus, a ny bit in t he 25 6 locat ions of Dat a
space memory can be set or cleared.
Bit Test & Branch. Bit t est and branch addressing
mode is a combination of direct addressing and
relative addressing. Bit test and branch instruc-
tions are three bytes long. The bit identification
and the test condition are included in the opcode
byte. The address of the byte to be tes ted is given
in the next byte. The third byte is the jump dis-
placemen t, w hich is in the range of -127 to +128.
This displacement can be determined using a la-
bel, which is converted by the assembler.
Indirect. In indirect addressing mode, the byte
processed by the register-indirect instruction is at
the address pointed to by t he content of one of the
indirect registers, X or Y (80h, 81h). The indirect
register is selected by bit 4 of the opcode. Regis ter
indirect instructions are one byte long.
Inherent. I n inherent address ing mode, all the in-
formation necessary for executing the instruction
is contained in the opc ode. These i ns tructions are
one byte long.
1