Skip to content

Appendix D: Bug Analysis and Corrections History

CRITICAL_CORRECTIONS_HX21S_and_KEY_Field.md

CRITICAL CORRECTIONS: HX21S Bit Testing and KEY Field Interpretation

BREAKTHROUGH DISCOVERIES

1. DMA LKEY Field = COM5025 Register Values

Revolutionary Understanding: The DMA descriptor LKEY field's low 8 bits contain actual COM5025 chip register values that get written directly to the hardware. This is what the HDLC manual calls "Dataflow Cost."

% DMA Descriptor LKEY Structure:
% Bits 15-8: Block control (Empty=010, Full=011, ToTransmit=100, etc.)
% Bits 7-0:  COM5025 register value (TSOM, TEOM, RSOM, REOM detection bits)

% Example - FSERM = 002003₈:
FSERM = 002003₈ = 0000 1000 0000 0011
        │        └─ 003: COM5025 TSOM(1) + TEOM(1) = complete frame
        └─ 010: Block to be transmitted

2. MASSIVE ERROR CORRECTED: HX21S Bit Testing Logic

The Critical Misunderstanding:

HX21S = 000016₈  % This is 14 DECIMAL (bit number), not a bitmask!

WRONG Interpretation (Previous):

IF A BIT HX21S THEN    % Incorrectly thought: "test bits 1,2,3"
% Actually means: "test bit 14"

CORRECT Interpretation:

HX21S = 000016₈ = 14 decimal = bit position 14
IF A BIT HX21S THEN    % Means: "IF bit 14 in register A is 1 THEN"

Impact on All Analysis Documents

Before (WRONG):

  • "HX21S tests receiver state bits 1,2,3"
  • "HX21S = 0x000E is a bitmask"
  • "Tests StatusAvailable, ReceiverActive, SyncFlagReceived"

After (CORRECT):

  • "HX21S tests X.21 Clear Indication bit 14"
  • "HX21S = 14 (decimal) is a bit position number"
  • "Tests X21S (Clear Indication) - exactly what the name suggests"

Corrected SINTRAN Logic Flows

Receiver Processing (HIINT):

% CORRECTED X.21 error handling:
IF A/\ HX21M >< 0 THEN           % X.21 error detected (bits 13-14)
   IF A BIT HX21S THEN           % IF bit 14 (X21S Clear) is set
      HASTAT BONE BLDON=:HASTAT  % Terminate connection cleanly
   FI
FI

C# Implementation (CORRECTED):

// OLD (WRONG):
if ((rrts & 0x000E) != 0)  // Wrong - tested bits 1,2,3

// NEW (CORRECT):
if ((rrts & 0x4000) != 0)  // Correct - tests bit 14 (X21S Clear)
{
    // X.21 Clear Indication detected - terminate connection
    setBlockDone();
}

Key Constants Corrected

| Constant | Value | Previous (Wrong) | Correct Interpretation | |