Commit Graph

60 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
Shamus Hammons 2e6a046d5d Fix to prevent defined registers/CCs from being exported in the symtab.
As it turns out, this was not due to malice but because RMAC was set up
to squeeze out every label ever defined in the assembly.  Hopefully,
with this patch, things should be a bit more sane.  :-)
2022-05-30 17:40:19 -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 09135712da .equr overhaul part 5: enabled .equr for all registers for all architectures 2022-05-30 14:17:59 -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 216bfb25e0 .equr overhaul part 2: added equr evaluation during parsing. So far the gpu/dsp test seems to assemble fine 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
ggn 7815a9c950 Remove all remaining traces of "as68_flag" from the codebase (issue #186) 2021-08-20 10:08:06 -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
James Jones fb7dbd1173 Properly advance past register bank specifier
Register banks, like all constants, are stored
in the token stream as uint64_t values.  Hence,
to advance the stream, the 32-bit tok pointer
must be advanced twice after parsing a register
bank.
2020-05-08 10:21:47 -05:00
ggn 3492e185b1 Add support for some missing ptestr/ptestrw/fsmove/fdmove. Add DSM in directives tab 2020-01-17 14:15:17 -06:00
Shamus Hammons 4205233c83 EOY minor update. 2020-01-03 09:25:26 -06:00
ggn 2037569179 Added DSM directive for 56001 mode (and not only). Updated doc. Condensed usage message. 2020-01-02 11:57:50 -06:00
Shamus Hammons 412fe3614e Minor code cleanups. 2019-08-09 09:48:31 -05: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 0561939cf6 Now we're pretty sure that the codebase doesn't cause any regressions. 2018-08-20 10:35:12 -05:00
Shamus Hammons 30a2086548 Cleanup of codebase and initial commit of 56K assembler by ggn.
There's still a ways to go before this will work properly as we need to
add proper fixup handling and origin (".org") bookkeeping. As it is now,
the addition of all the miscellaneous bits and bobs to support the main
56K assembler are in place but they don't cause any regressions to the
existing assemblers already present in RMAC. Stay tuned for Round 2!
2018-06-23 11:57:21 -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 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
Shamus Hammons 29b32d134b Lots of fixes for floating point handling; version now at 1.11.0.
Some of the following changes are ggn's, and some are mine:

 - When tokenizing floats we need to store them using a double pointer
 - PTR union needed a (double *)
 - Major changes to float depositing in eagen0.c
 - Reverted the changes in expr.c so at least floats are processed by
   expr() and friends
 - SYM svalue needs to be 64 bits
 - When EQUing a float symbol don't chop off the upper 32 bits from eval
 - Added fltpoint.{c,h} in order to properly create IEEE-754 floating
   point and Motorola extended numbers
 - Fixed float evaluations in evexpr()
 - Fixed floating point depositions in direct.c (in d_dc())
 - Upped the BSD image limit in object.c to 8MB for crazy people making
   6MB Jaguar ROMs (will need a real fix at some point)
2018-01-21 08:25:06 -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 a7d3861005 Version bump (1.8.4) for last commit. 2017-08-10 19:08:32 -05:00
ggn 05d0350b35 Multiple fixes for 020+ mode, including:
- Macro'd the FPU code generators.
- Fix some bfxxxx problems including {offset,width} parsing and valid <ea> modes.
- Add symbol checks for <ea> parsing
- Try at fixing k factor for fmove - had to change {} parsing in general so bfxxxx code was also changed.
- Fixed cinvl/p/a instructions. Converted all trapcc functions into macros.
- pmove/pmovefd fixed and verified against devpac.
- pack/unpk implemented and tested
- Fix left hand side of FPU register lists.
- Fix some 020 move parsing errors.
- Change tokenizer strategy to not munch forced .b/.w/.l extensions after constants
- Get rid of probably redundant code in m_move030.
- ploadr/ploadw implemented. Also added extra needed addressing mode to the mask for pmove which is used by the ploads too.
- Some pmove fixes.
- Added cpdbcc instructions.
- pflush/pflusha implemented for 68030/68040.
2017-08-10 18:52:53 -05:00
Shamus Hammons c9541a9d4f Fixed IREPT blocks to not corrupt memory on 64-bit hosts. 2017-07-19 15:27:06 -05:00
Shamus Hammons c3bb316d42 Minor code cleanups. 2017-06-23 19:58:41 -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 5f23454f71 Code cleanup from last patch, also, version bump for same. :-) 2017-05-06 21:07:36 -05:00
ggn 5cd8a4814b Initial commit for 68020/30/40/60/68881/68882/68851 support. 2017-05-06 13:06:57 -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
Shamus Hammons 66be644c3e Fix for bug #78: Thanks to ggn for reporting and supplying the patch.
Bug fix for .w access for alcyon target, added new optimisation that
converts 0(ax) to (ax).
2016-09-12 20:37:51 -05:00
Shamus Hammons e968236d06 Possible fix for bug #72 (no warning on unclosed .ifs). 2016-05-09 13:13:41 -05:00
ggn 1d8c5b2261 Moved some messages from -v to -x 2015-11-17 13:57:20 -06:00
Shamus Hammons 0e2c5f0a03 Fix for bug #33. Thanks to Linkovitch for reporting! 2015-10-07 10:21:55 -05:00
Shamus Hammons d0c28c349d Fix for "*" getting bad section attributes, reported by A. Seed. 2015-02-19 08:56:14 -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 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 bcd800a128 Fixed ignored label on rept line (bug #18) 2014-03-14 10:48:53 -05:00
Shamus Hammons 75969398d9 Fixed subtle bug in expr().
Basically, expr() was looking at the token following the one it was
looking at and bypassing the longer parse path if it found an EOL token
there. Problem is, some tokens have follow on values and so can be
considered compound tokens. In this case, the EOL token codes to 101,
having a constant with a value of 101 will not evaluate correctly in
this case as the CONST token is a compound token.

The short of this is that making assumptions is BAD! Don't do it! It
WILL come around to bite you in the ass eventually, in the form of
subtle bugs that are difficult to chase down. Assume nothing!
2013-11-09 09:01:57 -06:00
Shamus Hammons 6c1bc37901 Fixed assembler not complaining when using RISC regs in 68K mode. 2013-09-12 21:59:10 -05:00
Shamus Hammons b10167d557 More fixups to remove warnings, removal of more cruft. 2013-03-05 11:47:22 -06:00