Commit Graph

41 Commits

Author SHA1 Message Date
James Jones 526716329c Support -g debug info generation
-Add GenLineNoSym(), which will generate debug
 symbols for file names and line numbers when
 debug info generation is requested.

-Replace code that warns -g is not supported with
 code to set a flag.

-Complain if -g is specified for non-BSD output
 formats, as only stabs-in-symbol-table/a.out
 format debug information is supported currently.

-Document -g flag in usage information function.

-Document -g flag in manual.

v2:
-Only call debug symbol generation functions when
 dbg_sym != 0
2022-08-15 21:08:10 -05:00
James Jones e4747b998a Fix pack/unpack instructions
The GPU-specific PACK and UNPACK instructions
share opcode 63. PACK is chosen by encoding '0'
in the source operand, and UNPACK is chosen by
encoding '1' in the source operand. RMAC had the
magic source operand values reversed.
2022-06-27 11:52:29 -05:00
ggn 7d748dc6e2 Fix for #159: Split register sets according to architecture into different tables so they don't clash with label/symbol names. Modified tokeniser to use different tables when scanning for registers 2022-05-30 14:56:38 -05:00
ggn d21544da60 Removed some dead code, as well as all gpu/dsp regbank check code (not only it was complicated, it also was very incomplete - for example: no bank checks were performed during fixups) 2022-05-30 14:17:59 -05:00
ggn f23a0935e1 .equr overhaul part 3: store and handle banks in .equr evaluation 2022-05-30 14:17:59 -05:00
ggn c77f5e305e .equr overhaul part 1: remove gpu/dsp only restriction, make sure things still work (they do, but exported equrs do not match, which is weird considering they shouldn't be exported in the first place) 2022-05-30 14:17:59 -05:00
Shamus Hammons 1b714ae49d Harden RISC register parser and simplify expression evaluator.
The bulk of this patch is ggn's; I rolled a few more macros after I
realized that the EOL check in the RISC assembler required checking its
return value as well as EvaluateRegisterFromTokenStream()'s.  :-/
2021-06-07 22:42:33 -05:00
Shamus Hammons cbc8347d4f Update to the name (don't ask), and copyright dates. Now at v2.1.0. 2021-03-07 16:43:25 -06:00
Shamus Hammons 9518721db3 Further fix for bug #135 (added RISC error reporting). 2020-01-10 09:06:55 -06:00
Shamus Hammons c8c1bd3b36 Fix for bug #135 (RISC error reporting for immediate values).
Thanks to Linkovitch for the report; now at v2.0.7.
2020-01-04 10:24:57 -06:00
Shamus Hammons 4205233c83 EOY minor update. 2020-01-03 09:25:26 -06:00
Shamus Hammons 29fa5dcf50 The deed has been accomplished.
As far as I can tell, there should be no more regressions, but that's
no guarantee of anything.  Assuming no more are found, this should go
out as version 2.0.0.  :-D
2019-08-07 18:24:52 -05:00
Shamus Hammons bdbf34766f Added in DSP fixups to sect.c, misc. fixes for 6502 assembler. 2019-08-06 10:16:20 -05:00
Shamus Hammons 261f8d9198 Added Jaguar Object Processor assembler.
Rationale for this and how it works can be found in
docs/note-on-the-op-assembler.txt. Version now at 1.13.0.
2018-02-25 21:39:59 -06:00
Shamus Hammons 33bb2746fa Cleanups for the RISC assembler. Now at version 1.12.3. 2018-02-10 11:14:28 -06:00
Shamus Hammons 9153334781 Partial fix for bug #108 (Fixup cleanups).
RMAC has needed a struct for fixups for some time, and now it has one.
All of the credit for pushing (and patching!) in that direction goes to
ggn; blame for the way it's implemented goes to me. There's still room
for improvement; but for now, this should leave us in much better shape.
Now at v1.12.0.
2018-02-09 23:08:47 -06:00
ggn 0951a3e289 Various small fixes including:
- Corner case in ([bd,An/PC],Xn,od) addressing mode where bd is suppressed
- 68060 specific instructions (68ktab, mach.c)
- PMMU instruction fixes (68ktab, mach.c)
- FMOVEM fixes (amode.c)
- Switching CPU state fixes (direct.c)
- Bitfield instruction fixes (mach.c)
- pflush fixes (68ktab, mach.c)
- Various warnings silenced (mark.c, riscasm.c)
- Formatting ;)
2018-01-23 20:32:40 -06:00
Shamus Hammons eace4e1b29 Roll back TOKENPTR changes and most of the .u32 changes weren't needed.
The last commit had gone a bit overboard with the 32 vs 64 bit token
changes; this has been rectified. There's still a ways to go with the
floating point code, but this should be stable for now. Version now at
1.10.1.
2017-11-29 07:57:58 -06:00
Shamus Hammons f3c7d186a1 Fixes for last commit; version is now 1.10.0.
The float changes will need some going over to ensure that we don't end
up with what we had when pointers were shoved into the token stream
willy-nilly.
2017-11-21 07:54:55 -06:00
ggn 582df8950c Added floating point support to expression evaluator, introduced FLOAT token, fixup FU_ equates, fixed a load of casting warnings that (some) led to codegen bugs. 2017-11-18 09:54:04 -06:00
Shamus Hammons ff8188b7e2 Add support for 64-bit evaluations.
Version bump to 1.9.0. Right now the only thing that supports it is
dc.d; now that the infrastructure supports it, anything else that needs
64-bit support (such as FPUs and the like) can be done very easily now.
2017-10-08 08:40:02 -05:00
Shamus Hammons cfd001aea6 Fix for section alignment values in ELF objects.
Thanks to SainT for the patch. :-)
2017-08-29 12:20:17 -05:00
Shamus Hammons 96a5cd6957 Fixed bad char reporting, revamp of the error/warning system.
Somehow I put a unicode character in my assembly source and RMAC then
barfed up an internal error #2. Chasing this down, I finally determined
that the debug traces weren't lying to me and the input file had a
problem. However, RMAC wasn't reporting the illegal character correctly
either, so that was fixed (who knew that gcc was silently killing bit 7
of chars now?). I also realized that having five separate functions for
reporting errors (and the cruft of using those crippled things) was just
a wee bit insane, so now we have proper variable argument error and
warning functions (they can be used just like a printf). Enjoy!
2017-06-23 19:03:24 -05:00
ggn 03dd34951a (c) message in header files and doc mini adjustments. 2017-05-08 09:15:22 -05:00
Shamus Hammons ff2052bcaa Code cleanup, version bump for last commit. :-) 2017-04-20 14:29:31 -05:00
ggn 052be802ba 6502 support added back from original Madmac sources!
- Source fixed to work with current rmac implementation
- Removed ultra kludgy output mode and replaced it with .com/.exe./.xex output module (activated using -fx)
- Added #< and #> to give low and high bytes off an immediate word
- Included tester in "tests" folder.
- Updated docs.
2017-04-20 09:26:42 -05:00
Shamus Hammons 60f204cb9e ELF support for RMAC.
ggn deserves most of the credit for this, as my job was going through
and tossing out the stuff that wasn't needed. ;-) There might be some
ELFish things that still need fixing; time, as usual, will tell.
2017-04-14 15:52:31 -05:00
Graeme Hinchliffe 1feb728a9e Improved indexed reg error
- Added more helpful Indexing error message
- Added error condition for EQUR Indexing errors
- Updated patch # and copyright year
2017-01-31 08:57:11 -06:00
Shamus Hammons 850b5921f8 Fix NULL pointer dereference bug. 2015-10-07 11:53:50 -05:00
Shamus Hammons 0589a9f783 Fix for bug #34 (equated reg in 1st operand of MOVEI).
Thanks to Linkovitch for reporting!
2015-10-07 10:44:48 -05:00
Shamus Hammons 29dd8f1076 Fix for incorrect PACK/UNPACK generation. Thanks to A. Seed for reporting. 2015-03-03 21:12:13 -06:00
Shamus Hammons a48737de12 Fixed a nasty bug that dropped symbols that shouldn't have been.
This stemmed from the fact that EQUR symbols somehow made it on to the
symbol declaration list. If such symbol was later .equrundef'd, it would
find it's way back onto the the sdecl list *twice*, with the result
that any symbols that came after it would be summarily discarded into
the ether. Really, really bad mojo.
2015-01-31 20:49:38 -06:00
Shamus Hammons 3f2bccb78a Misc. whitespace cleanups, removal of unneeded code. 2015-01-16 11:16:33 -06:00
Shamus Hammons 090bda1c00 Fix for spurious 'undefined register equate' error. 2015-01-16 08:24:24 -06:00
Shamus Hammons d95ee7f628 Fixed bug with -l switch.
Turns out that the tokenClass buffer was too small, leading the eval()
function to dip into random memory. *facepalm*
2015-01-13 11:06:11 -06:00
Shamus Hammons 062214e620 Fixed word reversed fixup problem.
For some reason, there was code in several places that marked fixups/symbols
as belonging to a RISC section when it was clearly not the case. As a result,
it caused serious problems by reversing words in 68K sections just because a
symbol had been seen in a MOVEI # statement in a RISC section. Probably not
the last nasty surprise in this pile of spaghetti. :-/
2014-05-17 15:56:15 -05:00
Shamus Hammons 9df4696c6d Fix for extraneous newlines in .print directive. 2014-02-22 21:46:01 -06:00
Shamus Hammons 61ba7cfa9a Added "legacy mode" to assembler, which is on by default.
Apparently MAC did fixups for programmers who forgot that they couldn't
put a MOVEI immediately after a JUMP or JR, so we do the same to keep
legacy code assembling (though we may flip the default to OFF at some
time in the future :-P). If you don't like the assembler doing stuff like
that behind your back, you can tell it not to by adding the -n switch to
your command line.

There are lots of other cases that the user should be warned about with
RISC code; these will be added in future commits. :-)
2014-01-12 21:44:04 -06:00
Shamus Hammons ab99ead7ff Fixed segfault on encountering unexpected register in RISC section. 2013-09-12 09:44:40 -05:00
Shamus Hammons 82307651be Various code cleanups, mainly to do with RISC assembly. 2013-03-04 07:36:09 -06:00
Shamus Hammons f6e6a55c4c Fix silly mask bugs, added check for use of undefined register equates. 2013-03-02 14:22:33 -06:00
Renamed from risca.c (Browse further)