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

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
ssinc writes the half word in the two least significant b ytes of Breg to the location
addressed by Areg.
4.2.4
A block memory copy may be implemented using the instructions lwinc and swinc .
These instructions load or store a word, and increment the addresses used.
To copy n bytes from source to destination , where source and destination are both
word-aligned, a loop should be written, using the temporary variable limit , as in the
following code:
This is the most efficient method of copying, since it reads and writes full words,
making the best use of any 32-bit memory. However, this is not always possible if the
alignment of the source and destination blocks are different. In that case the byte or
half-word load and store should be used.
4.3
Expression evaluation and address calculation is performed using the evaluation
stack. For example, the evaluation of operations with two integer operands is
performed by instructions that operate on the values of Areg and Breg. The result is
left in Areg.
Arithmetic and boolean calculations are considered in sections 4.4 and 4.7 respec-
tively. This section describes how the evaluation stack is used. Loading and storing
instructions are described in section 4.2.
In this and subsequent sections, in examples of assembly code, a single letter or iden-
tifier wr itten as an instruction is either an expression or a segment of code. If it is an
expression then it means ‘evaluate the expression and leave the result in the Areg.
4.3.1
A compiler normally loads a constant expression c using ldc :
Loading from a constant table is described in section 4.3.3.
An expression consisting of a single local variable is loaded using
Methods for loading non-local variables are discussed in section 4.2, and array
elements in section 4.5.
LOOP: lwinc; rev; swinc
END:
Memory block copy
Expression evaluation
Using the evaluation stack
ldc c
ldl x
ld source; ld n; ld destination
add; stl limit
ldl limit; arot
gt; cj END; j LOOP;
4 Using ST20-C1 instructions
33/205

Related parts for ST20-C1