If-Else Logic

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

If-Else Logic

Joe
Is there a way to implement If-Else logic in the Hack Assembly Language?  I've used a while loop for Fill.asm to fill the screen, but I want to use some kind of conditional logic to check and see if KBD == 0 or KBD == 1.

Thanks!

Joe
Joe
Reply | Threaded
Open this post in threaded view
|

Re: If-Else Logic

Joe
Well, if KBD == 0 at any rate.  Supposedly, that RAM location gets filled with the ASCII value of a key when it's pressed.
Reply | Threaded
Open this post in threaded view
|

Re: If-Else Logic

cadet1620
Administrator
In reply to this post by Joe
This is what the Jump Specification in C-Instructions is all about.  (4.2.3, p.68)
Load KBD into a register and do a conditional jump.

--Mark