356 Commits

Author SHA1 Message Date
Olaf Seibert
2d86002111 Note the first change in CHANGES. 2021-02-14 15:03:08 +01:00
Olaf Seibert
57afe7ec85 Prepare for development after released version. 2021-02-14 14:36:32 +01:00
Stephen Casner
dcdbc02b2e Add binary operator '_' for left shift
If the command line option yus to allow the underscore character in
symbols is NOT selected, then interpret underscore as a new binary
operator meaning to do a left shift of the left side value by the
number of bit positions indicated by the right side value.  As for the
arithmetic operators, both values must be literal (numeric constants
or symbols equated to a numeric constant).
2021-02-14 14:33:42 +01:00
Stephen Casner
e452ac437c Ignore additional built files 2021-02-14 14:33:42 +01:00
Olaf Seibert
8d739efed4 Bump version to 0.6. 2021-02-13 14:24:56 +01:00
Olaf Seibert
39653bcd2f Fix typo. 2021-02-13 14:14:37 +01:00
Olaf Seibert
b6d49ec467 Typo/comment fixes. 2021-01-31 17:55:22 +01:00
Olaf Seibert
63fbbee2a5 Keep sanitizer options off by default.
I'm getting spurious memory leak errors from dumpobj.
2021-01-31 17:46:25 +01:00
Olaf Seibert
55243369eb Silence a spurious "maybe uninitialized" error.
mlb-rt11.c: In function 'mlb_rt11_entry':
mlb-rt11.c:284:27: warning: 'ent' may be used uninitialized in this function [-Wmaybe-uninitialized]
     buffer_resize(buf, ent->length + 1);        /* Make it large enough */
                        ~~~^~~~~~~~

It is spurious because ent gets initialized in the loop above.
If the loop is never executed, this must be because 0 >= mlb->nentries
and NULL is returned, so the buffer_resize() is never reached.
2021-01-31 16:20:08 +01:00
Olaf Seibert
ada2d17a1b Silence a spurious "maybe uninitialized" error.
mlb-rsx.c: In function 'mlb_rsx_entry':
mlb-rsx.c:374:23: warning: 'ent' may be used uninitialized in this function [-Wmaybe-uninitialized]
     fseek(mlb->fp, ent->position, SEEK_SET);
                    ~~~^~~~~~~~~~

It is spurious because ent gets initialized in the loop above.
If the loop is never executed, this must be because 0 >= mlb->nentries
and NULL is returned, so the fseek() is never reached.
2021-01-31 16:16:05 +01:00
Olaf Seibert
1d799534bb Add Commercial Instruction Set.
I haven't done much compatibility testing with MACRO11 to check
weirdnesses, but the original functionality is very limied: none
of the mnemonics has operands.
2021-01-27 16:31:45 +01:00
Olaf Seibert
fa7ece3864 Update CHANGES. 2021-01-23 22:43:44 +01:00
Olaf Seibert
706e4e9758 Clang found an uninitialized pointer. 2021-01-23 22:06:12 +01:00
Olaf Seibert
c53aec71c3 This TODO has been done (line end checks). 2021-01-23 21:30:52 +01:00
Olaf Seibert
e3042c9175 Remove dubious workaround in parse_unary().
The comment "eat first char of illegal label, else endless loop on
implied .WORD" was no longer true. It did reveal some other small
gotchas, which are corrected now as well.
2021-01-23 21:30:52 +01:00
Olaf Seibert
c587587f49 Fix/work around a bug in parse_expr().
There was an obscure bug in parse_expr(), used to evaluate 'if df',
where it could skip past the end of the line marker.

If this happened inside an expanded macro, then after that was the
next line...
In other cases it might be worse.

Now that this is fixed, another check for line end junk can be enabled.
2021-01-23 20:09:32 +01:00
Olaf Seibert
6f1af83101 Check junk at end of line with the repeat directives. 2021-01-23 18:37:47 +01:00
Olaf Seibert
40b41c3087 Here is another. 2021-01-23 17:23:29 +01:00
Olaf Seibert
af0cf5f7bc Here is the "Junk at end of line" case that I wanted to catch. 2021-01-23 17:18:08 +01:00
Olaf Seibert
5df0db5b58 First End Of Line checks. 2021-01-23 17:15:32 +01:00
Olaf Seibert
015c8bee23 Prepent register label values with a % in symbol table.
This changes the layout of all the regression test listings...
2021-01-23 16:37:15 +01:00
Olaf Seibert
0e3d596daf Allow implicit floating point immediate for FPP instructions
which have an general (source) argument and an AC destination.
There are no FPP instrs which have 1 general source arg;
only with 1 general destination (even TSTF).
2021-01-23 16:11:51 +01:00
Olaf Seibert
28f891dc1f Correct name of OC_[12]FIS to OC_FPP{ACGEN,GENAC}. 2021-01-22 18:26:07 +01:00
Olaf Seibert
e720e8a756 Fix floating ac number bounds check. 2021-01-22 18:10:36 +01:00
Olaf Seibert
21c994cfcd Replace magic value by the appropriate constant. 2021-01-22 18:09:42 +01:00
Olaf Seibert
a25a509ca5 Add some more test cases. 2021-01-21 20:56:22 +01:00
Olaf Seibert
96942ca6d6 Simplify rounding: unify cases for different sizes.
Mostly taken from Bjoren Davis in issue #5.
2021-01-21 20:56:22 +01:00
Olaf Seibert
8193f2c2cd Fix (rare) problem of exponent overflow when rounding. 2021-01-21 20:06:53 +01:00
Bjoren Davis
c559f1b65f Bump exponent when needed. 2021-01-21 18:04:49 +01:00
Olaf Seibert
3ef63b592e Add test for .MCALL (LIB)MACRO. 2021-01-20 21:33:13 +01:00
Olaf Seibert
2ac8b7eb5e Replace dodgy strncpy() with better range-checked variant. 2021-01-20 20:40:12 +01:00
Olaf Seibert
90943eaf49 Add some more tests; rounding of 56-bit mantissa now works. 2021-01-20 19:48:56 +01:00
Olaf Seibert
4f2f813dee Adjust some comments about precision 2021-01-19 10:52:22 +01:00
Olaf Seibert
7705c33076 Use standard type instead of ulong64 2021-01-19 10:52:22 +01:00
Olaf Seibert
0d2b0950be Fix short float rounding
The exponent was adjusted incorrectly.
2021-01-19 10:52:18 +01:00
Olaf Seibert
8aea1498c5 For now, solve the precision problem with brute force,
by using long double where available.
Unfortunately, it won't be available everywhere, so a better solution
would still be nice.
Also, sometimes rounding of smaller sizes doesn't work right yet.
2021-01-19 09:39:02 +01:00
Olaf Seibert
37abe35427 Add some test cases; some are failing so far. 2021-01-18 21:42:18 +01:00
Bjoren Davis
6f7e7963bc small (1 and 2 word) floating point literals not parsed correctly
Fix gitlab issue #5.

The parse_float() function has several bugs:

    1. For 1- and 2-word floats it will always write all 4 bytes if the value is
       exactly 0.
    2. It incorrectly rounds and normalizes 1- and 2-word floats.

To see the issue easily try the following inputs:

     .flt2  1.0
     .flt4  1.0

These will assemble as '040100 000000' and '040200 000000 000000 000000'.
They should both begin '040200'.

In fact the test file test/test-prec.mac is incorrect in its only floating point value:
	.word	^f 1.5		; 040140
should actually assemble as 040300, not 040140 (040140 is actually ^F0.875).
I confirmed this on RT-11 running MACRO V05.06.

I fixed the problem with the following deltas:

[the patch]

The most crucial change is the very last one. 0x200000000000 is actually (1 << 45)
and because ufrac is normalized it means that it will always downshift ufrac by 1.
2021-01-18 20:22:34 +01:00
Steven A. Falco
5af23d143e tar2mt: Correct argv test 2021-01-13 17:38:06 -08:00
Anders
4160763911 converters/Makefile,crossassemblers/Makefile: add missing directories 2021-01-03 11:52:01 -08:00
Anders
a1314cf21c .gitignore: add missing generated files 2021-01-03 11:51:59 -08:00
Olaf Seibert
07ee904c38 Extend test with a case that failed before a24e3ba3eaa70ab56346423a6156ac239737175e 2020-11-10 10:22:55 +01:00
Olaf Seibert
d7a98b8d4a Add another little macro-defined-within-macro test. 2020-08-22 15:45:52 +02:00
Olaf Seibert
2b6c416408 Prepare for development after released version. 2020-08-22 15:29:13 +02:00
Olaf Seibert
9638d527c9 Bump version to 0.5. 2020-03-24 23:37:59 +01:00
Olaf Seibert
2842c927b8 Add reference to original obj2bin in README. 2020-03-11 22:58:06 +01:00
Olaf Seibert
8ab3c27e0c Plug a memory leak. 2020-03-11 22:53:51 +01:00
Olaf Seibert
1958fa1fad Make default object file format choosable from Makefile. 2020-03-11 21:16:08 +01:00
Olaf Seibert
1508da6f48 Merge commit '114ceaf32c0969a318ec330a26a1ed5c5f4b2b47'
git subtree pull --prefix obj2bin https://github.com/AK6DN/obj2bin.git master
2020-03-11 20:59:37 +01:00
AK6DN
114ceaf32c Added RSX-11 format .obj file reader (as default), set BIN format as default output 2020-03-10 22:25:01 -07:00