1: / tape boot program to load and transfer 2: / the next item on the tape. 3: 4: / entry is made by jsr pc,*$0 5: / so return can be rts pc 6: 7: core = 24. 8: halt=0 9: .. = [core*2048.]-512. 10: start: 11: mov $..,sp 12: mov sp,r1 13: cmp pc,r1 14: bhis 2f 15: clr r0 16: cmp (r0),$407 17: bne 1f 18: mov $20,r0 19: 1: 20: mov (r0)+,(r1)+ 21: cmp r1,$core*2048. 22: blo 1b 23: jmp (sp) 24: 25: 2: 26: mov $1f,*$4 27: mov $340,*$6 28: tst *$htcs1 29: mov $htrew,rew 30: mov $htread,tread 31: br 2f 32: 1: 33: mov $tsread,tread 34: mov $tsrew,rew 35: 2: 36: jsr pc,*rew 37: mov $2,tapa 38: mov $-256.,wc 39: jsr pc,*tread 40: 41: mov *$2,r0 42: add *$4,r0 43: sub $512.,r0 44: asr r0 45: neg r0 46: bge 1f 47: 48: mov r0,wc 49: mov $3,tapa 50: mov $512.,ba 51: jsr pc,*tread 52: 1: 53: jsr pc,*rew 54: clr r0 55: mov $20,r1 56: mov sp,r4 57: clc 58: ror r4 59: 1: 60: mov (r1)+,(r0)+ 61: sob r4,1b 62: jsr pc,*$0 63: br . 64: 65: htcs1 = 172440 66: htba = 172444 67: htfc = 172446 68: htcs2 = 172450 69: htds = 172452 70: httc = 172472 71: 72: P800 = 1300 73: P1600 = 2300 74: PIP = 20000 75: RESET = 40 76: MOL = 10000 77: ERR = 40000 78: REV = 33 79: READ = 71 80: REW = 7 81: 82: htread: 83: 1: 84: mov ba,mtma 85: cmp mtapa,tapa 86: beq 1f 87: bhi 2f 88: jsr pc,hrrec 89: br 1b 90: 2: 91: jsr pc,htrew 92: br 1b 93: 1: 94: mov wc,r1 95: 1: 96: jsr pc,hrrec 97: add $256.,r1 98: bmi 1b 99: rts pc 100: 101: hrrec: 102: mov $htds,r0 103: tstb (r0) 104: bpl hrrec 105: bit $PIP,(r0) 106: bne hrrec 107: bit $MOL,(r0) 108: beq hrrec 109: mov $htfc,r0 110: mov $-512.,(r0) 111: mov mtma,-(r0) 112: mov $-256.,-(r0) 113: mov $READ,-(r0) 114: 1: 115: tstb (r0) 116: bpl 1b 117: bit $ERR,(r0) 118: bpl 1f 119: mov $RESET,*$htcs2 120: mov $-1,*$htfc 121: mov $REV,(r0) 122: br hrrec 123: 1: 124: add $512.,mtma 125: inc mtapa 126: rts pc 127: 128: htrew: 129: mov $RESET,*$htcs2 130: mov $P1600,*$httc 131: mov $REW,*$htcs1 132: clr mtapa 133: rts pc 134: 135: 136: tsbuf = 172520 137: tssr = 172522 138: 139: TSINIT = 140013 140: TSCHAR = 140004 141: TSREW = 102010 142: TSREAD = 100001 143: TSRETRY = 100401 144: 145: tsread: 146: 1: 147: mov ba,mtma 148: cmp mtapa,tapa 149: beq 1f 150: bhi 2f 151: jsr pc,tsrrec 152: br 1b 153: 2: 154: jsr pc,tsrew 155: br 1b 156: 1: 157: mov wc,r1 158: 1: 159: jsr pc,tsrrec 160: add $256.,r1 161: bmi 1b 162: rts pc 163: 164: tsrrec: 165: 1: 166: tstb tssr 167: bpl 1b 168: mov $136006,r0 169: mov $512.,(r0) 170: clr -(r0) 171: mov mtma,-(r0) 172: mov $TSREAD,-(r0) 173: mov r0,tsbuf 174: 1: 175: tstb tssr 176: bpl 1b 177: cmp $1,tssr 178: blos 1f 179: mov $TSRETRY,(r0) 180: mov r0,tsbuf 181: br 1b 182: 1: 183: add $512.,mtma 184: inc mtapa 185: rts pc 186: 187: tsrew: 188: jsr pc,tsinit 189: mov $TSREW,136000 190: mov $136000,tsbuf 191: clr mtapa 192: rts pc 193: 194: tsinit: 195: tstb tssr 196: bpl tsinit 197: mov $136000,r0 198: mov $TSCHAR,(r0)+ 199: mov $136010,(r0)+ 200: clr (r0)+ 201: mov $10,(r0)+ 202: mov r0,(r0)+ 203: clr (r0)+ 204: mov $16,(r0)+ 205: mov $136000,tsbuf 206: 1: 207: tstb tssr 208: bpl 1b 209: rts pc 210: mtapa: 0 211: mtma: 0 212: tapa: 0 213: wc: 0 214: ba: 0 215: rew: 0 216: tread: 0