35 Commits

Author SHA1 Message Date
Olaf Seibert
779c775107 Make RSX MLB parser more resistant to bad files. 2022-06-13 22:54:47 +02:00
Olaf Seibert
d2d143dd9b Put undefined symbols in separate table.
Even though all regression tests pass, it feels better to do the
undefined symbols similar to the implicit globals.
2021-05-30 13:19:39 +02:00
Olaf Seibert
7bbcbba5f5 Include undefined symbols in the symbol table for listing purposes.
MACRO11 V05.05 does this:

```
.MAIN.  MACRO V05.05  Sunday 18-APR-2021 16:29  Page 1

      1
      2 000000  012700  000000G                 mov #lab1,r0
      3
      4                                         .dsabl gbl
      5
U     6 000004  012700  000000                  mov #lab2,r0
      7
      8         000001                          .end

.MAIN.  MACRO V05.05  Sunday 18-APR-2021 16:29  Page 1-1
Symbol table

LAB1  = ****** GX       LAB2  = ******

. ABS.  000000    000   (RW,I,GBL,ABS,OVR)
        000010    001   (RW,I,LCL,REL,CON)
Errors detected:  1

*** Assembler statistics

Work  file  reads: 0
Work  file writes: 0
Size of work file: 34 Words  ( 1 Pages)
Size of core pool: 9260 Words  ( 35 Pages)
Operating  system: RSX-11M/M-PLUS

Elapsed time: 00:00:00.01
GBL,GBL/-SP=GBL
```
2021-05-30 13:19:39 +02:00
Olaf Seibert
2753b081cc Start each pass with .DSABL LSB
otherwise the end of pass 1 carries over into pass 2, which messes with
the ranges of local symbols.
2021-04-18 15:18:38 +02:00
Olaf Seibert
b9b61a4659 Prepare for development after released version. 2021-03-19 21:11:19 +01:00
Olaf Seibert
93d7839ccf Expand some tabs that crept in over time. 2021-02-14 22:00:30 +01:00
Olaf Seibert
1958fa1fad Make default object file format choosable from Makefile. 2020-03-11 21:16:08 +01:00
Olaf Seibert
8ce31d6bac Add -rt11 and -rsx options to usage message. 2020-03-08 21:38:14 +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
Olaf Seibert
62868a6661 Get rid of #define stricmp strcasecmp. 2020-03-06 22:44:20 +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
Olaf Seibert
5f5414fb37 Update some dates. 2017-05-06 19:11:19 +02:00
Olaf Seibert
ea5ef8587f Add .ENABL LCM. Its default setting was incorrect. 2017-05-06 17:53:15 +02:00
Olaf Seibert
6be865911c Each pass starts implicitly with .ENABL LC. 2017-05-06 17:11:56 +02:00
Olaf Seibert
faf378ba86 Factor out some common pass initialisation code. 2017-05-06 17:07:53 +02:00
Olaf Seibert
e4ec481d3d Add RT11 macro libraries.
Hopefully they won't open as RSX ones, because then they still won't work.
Can't test this now.
2017-04-27 20:34:07 +02:00
Olaf Seibert
80b20b17eb Add some info about git commit when printing the version.
Also modify dependency generation to be a side-effect of compilation.
It's still not quite perfect in picking up some changes (in particular
just after a commit, no files have changed but the git identification
is now different).
2015-07-06 21:43:03 +02:00
Olaf Seibert
60d0afde00 Use the path search also for .INCLUDE, and add -I option: include path
The -I option is used to specify the search path for .INCLUDE files.
It also appends this to the "INCLUDE" environment variable.
2015-05-31 22:52:05 +02:00
Olaf Seibert
d38f4009c4 Crank up the warning levels, and adjust the code to silence ...
several compilers:
- gcc version 4.5.3 (NetBSD nb2 20110806)
- gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
- Ubuntu clang version 3.6.0-2ubuntu1 (tags/RELEASE_360/final) (based on LLVM 3.6.0)

The warnings were mostly about local variables shadowing others,
unused function parameters, and C++ style comments. Some variables were
indeed used before set.

Note that on Linux, using -std=c99 does stupid things like *remove* the
declaration of strdup() from <string.h>. Therefore I've reluctantly used
-std=gnu99.
2015-05-27 21:51:26 +02:00
Olaf Seibert
bbaf56206e Allow extraction of Object LiBraries too.
Eliminate terminating 0 byte in macro buffers.
2015-05-24 17:37:08 +02:00
Olaf Seibert
da068e07c8 Make sure the -v argument show that this is not the same as previous versions. 2015-05-22 16:40:37 +02:00
Olaf Seibert
9640d19a1f Default module name is ".MAIN.". 2015-05-21 23:32:14 +02:00
Olaf Seibert
f75f5e1242 Change delimiters of local symbol blocks to be more like page 3-10 of the manual.
Also, to make Kermit sources work, only increase the local symbol block
counter if there actually was a local symbol used in the block.
This way, conditional inclusions (which include source text only in the
first pass) will have less potential for de-synchronisation between the
passes. After all, if the generated internal local symbol names do
not match, phase errors will result (showing themselves as strange label
redefinition problems).
2015-05-10 17:51:32 +02:00
Olaf Seibert
2bc55f39f3 Add debug flag to command line interpretation. 2015-05-10 17:39:38 +02:00
Olaf Seibert
2c091595e9 Add option -yl1 to list pass 1 as well
Normally listing is suppressed during the first pass, because there are
many unresolved symbols, which will be better in pass 2.
Errors are also suppressed because most of them are spurious.

With the -yl1 option, listing during pass 1 is not suppressed.
If you give the option twice, you also get the error messages.
2015-05-10 01:12:36 +02:00
Olaf Seibert
e55979b30d Add a symbol and section table dump at the end of the listing. 2015-05-10 00:04:41 +02:00
Olaf Seibert
32b8059cf8 Put code where it belongs. 2015-05-09 23:54:54 +02:00
Olaf Seibert
4849f7f039 Reset dot in all sections. write_globals() only does it...
if there is an object file.
2015-05-08 02:03:23 +02:00
Olaf Seibert
a5cc743cd6 Fix "-l -". 2015-05-07 21:39:50 +02:00
Toby Thain
6c388dcf54 Fix crashes when arguments aren't provided to options that expect them. Detect when an option might have been forgotten. Add some tests for required option arguments. 2015-02-03 22:07:58 -05:00
Toby Thain
7ab53debb8 Fix some warnings under clang. 2015-02-01 22:11:54 -05:00
Sergey Svishchev
8caea63b6a XXX #define stricmp strcasecmp 2013-06-04 23:38:14 +04:00
Sergey Svishchev
6a2afc3fa7 Import J Hoppe's 20090427 release from http://retrocmp.com/tools/macro-11-on-windows 2013-02-15 23:50:38 +04:00
Sergey Svishchev
3b8e141917 Initial import of 2001 code from http://www.dbit.com/pub/linux/macro11/ 2013-02-15 23:44:59 +04:00