Re: A86: ld HL call


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

Re: A86: ld HL call




BlAsTo1414@aol.com wrote:
> 
> ok, I see.  how would I get input(ascii), store it, then print it again?
> 
> BlAsTo1414
> 
> are you guys sick of me yet?

Sick of you?  Heck no.  You're the best mental workout we've had in awhile.
Anyway, if I understand you correctly, you basically want to echo whatever
letter they hit?  In EditPad, I used a key-map based on the GET_KEY routine (no,
I don't care about batts...):

Main:
 call GET_KEY
 or a
 jr z,Main
 cp K_EXIT
 ret z
 sub $0A               ;$0A = scancode of first letter ('X') to shorten keytable
 ld c,a
 ld b,0
 ld hl,KeyTable
 add hl,bc
 ld a,(hl)
 cp $41                ;$41 = 'A'
 jr c,Main
 cp $7B                ;$5B = 'Z' + 1
 jr nc,Main
 call _putc
 jr Main

KeyTable:
 .db "XTOJE??"         ;5th column
 .db "?WSNID??"        ;4th column
 .db "ZVRMHC??"        ;3rd column
 .db "YUQLGB??"        ;2nd column
 .db "??PKFA"          ;1st column

If you wanted to get real fancy, you could have it flip shiftLwrAlph when they
hit 'Alpha' and add $20 to a if it's been set (change to lower case).

Hope this is more helpful than it is confusing!
-- 
Dark Ryder
ICQ#:     8189903
E-Mail:   DarkRyder@cyberdude.com

Happiness is inversely proportional to how much you want to upgrade your
computer.


References: