Shift Right - HEIDENHAIN TNC 415 Technical Manual

Hide thumbs Also See for TNC 415:
Table of Contents

Advertisement

3.9.2 SHIFT RIGHT (>>)
Abbreviation for PLC Editor:
Execution time [µs]
Number of bytes
Operands: B, W, D, K
Operation:
Since the sign bit (MSB) is included with this command, it is grouped in with arithmetic commands.
For this reason and out of time considerations, this command should not be used for the isolation of bits.
A SHIFT RIGHT instruction causes the contents of the Word Accumulator to be divided by two. For this
purpose, the bits in the Accumulator are simply shifted by one place to the right. The number of the shift
operations is determined via the operand. Thus the set bits, which are shifted beyond the Accumulator to
the right, are lost; the Accumulator is filled according to the sign, from the left-hand side. With operand
contents greater than 32, the operand value Modulo 32 is used, i.e. the integer remainder from the division
(operand value)/32.
Example:
The content of the Doubleword D8 is to be shifted four times to the right and then stored in D12.
Initial state:
The Accumulator content is shown here in binary notation and the operand content in hexadecimal
notation.
Line Instruction
xxxxxxxx
1
L D8
00000000
2
>> K1
00000000
3
>> K1
00000000
4
>> K1
00000000
5
>> K1
00000000
6
= D12
00000000
Line 1:
Load Doubleword D8 into the Accumulator.
Line 2 to 5:
The content of the Word Accumulator is shifted to the right by the number of bits
specified in the operand. The complete operation can also be undertaken with the
command >> K+4.
Line 6:
The result is stored in Doubleword D12.
7-94
TNC 407/TNC 415/TNC 425
>> (SHIFT RIGHT)
Byte/Word/Double
Constant
0.6 to 0.9
0.3 to 0.5
6
Doubleword D8
= 3E 80 (hex)
Doubleword D12 = ?
Accumulator Content
xxxxxxxx
xxxxxxxx
00000000 00111110
00000000 00011111
00000000 00001111
00000000 00000111
00000000 00000011
00000000 00000011
3 Commands
8
Operand
Content
xxxxxxxx
10000000
00
01000000
10100000
11010000
11101000
11101000
00
00
3E
80
00
03
E8
01.98

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tnc 425eTnc 415fTnc 407Tnc 415bTnc 425

Table of Contents