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

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
constant from the n th entry in the constant table stored at address constants_ptr the
following code would be used:
where the instruction ldnl n is explained in section 4.2.2.
This code sequence only takes 2 bytes, provided constants_ptr is less than 16 words
from the work space pointer address and there are no more than 16 word-length
constants. At worse it is unlikely to take more than 4 bytes. Hence, if a constant takes
4 or more bytes to load using ldc then this sequence often improves code compact-
ness — especially if the constant is used more than once.
4.3.4
Single words, half words and bytes may be assigned using the load and store instruc-
tions described in section 4.2.
Word assignment
If x and y are both single word variables and e is a word valued expression then word
assignments are compiled as
Byte assignment
If a and b are both single byte variables and e is a byte valued expression then byte
assignments are compiled as
where address(variable) is the address of variable. Forming addresses is discussed in
section 4.5.
Half word assignment
If a and b are both half-word variables and e is a half-word valued expression then
half-word assignments are compiled as
where address(variable) is the address of variable. Forming addresses is discussed in
section 4.5.
4.4
This section describes the use of the arithmetic instructions except for the multiply-
accumulate instructions, which are described in Chapter 5, and forming addresses,
which is described in section 4.5. Boolean expression evaluation is discussed in
ldl constants_ptr ; ldnl n;
Assignment
x = y
x = e
b = a
b = e
b = a
b = e
Arithmetic
compiles to
compiles to
compiles to
compiles to
compiles to
compiles to
ld y; st x;
e; st x;
address(a); lbinc; address(b); sbinc;
e; address(b); sbinc;
address(a); lsinc; address(b); ssinc;
e; address(b); ssinc;
4 Using ST20-C1 instructions
35/205

Related parts for ST20-C1