Add .PAGE as no-op, and give errors for misplaced .ENDR .ENDM.

This commit is contained in:
Olaf Seibert 2020-03-08 16:50:51 +01:00
parent 43aef73305
commit 890daab687
4 changed files with 23 additions and 4 deletions

View File

@ -274,10 +274,9 @@ static int assemble(
switch (op->section->type) {
case SECTION_PSEUDO:
switch (op->value) {
case P_ENDR:
case P_ENDM:
case P_SBTTL:
case P_PAGE:
case P_PRINT:
case P_SBTTL:
return 1; /* Accepted, ignored. (An obvious
need: get assembly listing
controls working fully. ) */
@ -956,6 +955,14 @@ static int assemble(
pop_cond(last_cond - 1);
return 1;
case P_ENDM:
report(stack->top, "No macro definition block active\n");
return 0;
case P_ENDR:
report(stack->top, "No repeat block active\n");
return 0;
case P_EVEN:
cp = skipwhite(cp);
if (!EOL(*cp)) {

View File

@ -53,7 +53,14 @@ test-endm.mac:37->M5:3: ***ERROR .ENDM 'NOTM5' does not match .MACRO 'M5'
40 .macro M6
test-endm.mac:41: ***ERROR .ENDM 'NOTM6' does not match .MACRO 'M6'
41 .endm notM6 ; wrong
41
42
test-endm.mac:43: ***ERROR No macro definition block active
43 .endm ; end without macro
test-endm.mac:44: ***ERROR No repeat block active
44 .endr ; end without repetition
test-endm.mac:45: ***ERROR No conditional block active
45 .endc ; end without condition
45
Symbol table

View File

@ -39,3 +39,7 @@
.macro M6
.endm notM6 ; wrong
.endm ; end without macro
.endr ; end without repetition
.endc ; end without condition

View File

@ -23,6 +23,7 @@
test-rept.mac:20: ***ERROR .REPT value must be constant
20 .rept undefd
21 000014 005200 inc r0
test-rept.mac:22: ***ERROR No repeat block active
22 .endr
22