.TITLE S3D .IDENT /V1.3/ .ENABLE LC ; This program is used to test the speed of instructions. ; ; 13-Mar-85 B. Z. Lederman .MCALL QIOW$S, EXIT$S, ENAR$S, SREX$S, GTIM$S $NREP == 320. ; number of instructions wanted at one pass $NREAL = <$NREP - 3.> ; (minus loop instructions) $NPAS == 31250. ; number of passes ;AC0 = %0 ; Standard Floating Point registers ;AC1 = %1 ;AC2 = %2 .PSECT ALL, I, RW IOSB:: .BLKW 2 ; I/O status block STRTIM: .BLKW 8. ; for starting time ENDTIM: .BLKW 8. ; for ending time INTRNL: .WORD 0 ; flag for aborts, etc. MNEADR:: .WORD MNTAB ; starting point for mnemonics TABADR:: .WORD TABLE ; starting point for instructions .NLIST BEX ERMS1:: .ASCII \ Instruction \ ERMS2: .ASCII \ started \ ERMS3: .ASCII \ ended \ ERMS4: .ASCII \ Instructions per loop. \ ERMS5: .ASCII \ Passes through loop. \ ERMS7: .ASCII \Enable AST's directive rejected.\ ERMS10: .ASCII \Program has been aborted. \ STABUF: .ASCII \Program ends. \ STALEN = . - STABUF MNTAB:: .ASCII /MOV23P/ ; Table of mnemonics. See S1D.MAC .ASCII /MOV33P/ .ASCII /MOV66 / .ASCII /ADD23P/ .ASCII /ADD33P/ .ASCII /ADD66 / .ASCII /Last / .EVEN .LIST BEX TABLE:: MOV #1, @#IOSB ; MOVe mode 2, 3 MOV @#IOSB, @#ENDWRD ; move mode 3 and 3 MOV 4(R0), 2(R3) ; move mode 6 and 6 ADD #1, @#ENDWRD ADD @#IOSB, @#ENDWRD ADD 4(R0), 2(R3) HALT ; won't actually do this HALT HALT .PAGE START:: SREX$S #ABOAST ; specify abort AST point ENAR$S ; AST's should be enabled already BCC 10$ ; if no error, continue CMP #IE.ITS, $DSW ; were AST's already enabled? BEQ 10$ ; branch if yes, no real error MOV #ERMS7, R4 CALL ERMSG JMP EXIT 10$: MOV #ERMS4, R0 ; address of first information message MOV R0, R4 ; copy for ERMSG routine MOV #$NREP, R1 ; number of instructions per loop CLR R2 ; suppress leading zeroes CALL $CBDMG ; convert to ASCII CALL ERMSG ; write it out MOV #ERMS5, R0 ; repeat for second message MOV R0, R4 MOV #$NPAS, R1 CLR R2 CALL $CBDMG CALL ERMSG BEGIN:: MOV #ERMS1, R1 ; get start of message MOV R1, R4 ; copy for ERMSG routine MOV MNEADR, R5 ; address of mnemonic table MOVB (R5)+, (R1)+ ; move mnemonic into message MOVB (R5)+, (R1)+ MOVB (R5)+, (R1)+ MOVB (R5)+, (R1)+ MOVB (R5)+, (R1)+ MOVB (R5)+, (R1)+ MOV R5, MNEADR ; save address for next pass CALL ERMSG ; indicate instruction under test MOV TABADR, R5 ; address of instruction table MOV (R5)+, R0 ; get first word of instruction BNE 15$ ; branch if O.K. instruction JMP EXIT ; quit here if HALT instruction 15$: MOV (R5)+, R1 ; second word of instruction BNE 16$ ; branch if O.K. instruction JMP EXIT ; quit if HALT 16$: MOV (R5)+, R2 ; third word of instruction BNE 17$ ; branch if O.K. instruction JMP EXIT ; quit if HALT 17$: MOV R5, TABADR ; save address for next pass MOV #$NREAL, R4 ; number of repititions MOV #ISTRT, R3 ; address of instruction space 20$: MOV R0, (R3)+ ; move in first word of instruction MOV R1, (R3)+ ; second word of instruction MOV R2, (R3)+ ; third word of instruction SOB R4, 20$ ; continue until all loaded MOV #$NPAS, R4 ; number of times through the loop ; LDF #1, AC0 ; load floating point for some ; LDF #1, AC2 ; tests. MOV #IOSB, R0 ; need this for some modes MOV R0, R3 ; this also GTIM$S #STRTIM ; time test starts ISTRT:: .REPT $NREAL ; this number of instructions NOP ; filled with real instructions above NOP NOP .ENDR DEC R4 ; count number of passes BLE TIMES ; quit if enough passes JMP ISTRT ; otherwise continue TIMES:: GTIM$S #ENDTIM ; time test ends MOV #ERMS2, R0 MOV #STRTIM, R1 CALL WRITIM MOV #ERMS3, R0 MOV #ENDTIM, R1 CALL WRITIM TST INTRNL ; are we in abort AST? BNE EXIT ; quit if in abort AST JMP BEGIN ; otherwise go on EXIT:: MOV #STABUF, R4 CALL ERMSG ; write out byebye message EXIT$S ; byebye WRITIM: MOV R0, R4 ; copy address for ERMSG CALL $DAT ; convert date MOVB #40, (R0)+ ; blank space MOV #5, R2 ; convert all times CALL $TIM ; convert time CALL ERMSG ; write it out RETURN ERMSG:: QIOW$S #IO.WLB, #5, #5,,,, ; Print error message RETURN ABOAST:: ADD (SP), SP ; clean up stack DEC INTRNL ; mark as abort JMP TIMES ; write out times ENDWRD:: .BLKW 2 ; data at other end of program .END START