182 Commits

Author SHA1 Message Date
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
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
Olaf Seibert
8ce31d6bac Add -rt11 and -rsx options to usage message. 2020-03-08 21:38:14 +01:00
Olaf Seibert
5497a73a42 Add 'obj2bin/' from commit '5015ea60c545a7a21b17d5f313601111b96fe1cf'
git-subtree-dir: obj2bin
git-subtree-mainline: 890daab687b2625a59ef0295924fc711bf47bf29
git-subtree-split: 5015ea60c545a7a21b17d5f313601111b96fe1cf

Command was: git subtree add --prefix obj2bin https://github.com/AK6DN/obj2bin.git master
2020-03-08 21:28:29 +01:00
Olaf Seibert
890daab687 Add .PAGE as no-op, and give errors for misplaced .ENDR .ENDM. 2020-03-08 16:50:51 +01:00
Olaf Seibert
43aef73305 Fix logical error in listing from maclib.
It seems the code was similarly wrong before I introduced the flag
CALLED_NOLIST in f07c9045f5bf60ccd821a33bb4ebf06d06fe7c48.

No change in regression tests as we don't have macro libraries available
to test.
2020-03-07 23:23:44 +01:00
Olaf Seibert
cdef7047eb Make that .enabl ama does not affect the next pass. 2020-03-07 18:43:45 +01:00
Olaf Seibert
c4221e0b4b Sometimes pc-relative addressing needs no relocation record.
In this case, in an absolute section refering to an absolute symbol.
Use test cases from Johnny Billquist.
2020-03-07 17:34:45 +01:00
AK6DN
5015ea60c5 Update documentation comments 2020-03-06 23:48:55 -08:00
AK6DN
4523bd75e0 Update documentation re: multiple input .obj files 2020-03-06 21:51:29 -08:00
Olaf Seibert
62868a6661 Get rid of #define stricmp strcasecmp. 2020-03-06 22:44:20 +01:00
Olaf Seibert
88d33fd913 Adjust 2.11BSD-m11-lout.lst.ok.
Because of this corrected sequence:

      575        000000                  lctbas  =       .
      576 000000                                genlct  seq
        1        000001                  lc.seq=        1
-       2                                       .rept   <.-lctbas>/2
+       2        000000                         .rept   <.-lctbas>/2
        3                                lc.seq=        lc.seq+lc.seq
        4                                       .endm
-       1        000002                  lc.seq=        lc.seq+lc.seq
        5 000000 073631                         .rad50  /seq/
        6                                       .if nb  <>
        7                                       lcinit= lcinit+lc.seq
        8                                       .endc

The repeat count is 0. lc.seq previously incorrectly had a value of 2
but now it has the correct value of 1.
This has a knock-on effect on various other expressions throughout, so there
are various changes.
2020-03-06 22:08:02 +01:00
Olaf Seibert
2349d80ec8 Fix .REPT 0 to not repeat the code block at all.
Also, now list the calculated repeat count for reference.
This occurred a few times in the regression tests to fix the expected
outcome.
2020-03-06 21:58:53 +01:00
Olaf Seibert
7595621cd7 Add new options to usage message. 2020-03-04 19:41:22 +01:00
Kevin Handy
bf322f3c6b Fix file name parsing. 2020-03-04 19:40:56 +01:00
Olaf Seibert
94d044fd77 Add -rt11 option to dumpobj too. 2020-03-03 22:58:32 +01:00
Olaf Seibert
592b7facf1 Silence gcc7 warnings by adjusting FALLS THROUGH comment. 2020-03-03 22:11:02 +01:00
Olaf Seibert
5c9fc1ae16 Try to fix travis yml. 2020-03-03 21:46:57 +01:00
Kevin Handy
e2fb29e3f2 Make the produced object file configurable...
at run time, from the command line.
2020-03-03 19:13:20 +01:00
AK6DN
fa38443f8a sort psect list in .log file in asc addr order instead of name order 2019-03-25 20:17:31 -07:00
Olaf Seibert
c80c87b2d4 Test another weird delimiter: .ASCIZ && 2018-11-10 17:12:21 +01:00
Olaf Seibert
78fb685e59 Clarify ORG error message a bit
its counterpart for absolute sections mentions the section type too.
2018-11-10 17:12:21 +01:00
Olaf Seibert
2920e9f2f9 Test a few error message with .IIF. 2018-11-10 17:12:21 +01:00
Olaf Seibert
2dbf80388e Add tests for (N)'DF foo!bar' and (N)'DF foo&bar'. 2018-11-10 17:12:21 +01:00
Olaf Seibert
a42b49f73b Bug: '.iif conf, label: foo' didn't work. 2018-11-10 17:12:21 +01:00
Olaf Seibert
8c89fd27cf Try if gitlab-ci is as easy as Travis... 2018-06-06 22:24:14 +02:00
Olaf Seibert
647b639552 Also build and test on osx. 2017-12-18 14:59:45 +01:00
Olaf Seibert
877400f236 Fix error message for .odd with argument. 2017-12-18 14:50:17 +01:00
Olaf Seibert
d98c1e54d0 Initial Travis CI config.
Try to get Travis' gmake to run ./make-git-info in before compiling macro11.c.
In RunTests, reflect differences in exit status, for automated testing.
2017-12-18 14:30:30 +01:00
AK6DN
fd0eea148e added .gitignore 2017-07-19 21:22:08 -07:00
Olaf Seibert
0a9d7cddb0 Add some of the changes to CHANGES. 2017-05-13 19:47:03 +02:00
Olaf Seibert
5f5414fb37 Update some dates. 2017-05-06 19:11:19 +02:00
Olaf Seibert
a279a86076 Remove unneeded include (which cases compile errors wrt. git-info.h) 2017-05-06 19:10:21 +02:00
Olaf Seibert
1557c4c186 Add stuff to .gitignore. 2017-05-06 17:55:47 +02:00
Olaf Seibert
ea5ef8587f Add .ENABL LCM. Its default setting was incorrect. 2017-05-06 17:53:15 +02:00
Olaf Seibert
f3af0d060f Adjust tests: .ENABL LC can now be removed.
This changes all the 2.11 listings.
2017-05-06 17:15:20 +02:00