cltst: mov 1, prf[11] mov 1, prf[13] nt: mov wlk0, tdgen ; call walking 0 test_routine mov iwlk0, itdgen mvpcr +2, return2 jmp cc_uncond, tstgio mov wlk1, tdgen ; call walking 1 test_routine mov iwlk1, itdgen ; mvpcr +2, return2 jmp cc_uncond, tstgio mov psr, tdgen ; call pseudo random vector test_routine mov ipsr, itdgen mvpcr +2, return2 jmp cc_uncond, tstgio add prf[13], c3, prf[13] ; next initial vectors for all shl 1, prf[11], prf[11] ; testing routines jmp cc_carry, return1 mov bitnum work mov 15 rdata mov prf[11] prf[0] cmp rdata bitnum jmpr cc_ncarry 3 shl 15 prf[0] prf[0] sub work rdata work shlt work, prf[0] ; if MSB of the current register tested is set - stop! jmp cc_ncarry, nt jmp cc_uncond return1 ; END OF THE TESTING ROUTINE ; BEGIN OF THE SUBROUTINE (used by testing routine above) ; rolls all addresses and tests by w/r through GIO tstgio: mvpcr +2, return3 jmp cc_uncond, itdgen ; go to init the test data gen ; BEGIN WRITING THE TEST PATTERN mov firstaddress, ioaddr wd: jmpr cc_busy, 0 sgio+ tdata ; writing the test data in current address mvpcr +2, return3 ; runs the generator returning test vector jmp cc_uncond, tdgen cmp ioaddr, lastaddress ;IADEND ; is the last address reached? jmp cc_carry, wd ; if yes: ; BEGIN COMPARING PART OF CODE mov firstaddress, ioaddr mvpcr +2, return3 jmp cc_uncond, itdgen ; and go to init for testing wc: jmpr cc_busy, 0 ; here is the body of the cycle lgio+ 0; ; reading each address and jmpr cc_busy, 0 ; comparing the result with lpio 0x300, rdata ; data stored befor cmp rdata, tdata ; jmp cc_zero, noerr ; if err_or detected add errnum, c1, errnum ; errnum is incremented noerr: mvpcr +2, return3 jmp cc_uncond, tdgen ; get next test_data to compare with cmp ioaddr, lastaddress ; is tne last address tested? jmp cc_carry, wc ; if not go to wc jmp cc_uncond, return2 ; prepares the next data - walking 1 wlk1: shl 1, tdata, tdata and tdata, psrmask, tdata jmp cc_nzero, return3 mov 1, tdata jmp cc_uncond, return3 ; end of walking 1 ; prepares the next data - walking 0 wlk0: com tdata, tdata shl 1, tdata, tdata and tdata, psrmask, tdata jmpr cc_nzero, +2 mov 1, tdata com tdata, tdata and tdata, psrmask, tdata jmp cc_uncond, return3 ; end of walking 0 ; prepares the next data by pseudo random generator psr: lpio 0x202, tdata and tdata, psrmask, tdata jmp cc_uncond, return3 ; end random generator ; init walking 1 iwlk1: mov prf[11], tdata jmp cc_uncond, return3 ; init walking 0 iwlk0: com prf[11], tdata and tdata, psrmask, tdata jmp cc_uncond, return3 ; init psr ;#ifdef trap3 ipsr: mov b1_0_0_00_01_11111, tdata ;#else ;ipsr: mov b1_0_0_00_01_1111, tdata ;#endif mov 31 prf[0] sub prf[0] bitnum prf[0] ;#ifdef trap3 ;#else ; cmp prf[0] 16 ; jmpr cc_carry 2 ; mov 15 prf[0] ;#endif or tdata prf[0] tdata spio tdata, 0x201 mov prf[13], tdata spio tdata, 0x200 nop nop lpio 0x202, tdata jmp cc_uncond, return3