$ EDIT/SLP/NOAUDIT/CHECKSUM:011506 KMCLDR.MAC - 43, 44 ; .MCALL LBLDF$ ; LBLDF$ ;DEFINE LABEL BLOCK OFFSETS - 51 L$BBLK =360 ; FAKE LABEL BLOCK OFFSET ; TL000 - 70, 71 BCS 3$ ;USER WANTS OUT CALL GETUBA ;GET UNIBUS MAPPED ADDRESS BCC 5$ ;GOOD RETURN 3$: JMP END1 ;USER WANTS OUT - 204 BIC #' ,READBF ;MAKE IT UPPERCASE - 239 ; GETUBA - GET THE UNIBUS NUMBER ; ; INPUTS: ; R3 = CSR ADDRESS ; OUTPUTS: ; R3 = ADDRESS IN PSECT UBUS(0/1) WITH OFFSET FOR KMC CSR ; GETUBA: MOV #UBAQUE,Q.IOPL+MSGWRT ; ADDRESS OF BUFFER MOV #UBAL,Q.IOPL+2+MSGWRT ; BYTE COUNT MOV #44,Q.IOPL+4+MSGWRT ; VFC DIR$ #MSGWRT ; ASK THE QUESTION DIR$ #MSGWAT ; WAIT FOR IT TO COMPLETE DIR$ #MSGRED ; READ THE RESPONSE DIR$ #MSGWAT ; WAIT CMPB #IE.EOF,MCSTS ; DID THE USER TYPE CONTROL Z? BEQ SUBERR ; YES, EXIT MOV #.UBUS0,R1 ; ASSUME UNIBUS 0 MOV MCSTS+2,R2 ; GET # OF CHARACTERS IN RESPONSE BEQ 30$ ; NO CHARACTERS ENTERED MOV #READBF,R1 ; ADDRESS OF RESPONSE BUFFER 20$: MOVB (R1),R4 ; GET NEXT CHARACTER CMPB #'0,R4 ; LESS THAN AN ASCII 0? BHI 40$ ; ILLEGAL UBA CMPB #'7,R4 ; GREATER THAN 7? BLO 40$ ; ILLEGAL UBA BIC #177770,R4 ; MAKE IT AN OCTAL NUMBER MOV #.UBUS0,R1 ; ASSUME UNIBUS 0 TST R4 ; IS IT ZERO? BEQ 30$ ; YES MOV #.UBUS0,R1 ; NO-ASSUME UNIBUS 1 CMP #1,R4 ; LETS TRY 1 BNE 40$ ; NOT ZERO OR ONE 30$: BIC #160000,R3 ; CLEAR OFF I/O PAGE BITS IN CSR ADD R1,R3 ; ADD IN OUR PSECT ADDRESS CCC ; INDICATE GOOD RETURN RETURN 40$: MOV #ILUBA,Q.IOPL+MSGWRT ;ERROR MESSAGE ADDRESS MOV #ILULL,Q.IOPL+2+MSGWRT ;BYTE COUNT CALL ERR BR GETUBA ;GET UBA AGAIN ; - 272, 272 BNE 40$ ;NO - 395 ILUBA: .ASCII /***ILLEGAL UNIBUS***/ ILULL=.-ILUBA - 401 UBAQUE: .ASCII /UNIBUS? / UBAL=.-UBAQUE - 423 .PAGE .PSECT UBUS0,RW,D,GBL,REL,OVR .UBUS0:: .BLKB 20000 ;WILL MAP UNIBUS 0 ADDRESS ON VAX .PSECT UBUS1,RW,D,GBL,REL,OVR .UBUS1:: .BLKB 20000 ;WILL MAP UNIBUS 1 ADDRESS ON VAX .PSECT /