I am at a specific part in my code that is baffling me.
Here is four lines of a code snippet that seems to be the cause for weird behavior.
"
@KBD
D=M // [KBD] --> D
@LIGHT
D;JEQ // If NO key is pressed, Jump to (LIGHT) ELSE continue with next instruction
"
What I think happens is it checks for a keypress (this part works, and the value is moved to D). If no key is pressed, it jumps to a later section of code that is called (LIGHT). That also works.
Where it fails horribly is in the blank line of code that's mysteriously inserted into the ROM code right after this last D;JEQ line. Once that's executed, the PC moves to the ROM address that equals the ASCII code of the key pressed. If I hold down an "A" while it's executing automatically, suddenly the PC jumps to line 65. If I use F11 to move line by line, i'm now at empty ROM address 151.
If anyone would like a copy of my whole original fill.asm code, I'll be happy to send it! My email address is rcollins0618 (AT) gmail (D0T) com.
I think I must have messed up the syntax or something in my code and it's probably staring me right in the face, but i don't know what I did wrong.
HELP!?!
Thanks,
Rich :)
"If you wish to make an apple pie from scratch, you must first invent the universe." - Carl Sagan