Please enable JavaScript to view this site.

TEMES 1.0

The SICOLOG implements calculated signals with interpreted byte code. If a function cannot be implemented with TEMES calculations, then it might possibly be implemented with byte code instead. A resettable maximal value is such a function which will be realized with byte code in the following:

 

 

The interface for the byte code to TEMES is done via calculated signals which are assigned to fixed addresses:

 

The output signal: Constant definition with signal address a00016. Following calculated signal comment is required:
 
   [Parameters]
   DeviceAddr=40960
 

The input signal: Linear transform of the input signal with signal address a00116. Following calculated signal comment is required:
 
   [Parameters]
   DeviceAddr=40961
 

The test signal (on which the output signal should be reseted): Equality operation of the test signal with signal address a00216. Following calculated signal comment is required:
 
   [Parameters]
   DeviceAddr=40962
 

 

The function is realized in C as follows:

 

extern int32_t a000, a001, a002;

if (a002 != 0) {

   a000 = 0;

}

else {

   if (a000 < a001) a000 = a001;

}

 

 

The function is realized in byte code as follows:

 

da 02 a0 00 00   PushS4 $a002

22               IsNotZero

0e 0c            JumpShortIfZero 12

82 00 00 00 00   Push4 0

ea 00 a0 00 00   PopS4 $a000

0c 17            JumpShort 23

da 00 a0 00 00   PushS4 $a000

da 01 a0 00 00   PushS4 $a001

24               IsLessThan

0e 0a            JumpShortIfZero 10

da 01 a0 00 00   PushS4 $a001

ea 00 a0 00 00   PopS4 $a000

 

 

Following additional TEMES parameters are required:

 

CodeCount = 3

Code0 = da 02 a0 00 00   22   0e 0c   82 00 00 00 00   ea 00 a0 00 00   0c 17

Code1 = da 00 a0 00 00   da 01 a0 00 00   24   0e 0a   da 01 a0 00 00

Code2 = ea 00 a0 00 00