From f31b7f5822d147da836886a2335e147c1707923b Mon Sep 17 00:00:00 2001
From: Andy McFadden
This is expressed in symbol files with the MULTI_MASK statement. +Address symbol declarations that follow have the mask set applied. Symbols +whose addresses don't fit the pattern cause a warning and will be +ignored. Constants are not affected.
-For example, suppose the access pattern for a set of registers is
-???0 ??1? 1??x xxxx
(where '?' can be any value, 0/1 must
-be that value, and 'x' means the bit is used to determine the register).
-So any value between $0280-029f matches, as does $23c0-23df, but
+
The mask set is best explained with an example. Suppose the address
+pattern for a set of registers is ???0 ??1? 1??x xxxx
+(where '?' can be any value, 0/1 must be that value, and 'x' means the bit
+is used to determine the register).
+So any address between $0280-029F matches, as does $23C0-23DF, but
$0480 and $1280 don't. The register number is found in the low five bits.
The corresponding MULTI_MASK line, with values specifed in binary, would be:
-*MULTI_MASK %0001001010000000 %0000001010000000 %0000000000011111+
*MULTI_MASK %0001001010000000 %0000001010000000 %0000000000011111
The values are CompareMask, CompareValue, and AddressMask. To
determine if an address is in the register set, we check to see if
(address & CompareMask) == CompareValue
. If so, we can
extract the register number with (address & AddressMask)
.
We don't want to have a huge collection of equates at the top of the -file, so whatever value is used in the symbol declaration is considered -the "canonical" value. All other matching values are expressed as an -offset.
-All values must fall between 0 and $00FFFFFF. The set bits in +generated source file, so whatever value is used in the symbol declaration +is considered the "canonical" value. All other matching values are output +with an offset.
+All mask values must fall between 0 and $00FFFFFF. The set bits in CompareMask and AddressMask must not overlap, and CompareValue must not have any bits set that aren't also set in CompareMask.
+If an address can be mapped to a masked value and an unmasked value,
+the unmasked value takes precedence for exact matches. In the example
+above, if you declare REG1 @ $0281
outside the MULTI_MASK
+declaration, the disassembler will use REG1
for all operands
+that reference $0281. If other code accesses the same register as $23C1,
+the symbol established for the masked value will be used instead.
If there are multiple masked values for a given address, the precedence +is undefined.
+To disable the MULTI_MASK and resume normal declarations, write the +tag without arguments: +
*MULTI_MASK
*SYNOPSIS
,
then add the desired symbols.
Finally, add it to your project. Select Edit > Project Properties, -switch to the Symbol Files tab, click Add Symbol Files, and select your -symbol file. It should appear in the list with a "PROJ:" prefix.
+switch to the Symbol Files tab, click Add Symbol Files from Project, and +select your symbol file. It should appear in the list with a +"PROJ:" prefix.If an example helps, the A2-Amper-fdraw project in the Examples directory has a project-local symbol file, called "fdraw-exports". -(Amper-fdraw provides an Applesoft BASIC interface to the machine-language -fdraw library.)
+(fdraw-exports is a list of exported symbols from the fdraw library, +for which Amper-fdraw provides an Applesoft BASIC interface.)NOTE: in the current version of SourceGen, changes to .sym65 files are not detected automatically. Closing and re-opening the project diff --git a/SourceGen/RuntimeData/Help/intro.html b/SourceGen/RuntimeData/Help/intro.html index cd5eb1e..a98258a 100644 --- a/SourceGen/RuntimeData/Help/intro.html +++ b/SourceGen/RuntimeData/Help/intro.html @@ -61,10 +61,12 @@ something that people actually want.
The next few sections present some general concepts and terminology. The -rest of the documentation assumes you've read and understood this. It will -be helpful if you already understand something about the 6502 instruction -set and assembly-language programming, but disassembling other programs is -actually a pretty good way to learn how to code in assembly.
+rest of the documentation assumes you've read and understood this. +It will be helpful if you already understand something about the 6502 +instruction set and assembly-language programming, but disassembling +other programs is actually a pretty good way to learn how to code in +assembly. You will need to be familiar with hexadecimal numbers and +general programming concepts to make sense of anything, however.