.Title ASHTST A program to check the ASH and ASHC instructions ;#: 53878 S7/Hardware Hints ; 27-Jan-88 20:41:34 ;Sb: #DL7 Upload.. ;Fm: Terry Compton 70010,211 ;To: Eli Willner (Software) 76703,500 (X) ; ;Eli, ; ;There is a file in DL7's inbox called ASHTST.MAC.. it's a short program to run ;under RT11 / TSX to see if the CPU you are running contains a defective J11 ;chip.. all known J11 products.. PRO380's, 11/53's, 11/73's, 11/83's, 11/84's.. ;[you get the idea..] have problems with the ASH and ASHC instructions. ; ;Monty wanted to see this, and for my own information, I'd like everyone that ;can to run this and let me know if *YOUR* cpu is defective.. ; ;Terry ; ;1 Reply .Enabl mcl .Ident /v01jtc/ .Mcall .print psw = 177776 start: .print #m0 ;Say testing ASH ; clr @#psw ;CLR the PSW to start mov #table1,r1 ;Use the OLD J11 table to start mov 2(r1),r2 ;Load the value to be shifted call showi1 ;Show initial values scc ;SET all the condition codes ash (r1),r2 ;Shift them suckers! mov psw,pswsav ;Grab the PSW of the result bic #177760,pswsav ;Strip off MMGT bits.. cmp pswsav,4(r1) ;Check it against the table beq 1$ ;Well? mov #table3,r1 ;Wasn't the old one, new one? cmp pswsav,4(r1) ;Check it against the table bne 2$ ;Well? call show1 ;Show the results.. .print #msdcjb ;Wasn't the old one, new one? jmp test2 ;Check ASHC now.. 1$: call show1 .print #msdcja ;We got an old J11 chip.. jmp test2 2$: call show1 ;show the results anyway.. .print #dunno ;Beats me what it is.. ;carry on in any case.. test2: .print #m1 ;Say testing ASHC ; clr @#psw ;CLR the PSW to start mov #table2,r1 ;Use the old J11 ASHC table to start mov 2(r1),r2 ;Setup the high order bits mov 4(r1),r3 ;Setup the low order bits call showi2 ;Show initial values scc ;SET all the condition codes ashc (r1),r2 ;Shift them suckers! mov psw,pswsav ;Grab the results in the PSW bic #177760,pswsav ;Strip off MMGT bits.. cmp pswsav,6(r1) ;Check PSW results against the table beq 1$ ;Well? mov #table4,r1 ;Wasn't the old one, new one? cmp pswsav,6(r1) ;Check it against the table bne 2$ ;Well? call show2 ;Show the results.. .print #msdcjb ;Wasn't the old one, new one? jmp fin ;we're out of here! 1$: call show2 .print #msdcja ;We got an old J11 chip.. jmp fin 2$: call show2 ;show the results anyway.. .print #dunno ;Beats me what it is.. ;carry on in any case.. fin: .exit ;Sigh.. showi1: .print #hed1 .print #init ; mov (r1),r0 ;Print the SHIFT count call prtoct .ttyout #40 ;space.. mov #17,r0 ;Print the inital PSW value call prtoct .ttyout #40 ;space.. mov r2,r0 ;Print the value to be shifted call prtoct .ttyout #40 ;space.. .print #crlf .print #right1 ;Print the correct answers return show1: .print #exp ; mov (r1),r0 ;Print the SHIFT count call prtoct .ttyout #40 ;space.. mov 4(r1),r0 ;Print the expected PSW value call prtoct .ttyout #40 ;space.. mov 6(r1),r0 ;Print the expected return value call prtoct .ttyout #40 ;space.. .print #crlf .print #ret mov (r1),r0 ;Print the SHIFT count call prtoct .ttyout #40 ;space.. mov pswsav,r0 ; call prtoct ;Print the actual PSW returned .ttyout #40 ;space.. mov r2,r0 ;Print the actual returned value call prtoct .ttyout #40 ;space.. .print #crlf cmp 4(r1),pswsav ;See if the results are as expected.. beq 1$ br 3$ 1$: cmp 6(r1),r2 beq 2$ 3$: .print #ugly return 2$: cmp r1,#table1 beq 4$ .print #good return 4$: .print #bad return showi2: .print #hed2 .print #init mov (r1),r0 ;Print the SHIFT count call prtoct .ttyout #40 ;space.. mov #17,r0 ;Print the initial PSW call prtoct .ttyout #40 ;space.. mov r2,r0 ;Print the initial high order value call prtoct .ttyout #40 ;space.. mov r3,r0 ;Print the initial low order value call prtoct .ttyout #40 ;space.. .print #crlf .print #right2 ;Print the correct answers return show2: .print #exp ; mov (r1),r0 ;Print the SHIFT count call prtoct .ttyout #40 ;space.. mov 6(r1),r0 ;Print the expected PSW value call prtoct .ttyout #40 ;space.. mov 10(r1),r0 ;Print the expected high order value call prtoct .ttyout #40 ;space.. mov 12(r1),r0 ;Print the expected low order value call prtoct .ttyout #40 ;space.. .print #crlf .print #ret mov (r1),r0 ;Print the SHIFT count call prtoct .ttyout #40 ;space.. mov pswsav,r0 ;Print the returned PSW value call prtoct .ttyout #40 ;space.. mov r2,r0 ;Print the returned high order value call prtoct .ttyout #40 ;space.. mov r3,r0 ;Print the returned low order value call prtoct .ttyout #40 ;space.. .print #crlf cmp 6(r1),pswsav ;See if the results are as expected.. beq 1$ br 4$ 1$: cmp 10(r1),r2 beq 2$ br 4$ 2$: cmp 12(r1),r3 beq 3$ 4$: .print #ugly return 3$: cmp r1,#table2 beq 5$ .print #good return 5$: .print #bad return PRTDEC:: ;This will .PRINT the value in R0 ;as a DECIMAL number... MOV R1,-(SP) ;Save R1 - R2, R0 is used.. MOV R2,-(SP) MOVB #48.,@#BUFSTA MOVB #48.,@#BUFSTA+1 MOVB #48.,@#BUFSTA+2 MOVB #48.,@#BUFSTA+3 MOVB #48.,@#BUFSTA+4 MOV #BUFEND,R2 ;End of buffer MOV R0,R1 ;Make a copy 1$: CLR R0 ;Make zero for DIV DIV #10.,R0 ;Get LSD ADD #48.,R1 ;Make the remainder ASCII MOVB R1,-(R2) ;Save the digit MOV R0,R1 ;Set for next DIV BNE 1$ ;Do it again .PRINT #BUFSTA ;PRINT it MOV (SP)+,R2 ;Put the REG's back MOV (SP)+,R1 RETURN PRTOCT:: ;This will .PRINT the value in R0 ;as an OCTAL number... MOV R1,-(SP) ;Save R1 - R3, R0 is used.. MOV R2,-(SP) MOV R3,-(SP) MOV #EOB,R2 ;End of the buffer to print MOV #6,R3 ;6 Chars to output 1$: MOV R0,R1 ;Make a copy of R0 BIC #177770,R1 ;Peel off a digit ADD #'0,R1 ;Make ASCII out of it MOVB R1,-(R2) ;Save the digit CLC ;Clear C ROR R0 ;Rotate up the next digit ASH #-2,R0 ;Get rid of the used stuff SOB R3,1$ ;Do it again.. .PRINT #CBUFF ;Print it, cause we did 'em all! MOV (SP)+,R3 ;Put the REG's back MOV (SP)+,R2 MOV (SP)+,R1 RETURN .REM | Tables 1 and 2 below contain test values which are legal that will produce incorrect operation of the ASH and ASHC instructions. The table contains the *EXPECTED* results from the older KDJ11 CPU's using the pre -09 J11 chips. Note that the values that are returned *ARE* wrong, but they are the values the CPU will return, and are in fact the values that the DEC XXDP DIAGNOSTIC, OKDAD0/E0 are coded with. In short, DEC has known since before July of 1984 that the ASH and ASHC instructions in the J11 chip return incorrect values under these conditions. | table1: ; .word 37 ;Shift left 31 places .word 177737 ;Shift left 31 places .word 177777 ;Value to be shifted .word 11 ;Expected PSW on old style J11 .word 177777 ;Expected result of shift operation table2: ; .word 37 ;Shift left 31 places .word 177737 ;Shift left 31 places .word 177777 ;Low order value to shift .word 177774 ;High order value to shift .word 11 ;Expected PSW on old style J11 .word 177777 ;Expected low order result .word 177777 ;Expected high order result .REM | Tables 3 and 4 below contain the same test values. They work properly on the 11/23 and new KDJ11 CPU's using the -09 J11 chips.. and given the description of the way the ASH and ASHC instructions are supposed to operate, are the *CORRECT* return values. | table3: ; .word 37 ;Shift left 31 places .word 177737 ;Shift left 31 places .word 177777 ;Value to be shifted .word 6 ;Expected PSW on *NEW* style J11 .word 0 ;Expected result of shift operation table4: ; .word 37 ;Shift left 31 places .word 177737 ;Shift left 31 places .word 177777 ;Low order value to shift .word 177774 ;High order value to shift .word 6 ;Expected PSW on *NEW* style J11 .word 0 ;Expected low order result .word 0 ;Expected high order result pswsav: .word 0 ;Save the PSW here.. msdcja: .asciz /This CPU's returns and PSW matches an old style J11!/ msdcjb: .asciz /This CPU's returns and PSW matches a new style J11!!/ dunno: .asciz /This CPU's returns and PSW matched nothing we know?!/ good: .asciz /The PSW and results are correct!!/ bad: .asciz /The PSW and results are broken.../ ugly: .asciz /The PSW and results are unknown?!/ m0: .asciz <12><15>/Testing ASH operation... ASH (R1),R2/<12><15> m1: .asciz <12><15>/Testing ASHC operation.. ASHC (R1),R2/<12><15> hed1: .asciz / (R1) PSW R2/ hed2: .asciz / (R1) PSW R2 R3/ init: .ascii /Initial values are: /<200> exp: .ascii /Expected values are: /<200> ret: .ascii /Returned values were: /<200> crlf: .asciz / / right1: .asciz /Correct returns are: 177737 000006 000000/ right2: .asciz /Correct returns are: 177737 000006 000000 000000/ .even BUFSTA: .BYTE 48.,49.,50.,51.,52. ;5 digits of out BUFEND: .BYTE 200 ;Make no do CRLF CBUFF: .BLKB 6 ;6 digits EOB: .BYTE 200 ;Make no do CR LF .EVEN .end start