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!
ggn [Fri, 30 Oct 2015 17:30:21 +0000 (19:30 +0200)]
Fix for bug that happened when a called macro inside an if/endif block would have a syntax error: the assembler would get stuck in an infinite loop (Error: mismatched .endif)