Better fix for the two-word splitting problem.
authorAdam Sampson <ats@offog.org>
Sat, 21 Apr 2018 16:16:05 +0000 (17:16 +0100)
committerAdam Sampson <ats@offog.org>
Sat, 21 Apr 2018 16:16:05 +0000 (17:16 +0100)
It's now clearer to me how IRCONT is meant to be used: the BKBUF buffer
is BSIZE+5 words long, so it's OK to go a word or too over BSIZE. So
you're meant to set IRCONT before you start adding words, and clear it
*before* you add the last one.

So no need for my extra function; just use IRCONT as intended.

The code in CNSTA wrote its last word with IRCONT still set. I think
this is harmless because it was always the first word in a block anyway,
but fixed anyway.

<mdl.int>/midas.323

index 100c15e6a6414d2a21945665f386bbfa826c6fcc..bbb37e74b34e1890ed53cbf56af53ccec1589971 100644 (file)
@@ -2997,14 +2997,15 @@ OUTDE1: TLNE FF,FLPPSS
 ;I.E. TELL LOADER THAT SQUOZE IN SYM, FORMERLY CONSIDERED LOCAL, IS REALLY GLOBAL
 PLOGLO:        SKIPGE CONTRL
         RET
-       PUSHJ P,MKROOM
        PUSH P,A
+       TRO I,IRCONT    ;Don't end block between the two words
        PUSHJ P,PBITS7
        MOVEI A,CLGLO
        PUSHJ P,PBITS
        TLO SYM,400000  ;SAY THIS IS NEW STYLE RQ,
        PUSHJ P,OUTSM0  ;PUNCH "OLD NAME" = SYMTAB IDX,
        TLC SYM,440000  ;SAY MAKE GLOBAL, OUTPUT ACTUAL NAME OF SYM.
+       TRZ I,IRCONT
        PUSHJ P,OUTSM
        JRST POPAJ
 \f
@@ -3937,8 +3938,8 @@ CNSTA:    HRRZ T,PBCON
        TLO A,100000    ;RELOCATE
        PUSHJ P,$OUTPT
        HRRZ A,1(T)
-       PUSHJ P,$OUTPT  ;OUTPUT VALUE, FIRST LOCATION IN AREA
        TRZ I,IRCONT
+       PUSHJ P,$OUTPT  ;OUTPUT VALUE, FIRST LOCATION IN AREA
 CNSTDA:        MOVSI A,CTDEF
        IORM A,2(T)     ;CALL IT DEFINED
 CNSTD: TRNE FF,FRPSS2
@@ -4891,14 +4892,6 @@ PBITS:   SKIPGE CONTRL
        TROA FF,FRBIT7
        TRZ FF,FRBIT7
        IDPB A,BITP
-       POPJ P,
-
-               ;Call when you're about to output two words into a block.
-MKROOM:        PUSH P,A
-       MOVE A,OPT1
-       CAIL A,BSIZE+BKBUF-1    ;Space for more than one word?
-        PUSHJ P,EBLK           ;No - start a new block
-       POP P,A
        POPJ P,
 
                ;FOLLOWING ROUTINES SAVE AC'S EXCEPT FOR A
@@ -6275,13 +6268,14 @@ IFN CREFSW,XCT CRFDEF
        SKIPL CONTRL    ;IF RELOCATABLE ANDLOCAL SYMBOL,
        CAIL A,DEFGVR_-33.
         RET
-       PUSHJ P,MKROOM
+       TRO I,IRCONT    ;Don't end block between the two words
        PUSHJ P,PBITS7  ;TELL STINK TO EXPUNGE SYM.
        MOVEI A,CLGLO
        PUSHJ P,PBITS
        TLO SYM,400000  ;SAY IS NEW TYPE RQ,
        PUSHJ P,OUTSM0
        MOVSI A,400000  ;NEW NAME NULL => DELETE.
+       TRZ I,IRCONT
        JRST $OUTPT
 \f
 ;EQUAL SYM1,SYM2       ;DEFINE SYM1 SAME AS SYM2.