User manual
TMCM-1180 and PD86-1180 TMCL Firmware V4.42 Manual (Rev. 1.08 / 2012-NOV-20) 71
www.trinamic.com
5.7.28 CALCX (calculate using the X register)
This instruction is very similar to CALC, but the second operand comes from the X register. The X register can
be loaded with the LOAD or the SWAP type of this instruction. The result is written back to the accumulator
for further processing like comparisons or data transfer.
Related commands: CALC, COMP, JC, AAP, AGP
Mnemonic: CALCX <operation>
with <operation>=ADD|SUB|MUL|DIV|MOD|AND|OR|XOR|NOT|LOAD|SWAP
Binary representation:
INSTRUCTION NO.
TYPE
MOT/BANK
VALUE
33
0 ADD – add X register to accu
1 SUB – subtract X register from accu
2 MUL – multiply accu by X register
3 DIV – divide accu by X-register
4 MOD – modulo divide accu by x-register
5 AND – logical and accu with X-register
6 OR – logical or accu with X-register
7 XOR – logical exor accu with X-register
8 NOT – logical invert X-register
9 LOAD – load accu to X-register
10 SWAP – swap accu with X-register
(don't care)
(don't care)
Example:
Multiply accu by X-register
Mnemonic: CALCX MUL
Binary:
Byte Index
0
1
2
3
4
5
6
7
8
Function
Target-
address
Instruction
Number
Type
Motor/
Bank
Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Checksum
Value (hex)
$01
$21
$02
$00
$00
$00
$00
$00
$24