1: rti = 2 2: / accept 3: / r1 = header of where to put it 4: / 5: accept: 6: mov r0,-(sp) 7: movb $':,r0 8: jsr r5,tfoput 9: movb $' ,r0 10: jsr r5,tfoput 11: 2: 12: jsr r5,tfiget 13: cmpb r0,$'\n 14: beq 1f 15: jsr pc,putchar 16: br 2b 17: 1: 18: jsr pc,putchar 19: jsr r5,tfiget 20: cmpb r0,$'\n 21: beq 1f 22: jsr pc,putchar 23: br 2b 24: 1: 25: mov (sp)+,r0 26: rts pc 27: / 28: / 29: / routine to get the last word from the string 30: / r1=header addr 31: / 32: pop: 33: jsr pc,fsfile 34: jsr pc,backword 35: bes 1f 36: sub $2,w(r1) 37: 1: 38: rts pc 39: / 40: / 41: / routine to add an entry to assoc mem or curly 42: / r1 = header 43: / r0 = header of string name 44: / r2 = header of string 45: / 46: addentry: 47: jsr pc,putword 48: mov r2,r0 49: jsr pc,putword 50: rts pc 51: / 52: / 53: / routine to find the string pointed to by r0 54: / in either memory or curly 55: / r1 = where to look 56: / 57: / returns error set if string not there 58: / returns r1 = header of string if there 59: / 60: getsp: 61: mov r0,-(sp) 62: mov r1,-(sp) 63: jsr pc,rewind /memory 64: 3: 65: mov 2(sp),r1 66: jsr pc,rewind /output 67: mov (sp),r1 68: jsr pc,getword 69: bes 1f 70: mov r0,r1 71: mov r0,-(sp) 72: jsr pc,rewind /string 73: 2: 74: mov (sp),r1 75: jsr pc,getchar 76: bes 2f 77: movb r0,r2 78: mov 4(sp),r1 79: jsr pc,getchar 80: bes 4f 81: cmpb r0,r2 82: beq 2b 83: 4: 84: tst (sp)+ 85: 4: 86: mov (sp),r1 87: add $2,r(r1) 88: br 3b 89: 2: 90: tst (sp)+ 91: mov 2(sp),r1 92: cmp r(r1),w(r1) 93: bne 4b 94: mov (sp)+,r1 95: jsr pc,getword 96: tst (sp)+ 97: rts pc 98: 1: 99: mov (sp)+,r1 100: mov (sp)+,r0 101: sec 102: rts pc 103: / 104: / 105: / tfoput 106: / 107: / jsr r5,tfoput 108: / 109: tfoput: 110: mov r0,ch 111: mov $1,r0 112: sys write; ch; 1 113: rts r5 114: / 115: / 116: / tfiget 117: / 118: / jsr r5,tfiget 119: / 120: tfiget: 121: clr r0 122: sys read; ch; 1 123: bes 1f 124: tst r0 125: beq 1f 126: movb ch,r0 127: rts r5 128: 1: 129: jsr r5,flushb 130: tst argf 131: beq 1f 132: mov opointer,r1 133: jsr pc,pop 134: 1: 135: mov $5,tflag 136: jmp interrupt 137: / 138: / putc 139: / jsr r5,putc 140: / 141: putc: 142: mov r1,-(sp) 143: mov r2,-(sp) 144: mov $rfo+2,r1 145: mov r1,r2 146: add (r1),r2 147: movb r0,2(r2) 148: inc (r1) 149: cmp (r1),$512. 150: bge 1f 151: mov (sp)+,r2 152: mov (sp)+,r1 153: rts r5 154: 1: 155: mov (sp)+,r2 156: mov (sp)+,r1 157: / 158: / 159: / flush output buffer to output file. 160: / 161: flushb: 162: mov r1,-(sp) 163: mov r0,-(sp) 164: mov $rfo,r1 165: mov (r1)+,r0 166: mov (r1),0f+2 167: beq 1f 168: clr (r1)+ 169: mov r1,0f 170: sys write; 0:..;.. 171: 1: 172: mov (sp)+,r0 173: mov (sp)+,r1 174: rts r5 175: relarg: 176: mov $arg,r2 177: 1: 178: mov (r2)+,r1 179: beq 2f 180: jsr pc,release 181: br 1b 182: 2: 183: cmp r2,$arge 184: blt 1b 185: rts pc 186: / 187: relcurl: 188: mov curly,r1 189: jsr pc,rewind 190: 1: 191: jsr pc,getword 192: bes 1f 193: mov r0,r1 194: jsr pc,release 195: mov curly,r1 196: br 1b 197: 1: 198: jsr pc,release 199: rts pc 200: / 201: int: 202: inc iflag 203: rti 204: / 205: interrupt: 206: jsr pc,relarg 207: tst opointer 208: beq 2f 209: 1: 210: mov opointer,r1 211: jsr pc,rewind 212: 1: 213: jsr pc,getword 214: bes 1f 215: mov r0,r1 216: jsr pc,release 217: mov opointer,r1 218: br 1b 219: 1: 220: mov opointer,r1 221: jsr pc,release 222: tst ipointer 223: beq 2f 224: mov ipointer,r1 225: jsr pc,release 226: tst curly 227: beq 2f 228: jsr pc,relcurl 229: tst scr 230: beq 2f 231: mov scr,r1 232: jsr pc,release 233: 2: 234: jsr pc,flush 235: jsr pc,whead 236: sys exit 237: letter: .=.+2 238: arg: .=.+20. 239: arge: 0 240: argf: .=.+2 241: switch: .=.+2 242: curly: .=.+2 243: curlyf: .=.+2 244: ch: .=.+2 245: opointer: .=.+2 246: ipointer: .=.+2 247: scr: .=.+2 248: iflag: 0 249: tflag: 0 250: end: