|
So I've been working on an optimizing VMTranslator for way too long now. So far it's passed all of the tests supplied in projects 7 and 8, and it generates a Pong.asm file of only around 17k lines without any dead code removal. But this Pong.asm always fails to run on the CPUEmulator.
I've gone through several debugging attempts and fixed errors whenever I got an illegal memory address. But now, I've reached a point where Sys.halt is being called and execution ends on an infinite loop. Obviously, some part of the code is going into Sys.error, which in turn calls Sys.halt. I'm trying some debugging techniques still to trace which function is causing the error, but I feel like Pong is a way too big a leap from FibonacciElement, and the code is so long it's impossible to find errors by stepping code one line at a time.
So my question is, can anyone recommend an intermediate program, more complex than Fibonacci, but not as complex as Pong, to help with debugging? I haven't even started on the compiler or jack yet (which yes, I know is bad, but I've been having a lot of fun with optimizing VM) so I don't have any programs of my own.
|