From 8aa3c4e8c70d64991926812aef92f2a6d78905ba Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Wed, 3 Mar 2021 22:53:57 -0600 Subject: [PATCH] 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.) --- pass2.asm | 8 +++++++- pass2.mac | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pass2.asm b/pass2.asm index aac0e28..07ad2ff 100644 --- a/pass2.asm +++ b/pass2.asm @@ -26,6 +26,7 @@ **************************************************************** * Align private + using Common ldy #1 get the alignment factor lda [sp],Y @@ -34,7 +35,12 @@ Align private iny lda [sp],Y 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 rts end diff --git a/pass2.mac b/pass2.mac index 78307f1..c4f9f6f 100644 --- a/pass2.mac +++ b/pass2.mac @@ -608,3 +608,12 @@ .d sta 2+&op mend + macro +&lab cmpl &n1,&n2 +&lab lda 2+&n1 + cmp 2+&n2 + bne ~&syscnt + lda &n1 + cmp &n2 +~&syscnt anop + mend