Technical data

SDA Description
Examine the code to determine which variables control the loop.
The byte count (BCNT) is the number of characters in the buffer. Note that
BCNT is set by a function decision table (FDT) routine and that this routine sets
the value of BCNT to the number of characters in the buffer. In line 586, the
starting address of a buffer that is BCNT bytes in size is moved into R3.
Note also that the number of characters left to be printed is represented by the
byte offset (BOFF), the offset into the buffer at which the driver finds the next
character to be printed. This value controls the number of times the loop is
executed.
Because the exception is an access violation, either R3 or R0 must contain an
incorrect value. You can determine that R0 is probably valid by the following
logic:
The instruction at 10$ (ADDL3 #LP_DBR,R4,R0) places an address in R0 and
R0 is not modified again until the failing instruction (line 599).
The value in R4 at the time that the instruction at 10$ is executed was
derived from the addresses of the device’s unit control block (UCB) (line 587)
and CRB (line 599). Although it is possible that these data structures might
contain wrong information, it is unlikely.
Thus, the contents of R3 seem to be the cause of the failure.
The most likely reason that the contents of R3 are wrong is that the MOVB
instruction at line 599 executes too many times. You can check this by comparing
the contents of UCB$W_BOFF and UCB$W_BCNT. If UCB$W_BOFF contains
a larger value than that in UCB$W_BCNT, then R3 contains a value that is too
large, indicating that the MOVB instruction has incremented the contents of R3
too many times.
9.4.2 Checking the Values of Key Variables
Because the start-I/O routine requires that R5 contain the address of the printers
UCB, and because several other instructions reference R5 without error before
any instruction in the loop does, you can assume that R5 contains the address of
the right UCB. To compare BOFF and BCNT, use the command FORMAT @R5 to
display the contents of the UCB, as shown in the following session.
SDA> READ SYS$SYSTEM:SYSDEF.STB
SDA> FORMAT @R5
8005D160 UCB$L_FQFL 800039A8
UCB$L_RQFL
UCB$W_MB_SEED
UCB$W_UNIT_SEED
8005D164 UCB$L_FQBL 800039A8
UCB$L_RQBL
8005D168 UCB$W_SIZE 0122
8005D16A UCB$B_TYPE 10
8005D16B UCB$B_FIPL 34
UCB$B_FLCK
SDA29