Re: A86: Why doesn't this work?


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

Re: A86: Why doesn't this work?




Refer to the coments below to fix the code so it will work corectly.
Explanation:
You dont decriment a. You compare a to a key, since a keycode is returned
in a.
For a list of keycodes, refer to ti86asm.inc.
If you need anymore help, mail me or the list.

At 02:17 PM 8/16/98 -0400, you wrote:
>
>I'm writing a program that will eventually move something around the screen,
>to learn asm. This won't work for some reason.  However a version I made
>that only says Left and Right works, this works the same way, it just looks
>for Up and Down too.
>
>#include "ti86asm.inc"
>
>.org _asm_exec_ram
>
> call _clrLCD
>Keyloop:
> call _getkey		;this returns a keypress in a
> dec a			;replace with "cp	kRight"
> jr z,Right			;this code is fine
> dec a			;replace this with "cp	kLeft"
> jr z,Left			;fine
> dec a			;"cp	kUp"
> jr z,Up			;fine
> dec a			;"cp	kDown
> jr z,Down			;fine
> jr Keyloop			;fine
>Left:
> call _homeup
> ld hl,LFT
> call _puts
> jr ED
>Right:
> call _homeup
> ld hl,RTE
> call _puts
> jr ED
>Up:
> call _homeup
> ld hl,UPP
> call _puts
> jr ED
>Down:
> call _homeup
> ld hl,DWN
> call _puts
> jr ED
>LFT:
> .db "Left",0
>RTE:
> .db "Right",0
>UPP:
> .db "Up",0
>DWN:
> .db "Down",0
>ED:
>.end
>
>Thanks,
>JEI
>
>
>
>
>
CHICANE
ICQ: #14727618
chicane on EFNET #ti
Homepage: Under Construction.


Follow-Ups: References: