; RXV21_boot     From Microcomputer Interfaces Handbook 1983-84, page 484 (corrected)
;                Use ODT to enter, then set RS=340, R6=1000, R7=1000, then P
;
           ORG      O1000
;
           MOV      #O100240,R0
           MOV      #O177170,R1       ; RXCSR
           CLR      R2
           MOV      #O200,R5
           MOV      #O401,R4          ; track 1, sector 1
           MOV      #O177172,R3       ; RXDBR
           BIT      R0,(R1)
           BEQ      $-4               ; wait for DONE or ERR
           BMI      O1132             ; branch to HALT if ERR set
           MOV      #O407,(R1)        ; set DDens, Read, Go
           BIT      R0,(R1)           ; wait for TranferRequest or ERR
           BEQ      $-4
           BMI      O1132             ; branch if ERR set
           MOVB     R4,(R3)           ; give sector number
           SWAB     R4                ; swap track and sector
           BIT      R0,(R1)           ; wait for TR or ERR
           BEQ      $-4
           MOVB     R4,(R3)           ; give track number
           SWAB     R4                ; swap sector and track
           BIT      R0,(R1)           ; wait for DONE or ERR
           BEQ      $-4
           BMI      O1132             ; branch if ERR set
           MOV      #O403,(R1)        ; EmptyBuffer (DDens) command
           BIT      R0,(R1)           ; wait for TR or ERR
           BEQ      $-4
           BMI      O1132             ; branch if ERR set
           MOV      R5,(R3)           ; set word count=128
           BIT      R0,(R1)
           BEQ      $-4               ; wait for DONE or ERR
           BMI      O1132             ; branch if ERR set
           MOV      R2,(R3)           ; set address=0
           ADD      R5,R2             ; increment...
           ADD      R5,R2             ; ...address
           CMPB     (R4)+,(R4)+       ; bump R4 by 2
           CMPB     R4,#3             ; sectors 1 and 3 get done
           BLE      O1022             ; loop if not finished
           MOV      #0,R0
           CLR      PC                ; go to address zero
