ST20-C1 STMICROELECTRONICS [STMicroelectronics], ST20-C1 Datasheet - Page 26

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
3.4 Instruction encoding
One or more prefixing components may be needed to create the full instruction data
value. The prefixes are shown in Table 3.4 and explained below.
All instruction components initially load the four data bits into the least significant four
bits of the instruction data value.
pfix loads its four data bits into the instruction data value, and then shifts this value up
four places. Consequently, a sequence of one or more prefixes can be used to extend
the data value of the following instruction to any positive value. Instruction data values
in the range 16 to 255 can be represented using one pfix .
nfix is similar, except that it complements all 32 bits of the instruction data value before
shifting it up, thus changing the sign of the instruction data value. Consequently, a
sequence of one or more pfix es with one nfix can be used to extend the data value of
a following instruction to any negative value. Instruction data values in the range -256
to -1 can be represented using one nfix .
When the processor encounters an instruction component other than pfix or nfix , it
loads the 4-bit data field into the instruction data value. The instruction encoding is
now complete and the instruction can be executed. The instruction data value is then
cleared so that the processor is ready to fetch the next instruction component, by
building a new instruction data value.
For example, to load the constant 0x11, the instruction ldc 0x11 is encoded with the
sequence:
The instruction ldc 0x2A68 is encoded with the sequence:
The instruction ldc -1 is encoded with the sequence:
3.4.3
Research has shown that computers spend most time executing a small number of
instructions such as:
For efficiency, in the ST20 these are encoded directly as primary instructions using
the function field of an instruction component.
Thirteen of the instruction components are used to encode the most important opera-
tions performed by any computer executing a high level language. These are used (in
conjunction with zero or more prefixes) to implement the primary instructions. Primary
instructions interpret the instruction data value as an operand for the instruction. The
mnemonic for a primary instruction always includes this operand, shown in this
manual as n .
26/205
pfix 1; ldc 1
pfix 2; pfix A; pfix 6; ldc 8
nfix 0; ldc F
Primary Instructions
instructions to load and store from a small number of ‘local’ variables;
instructions to add and compare with small constants; and
instructions to jump to or call other parts of the program.

Related parts for ST20-C1