![Trinamic PD57-1060 Скачать руководство пользователя страница 74](http://html1.mh-extra.com/html/trinamic/pd57-1060/pd57-1060_firmware-manual_1163104074.webp)
PD57/60-1060 / TMCM-1060 TMCL™ Firmware Manual (V1.04 / 2011-AUG-29)
74
Copyright © 2011, TRINAMIC Motion Control GmbH & Co. KG
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