Re: A86: Strings in memory


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

Re: A86: Strings in memory




You don't need to copy it anywhere - you could use:

        ld hl,string_sprite + 8        ;8 is size of sprite
        call _vputs

But if you really wanted to copy, you can access just the string in the same
way:

        ld de,name
        ld hl,sprite_string + 8
        ld bc,6                            ;length of string + 1
        ldir


        ld hl,name
        call _vputs

Hope this helps!

Dave VanEe wrote:

> I'll try again with this...
>
> Normally to display text you would do something like this:
>
>  ld hl,string
>  call _vputs
>
> string:
>  .db "Hello",0
>
> But I have the string INSIDE a bigger area like this:
>
> sprite_string:
>  .db %11111111
>  .db %10000001
>  .db %10000001
>  .db %10000001
>  .db %10000001
>  .db %10000001
>  .db %10000001
>  .db %11111111
>  .db "Hello",0
>
> So, how could I load that 'Hello' string into a location defined as:
>
> name = $8000
>
> and later use it in like this:
>
>  ld hl,name
>  call _vputs
>
> --> (Which would display 'Hello' on screen)
>
> uh...I hope someone understands and can help...
>
> Thanx,
> Dave

--
Dark Ryder
ICQ#:     8189903
E-Mail:   DarkRyder@cyberdude.com

Happiness is inversely proportional to how much you want to upgrade your
computer.

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/CC/ED/IT/M/MU/P/S/O/AT (!)d-? s++(+):+(++) a?--- C++++$
UB>L+++ P L>+++ E- W+++$ !N o? K- w(---)$ !O M(+)(-) V?
PS+(+++) PE-- Y PGP++ t*+(+++) 5++ X+ R*+++ tv b+++ DI++++
D++ G++>++++ e*>+++++ h!>++ r-(+) y**++
------END GEEK CODE BLOCK------




References: