[vcf-midatlantic] Woohoo!
Bob Applegate
bob at corshamtech.com
Sun Jul 30 08:25:50 EDT 2017
> On Jul 30, 2017, at 4:52 AM, Evan Koblentz via vcf-midatlantic <vcf-midatlantic at lists.vintagecomputerfederation.org> wrote:
>
> This popped into my mind: what if you want to display a large amount of text? I assume there's some better way than loading each individual character. The book I'm reading may explain it in a later chapter, and maybe it's counterproductive for me to ask at this point! Not looking for a code example right now. But someone please assure me assembly isn't always * this tedious *.
There are lots of common routines to do this. A good collection of handy 6502 routines is here:
http://www.6502.org/source/ <http://www.6502.org/source/>
There’s an entry for PRIMM, and if follow that page to the last version (by Russ Archer) you’ll see a very nice way of doing it. Just change to your local character-output subroutine.
jsr PUTSTRI
db “Hello world. Wow.”
db 0
Let’s not get into religious discussions about whether strings should be in-line with the code or not. This was just an example.
Suggestions on your original code:
Use labels, not hard coded addresses (“magic numbers”). Most assemblers also allow character constants, like:
lda #’H’
jsr OUTCH
Etc. Use of magic numbers is highly discouraged and would fail pretty much any code review.
But… congrats on your first 6502 assembly language program!
Bob
More information about the vcf-midatlantic
mailing list