A82: Printing Strings


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

A82: Printing Strings



I want to be able to print a large number of strings stored in one
location, but separately. For example, lets say I was doing a
dictionary. I would want to be able to show each word on the screen, as
the user  cycles through by the arrows. Example, it starts out on Cat,
and when you press the right arrow, it goes to Dog, or the left would
make it go to Bat. Now, I could do this by having separate code for all
of the words, but that could get huge. I think this might be better:

Dict:
.db "Bat",0,"Cat",0,"Dog"

And have it keep the location of the string its on, and go back or
forward till it hits a zero, or some other delimiter. So I guess I'm
asking, how do I print items of a zero-delimited database one at a time?
No special sorting, just print them in the order stored. The code should
actually be pretty short (Read to a zero, inc the location one, and
print it), leaving the bulk of the space for the data, but I don't have
the knowledge to do it. Any help?


Follow-Ups: