Re: LZ: string input help
[Prev][Next][Index][Thread]
At 13:26 11/25/96 -0800, you wrote:
>Nathan Adams wrote:
>>=20
>> I've been trying to write a string input routine and have been having=
some
>> trouble. This is my first shot at zshell/asm. Here is the code that I=
am
>> working on:
>>=20
>> For size purposes I'm going to change the code. Let's say I am writing a
>> program to input the letter t, store it and then print it out somewhere=
else
>>=20
>> ;beginning of "t" program
>>=20
>> #include "TI-85.H"
>>=20
>> .org 0
>> .db "Input String", 0
>>=20
>> TextIn =3D $80DF ;address to store string of t's
>>=20
>> Start:
>> ld hl,TextIn ;load hl with address of TextIn
>> CALL_(KeyLoop) ;Input t's
>> ld hl,TextIn ;load hl with address of TextIn
>> ld b,5 ;load b with number of t's to be=
displayed
>> CALL_(DispTxt) ;Display t's
>>=20
>> Waitforkey: ;Wait for key to be pressed & return to
zshell
>> call GET_KEY
>> cp 0
>> ret nz
>> jr Waitforkey
>>=20
>> KeyLoop:
>> call GET_KEY ;get scancode of last key
>> cp $0B ;compare it with t key scancode
>> JUMP_Z(TKey) ;if they are equal goto TKey
>>=20
>> cp $09 ;compare it with enter key
>> ret z ;return if equal
>> jr KeyLoop
>>=20
>> TKey:
>> ld (hl),'t' ;load current address in hl with 't'
>> inc hl ;increment address in hl
>> ld a,'t'
>> ROM_CALL(M_CHARPUT) ;Output 't'
>> JUMP_(KeyLoop) ;jump back to keyloop to input more t's
>>=20
>> DispTxt:
>> ld a,(hl) ;ld a with char in address in hl
>> ROM_CALL(M_CHARPUT) ;display it
>> inc hl ;increment address
>> djnz DispTxt ;jump to DispTxt if value in b is not 0
>> ret ;return if b is 0
>>=20
>> .end
>>=20
>> When I try to run a program similar to this I can't get the characters to
>> display correctly. What I would like to know is what is wrong with this,
>> how I can fix it and if there is a better way to input strings.
>>=20
>> Any help would be greatly appreciated, I've been working on this for=
hours.
>>=20
>> Nathan Adams
>
>Well, I don't know if this is what is causing a problem, but you never=20
>set your menu text cursor, ($8333) for x coord and ($8334) for y coord
>
>--=20
>Compliments of:
>_-_-_-_-_-_-_-_
> Alan Bailey
> mailto:bailala@mw.sisna.com
> IRC:Abalone
> Web:http://www.mw.sisna.com/users/bailala/home.htm
>
No, in the real version of this string input routine I set the cursor
positions but I don't get the correct characters printed out. I get things
like =7F=7F=7F and other symbols. Thanks for the input and nice webpage, I=
like
the background.
References: