Skip to content

Coding Style

Julie Montoya edited this page Mar 18, 2020 · 1 revision

The preferred coding style for BCP assembler source files is as follows:

  • A gap at the beginning of the line numbering schema to accommodate imported variables
  • One assembler instruction (or EQUB / EQUW / EQUD / EQUS) per line. But multiple EQU pseudo-instructions may be run together on a line if and only if this is preferrable to an opaque EQUW
  • .label definitions on a line by themselves
  • One-letter variable names for obvious, commonly-accessed values e.g. o=&FFEE for OSWRCH and w=workspace just because something like scrX-w occupies less space than scrX MOD256 without seriously compromising readability
  • "Permanent" variables A%-Z% are used to store values which may be required to persist across LOAD / CHAIN commands
  • A PROC to create the final variable export file with an explicit command; this is simply a bunch of BASIC statements to define variables (entry points and workspace variables) needed by subsequent source files