From 1136759c980a313598ea30cf11c67362ebb8a96e Mon Sep 17 00:00:00 2001
From: Andy McFadden
Select the line with address $2003 ("CMP #$04"), then +Actions > Edit Operand. This allows you to pick how you want the +operand to look. It's currently set to Default, which for an 8-bit +immediate argument means it's shown as a hexadecimal value. Click +Binary, then OK. It now appears as a binary value.
+The operand in the LDA instruction at line $2000 refers to an address ($3000) that isn't part of the file. We want to create an equate directive to give it a name. With the line at $2000 selected, use Actions > Edit Operand, @@ -229,12 +235,14 @@ label. However, you changed the code at $2005 to have a symbolic reference to a symbol called "IS_OK", and there were no other numeric references to $2009, so the auto-label was no longer needed. Because IS_OK doesn't exist, the operand at $2005 is just formatted -as a hexadecimal value.
+as a hexadecimal value. (There's also now a message at the bottom of the +window telling us this.)Let's fix this. Select the line at address $2009, then Actions > Edit Label. Enter "IS_OK", and hit Enter. (NOTE: labels are case-sensitive, so it needs to match the operand at $2005 exactly.) You'll see the new label appear, and the operand at line $2005 will use it.
-There's an easier way. Select Edit > Undo twice, to get back to the + + + +
There's another way to set a label that is simpler and more convenient. +Select Edit > Undo twice, to get back to the state where line $2005 +says "BCC L2009", and line $2009 has the label L2009. +Double-click on the operand on line $2005 ("L2009") to open the operand +editor, then in the bottom left panel click "Create Label". Type "IS_OK", +then click "OK". Make sure the operand format is still set to Default, +then click "OK".
+This puts the label IS_OK at line $2009, and we can see the BCC +instruction has it as well. We didn't have to manually type the symbol +for the BCC instruction because the numeric reference to $2009 was +automatically resolved to the IS_OK label. You could do the same thing +by editing the label on line $2009 directly, but in many cases -- +particularly when the operand's target address is far off screen -- +it's more convenient to work through the operand editor.
We now have two ".STR" lines, one for "string zero ", and one with the
STR1 label and the rest of the string data. This is okay, but it's not
really what we want. The code at $200B appears to be loading a 16-bit
@@ -550,9 +561,10 @@ and navigate to the Examples directory. In A2-Amper-fdraw, select
This particular program interfaces with Applesoft BASIC, so we can make it
a bit more meaningful by loading an additional platform
symbol file. Select Edit > Project Properties, then the Symbol Files
-tab. Click Add Symbol Files. The file browser starts in the RuntimeData
-directory. In the Apple folder, select Applesoft.sym65
, and
-click "Open". Click "OK" to close the project properties window.
Applesoft.sym65
, and click "Open". Click "OK" to close
+the project properties window.
The STA
instructions now reference BAS_AMPERV
,
which is noted as a code vector. We can see the code setting up a jump
(opcode $4c) to $1d70. As it happens, the start address of the code
@@ -637,8 +649,9 @@ save the project. File > Save, use the default name ("Tutorial4.dis65").
Nothing happened. If you look at the script (and you know some C#), you'll see that it's looking for a JSR to a function called "PrintInlineL1String". So let's give it one.