1: / 2: / 3: 4: /roff3 -- runoff 5: 6: skipcont: 7: jsr pc,getchar 8: mov r0,r2 9: jsr pc,alph2 10: beq skipcont 11: 1: 12: cmp $' ,r0 13: bne 1f 14: jsr pc,getchar 15: br 1b 16: 1: 17: mov r0,ch 18: rts pc 19: 20: rbreak: 21: tst nc 22: ble 4f 23: clrb *linep 24: inc totout 25: mov ls,r0 26: dec r0 27: jsr r5,nlines; nline 28: tst pl 29: beq 4f 30: cmp nl,bl 31: bne 1f 32: 3: 33: jsr pc,eject 34: 1: 35: tst nl 36: bne 3f 37: mov ma1,r0 38: jsr r5,nlines; newline 39: bit $1,pn 40: bne 1f 41: jsr r5,headout; ehead 42: br 2f 43: 1: 44: jsr r5,headout; ohead 45: 2: 46: mov ma2,r0 47: jsr r5,nlines; newline 48: dec skip 49: bge 3b 50: 3: 51: mov po,r0 52: jsr pc,space 53: jsr pc,donum 54: mov un,r0 55: jsr pc,space 56: jsr pc,jfo 57: mov $line,r2 58: 1: 59: movb (r2)+,r0 60: cmp $' ,r0 61: bne 2f 62: jsr pc,fill 63: tst nc 64: bne 1b 65: br 3f 66: 2: 67: jsr pc,putchar 68: dec nc 69: bgt 1b 70: 3: 71: jsr pc,newline 72: clr nwd 73: clr ne 74: mov in,un 75: 4: 76: jsr pc,setnel 77: rts pc 78: 79: jfo: 80: tst jfomod 81: beq 1f 82: mov fac,r0 83: add fmq,r0 84: beq 1f 85: clr fac 86: clr fmq 87: mov nel,r0 88: cmp jfomod,$1 89: bne 2f 90: asr r0 91: 2: 92: jsr pc,space 93: 1: 94: rts pc 95: 96: donum: 97: tst numbmod 98: beq 2f 99: dec nn 100: blt 1f 101: mov $5,r0 102: add ni,r0 103: jsr pc,space 104: rts pc 105: 1: 106: clr r0 107: cmp lnumber,$100. 108: bge 1f 109: inc r0 110: cmp lnumber,$10. 111: bge 1f 112: inc r0 113: 1: 114: add ni,r0 115: jsr pc,space 116: mov lnumber,r0 117: jsr r5,decimal; putchar 118: mov $2,r0 119: jsr pc,space 120: inc lnumber 121: 2: 122: rts pc 123: 124: 125: newline: 126: mov $'\n,r0 127: jsr pc,putchar 128: inc nl 129: rts pc 130: 131: nline: 132: mov nl,r0 133: beq 1f 134: cmp r0,bl 135: beq 1f 136: jsr pc,newline 137: 1: 138: rts pc 139: 140: number: 141: jsr pc,skipcont 142: number1: 143: mov r1,-(sp) 144: mov r3,-(sp) 145: clr r3 146: clr -(sp) 147: clr -(sp) 148: 1: 149: jsr pc,getchar 150: cmp r0,$'+ 151: beq 2f 152: cmp r0,$'- 153: beq 2f 154: sub $'0,r0 155: cmp r0,$9. 156: bhi 3f 157: inc (sp) 158: mpy $10.,r3 159: add r0,r3 160: br 1b 161: 2: 162: mov r0,2(sp) 163: br 1b 164: 3: 165: add $'0,r0 166: mov r0,ch 167: mov (sp)+,r0 168: bne 1f 169: mov $1,r3 170: mov r3,r0 171: 1: 172: mov (r5)+,r0 173: beq 1f 174: mov (r0),r0 175: 1: 176: mov (sp)+,r1 177: cmp r1,$'- 178: bne 1f 179: sub r3,r0 180: br 2f 181: 1: 182: cmp r1,$'+ 183: bne 1f 184: add r3,r0 185: br 2f 186: 1: 187: mov r3,r0 188: 2: 189: mov (sp)+,r3 190: mov (sp)+,r1 191: rts r5 192: 193: eject: 194: tst pl 195: beq 1f 196: tst nl 197: beq 1f 198: mov pl,r0 199: sub nl,r0 200: sub ma4,r0 201: sub hx,r0 202: jsr r5,nlines; newline 203: bit $1,pn 204: bne 2f 205: jsr r5,headout; efoot 206: br 3f 207: 2: 208: jsr r5,headout; ofoot 209: 3: 210: cmp numbmod,$1 211: bne 3f 212: mov $1,lnumber 213: 3: 214: mov ma4,r0 215: jsr r5,nlines; newline 216: clr nl 217: inc pn 218: 1: 219: cmp pn,pto 220: ble 1f 221: jsr pc,flush 222: jmp place 223: 1: 224: istop: 225: tst stop 226: beq 2f 227: cmp pn,pfrom 228: blo 2f 229: jsr pc,flush 230: / mov sp,r1 231: / sys signal; 2; 1f 232: clr r0 233: sys read; garb; 1 234: 1: 235: / mov r1,sp 236: / sys signal; 2; place 237: 2: 238: rts pc 239: 240: 241: storeline: 242: cmp linep,$line+linsiz 243: bhis 1f 244: movb r0,*linep 245: inc linep 246: jsr pc,width 247: add r1,ne 248: sub r1,nel 249: inc nc 250: 1: 251: rts pc 252: 253: getword: 254: mov $word,r2 255: clr wne 256: clr wch 257: clr nhyph 258: clr hypedf 259: mov $word,wordp 260: clr -(sp) 261: 1: 262: jsr pc,gettchar 263: cmp r0,$'\n 264: beq 3f 265: cmp r0,ohc 266: bne 2f 267: inc hypedf 268: br 1b 269: 2: 270: cmp $' ,r0 271: bne 2f 272: jsr pc,storeword 273: br 1b 274: 2: 275: mov r0,-(sp) 276: mov $' ,r0 277: jsr pc,storeword 278: tst spaceflg 279: beq 2f 280: jsr pc,storeword 281: clr spaceflg 282: 2: 283: mov (sp)+,r0 284: 2: 285: jsr pc,storeword 286: bisb (sp),-1(r2) /add in hyphen 287: clr (sp) 288: jsr pc,gettchar 289: cmp r0,ohc 290: bne 1f 291: inc hypedf 292: jsr pc,gettchar 293: mov $200,(sp) 294: 1: 295: cmp $' ,r0 296: beq 1f 297: cmp $'\n,r0 298: bne 2b 299: cmpb -1(r2),$'. 300: bne 1f 301: inc spaceflg 302: 1: 303: add $2,2(sp) 304: 1: 305: clrb (r2)+ 306: 3: 307: tst (sp)+ 308: mov $word,wordp 309: tst nc 310: bne 1f 311: jsr pc,setnel 312: 1: 313: rts pc 314: 315: setnel: 316: mov $line,linep 317: mov ll,nel 318: sub un,nel 319: clr ne 320: clr fac 321: clr fmq 322: rts pc 323: 324: storeword: 325: jsr pc,width 326: add r1,wne 327: inc wch 328: movb r0,(r2)+ 329: rts pc 330: 331: need: 332: mov r0,r3 333: mpy ls,r3 334: mov r3,r0 335: need2: 336: add nl,r0 337: cmp r0,bl 338: ble 1f 339: jsr pc,eject 340: 1: 341: rts pc 342: 343: min: 344: tst r0 345: bge 1f 346: clr r0 347: 1: 348: rts pc 349: 350: getname: 351: mov r1,-(sp) 352: mov r2,-(sp) 353: mov (r5)+,r1 354: mov $18.,r2 355: 1: 356: jsr pc,getchar 357: cmp r0,$041 358: blt 2f 359: cmp r0,$0176 360: ble 4f 361: 2: 362: mov r0,ch 363: 3: 364: clrb (r1)+ 365: mov (sp)+,r2 366: mov (sp)+,r1 367: rts r5 368: 4: 369: movb r0,(r1)+ 370: dec r2 371: beq 3b 372: br 1b 373: 374: copyb: 375: mov (r1),r1 376: jsr pc,flushi 377: clr nlflg 378: mov $1,-(sp) 379: 1: 380: jsr pc,getchar 381: cmp r0,$'\n 382: bne 2f 383: mov $1,(sp) 384: clr nlflg 385: br 4f 386: 2: 387: cmp r0,$'. 388: bne 9f 389: cmp (sp),$1 390: bgt 3f 391: blt 9f 392: inc (sp) 393: br 4f 394: 3: 395: dec r1 396: clr r0 397: inc (sp) 398: br 4f 399: 9: 400: clr (sp) 401: 4: 402: tst skp 403: bne 5f 404: jsr pc,wbf 405: 5: 406: cmp (sp),$3 407: bne 1b 408: tst (sp)+ 409: tst skp 410: bne 6f 411: mov r1,nextb 412: 6: 413: rts pc 414: 415: popi: 416: cmp ilistp,$ilist 417: beq 1f 418: sub $2,ilistp 419: mov *ilistp,ip 420: 1: 421: rts pc 422: 423: wbf: 424: mov r0,char 425: mov r1,offb 426: mov ibf,r0 427: sys seek; offb:..;0 428: mov ibf,r0 429: sys write; char;1 430: inc r1 431: cmp ibf1,ofile 432: bne 1f 433: mov $-1,ofile 434: 1: 435: rts pc 436: rbf: 437: mov ip,r1 438: mov ibf1,nfile 439: jsr pc,rdsufb 440: tstb r0 441: bne 2f 442: jsr pc,popi 443: rts pc 444: 2: 445: inc ip 446: rts pc 447: 448: alph: 449: movb (r0),r2 450: alph2: 451: cmp r2,$'A 452: blo 1f 453: cmp r2,$'Z 454: blos 2f 455: cmp r2,$'a 456: blo 1f 457: cmp r2,$'z 458: bhi 1f 459: 2: 460: sez 461: rts pc 462: 1: 463: clz 464: rts pc 465: 466: rdsufb: 467: mov r1,-(sp) 468: bic $77,r1 469: cmp r1,sufoff 470: bne 1f 471: cmp nfile,ofile 472: beq 2f 473: 1: 474: mov r1,sufoff 475: mov nfile,ofile 476: mov nfile,r0 477: sys seek; sufoff: -1; 0 478: mov nfile,r0 479: sys read; sufbuf; 512. 480: 2: 481: mov (sp),r0 482: bic $!77,r0 483: movb sufbuf(r0),r0 484: mov (sp)+,r1 485: rts pc