#!/usr/bin/perl # # Copyright (C) 2001 Mark Bush # # # This is a BBC disassembler. # # Options: # ------- # # -f Specify the BBC micro machine code file # to try to disassemble. # # -s Specify a "skip" file (see below). # # -o Specify the address to start disassembly from. # The default is the first byte (or the service # routine if the file is a ROM). # # -a Specify the address of the first byte in the file. # The first address will be assumed to be 0x0000 # (or 0x8000 if this is a ROM) without this option. # # -r The file to disassemble is a ROM and has a # ROM header which will be decoded. By default, # the disassembly will then start from the address # # -l Disassemble from the language routine if this # is a ROM rather than the service routine. # # The script will disassemble until the end of file is reached by trying # to decode op-codes (all 65C02 including undocumented op-codes are # supported, though BBS0-7 instructions are not recognised properly as # I don't know yet what form the argument bytes take - if someone knows, # let me know and I'll add them). # # Obviously, because data bytes are often interspersed with operational # bytes, this method may produce errors. You will have to inspect the # output and use a "skip" file to identify data bytes and bytes not to # be decoded. A complete decode may, therefore, involve many cycles of # disassembly, scanning output, re-writing the "skip" file, and repeating. # # Skip File # --------- # A "skip" file can be used to help the disassembler locate valid # sections of code. Lines must be one of (with all addresses in hex): # # l:
: