+9640News Posted March 13, 2022 Share Posted March 13, 2022 I have a need for a piece of code that thoroughly tests memory that scans a full 8K memory range. The code will be called multiple times, and must fit in >80 bytes of memory in the onboard TMS9995 ram including the workspace for the code. Thus, I must be able to point to the start of the piece of code, and the end of the code, and copy that piece of code into the 9995 RAM. At the completion of the test, the word in that memory range must be restored as it may or may not be program code that would need to be executed upon exiting from the routine. The routine can exit with either a B *R11 or RTWP. If there is an error on a memory word/byte test, then a 16 bit counter outside that routine would be incremented by one and one can then exit. It's possible that there may be no RAM in the memory range, so I do not need 8192 errors, rather, just a single error on the first occurence and then one can exit the routine. What I am trying to do is run a test of the Geneve memory across a total of 256 memory pages I will map from outside the onboard RAM routine and will disable interrupts before entry to the code. I am trying to duplicate Ron Walter's MEMTEST program that stays in a continuous loop retesting memory for errors over and over. If anyone has a good piece of code that does the test, I would appreciate it. Beery Quote Link to comment Share on other sites More sharing options...
+jedimatt42 Posted March 13, 2022 Share Posted March 13, 2022 I would recommend going to ti99-geek.nl, under "Projects", then "Memory Test Program(s)" https://ti99-geek.nl/ (Fred's site design discourages deep linking) He has an entire thesis written there about memory testing with various assembly bits... 7 Quote Link to comment Share on other sites More sharing options...
Willsy Posted March 13, 2022 Share Posted March 13, 2022 (edited) This is what I came up with. I think it is 44 bytes (>2C) bytes. Note: It is untested, but should work from what I can tell. AORG >some_address ; address of the 8k memory to test should be in r0 memchk li r1,8192 ; number of bytes to test next li r2,>aaaa ; first test value mov *r0,r3 ; save the memory contents mov r2,*r0 ; load memory with first test value mov *r0,r4 ; read it back c r4,r2 ; are they the same? jne bad ; if not then jump src r2,1 ; change the test value (is now >5555) mov r2,*r0 ; load memory with the test value mov *r0,r4 ; read it back c r4,r2 ; are they the same? jne bad ; if not then jump mov r3,*r0 ; restore the memory to previous contents inct r0 ; move to next memory location dect r1 ; finished? jne next clr r0 ; passed all tests bad b *r11 ; return to caller Call it with a BL @MEMCHK. When the routine returns to the caller: If R1 is 0, then all tests passed If R1 <> 0, then the test failed. The address of the bad memory location is in R0. It stops on the first bad memory address. It tests using the values >AAAA (1010101010101010) and >5555 (0101010101010101) - so it tests all bits for both a 1, and a 0. However, please note, it does not tell you which bit failed. You'd need a walking 1's and 0's test for that. It can be copied into the 9995's memory with loop similar to this: li r0, MEMCHK li r1, tms9995_memory_addr li r2, 44 loop mov *r0+,*r1+ dec r2 jne loop Edited March 13, 2022 by Willsy Bug: Changed DEC R1 to DECT R1 4 Quote Link to comment Share on other sites More sharing options...
+9640News Posted March 13, 2022 Author Share Posted March 13, 2022 @jedimatt42 and @Willsy I thank you for the link and the references. Willsy, I think that piece of code will be exactly what I need. Much appreciated. Beery Quote Link to comment Share on other sites More sharing options...
RXB Posted March 13, 2022 Share Posted March 13, 2022 You could write your own RXB program to test any type of memory GRAM/VDP/RAM instead? MOVES subprogram PAGE M7 ------------------------------------------------------------- Format CALL MOVES(type$,bytes,string-variable,string- variable[,...]) CALL MOVES(type$,bytes,from-address,to-address [,...]) CALL MOVES(type$,bytes,from-address,string- variable[,...]) CALL MOVES(type$,bytes,string-variable,to- address[,...]) CALL MOVES(string-variable,number,string- variable,string-variable[,...]) Description The MOVES subprogram moves (copies) FROM TO the amount of bytes specified using the memory type string. MOVES does not physically move memory but copies it. MOVES can RIPPLE a byte thru memory by the from-address being one byte less than the to address. The type$ below specifies what type of memory is being moved and to what other type of memory it is moved into. The bytes are 255 maximum if being moved into a string- variable. MOVES address range is from -32768 to 0 to 32767 As MOVES mostly works with string-variables see the Extended Basic Manual page 41. MOVES will error out with * BAD VALUE IN ###* in a program if the string variable length exceeds 255, or if the number of bytes exceeds 255. type$ TYPE OF MEMORY ~~~~~ ~~~~~~~~~~~~~~~ $ ------------- STRING-VARIABLE V ------------- VDP ADDRESS R ------------- RAM ADDRESS G ------------- GRAM ADDRESS *NOTE: upper case only for type as lower case are ignored. VDP address are from 0 to 16384 (>0 to >3FFF) MOVES PAGE M8 ------------------------------------------------------------- RAM may be moved but not into ROM, and that you may move memory into GRAM but not GROM. You can copy or move memory from ROM or GROM. Also note that any devices that use phony GRAM will not work with MOVES as these devices don't use the Programs Line 100 has the type$ string.| >100 X$="VV" Line 110 thus uses type$ 0 VDP| >110 CALL MOVES(X$,767,1,0) to VDP. 767 bytes are moved. A| VDP from-address of 1 and a | VDP to-address of 0. Will use | a ripple effect of moving all | screen bytes over one address.| | Line 100 copies entire screen | >100 CALL MOVES("VR",768,0,81 into lower 8K. | 92) | Line 110 clears the screen. | >110 CALL CLEAR Line 120 copies entire screen | >120 CALL MOVES("VR",768,0,90 into lower 8K. | 00) Line 130 copies from lower 8K | >130 CALL MOVES("RV",768,8192 to screen, then again. GOTO | ,0,"RV",768,9000,0) :: GOTO makes it an endless loop. | 130 | Line 100 sets up loop. Counts | >100 FOR G=-32768 TO 32767 from -32768 to 0 to 32767 or | (HEX >8000 to >0000 to >7FFF) | Line 110 move GRAM/GROM to | >110 CALL MOVES("GV",8,G,1024) VDP. 8 bytes to be moved. GA | is counter. 1024 is decimal | address of space character in | VDP pattern table. | Line 120 completes loop. | >120 NEXT G | | Loop address VDP | >100 FOR V=0 TO 16384 Load that 8 bytes into space | >110 CALL MOVES("VV",8,V,1024) Loop back | >120 NEXT V | A simple XB program that will test any type of memory you could write yourself. Quote Link to comment Share on other sites More sharing options...
+9640News Posted March 13, 2022 Author Share Posted March 13, 2022 7 minutes ago, RXB said: You could write your own RXB program to test any type of memory GRAM/VDP/RAM instead? MOVES subprogram PAGE M7 ------------------------------------------------------------- Format CALL MOVES(type$,bytes,string-variable,string- variable[,...]) CALL MOVES(type$,bytes,from-address,to-address [,...]) CALL MOVES(type$,bytes,from-address,string- variable[,...]) CALL MOVES(type$,bytes,string-variable,to- address[,...]) CALL MOVES(string-variable,number,string- variable,string-variable[,...]) Description The MOVES subprogram moves (copies) FROM TO the amount of bytes specified using the memory type string. MOVES does not physically move memory but copies it. MOVES can RIPPLE a byte thru memory by the from-address being one byte less than the to address. The type$ below specifies what type of memory is being moved and to what other type of memory it is moved into. The bytes are 255 maximum if being moved into a string- variable. MOVES address range is from -32768 to 0 to 32767 As MOVES mostly works with string-variables see the Extended Basic Manual page 41. MOVES will error out with * BAD VALUE IN ###* in a program if the string variable length exceeds 255, or if the number of bytes exceeds 255. type$ TYPE OF MEMORY ~~~~~ ~~~~~~~~~~~~~~~ $ ------------- STRING-VARIABLE V ------------- VDP ADDRESS R ------------- RAM ADDRESS G ------------- GRAM ADDRESS *NOTE: upper case only for type as lower case are ignored. VDP address are from 0 to 16384 (>0 to >3FFF) MOVES PAGE M8 ------------------------------------------------------------- RAM may be moved but not into ROM, and that you may move memory into GRAM but not GROM. You can copy or move memory from ROM or GROM. Also note that any devices that use phony GRAM will not work with MOVES as these devices don't use the Programs Line 100 has the type$ string.| >100 X$="VV" Line 110 thus uses type$ 0 VDP| >110 CALL MOVES(X$,767,1,0) to VDP. 767 bytes are moved. A| VDP from-address of 1 and a | VDP to-address of 0. Will use | a ripple effect of moving all | screen bytes over one address.| | Line 100 copies entire screen | >100 CALL MOVES("VR",768,0,81 into lower 8K. | 92) | Line 110 clears the screen. | >110 CALL CLEAR Line 120 copies entire screen | >120 CALL MOVES("VR",768,0,90 into lower 8K. | 00) Line 130 copies from lower 8K | >130 CALL MOVES("RV",768,8192 to screen, then again. GOTO | ,0,"RV",768,9000,0) :: GOTO makes it an endless loop. | 130 | Line 100 sets up loop. Counts | >100 FOR G=-32768 TO 32767 from -32768 to 0 to 32767 or | (HEX >8000 to >0000 to >7FFF) | Line 110 move GRAM/GROM to | >110 CALL MOVES("GV",8,G,1024) VDP. 8 bytes to be moved. GA | is counter. 1024 is decimal | address of space character in | VDP pattern table. | Line 120 completes loop. | >120 NEXT G | | Loop address VDP | >100 FOR V=0 TO 16384 Load that 8 bytes into space | >110 CALL MOVES("VV",8,V,1024) Loop back | >120 NEXT V | A simple XB program that will test any type of memory you could write yourself. Rich, this was for running from MDOS so can't use RXB. 1 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.