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

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
where the label ENDIF: is at the end of the code for the if construct.
The compilation of a while loop is shown by the following example.
This compiles to:
Note that this loop includes a timeslice instruction. This causes the current process to
be descheduled if a timeslice is due and timeslicing is enabled. The presence of this
ensures that the process cannot occupy the CPU for too long provided timeslicing is
enabled. It is good practice for multi-tasking programs to include a timeslice instruction
in every loop. Timeslicing is described in section 7.4. Single task programs do not
need to timeslice, but should have timeslicing disabled, so the timeslice instruction
has no effect.
A repeat .. until loop is shown by the following example.
This compiles to:
4.6.5
Two instructions are provided to select the smaller of two values. If Breg is smaller
than Areg as a signed integer, order will swap Areg and Breg; otherwise order will
have no effect. This can be used to find the minimum of two signed variables:
Similarly orderu can be used to find the minimum or maximum of two unsigned values
4.7
This section describes the operations using the logical true and false values, as used
with the conditional jump cj . Conditional behavior and comparisons are described in
section 4.6. Bitwise boolean operations are described in section 4.8. General issues
concerning expression evaluation are discussed in section 4.3.
while ( E ) {
}
P
L:
ENDWHILE:
repeat {
} until E
L:
K:
END:
Ordering instructions
ldl a; ldl b; order;
stl minimum; stl maximum
Evaluation of boolean expressions
P
j K
E; eqc 0; cj END
P; timeslice; j L
E; cj ENDWHILE
P; timeslice; j L
4 Using ST20-C1 instructions
45/205

Related parts for ST20-C1