ST20-C1 STMICROELECTRONICS [STMicroelectronics], ST20-C1 Datasheet - Page 180
ST20-C1
Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
1.ST20-C1.pdf
(205 pages)
- Current page: 180 of 205
- Download datasheet (842Kb)
C.2
The switch statement is a special form of conditional transfer where the transfer is
determined by comparing an expression to a number of constants.
When compiling the process
the expression x is evaluated and stored in a local variable by
Then each branch of the switch statement
can be compiled by
where the label END: is placed at the end of the switch statement.
C.2.3 Optimal compilation of switch
The compilation method given above will produce inefficient code for large switch
statements. To produce more efficient code the following rules can be used.
First build up a set of pairs of selector values and processes, consisting of every
selector value in the switch statement along with its associated process — the
process part of each pair can be represented by the offset to the start of the compiled
code for that process. Then the following rules can be used.
The choice of 3 or less entries, 12 or less entries and one third filled tab le are the
values used in current ST20 compilers.
180/205
1
2
3
Compiling switch statements
switch x
x; stl selector
c
L:
M:
If there are 3 entries or less then use the method as described above.
If there are 12 entries or less then use a binary search to limit the number of
comparisons required.
For more than 12 entries attempt to use a jump table. The offset of the start of
each selected process is placed in the table against each selector value.
Entries that do not match a selector in the switch statement must contain the
offset of an error handler process. This jump table should be the largest table
such that about one third of the entries are filled. This compilation strategy is
then recursively called to handle the two ends. The jab (section 4.10) and ldpi
(section 4.5) instructions, can be used to jump to the selected piece of code.
1
, ..., c
...
ldl selector; ldc c
ldl selector; ldc c
...
ldl selector; eqc c
P; j END;
P
n
1
2
n
; sub; cj L;
; sub; cj L;
; cj M;
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: