229 Commits

Author SHA1 Message Date
Olaf Seibert
33fc39ff32 Bump version to 0.7. 2021-03-19 20:16:16 +01:00
Olaf Seibert
b100021ffd Add check for odd branch target.
Apart from the fact that instruction addresses must be even, this can't
even be expressed since the branch offset is expressed in words.
2021-03-14 21:19:18 +01:00
Olaf Seibert
0e373a8570 Make operand parsing error messages more helpful
and add a test that is supposed to exercise them all.
2021-03-14 20:19:15 +01:00
Olaf Seibert
d4c0520ac1 Update CHANGES. 2021-03-14 14:43:54 +01:00
Olaf Seibert
6369384e25 Add some missing instructions.
- to tests: MFPT, MTPS, MFPS
- also to opcode set: CSM, TSTSET, WRTLCK
2021-03-13 22:55:04 +01:00
Olaf Seibert
6280a4416e Add test file with all opcodes. 2021-03-13 16:49:16 +01:00
Olaf Seibert
cf7e442557 LDCFD: add missing FloatingPointProcessor instruction. 2021-03-13 15:48:04 +01:00
Olaf Seibert
7d4370af45 Make sure "str->stream.next = NULL"
even though it isn't strictly necessary (stack_push() will set it
later).
2021-03-13 14:50:57 +01:00
Olaf Seibert
70d06c9a92 Fix a double free. 2021-03-13 14:50:29 +01:00
Bjoren Davis
12e66a65d9 Properly set the character pointer after the operand.
Fixes issue #6.
2021-03-13 14:00:51 +01:00
Olaf Seibert
54b73f7f9c Attempt bracketing checking.
Too bad we can't issue a diagnostic here now; we just return failure
and the caller will probably next try a whitespace delimited string
next.
2021-02-18 22:49:52 +01:00
Olaf Seibert
289860e539 Rearrange flow control in brackrange()
which was a bit weird.
This also fixes a potential bug when a bracketed or nested string is not
properly terminated on this line.
2021-02-18 20:56:54 +01:00
Olaf Seibert
13c5a8374f Adjust the notice in CHANGES. 2021-02-15 20:06:34 +01:00
Stephen Casner
ef8afb9e5f Put back a blank line unintentionally deleted 2021-02-15 19:48:23 +01:00
Stephen Casner
05fc94ce90 Extend left-shift operator
- Negative shift values are right-shift
- Optimize shift of 0 or more than 15
- Allow shifting symbols by complex relocation
2021-02-15 19:48:16 +01:00
Olaf Seibert
93d7839ccf Expand some tabs that crept in over time. 2021-02-14 22:00:30 +01:00
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