Commit Graph

70 Commits

Author SHA1 Message Date
Shamus Hammons 977e372d50 Fix to placate the Visual Studio(TM) gods.
N.B.: Even MXE (which makes Windows(TM) executables), doesn't need this
      kind of special treatment.  So, meh.  :-/
2023-03-20 14:57:12 -05:00
ggn 41a8ca9921 Fix for #210 - 6502 mode with -fr working 2022-12-21 16:57:02 -06:00
ggn 31894aa869 Fix for #209 - forbid exporting expressions with unresolved symbols 2022-12-21 16:49:40 -06:00
Shamus Hammons c6808e75ed Files missed in the last commit. :-P 2022-12-21 16:37:53 -06:00
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 e8f9d55bc7 Add NewDebugSymbol(): stabs symbol factory
This function, currently unused, generates a stabs
debugging symbol, as documented here:

https://sourceware.org/gdb/onlinedocs/stabs.html

It can be used to process stabs directives, also
documented at the above URL, generated by HLL
compilers such as GCC, as well as to generate line
number and file name debug symbols when assembling
hand-coded assembly files with the -g option.

v2:
-Don't double-init stabs symbol fields
-Consistently use tabs, not spaces
2022-08-15 21:08:06 -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 5559ac0292 Get rid of some old and deprecated macros 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 1df6df8dae .equr overhaul part 4: handle equrundef (and the other permutations of the directive) 2022-05-30 14:17:59 -05:00
ggn 5b53a2a9e5 Add new optimisation switches for 56001 mode that were missing. Added warnings to all optimisation messages, as well as mention which switch caused the optimisation. Moved opt +op to opt +30 (Issue #185) 2021-08-20 10:57:31 -05:00
ggn 7815a9c950 Remove all remaining traces of "as68_flag" from the codebase (issue #186) 2021-08-20 10:08:06 -05:00
ggn 22203fdc3b Fix for issue #179: Don't touch o10 when +/~Oall is called. Made the o10 error message more verbose. Updated documentation. 2021-06-08 20:11:29 -05:00
James Jones b1d365c467 Treat ':' as a path separator on non-Windows platforms
In addition to ';', allow the use of ':' as a path
separator in RMACPATH, the -i parameter, and any
other uses of nthpath. This makes rmac more
consistent with standard Unix tool behavior on
Unix-like systems.
2021-06-08 18:34:07 -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
ggn 9afaf60ca2 Slight revamp of the optimisation system, featuring: strengthened flag parser, slight merge of two 020+ flags, fixes for +o6,+o8,+o9 and maybe more! 2020-07-17 18:20:19 -05:00
Shamus Hammons 3f6e05a96f Added check to see that include paths actually exist.
RMAC will now yell at you if you give it a bogus include path.  Thanks
to ggn for the idea!  Now at v2.0.11.
2020-02-28 17:24:59 -06:00
ggn fbbe9b115f Added new optimisation option "+op" which enforces PC relative mode (#123) 2020-01-17 13:56:41 -06:00
ggn 8f287ee722 Introducing new switch -fr which outputs binaries assembled at a given address. 2020-01-10 09:04:35 -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 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
ggn b57de9c1d9 Added optimisation switches -o8 and -o9
Added optimisation switches -o8 (adda.w/l #x,Dy to addq.w/l #x,Dy) and
-o9 (adda.w/l #x,Dy to lea x(Dy),Dy), both off by default.
2018-01-23 18:34:43 -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 4ca28ba07d Small cleanups + version bump for last commit.
Version now at 1.10.2.
2017-11-29 18:52:47 -06:00
ggn 2ede373128 Various small fixes and additions to the 680x0 parts:
- New command line switch -m[cpu]  enables you to switch to a different cpu from the command line
- BYTESWAP64 macro fix
- New optimisation flags o6 and o7 turn null branches to NOP and convert clr.l Dx to moveq #0,Dx
- Remove tons of FPU/PMMU codegen functions in mech.c. They are now handled in a more smart way. Condition codes now stored in 68ktab - updated 68ktab to reflect that
2017-11-29 18:01:27 -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 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 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
ggn ba392fd1c6 Added -l* to enable listing without pagination. Fix bug where a wrong malloc would lead to explosions with listing enabled. 2017-04-27 08:06:49 -05:00
Shamus Hammons 9207a38ed4 Fixed code to remove warnings. Inching closer towards zero. :-) 2017-04-24 22:30:42 -05:00
Shamus Hammons 751aa148a9 Minor tweaking from last round of patching, version bump. :-) 2017-04-21 16:36:06 -05:00
ggn a3feec3b2d Much better implementation for A8 strings - introduced a new token called STRINGA8. Also, all this time we forgot to update mntab :). 2017-04-21 16:26:28 -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
ggn 5f3b8bc35e Make .incbin and object writing work ok under MinGW. 2017-04-14 20:04:24 -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 2d302cb8c2 Version bump. :-) 2016-09-12 22:27:30 -05:00
ggn 0fd4b86c98 Added .opt directive with similar syntax to command line. Example syntax: '.opt "~all" "+o1"' etc.
Signed-off-by: Shamus Hammons <jlhamm@acm.org>
2016-09-12 22:14:46 -05:00
ggn 02523045dc Removed -w flag, added +o[n], ~o[n] switches to control individual optimisations on/off, as well as +oall, ~oall for all optimisations.
Signed-off-by: Shamus Hammons <jlhamm@acm.org>
2016-09-12 21:25:48 -05:00