Skip to content

Commit

Permalink
Better fix for the two-word splitting problem.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
atsampson committed Apr 21, 2018
1 parent 9acab4b commit 7b28732
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions <mdl.int>/midas.323
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

;EQUAL SYM1,SYM2 ;DEFINE SYM1 SAME AS SYM2.
Expand Down

0 comments on commit 7b28732

Please sign in to comment.