Re: A86: simple code I can't figure out
[Prev][Next][Index][Thread]
Re: A86: simple code I can't figure out
, IVlusicman@AOL.COM writes:
>
> --RC
> #include "ti86asm.inc"
> #include "asm86.h"
>
> .org _asm_exec_ram
>
> Start:
> call _clrLCD
> call _homeup
> ld hl,String
> call _puts
this is all good
> ldir
ldir takes the byte pointed to by hl and copys it to the address containd in
de and decreases bc
it does this till bc=0
(hl) moves to (de) and both pointers are increased while bc decreases to zero
when you call it hl points to the byte after the string
and de and bc are unknown
this is probally what makes it crash
also its not a good idea to have
data such as the string in the middle of the code
when compiled it will turn up as opticodes and the calc will think they are
part of the program
just put all your data at the end of the program code
> String:
> .db "did it work?",0
> Loop:
> call _getkey
> cp K_EXIT
> jr z,Exit
> cp K_ENTER
> jr z,Exit
> jr Loop
> Exit:
> call _clrLCD
> ret
you could make this a <jp _clrLCD>
>
> .end
>
Follow-Ups: