Administrator
|
That's a good question. Those three probably do a pretty good job, but there will always be some uncertainly -- and that's true of "real" software products even more so.
You could write a program (or a series of programs) that test every possible instruction. This is possible because the ISA for Hack is so small. There are only 1792 legal C-type instructions.
The most likely oversight you might have made -- and that could bite you later in the project -- is not properly allowing for all of the legal identifiers. So make sure that you are properly allowing for not only the letters and digits, but also the special characters {.,_,$,:}, including identifiers that start with any of these (except digits). Also that your identifiers are case sensitive. You can do a reasonable test for this with a small program by just examining the .hack file.
You also want to make sure that your variables are properly being assigned to RAM locations starting at address 16. That same small program should allow you to verify this.
|