; Test program for D-bank memory ; CPU0 performs full test of the all D-bank locations. ; The number of the errors is stored in CONST8 - address 0xC00 in GIO-space. ; DEFINITIONS, USED IN THE PROGRAM CODE: #def work=PRF[1] ; register for current operations (CO) #def rdata=PRF[2] ; data red by test_programs and CO #def tdata=PRF[3] ; test_vector to be writen #def errnum=PRF[4] ; contains the number of err_ors #def return1=PRF[5] ; return address (at first level) #def return2=PRF[6] ; return address (at second level) #def return3=PRF[7] ; return address (at third level) #def tdgen=PRF[8] ; test data generator code label #def itdgen=PRF[9] ; init tdgen code label #def psrmask=PRF[10] ; mask for test_vector #def bitnum=PRF[12] ; =32 minus the number of bits of the tested area ; prf11 and prf13 are used inside the testing routine #def ioaddr=PRF[14] ; contains the autoincrementing address of I/O operations through GIO #def errstore=PRF[15] ; autoincrement address for RAM-access #def firstaddress=grf[1] ; first address of the tested area #def lastaddress=grf[2] ; last address of the tested area #def MEMRW=0xD000 ; the address of the register, controling R/W operations of IMEM/DMEMs #def IAFIRST=0xE000 ; first address of IMEM #def IADEND =0xEFFF ; last address of IMEM #def DAFRSTG=0xE000 ; first address of DMEM via GIO #def DADENDG=0xE3FF ; last address of DMEM via GIO #def DAFIRST=0x0000 ; first address of DMEM as RAM #def DADEND =0x0FFC ; last address of DMEM as RAM #def DBFST=0xF000 ; first address of DBANK (trap3) #def DBEND=0xF0FF ; last address of DBANK (trap3) ; masks of certain length #def BITMASK24=0x0FFFFFF #def BITMASK32=0xFFFFFFFF #def BITMASK12=0x00000FFF #def BITMASK13=0x00001FFF start: nop #ifdef cpu0 mov c0 errnum ; clear the err_or_counter ;#ifdef trap3 ; DBANK test here iext DBFST mov DBFST firstaddress iext DBEND mov DBEND lastaddress mov c0 bitnum iext BITMASK32 mov BITMASK32 psrmask mvpcr +2, return1 jmp cc_uncond cltst ;#endif jmpr cc_busy 0 sgio errnum 0xC00 ; store the err_ornum in c8 and ... lp: jmpr cc_busy, 0 ; ... transition into ... iext 0x0A20 mov 0x0A20, work shl +1, c5, rdata add work, rdata, work mov b0_0111, rdata sgio rdata, work jmpr cc_busy, 0 sgio rdata 0xA20 mov 0x012, work sgio work, 0xA04 ; ... low power mode end: jmp cc_uncond, end ; END OF THE ENTIRE PROGRAM #inc "TST.asm" #endif