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

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
where jump table code is
The code at jump_table consists of a sequence of jump instructions which transfer
control to the relevant branch Li ... Lm or to ERROR . The destination, case_x , of
each of these jumps is Lj if c
The code at ERROR should be the same code as used at the end of an IF statement
where all the conditionals have been false . The add , ldpi and jab instructions are
explained in other sections.
All the jumps in the jump_table code must be encoded to the same length ( jump_size
bytes) to enable them to be accessed as a byte array. nop , which is a two byte instruc-
tion that performs no operation, can be used to ensure this where different operands
require a different amount of prefixing.
Also note that in the special case where jump_size is 1, ‘ ldc jump_size ; mul ’ can be
removed from the sequence, and where jump_size is 4, ‘ ldc jump_size ; mul ’ can be
removed provided add is replaced with wsub .
C.3
Let depth(e) be the number of stack locations needed for the evaluation of expression
e , defined b y
That is, if the depth required for each expression is the same, then one extra stack
location is required to store the result of the first expression, while the second expres-
sion is being evaluated. If the stack requirements for each expression are different,
182/205
}
else if (X > c
else
M:
jump_table:
ERROR:
Li:
Lm:
Expression evaluation order
depth(constant)
depth(variable)
depth(function call) = ‘infinite’
depth(e1 op e2)
... similar
... jump table code
X; ldc c
add; jab;
j case_0; j case_1; ... ; j case_k
... error code
... code for P
...
... code for P
m
)
i
; sub; ldc jump_size; mul; ldc (jump_table-M); ldpi
j
= 1
= 1
= if (depth(e1) > depth(e2))
is equal to (c
else if (depth(e1) < depth(e2))
else
i
m
depth(e1)
depth(e2)
depth(e1) + 1
i
+ x) and is ERROR otherwise.

Related parts for ST20-C1