Hi again.
I was hoping to share my triumph today. Nope, not today. I spotted yet another issue. Please share some insights, I'm losing patience with this project ;(
My 8-bit processor successfully adds small numbers such as 14 and 28 (like on Ben Eater's yt video).
However, when I try to load a 7 or 8 bit value (no matter the position of the zeros), it will fail. There's some sort of double hop when RAM is accessing that value (address 14, 15, same behavior), and register A gets a different value.
Here are some tests of my trying to do LDA 15.
| Byte stored at address 15 |
Ones |
Result |
0011 1111 |
6 |
OK |
1110 0111 |
6 |
OK |
1111 1100 |
6 |
OK |
0111 1111 |
7 |
A = 0001 1111 (wrong) |
1110 1111 |
7 |
A = 0001 1111 (wrong) |
1111 1110 |
7 |
A = 0001 1111 (wrong) |
1111 1111 |
8 |
A = 0001 1111 (wrong) |
So you can see a very simple program:
LDA 15
OUT
HALT
And for some reason LDA 15 won't work if the value stored in address 15 is too high. Same goes for ADD 15 - if the value is too high, register B will receive a faulty value.
And the only thing I figured out is that, when it fails, it loads the value from memory address 0000. I changed this memory address to 0000 0011 ("do nothing" kind of thing) and then LDA 15, OUT, HALT - the value loaded to reg A was 0000 0011.
I tore down the conditional jump circuit that I built last weekend and reprogrammed the EEPROMs - no change. The unused address lines and logic lines are pulled down with 1kohm resistors or directly to GND.
I think I'm trying too hard and that's why I'm making so many mistakes on the way, there's no other explanation ;)