learning67 wrote
Hi,
Thank you for doing such an incredible job with the course.
Unfortunately I haven't been able to debug this error, '*At line 32757;
can't continue past line*' and '*At line 30: Destination is M but A=24577
is an illegal address'*
I am unable to understand how it reaches 24577.
The code I have is:
...
@KBD //Checking the keyboard value
D=M
@AHEAD
D;JEQ //if the keyboard is equal to zero jump ahead
@-1 //else assign -1 to value
"@-1" is not a legal A-command. The number must be between 0 and 32767. Use the C-command "A=-1".
There is a bug in the CPU Emulator (and the supplied Assembler) that causes it to write a bad machine instruction for "@-1". This results in a wild jump and your program executes off the end of ROM resulting in the 32767 message.
When I fix that, your code runs without crashing, but does not do anything when a key is pressed.
There is a logic problem with your POINTER : SCREENEND comparison. Fix one instruction there and your program works.
[Please edit your post to remove the source code once your problem is resolved.]
--Mark