17 Commits

Author SHA1 Message Date
Olaf Seibert
fcc85aa5f5 Fix .asciz <expr>... where an overzealous parsing wants to parse too much of the remaining text
In particular, the example was
	.asciz <cr><lf>/<SOH>/
where it tried to make a division betweem <lf> and the delimited
string /<SOH>/.
2015-05-10 17:32:44 +02:00
Olaf Seibert
787625ab47 Somewhat more interesting error messages. 2015-05-09 23:52:40 +02:00
Olaf Seibert
a8b6c026db Correct comment. 2015-05-09 16:07:58 +02:00
Olaf Seibert
60511a5f81 Improve comment. 2015-05-09 16:04:50 +02:00
Olaf Seibert
e477f7bd80 The manual differs from the implementation...
at least the one of RSX M+ 4.6.
Inconsistent flags given to .PSECT seem to be simply combined, with
nothing special done after pass 1 when re-reading for 2. The situation
at the end of pass 2 wins.
2015-05-09 15:45:00 +02:00
Olaf Seibert
20f25b9dd9 Fix bug with .SAVE and .RESTORE
.SAVE didn't check for  stack overflow.
.RESTORE moved the stack pointer in the wrong direction.
2015-05-09 12:51:31 +02:00
Olaf Seibert
b4d3c9a094 Fix undefined macros in second pass when conditional inclusion is used...
Given the following conditional inclusion, as seen in RSX Kermit-11
sources:

        .if ndf, K11INC
        .ift
        .include /IN:K11MAC.MAC/
        .include /IN:K11DEF.MAC/
        .endc

macros defined in K11MAC.MAC are unknown when used later on.

The assembler keeps a running count of the line number (stmtno) and
stores it in the macro definition. In the second pass, it tries to avoid
cases of use-before-defined, because it doesn't really forget the
macros.

However, in this case, the second pass has fewer lines, because there
was some conditional inclusion... so when the macro is used in the
second pass, its running line number (including the skipped inclusions)
is lower than the line number where the macro was defined...

The line number check would also interfere when the /PASS:1 and /PASS:2
input file modifiers would be implemented.

It seems to me that in most normal cases, a use-before-defined is
already detected in the first pass, so the check is not really needed.

Therefore I have simply removed it.
2015-05-08 23:19:13 +02:00
Olaf Seibert
184fae4b67 Generalise argument string parsing,
not just for .include. Manual shows various delimiters.
2015-05-08 12:35:57 +02:00
Olaf Seibert
f01ee85a8f Allow whitespace before comma in two-general-operand instructions.
(it was allowed already in other cases such as SOB, JSR, ASH, ...).
2015-05-08 10:03:04 +02:00
Olaf Seibert
422285bb60 If a section is declared a second time, and flags...
are given, then they must be identical to the  first time.
See page 6-38 of AA-KX10A-TC_PDP-11_MACRO-11_Reference_Manual_May88.pdf .
2015-05-08 02:09:03 +02:00
Olaf Seibert
3b6637f82d Also add NOSAV flag to PSECT. 2015-05-08 00:41:18 +02:00
Olaf Seibert
6acf2971bd Add the "COM" flag to PSECT/CSECT: opposite of OVR. 2015-05-08 00:28:25 +02:00
Olaf Seibert
98e782e41e INCLUDE file names may have quotes around them. 2015-05-08 00:08:50 +02:00
Toby Thain
ea8ee367ee Fix crash on OS X x86_64. 2015-02-03 19:35:03 -05:00
Toby Thain
48996a6627 Typo and one more warning. 2015-02-01 22:25:59 -05:00
Toby Thain
7ab53debb8 Fix some warnings under clang. 2015-02-01 22:11:54 -05: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