Re: A86: Re:


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

Re: A86: Re:




HOLY CRAP! That's two posts now telling me how to wait for two
keypresses!!! I DON'T want to wait for two keypresses, that's easy as shit!
It just _happened_ to be two keypresses when all the calculations were
finished....

At 03:20 PM 11/5/98 EST, you wrote:
>
>In a message dated 11/4/98 10:41:59 PM Eastern Standard Time,
>Assembly86@aol.com writes:
>
>> It looks good except you just have a key loop! You need to store the
number 
>> of
>>  times that the key is pressed.
>>  
>>  ( Try This )
>>  
>>  Start:
>>  	xor a
>>  
>>  KeyLoop:
>>  Whatever.......
>>  ......
>>  ......
>>   cp	k_F1		;Compare to F1
>>   jp	z,keypress		;If pressed jump to label
>>  ........
>>  .......
>>  Keypress:
>>  	add a,1			;A+1->A
>>  	cp 2			;Two times
>>  	jr	z,exit
>>  	jp	nz,keyloop
>>  
>
>how about this instead (shorter, does same thing)
>
>Start:
>	ld a,2				;two keypresses to read
>
>Keyloop:
>	....
>	cp K_F1
>	jr z,keypress
>	...
>
>keypress:
>	dec a				;a-1->a
>	jr z,exit				;when a=0, exit
>	jr keyloop			;get another key
>
>


References: