A86: Displaying a LOT of text!!! Question


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

A86: Displaying a LOT of text!!! Question



Say I was making a program which has to display a lot of text
sequentially......this is done:

ld hl,label1
call _vputs

Now if label is defined at the end of program:

label1:
   .db "Text string",0

The question is if hl is modifed by calling _vputs, and if not where is it
pointing? To the null byte of label1, or the byte after the null
character.....  Cause if there is another label after label1.....

label1:
   .db "Text string",0
label2:
   .db "Text string 2",0

Then could I do this:

ld hl,label1
call _vputs
call _vputs ;If hl is not modified during the previous call to _vputs and
if its pointing to 
	    ; label2 then I could just call again?? - if it is modified then could
I push
	    ; then pop of the stack.....

Im trying I guess to come up with some sort of "engine" to display text
using very little code as possible..

Im thinking like this:

; I have 5 lines of text to display... label1, label2, label3, etc.
; Ill assum that hl is not modified during _vputs and its pointing to null
byte - meaning
; it has to be incremented once top point to next label

<-----Snip code---->
  ld b,5		; # of labels
  ld hl,label1
PutText:
  call _vputs
  inc hl 		; Is that in the instruction set?
  djnz,PutText	;Is that the correct syntax?
 
label1:
  .db "Text string 1",0

; Rest of the labels below....