Load Two's-Complement - HEIDENHAIN TNC 415 Technical Manual

Hide thumbs Also See for TNC 415:
Table of Contents

Advertisement

3.1.3 LOAD TWO'S-COMPLEMENT (L–)
Abbreviation for the PLC-Editor:
Execution time [µs]
Number of bytes
Operands: B, W, D, K
Operation:
The contents of the addressed Operand (B, W, D) or a Constant (K) are loaded into the Word
Accumulator as a two's complement. In addition, the Accumulator is filled, if necessary, according to
the sign bit. The two's complement allows negative numbers to be stored. i.e. a number loaded with
the L- command appears in the Accumulator with an inverted sign.
This command may only be used with Word execution.
Example:
The contents of Byte B5 is to be negated, added to Byte B6 and the result assigned to Byte B8.
Initial state:
Line Instruction
Bit
1
L– B5
2
+ B6
3
= B8
To aid understanding of this example, the contents of the Accumulator and operands are shown as
decimal values in parentheses.
Line 1: The contents of Byte B5 are loaded into the Accumulator and the sign of the value is
inverted.
Line 2: The contents of the Word Accumulator and Byte B6 are added.
Line 3: The result is assigned to Byte B8.
7-40
TNC 407/TNC 415/TNC 425
L– (LOAD MINUS)
Logic
----
----
Byte B5 = 15 (dec)
Byte B6 = 20 (dec)
Byte B8 = ?
Accumulator Contents
31 . . . 15
... x x x x x x x x x x x x x x x x x x
... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 (–15)
... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 (+ 5)
... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 (+ 5)
3 Commands
Byte/Word
Double
0.5 to 1.6
0.5 to 0.7
8
6
7
Constant
0.2 to 0.3
8
Operand Contents
0
7
(+15) 00001111
(+20) 00010100
(+5) 00000101
0
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