Assembling the code

The Ophis assembler is a collection of Python modules, controlled by a master script. On Windows, this should all have been combined into an executable file ophis.exe; on other platforms, the Ophis modules should be in the library and the ophis script should be in your path. Typing ophis with no arguments should give a summary of available command line options.

Table 2. Ophis Options

OptionEffect
-6510Allows the 6510 undocumented opcodes as listed in the VICE documentation.
-65c02Allows opcodes and addressing modes added by the 65C02.
-v 0Quiet operation. Only reports errors.
-v 1Default operation. Reports files as they are loaded, and gives statistics on the final output.
-v 2Verbose operation. Names each assembler pass as it runs.
-v 3Debug operation: Dumps the entire IR after each pass.
-v 4Full debug operation: Dumps the entire IR and symbol table after each pass.

The only options Ophis demands are an input file and an output file. Here's a sample session, assembling the tutorial file here:

localhost$ ophis tutor1.oph tutor1.prg -v 2
Loading tutor1.oph
Running: Macro definition pass
Running: Macro expansion pass
Running: Label initialization pass
Fixpoint failed, looping back
Running: Label initialization pass
Running: Circularity check pass
Running: Expression checking pass
Running: Easy addressing modes pass
Running: Label Update Pass
Fixpoint failed, looping back
Running: Label Update Pass
Running: Instruction Collapse Pass
Running: Mode Normalization pass
Running: Label Update Pass
Running: Assembler
Assembly complete: 45 bytes output (14 code, 29 data, 2 filler)
    

If your emulator can run PRG files directly, this file will now run (and print HELLO, WORLD!) as many times as you type RUN. Otherwise, use a D64 management utility to put the PRG on a D64, then load and run the file off that.