Re: A86: Input (yes another input question)


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

Re: A86: Input (yes another input question)




In a message dated 10/3/98 9:15:57 PM Eastern Daylight Time,
uneven14@hotmail.com writes:

> After what Dux just said about using .db to input I got to thinking.  I 
>  was wondering would this code work for getting a 3 char string?
>  
>  
>  
>  KeyLoop:
>   call GET_KEY
>   ld string+1,a
>   call GET_KEY
>   ld string+2,a
>   call GET_KEY
>   ld string+3,a
>  
>  Other_Code:
>   ......
>  


close.  try this:



	ld hl,string
	ld b,3
loop:
	call GET_KEY
	or a
	jr z,loop
	ld (hl),a
	inc hl
	djnz loop

	;other code....
	
string:
	.db 0,0,0