SourceGen allows you to customize the on-screen listing to your personal tastes, configuring mnemonic capitalization, pseudo-opcode names, text delimiters, cycle count annotations, and expresson syntax. The HTML output reflects those choices. Most of the listings here use the default settings, although I generally use Merlin-style labels (':' for locals, ']' for variables).
To aid perusal, all references to global labels are links, but I found it visually distracting so I tweaked the page style to make them look like plain text.
One potentially confusing output option is expression style.
LDA #>FOO+4*3
is evaluated in completely different ways by
different assemblers. SourceGen's default presentation (called "common")
assumes C language operators and precedence. It's useful to consider
an example.
The Applesoft BASIC disassembly is based on a much older disassembly that was developed in S-C Assembler format. The original has code like this for setting the high and low bytes of a pointer:
D592- A9 D0 1650 LDA #TOKEN.NAME.TABLE-$100 D594- 85 9D 1660 STA FAC MAKE PNTR FOR SEARCH D596- A9 CF 1670 LDA /TOKEN.NAME.TABLE-$100 D598- 85 9E 1680 STA FAC+1
Where TOKEN.NAME.TABLE
symbol is a label at address
$D0D0
. The order of operations imposed by the assembler
matters. SourceGen can generate three different things, depending on what
it's generating code for:
lda #<TOKEN_NAME_TABLE lda #>TOKEN_NAME_TABLE-256
lda #<TOKEN_NAME_TABLE lda #>TOKEN_NAME_TABLE-1
lda #<TOKEN_NAME_TABLE lda #(>TOKEN_NAME_TABLE)-1
This is a fairly simple example; things get messier when 16-bit code is involved. If you find the "common" style to be too different from what you're used to, remember that you can load the project into SourceGen and re-export it with your preferred options.
Copyright 2020 by Andy McFadden