Re: A82: Either I'm crazy or my 82 is...


[Prev][Next][Index][Thread]

Re: A82: Either I'm crazy or my 82 is...



I'm assuming you have a Keyloop label?

Keyloop:
>       CALL   GET_KEY              
>       CP $37
>       JR NZ,ND
You want JR Z, ND - With CP, the 0 flag is set if they are equal.
Therefore, if the person pressed [MODE], the calc. will make a relative
jump to the label ND.

>       CP $04
>       JR z,UP
This code is fine.

>       CP $01
>       JR z,DWN
Same here. 

>       JR NZ,Keyloop       
This should be JR Z, Keyloop because if no key is pressed, the value
returned is 0.

			-Scoobie


Dean May <dmay@freenet.columbus.oh.us> writes:
>--1920402471-232707126-868324702:#16331
>Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
>
>I am writing code for an nth root simplifier (For people who actually 
>use
>calculators for math) but I am having getkey problems. I have attached 
>the
>problem (I think) code. What it is SUPPOSED to do is wait for a 
>keypress,
>If mode is pressed, go on. If uparrow is pressed, it is supposed to 
>jump
>to label UP. If downarrow is pressed, it is supposed to jump to label 
>DWN.
>But it doesn't even wait for a keypress! It flashes the screen then 
>goes
>back to ASH. I dunno what I'm doin' wrong (Again, however it is 
>probably
>sopmething stupid, I'm a newbie on ASM)
>
>
>
>--1920402471-232707126-868324702:#16331
>Content-Type: APPLICATION/OCTET-STREAM; NAME="PROB.TXT"
>Content-ID: <Pine.3.07.9707072122.A16331@login>
>Content-Description: 
>
>       CALL   GET_KEY              
>       CP $37
>       JR NZ,ND
>       CP $04
>       JR z,UP
>       CP $01
>       JR z,DWN
>       JR NZ,Keyloop       
>
>
>--1920402471-232707126-868324702:#16331--
>
>


References: