Give error about excessive alignment at the right time.

The error "Alignment factor must not exceed segment align factor" is now given when an ALIGN record with greater alignment than its segment is encountered. (This is the error that was given erroneously in other circumstances before the last commit.)
This commit is contained in:
Stephen Heumann 2021-03-03 22:53:57 -06:00
parent aa9a585d19
commit 8aa3c4e8c7
2 changed files with 16 additions and 1 deletions

View File

@ -26,6 +26,7 @@
**************************************************************** ****************************************************************
* *
Align private Align private
using Common
ldy #1 get the alignment factor ldy #1 get the alignment factor
lda [sp],Y lda [sp],Y
@ -34,7 +35,12 @@ Align private
iny iny
lda [sp],Y lda [sp],Y
sta r2 sta r2
add4 sp,#5 skip the alignment opcode and operand cmpl segAlign,r0 if alignment factor > segAlign
bge lb1
ph4 #0 Error(NULL,22)
ph2 #22
jsr Error
lb1 add4 sp,#5 skip the alignment opcode and operand
jsr DefineAlign do the align jsr DefineAlign do the align
rts rts
end end

View File

@ -608,3 +608,12 @@
.d .d
sta 2+&op sta 2+&op
mend mend
macro
&lab cmpl &n1,&n2
&lab lda 2+&n1
cmp 2+&n2
bne ~&syscnt
lda &n1
cmp &n2
~&syscnt anop
mend