Technical data

SDA Description
9.4 Finding the Problem Within the Routine
To find the problem within the routine, examine the printers driver code. In
the system failure discussed in this example, the instruction that caused the
exception is MOVB (R3)+,(R0). To check the contents of R3, use the EXAMINE
command as follows:
SDA> EXAMINE R3
R3: 80069E00 "...."
The invalid virtual address, as recorded in the signal array, is stored in R3. In
the following driver code excerpt, the instruction in question appears at line 599.
It is likely that the contents of R3 have been incremented too many times.
581 STARTIO:
582 MOVL UCB$L_IRP(R5),R3 ;Retrieve address of I/O packet
583 MOVW IRP$L_MEDIA+2(R3),-
584 UCB$W_BOFF(R5) ;Set number of characters to print
585 MOVL UCB$L_SVAPTE(R5),R3 ;Get address of system buffer
586 MOVAB 12(R3),R3 ;Get address of data area
587 MOVL UCB$L_CRB(R5),R4 ;Get address of CRB
588 MOVL @CRB$L_INTD+VEC$L_IDB(R4),R4 ;Get device CSR address
589 ;
590 ; START NEXT OUTPUT SEQUENCE
591 ;
592
593 10$: ADDL3 #LP_DBR,R4,R0 ;Calculate address of data buffer register
594 MOVZWL UCB$W_BOFF(R5),R1 ;Get number of characters remaining
595 MOVW #^X8080,R2 ;Get control register test mask
596 BRB 25$ ;Start output
597 20$: BITW R2,(R4)
!
;Printer ready or have paper problem?
598 BLEQ 30$ ;If LEQ not ready or paper problem
599 MOVB (R3)+,(R0)
"
;Output next character
600 ASHL #1,G^EXE$GL_UBDELAY,-(SP) ;Delay 3*2 u-seconds
601 24$: SOBGEQ (SP),24$ ;Delay loop calibrated to machine speed
602 ADDL #4,SP ;Pop extra longword off stack
603 25$: SOBGEQ R1,20$
#
;Any more characters to output?
604 BRW 70$ ;All done, BRW to set return status
Explanations of the circled numbers in the example are in Section 9.4.1.
9.4.1 Examining the Routine
The MOVB instruction is part of a routine that reads characters from a buffer
and writes them to the printer. The routine contains the loop of instructions
that starts at the label 20$ and ends at 25$. This loop executes once for each
character in the buffer, performing these steps:
! The driver checks the printers status register to see if the printer is ready.
" If the printer is ready, the driver gets a character from the buffer and moves
it to the printers data register, to which R0 points.
# It then decrements R1, which contains the count of characters left to print. If
R1 contains a number greater than 0, control is passed back to the instruction
at 20$, and the loop begins again.
Steps 1 and 2 are repeated until the contents of R1 are 0 or the printer signals
that it is not ready.
If the printer signals that it is not ready, the driver transfers control to 30$ (line
598), the beginning of a routine that waits for an interrupt from the printer.
When the printer becomes ready, it interrupts the driver and execution of the loop
resumes.
SDA28