From c4be540f49e814a13d67cfd4a44bca89d13bdf2c Mon Sep 17 00:00:00 2001 From: gardners Date: Thu, 6 Feb 2014 22:23:28 +1030 Subject: [PATCH] add 4502 option to Ophis command line. --- src/Ophis/CmdLine.py | 9 ++++++++- src/Ophis/Main.py | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Ophis/CmdLine.py b/src/Ophis/CmdLine.py index 562bdbe..299ad44 100644 --- a/src/Ophis/CmdLine.py +++ b/src/Ophis/CmdLine.py @@ -26,7 +26,7 @@ listfile = None def parse_args(raw_args): "Populate the module's globals based on the command-line options given." global enable_collapse, enable_branch_extend - global enable_undoc_ops, enable_65c02_exts + global enable_undoc_ops, enable_65c02_exts, enable_4502_exts global warn_on_branch_extend global print_summary, print_loaded_files global print_pass, print_ir, print_labels @@ -46,6 +46,8 @@ def parse_args(raw_args): help="Enable 6502 undocumented opcodes") ingrp.add_option("-c", "--65c02", action="store_true", default=False, dest="c02", help="Enable 65c02 extended instruction set") + ingrp.add_option("-4", "--4502", action="store_true", default=False, + dest="csg4502", help="Enable 4502 extended instruction set") outgrp = optparse.OptionGroup(parser, "Console output options") outgrp.add_option("-v", "--verbose", action="store_const", const=2, @@ -72,6 +74,10 @@ def parse_args(raw_args): parser.error("No input files specified") if options.c02 and options.undoc: parser.error("--undoc and --65c02 are mutually exclusive") + if options.c02 and options.csg4502: + parser.error("--undoc and --65c02 are mutually exclusive") + if options.csg4502 and options.undoc: + parser.error("--undoc and --65c02 are mutually exclusive") infiles = args outfile = options.outfile @@ -79,6 +85,7 @@ def parse_args(raw_args): enable_branch_extend = options.enable_branch_extend enable_undoc_ops = options.undoc enable_65c02_exts = options.c02 + enable_4502_exts = options.csg4502 warn_on_branch_extend = options.warn print_summary = options.verbose > 0 # no options set print_loaded_files = options.verbose > 1 # v diff --git a/src/Ophis/Main.py b/src/Ophis/Main.py index feedc00..39d7adc 100644 --- a/src/Ophis/Main.py +++ b/src/Ophis/Main.py @@ -104,6 +104,8 @@ def run_ophis(args): Ophis.Opcodes.opcodes.update(Ophis.Opcodes.undocops) elif Ophis.CmdLine.enable_65c02_exts: Ophis.Opcodes.opcodes.update(Ophis.Opcodes.c02extensions) + elif Ophis.CmdLine.enable_65c02_exts: + Ophis.Opcodes.opcodes.update(Ophis.Opcodes.csg4502extensions) Ophis.CorePragmas.reset() return run_all()