Moteur de recherche de fiches techniques de composants électroniques
  French  ▼
ALLDATASHEET.FR

X  

ST20-C1 Fiches technique(PDF) 46 Page - STMicroelectronics

No de pièce ST20-C1
Description  Instruction Set Reference Manual
PDF  205 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Fabricant  STMICROELECTRONICS [STMicroelectronics]
Site Internet  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

ST20-C1 Fiches technique(HTML) 46 Page - STMicroelectronics

Back Button ST20-C1 Datasheet HTML 42Page - STMicroelectronics ST20-C1 Datasheet HTML 43Page - STMicroelectronics ST20-C1 Datasheet HTML 44Page - STMicroelectronics ST20-C1 Datasheet HTML 45Page - STMicroelectronics ST20-C1 Datasheet HTML 46Page - STMicroelectronics ST20-C1 Datasheet HTML 47Page - STMicroelectronics ST20-C1 Datasheet HTML 48Page - STMicroelectronics ST20-C1 Datasheet HTML 49Page - STMicroelectronics ST20-C1 Datasheet HTML 50Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 46 / 205 page
background image
4.7 Evaluation of boolean expressions
46/205
®
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).
true
=
ldc 1
false
=
ldc 0
!X
=
¬(X)
X== Y
=
X; Y; sub; eqc 0
X!= Y
=
¬(X; Y; sub; eqc 0)
X== K
=
X; eqc K
X!= K
=
¬(X; eqc K)
X> Y
=
X; Y; gt
X< Y
=
Y; X; gt
X>= Y
=
¬(Y; X; gt)
X<= Y
=
¬(X; Y; gt)
Further optimizations can be made to the ‘not equals’ comparison when followed by a
conditional jump.
X != Y; cj L
=
X; Y; sub; cj L
X != 0; cj L
=
X; cj L
4.7.1
Evaluation of NOT
If zero represents false and 1 represents true, then logical NOT can be performed by
eqc 0.
4.7.2
Evaluation of AND and OR
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:
if ((ptr != NULL) && (ptr->tag == TAG_VAL)) ...
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:
X OR Y
=
¬(¬(X); cj L; ¬(Y); L:)
X AND Y
=
X; cj L; Y; L:
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:
¬(X AND Y)
=
(
¬X) OR (¬Y)
[=
¬(X; cj L; Y; L:)]
¬(X OR Y)
=
(
¬X) AND (¬Y)
[=
¬(X); cj L; ¬(Y); L:]
(X OR Y); cj L
=
(
¬X); cj M; Y; cj L; M:
(X AND Y); cj L = X; cj L; Y; cj L



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Fiches technique Télécharger

Go To PDF Page


Lien URL



ALLDATASHEET vous a-t-il été utile ?  [ DONATE ] 

À propos de Alldatasheet   |   Publicité   |   Contactez-nous   |   Politique de confidentialité   |   Lien vers la fiche technique    |   Echange de liens   |   Fabricants
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com