[A83] Re: Displaying Characters
[Prev][Next][Index][Thread]
[A83] Re: Displaying Characters
Ok understood but i tried it with loading three into it and the first time
it decremented from 3 it went to 255 and when it is called to decrement
after that it just stays at a constant 255
The reason is in your:
A: .db 0h
The ld hl,A , dec (hl) is decrementing the value pointed to by HL, in this
case (A). The value there is 0h. When you decrement that, it underflows and
becomes 255 (or -1 with signed arithmetic).
Michael Vincent
Detached Solutions - www.detacheds.com
Radical Software - www.radicalsoft.org
----- Original Message -----
From: "Shane" <ti83asm2001@yahoo.com>
To: <assembly-83@lists.ticalc.org>
Sent: Wednesday, October 10, 2001 2:29 PM
Subject: [A83] Re: Displaying Characters
>
> well why if I am dec 3, to 2 does it give me 255?? i dont get that (im new
> to assembly)
>
> > I am trying to display numbers on the graph screen that are stored in in
a
> > string 'A' and then decrement them. SOCCERK121 helped me with displaying
> > them on the graph screen by:
> >
> > ld a,(a)
> > ld h,0
> > ld l,a
> > bcall(_Setxxxxop2)
> > bcall(_op2toop1)
> > ld a,5 ;<--- number of digits, 5 is a safe number
> > bcall(_dispop1a)
> >
> >
> > But whenever I dec the A like this:
> >
> > ld hl,A
> > dec (hl)
> >
> > A: .db 0h
> >
> > It messes up and from then on displays the number 255 whenever i reuse
> > SOCCERK121's routine.
> > I don't know wether its because A is a hex number or if I am
> > doing something wrong.
> >
> 0 - 1 = 255, i don't see the problem....
>
>
>
References: