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!
Shamus Hammons [Tue, 2 May 2017 18:02:47 +0000 (13:02 -0500)]
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.
6502 mode: fix clearing of its RAM space with each .6502 invocation. Also fixed chptr resetting with each .6502 invocation. Also in this mode: dc.b strings with single quotes will get encoded to Atari 800 internal encoding (hardcoded mode for now, can be extended).
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.
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.
This probably won't help on Visual Studio, unless you can tell the build
system there to use a C99 compliant compiler (MS's track record in this
area is abysmal).
Shamus Hammons [Sun, 15 May 2016 23:25:37 +0000 (18:25 -0500)]
Fix for bug #67 (thanks to ggn for reporting!).
Turns out the tokenizer would not properly tokenize DOTx constructs
unless they were hanging off the end of a symbol. This should fix that
once and for all.
Shamus Hammons [Mon, 7 Dec 2015 03:29:06 +0000 (21:29 -0600)]
Removed naked 'abs' (sans leading dot) from mntab.
The problem with having .abs *and* abs (as an alternate) is that the
naked abs conflicts with the RISC asm instruction ABS R#. There's no
good way to detect this ahead time, and it's a bad idea to do so anyway.
So don't do it!