Object Code Accelerator Manual
Preparing Your Program for TNS/E Systems
Object Code Accelerator Manual—528144-003
2-9
Odd-Byte References
s2 ':=' p FOR $LEN(s2) BYTES; ! On TNS/E systems,
p.d := %h12345678%d; ! these operations
p.j := 6; ! might wrap or trap
END;
The structure defined by P starts near the end of the user data segment and goes past
the end. On TNS systems, this addressing operation wraps back to G[0], as shown by
the dotted line in the following figure. On TNS/E systems, this addressing operation
might wrap or trap.
Odd-Byte References
When a language compiler applies a TNS word instruction to an operand with an odd-
byte address, run-time results are unpredictable. The instruction might do any, or any
combination, of:
•
“Round down” the misaligned address (as the TNS CISC processors always did)
•
Use the misaligned address without rounding it down
•
Cause the instruction to fail
The TNS instruction’s misalignment behavior depends on:
•
Operand size (16-bit, 32-bit, or 64-bit)
•
Execution mode
In TNS mode or accelerated mode, the action also depends on:
°
TNS opcodes such as QCMP
°
Although 64-bit integers with odd-byte addresses usually are not rounded
down, they can be—QCMP is one such example.
P
G [0]
G [65535]
SG [0]
User Data Segment
(Relative Segment 0)
System Data Segment
(Relative Segment 1)
VST0202.vdd
p