|
This post was updated on .
I was trying to debug my completed assembler last week, which was performing perfectly assembling all test programs...except Pong.asm. I would assemble it with the supplied assembler, then with mine. I would import both hack files into excel because the compare function in the assembler was just too slow for 28k or so lines.
The comparison found 98 lines with "errors", or that didn't match. I was lost on what was going wrong until i looked at exactly what specific instruction these 98 errors were in the Pong.asm file. They ended up being A-instructions involving a set of about 5-6 different variables (ie. @ponggame.0).
What was originially thought to be an error in the assembler was really just my assembler storing the (correct) PC address to a slightly differing location in RAM. My hash table implementation populates slightly differently. Testing my output hack files works as expected in the hardware simulator, pong works as expected.
I was just thinking there could be a better way to confirm a working or proper output hack file from your own assembler. Testing vs. the output of another assembler varied in my case as implementation of hash table had a slight variation and mislead me to think i had coded a broken assembler.
Any thoughts?
|