A86: Re: pointers


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

A86: Re: pointers




> curr: .db 0
> draw:
>  ld a,(curr)
>  add a,a
>  ld d,0
>  ld e,a
>  ld hl,pointers
>  add hl,de

At this point, HL contains a pointer to a pointer to the data, not a pointer
to the data.  You need to load the pointer into HL:

 ld a,(hl)
 inc hl
 ld h,(hl)
 ld l,a

>  ld de,$fc00
>  call DispRLE
>  ret
>
> pointers:
>  .dw pic1,pic2,pic3,pic4,pic5
>
> pic1: .db ............
> pic2: .db...




References: