The RAM appears to be working ok. I haven't done an exhaustive test, but I'll get to that soon. I just wanted to make sure I could read/write using the legacy memory modes. I haven't checked out the new memory access modes yet. So I'm getting low on the things which may not be working. This means I may have to try more intricate tests. I figure why not try the fibonacci code with a slight modification. It would be slightly more interesting and use the RAM a little more.
// RAM tester
byteProgram(0x0000, 0x0000); // ld (0b0000, AC) // value to load into blinkenlights LEDs |OOOO|
byteProgram(0x0001, 0x1800); // ld (0x00, OUT) // Prepare XOUT update, hSync goes down, RGB to black
byteProgram(0x0002, 0x1840); // ld (0b01000000, OUT) // hSync goes up (bit 6), updating XOUT
byteProgram(0x0003, 0xC005); // st 0x05 [0x05] // write to RAM [0,D] where d=5 a value of 0x05
byteProgram(0x0004, 0x0105); // ld [0x05], AC // read from RAM [0,D] where d=5 to AC
byteProgram(0x0005, 0x1200); // ld (ac,x) // move AC to X
byteProgram(0x0006, 0x1800); // ld (0x00, OUT) // Prepare XOUT update, hSync goes down, RGB to black
byteProgram(0x0007, 0x1840); // ld (0b01000000, OUT) // hSync goes up (bit 6), updating XOUT and blinkenlights expect: |*0*0|
byteProgram(0x0008, 0xC40A); // st 0x0A,[x] // write to RAM [0,X] a value of 0x0A
byteProgram(0x0009, 0x0500); // ld [x] // read from RAM [0,X] to AC
byteProgram(0x000A, 0x1600); // ld ac,y // move AC to Y
byteProgram(0x000B, 0x1800); // ld (0x00, OUT) // Prepare XOUT update, hSync goes down, RGB to black
byteProgram(0x000C, 0x1840); // ld (0b01000000, OUT) // hSync goes up (bit 6), updating XOUT and blinkenlights expect: |0*0*|
byteProgram(0x000D, 0xC803); // st 0x03,[y,0x03] // write to RAM [Y,D] at 0x03 a value of 0x03
byteProgram(0x000E, 0x0903); // ld [y,0x03] // read from RAM [Y,D] where d=0 to AC
byteProgram(0x000F, 0x1800); // ld (0x00, OUT) // Prepare XOUT update, hSync goes down, RGB to black
byteProgram(0x0010, 0x1840); // ld (0b01000000, OUT) // hSync goes up (bit 6), updating XOUT and blinkenlights expect: |**00|
byteProgram(0x0011, 0xCC0E); // st 0x0E,[x,y] // write to RAM [Y,X] a value of 0x0E
byteProgram(0x0012, 0x0d00); // ld [y,x] // read from RAM [Y,X] to AC
byteProgram(0x0013, 0x1800); // ld (0x00, OUT) // Prepare XOUT update, hSync goes down, RGB to black
byteProgram(0x0014, 0x1840); // ld (0b01000000, OUT) // hSync goes up (bit 6), updating XOUT and blinkenlights expect: |0***|
byteProgram(0x0015, 0xFC00); // bra (0x00) // unconditional branch back to 0
byteProgram(0x0016, 0x0200); // nop // nop for pipelining simplification
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.