User manual
PD-1141 TMCL Firmware V1.19 Manual (Rev. 1.01 / 2012-JUL-27)  41 
www.trinamic.com   
3.6.17  COMP (compare) 
The specified number is compared to the value in the accumulator register. The result of the comparison 
can  for example  be used by the conditional  jump  (JC)  instruction.  This  command  is  intended for use in 
standalone operation only. 
The host address and the reply are only used to take the instruction to the TMCL program memory while 
the program loads down. It does not make sense to use this command in direct mode. 
Internal function: The specified value is compared to the internal accumulator, which holds the value of a 
preceding get  or calculate instruction (see GAP/GGP/ CALC/CALCX). The internal arithmetic status flags are 
set according to the comparison result. 
Related commands: JC (jump conditional), GAP, GGP, CALC, CALCX 
Mnemonic: COMP <value>  
Binary representation: 
INSTRUCTION NO. 
TYPE 
MOT/BANK 
VALUE 
20 
(don't care) 
(don't care) 
<comparison value> 
Example: 
Jump to the address given by  the label when  the position of  motor  is greater  than or  equal to 
1000. 
GAP 1, 2, 0  //get axis parameter, type: no. 1 (actual position), motor: 0, value: 0 (don't care) 
COMP 1000   //compare actual value to 1000 
JC GE, Label  //jump,  type:  5  greater/equal,  the  label  must  be  defined  somewhere  else  in  the 
program 
Binary format of the COMP 1000 command: 
Byte Index 
0 
1 
2 
3 
4 
5 
6 
7 
Function 
Target- 
address 
Instruction 
Number 
Type 
Motor/ 
Bank 
Operand 
Byte3 
Operand 
Byte2 
Operand 
Byte1 
Operand 
Byte0 
Value (hex) 
$01 
$14 
$00 
$00 
$00 
$00 
$03 
$e8 










