I don't seem to be getting the fill.asm project right. I need some help. The program is failing at the first test of the fillautomatic.asm, comparison failure at line 3 and it will only write a pixel on the screen. I quite understood how the program should work but implementing it has been a bit more difficult. I think my major obstacle is to change all the bits in a selected register as well as move to the next register in the screen memory.
Keep in mind that you don't have to change individual pixels. Each memory address in the SCREEN memory segment controls sixteen pixels. If you set the value to 0 then they will be all white while if you set the value to 32767 (which is all 1s in binary), they will be all black.
I made a few changes and I'm still getting the same error message. Since the conditional operators only test against '0' (D;JGT etc) and it's impossible to test against any real number like 24576, I then decided to use the value which is between 16383 and 24576 which is 8193, decrement it, and check that against 0 while incrementing 16383 as well. it worked and the whole screen went black but then I'm still getting that error message "Destination is M but A=24577 is an illegal memory address". May be my logic is incorrect.
Use a toy screen and run your program by hand. Imagine that the screen memory still starts at 16384 but it only has 32 pixels (two RAM locations), placing the keyboard at 16386 instead of 24576.
By your reasoning, you countdown value would start at 3 (the difference between 16386 and 16383). Follow your program, step by step, and see what the last RAM location you write to would be. Is it 16386?
As for checking one number against another even though you can only test against zero, the key is to recognize that
A > B
is the same as
(A-B) > 0
But maintaining a separate counter like you are doing is perfectly reasonable.