Text preview for : 22544-8000x.txt part of HP 22544-8000x HP 2000TSB 22544-8000x.txt



Back to : 22544-8000x.txt | Home

22544-80001
16K STAND-ALONE DUMP OF HP 2000C/F FORMAT MAG TAPE
H0101

ASMB,A,L,C *** 2000C/F TSB PROGRAM DECODER ***
*
HED *** 2000C/F TSB PROGRAM DECODER ***
* VERSION D - APRIL 6, 1973
*
ORG 2B
*
CON EQU 12B TTY SELECT CODE.
LP EQU 17B LINE PRINTER SELECT CODE.
MT EQU 21B MAG TAPE COMMAND CHANNEL.
PUN EQU 25B PUNCH SELECT CODE.
*
HLT 2 FOR SYSTEM
JMP *-1 PROTECTION.
HLT 4,C POWER FAIL HALT.
HLT 5 PARITY ERROR/MEMORY PROTECT HALT.
CLC 6,C IGNORE DMA CHANNEL 1 INTERRUPTS.
ORG CON
JSB T35DR,I JUMP TO INTERRUPT SECTION OF TTY.
ORG LP
CLC LP,C IGNORE LINE PRINTER INTERRUPTS.
ORG MT-1
CLC MT-1,C IGNORE MAG TAPE
CLC MT,C INTERRUPTS.
ORG PUN
CLC PUN,C IGNORE PUNCH INTERRUPTS.
*
*
ORG 100B
JMP START GO TO START PROGRAM.
*
*
* REQUIRED HARDWARE:
*
* 2116/2100 COMPUTER WITH 16K MEMORY, EAU, AND DMA
* 7970A MAGNETIC TAPE UNIT
* PAPER TAPE READER
* 2753A PAPER TAPE PUNCH
* 2752A/2754B TELETYPE
* 2767A EQUIVALENT LINE PRINTER
*
* OPERATING INSTRUCTIONS:
*
* 1. LOAD ABSOLUTE PROGRAM INTO CORE.
* 2. MOUNT THE TSB DUMP MAG. TAPE (UNIT 0),
* TURN ON REQUIRED DEVICES.
* 3. START AT ADDRESS 100B.
* 4. ENTER COMMANDS ON THE CONSOLE.
*
* CONFIGURATION CHANGES:
*
* RE-ASSEMBLE THE PROGRAM AFTER CHANGING: CON, LP, MT, AND PUN
* (GIVEN ABOVE) TO REFLECT THE NEW SELECT CODES AND CLEAR PCHA1
* (IN THE PRINT CHARACTER ROUTINE) IF USING 2767 LINE PRINTER.
* NOTE: MT IS THE LOW PRIORITY MAG. TAPE SELECT CODE.
SKP
* COMMAND FORMATS
* ---------------
*
* STOP CLEARS THE SWITCH REGISTER, REWINDS AND
* SETS MAG. TAPE OFF-LINE, AND HALTS THE
* COMPUTER.
*
* END SAME AS STOP.
*
* DIRECTORY PRINTS A DIRECTORY OF THE PROGRAMS AND
* FILES WHICH ARE ON THE MAG. TAPE.
*
* DIRECTORY-ID SAME AS DIRECTORY BUT ONLY FOR THAT ID.
*
* PUNCH PUNCHES THE FIRST PROGRAM ON THE MAG. TAPE
* AND SETS UP FOR SUBSEQUENT PUNCHING OF
* EVERY PROGRAM.
*
* PUNCH-ID PUNCHES THE FIRST PROGRAM ON THE MAG. TAPE
* WHICH BELONGS TO THAT ID AND SETS UP FOR
* SUBSEQUENT PUNCHING OF EVERY PROGRAM OF
* THAT ID.
*
* PUNCH-ID,NAME SEARCHES FOR THAT PARTICULAR PROGRAM,
* PUNCHES IT, AND SETS UP FOR SUBSEQUENT
* PUNCHING OF ALL FOLLOWING PROGRAMS. BEGINS
* SEARCH AT CURRENT MAG. TAPE POSITION
* (NO REWIND).
*
* CR AFTER ANY PUNCH INITIATES PUNCHING OF THE SUBSEQUENT
* PROGRAM AS INDICATED ABOVE.
*
* LIST LISTS EVERY PROGRAM ON THE MAG. TAPE.
*
* LIST-,,HEADING SAME AS LIST BUT WITH PAGE HEADING.
*
* LIST-ID LIST ALL PROGRAMS BELONGING TO THAT ID.
*
* LIST-ID,,HEADING SAME AS LIST-ID BUT WITH PAGE HEADING.
*
* LIST-ID,NAME LISTS ONLY THAT ONE PROGRAM. BEGINS SEARCH
* AT CURRENT MAG. TAPE POSITION (NO REWIND).
*
* LIST-ID,NAME,HEADING SAME AS LIST-ID,NAME BUT WITH PAGE HEADING.
*
* REWIND REWINDS THE MAG. TAPE. USEFUL TO SHORTEN
* SEARCH TIME FOR A PARTICULAR PROGRAM OR
* AFTER AN ABORT.
*
* ANY KEY ABORTS THE CURRENT OPERATION.
*
* THE COMMAND TYPE WORDS: STOP, END, DIRECTORY, PUNCH, AND LIST
* MAY BE ABBREVIATED TO TWO CHARACTERS. EACH COMMAND, EXCEPT THE
* ABORT, IS INPUT IN RESPONSE TO THE PROMPT CHARACTER ">" AND IS
* TERMINATED WITH THE RETURN KEY. THE ESCAPE KEY MAY BE USED TO
* DELETE THE LINE AND THE "_" MAY BE USED TO BACKSPACE.
SKP
* CONSTANTS AND TEMPORARIES FOR PROGRAM DECODE SECTION
*
.58 DEC 58 (ASCII NINE) + 1
A EQU 0B A REGISTER
A1 BSS 1
A2 BSS 1
ATAB DEF TAB POINTER TO FUNCTION PRINT TABLE
B EQU 1B B REGISTER
B17 OCT 17
B37 OCT 37
B40 OCT 40 ASCII BLANK
B53 OCT 53 ASCII PLUS
B55 OCT 55 ASCII MINUS
B56 OCT 56 ASCII POINT
B60 OCT 60 ASCII ZERO
B61 OCT 61 ASCII ONE
B63 OCT 63
B100 OCT 100
B177 OCT 177 MASK FOR LOWER 7 BITS
B200 OCT 200
B377 OCT 377 MASK FOR LOWER 8 BITS
B400 OCT 400
B776 OCT 776
BASAD DEF BUF ADDRESS OF FIRST STATEMENT
BLANK OCT 40 ASCII BLANK
C1 BSS 1
C2 BSS 1
COMMA OCT 54 ASCII COMMA
COMOP OCT 45000 COM STATEMENT OPERATOR CODE
CR OCT 15 ASCII CARRIAGE RETURN
D3 DEC 3
D7 DEC 7
D10 DEC 10
D62 OCT -62
DGCNT BSS 1
DIGCT BSS 1
DIMOP OCT 47000 DIM STATEMENT OPERATOR CODE
DOLAR OCT 44 ASCII DOLLAR
DVSRS DEC 10000,1000,100,10
E OCT 105 ASCII E
EXP BSS 1
EXP2 BSS 1
EXPON BSS 1
F OCT 106 ASCII F
FD0 BSS 1
FFLAG BSS 1
FILOP OCT 70000 FILES STATEMENT OPERATOR CODE
FLGBT OCT 100000
FOPBS DEF TABLE-2 POINTS TO SINGLE CHAR PRINT TABLE
FUDGE BSS 1 A LITTLE BIT OF SWEETNESS
HMASK OCT 174000
IMGOP OCT 44000 IMAGE STATEMENT OPERATOR CODE
INF OCT 77777
LDVSR DEF DVSRS POINTS TO DIVISOR TABLE
LETOP OCT 73000 IMPLIED LET STATEMENT CODE
LF OCT 12 ASCII LINE FEED
LIBSP BSS 1 START OF PROGRAM POINTER
LT1 BSS 1 PROGRAM WORD POINTER
LT2 BSS 1 NEG NO WORDS LEFT IN STATEMENT
LT3 BSS 1 TEMPORARY
LT4 BSS 1 TEMPORARY
LT5 BSS 1 COMPILED PROGRAM FLAG
LT6 BSS 1 LWA+1 OF PROGRAM
M1 DEC -1
M2 DEC -2
M4 DEC -4
M5 DEC -5
M6 DEC -6
M7 DEC -7
M8 DEC -8
M16 DEC -16
M25 DEC -25
M256 DEC -256
MANT1 BSS 1
MANT2 BSS 1
MAXFX DEC -999999.5
MCBOP DEF MCBOS POINTS TO MULTI-CHAR PRINT TABLE
MINFX DEC -0.099999959
MNEG OCT 100000,376
N OCT 116 ASCII N
NMBFA DEF NUMBF POINTS TO ASCII NUMBER STORAGE
NMPTR BSS 1
NMTMP BSS 1
NT0 BSS 1
NUMBF BSS 15 ASCII NUMBER STORAGE AREA
OPDMK OCT 100777 OPERAND MASK
OPMSK OCT 77000 OPERATOR MASK
OT1 BSS 1
OT3 BSS 1
OT4 BSS 1
PDFFL OCT 100017 FUNCTION M@SJ
POINT BSS 1
QUOTE OCT 42 @SCII QUOTE
REMOP OCT 50000 REM STATDLDNT OPERATOR CODE
SIGN BSS 1
SMSK OCT 77600
SYMTB BSS 1 LWA + 1 OF PROGRAM
TEMP6 BSS 1
TEMPX BSS 1
TENTH OCT 63146
UNNRM OCT 140000
USEOP OCT 43000 USING STATEMENT OPERATOR CODE
SKP
* COMMAND TABLE
*
COMT ASC 1,DI DIRECTORY
DEF DIRE
ASC 1,PU PUNCH
DEF PUNC
ASC 1,LI LIST
DEF LIS
ASC 1,ST STOP
DEF STOP
ASC 1,EN END
DEF STOP
ASC 1,RE REWIND
DEF REWND
COMP DEF COMT POINTS TO BEGINNING OF TABLE
*
* MAG TAPE CONTROL WORDS
*
RRF OCT 23 READ RECORD FORWARD
BSR OCT 41 BACK SPACE RECORD
REW OCT 101 REWIND
RWO OCT 105 REWIND/OFFLINE
CLR OCT 110 CLEAR
FSF OCT 203 FORWARD SPACE FILE
SL0 OCT 1400 SELECT UNIT ZERO
MCW1 ABS 20000B+MT-1 DMA CONTROL WORD.
*
ALTMD OCT 175 ASCII ALTER MODE
ASCC ASC 1,C ASCII C,BLANK FOR COMPILED PROGS.
ASCF ASC 1,F ASCII F,BLANK FOR FILES
ASCBB ASC 1, ASCII BLANK,BLANK
ASCNN ASC 1,00 ASCII ZERO,ZERO
ASCSN ASC 1, 0
B2 OCT 2
B6 OCT 6
B23 OCT 23
B32 OCT 32
B33 OCT 33
B140 OCT 140
B176 OCT 176 ASCII ESCAPE
B1777 OCT 1777
B120K OCT 120000
B130K OCT 130000
B140K EQU UNNRM
B160K OCT 160000
BIT15 EQU FLGBT
BKSPC OCT 137 ASCII LEFT ARROW
BUFAD BSS 1 LINE PRINTER DRIVER BUFFER ADDR.
BUFP DEF BUF FWA OF PROGRAM BUFFER
BUFI DEF BUF,I INDIRECT FWA OF PROGRAM BUFFER
CADDR BSS 1 CHARACTER ADDRESS TEMP FOR LETTR
COUNT BSS 1 TEMPORARY USED FOR COUNTING
CRAFI DEF CRAFT ADDRESS OF 'AFTER PUNCH' SECTION
CTABL DEF CHARS FWA OF 'LARGE' CHARACTER TABLE
D1 DEC 1
D4 DEC 4
D8 DEC 8
D11 DEC 11
D13 DEC 13
D14 DEC 14
D15 DEC 15
D16 DEC 16
D18 DEC 18
D21 DEC 21
D22 DEC 22
D29 DEC 29
D72 DEC 72
D100 DEC 100
DASH OCT 55 ASCII DASH
DMSK OCT 17400
DRFX ASC 1,@0
FF OCT 14 ASCII FORM FEED
GET1 BSS 1 TEMPORARIES
GET2 BSS 1 FOR THE GET ID
GET3 BSS 1 ROUTINE.
HDCNT BSS 1 LENGTH OF THE PAGE HEADING
HDBUF DEF *+1 ADDRESS OF PAGE HEADING
BSS 30 PAGE HEADING BUFFER
HDPNT DEF HDBUF+HDBUF+2 CHAR. FWA OF PAGE HEADING
HIMSK OCT 177400 MASK FOR UPPER CHARACTER
HMANY BSS 1 LINE LENGTH COUNTER.
ID BSS 1 STORAGE FOR ACCOUNT NUMBER
LCNT BSS 1 LINE COUNTER
LCOMD BSS 1 LAST COMMAND FLAG (=0 FOR PUNCH)
LISTI DEF LIST ADDRESS OF PROGRAM DECODER
M3 OCT -3
M12 DEC -12
M40 OCT -40
M58 DEC -58
M60 DEC -60
M80 DEC -81
M400 OCT -400
M72B OCT -72
M133B OCT -133
M1024 DEC -1024
M1036 DEC -1036
MSK EQU INF
NAMBF BSS 4 BUFFER FOR PROGRAM ID AND NAME
NAMBP DEF NAMBF ADDRESS OF PROG. NAME BUFFER
NAMEP DEF NAMBF+NAMBF+2 CHAR. ADDR. OF PROG. NAME
PASS BSS 1 NUMBER OF SCANS THROUGH TAPE
PGCNT BSS 1 PAGE COUNTER
PLFLG NOP PUNCH/LIST FLAG
PREB DEF BUF-12 ADDR. OF PROGRAM NAME RECORD
PREBI DEF BUF-12,I INDIRECT ADDR OF PROG NAME RECORD
RVRSL ASC 1, \
SAVEA BSS 1 TEMPORARY STORAGE FOR A-REGISTER
T35B1 DEF T35BF ADDR. OF TTY INPUT BUFFER
T35B2 DEF T35BF+T35BF CHAR ADDR OF TTY INPUT BUFFER
T35BF BSS 36 TTY INPUT BUFFER
T35CP BSS 1 TTY CHARACTER POINTER
T35DR DEF ?TT2 ADDR. OF INTERRUPT SECT OF TTY
T35F1 BSS 1 TTY OUTPUTTING FLAG
T35F2 BSS 1 TTY BUSY FLAG
T35LC BSS 1 TTY LAST CHARACTER SCANNED
TADR NOP
TBITS NOP
TCNT NOP
TEMP BSS 1 GENERAL TEMPORARY
TLNGT BSS 1
TMP1 BSS 1 GENERAL TEMPORARIES
TMP2 BSS 1 *
TMP3 BSS 1 *
TMP4 BSS 1 *
TMP5 BSS 1 *
TMP6 BSS 1 GENERAL TEMPORARIES
TOG NOP
TTA NOP
TTB NOP
TTE NOP
TTXCP DEF *+1
OCT 6412 ASCII CR,LF FOR END-OF-LINE.
TTY35 DEF ?TT35 TTY OUTPUT DRIVER ADDRESS
WADDR BSS 1 WORD ADDRESS
*
SUP
HDP DEF *+1 PROGRAM HEADING
OCT 6412 CARRIAGE RETURN,LINE FEED
ASC 14,*** TSB PROGRAM DECODER ***
DIRH DEF *+1 DIRECTORY TABLE HEADING
ASC 11, ID NAME LENGTH
PMP DEF *+1
ASC 1,> PROMPT CHARACTER
PAGE DEF *+1 PAGE NUMBER
ASC 7, PAGE
ER1P DEF *+1
OCT 5111
ASC 7,LLEGAL COMMAND
ER2P DEF *+1
OCT 5076 LINE FEED,PROMPT
ER3P DEF *+1
OCT 5115
ASC 8,ISSING PARAMETER
ER4P DEF *+1
OCT 5111
ASC 5,LLEGAL ID
ER6P DEF *+1
OCT 5103
ASC 6,OMMA MISSING
ER8P DEF *+1
OCT 5115
ASC 10,AG TAPE NOT ON LINE
ER9P DEF *+1
OCT 5120
ASC 8,ROGRAM NOT FOUND
ER10P DEF *+1
OCT 5125
ASC 8,NREADABLE RECORD
ER12P DEF *+1
OCT 5111
ASC 6,LLEGAL--FILE
ER13P DEF *+1
OCT 5122
ASC 7,ECORD MISSING
RDYP DEF *+1
OCT 5120
ASC 8,RINTER NOT READY
UNS
SKP
START CLC 00,C CLEAR ALL INPUT/OUTPUT.
JSB ONLIN INSURE MAG TAPE IS ON LINE.
LDA D29 PRINT
LDB HDP "*** TSB PROGRAM DECODER ***"
JSB COUT ON THE TTY.
CLA,INA SET LAST COMMAND FLAG TO SAY
STA LCOMD 'LAST COMMAND WAS NOT PUNCH'.
*
ERT CLA SET T35F2 TO SAY LAST INPUT
STA T35F2 HAS BEEN PROCESSED.
INA PRINT A
IOR BIT15 PROMPT
LDB PMP CHARACTER
JSB COUT ON THE TTY.
*
* MAIN WAITING LOOP
*
LOOP LDA T35F2 HAS A CR
SZA,RSS BEEN INPUT?
JMP LOOP NO, CHECK AGAIN.
*
* PROCESS INPUT LINE
*
LDA T35B2 RESET CHARACTER POINTER
STA T35CP TO THE BEGINNING OF INPUT BUFFER.
CLA CLEAR LAST CHARACTER
STA T35LC FOR T35CH.
LDA COMP SET COMMAND TABLE
STA TMP2 POINTER
LDA M6 AND
STA TMP3 COUNTER.
JSB T35CH GET FIRST NON-BLANK CHARACTER.
JMP COM3 CR, CHECK FOR EXTENDED PUNCH
ALF,ALF MOVE TO TOP CHARACTER
STA TMP1 SAVE
JSB T35CH GET NEXT CHARACTER
JMP ER1 CR GO PRINT ERROR MESSAGE
ADA TMP1 MERGE SECOND CHARACTER WITH FIRST
COM1 CPA TMP2,I IS THIS THE RIGHT COMMAND?
JMP COM2 YES GO TO THE ROUTINE
ISZ TMP2 NO INCREMENT POINTERS
ISZ TMP2 TO NEXT COMMAND
ISZ TMP3 FINISHED?
JMP COM1 NO CHECK NEXT COMMAND
JMP ER1 COMMAND NOT FOUND PRINT ERROR
COM2 ISZ TMP2 INCREMENT POINTER TO ADDRESS
LDB TMP2,I GET THE ADDRESS
JMP B,I JUMP TO THE ROUTINE
*
* PROCESS CARRIAGE RETURN INPUT
*
COM3 LDA LCOMD WAS LAST COMMAND
SZA A PUNCH?
JMP ER2 NO, JUST OUTPUT LF AND PROMPT.
JMP CRAFI,I YES, GO TO PROCESS IT.
*
* PROCESS STOP OR END COMMAND
*
STOP JSB OFLIN REWIND MAG TAPE. SET OFF LINE.
CLC 00,C CLEAR ALL INPUT/OUTPUT DEVICES.
CLA CLEAR THE
OTA 01 SWITCH REGISTER.
HLT 77B HALT THE COMPUTER.
JMP *-1 IRRECOVERABLE.
*
* PROCESS REWIND COMMAND
*
REWND CLA,INA SET LAST COMMAND FLAG TO SAY
STA LCOMD 'LAST COMMAND WAS NOT PUNCH'.
JSB RWIND REWIND MAG. TAPE.
JMP ER2 RETURN TO OUTPUT LF AND PROMPT.
*
*
ER1 LDA D16 PRINT
LDB ER1P "ILLEGAL COMMAND"
JSB COUT ON THE TTY.
JMP ERT RETURN TO WAITING LOOP.
ER2 CLA SET TTY BUSY
STA T35F2 FLAG TO FINISHED.
LDA B2 OUTPUT
IOR BIT15 LINE FEED AND PROMPT CHAR.
LDB ER2P TO THE
JSB COUT TTY.
JMP LOOP RETURN TO WAITING LOOP.
ER3 LDA D18 PRINT
LDB ER3P "MISSING PARAMETER"
JSB COUT ON THE TTY.
JMP ERT RETURN TO WAITING LOOP.
ER4 LDA D11 PRINT
LDB ER4P "ILLEGAL ID"
JSB COUT ON THE TTY.
JMP ERT RETURN TO WAITING LOOP.
ER6 LDA D14 PRINT
LDB ER6P "COMMA MISSING"
JSB COUT ON THE TTY.
JMP ERT RETURN TO WAITING LOOP.
ER9 NOP ENTRY POINT.
LDB D18 PRINT
LDB ER9P "PROGRAM NOT FOUND"
JSB COUT ON THE TTY.
JMP ER9,I RETURN.
*
*
* PRINT CONSOLE MESSAGE AND WAIT FOR ITS COMPLETION
*
COUT NOP ENTRY POINT.
JSB TTY35,I INITIATE PRINTING ON CONSOLE.
LDA T35F1 WAIT UNTIL
SZA THE PRINTING
JMP *-2 IS COMPLETED.
JMP COUT,I RETURN.
SKP
* GET THE NEXT CHARACTER FROM THE CONSOLE INPUT BUFFER
*
* CALLING SEQUENCE:
*
* (P) JSB T35CH
* (P+1)
* (P+2)
*
* ALL ASCII NON-PRINTING CHARACTERS EXCEPT CARRIAGE RETURN ARE
* IGNORED. THE CHARACTER IS RETURNED IN THE A-REGISTER WITH THE
* PARITY BIT REMOVED.
* THE DE-BLANKING FUNCTION MAY BE CANCELLED BY CLEARING
* LOCATION T35C1.
*
T35CH NOP ENTRY POINT.
LDA T35LC IF THE LAST CHARACTER
CPA CR WAS A CARRIAGE RETURN
JMP T35CH,I RETURN IMMEDIATELY.
LDA T35CP LOAD THE CHARACTER ADDRESS.
JSB GETCR GET THE CHARACTER.
AND B177 REMOVE PARITY BIT.
STA T35LC SAVE THE CHARACTER.
ISZ T35CP INCREMENT THE CHAR. POINTER.
CPA CR WAS IT A CARRIAGE RETURN?
JMP T35CH,I YES, TAKE P+1 RETURN.
AND B140 NO, IGNORE ALL
SZA OTHER
CPA B140 CONTROL
JMP T35CH+4 CHARACTERS.
LDA T35LC RELOAD CHAR.
CPA BLANK WAS IT A BLANK?
T35C1 JMP T35CH+4 YES, IGNORE IT
ISZ T35CH NO, TAKE P+2
JMP T35CH,I RETURN.
*
T35C2 JMP T35CH+4 USED TO RESTORE T35C1.
*
* GET AN ID FROM THE TTY BUFFER
*
GETID NOP ENTRY POINT.
JSB T35CH GET FIRST CHARACTER
JMP ER4 CR GO PRINT ERROR
ADA M133B CHECK FOR A
SSA,RSS LETTER
JMP ER4 IN THE
ADA B32 FIRST
SSA,INA POSITION.
JMP ER4
ASL 10 SHIFT LETTER TO TOP
STA GET1 AND SAVE IT.
LDA M3 SET DIGIT
STA GET2 COUNTER.
CLB CLEAR NUMERICAL PART TO ZERO
GT1 STB GET3 SAVE IT
JSB T35CH GET NEXT CHARACTER
JMP ER4 CHECK FOR
ADA M72B A DIGIT.
SSA,RSS
JMP ER4
ADA D10
SSA
JMP ER4
LDB GET3 GET OLD NUMBER
RBL,RBL MULTIPLY
ADB GET3 IT BY
RBL TEN.
ADB A ADD IN NEW DIGIT
ISZ GET2 ARE WE FINISHED?
JMP GT1 NO GO GET NEXT DIGIT
ADB GET1 YES ADD IN LETTER
STB ID STORE THE COMPLETE ID
JMP GETID,I RETURN
*
* CONVERT A NUMBER LESS THAN 100 TO TWO ASCII DIGITS
*
DRNM NOP ENTRY POINT.
CLB GET UPPER DIGIT IN A
DIV D10 AND LOWER DIGIT IN B.
ALF,ALF MERGE THE TWO INTO
ADA B ONE WORD.
ADA ASCNN CONVERT TO ASCII CHARACTERS.
JMP DRNM,I RETURN.
SKP
* MAGNETIC TAPE READ ROUTINE
*
* CALLING SEQUENCE:
*
* A = BUFFER ADDRESS (WITH BIT 15 SET)
* B = BUFFER LENGTH
* (P) JSB TIN
* (P+1)
* (P+2)
*
* FOR THE (P+1) RETURN A = 0 FOR EOF, A = -1 FOR PARITY ERROR.
* FOR THE (P+2) RETURN A = LENGTH OF RECORD TRANSFERED.
*
TIN NOP
DST TMP1 SAVE BUFFER ADDRESS AND LENGTH
LDA M7 SET RETRY COUNTER
STA TMP3
RTN LDA MCW1 GET MAG TAPE CONTROL WORD
OTA 6 OUTPUT TO DMA
CLC 2
LDA TMP1 GET BUFFER ADDRESS
OTA 2 OUTPUT TO DMA
STC 2
JSB BUSY MAG TAPE BUSY
LDA RRF NO GET READ COMMAND
OTA MT OUTPUT TO MAG TAPE
JSB REJ REJECTED?
CLF 0 NO TURN OFF INT SYSTEM
STC MT-1,C TURN ON MT DATA CHANNEL
STC MT START MAG TAPE MOTION
CLC MT CLEAR CONT TO PREVENT INT
SFS MT-1 WAIT FOR
JMP *-1 FIRST WORD.
LIB MT-1 GET FIRST WORD
SSB,RSS EOF?
JMP TN1 YES RETURN TO USER
STC MT-1,C NO TURN ON DATA CHANNEL AGAIN
STB TMP4 SAVE RECORD LENGTH WORD
CMB,INB MAKE IT POSITIVE
ADB TMP2 IS RECORD LONGER THAN BUFFER?
SSB
JMP *+3 NO
LDA TMP2 YES GET BUFFER LENGTH
RSS
LDA TMP4 GET ACTUAL RECORD LENGTH
OTA 2 OUTPUT TO DMA
STC 6,C TURN ON DMA
CMA,INA MAKE INPUT LENGTH POSITIVE
STA TMP4 SAVE IT
SFS 6 DMA FINISHED?
JMP *-1 NO WAIT
STF 0 YES TURN ON INT SYSTEM AGAIN
LIB MT GET MAG. TAPE STATUS WORD.
RBR MOVE PARITY BIT TO BOTTOM.
SLB,RSS PARITY ERROR?
JMP TN3 NO, GO TO RETURN.
ISZ TMP3 YES, FINISHED LAST RETRY?
JMP TN2 NO TRY AGAIN
CCA PARITY ERROR FLAG
JMP TIN,I RETURN WITH ERROR INDICATION
TN2 LDA BSR BACKSPACE OVER
JSB CONF BAD RECORD
JMP RTN RETRY TO READ IT
TN1 CLA SET EOF FLAG
CLC MT-1 TURN OFF MT DATA CHANNEL
STF 0 TURN ON INT SYSTEM AGAIN
JMP TIN,I RETURN WITH ERROR INDICATION
TN3 LDA TMP4 GET TRANSFER LENGTH
ISZ TIN INCREMENT FOR SKIP RETURN (OK)
JMP TIN,I RETURN
*
* INSURE MAG TAPE IS ON LINE
*
ONLIN NOP ENTRY POINT.
LDA SL0 SELECT
OTA MT UNIT ZERO.
LIA MT LOAD MAG TAPE STATUS.
SLA ON LINE?
JMP ER8 NO, OUTPUT ERROR MESSAGE.
JMP ONLIN,I YES, RETURN.
ER8 LDA D21 PRINT
LDB ER8P "MAG TAPE NOT ON LINE"
JSB COUT ON THE TTY.
LIA MT WAIT FOR OPERATOR
SLA TO PLACE IT
JMP *-2 ON LINE.
JSB CLEAR CLEAR MAG TAPE CONTROLLER.
JMP ONLIN,I RETURN
*
* REWIND WITHOUT WAIT
*
REWIN NOP ENTRY POINT.
JSB BUSY WAIT IF CONTROLLER BUSY.
LDA REW OUTPUT REWIND COMMAND
OTA MT TO CONTROLLER.
JSB REJ IF REJECTED, CLEAR AND RETRY.
CLF 00 TURN INTERRUPT SYSTEM OFF.
STC MT START COMMAND EXECUTION.
CLC MT CLEAR CONTROL TO AVOID INTERRUPT.
STF 00 TURN INTERRUPT SYSTEM ON AGAIN.
JMP REWIN,I RETURN.
*
* WAIT FOR REWIND TO COMPLETE
*
WAIT NOP ENTRY POINT.
LIA MT LOAD MAG TAPE STATUS WORD.
ALF,RAL REWINDING?
SSA
JMP *-3 YES, CONTINUE WAITING.
JMP WAIT,I NO, RETURN
*
* REWIND MAG TAPE AND SET OFF LINE
*
OFLIN NOP ENTRY POINT.
JSB BUSY WAIT IF CONTROLLER BUSY.
LDA RWO OUTPUT REWIND/OFF LINE
OTA MT COMMAND TO CONTROLLER.
JSB REJ IF REJECTED, CLEAR AND RETRY.
CLF 00 TURN OFF INTERRUPT SYSTEM.
STC MT START COMMAND EXECUTION.
JMP OFLIN,I RETURN.
*
* EXECUTE A CONTROL FUNCTION
*
CONF NOP ENTRY POINT.
JSB BUSY MAG TAPE BUSY?
OTA MT NO OUTPUT COMMAND
JSB REJ REJECTED?
CLF 0
STC MT,C NO START EXECUTION
CLC MT CLEAR CONTROL TO PREVENT INT
STF 0
SFS MT FINISHED?
JMP *-1 NO WAIT
JMP CONF,I YES RETURN
*
* REWIND WITH WAIT
*
RWIND NOP ENTRY POINT.
JSB REWIN REWIND TAPE
JSB WAIT WAIT FOR IT
JMP RWIND,I RETURN
*
* WAIT IF CONTROLLER BUSY
*
BUSY NOP ENTRY POINT.
LIB MT GET MAG TAPE STATUS WORD
BLF,BLF MOVE BUSY BIT TO BOTTOM
SLB BUSY?
JMP *-3 YES WAIT
JMP BUSY,I NO RETURN
*
* CHECK FOR REJECTED COMMAND
*
REJ NOP ENTRY POINT.
LIB MT GET MAG TAPE STATUS WORD
RBR,RBR MOVE REJECT BIT
RBR TO BOTTOM
SLB,RSS REJECTED?
JMP REJ,I NO RETURN
JSB CLEAR YES CLEAR CONTROLLER
LDB REJ DECREMENT RETURN ADDRESS
JMP B,I RETURN
ADB M3 TO RE-ISSUE COMMAND
*
* CLEAR CONTROLLER
*
CLEAR NOP ENTRY POINT.
LDB CLR GET CLEAR COMMAND
OTB MT OUTPUT TO MAG TAPE
CLF 0
STC MT,C START EXECUTION
CLC MT CLEAR TO PREVENT INTERRUPT
STF 0
SFS MT FINISHED?
JMP *-1 NO WAIT
JMP CLEAR,I YES RETURN
SKP
* OUTPUT CHARACTER ROUTINE
*
* OUTCR ACCEPTS EACH CHARACTER FROM THE PROGRAM DECODE SECTION
* AND OUTPUTS IT TO THE PUNCH OR LINE PRINTER ACCORDING TO THE
* STATUS OF THE PUNCH/LIST FLAG PLFLG.
*
* FOR PUNCH OUTPUT--EVERY CHARACTER IS PUNCHED.
*
* FOR PRINTER OUTPUT--ALL CONTROL CHARACTERS EXCEPT LINE FEED ARE
* IGNORED. BEFORE THE LINE FEED IS PRINTED, A LINE COUNTER IS
* INCREMENTED AND, IF THE PAGE IS FULL, A FORM FEED AND PAGE
* HEADING ARE OUTPUT. ALL OTHER PRINTING CHARACTERS ARE SENT
* TO THE PRINTER AS RECEIVED. LONG LINES ARE FOLDED AT 80 CHARS.
*
* ENTER WITH LCNT=-1, PGCNT=0, AND A=12B PRIOR TO ANY
* OUTPUT TO FORCE PAGE 1 PRINTER HEADING.
*
OUTCR NOP ENTRY POINT.
AND B177 ISOLATE THE 7-BIT CHAR.
OTA 01 OUTPUT IT TO THE SWITCH REG.
LDB T35F2 HAS THE OPERATOR
SZB,RSS ABORTED THE PUNCH/LIST?
JMP ERT YES, RETURN FOR OPERATOR INPUT.
LDB PLFLG NO, LOAD THE PUNCH/LIST FLAG.
SZB PUNCHING?
JMP OUTC1 NO, GO TO PRINT.
JSB PUNCH YES, PUNCH THE CHARACTER
JMP OUTCR,I AND RETURN.
*
OUTC1 CPA LF LINE FEED?
JMP OUTC3 YES, GO CHECK FOR END-OF-PAGE.
STA TEMP NO, SAVE CHAR. TEMPORARILY.
AND B140 IGNORE ALL
SZA OTHER
CPA B140 NON-PRINTING
JMP OUTCR,I CHARACTERS.
LDA TEMP RETRIEVE PRINTING CHAR.
ISZ HMANY 80TH CHAR. REACHED?
JMP OUTC2 NO, OUTPUT IT.
ISZ LCNT YES, BUMP LINE COUNT. EOP?
JMP OUTC5 NO, OUTPUT LF FIRST
JSB PAGEH YES, OUTPUT PAGE HEADING
ISZ HMANY CORRECT FOR 1ST CHAR.
LDA TEMP OUTPUT THE
JMP OUTC2 ORIGINAL CHAR.
OUTC5 LDA LF OUTPUT A
JSB PCHAR LF FIRST.
LDB M80 RESET
INB LINE LENGTH
STB HMANY COUNTER.
LDA TEMP OUTPUT THE ORIGINAL CHAR.
OUTC2 JSB PCHAR OUTPUT CHAR. TO THE PRINTER.
JMP OUTCR,I THEN RETURN.
*
OUTC3 ISZ LCNT BUMP LINE COUNT. END-OF-PAGE?
JMP OUTC6 NO, OUTPUT THE LINE FEED.
JSB PAGEH YES, GO OUTPUT PAGE HEADING.
JMP OUTCR,I RETURN.
OUTC6 LDB M80 RESET LINE LENGTH
STB HMANY FOR 80 CHARS.
JMP OUTC2
*
* OUTPUT PAGE HEADING
*
PAGEH NOP ENTRY POINT.
LDA M58 YES, SET LINE COUNT
STA LCNT BACK TO -58.
LDA FF OUTPUT FORM FEED
JSB PCHAR TO PRINTER.
LDA B6 PRINT
LDB PREB THE
INB PROGRAM
JSB PRINT NAME.
ISZ PGCNT INCREMENT PAGE COUNT.
LDA PGCNT GET NEW PAGE NUMBER.
JSB DRNM CONVERT TO ASCII.
STA PAGE+5 STORE ASCII INTO 'PAGE XX'.
LDA D13 PRINT THE
LDB PAGE PAGE
JSB PRINT NUMBER.
LDA HDCNT ANY HEADING
SZA,RSS TO PRINT?
JMP OUTC4 NO, GO OUTPUT BLANK LINE.
LDB HDBUF YES, OUTPUT THE
JSB PRINT HEADING.
OUTC4 LDA LF COMPLETE PRINTING OF
JSB PCHAR HEADING LINE,
LDA LF THEN OUTPUT
JSB PCHAR ONE BLANK LINE.
LDA M80 SET LINE LENGTH
STA HMANY COUNTER FOR 80 CHARS.
JMP PAGEH,I RETURN.
*
* PRINT CHARACTER ROUTINE
*
* ENTER WITH THE CHARACTER IN THE A REGISTER.
*
PCHAR NOP ENTRY POINT.
LIB LP GET LINE PRINTER STATUS.
SZB READY?
JMP NOTRD NO, GO OUTPUT ERROR MESSAGE.
PCHA1 NOP *** CMA FOR DP2410 LP ***
OTA LP OUTPUT IT TO THE BUFFER.
CLF 00 TURN OFF INTERRUPT SYSTEM.
STC LP,C SEND CHAR. TO PRINTER.
SFS LP HAS PRINTER ACCEPTED IT YET?
JMP *-1 NO, CHECK AGAIN.
CLC LP CLEAR CONTROL TO AVOID INTERRUPT.
STF 00 TURN INTERRUPT SYSTEM BACK ON.
JMP PCHAR,I RETURN.
*
NOTRD STA SAVEA SAVE CHAR. TEMPORARILY.
LDA D18 TELL THE OPERATOR
LDB RDYP THAT THE
STF 00 PRINTER IS
JSB COUT NOT READY.
LIB LP WAIT FOR
SZB HIM TO
JMP *-2 READY IT.
LDA SAVEA RELOAD SAVED CHAR.
JMP PCHA1 RETURN TO PRINT IT.
*
* PRINT A STRING OF CHARACTERS ON THE PRINTER.
*
* ENTER WITH CHARACTER COUNT IN THE A REGISTER AND THE
* BUFFER ADDRESS IN THE B REGISTER.
*
PRINT NOP ENTRY POINT.
CMA,INA NEGATE CHAR. COUNT FOR USE
STA COUNT AS A COUNTER.
STB BUFAD SAVE BUFFER ADDRESS.
PRIN1 LDA BUFAD,I GET TWO CHARS. FROM THE BUFFER.
ALF,ALF PRINT THE
AND B377 UPPER
JSB PCHAR CHARACTER.
ISZ COUNT ANY MORE LEFT?
RSS
JMP PRINT,I NO, RETURN.
LDA BUFAD,I YES, NEXT ONE MUST BE LOWER.
AND B377 PRINT THE LOWER
JSB PCHAR CHARACTER.
ISZ BUFAD INCREMENT POINTER TO NEXT PAIR.
ISZ COUNT ANY MORE LEFT?
JMP PRIN1 YES, NEXT ONE MUST BE UPPER.
JMP PRINT,I NO, RETURN.
SKP
* OUTPUT LEADER/TRAILER TO PUNCH
*
LEAD NOP ENTRY POINT.
LDA M400 SET COUNTER FOR
STA COUNT 400 OCTAL FEED FRAMES.
CLA LOAD NULL CHARACTER.
JSB PUNCH PUNCH IT.
ISZ COUNT ANOTHER CHAR. TO BE OUTPUT?
JMP *-2 YES
JMP LEAD,I NO, RETURN
*
* SUBROUTINE TO PUNCH A STRING OF LARGE CHARACTERS
*
* ENTER WITH CHARACTER COUNT IN THE A REGISTER AND THE BUFFER
* ADDRESS IN THE B REGISTER.
* THE CHARACTERS ARE PUNCHED IN THE REVERSE ORDER FROM THEIR
* POSITION IN THE BUFFER. TRAILING BLANKS FROM THE BUFFER ARE
* NOT OUTPUT.
*
LETTR NOP ENTRY POINT.
ADB B CALCULATE THE CHARACTER
ADB A ADDRESS OF THE LAST CHARACTER
ADB M1 IN THE BUFFER.
STB CADDR SAVE IT IN CADDR.
CMA,INA NEGATE CHARACTER COUNT
STA COUNT FOR USE AS A COUNTER.
STB A
LETR1 JSB GETCR GET A CHAR. FROM THE BUFFER.
CPA BLANK IS IT A BLANK?
RSS YES, IGNORE IT.
JMP LETR2 NO, GO OUTPUT IT.
ISZ COUNT ANY MORE TO OUTPUT?
RSS
JMP LETTR,I NO, RETURN.
LDA CADDR YES, FORM
ADA M1 ADDRESS OF
STA CADDR NEXT CHARACTER.
JMP LETR1 GO TO GET NEXT CHAR.
LETR2 JSB PLETR PUNCH THE LARGE CHARACTER.
ISZ COUNT ANY MORE TO OUTPUT?
RSS
JMP LETTR,I NO, RETURN.
LDA CADDR YES, FORM
ADA M1 ADDRESS OF
STA CADDR NEXT CHARACTER.
JSB GETCR GET NEXT CHAR.
JMP LETR2 GO TO PUNCH IT.
*
GETCR NOP ENTRY POINT.
CLE,ERA E_UPPER/LOWER FLAG,A_WORD ADDR.
LDA A,I GET THE WORD.
SEZ,RSS UPPER CHARACTER WANTED?
ALF,ALF YES, MOVE TO LOWER POSITION.
AND B177 NO, MASK OUT UPPER CHAR.
JMP GETCR,I RETURN WITH CHAR. IN A.
*
* PUNCH ONE LARGE CHARACTER
*
PLETR NOP ENTRY POINT.
STA TEMP SAVE THE CHAR. TEMPORARILY.
AND B140 IGNORE ALL
SZA NON-PRINTING
CPA B140 CHARACTERS (EXCEPT
JMP PLETR,I BLANKS).
LDA TEMP RELOAD THE ASCII CHAR. VALUE.
ADA M40 CALCULATE THE CHARACTER'S
MPY D7 POSITION IN THE CHARACTER
ADA CTABL TABLE CHARS.
STA B SET B TO THE FIRST ENTRY.
LDA M7 SET TEMP TO SERVE AS A
STA TEMP COUNTER FOR 7 PUNCHES.
PLET1 LDA B,I LOAD A TABLE ENTRY.
JSB PUNCH PUNCH IT.
INB INCREMENT TO NEXT TABLE ENTRY.
ISZ TEMP HAVE WE FINISHED THIS CHAR?
JMP PLET1 NO
CLA YES, PUNCH TWO FEED FRAMES
JSB PUNCH FOR INTER-CHARACTER
JSB PUNCH SPACING.
JMP PLETR,I RETURN.
*
* PUNCH ONE CHARACTER
*
PUNCH NOP ENTRY POINT.
OTA 01 OUTPUT CHAR. TO THE SWITCH REG.
OTA PUN AND THE PUNCH BUFFER.
CLF 00 TURN OFF THE INTERRUPT SYSTEM.
STC PUN,C START THE PUNCHING.
SFS PUN FINISHED?
JMP *-1 NO, NOT YET.
CLC PUN YES, DISALLOW INTERRUPT.
STF 00 RESTORE INTERRUPT SYSTEM STATUS.
JMP PUNCH,I RETURN.
SKP
* DECODE PROGRAM ROUTINE
*
* THIS ROUTINE CONVERTS A BASIC PROGRAM IN THE 2000C TSB (VER B),
* 2000C TSB (HIGH SPEED - VER C), OR 2000F TSB (VER B)
* MAG TAPE DUMP FORMAT INTO THE ASCII LIST/PUNCH FORM. THE
* OUTPUT IS IDENTICAL TO THAT PRODUCED BY A 2000C/F LIST COMMAND.
* PRIOR TO ENTRY, THE ENTIRE PROGRAM SHOULD BE IN
* CORE, BASAD SHOULD BE SET TO THE ADDRESS OF THE FIRST STATEMENT,
* SYMTB SHOULD BE SET TO THE LWA+1 OF THE PROGRAM, PLFLG SHOULD
* BE SET EQUAL TO 0 FOR PUNCHING OR 1 FOR LISTING, AND LT5 SHOULD
* BE SET TO 1 FOR COMPILED PROGRAMS AND 0 OTHERWISE.
* FOR PUNCH OUTPUT THE PROGRAM IS PRECEEDED BY ITS NAME IN LARGE
* VISIBLE LETTERS AND A LEADER. THE LAST STATEMENT OF THE PROGRAM
* IS FOLLOWED BY A CARRIAGE RETRUN, LINE FEED AND TRAILER.
* FOR LIST OUTPUT, THE LAST STATEMENT IS FOLLOWED BY A CARRIAGE
* RETURN ONLY.
* EACH ASCII CHARACTER OF THE PUNCH OR LIST IS TRANSFERRED TO
* THE SUBROUTINE OUTCR FOR OUTPUT.
*
ORG 2000B
*
LIST NOP ENTRY POINT.
LDB BASAD SET FIRST STATEMENT
STB LT1 ADDRESS INTO LT1.
LDB SYMTB SET LT6 TO LWA + 1
STB LT6 OF PROGRAM.
LDA PLFLG LOAD PUNCH/LIST FLAG.
SZA PUNCHING?
JMP LIST2 NO
LDA B6 YES, PUNCH THE
LDB PREB PROGRAM NAME IN
INB LARGE
JSB LETTR VISIBLE LETTERS.
JSB LEAD PUNCH A LEADER.
*
* MAIN LIST LOOP
*
LIST2 LDB LT1 PROGRAM
CPB LT6 EXHAUSTED?
JMP LIS15 YES
LDB LT1,I NO, GET LINE NUMBER
JSB OUTIN AND OUTPUT IT.
LDA BLANK OUTPUT
JSB OUTCR BLANK.
ISZ LT1 SET
LDA LT1,I LENGTH
CMA,INA COUNTER
INA FOR
STA LT2 STATEMENT.
JMP LIST3 OUTPUT REST OF STATEMENT.
*
LDB LT1,I OUTPUT
JSB OUTIN BOUND.
LIST3 ISZ LT1 MORE OF
ISZ LT2 STATEMENT?
JMP LIST4 YES
LDB LT1 PROGRAM
CPB LT6 EXHAUSTED?
JMP LIS15 YES, GO TO COMPLETION SECTION.
LDA CR NO, OUTPUT A
JSB OUTCR CARRIAGE RETURN
LDA LF AND LINE FEED TO
JSB OUTCR TERMINATE STATEMENT.
JMP LIST2+3 RETURN FOR NEXT STATEMENT.
*
* IDENTIFY OPERATOR
*
LIST4 LDA LT1,I EXTRACT
AND OPMSK OPERATOR CODE.
SZA,RSS NULL OPERATOR?
JMP LIST5 YES, GO IDENTIFY OPERAND.
CPA LETOP NO, IMPLIED LET?
JMP LIST5-2 YES, GO OUTPUT BLANK, THEN
* IDENTIFY OPERAND.
ALF,ALF NO, SINGLE
ADA D62 CHARACTER
SSA,RSS OPERATOR?
JMP LIS12 NO, GO LIST MULTI-CHAR OPERATOR.
ADA B63 YES,EXTRACT
ADA FOPBS THE
LDA A,I ASCII
ALF,ALF CODE
AND B177 FOR IT.
CPA QUOTE QUOTE?
JMP LIS14 YES, GO TO OUTPUT STRING
RSS
LDA BLANK LOAD A BLANK.
JSB OUTCR NO, OUTPUT IT.
*
* IDENTIFY OPERAND
*
LIST5 LDA LT1,I EXTRACT
AND OPDMK OPERAND AND SAVE
STA LT3 IN LT3.
SSA FLAG BIT SET?
JMP LIST9 YES, LIST CONSTANT OR PARAMETER.
CLB NO, NULL
CPB LT3 OPERAND?
JMP LIST3 YES, RETURN FOR REST OF STATE.
CPB LT5 NO, 'COMPILED'?
JMP LIST0 NO
ADA M1 YES
ALS LOAD
ADA SYMTB ACTUAL
LDA A,I SYMBOL
STA LT3 SAVE SYMBOL
*
* LIST SYMBOLIC OPERAND
*
LIST0 AND PDFFL NO, ISOLATE TYPE PART.
CPA B17 FUNCTION?
JMP LIST8 YES, GO OUTPUT 'FN'.
LIST6 LDA LT3 NO, COMPUTE
RRR 4 ASCII
AND B37 FOR
ADA B100 THE LETTER.
JSB OUTCR OUTPUT IT.
LDA LT3
AND B17
CPA B17 FUNCTION?
JMP LIST3 YES, RETURN FOR REST OF STATE.
SZA,RSS NO, STRING VARIABLE?
JMP LIST7 YES
ADA M5
SSA NO, DIGIT?
JMP LIST3 NO, RETURN FOR REST OF STATE.
ADA B60 YES, OUTPUT
JSB OUTCR IT.
JMP LIST3 RETURN FOR REST OF STATEMENT.
*
LIST7 LDA DOLAR LOAD ASCII DOLLAR
JMP *-3 AND GO OUTPUT IT.
*
LIST8 LDA F OUTPUT
JSB OUTCR 'F'.
LDA N OUTPUT
JSB OUTCR 'N'.
JMP LIST6 GO OUTPUT FUNCTION LETTER.
*
* LIST CONSTANT OPERAND OR PARAMETER
*
LIST9 ELA,CLE,ERA CLEAR FLAG BIT.
SZA CONSTANT?
JMP LIS10 NO
STA SIGN YES, SET FOR NO SIGN.
ISZ LT1 INCREMENT POINTERS
ISZ LT2 TO THE CONSTANT.
DLD LT1,I LOAD THE CONSTANT.
ISZ LT1 ADVANCE TO THE
ISZ LT2 NEXT PROGRAM WORD.
CLE,SSA NEGATIVE NUMBER?
CCE YES, ENABLE SIGN.
JSB NUMOT NO, OUTPUT THE CONSTANT.
JMP LIST3 RETURN FOR REST OF STATEMENT.
*
LIS10 AND B17 ISOLATE TYPE PART.
CPA D3 PROGRAM INTEGER?
JMP LIS11 YES
CPA B17 NO, PRE-DEFINED FUNCTION?
RSS
JMP LIST6 NO, MUST BE A PARAMETER SYMBOL
LDA LT3 YES, OUTPUT
ALF,RAL THE
LDB ATAB FUNCTION
JSB MCOUT SYMBOL.
JMP LIST3 RETURN FOR REST OF STATEMENT.
*
LIS11 ISZ LT1 INCREMENT TO THE NEXT
ISZ LT2 PROGRAM WORD.
LDA LT4 RELOAD OPERATOR.
CPA DIMOP DIM STATEMENT?
JMP LIST3-2 YES
CPA COMOP NO, COM STATEMENT?
JMP LIST3-2 YES
LDA LT5 NO
LDB LT1,I LOAD PROSPECTIVE INTEGER
SZA,RSS 'COMPILED' PROGRAM?
JMP *+3
ADB FUDGE YES, CORRECT ADDRESS
LDB B,I AND LOAD AGAIN.
JSB OUTIN NO, OUTPUT IT.
ISZ LT1 MORE OF
ISZ LT2 STATEMENT?
RSS
JMP LIST3+3 NO
LDA LT4 YES, IS THE OPERATOR
CPA USEOP 'USING'?
JMP LIST4 YES
LDA COMMA NO, OUTPUT A
JSB OUTCR COMMA.
JMP LIS11+7
*
* LIST MULTI-CHARACTER OPERATOR
*
LIS12 LDA BLANK OUTPUT
JSB OUTCR A BLANK.
LDA LT1,I OUTPUT THE
LDB MCBOP MUTI-CHARACTER
JSB MCOUT OPERATOR.
LDA BLANK
LDB LT4 WAS IT A
CPB REMOP 'REM'?
JMP LIS13 YES
CPB FILOP NO, 'FILES'?
JMP LIS13-1 YES
CPB IMGOP NO, 'IMAGE'?
JMP LIS18 YES
JSB OUTCR NO, OUTPUT A BLANK.
JMP LIST5 GO IDENTIFY OPERAND.
*
LIS18 CLB OUTPUT
LDA LT2 THE
INA,SZA IMAGE
JSB OUTST STRING.
JMP LIST3 RETURN FOR REST OF STATEMENT.
*
JSB OUTCR OUTPUT A BLANK.
LIS13 CCB OUTPUT
LDA LT2 THE
JSB OUTST REMARK.
JMP LIST3 RETURN FOR REST OF STATEMENT.
*
* COMPLETE OUTPUT AFTER LAST STATEMENT
*
LIS15 LDA PLFLG LOAD PUNCH/LIST FLAG.
SZA PUNCHING?
JMP LIS16 NO, OUTPUT CR ONLY.
LDA CR YES, OUTPUT A
JSB OUTCR CARRIAGE RETURN
LDA LF AND
JSB OUTCR LINE FEED.
JSB LEAD PUNCH A TRAILER.
JMP LIST,I RETURN.
LIS16 LDA CR FOR LIST OUTPUT OUTPUT A
JSB PCHAR CARRIAGE RETURN DIRECTLY
JMP LIST,I TO THE PRINTER, THEN RETURN
*
* LIST A STRING CONSTANT
*
LIS14 JSB OUTCR OUTPUT FIRST QUOTE.
LDA LT1,I COMPUTE
AND B377 THE
SZA,RSS NUMBER OF
JMP LIS17 WORDS IN
CMA,INA THE
ARS STRING AND
CLB OUTPUT
JSB OUTST IT.
LIS17 LDA QUOTE OUTPUT THE CLOSING
JSB OUTCR QUOTE.
JMP LIST3 RETURN FOR REST OF STATEMENT.
SKP
* LIST A MULTI-CHARACTER SYMBOL
*
* UPON ENTRY A HOLDS A WORD CONTAINING THE SYMBOL CODE AND
* B HOLDS A POINTER TO THE PRINT NAME TABLE. THE SYMBOL IS FOUND
* IN THE TABLE AND ITS ASCII FORM IS OUTPUT.
*
MCOUT NOP ENTRY POINT.
AND OPMSK SAVE THE SYMBOL
STA LT4 CODE IN TEMP.
MCOT1 LDA B,I IS THIS THE
AND OPMSK DESIRED TABLE
CPA LT4 ENTRY?
JMP MCOT2 YES, GO TO OUTPUT SYMBOL.
LDA B,I NO, COMPUTE
AND D7 THE
ADA D3 ADDRESS
ARS OF THE NEXT
ADB A TABLE ENTRY.
JMP MCOT1 GO TO CHECK THAT ENTRY.
*
MCOT2 LDA B,I COMPUTE
AND D7 THE ASCII
CMA,INA WORD
ARS COUNT
STA LT3 AND SAVE IN LT3.
STB OUTST SAVE ASCII SYMBOL ADDRESS.
MCOT3 ISZ OUTST GET NEXT WORD OF SYMBOL.
LDA OUTST,I OUTPUT THE
ALF,ALF UPPER
JSB OUTCR CHARACTER.
LDA OUTST,I OUTPUT
AND B377 THE LOWER
SZA CHARACTER IF IT IS NOT
JSB OUTCR A NULL CHARACTER.
ISZ LT3 MORE OF SYMBOL TO OUTPUT?
JMP MCOT3 YES
JMP MCOUT,I NO, RETURN
*
* LIST A STRING
*
* UPON ENTRY A HOLDS A NEGATIVE WORD COUNT OF THE STRING LENGTH.
* IF B # 0, THE STRING BEGINS WITH THE LOWER CHAR. OF (LT1,I);
* OTHERWISE, IT BEGINS WITH THE UPPER HALF OF THE FOLLOWING WORD.
* A TRAILING NULL CHARACTER WILL NOT BE PRINTED.
*
OUTST NOP ENTRY POINT.
STA LT4 SAVE STRING WORD COUNT.
SZB START WITH LOWER CHARACTER?
JMP OTST2 YES
OTST1 ISZ LT1 NO, MOVE TO
ISZ LT2 NEXT PROGRAM WORD.
LDA LT1,I OUTPUT THE
ALF,ALF UPPER
JSB OUTCR CHARACTER.
OTST2 LDA LT1,I OUTPUT
AND B377 THE LOWER
SZA CHARACTER IF IT IS NOT
JSB OUTCR A NULL CHARACTER.
ISZ LT4 MORE OF STRING TO OUTPUT?
JMP OTST1 YES
JMP OUTST,I NO, RETURN.
*
* OUTPUT AN INTEGER
*
* ENTER WITH A POSITIVE INTEGER IN B. OUTPUT
* IT WITHOUT LEADING ZEROES.
*
OUTIN NOP ENTRY POINT.
LDA M4 SET DIVISOR COUNTER
STA DGCNT TO -4.
LDA LDVSR SET DIVISOR
STA OT1 ADDRESS INTO OT1.
CLA SUPPRESS
STA OT4 ZEROES.
OUTI1 LSR 16 DIVIDE INTEGER BY
DIV OT1,I CURRENT DIVISOR.
STB OT3 SAVE THE REMAINDER.
CPA OT4 IS THERE A LEADING ZERO?
JMP OUTI2 YES, DON'T OUTPUT IT.
ADA B60 NO, TURN OFF ZERO
STA OT4 SUPPRESS AND OUTPUT
JSB OUTCR CURRENT DIGIT.
OUTI2 LDB OT3 RETRIEVE REMAINDER.
ISZ OT1 SET FOR NEXT DIVISOR.
ISZ DGCNT ALL DIVISORS USED?
JMP OUTI1 NO, BACK FOR ANOTHER DIVIDE.
LDA B YES, NOW
ADA B60 OUTPUT THE
JSB OUTCR LAST DIGIT.
JMP OUTIN,I AND RETURN.
SKP
* ENTER WITH A FLOATING POINT NUMBER IN A AND B AND E = 1
* IF A SIGN IS WANTED. NON-INTEGERS ARE ROUNDED AFTER CONVERSION
* TO DECIMAL. TRAILING ZEROES ARE SUPPRESSED.
*
NUMOT NOP ENTRY POINT.
STA NUMBF SAVE HIGH MANTISSA.
SEZ,RSS SIGN WANTED?
JMP NUMO1 NO
SSA,RSS YES, NEGATIVE NUMBER?
JMP *+5 NO
JSB ARINV YES, NEGATE NUMBER.
STA NUMBF SAVE HIGH MANTISSA.
LDA B55 LOAD ASCII MINUS.
RSS
LDA B40 LOAD ASCII BLANK (+).
STA SIGN SAVE SIGN.
LDA NUMBF RETRIEVE HIGH MANTISSA.
NUMO1 STB NUMBF+1 SAVE LOW MANTISSA.
JSB IFIX INTEGER?
JMP NUMO2 NO
SOC YES, 16-BIT INTEGER?
JMP NUMO2 NO
*
* OUTPUT AN INTEGER
*
STB NUMBF SAVE INTEGER.
LDA SIGN
SZA SIGN?
JSB OUTCR YES, OUTPUT IT.
LDB NUMBF NO, RETRIEVE INTEGER.
JSB OUTIN OUTPUT THE INTEGER.
JMP NUMOT,I RETURN.
*
* OUTPUT A FLOATING POINT NUMBER
*
NUMO2 LDA M2 SET FIXED
STA FFLAG FLAG FALSE.
DLD NUMBF LOAD NUMBER.
JSB .FAD IS NUMBER
DEF MAXFX LESS THAN
SSA,RSS 999999.5?
JMP NUMO3 NO
DLD NUMBF YES, IS
JSB .FAD NUMBER
DEF MINFX LESS THAN
SSA,RSS 0.09999995?
ISZ FFLAG NO, SET FIXED FLAG TRUE.
NUMO3 DLD NUMBF LOAD NUMBER.
STA MANT1 UNPACK
JSB .FLUN THAT
STB MANT2 NUMBER
STA EXP INTO MANT1,MANT2,EXP.
CLA INITIALIZE
STA EXPON DECIMAL EXPONENT.
CPA EXP ZERO EXPONENT?
JMP NUMO5 YES
NUMO0 JSB MBY10 NO
LDA EXP MULTIPLY
CMA,SSA,INA,SZA NUMBER BY 10
JMP *+3 UNTIL IT IS
ISZ EXPON GREATER
JMP NUMO0 THAN 1.
JSB DBY10 DIVIDE BY 10.
LDA EXPON
NUMO4 LDB EXP DIVIDE
CMB,INB NUMBER
SSB,RSS BY 10
JMP NUMO5 UNTIL
STA EXPON IT IS
JSB DBY10 LESS
CCA THAN
ADA EXPON 1.
JMP NUMO4
NUMO5 CMA SET EXPONENT
STA EXPON TO TRUE VALUE-1.
LDB M6 SET DIGIT
STB DIGCT COUNTER.
LDB NMBFA SET BUFFER
STB NMPTR POINTER.
*
* CONVERT MANTISSA TO ASCII
*
NUMO6 JSB GETDG STORE A
ADA B60 DECIMAL
STA NMPTR,I DIGIT.
ISZ NMPTR
ISZ DIGCT SIXTH DIGIT?
JMP NUMO6 NO
JSB GETDG YES,
ADA M5 NEXT DIGIT
SSA GREATER THAN OR EQUAL TO 5?
JMP NUMO9+1 NO
*
* ROUND ASCII MANTISSA
*
LDB NMPTR
NUMO7 ADB M1 LOAD LAST
LDA B,I DIGIT.
INA INCREMENT IT.
CPA .58 WAS IT A NINE?
RSS
JMP NUMO9 NO
CPB NMBFA YES, LEADING DIGIT?
JMP NUMO8 YES
LDA B60 NO, OVERLAY
STA B,I A ZERO.
JMP NUMO7
NUMO8 ISZ EXPON BUMP DECIMAL
NOP EXPONENT AND
LDA B61 OVERLAY A ONE.
NUMO9 STA B,I
LDA EXPON IS NUMBER
SSA,RSS LESS THAN 1?
JMP NMO11 NO
STA NMTMP YES
LDA B60
LDB NMPTR
NMO10 ISZ NMTMP COUNT ZEROS
NOP PLUS 1.
ADB M1 LAST
CPA B,I DIGIT 0?
JMP NMO10 YES
LDA NMTMP NO, ALL SIGNIFICANCE
SSA IN SIX DIGITS?
JMP NMO11 NO
CCA YES, SET
STA FFLAG FIXED FLAG TRUE.
NMO11 ISZ FFLAG
NOP
LDA SIGN
SZA SIGN?
JSB OUTCR YES, OUTPUT IT.
LDB M7 NO, SET OUTPUT
STB DIGCT DIGIT COUNTER.
LDB NMPTR
CCA FIXED
CPA FFLAG FORMAT?
JMP *+5 NO
LDA EXPON YES, SET
CMA INDICATOR TO
STA NMTMP DECIMAL POINT.
JMP NMO16
STA NMTMP SET INDICATOR FOR DECIMAL POINT.
JMP NMO16
*
* DELETE TRAILING ZEROES
*
NMO12 LDA DIGCT AT RIGHT OF
INA DECIMAL
CPA NMTMP POINT?
JMP *+6 NO
STA DIGCT YES, DELETE ZERO.
NMO16 ADB M1 LAST
LDA B,I DIGIT
CPA B60 ZERO?
JMP NMO12 YES
CCA NO, FIXED
CPA FFLAG FORMAT?
JMP NMO14 NO
LDA EXPON YES, LEADING
SSA,RSS DECIMAL POINT?
JMP NMO14 NO
STA NMTMP YES, SET LEADING ZEROS COUNTER.
*
* OUTPUT MANTISSA
*
LDA B56 OUTPUT A DECIMAL
RSS POINT.
NMO13 LDA B60 OUTPUT
JSB OUTCR A ZERO.
ISZ NMTMP MORE LEADING ZEROS?
JMP NMO13 YES
ISZ DIGCT NO, COUNT DECIAML POINT.
NMO14 LDB NMBFA SET
STB NMPTR DIGIT POINTER.
JMP *+5
NMO15 ISZ NMTMP DECIMAL POINT NEXT?
JMP *+3 NO
LDA B56 YES, LOAD IT.
JMP *+3
LDA NMPTR,I LOAD NEXT
ISZ NMPTR DIGIT.
JSB OUTCR OUTPUT CHARACTER.
ISZ DIGCT MORE DIGITS?
JMP NMO15 YES
ISZ FFLAG NO, EXPONENT?
JMP NUMOT,I NO, RETURN.
*
* OUTPUT THE EXPONENT
*
LDA E OUTPUT
JSB OUTCR AN E.
LDA B55 OUTPUT
LDB EXPON THE
SSB APPROPRIATE
CMB,INB,RSS SIGN
LDA B53 OF
STB EXPON THE
JSB OUTCR EXPONENT.
LDA EXPON COMPUTE
CLB THE
DIV D10 EXPONENT'S
ADA B60 TEN'S
ADB B60 DIGIT.
STB EXPON
JSB OUTCR OUTPUT IT.
LDA EXPON OUTPUT ITS
JSB OUTCR ONES DIGIT.
JMP NUMOT,I RETURN.
SKP
* GET DIGIT TO OUTPUT
*
* COMPUTE NEXT DECIMAL DIGIT AND RETURN WITH IT IN A.
* SUBTRACT IT OUT OF THE NUMBER.
*
GETDG NOP ENTRY POINT.
JSB MBY10 MULTIPLY BY 10.
LDB EXP GET EXPONENT IN B
CMB,INB AND NEGATE.
AND HMASK RETAIN UPPER 5 BITS.
RAL NORMALIZE TO BIT 15.
SSB,INB ROTATE INTEGER
JMP *-2 INTO A.
AND B377 EXTRACT
STA FD0 DIGIT.
LDB EXP ROTATE
CMB,INB
RAR BACK.
SSB,INB
JMP *-2
XOR MANT1 REMOVE
LDB MANT2 DIGIT.
JSB NORML NORMALIZE REMAINDER.
LDA FD0 LOAD DIGIT INTO A.
JMP GETDG,I RETURN.
*
* MULTIPLY UNPACKED NUMBER BY 10
*
* THE FOLATING POINT NUMBER IN MANT1, MANT2, AND
* EXP IS MULTIPLIED BY TEN.
*
MBY10 NOP ENTRY POINT.
LDA MANT1 LOAD HIGH MANTISSA.
SZA,RSS NUMBER ZERO?
JMP MBY10,I YES, RETURN.
LDB EXP NO, MULTIPLY
ADB D3 BY
STB EXP EIGHT.
LDB MANT2 LOAD LOW MANTISSA.
CLE,ERA DIVIDE
ERB BY
CLE,ERA FOUR.
ERB,CLE
ADB MANT2 ADD INTO
SEZ BOTH REGISTERS
INA PRODUCING
ADA MANT1 1.25 * MANTISSA.
SSA,RSS CORRECT
JMP MBY01
CLE,ERA ON
ERB
ISZ EXP OVERFLOW.
NOP
MBY01 STA MANT1 STORE
STB MANT2 MANTISSA.
JMP MBY10,I RETURN.
*
* NORMALIZE UNPACKED NUMBER
*
* ENTER WITH THE NUMBER IN A, B, AND EXP. EXIT WITH
* NORMALIZED NUMBER IN MANT1, MANT2, AND EXP (MANTISSA
* IS LEFT IN A AND B AS WELL).
*
NORML NOP ENTRY POINT.
STA NT0 SET
CLA LEFT-SHIFT
STA TEMPX COUNTER
LDA NT0 TO ZERO.
SZA,RSS IF NUMBER
SZB IS ZERO,
JMP NORM2+1 CLEAR
STA EXP EVERYTHING.
STA MANT1 STORE
NORM1 STB MANT2 MANTISSA.
JMP NORML,I RETURN.
NORM2 ISZ TEMPX COUNT A LEFT SHIFT.
CLE,ELB ROTATE A
ELA AND B LEFT.
SEZ,SSA,RSS TWO HIGHEST BITS ZERO?
JMP NORM2 YES, POSITIVE UNNORMALIZED.
SEZ,SSA NO, TWO HIGHEST BITS ONE?
JMP NORM2 YES, NEGATIVE UNNORMALIZED.
ERA NO, NORMALIZE
ERB,CLE MANTISSA.
STA MANT1 COMPUTE
LDA TEMPX
CMA,INA CORRECTED
ADA EXP
STA EXP EXPONENT.
LDA MANT1
JMP NORM1
*
* DIVIDE UNPACKED NUMBER BY 10
*
* THIS SUBROUTINE IS THE INVERSE OF MBY10
*
DBY10 NOP ENTRY POINT.
LDA MANT1 RETURN
SZA,RSS ON
JMP DBY10,I ZERO.
LDB M2 ADD EXPONENT
ADB EXP OF 1/10 TO
STB EXP THAT OF NUMBER.
LDA MANT2 JUSTIFY
CLE,ERA LOWER MANTISSA.
MPY TENTH MULTIPLY BY 1/10.
CLE,ELA SHIFT
ELB,CLE BACK.
ADA B ADD IN EQUIVALENT OF
SEZ LOWER MANTISSA *
CLE,INB TENTH * 2 ^ (-16)
STB MANT2 AND ROUND TO 16 BITS.

LDA MANT1 DO
MPY TENTH SAME TO
ADA B HIGH MANTISSA.
ADA MANT2 PERFORM EFFECTIVE
SEZ SUM OF DOUBLE-LENGTH
INB PRODUCTS.
SWP SWAP A AND B.
JSB NORML NORMALIZE.
JMP DBY10,I RETURN.
*
* TAKE ARITHMETIC INVERSE
*
* ENTER WITH A FLOATING POINT NUMBER IN A AND B.
* EXIT WITH ITS ARITHMETIC INVERSE IN A AND B.
*
ARINV NOP ENTRY POINT.
SWP SWAP REGISTERS.
CMB,CLE COMPLEMENT HIGH PART.
XOR M256 COMPLEMENT LOW PART.
ADA B400 FINISH LOW PART.
SEZ,RSS OVERFLOW?
JMP ARIN1 NO
INB YES, INCREMENT HIGH PART.
CPB FLGBT OVERFLOW?
JMP *+4 YES
CPB UNNRM NO, NEGATIVE UNNORMALIZED?
RSS YES
JMP ARIN1 NO
ADB UNNRM FIX HIGH MANTISSA.
SLA,RAR POSITION EXPONENT.
IOR SMSK FILL IN LEADING BITS IF NEGATIVE.
SSB,RSS POSITIVE?
INA,RSS YES, INCREMENT EXPONENT.
ADA M1 NO, DECREMENT EXPONENT.
RAL POSITION
AND B377 EXPONENT.
ARIN1 SWP RESTORE USUAL NUMBER ORDER.
JMP ARINV,I RETURN.
*
* UNPACK LOW WORD OF NUMBER
*
* ENTER WITH LOW WORD OF FLOATING POINT NUMBER IN B.
* EXIT WITH EXPONENT IN A AND MANTISSA IN B.
*
.FLUN NOP ENTRY POINT.
CLA EXTRACT
LSR 8 EXPONENT
ALF,ALF IN A AND
BLF,BLF MANTISSA IN B.
SLA,RAR NEGATIVE EXPONENT?
IOR SMSK YES, FILL IN LEADING BITS.
JMP .FLUN,I RETURN.
*
* INTEGERIZE A NUMBER
*
* ENTER WITH A FLOATING POINT NUMBER IN A AND B.
* IF THE EXPONENT EXCEEDS 23, THEN THE NUMBER HAS INTEGER
* SIGNIFICANCE; EXIT TO P+1. ALL OTHER CASES EXIT TO P+2 WITH
* 32-BIT INTEGER RIGHT JUSTIFIED IN A AND B. ON EXIT O = 0 IF THE
* NUMBER IS EXACTLY REPRESENTABLE AS A 16-BIT INTEGER.
* IF THE EXPONENT IS NEGATIVE, TRUNCATE TO 0 OR -1 APPROPRIATELY
* AND LET O = 1. OTHERWISE, RIGHT JUSTIFY THE INTEGER
* AND EXIT WITH THE LOST BIT IN E.
*
IFIX NOP ENTRY POINT.
STA TEMP6 SAVE A.
STO SET NOT ONE-WORD INTEGER MODE.
JSB .FLUN UNPACK B.
SSA NEGATIVE EXPONENT?
JMP IFIX3 YES
ADA M16 NO, EXPONENT
SSA <= 15?
CLO YES
ADA M8 NO, EXPONENT
SSA,RSS <= 23?
JMP IFIX,I NO, ALL SIGNIFICANCE IS INTEGER.
ADA M8 YES, MOVE BINARY POINT TO END OF
STA EXP B AND SAVE SHIFT COUNT.
LDA TEMP6 RETRIEVE A.
JMP IFIX2
IFIX1 CLE,SLA,ARS SHIFT A RIGHT.
CME SHIFT
SLB,ERB B RIGHT.
STO LOST A ONE.
IFIX2 ISZ EXP ALL SHIFTS DONE?
JMP IFIX1 NO
ISZ IFIX YES
JMP IFIX,I RETURN.
IFIX3 LDA TEMP6 RETRIEVE A.
CLE,SSA TRUNCATE
CCA,RSS TO
CLA,RSS -1
CCB,RSS OR
CLB 0.
JMP IFIX3-2
*
* ADD TWO FLOATING POINT NUMBERS
*
.FAD NOP ENTRY POINT.
JSB UNPAK UNPACK THE ARGUMENTS.
DEF .FAD
*
* ADD UNPACKED ARGUMENTS
*
ADMU1 CMA,INA EXP2 IN A.
ADA EXP COMPUTE EXPONENT DIFFERENCE.
SSA,RSS ARG ONE LARGER?
JMP ADMU2 YES
LDA A1 NO,
LDB A2
STA A2 SWAP
STB A1
LDA C1 ARGUMENTS.
LDB C2
STA C2
STB C1
LDA EXP
LDB EXP2
STA EXP2
STB EXP
JMP ADMU1
ADMU2 ADA M25 SHIFT
LDB C1 COUNT
CMA,CLE,SSA >= 25?
JMP ADMU4 YES, IGNORE SMALLER ARGUMENT.
ADA M25 NO, COMPUTE SHIFT COUNT IN
STA EXP2 1'S COMPLEMENT.
LDA A2 LOAD SMALLER
LDB C2 MANTISSA.
ADMU3 ISZ EXP2 MORE SHIFTS?
JMP ADMU5 YES
ADB C1 NO, ADD
CLO LOWER MANTISSAS.
SEZ OVERFLOW?
CLE,INA YES, BUMP A.
SOS OVERFLOW?
JMP *+5 NO
ADA A1 YES, ADD HIGH MANTISSAS.
SSA,RSS OVERFLOW CORRECTED BY A1<0?
JMP ADMU4+1 YES
JMP *+4 NO, CORRECT OVERFLOW.
ADA A1 ADD HIGH MANTISSAS.
SOS OVERFLOW?
JMP ADMU4+1 NO
ERA YES, SHIFT
ERB DOWN AND
ISZ EXP BUMP
JMP ADMU4+1 EXPONENT.
RSS
ADMU4 LDA A1
JSB .PACK NORMALIZE AND PACK.
JMP .FAD,I RETURN.
ADMU5 CLE,SLA,ARS ARITHMETIC
CME DOUBLE
ERB,CLE SHIFT.
JMP ADMU3
*
* UNPACK AGRUMENTS FOR ARITHMETIC OPERATIONS
*
UNPAK NOP ENTRY POINT.
STA A1 SAVE HIGH MANTISSA OF ARG 1.
SZA,RSS UNPACK
CLE,INB SECOND
JSB .FLUN WORD.
STB C1 SAVE LOW MANTISSA OF ARG 1.
STA EXP SAVE EXPONENT.
LDA UNPAK,I COMPUTE ADDRESS
ISZ UNPAK OF CALLING ROUTINE.
LDB A,I
ISZ A,I SET CALLING ROUTINE'S RETURN.
LDB B,I LOAD
DLD B,I ARG 2.
STA A2 SAVE HIGH PART OF ARG 2.
SZA,RSS UNPACK
CLB,INB LOW
JSB .FLUN PART.
STB C2 SAVE LOW MANTISSA OF ARG 2.
STA EXP2 SAVE EXPONENT.
JMP UNPAK,I RETURN.
*
* NORMALIZE AND PACK NUMBER
*
* NUMBER IN A, B, AND EXP ON ENTRY. ON EXIT A
* AND B CONTAIN THE NORMALIZED, ROUNDED, AND PACKED
* NUMBER. UNDERFLOW BECOMES A ZERO, OVERFLOW BECOMES
* THE LARGEST REPRESENTABLE NUMBER OF APPROPRIATE SIGN.
*
.PACK NOP ENTRY POINT.
JSB NORML NORMALIZE NUMBER.
CLE,SZA,RSS ZERO?
JMP .PACK,I YES, RETURN.
ADB B177 NO, ROUND.
SSA,RSS POSITIVE?
INB YES, FINISH ROUND.
CLO
SEZ ON OVERFLOW FROM B
CLE,INA CORRECT A.
SOS OVERFLOW? (A=100000,B=0)
RAL TWO HIGH BITS
SSA,SLA,RSS BOTH 1? (IF A WAS 140000)
JMP PACK1 NO
CCE YES
ARS,SLA,ALS SET A = 100000 AND SKIP.
PACK1 RAR UNDOES RAL ABOVE.
STA TEMPX SAVE A.
LSR 8 DELETE 8 LOW BITS
BLF,BLF OF MANTISSA.
LDA EXP DECREMENT
SEZ EXPONENT
ADA M1 ON E # 0.
SOC INCREMENT
INA EXPONENT ON OVERFLOW.
ADA B200 EXPONENT
SSA UNDERFLOW?
JMP PACK3 YES
ADA M256 NO, EXPONENT
SSA,RSS OVERFLOW?
JMP PACK4 YES
ADA B200 NO, RESTORE EXPONENT.
RAL POSITION
AND B377 EXPONENT AND
ADB A ADD LOW MANTISSA.
LDA TEMPX RETRIEVE HIGH MANTISSA.
CPA MNEG
RSS NEGATIVE
JMP .PACK,I
CPB MNEG+1 OVERFLOW?
JMP PACK4 YES
JMP .PACK,I NO
PACK3 NOP IGNORE UNDERFLOW ERROR.
CLA ZERO RESULT
CLB ON UNDERFLOW.
JMP .PACK,I RETURN WITH ERROR.
PACK4 NOP IGNORE OVERFLOW ERROR.
LDA TEMPX RETRIEVE HIGH MANTISSA.
JSB OVFLW GET OVERFLOW VALUE.
JMP .PACK,I RETURN WITH ERROR.
*
* HANDLE OVERFLOW
*
* A CONTAINS THE HIGH MANTISSA UPON ENTRY. A AND
* B CONTAIN THE LARGEST REPRESENTABLE NUMBER OF
* APPROPRIATE SIGN, PACKED, UPON EXIT.
*
OVFLW NOP ENTRY POINT.
LDB M2
SSA
LDB B776
IOR INF
SSA
LDA MNEG
JMP OVFLW,I RETURN.
SKP
* PRINT NAME TABLE FOR MULTI-CHARACTER SYMBOLS
*
* BITS 15-9 OF THE OCTAL WORD ARE THE BASIC OPERATOR
* CODES OF THE SYMBOL. BITS 2-0 ARE THE LENGTH IN
* CHARACTERS OF THE SYMBOLS. THE ASCII VERSION (PRINT
* NAME) FOLLOWS.
*
* MULTI-CHARACTER BINARY OPERATORS
*
MCBOS OCT 32003 AND
ASC 1,AN
OCT 42000
OCT 33002 OR
ASC 1,OR
OCT 34003 MIN
ASC 1,MI
OCT 47000
OCT 35003 MAX
ASC 1,MA
OCT 54000
OCT 36002 UNEQUAL
ASC 1,<>
OCT 37002 GREATER THAN OR EQUAL TO
ASC 1,>=
OCT 40002 LESS THAN OR EQUAL TO
ASC 1,<=
*
* MULTICHARACTER UNARY OPERATOR
*
OCT 41003 NOT
ASC 1,NO
OCT 52000
*
* STATEMENT TYPES
*
OCT 42006 ASSIGN
ASC 3,ASSIGN
OCT 43005 USING
ASC 2,USIN
OCT 43400
OCT 44005 IMAGE
ASC 2,IMAG
OCT 42400
OCT 45003 COM
ASC 1,CO
OCT 46400
OCT 46003 LET
ASC 1,LE
OCT 52000
OCT 47003 DIM
ASC 1,DI
OCT 46400
OCT 50003 DEF
ASC 1,DE
OCT 43000
OCT 51003 REM
ASC 1,RE
OCT 46400
OCT 52004 GOTO
ASC 2,GOTO
OCT 53002 IF
ASC 1,IF
OCT 54003 FOR
ASC 1,FO
OCT 51000
OCT 55004 NEXT
ASC 2,NEXT
OCT 56005 GOSUB
ASC 2,GOSU
OCT 41000
OCT 57006 RETURN
ASC 3,RETURN
OCT 60003 END
ASC 1,EN
OCT 42000
OCT 61004 STOP
ASC 2,STOP
OCT 62004 DATA
ASC 2,DATA
OCT 63005 INPUT
ASC 2,INPU
OCT 52000
OCT 64004 READ
ASC 2,READ
OCT 65005 PRINT
ASC 2,PRIN
OCT 52000
OCT 66007 RESTORE
ASC 3,RESTOR
OCT 42400
OCT 67003 MAT
ASC 1,MA
OCT 52000
OCT 70005 FILES
ASC 2,FILE
OCT 51400
OCT 71005 CHAIN
ASC 2,CHAI
OCT 47000
OCT 72005 ENTER
ASC 2,ENTE
OCT 51000
OCT 73001 IMPLIED LET
OCT 0
*
* MISCELLANEOUS OPERATORS
*
OCT 74002 OF
ASC 1,OF
OCT 75004 THEN
ASC 2,THEN
OCT 76002 TO
ASC 1,TO
OCT 77004 STEP
ASC 2,STEP
*
* PREDEFINED FUNCTIONS
* BITS 13-9 ARE USED FOR INTERNAL IDENTIFICATION
*
TAB OCT 1003 TAB
ASC 1,TA
OCT 41000
OCT 2003 LIN
ASC 1,LI
OCT 47000
OCT 3003 SPA
ASC 1,SP
OCT 40400
OCT 4003 TAN
ASC 1,TA
OCT 47000
OCT 5003 ATN
ASC 1,AT
OCT 47000
OCT 6003 EXP
ASC 1,EX
OCT 50000
OCT 7003 LOG
ASC 1,LO
OCT 43400
OCT 10003 ABS
ASC 1,AB
OCT 51400
OCT 11003 SQR
ASC 1,SQ
OCT 51000
OCT 12003 INT
ASC 1,IN
OCT 52000
OCT 13003 RND
ASC 1,RN
OCT 42000
OCT 14003 SGN
ASC 1,SG
OCT 47000
OCT 15003 LEN
ASC 1,LE
OCT 47000
OCT 16003 TYP
ASC 1,TY
OCT 50000
OCT 17003 TIM
ASC 1,TI
OCT 46400
OCT 20003 SIN
ASC 1,SI
OCT 47000
OCT 21003 COS
ASC 1,CO
OCT 51400
OCT 22003 BRK
ASC 1,BR
OCT 45400
*
* MATRIX FUNCTIONS
*
OCT 24003 ZER
ASC 1,ZE
OCT 51000
OCT 25003 CON
ASC 1,CO
OCT 47000
OCT 26003 IDN
ASC 1,ID
OCT 47000
OCT 27003 INV
ASC 1,IN
OCT 53000
OCT 30003 TRN
ASC 1,TR
OCT 47000
*
*
* SINGLE CHARACTER AND/OR FORMULA OPERATORS
*
* BITS 15-9 OF THE OCTAL WORD ARE THE OPERATOR CODE.
* BITS 3-0 ARE THE PRECEDENCE FOR FORMULA OPERATORS.
* THE ASCII WORD IS USED TO RECOGNIZE THE OPERATOR ON
* INPUT AND TO PROVIDE THE PRINT NAME ON OUTPUT. THE
* ORDERING OF THE TABLE FACILITATES SEARCHING.
*
TABLE OCT 1000 STRING DELIMITER
ASC 1,"
OCT 2000 COMMA
ASC 1,,
OCT 3000 SEMICOLON
ASC 1,;
OCT 4000 HATCH SIGN
ASC 1,#
OCT 15000
OCT 14000
OCT 11000
ASC 1,NF
ASC 1,TO
ASC 1,OF
OCT 10001 RIGHT PARENTHESIS
ASC 1,)
OCT 11001 RIGHT BRACKET
ASC 1,]
OCT 12013 LEFT BRACKET
ASC 1,[
OCT 13013 LEFT PARENTHESIS
ASC 1,(
OCT 14011 UNARY PLUS
ASC 1,+
OCT 15011 UNARY MINUS
ASC 1,-
OCT 16002 SUBSCRIPT SEPARATOR
ASC 1,,
OCT 17002 ASSIGNMENT OPERATOR
ASC 1,=
OCT 20007 ADDITION
ASC 1,+
OCT 21007 SUBTRACTION
ASC 1,-
OCT 22010 MULTIPLICATION
ASC 1,*
OCT 23010 DIVISION
ASC 1,/
OCT 24012 EXPONENTIATION
ASC 1,^
OCT 25005 GREATER THAN
ASC 1,>
OCT 26005 LESS THAN
ASC 1,<
OCT 27005 UNEQUAL
ASC 1,#
OCT 30005 EQUAL
ASC 1,=
SKP
* LARGE CHARACTER PUNCH TABLE
*
* EACH OF THE 64 SEVEN WORD ENTRIES IN THE TABLE CHARS GIVES THE
* PATTERN OF HOLES (IN REVERSE ORDER) FOR THE OUTPUT OF ONE LARGE
* VISIBLE CHARACTER ON PUNCHED PAPER TAPE. EACH NUMBER IS THE
* BINARY PATTERN FOR ONE PUNCH CHARACTER. THE TABLE IS ORDERED
* BY THE ASCII VALUE OF THE CORRESPONDING CHARACTER TO FACILITATE
* ADDRESS ARITHMETIC.
*
SUP
*
* CHARACTER PATTERN...... ASCII CHAR
CHARS OCT 000,000,000,000,000,000,000 040 BLANK
OCT 000,000,000,373,373,000,000 041 !
OCT 000,000,300,000,300,000,000 042 "
OCT 024,024,177,024,177,024,024 043 #
OCT 000,104,112,377,112,062,000 044 $
OCT 140,023,013,140,144,003,000 045 %
OCT 001,006,146,221,211,161,006 046 &
OCT 000,000,000,300,000,000,000 047 '
OCT 000,000,201,146,030,000,000 050 (
OCT 000,000,030,146,201,000,000 051 )
OCT 010,054,030,176,030,054,010 052 *
OCT 010,010,010,176,010,010,010 053 +
OCT 000,000,000,016,015,000,000 054 ,
OCT 000,000,004,004,004,004,000 055 -
OCT 000,000,000,003,003,000,000 056 .
OCT 040,020,010,000,004,002,001 057 /
OCT 074,142,221,211,201,106,074 060 0
OCT 000,000,001,377,101,000,000 061 1
OCT 141,221,211,201,205,203,101 062 2
OCT 166,211,211,211,211,201,102 063 3
OCT 010,011,377,111,050,030,010 064 4
OCT 304,212,221,221,221,211,362 065 5
OCT 346,111,211,211,211,111,076 066 6
OCT 340,220,210,207,200,200,340 067 7
OCT 166,211,211,211,211,211,166 070 8
OCT 176,211,211,211,211,211,162 071 9
OCT 000,000,000,036,036,000,000 072 :
OCT 000,000,000,000,156,155,000 073 ;
OCT 000,000,102,044,020,010,000 074 <
OCT 000,000,050,050,050,050,000 075 =
OCT 000,000,010,020,044,102,000 076 >
OCT 000,160,210,210,215,200,140 077 ?
OCT 034,042,205,211,211,207,060 100 @
OCT 077,110,210,210,210,110,077 101 A
OCT 166,211,211,211,211,377,201 102 B
OCT 146,201,201,201,201,201,176 103 C
OCT 176,201,201,201,201,377,201 104 D
OCT 303,211,211,211,211,377,201 105 E
OCT 300,210,210,210,211