Fill.asm need some help

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

Fill.asm need some help

Bob
This post was updated on .
My fill.asm has some errors, but I do not find it. The below is my code, could you help me, Thank you very much.
       
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm need some help

cadet1620
Administrator
Bob wrote
    @24576 //get keyboard value
    D=M
There is a built-in symbol "KBD" tha you can use here instead of 24576.
        @i   // if i==n,goto END
        D=M  
        @n
        D=D-M
        @END
        D,JEQ
...
   (END)
   @END
   0;JMP
The Fill program should never enter a halt loop. After filling with white, it needs to recheck the keyboard to see if it needs to fill black. Likewise, after filling black it needs to check if it needs to fill white.

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

Re: Fill.asm need some help

Bob
cadet1620 wrote
Bob wrote
    @24576 //get keyboard value
    D=M
There is a built-in symbol "KBD" tha you can use here instead of 24576.
        @i   // if i==n,goto END
        D=M  
        @n
        D=D-M
        @END
        D,JEQ
...
   (END)
   @END
   0;JMP
The Fill program should never enter a halt loop. After filling with white, it needs to recheck the keyboard to see if it needs to fill black. Likewise, after filling black it needs to check if it needs to fill white.

--Mark
Thanks, you are right. I have worked it out.
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm need some help

cadet1620
Administrator
I'm glad that I could help.

Now that your program is working, please edit your original post to remove the source code.

If you want to, mail me your working Fill.asm and I'll send you back a couple other implementations to look at.

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

Re: Fill.asm need some help

Bob
cadet1620 wrote
I'm glad that I could help.

Now that your program is working, please edit your original post to remove the source code.

If you want to, mail me your working Fill.asm and I'll send you back a couple other implementations to look at.

--Mark
you are so nice.
I have sent it to you.
I hope you have received it.
Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm need some help

A_Random_Person
In reply to this post by Bob
I also need some help.