.TITLE TIME .IDENT /BZL1.2/ .ENABLE LC ; ; This program does a quick check of the Floating Point Processor. ; If it fails, an error message is printed on the console. ; In all cases, it prints the time of day and current error count. ; It is handy to run this on the clock queue every 10 minutes or ; so, to mark off on your console listing a record of how ; the error count is doing, and the time of day. ; ; B. Z. Lederman 27-Jul-84 ; ; Do not print O.K. message: print only on failure. ; Ring bells in failure message. ; ; 24-Sep-84 Use low order byte of SYSID to avoid problems ; on "D" system. ; ; 24-Oct-84 Exit with status (Severe if floating point error, ; successful otherwise). ; .MCALL GTIM$S, EXST$S, QIOW$S, ALUN$S ; .PSECT DATAI, D, RW ; OUTBUF: .BLKB 120. ; space for finished message RESLT: .BLKW 8. ; temp storage for floating OUTBLK: .WORD SYSNUM ; address of sys. ID char TIMBLK: .BLKW 10 ; Get Time Block VRSN: .WORD 0 ; system version number ERRNUM: .WORD 0 ; error sequence number SYSNUM: .WORD 0 ; system ID number EXSTAT: .WORD EX$SUC ; Exit status (default is success) ; .PSECT DATAP, D, RO ; S1: .FLT2 0.70E2 ; input numbers S2: .FLT2 -.50E2 D1: .FLT4 0.70E2 D2: .FLT4 -.50E2 ; KNOWN: .WORD 20. ; start of known answers .WORD 5. .WORD -1000. .WORD 10. .WORD 20. .WORD 5. .WORD 70. .WORD 7. ; .NLIST BEX INSTR: .ASCII /%N*** %A System, %Y, %4Z RSX-11M-Plus V%4A/ .ASCIZ / *** Error Count = %M / ; %N at beginning, end ; FAIL: .BYTE 7, 7 ; Bells .ASCII /***** Floating Point '/ .BYTE 7, 7 FAILTP: .ASCII / ' Failure *****/ .BYTE 7, 7 FAILN=.-FAIL ; ; SUCC: .ASCII /***** Floating Point Tests OK *****/ ; SUCLN=.-SUCC ; .EVEN .LIST BEX ; .PSECT CODE, I, RO ; START:: ALUN$S #5, #"TI, #0 ; assign output LUN ; ; On our systems, each CPU (11/70) has a system ID register ; which has been set to a different number. This ; allows programs to find out which machine they are ; running on, and print out an appropriate I.D. (The ; registers are set by field service once.) Since ; most people unfortunately do not have this, the ; following code is commented out, and a blank ; space is put in instead. ; ;; MOV @#177764, SYSNUM ; Get system ID ;; BIC #177700, SYSNUM ; want low order bits only ;; ADD #100, SYSNUM ; convert to ASCII MOV #' , SYSNUM ; move in a blank space instead. ; MOV $ERRSQ, ERRNUM ; get Error Sequence number MOV #$VERSN, VRSN ; system version GTIM$S #TIMBLK ; get current time MOV #OUTBUF, R0 ; Output buffer address MOV #INSTR, R1 ; Address of format control string MOV #OUTBLK, R2 ; Address of Agument block CALL $EDMSG ; process message QIOW$S #IO.WBT, #5, #1,,,, <#OUTBUF, R1, #40> ; CALL CLEAR ; clean out compare area MOVB #'S, FAILTP ; type of test LDFPS #0 ; clear floating point status CLRF R0 ; clear registers CLRF R1 LDF S1, R0 ; load number LDF S2, R1 ; load another number CALL XRSIZ ; 50$: CALL CLEAR ; clear area MOVB #'D, FAILTP LDFPS #200 ; go to double precision CLRF R0 CLRF R1 LDF D1, R0 LDF D2, R1 CALL XRSIZ ; ; don't print success message. ; QIOW$S #IO.WBT, #5, #1,,,, <#SUCC, #SUCLN, #40> ;success EXIT: ; EXIT$S ; exit with status EXST$S EXSTAT ; ; XRSIZ: MOV #RESLT, R4 ; address of result buffer ADDF R1, R0 ; add two numbers STCFI R0, (R4)+ ; store mantissa (as integer) STEXP R0, (R4)+ ; store exponent (as integer) MULF R1, R0 ; multiply STCFI R0, (R4)+ STEXP R0, (R4)+ DIVF R1, R0 ; divide STCFI R0, (R4)+ STEXP R0, (R4)+ SUBF R1, R0 ; subtract STCFI R0, (R4)+ STEXP R0, (R4)+ MOV #RESLT, R0 ; compare results with MOV #KNOWN, R1 ; stored values MOV #8., R2 ; number of values to check 20$: CMP (R0)+, (R1)+ ; compare answers BNE 30$ ; if not equal, failed test SOB R2, 20$ ; repeat until all tested RETURN ; test finished O.K. 30$: QIOW$S #IO.WBT, #5, #1,,,, <#FAIL, #FAILN, #40> ; failure message MOV #EX$SEV, EXSTAT ; severe exit status RETURN ; CLEAR: MOV #8., R0 ; clear temp area MOV #RESLT, R1 10$: CLR (R1)+ SOB R0, 10$ RETURN ; .END START