Fill.asm

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

Fill.asm

George
Can someone please tell me how you draw a rectangle for Fill.asm? All I have is one line
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm

cadet1620
Administrator
George wrote
Can someone please tell me how you draw a rectangle for Fill.asm? All I have is one line
Section 4.2.5 describes how the screen works; read it carefully.  Memory address 16384 is the first word of screen memory.  It sounds like you are only writing to 16384 so you only get a 16 pixel long line in the upper left corner of the screen.  You need to write to all the words in the screen memory to make the screen all black.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm

George
Thank you so much.
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm

linuxford
In reply to this post by cadet1620
cadet1620 wrote
Section 4.2.5 describes how the screen works; read it carefully.  Memory address 16384 is the first word of screen memory.  It sounds like you are only writing to 16384 so you only get a 16 pixel long line in the upper left corner of the screen.  You need to write to all the words in the screen memory to make the screen all black.

--Mark
I believe I am on the right track. My thinking is that each memory address holds a 16-bit word and if I can flip all the bits to 1 for the 16-bit word then it will display black for that section. I then can loop through and do that to all the words (8K~8192). It seems to be sort of working but I am having trouble setting the MSB of the 16-bit word to 1.

Could you please give me a hint?
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm

cadet1620
Administrator
linuxford wrote
... It seems to be sort of working but I am having trouble setting the MSB of the 16-bit word to 1.

Could you please give me a hint?
What is the signed-integer value of a word that is all 1 bits?

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm

linuxford
cadet1620 wrote
linuxford wrote
... It seems to be sort of working but I am having trouble setting the MSB of the 16-bit word to 1.

Could you please give me a hint?
What is the signed-integer value of a word that is all 1 bits?

--Mark
2^16 is 65536. 65536/2 is 32768, so signed 16-bit integer represented values range from -32768..0..32767.

If I use the
@-1
it will give me the a 16-bit pattern of all 1's - 1111 1111 1111 1111
However, if I do that, the CPU don't like that. It seems as soon as I make the MSB 1, that it is not an A-instruction but is instead a C-instruction perhaps.
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm

cadet1620
Administrator
Correct.  You can't set -1 with an A-Instruction.  Look at the C-Instruction comp table in 6.2.2.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm

linuxford
cadet1620 wrote
Correct.  You can't set -1 with an A-Instruction.  Look at the C-Instruction comp table in 6.2.2.

--Mark
Haha... got it. I'll take a crack at it this evening after I get off from work. Thanks Mark