James Jones [Sun, 12 Apr 2020 05:25:48 +0000 (22:25 -0700)]
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.
Shamus Hammons [Wed, 15 Jan 2020 04:14:01 +0000 (22:14 -0600)]
Fixes for bug #144 (unitialized code paths in 6502 codegen).
I was able to throw away a bunch of code in m6502cg(); things should be
much clearer vis-a-vis how things are parsed and code flow through that
function. Plus it's always nice to be able to throw away code. :-)
Now at v2.0.9.
Shamus Hammons [Wed, 7 Aug 2019 23:24:52 +0000 (18:24 -0500)]
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
Shamus Hammons [Sat, 23 Jun 2018 16:57:21 +0000 (11:57 -0500)]
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!
Shamus Hammons [Sun, 3 Jun 2018 15:01:45 +0000 (10:01 -0500)]
Minor fixups.
Basically give a more meaningful error message in incbin if the filename
is missing, and use the macros already defined in opkw.h instead of
cooking up our own and (possibly) getting out of sync later on down the
road.
Shamus Hammons [Sat, 24 Feb 2018 16:27:31 +0000 (10:27 -0600)]
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.
Shamus Hammons [Sat, 10 Feb 2018 05:08:47 +0000 (23:08 -0600)]
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.
Shamus Hammons [Sun, 21 Jan 2018 14:25:06 +0000 (08:25 -0600)]
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)
ggn [Wed, 29 Nov 2017 19:28:44 +0000 (21:28 +0200)]
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
Shamus Hammons [Wed, 29 Nov 2017 13:57:58 +0000 (07:57 -0600)]
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.
Shamus Hammons [Tue, 21 Nov 2017 13:54:55 +0000 (07:54 -0600)]
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.
ggn [Thu, 26 Oct 2017 12:24:25 +0000 (15:24 +0300)]
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.
Shamus Hammons [Sun, 8 Oct 2017 13:40:02 +0000 (08:40 -0500)]
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.
ggn [Tue, 1 Aug 2017 12:42:34 +0000 (15:42 +0300)]
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.
Various 020+ fixes. In brief, this commit fixes the following:
- Fix warning for \! inside string - we might be evaluating a macro so it's legal.
- Handle (Dn[.w][*scale],label[.l]) ea case.
- Enable scale value in ea to be expression (evaluated) besides constant.
- Fix for ([address[.wl]]). It seems that undefined symbols were not stored properly in eagen0.s (it used aNexpr instead of aNbexpr when storing base displacement).
- Fixes for fmove freg,freg (no size suffix) and ftst freg (no size suffix).
- fmovem now defaults to .x
- Fixed muls.l
Just when you thought it was safe to write macros with constants, up
pops a condition you thought was dead and buried yet lurches inexorably
towards your code and causes it to segfault. As it turns out, it was
bad token stream parsing that caused this, with a constant masquerading
as a STRING token being the particular mischief maker. The code that
was in place was an awful mess of horrible garbage code that wasn't
even being used anymore--so that crap is gone, and replaced with
something more (I hope) sane and maintainable. I think that the code
that was there survived purging for so long because nobody really
understood it; now that I understand it, I can't believe that it was
written in the first place (to be fair, some of it was patching done by
me, though the bulk of awfulness didn't come from that code). Onward
and upward...
Shamus Hammons [Sat, 24 Jun 2017 00:03:24 +0000 (19:03 -0500)]
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!