Skip to content

BASIC_CBM2 legibility improvements - #18

Open
sean-gugler wants to merge 8 commits into
mist64:masterfrom
sean-gugler:cbm_fix
Open

BASIC_CBM2 legibility improvements#18
sean-gugler wants to merge 8 commits into
mist64:masterfrom
sean-gugler:cbm_fix

Conversation

@sean-gugler

Copy link
Copy Markdown

This change improves legibility by bringing more code into conformance with the layout changes in effect for this project.

By comparison of the current head against original sources [1][2][3], the extant rules for layout revision appear to be as follows:

  1. Directives that directly emit binary, such as .BYTE and .WORD, are aligned to the same column as instruction opcodes are. All other directives, such as .SKIP and .PAGE, align to the left column.
  2. Symbolic address labels, when present, are left-aligned.
  3. A tab precedes instructions (LDA JSR .BYTE), assignments (=16+2), and address adjustments (*=*+2). If a label is present on the same line, the tab comes right after it. Any comments that follow will align to column 25 if possible, with at least one space before the semicolon (;).

I observe that some text did not receive this processing. For example, lines that begin with more than one space or that are commented out with a semicolon (;) appear to have been left unmodified. This change brings those sections into conformance.

Furthermore, since the goal of that reformatting appears to be legibility, this change includes a few more proposed edits:

  • Directives .IFE and .IFN should also be left-aligned to match their closing bracket '>' which appears on a separate line.
  • The space count between an instruction and its argument is inconsistent in the original listing, even sometimes within a single function. Examples of such untidiness can be seen in BASIC_CBM2_1983-05-31/bverbs3 at DCAT4, DCAT5, and OCHANL. Using a single space appears predominant in existing code, so that is what I went with for this edit.
  • Byte arrays mix and match hexadecimal and decimal notation, causing visual misalignment. I chose to add whitespace rather than change them all to hexadecimal representation for a rather niche reason: in the app Beyond Compare, a non-whitespace change would be color-coded differently and needlessly stand out from all other diffs.
  • The third source has evidence of someone back in 1984 attempting to bulk-correct some issues in the strng1 and strng2, such as: adding a comma to "STA (INDEX1)Y"; shortening .SKIP and .PAGE to .SKI and .PAG; and removing excess spaces after each semicolon (;). These traits persist unchanged in the other 1984 code modules; I must conclude they do not affect the ability for an assembler to correctly parse them. In the interest of reducing noise and making it easier to see the material differences between versions, I include a commit that undoes these edits.

I have separated each concern into a separate commit to make it easier for you to review and individually reject any you feel do not serve this project's goals.

[1] http://www.pagetable.com/docs/CBM2_Sources.zip
[2] https://www.davidviner.com/cbm9.html
[3] https://www.insectria.org/b128/CBUG/cbug68.d80.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant