ST20-C1 STMICROELECTRONICS [STMicroelectronics], ST20-C1 Datasheet - Page 46
ST20-C1
Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
1.ST20-C1.pdf
(205 pages)
- Current page: 46 of 205
- Download datasheet (842Kb)
4.7 Evaluation of boolean expressions
The following shows the correspondence between C logical expressions and ST20-C1
instructions. X and Y represent expressions,and K represents a constant. The symbol
‘ ’ is a logical NOT (see section 4.7.1).
Further optimizations can be made to the ‘not equals’ comparison when followed by a
conditional jump.
4.7.1
If zero represents false and 1 represents true, then logical NOT can be performed by
eqc 0 .
4.7.2
For evaluation of logical AND and OR operations, the instruction sequence depends
on whether strict or non-strict evaluation is used, i.e. whether both operands are
always evaluated. This is important if side-effects may occur, such as a trap, or if the
second operand is not always defined, as in:
In this example, ptr->tag is not defined if ptr is NULL. For languages such as ANSI
C, non-strict evaluation is required, so the following short-cuts must be used:
For non-strict evaluation, the following laws should be applied to the compilation of
conditional expressions before code is generated to ensure that the jump is taken as
early as possible:
46/205
if ((ptr != NULL) && (ptr->tag == TAG_VAL)) ...
true
false
! X
X == Y
X != Y
X == K
X != K
X > Y
X < Y
X >= Y
X <= Y
X != Y; cj L
X != 0; cj L
Evaluation of NOT
Evaluation of AND and OR
X OR Y
X AND Y
(X OR Y); cj L
(X AND Y); cj L = X; cj L; Y; cj L
(X AND Y)
(X OR Y)
= ( X) OR ( Y)
= ( X) AND ( Y)
= ( X); cj M; Y; cj L; M:
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
ldc 1
ldc 0
X; Y; sub; eqc 0
X; eqc K
X; Y; gt
Y; X; gt
X; Y; sub; cj L
X; cj L
X; cj L; Y; L:
(X)
(X; Y; sub; eqc 0)
(X; eqc K)
(Y; X; gt)
(X; Y; gt)
( (X); cj L; (Y); L:)
[= (X; cj L; Y; L:) ]
[= ( X); cj L; ( Y); L: ]
Related parts for ST20-C1
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
ST20 software development and debugging tools
Manufacturer:
STMICROELECTRONICS [STMicroelectronics]
Datasheet:
Part Number:
Description:
C++ preprocessor for ST20 and T4/T8 transputers
Manufacturer:
STMICROELECTRONICS [STMicroelectronics]
Datasheet:
Part Number:
Description:
PC PARALLEL PORT TO JTAG INTERFACE
Manufacturer:
STMICROELECTRONICS [STMicroelectronics]
Datasheet:
Part Number:
Description:
PC PARALLEL PORT TO OS-LINK INTERFACE
Manufacturer:
STMICROELECTRONICS [STMicroelectronics]
Datasheet:
Part Number:
Description:
Gps Processor
Manufacturer:
STMicroelectronics
Datasheet:
Part Number:
Description:
Gps Processor
Manufacturer:
STMicroelectronics
Datasheet:
Part Number:
Description:
THYRISTORS
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
ADJUSTABLE INVERTING NEGATIVE OUTPUT CURRENT MODE PWM REGULATORS
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
0.25A SCRs
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
0.8A SCRs
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
Smartcard MCU With 4 additional I/0
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
SERIAL 2K (256 x 8) EEPROM
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
Search -----> STP10NB50FP
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
Search ---> STP12NB30
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
Search -----> STP13NK50Z
Manufacturer:
ST Microelectronics
Datasheet: