Re: A83: buffer magic


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

Re: A83: buffer magic




first: where do you say it increments bc?

second: the reasons you use hl, de and bc (that btw is NOT variables, they are
registers in the processor) is that the instruction ldir uses theese exact three
registers to get the location where from to copy (hl), the destination (de), and
the numbers of bytes to copy (bc). ldir is not a romcall, it is an instruction
in the z80.

what the first four lines does is that it copys the picture stored at logo to
the graphbuffer.
the last line "call _grbufcpy_v" then calls a ROM routine that displays the
graphbuffer on the screen. (by copying the data in the graphbuffer to the
LCD-driver on port 11)

//Olle

Man in the Moon wrote:
> 
> Could someone please explain to me how this standard piece of code that
> displays a picture works? Why increament bc? It will neve reach zero using
> ldir. Why use hl, de, and bc, three varibles which appear to have nothing to
> do with each other.
> 
>  ld hl,logo
>  ld de,$8e29
>  ld bc,768
>  ldir
>  call _grbufcpy_v
> 
> From: Chris (Man in the Moon)
> man_in_the_moon@usa.net


References: