ORG 0
*
STA STRT SAVE AUTO START LOCATION
+ CRA
HLT
STA ALOC FIRST LOCATION TO PUNCH
+ CRA
HLT
STA ELOC LAST LOCATION TO PUNCH
*
+* FIRST SOME PREPARATIONS FOR THE SECOND AND THIRD STAGE LOADERS
+* CRA
+ STA PTR2 CLEAR PTR2, SO KEY-IN LOADER WILL STOP THERE.
+ STA PAUS TERMINATOR FOR THIRD STAGE LOADER
+*
+* BUT HERE WE GO
OCP '0002 START PUNCH (NOT NECESSARY ON MY H316)
*
SR1 SKIP IF SSW 1 RESET
******************
* MAKE A START ADDRESS BLOCK
ABLK DAC **
- STA CNT SAVE THE ADDRESS
+ STA CNT2 SAVE THE ADDRESS
LDA BSTA START CHARACTER
ICA
ADD TSAD BLOCK TYPE
JST SWRD PUNCH THAT
- LDA CNT
+ LDA CNT2
JST SWRD
JST SWRD
JMP* ABLK
*******************
* MAKE ZERO BLOCK
ZBLK DAC ** PRODUCE A ZERO BLOCK
- STA CNT STORE SIZE OF BLOCK
+ STA CNT2 STORE SIZE OF BLOCK
LDA BSTA START CHARACTER
ICA
ADD TZER BLOCK TYPE
LDA ALOC LOAD START ADDRESS
JST SWRD PUNCH START ADDRESS
STA CSUM INIT CHECKSUM
- LDA CNT LOAD SIZE
+ LDA CNT2 LOAD SIZE
JST SWRD PUNCH SIZE
ADD CSUM ADD CHECKSUM
JST SWRD PUNCH OUT CHECKSUM
LDA ALOC RELOAD POINTER
- ADD CNT CALCULATE NEW POINTER
+ ADD CNT2 CALCULATE NEW POINTER
STA ALOC UPDATE ALOC
JMP* ZBLK END
*
********************
* MAKE DATA BLOCK
DBLK DAC **
- STA CNT SAVE SIZE
+ STA CNT2 SAVE SIZE
*
LDA BSTA START CHARACTER
ICA
JST SWRD PUNCH IT
STA CSUM INIT CHECKSUM
*
- LDA CNT PACKET SIZE
+ LDA CNT2 PACKET SIZE
JST SWRD PUNCH IT
ADD CSUM
STA CSUM UPDATE CHECKSUM
*
- LDA CNT
+ LDA CNT2
TCA
- STA CNT NOW WE USE IT AS NEG COUNTER
+ STA CNT2 NOW WE USE IT AS NEG COUNTER
*
DDLP LDA* ALOC LOAD DATA
JST SWRD PUNCH DATA
ADD CSUM
STA CSUM UPDATE CHECKSUM
IRS ALOC
- IRS CNT
+ IRS CNT2
JMP DDLP LOOP IT
JST SWRD PUNCH CHECKSUM
JMP* DBLK BLOCK DONE
*
COUN DAC ** COUNT FILLED OR EMPTY LOCATIONS
CRA
- STA CNT INITIALIZE COUNTER
+ STA CNT2 INITIALIZE COUNTER
CLOP LDA* PTR
DISC SZE WILL BE DYNAMICALLY OVERWRITTEN
JMP ZFIN NOW OTHER KIND OF DATA
- IRS CNT NOTE DOWN THE FIND
+ IRS CNT2 NOTE DOWN THE FIND
IRS PTR POINT TO NEXT LOCATION TO BE TESTED
SKP
JMP ZFIN ADDRESS OVERFLOW MUST STOP COUNTING
JMP CLOP COUNT ON
-ZFIN LDA CNT
+ZFIN LDA CNT2
JMP* COUN
*
*
PLDR DAC ** PUNCH LEADER
LDA LDRL LOAD LEADER LENGTH
TCA COMPLEMENT IT
- STA CNT STORE TO LEADER COUNTER
+ STA CNT2 STORE TO LEADER COUNTER
CRA LEADER IS ZERO
LLP OTA 2
JMP *-1
- IRS CNT
+ IRS CNT2
JMP LLP
JMP* PLDR
*
************************************************************************
* THIS IST THE SECOND STAGE LOADER
*
- ORG '317 ONLY FOR DEVELOPMENT!
-BO2S OCT '20 START ADDRESS
+* IT IS IMPORTANT THAT THERE ARE NO ZERO WORDS IN THIS CODE BECAUSE THE
+* KEY-IN LOADER WORKS ONLY UNTIL IT DETECTS A ZERO WORD.
+*
+BO2S DAC '20 START ADDRESS, ALWAYS '20
JMP '10 JUMP BACK INTO KEY-IN LOADER
*
*S21 OCP '001 THIS IS THE JUMP-IN LOCATION, WILL GO TO '21
*
- INA '1001
- JMP '17-BO2S+*-1
+ INA '1001 READ FROM PAPER TAPE
+ JMP '17-BO2S+*-1 WAIT
SUB '17-BO2S+S3SC STAGE 3 START CHARACTER
SZE
JMP '17-BO2S+*-4 EAT UP ALL JUNK
*
- INA '1001 READ WITH CLEAR
- JMP '17-BO2S+*-1
- ICA
- INA '001 READ WITHOUT CLEAR
- JMP '17-BO2S+*-1
+ INA '1001 READ FROM PAPER TAPE
+ JMP '17-BO2S+*-1 WAIT
+ ICA OTHER CHARACTER
+ INA '001 READ FROM TAPE WITHOUT CLEARING A
+ JMP '17-BO2S+*-1 WAIT
*
- STA '17-BO2S+CNT2 STORE START ADDRESS
- STA* '17-BO2S+CNT2 STORE START IN START
+ STA '17-BO2S+CNT2 STORE START ADDRESS OF THIRD STAGE
* LDA '57 LOOK FOR DEPOSITED OTHER BOOT ADDRESS
* SZE OK, IF WE FIND SOMETHING THERE...
* STA '17-BO2S+CNT2 OVERWRITE DEFAULT VALUE
+ LDA '17-BO2S+CNT2 RELOAD START ADDRESS
+ STA* '17-BO2S+CNT2 STORE THAT ADDRESS INTO ITSELF
IRS '17-BO2S+CNT2 CORRECT STOLEN WORD
- LDA '17-BO2S+CNT2
-* JMP '776
-*
LDA '17-BO2S+CNT2 WHERE TO LOAD NOW?
- STA '17-BO2S+PTR2 INIT POINTER
+ STA '17-BO2S+PTR2 INIT WRITE POINTER
*
-LOP INA '1001 READ IN CHARACTER
- JMP '17-BO2S+*-1
- ICA
- INA '001 READ OTHER CHARACTER
- JMP '17-BO2S+*-1
- SNZ
+LOP INA '1001 READ IN CHARACTER
+ JMP '17-BO2S+*-1 WAIT
+ ICA OTHER CHARACTER
+ INA '001 READ FROM TAPE WITHOUT CLEARING A
+ JMP '17-BO2S+*-1 WAIT
+ SNZ DID WE LOAD A ZERO?
JMP* '17-BO2S+CNT2 JUMP INTO THIRD STAGE LOADER
-* JMP '665
STA* '17-BO2S+PTR2 STORE DATA
IRS '17-BO2S+PTR2 MOVE ON
JMP '17-BO2S+LOP FETCH MORE DATA
*
S3SC OCT '301 START CHARACTER TO RECOGNIZE STAGE3
-PTR2 DAC ** GENERAL PURPOSE MEMORY POINTER
-CNT2 DAC ** WHERE TO LOAD? CAN BE CHANGED.
-BO2E OCT 10600 ZERO-TERMINATOR
+PTR2 DAC ** MEMORY POINTER
+CNT2 DAC ** LOAD ADDRESS
*
*
************************************************************************
ORG '600
BO3S DAC * THAT IS FOR THE SECOND STAGE LOADER
*********
-* COMPLETE THE ATTIC
- LDA PJ1 COMPLETE THE PAUS ROUTINE
+* COMPLETE THE PAUS ROUTINE
+ LDA PJ1
STA J1
CRA
- STA JH ENSURE HALT INSTRUCTION
-*
- OCP 1 READER ON (UNNECESSARY?)
+ STA PAUS
+ STA JH
+*
+* START LOADING
+ OCP 1 READER ON
SLOP INA '1001 CRA AND READ
JMP *-1
SUB BSTA BLOCK START?
JMP *+2
JMP RSTP PROCESS STOP BLOCK
NOP
- LDA ='125252 ERROR BLOCK TYPE
+ LDA EBT ERROR BLOCK TYPE
JST PAUS PAUSE
JMP SLOP SEARCH FOR NEW BLOCK
- FIN
*
********************
* START ADDRESS BLOCK
*
RESA DAC SLOP RESTART ADDRESS
BSTA DEC 129 BLOCK START CHARACTER
+EBT OCT '125252 ERROR MESSAGE FOR A REG
*
* BLOCK TYPES:
TSAD OCT '33
*******************
* THE ATTIC OF THE THIRD STAGE LOADER
PJ1 JMP* PAUS LAST LOCATION THAT WILL BE LOADED FROM TAPE!
-PAUS DAC **
-JH HLT THIS WILL STAY A HALT
-J1 DAC ** WILL BE: JMP* PAUS
+PAUS DAC ** WILL BE INITIALIZED TO ZERO BEFORE PUNCHING
+JH HLT BECOMES CLEARED ON START OF LOAD
+J1 DAC ** BECOMES JMP* PAUS ON START OF LOAD
*
***** VARIABLES
-CSUM OCT 66 CHECKSUM
-LEN OCT 66 LENGTH TO GO
-BTYP OCT 66 BLOCK TYPE
-*
-*******************
-* VARIABLES OF THE MAIN PROGRAM
-ALOC *** ** NEXT WORD TO BE PUNCHED OUT
-ELOC *** ** LAST WORD TO BE PUNCHED OUT
-PTR DAC ** GENERAL PURPOSE MEMORY POINTER
+CSUM DAC ** CHECKSUM
+LEN DAC ** LENGTH COUNTER
+BTYP DAC ** BLOCK TYPE
+ALOC *** ** CURRENT LOCATION TO PUNCH
+ELOC *** ** LAST LOCATION TO PUNCH
+PTR DAC ** MEMORY POINTER
CNT DAC ** WHERE TO LOAD? CAN BE CHANGED.
*
************************************************************
- END
+ END THAT'S IT, ENJOY!
+