Originally posted by: Mario's Right Nut
Holy Christ...this one is pretty intense. My brain hurts.
I do have a question though. I have tried to use negative numbers before and the assembler rejected it. Not to sound too dumb, but how are you getting it to just let you "add negative numbers"?
-1 gets interpreted by the assembler as $FF. -2 is $FE, -3 is $FD, etc. I use the negative values because it's easier to read and understand what they're used for, but in the final ROM they will appear as FF, FE, etc.
If you try out some 8bit addition, you can see that they work the same:
1 + FF = 0 (carry set)
2 + FF = 1
3 + FF = 2
etc..
]]>