Trouble executing Pong.asm

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble executing Pong.asm

harshchikorde1234@gmail.com
I am getting a comparison error while executing the Pong.asm in the supplied assembler, it shows an error with a variable. I don't know how to debug it as my code for assembler works fine with other test programs! Also since the program is very long my terminal (command window) I think is deleting the previously printed comments which I had generated for my reference in the assembly code due to which I am unable to debug my code. Please suggest to me how to rectify this problem.

I can send you my code written in python 3 if you need it for inspection...
Reply | Threaded
Open this post in threaded view
|

Re: Trouble executing Pong.asm

Gerrit0
Given that it works for smaller programs, my first recommendation would be to take a look at your output size - is it small enough to fit in the ROM? If it isn't, I would expect any comparison from running it to give unexpected results.
Reply | Threaded
Open this post in threaded view
|

Re: Trouble executing Pong.asm

harshchikorde1234@gmail.com
No file size of pong.asm is 196Kb and generated Pong.hack file is around 500Kb. So what should I donow to rectify these issues, do you have something to suggest, please do so...
Reply | Threaded
Open this post in threaded view
|

Re: Trouble executing Pong.asm

WBahn
Administrator
The ROM can hold 32768 instructions and each instruction requires either 17 or 18 bytes in the .hack file (16 bits for the pattern of 1s and 0s and then either one (*nix) or two (DOS/Windows) bytes for the end-of-line character, depending on operating system.

Thus, on a Windows machine, anything under about 576 KB (~544 KB on *nix) should fit into the ROM.

Open the .hack file in an editor that will tell you how many lines are in it and see if it exceeds 32768.

It might also be a good idea to modify your assembler so that it reports the number of instructions in the resulting .hack file.

Could you elaborate on exactly what the error is that you are getting and what you are doing when you get it?
Reply | Threaded
Open this post in threaded view
|

Re: Trouble executing Pong.asm

harshchikorde1234@gmail.com
There is a variable in the Pong.asm "memory.0" which is to be registered in the symbol table and assigned an address(which the assembler code does for all test programs) but somehow in the Pong.asm it is assigning an address which is +1 of that which should be assigned! and this is causing comparison failure!!!!
but the same assembler code generates correct machine code for Rect.asm

I tried adding some more lines to the Rect.asm which adds more variables to the code for example(just for testing)
@add
@reas
@ds
 and when I executed it with my assembler code passes the comparison test on the given assembler.

And just before writing this mail I executed it once again, and now it passed the comparison test!!!

what exactly is wrong? I don't get it!
Does closing the terminal makes difference?