.ORIG x3000 TstAsgn4 AND R1,R1,#0 ST R1,NextVal ;; Test the eight special values SpLoop LD R1,NextVal ;; Load R0 with next special value LEA R2,Specials ADD R2,R2,R1 LDR R0,R2,#0 JSR CallFunc ;; Test function LD R1,NextVal ;; Store R0 with result LD R2,SpRstLoc ADD R2,R2,R1 STR R0,R2,#0 ADD R1,R1,#1 ST R1,NextVal ADD R2,R1,#-8 BRn SpLoop AND R1,R1,#0 ST R1,NextVal ;; Test the 128 regular values RegLoop LD R0,NextVal ;; Load R0 with next special value JSR CallFunc ;; Test function LD R1,NextVal ;; Store R0 with result LD R2,NrRstLoc ADD R2,R2,R1 STR R0,R2,#0 ADD R1,R1,#1 ST R1,NextVal LD R2,M128 ADD R2,R1,R2 BRn RegLoop HALT ;; Call test function with value placed in register R0 CallFunc LD R1,GVal ;; Mess up the registers before the call ADD R2,R1,R1 ADD R3,R2,R2 ADD R4,R3,R3 ADD R5,R4,R4 LD R6,TestLoc ST R7,RetAddr JSRR R6 LD R7,RetAddr RET RetAddr .BLKW x1 ;; Saved register R7 NextVal .BLKW x1 ;; Temporary location M128 .FILL #-128 GVal .FILL x109 ;; Location of the code to be tested TestLoc .FILL x3400 ;; Test results for the eight special values should all be 7 Specials .FILL x8000 .FILL x8020 .FILL xBEEF .FILL xFFFF .FILL #128 .FILL #255 .FILL x7FD0 .FILL x7FFF ;; Location to store the eight results of the special tests ;; These should all be zero SpRstLoc .FILL x3FF8 ;; Location to store the 128 results of the ASCII tests NrRstLoc .FILL x4000 ;; Value equal those of the big table .END