Re: A86: Variables -> display


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

Re: A86: Variables -> display



Stein Sem-Jacobsen wrote:

> >Stein Sem-Jacobsen wrote:
> >>
> >> I've got the variable stored in "var: .db " How do I diplay this number,
> >> that I write to all the time, on the display as a decimalnumber?
> >
> >ld hl,var
> >ld l,0
> >ld a,0
> >call $4a33
> >
>
> I didn't get this to work. This is how it looks like:
>
> #include "asm86.h"
> #include "ti86asm.inc"
>
> ;-----------------------------
> ;Variables
>     frstb = $CFAB
> ;-----------------------------
>      ld   (frstb),a ;store the 1st byte
>
>      ld   hl,frstb
>      ld   l,0
>      ld   a,0
>      call $4a33
>
> This should display the number stored in "frstb" as a DEC not a character,
> hex or bin.
>
> But no matter what i put in "frstb" i get the same number out at the screen.
> The number is 55xxx where xxx is the numbers that varies. Some times it
> changes but i don't know why, because it doesn't happen when I change the
> number stored in "frstb"
>
> Stein Sem-Jacobsen

Your problem is that you'r zeroing out L instead of H.  Also, don't load HL from
there, because HL is a word and that was a byte.  A better code would be this:

 ld l,(frstb)
 ld h,0
 xor a
 call $4a33

That should do it.

--
Stephen Hicks
mailto:shicks@mindspring.com
UIN:5453914
AIM:Kupopo1



Follow-Ups: References: