Commit Graph

335 Commits

Author SHA1 Message Date
Shamus Hammons 43e59d87fe Version bump for last commit. Now at version 1.13.2. 2018-05-15 13:36:04 -05:00
ggn b94e4cd8af Remove hacky code that truncates absolute addresses. (Bug 38) 2018-05-15 13:35:04 -05:00
Shamus Hammons b93a2e2f8a Minor tweak for OP data address fixups. Now at version 1.13.1. 2018-02-26 20:43:58 -06: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 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 4ca3c2db26 Add fixup stubs for FU_FLOATfoo types. Now at version 1.12.4. 2018-02-10 11:41:18 -06:00
Shamus Hammons 33bb2746fa Cleanups for the RISC assembler. Now at version 1.12.3. 2018-02-10 11:14:28 -06:00
Shamus Hammons fe673c9fe1 Minor bugfix for FU_NUM15 fixups.
Since eval is an unsigned int, the check for eval < -16 would never be
true. This has been fixed by casting eval to an int. Now at v1.12.2.
2018-02-10 09:12:28 -06:00
Shamus Hammons a5527a0117 Fix for D_foo() macros.
Seems that no bounds checking was been done for the majority of the
D_foo() macros; that has been fixed. Now at v1.12.1.
2018-02-10 08:30:54 -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
Shamus Hammons 81c752326a Version bump for last eight commits; cleanup of Alcyon image writing.
Now at version 1.11.9.
2018-01-23 22:20:24 -06:00
ggn e5a1aead36 When an error occurs inside a macro or rept, report the exact line, not the line the macro or rept was invoked 2018-01-23 20:40:22 -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
ggn a67f83362c Added missing (d16,An,Dn[.size][*scale]) addressing mode 2018-01-23 20:11:52 -06:00
ggn 8a5d76b0e6 Fix for addressing mode base value getting clobbered by scale value 2018-01-23 20:05:25 -06:00
ggn 0c583009c5 FPU instructions debugged and stricter checks enforced 2018-01-23 19:55:34 -06:00
ggn 2e93724df4 divu.l/divs.l/mulu.l/muls.l debugged and condensed into one function 2018-01-23 19:45:24 -06:00
ggn 76299dcc58 Add flag -px in alcyon mode which enables extended GST symbol table. 2018-01-23 19:35:29 -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 3b063cd8b1 Fixes for slightly broken Motorola extended float generation. 2018-01-22 12:04:31 -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
ggn c2caacfdc8 Modified IMACRO and IREPT to store line numbers during definition - error now correctly prints source line number 2017-11-29 13:58:33 -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 689803cff9 Small fix for spurious "out of range" errors (tied to 64-bit eval path). 2017-10-13 18:00:10 -05: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 ada93ab0c3 Patch to fix lack of WORD sized symbol relocations by SainT.
Version now at 1.8.7.
2017-10-04 11:25:45 -05:00
Shamus Hammons c0bdc914ed Missed a few double parens in eagen0.c. :-P 2017-08-29 13:49:06 -05:00
Shamus Hammons d1f5f1cacc Added a few more fixes piggybacked on the last one; bump to v1.8.6. 2017-08-29 13:28:18 -05:00
ggn 3c7505f2f4 On some occasions elf output would misplace symbols due to the fact that it D_word thought that it would write outside current chunk. 2017-08-29 13:23:28 -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 a7d3861005 Version bump (1.8.4) for last commit. 2017-08-10 19:08:32 -05:00
ggn 05d0350b35 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.
2017-08-10 18:52:53 -05:00
ggn 1b98a8c971 Fix for reg keyword not working. Apparently it was renumbered (and unused) when the jaguar specific stuff went in and was never tested. 2017-08-10 18:44:24 -05:00
Shamus Hammons 947f081dd2 Version bump (1.8.3) for last commit. :-P 2017-07-20 14:17:47 -05:00
Shamus Hammons 49eac9eff9 Fix for bug #102. Thanks (blame!) go to ggn & dml for the idea. :-) 2017-07-20 14:15:53 -05:00
Shamus Hammons 79c1a7cc20 Version bump (1.8.2) for last commit. 2017-07-20 08:38:02 -05:00
ggn da0013df94 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
2017-07-20 07:52:45 -05:00
Shamus Hammons f7f625cf6c Fix for bug #101 (bad macro handling).
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...
2017-07-19 23:22:01 -05:00
Shamus Hammons c9541a9d4f Fixed IREPT blocks to not corrupt memory on 64-bit hosts. 2017-07-19 15:27:06 -05:00
Shamus Hammons c3bb316d42 Minor code cleanups. 2017-06-23 19:58:41 -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 03eb5a53e1 Increase line lengths for listing and line parser. 2017-05-06 13:07:07 -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 51cff2ac6c Version bump for last commit. :-) 2017-05-05 08:33:31 -05:00