evan at vcfed.org
Sun Jul 30 04:06:14 EDT 2017
Made my first assembly program just now. :)
I was nudged by Ragooman, inspired by attending Kfest, and grateful for
the book "Apple Roots" (the previously recommended book "Assembly Lines"
left my brain in a knot after 5 pages). I read chapters 1, 3, and 4 --
skipped chapter 2 about number systems because I already understand that
well enough to fake it and it didn't seem pivotal to * jumping in and
doing something *.
I used ProDOS Assembly Tools which I downloaded from the Asimov site.
(Adam convinced me to switch to a real program like Merlin soon.) Tried
the sample program (ADDNRS) in chapters 3/4 and got it to work after
Facebook user Katherine S. in the Apple II group noted that I was
missing some spaces in the sample code. After that it assembled without
errors. Our own list member Paul H. provided additional insight.
Then, armed with sleep-deprived confidence, I went back and applied what
I learned to the "HI" example in chapter 1. That worked too, so I looked
up the number chart at the back of the book and changed it to HELLO
WORLD. It worked but I had a typo in the output: it showed a hyphen
instead of a space. That was a good thing because it forced me to
download the manual and learn how to load and edit the listing.
Corrected it and this time it showed HELLO WORL ... what happened to the
D? Looked again and I'd forgotten the final $FDED to display what I
LDA'd. Okay then! Now it works.
I have absolutely no clue if this is the "correct" way to make a hello
world in Apple II 6502 assembly. I understand there's probably a more
efficient way to do it. But for now, I basically skimmed three of the
first four chapters and wound up with this:
1 ORG $1000
2 LDA #200
3 JSR $FDED
4 LDA #197
5 JSR $FDED
6 LDA #204
7 JSR $FDED
8 LDA #204
9 JSR $FDED
10 LDA #207
11 JSR $FDED
12 LDA #160
13 JSR $FDED
14 LDA #215
15 JSR $FDED
16 LDA #207
17 JSR $FDED
18 LDA #210
19 JSR $FDED
20 LDA #204
21 JSR $FDED
22 LDA #196
23 JSR $FDED
Efficient or not, it works!
Evan Koblentz, director
Vintage Computer Federation
a 501(c)(3) educational non-profit
evan at vcfed.org
More information about the vcf-midatlantic