AS8 assembler for intel 8008, t.e.jones Version 1.0 Options: listfile=1 debug=0 binaryout=0 singlelist=1 octalnums=0 markascii=0 Infile=memtst Assembly Performed: Sat Jan 15 19:10:06 2005 Line Addr. DAT Source Line ---- ------ --- ---------------------------------- 1 ;;; This 8008 program will test memory. Basically, it writes 2 ;;; pseudo-random byte values to all of memory (except the part 3 ;;; where this program resides) and then reads each byte back, 4 ;;; to see if the read value is correct. It repeats this 207 5 ;;; times, which is once for each possible random bit pattern. 6 ;;; 7 ;;; When the program finds an error in the read value, it will 8 ;;; display the bit on the output led display (port 0), and halt. 9 ;;; The operator then interrupts a NOP code (or LAA 300) onto the 10 ;;; control panel, and the program displays the high-byte of the 11 ;;; address of the error, and again halts. The operator interupts 12 ;;; in another NOP code, and the program continues. 13 ;;; 14 ;;; While running, the program can either display the count of the 15 ;;; number of cycles (about 4 minutes/cycle for 1K or 45 minutes 16 ;;; for 16K) or the program can display the random number seed for 17 ;;; the current pass (a much more interesting display, of 207 byte 18 ;;; values. 19 20 21 22 00-000 016 LBI 0 ; B will count number of complete cycles. 00-001 000 23 00-002 036 START: LDI 001 ; D Is random number seed for this pass. 00-003 001 24 00-004 026 LCI 004 ; C IS HIGHEST 6 BITS OF MEMTOP+1 00-005 004 25 ; (1 for 256, 4 for 1K, 64 for 16K.) 26 00-006 056 NXTPAS: LHI \HB\ENDPRG ; Load HL with the starting address to test 00-007 000 27 00-010 066 LLI \LB\ENDPRG ; (the address right after this program 00-011 116 28 ; LAB ; Uncomment this line to display cycle count 29 00-012 303 LAD ; Uncomment this line to display seed 30 00-013 121 OUT 0 ; Display the cycle count or seed for pass. 31 00-014 343 LED ; Load E with the random number 32 00-015 106 WRNEXT: CAL RANDOM ; GET RAND, LOAD INTO MEMORY 00-016 104 00-017 000 33 00-020 370 LMA 34 00-021 060 INL 35 00-022 110 JFZ WRNEXT 00-023 015 00-024 000 36 00-025 050 INH 37 00-026 305 LAH 38 00-027 272 CPC ; Compare H with Memory Top 39 00-030 110 JFZ WRNEXT ; If not done, write more 00-031 015 00-032 000 40 41 00-033 056 READIT: LHI \HB\ENDPRG 00-034 000 42 00-035 066 LLI \LB\ENDPRG ; Set HL to srarting point again. 00-036 116 43 00-037 343 LED ; Reset seed again 44 00-040 106 NXTLOC: CAL RANDOM 00-041 104 00-042 000 45 00-043 257 XRM 46 00-044 150 JTZ OKAY 00-045 066 00-046 000 47 00-047 121 OUT 0 ; Error Found, Display Bad Bit and Halt 48 00-050 001 HLT 49 00-051 305 LAH 50 00-052 121 OUT 0 51 00-053 001 HLT ; Display High Address and Halt 52 00-054 060 INL 53 00-055 110 JFZ NXTLOC 00-056 040 00-057 000 54 00-060 050 INH 55 00-061 305 LAH 56 00-062 272 CPC 57 00-063 110 JFZ NXTLOC 00-064 040 00-065 000 58 00-066 343 OKAY: LED ; Gets here if read value is correct 59 00-067 106 CAL RANDOM 00-070 104 00-071 000 60 00-072 334 LDE ; Save Seed for next pass. 61 00-073 074 CPI 001 ; When seed returns to one, we've done all 00-074 001 62 00-075 110 JFZ NXTPAS ; 207 combos, and we're done with pass. 00-076 006 00-077 000 63 00-100 010 INB ; Increment cycle counter 64 00-101 104 JMP START ; Do another full cycle of program. 00-102 002 00-103 000 65 66 ;;; Here is the Pseudo-Random Number Generator. It takes a Seed in 67 ;;; the E register, and replaces it with the new pseudo-random 68 ;;; sequence. The seqence generates 207 possible values, so after 69 ;;; calling it 207 times, E will contain the original seed. 70 71 00-104 304 RANDOM: LAE ; THE PSEUDORANDOM NUMBER 72 00-105 032 RRC ; GENERATOR, MAKES A SEQUENCE 73 00-106 032 RRC ; OF 207 OF POSSIBLE 256 VALUES. 74 00-107 032 RRC 75 00-110 254 XRE 76 00-111 012 RAR 77 00-112 304 LAE 78 00-113 032 RRC 79 00-114 340 LEA 80 00-115 007 RET 81 ENDPRG: ; THIS MARKS WHERE TO START TESTING MEM Symbol Count: 8 Symbol Oct Val DecVal ------ ------- ------ START 002 2 NXTPAS 006 6 WRNEXT 015 13 READIT 033 27 NXTLOC 040 32 OKAY 066 54 RANDOM 104 68 ENDPRG 116 78