TMCL™ Firmware Manual - Trinamic
TMCL™ Firmware Manual - Trinamic
TMCL™ Firmware Manual - Trinamic
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
PD-109-57 V2 TMCL <strong>Firmware</strong> <strong>Manual</strong> (V1.00/2010-FEB-18) 68<br />
6.7.27 CALCX (calculate using the X register)<br />
This instruction is very similar to CALC, but the second operand comes from the X register. The X register<br />
can be loaded with the LOAD or the SWAP type of this instruction. The result is written back to the<br />
accumulator for further processing like comparisons or data transfer.<br />
Related commands: CALC, COMP, JC, AAP, AGP<br />
Mnemonic: CALCX <br />
with =ADD|SUB|MUL|DIV|MOD|AND|OR|XOR|NOT|LOAD|SWAP<br />
Binary representation:<br />
INSTRUCTION NO. TYPE MOT/BANK VALUE<br />
33 0 ADD – add X register to accu<br />
1 SUB – subtract X register from accu<br />
2 MUL – multiply accu by X register<br />
3 DIV – divide accu by X-register<br />
4 MOD – modulo divide accu by x-register<br />
5 AND – logical and accu with X-register<br />
6 OR – logical or accu with X-register<br />
7 XOR – logical exor accu with X-register<br />
8 NOT – logical invert X-register<br />
9 LOAD – load accu to X-register<br />
10 SWAP – swap accu with X-register<br />
Copyright © 2010, TRINAMIC Motion Control GmbH & Co. KG<br />
(don't care) (don't care)<br />
Example:<br />
Multiply accu by X-register<br />
Mnemonic: CALCX MUL<br />
Binary:<br />
Byte Index 0 1 2 3 4 5 6 7 8<br />
Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum<br />
address Number<br />
Bank Byte3 Byte2 Byte1 Byte0<br />
Value (hex) $01 $21 $02 $00 $00 $00 $00 $00 $24