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

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
4.2
The loading and storing instructions are listed in Table 4.3.
On the ST20, the term loading means pushing a value onto the evaluation stack. The
value to be loaded may be a value read from memory, a constant, a copy of another
register or a calculated value. Storing means popping a value from the evaluation
stack. The value may be written into memory or written into another register. The eval-
uation stack is described in section 3.3, and evaluation of expressions is described in
section 4.3.
Relative addresses are used for accessing memory in order to reduce code size, as
the operand values are smaller than full machine addresses. Data structures are
word-aligned, so relative addresses can be word offsets, reducing the operand size
further.
The most common operations performed by a program are loading and storing of a
small number of variables, and loading small literal values.
4.2.1
One primary instruction ldc is provided for loading a general constant, for initializing a
variable or register or for a constant in an expression.
4.2.2
When loading from and storing to memory, the ST20 distinguishes between local and
non-local addressing. Local addressing means that the address is given as a word
offset from the Wptr. Non-local addressing means that the address is given as a word
offset from the Areg. In practice, the Wptr points to the stack, so local addressing is
ldc n
ldl n
stl n
ldnl n
stnl n
lbinc
sbinc
lsinc
lsxinc
ssinc
lwinc
swinc
Mnemonic
Loading and storing
Loading constants
Local and non-local variables
load constant
load local
store local
load non-local
store non-local
load byte and increment
store byte and increment
load sixteen and increment
load sixteen sign extended
and increment
store sixteen and increment Store a half word and increment the address by 2 bytes.
load word and increment
store word and increment
Name
Table 4.3 Loading and storing instructions
Load the constant n .
Load the value from
Store a value to
Load the value from
Store a value to
Load a byte and increment the address by 1 byte.
Store a byte and increment the address by 1 byte.
Load a half word and increment the address by 2 bytes.
Load a half word and sign extend to 32 bits and increment
the address by 2 bytes.
Load a word and increment the address by 4 bytes.
Store a word and increment the address by 4 bytes.
n
n
words above
words above
4 Using ST20-C1 instructions
n
n
Description
words above
words above
Wptr
Areg
Wptr
Areg
.
.
.
.
31/205

Related parts for ST20-C1