A86: Re: Strings in memory


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

A86: Re: Strings in memory




For starters, you can't start at $8000 (you mean ram page 1, right), you
have to start at $800b (according to Dux) because there is one OP pushed
there when your asm program starts.  But aside with that...

You can just copy the string over to name, though I don't know why you are
storing strings and sprites together and can't put a label before the
string.  But anyway...

ld hl,sprite_string+8    ; point past 8 byte sprite to string
ld de,name               ; point to destination
ld bc,6                  ; size of string
ldir                     ; copy the string

If you don't want the size as a constant, you can have the assembler
automatically calculate the size.  But a label sprite_string_end at the end
of the sprite and string and load BC like this:

ld bc,sprite_string_end-sprite_string-8       ; size of sprite - 8

Hope this helps.

-----Original Message-----
From: Dave VanEe <dvanee@dowco.com>
To: assembly-86@lists.ticalc.org <assembly-86@lists.ticalc.org>
Date: Sunday, November 08, 1998 11:15 PM
Subject: A86: Strings in memory


>
>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
>