Download Print this page

HEIDENHAIN MANUALplus 620 Technical Manual page 1709

Hide thumbs Also See for MANUALplus 620:

Advertisement

8.15.54 SHIFT LEFT (<<)
January 2012
Syntax:
<< (SHIFT LEFT)
Operands:
B, W, D, K
Action:
A SHIFT LEFT statement multiplies the content of the word accumulator by
two. This is done by simply shifting the bits in the accumulator by one place
to the left. The result must lie in the range of -2 147 483 648 to +2 147 483
647, otherwise the accumulator contains an undefined value. You define the
number of shifts through the operand. The control fills the right end of the
accumulator with zeros.
This statement is one of the arithmetic commands because it includes the
sign bit. For this reason, and to save time, you should not use this command
to isolate bits.
Example:
Shift the content of double word D8 four times to the left, then assign it to
double word D12.
Initial state:
Double word D8
= 3E 80 (hex)
Double word D12
= ?
Function
Load the double word D8
into the word accumulator
Shift the content of the
word accumulator to the
left by the number of bits
that are specified in the
operand.
Assign the result to
double word D12.
Instead of using the << K+1 command four times, simply use the << K+4
command.
8.15 Command Set
STL
Accumulator
content
L D8
3E80
<< K+1 7D00
<< K+1 FA00
<< K+1 1F400
<< K+1 3E800
= D12
3E800
Operand content
3E80
3E800
1709

Advertisement

loading