91 Commits

Author SHA1 Message Date
Olaf Seibert
fda852a3f1 ^X is not an extension; ^R ^/.../ is.
Adjust comments about that.
2015-11-09 21:13:49 +01:00
Olaf Seibert
e148471a19 Extension .ascii ^/.../ conflicts with .ascii ^...^
so I removed it.
2015-11-09 21:11:41 +01:00
Olaf Seibert
0fba6eea33 Use function for creating a literal expression node. 2015-11-08 20:51:45 +01:00
Olaf Seibert
d6ff111149 Introduce a function to create a binary expression node. 2015-11-08 20:51:07 +01:00
Olaf Seibert
40ff236aaf Make free(tp) common code. 2015-11-08 20:49:37 +01:00
Olaf Seibert
9d756361b4 Fix pasto, present since all recorded history.
I don't think it made any practical difference: 2, like 1, is >= 1 and
that is what all the tests of xxx_PREC test.
2015-11-08 17:41:46 +01:00
Olaf Seibert
09717c3a5a Add comparison files for tests. 2015-11-08 17:41:46 +01:00
Olaf Seibert
3657acf345 Clean up some now-inaccurate comments. 2015-07-06 22:27:46 +02:00
Olaf Seibert
e02d3b3bdf Update the README file for the situation since 2009. 2015-07-06 22:23:39 +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
ce2d526291 Added some robustness for when dumpobj is run on files which are...
almost an object file, such as an object library.
2015-06-09 22:33:53 +02:00
Olaf Seibert
22886c4a14 Add varrec, a little tool to convert files with variable records to byte streams. 2015-06-09 22:04:43 +02:00
Olaf Seibert
0aee873dc8 Add the link checker tool (in Perl).
This tool tells you which symbols are referenced by a group of OBJ files
but not defined.

It uses dumpobj to parse the OBJ files.
2015-06-09 22:04:01 +02:00
Olaf Seibert
137a9db671 More tests. Refine string delimiter test for .ASCII a bit.
Make the delimiters for .INCLUDE and .LIBRARY accept the same
delimiters (= is not disallowed, it just makes the line look like
an assignment).
2015-06-04 12:11:14 +02:00
Olaf Seibert
fdceabe88c Add .IF P1 and .IF P2 (tests for pass 1 and 2). 2015-06-04 00:35:31 +02:00
Olaf Seibert
b75195549e Combine .IF IDN and .IF DIF. 2015-06-03 23:03:36 +02:00
Olaf Seibert
c423ee346a Handle invalid expressions in .WORD directives with a message.
This is most relevant in implied .WORD directives which are caused by an
attempt to call a macro (which happens to be undefined) with arguments
that don't parse as valid expressions.
2015-06-01 23:30:16 +02:00
Olaf Seibert
ff5179743c Add addressing mode check for JSR, and a test. 2015-06-01 00:28:49 +02:00
Olaf Seibert
a24e3ba3ea Fix check for JMP Rn (which is illegal). 2015-05-31 23:34:05 +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
e46f8ee2c7 Add a simple file name parser to my_searchenv(),
to try to find the requested file without device, directory and/or in
lower case.
2015-05-31 22:00:04 +02:00
Olaf Seibert
87814f7bb9 Automatic dependency generation with gcc -MM. 2015-05-28 20:04:31 +02:00
Olaf Seibert
c8dbd26e9a This initialisation wasn't needed. 2015-05-27 22:22:52 +02:00
Olaf Seibert
bc450511d8 Add some tests for things I have fixed while the last weeks. 2015-05-27 21:54:00 +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
8a2ba3adf0 Print flag names. 2015-05-27 01:37:16 +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
435cdb0b7f Separate out the string parsing for .include/.library file names and macro arguments.
They behave observably different from generic string parsing and trying
to account for them generically just gets in the way.
.rept is treated the same as a macro.
2015-05-22 16:36:16 +02:00
Olaf Seibert
536d1856f0 .IF B,< > is supposed to be TRUE
because spaces are blank.
Seen in Kermit, although perhaps the author didn't mean that (MESSAGE < >).
2015-05-22 01:32:45 +02:00
Olaf Seibert
60af942129 .RESTORE restores DOT too
this is how it should be according to page 6-42 of the manual.
Kermit does this ugly thing to backpatch some .word value:

     435 000070                         	dial$time	35.
       1 000070                         	modval	35.,dial.time
       1                                	.save
       2 000070                         	.psect	modinf
       3        000006                  	. = $$current + dial.time
       4 000006 000043                  	.word	35.
       5 000070                         	.restore
     436 000070                         	wake$string	<^E^M>

where the current program section already is modinf. So the .save stores
DOT, it's changed to a lower value (6) to backpatch, and .restore sets DOT
back to 70.
2015-05-22 00:13:54 +02:00
Olaf Seibert
9640d19a1f Default module name is ".MAIN.". 2015-05-21 23:32:14 +02:00
Olaf Seibert
8433503792 Make sure that undefined global symbols don't get reduced to 0 when negated
Test case:

        ; test complex relocations

        ; .globl  IE.ITS,IE.MON ; implicit
        mov     #-IE.ITS, space

space:  .word   IE.ITS    ; the only simple relocation
        .word   -IE.ITS   ; all others are complex relocations
        .word   ^C<IE.ITS>
        .word   IE.ITS + IE.MON
        .word   IE.ITS - IE.MON
        .word   IE.ITS * IE.MON
        .word   IE.ITS / IE.MON
        .word   IE.ITS & IE.MON
        .word   IE.ITS ! IE.MON
2015-05-21 23:21:19 +02:00
Olaf Seibert
b8a15a89b5 Implement .ENABL and .DSABL LC. 2015-05-21 22:24:31 +02:00
Olaf Seibert
168340c54c A bit more tweaking of output/listing. 2015-05-21 00:57:52 +02:00
Olaf Seibert
6c992f6406 Fix some warnings from clang. 2015-05-20 22:54:26 +02:00
Olaf Seibert
59711f17f2 Make trailing commas work in .BYTE and .WORD
16 000000 000123                  state:  .word   123    ; 1 word
      17 000002 000000                          .word          ; 1 word
      18 000004 000001  000000                  .word   1,     ; 2 words
      19 000010 000000  000002                  .word   ,2     ; 2 words
      20 000014 000000  000000                  .word   ,      ; 2 words
      21 000020 000000  000000  000000          .word   ,,     ; 3 words
      22 000026 000001  000000  000000          .word   1,,    ; 3 words
      23 000034 000000  000000  000003          .word   ,,3    ; 3 words
      24 000042 000001  000000  000003          .word   1,,3   ; 3 words
      25 000050 000001  000002  000003          .word   1,2,3  ; 3 words
2015-05-19 22:57:45 +02:00
Olaf Seibert
dbc3a55666 Store section size after .EVEN and .ODD
just in case it's the last thing in the section.
2015-05-19 22:42:55 +02:00
Olaf Seibert
b45cf742f7 A trailing comma in a macro call is an empty argument
which should also be counted for the purposes of .NARG.
2015-05-19 22:10:44 +02:00
Olaf Seibert
2488e02aae A few more small listing tweaks. 2015-05-19 22:09:53 +02:00
Olaf Seibert
859e8dbb1f List macro calls with the location of DOT
Like MACRO V05.05.
2015-05-19 21:17:15 +02:00
Olaf Seibert
2e06f50286 List values in the data column, not the location column. 2015-05-19 21:15:57 +02:00
Olaf Seibert
06a780cb94 Suppress spurious error message in RSX format version. 2015-05-19 21:15:24 +02:00
Olaf Seibert
6a6a9ee1eb Remove two optimizations that RSX Macro-11 apparently does not perform.
This is useful for comparing created files with the original assembler.
They can be put back later.
2015-05-19 01:00:05 +02:00
Olaf Seibert
12fdea5b21 Adapt the generating and dumping of object files to what is observed
in RSX-11M+ files. Use conditional compilation so the RT-11 version can
be restored.
2015-05-19 00:56:40 +02:00
Olaf Seibert
f34996452b Mark PSECT relocation also with a ' in the listing. 2015-05-19 00:50:17 +02:00
Olaf Seibert
4fabe28497 Make .narg work
it should count only non-keyword (actual) arguments.
2015-05-14 14:33:54 +02:00
Olaf Seibert
833d9186cc Make empty expressions in .byte and .word work
such as
        .byte   ,0
2015-05-14 14:32:46 +02:00
Olaf Seibert
e703403017 Bring .ENDM label in correspondence with the manual. 2015-05-12 22:59:21 +02:00
Olaf Seibert
1e9e8023b3 Fix my_searchenv(). 2015-05-12 22:42:39 +02:00