Commit Graph

15 Commits

Author SHA1 Message Date
gardners
c4be540f49 add 4502 option to Ophis command line. 2014-02-06 22:23:28 +10:30
Cat's Eye Technologies
5fc504c6c1 Exit with exit code 1 if there were errors, 0 otherwise. 2012-10-25 10:51:39 +01:00
Michael Martin
7f650e787d Fix the bugs the test suite found
- .require now tracks absolute paths of loaded files
 - stricter checking of .incbin arguments
 - fix charmap reset directive
 - Allow register names (a, x, y) as labels, with warning
 - Allow opcode names as labels, with warning
2012-06-12 06:29:03 -07:00
Michael Martin
382a6a218b Set STDOUT to binary mode on Windows if needed 2012-06-10 18:53:49 -07:00
Michael Martin
4891849e4a Pass control command line options.
It turns out that --enable-collapse is fundamentally misguided. We'll
need a better solution for that. --no-branch-extension looks pretty good.
2012-06-06 04:33:21 -07:00
Michael Martin
cf0df92fb1 Wrap up the new file/dir handling.
An .outfile directive lets sources suggest default filenames.

Also, .include, .require, .incbin, and .charmapbin are relative
to their _source file_ as opposed the _directory you called Ophis
from_, like it really should have always been.
2012-06-03 19:50:17 -07:00
Michael Martin
17f68399ef Allow support for multiple input files.
To account for this change, output files are now prefixed with the
-o option, and if none is specified, it defaults to 'ophis.bin'.
2012-06-03 18:32:25 -07:00
Michael C. Martin
14a37ca879 Massive code modernization spree.
Full PEP8 compliance. Also, booleans have been inserted where
they make sense (introduced in 2.3!) and I haven't knowingly
added anything that will break 2.3 compatibility.

At this point the code really doesn't look like it was written
ten years ago. Hooray!
2012-06-02 00:04:15 -07:00
Michael C. Martin
e47073bc1d New command-line system.
This is a full optparse-based parser for all the options we want
to have in Ophis 2.0, but the pass-disablers aren't working yet.

This also doesn't handle positional arguments the way we hope
to eventually; that will come later.

optparse is deprecated in 2.7, but its replacement isn't available
in any previous version of Python, so we avoid it so as to not
gratuitously break compatibility on older machines.

It would be nice to at least stay usable on stock Leopard Macs (2.5).
2012-06-01 00:09:25 -07:00
Michael C. Martin
196cb47f05 Fix bug in pass manager that was making the branch extender too aggressive.
We need to let the zero-page collapser do as much work as it can before
we get bent out of shape about out-of-range branches.
2012-05-28 22:53:53 -07:00
Michael C. Martin
741390e955 Allow '-' as a filename to mean standard input or output.
As part of this change, all assembler chat is being pushed to
standard error, where it probably should have been in the first place.
Scripts and batchfiles that relied on capturing the output of Ophis
will need to capture stderr now instead.
2012-05-28 19:19:08 -07:00
Michael C. Martin
f8bc917601 A new 'correctness optimization': ExtendBranches.
This pass actually isn't an optimizer in that it produces larger
binaries when it triggers. However, the larger binaries created
will actually assemble properly.

The ExtendBranches pass detects Relative instructions (that is,
branches) that extend past the signed-8-bit range Relative instructions
permit, and replaces them with a branch-jump combination with identical
semantics.

Since this may be evidence of a program bug, Ophis will warn when
the optimization is triggered.

Due to similarities between this pass and UpdateLabels, both passes
have been refactored in passing.
2012-05-27 15:57:23 -07:00
Michael C. Martin
c1c102291c Remove the deprecated and incomplete compatibility mode for Perl65. 2012-05-27 15:57:10 -07:00
Michael C. Martin
1df8ad465d Major formatting fixes:
* No more tabs
 * Fix copyright notices to point at right files and name the license right
2012-05-06 20:06:28 -07:00
Michael C. Martin
2c8dba2450 Initial import of the Ophis 1.0 distribution and supplemental material 2011-08-20 16:33:25 -07:00