diff --git a/SourceGen/DisasmProject.cs b/SourceGen/DisasmProject.cs index c2f475c..7fbf66f 100644 --- a/SourceGen/DisasmProject.cs +++ b/SourceGen/DisasmProject.cs @@ -702,11 +702,14 @@ namespace SourceGen { // address map split as well, since the first byte past is an external // address, and a label at the end of the current region will be offset // from by this.) - if (sym == null && (attr.OperandAddress & 0xffff) != 0xffff && checkNearby) { + if (sym == null && (attr.OperandAddress & 0xffff) > 0 && checkNearby) { sym = SymbolTable.FindAddressByValue(attr.OperandAddress - 1); } - // TODO(maybe): if this is a 65816, check for a symbol at addr-2, for the - // benefit of long pointers. + // If that didn't work, try addr-2. Good for 24-bit addresses and jump + // vectors that start with a JMP instruction. + if (sym == null && (attr.OperandAddress & 0xffff) > 1 && checkNearby) { + sym = SymbolTable.FindAddressByValue(attr.OperandAddress - 2); + } if (sym != null) { mAnattribs[offset].DataDescriptor = FormatDescriptor.Create(mAnattribs[offset].Length, diff --git a/SourceGen/RuntimeData/Apple/Applesoft.sym65 b/SourceGen/RuntimeData/Apple/Applesoft.sym65 index 4323dcd..c396aa9 100644 --- a/SourceGen/RuntimeData/Apple/Applesoft.sym65 +++ b/SourceGen/RuntimeData/Apple/Applesoft.sym65 @@ -26,8 +26,7 @@ ERRFLG @ $D8 ;$80 if onerr active HPAG @ $E6 ;hi-res page to draw on ($20 or $40) SCALE @ $E7 ;hi-res graphics scale factor -AMPERV @ $03F5 ;jump to function that handles Applesoft '&' cmds -AMPERV_ @ $03F6 ;vector to function that handles Applesoft '&' cmds +AMPERV @ $03F5 ;JMP to function that handles Applesoft '&' cmds ; ; Useful Applesoft routines. diff --git a/SourceGen/RuntimeData/Help/tutorials.html b/SourceGen/RuntimeData/Help/tutorials.html index 331877d..fb41f8d 100644 --- a/SourceGen/RuntimeData/Help/tutorials.html +++ b/SourceGen/RuntimeData/Help/tutorials.html @@ -327,15 +327,16 @@ can do. We assume you've already finished the Basic Features tutorial.
and navigate to the Examples directory. In A2-Amper-fdraw, selectAMPERFDRAW#061d60
. Click OK to create the project.
Not a lot to see here -- just half a dozen lines of loads and stores.
-We can make it a bit more meaningful by loading an additional platform
+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.
The STA instructions now reference AMPERV_
, which is noted
-as a call vector. We can see it setting up a call to $1d70. As it happens,
-the start address of the code is $1d60 -- the last four digits of the
-filename -- so let's make that change. Double-click the initial .ORG
+
The STA instructions now reference AMPERV
, which is noted
+as a call vector. We can see the code setting up a jump to $1d70. As it
+happens, the start address of the code is $1d60 -- the last four digits of
+the filename -- so let's make that change. Double-click the initial .ORG
statement, and change it from $2000 to $1d60. We can now see that $1d70
starts right after this initial chunk of code.