Commit Graph

59 Commits

Author SHA1 Message Date
ggn 23ff3174f4 - If ^^filesize could not open the requested file, it would show "(null)" as the filename
- Changed one '#include <...>' to 'include "..."'
- Minor doc additions
- Added 'dirent_lose.c/.h' to Visual Studio project
2023-06-19 16:26:48 -05:00
ggn 31894aa869 Fix for #209 - forbid exporting expressions with unresolved symbols 2022-12-21 16:49:40 -06:00
ggn 3f937a2ab5 Added "-4" switch that enables C style operator precedence (original work by Bastian Schick) 2022-06-27 11:52:24 -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
ggn 5d066fc786 Fix for bug #173 - expressions that contain "*" are treated as absolute when ORG is active. Also small cleanup of expr.c and doc update 2021-06-08 19:04: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
ggn 9ecc6f5e49 Fix for bug #167 2020-08-03 12:24:36 -05:00
ggn fbbe9b115f Added new optimisation option "+op" which enforces PC relative mode (#123) 2020-01-17 13:56:41 -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 01dbdb3508 Version bump for last commits; now at v2.0.6. 2020-01-03 10:37:08 -06:00
ggn c38505ee4b Actually implement ^^FILESIZE this time :) 2020-01-03 09:56:36 -06:00
Shamus Hammons 4205233c83 EOY minor update. 2020-01-03 09:25:26 -06:00
ggn d3748ed651 More correct calculation of ^^ABSCOUNT. Also updated VS project. Now at version 2.0.1. 2020-01-01 13:46:40 -06: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
ggn 5c1e995754 Bug fix in flognp1. Better handling of cpbcc/fbcc/pbcc groups of instructions. 2018-05-16 12:57:53 -05:00
Shamus Hammons ae528e6fdb Fix for subtle bug in the expression analyzer.
Turns out if you blindly promote arithmetic expressions to
ABS + DEFINED, it causes things to assemble wrong. This crept in around
v1.9.1; Now at version 1.12.5.
2018-02-24 10:27:31 -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 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
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 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 a29cbeceea Fix for bug #77 (ds with negative numbers).
Last time it didn't work because our target number was an unsigned int
(as opposed to a signed int). So now that we know, we have a proper
check for it now.
2017-05-02 13:02:47 -05:00
Shamus Hammons ff2052bcaa Code cleanup, version bump for last commit. :-) 2017-04-20 14:29:31 -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
ggn 00b03aec5b Fix for initial plus in expression throwing a "bad expression error" 2015-11-14 10:42:31 -06:00
ggn 389f084bc1 New keyword ^^ABSCOUNT counts bytes defined in current .abs section. 2015-11-10 20:41:02 -06:00
Shamus Hammons a47cfb0704 Fix for bug where ^^FOO mnemonics were parsed incorrectly. 2015-11-10 13:38:30 -06:00
Shamus Hammons e86444a037 Fix for bug #46 (thanks to ggn for reporting!). 2015-11-01 09:14:52 -06:00
Shamus Hammons d9aaeb6dc9 Fix for bad division in expressions. Thanks to A. Seed for reporting! 2015-02-19 10:04:29 -06: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 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 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 2e6629b638 Forgot minor release number bump. :-P 2013-09-12 10:00:35 -05:00
Shamus Hammons ab99ead7ff Fixed segfault on encountering unexpected register in RISC section. 2013-09-12 09:44:40 -05:00
Shamus Hammons b10167d557 More fixups to remove warnings, removal of more cruft. 2013-03-05 11:47:22 -06:00