Another example is data type conversion from a 32-bit unsigned variable with an offset to a 32-bit signed variable:
The interface for the byte code to TEMES is done via calculated signals which are assigned to fixed addresses:
•The input signal: Linear transform of the input signal with signal address c00016. Following calculated signal comment is required:
[Parameters]
DeviceAddr=40960
•The output signal: Constant definition with signal address d00016. Following calculated signal comment is required:
[Parameters]
DeviceAddr=53248
The function is realized in C as follows:
extern uint32_t c000;
extern int32_t d000;
uint32_t offset = 0x80000000;
d000 = c000 - offset; /* = c000 + (~offset + 1) */
The function is realized in byte code as follows:
da 00 c0 00 00 PushS4 $c000
82 00 00 00 80 Push4 $80000000
54 Add
ea 00 d0 00 00 PopS4 $d000
Following additional TEMES parameters are required:
CodeCount=4
Code0 = da 00 c0 00 00
Code1 = 82 00 00 00 80
Code2 = 54
Code3 = ea 00 d0 00 00