[Simh] RK formatting - closed

Bob Supnik bob at supnik.org
Thu Feb 13 17:26:42 EST 2020


The simulator is doing the right thing. Here's the core of the 
formatting routine:

6$:     MOV     #-1,RKWC(R2)            ;SET WORD COUNT TO 1
         MOV     #RKDATA,RKBA(R2)        ;SET BUFFER ADDRESS
         MOV     #WRTFMT+GO,RKCS(R2)     ;ISSUE WRITE FORMAT
7$:     BIT     #CTLRDY,RKCS(R2)        ;DONE?
         BEQ     7$                      ;NO-WAIT
         BIT     #ERR,RKCS(R2)           ;REACHED ERROR CONDITION YET?
         BEQ     6$                      ;NO. REPEAT 'TILL ERROR CONDITION
         ADD     #14533,R1               ;COMPUTE LAST VALID ADDRESS ON DISK
         CMP     R1,RKDA(R2)             ;ARE WE THERE?
         BHI     9$                      ;NO. ERROR
         MOV     #CTLRST+GO,RKCS(R2)     ;CLEAR CONTROLLER
8$:     BIT     #CTLRDY,RKCS(R2)        ;DONE?
         BEQ     8$                      ;NO-WAIT
         BIT     #ERR,RKCS(R2)           ;ERROR?
         BNE     9$                      ;YES, BUT ERROR
         CLC                             ;NO ERRORS.
         BR      11$                     ;GO TO RETURN

9$:     $ERROR  #$SERR2,F               ;'?DEVICE ERROR'                ;MG1
10$:    SEC                             ;INDICATE ERROR
11$:    RTS     PC                      ;RETURN

And here's the simulator coming out of the loop:

.format rk0:
RK0:/FORMAT-Are you sure? Y

Breakpoint, PC: 012736 (ADD #14533,R1)
sim> s

Step expired, PC: 012742 (CMP R1,12(R2))
sim> s

Step expired, PC: 012746 (BHI 13002)
sim> s

Step expired, PC: 012750 (MOV #1,4(R2))
sim> s

Step expired, PC: 012756 (BIT #200,4(R2))
sim> s

Step expired, PC: 012764 (BEQ 12756)
sim> s

Step expired, PC: 012766 (BIT #100000,4(R2))
sim> s

Step expired, PC: 012774 (BNE 13002)
sim> s

Step expired, PC: 012776 (CLC)
sim> s

Step expired, PC: 013000 (BR 13020)
sim> s

Step expired, PC: 013020 (RTS PC)
sim> c
?FORMAT-I-Formatting complete

As you can see, the code resets the controller, sees no errors, and 
continues onward.

I regard the issue as resolved. The simulator is handling formatting 
correctly, and RT11 is generating an appropriate informational message 
at the end.

/Bob



More information about the Simh mailing list