1: /
   2: /
   3: 
   4: / nroff3
   5: 
   6: skipcont:
   7: /	mov	r2,-(sp)
   8: 0:
   9:         jsr     pc,getchar
  10: /	mov	r0,r2
  11: /	jsr	pc,alph2
  12: /	beq	0b
  13: 1:
  14:         cmp     $' ,r0
  15:         bne     1f
  16:         jsr     pc,getchar
  17:         br      1b
  18: 1:
  19: /	mov	(sp)+,r2
  20:         mov     r0,ch
  21:         tst     nlflg
  22:         rts     pc
  23: 
  24: rbreak:
  25:         jsr     pc,rbreak1
  26:         clr     totout
  27:         rts     pc
  28: rbreak1:
  29:         clr     trap
  30:         tst     nb
  31:         beq     1f
  32:         rts     pc
  33: 1:
  34:         cmp     nl,$-1
  35:         bne     1f
  36:         jsr     pc,newln1
  37:         rts     pc
  38: 1:
  39:         tst     nc
  40:         bne     1f
  41:         tst     pendw
  42:         bne     4f
  43:         tst     wch
  44:         beq     4f
  45:         jsr     pc,setnel
  46:         jsr     pc,movword
  47:         nop
  48: 1:
  49:         clrb    *linep
  50:         clr     nls
  51:         inc     totout
  52:         tst     lastl
  53:         bmi     1f
  54:         mov     ne,lastl
  55:         br      0f
  56: 1:
  57:         mov     ll,lastl
  58: 0:
  59:         tst     op
  60:         bne     0f
  61:         mov     po,r0
  62:         jsr     pc,space
  63: 0:
  64:         jsr     pc,donum
  65:         mov     un,r0
  66:         jsr     pc,space
  67:         jsr     pc,jfo
  68:         mov     $line,r2
  69: 1:
  70:         movb    (r2)+,r0
  71:         cmp     $' ,r0
  72:         bne     2f
  73:         jsr     pc,fill
  74:         tst     nc
  75:         bne     1b
  76:         br      3f
  77: 2:
  78:         jsr     pc,putchar
  79:         dec     nc
  80:         bgt     1b
  81: 3:
  82:         clr     nwd
  83:         clr     ne
  84:         mov     in,un
  85:         jsr     pc,setnel
  86:         jsr     pc,newline
  87:         cmp     nl,hnl
  88:         ble     0f
  89:         mov     nl,hnl
  90: 0:
  91:         tst     trap
  92:         bne     3f
  93:         mov     ls,r2
  94:         dec     r2
  95:         clr     r0
  96:         jsr     pc,findt
  97:         cmp     r1,r2
  98:         bgt     1f
  99:         mov     r1,r0
 100:         jsr     r5,nlines; newline
 101:         br      3f
 102: 1:
 103:         mov     r2,r0
 104:         jsr     r5,nlines;newline
 105: 3:
 106: /	clr	pendb
 107:         clr     spread
 108:         rts     pc
 109: 4:
 110:         jsr     pc,setnel
 111:         rts     pc
 112: 
 113: jfo:
 114:         tst     jfomod
 115:         beq     1f
 116:         mov     fac,r0
 117:         add     fmq,r0
 118:         beq     1f
 119:         clr     fac
 120:         clr     fmq
 121:         mov     nel,r0
 122:         cmp     jfomod,$1
 123:         bne     2f
 124:         asr     r0
 125: 2:
 126:         jsr     pc,space
 127: 1:
 128:         rts     pc
 129: 
 130: donum:
 131:         tst     numbmod
 132:         beq     2f
 133:         dec     nn
 134:         blt     1f
 135: 0:
 136:         mov     $3,r0
 137:         add     nms,r0
 138:         add     ni,r0
 139:         jsr     pc,space
 140:         rts     pc
 141: 1:
 142:         mov     lnumber,r1
 143:         sxt     r0
 144:         mov     ndf,-(sp)
 145:         dvd     (sp)+,r0
 146:         tst     r1
 147:         beq     1f
 148:         inc     lnumber
 149:         br      0b
 150: 1:
 151:         clr     r0
 152:         cmp     lnumber,$100.
 153:         bge     1f
 154:         inc     r0
 155:         cmp     lnumber,$10.
 156:         bge     1f
 157:         inc     r0
 158: 1:
 159:         add     ni,r0
 160:         jsr     pc,space
 161:         mov     lnumber,r0
 162:         jsr     r5,decimal; putchar
 163:         mov     nms,r0
 164:         jsr     pc,space
 165:         inc     lnumber
 166: 2:
 167:         rts     pc
 168: 
 169: newline:
 170:         mov     $'\n,r0
 171:         jsr     pc,putchar
 172:         tst     op
 173:         beq     1f
 174:         inc     dnl
 175:         rts     pc
 176: 1:
 177:         tst     x.5
 178:         beq     1f
 179:         mov     $032,r0
 180:         jsr     pc,putchar
 181: 1:
 182:         inc     nl
 183:         cmp     nl,pl
 184:         blo     3f
 185: newln1:
 186:         clr     nl
 187:         clr     hnl
 188:         clr     ejf
 189:         mov     $ilist,ejl
 190:         tst     donef
 191:         beq     2f
 192:         tst     nc
 193:         bne     1f
 194:         tst     wch
 195:         bne     1f
 196:         jmp     done1
 197: 1:
 198:         tst     ndone
 199:         jne     done1
 200:         inc     ndone
 201:         clr     donef
 202:         cmp     frame,$stk
 203:         bne     2f
 204:         inc     nflush
 205: 2:
 206:         inc     pn
 207:         tst     npn
 208:         beq     1f
 209:         mov     npn,pn
 210:         clr     npn
 211: 1:
 212:         cmp     pn,pto
 213:         ble     2f
 214:         jsr     pc,flush
 215:         jmp     place
 216: 2:
 217:         tst     stop
 218:         beq     2f
 219:         cmp     pn,pfrom
 220:         blo     2f
 221:         jsr     pc,flush
 222: /	mov	sp,r1
 223: /	sys	signal; 2; 1f
 224:         mov     ttyid,r0
 225:         sys     read; char; 1
 226: 1:
 227: /	mov	r1,sp
 228: /	sys	signal; 2; place
 229: 2:
 230: /	cmp	numbmod,$1
 231: /	bne	3f
 232: /	mov	$1,lnumber
 233: 3:
 234:         clr     trap
 235:         jsr     pc,findnl
 236:         tst     r1
 237:         beq     4f
 238:         mov     [mlist-nlist](r1),r0
 239:         mov     frame,-(sp)
 240:         jsr     pc,cont1
 241:         cmp     (sp)+,frame
 242:         beq     4f
 243:         inc     trap
 244: /	inc	nlflg
 245:         rts     pc
 246: 4:
 247:         tst     ejf
 248:         beq     5f
 249:         cmp     ilistp,ejl
 250:         beq     newline
 251: 5:
 252:         rts     pc
 253: 
 254: findnl:
 255:         mov     $nlist,r1
 256: 1:
 257:         mov     (r1),r0
 258:         tst     r0
 259:         bpl     2f
 260:         add     pl,r0
 261:         inc     r0
 262: 2:
 263:         cmp     nl,r0
 264:         beq     4f
 265: 3:
 266:         tst     (r1)+
 267:         cmp     r1,$nliste
 268:         bne     1b
 269:         clr     r1
 270:         rts     pc
 271: 4:
 272:         tst     [mlist-nlist](r1)
 273:         beq     3b
 274:         rts     pc
 275: 
 276: number:
 277:         jsr     pc,skipcont
 278: number1:
 279:         clr     -(sp)
 280:         mov     r1,-(sp)
 281:         mov     r3,-(sp)
 282:         clr     r3
 283:         clr     -(sp)
 284: 1:
 285:         jsr     pc,getchar
 286:         cmp     r0,$'+
 287:         beq     2f
 288:         cmp     r0,$'-
 289:         beq     2f
 290:         mov     r0,ch
 291: 1:
 292:         jsr     pc,atoi
 293:         beq     3f
 294:         mov     r0,r3
 295:         inc     6(sp)
 296:         br      3f
 297: 2:
 298:         mov     r0,(sp)
 299:         br      1b
 300: 3:
 301:         tst     6(sp)
 302:         bne     1f
 303:         mov     $1,r3
 304: 1:
 305:         mov     (r5)+,r0
 306:         beq     1f
 307:         mov     (r0),r0
 308: 1:
 309:         mov     (sp)+,r1
 310:         cmp     r1,$'-
 311:         bne     1f
 312:         sub     r3,r0
 313:         br      2f
 314: 1:
 315:         cmp     r1,$'+
 316:         bne     1f
 317:         add     r3,r0
 318:         br      2f
 319: 1:
 320:         mov     r3,r0
 321: 2:
 322:         mov     (sp)+,r3
 323:         mov     (sp)+,r1
 324:         tst     (sp)+
 325:         rts     r5
 326: 
 327: eject:
 328: /	tst	ejf
 329: /	bne	2f
 330:         inc     ejf
 331:         mov     r0,ejl
 332:         tst     trap
 333:         bne     2f
 334:         jsr     pc,newline
 335: 2:
 336:         rts     pc
 337: 
 338: storeline:
 339:         cmp     linep,$line+linsiz
 340:         bhis    1f
 341:         movb    r0,*linep
 342:         inc     linep
 343:         jsr     pc,width
 344:         add     r1,ne
 345:         sub     r1,nel
 346:         inc     nc
 347:         rts     pc
 348: 1:
 349:         tst     over
 350:         bne     2f
 351:         jsr     r5,stringfl; linemes
 352: 2:
 353:         inc     over
 354:         rts     pc
 355: linemes: <Line overflow\n\0>
 356:         .even
 357: 
 358: getword:
 359:         clr     -(sp)
 360:         clr     -(sp)
 361:         mov     pendw,r2
 362:         bne     5f
 363:         mov     $word,r2
 364:         clr     over
 365:         clr     wne
 366:         clr     wch
 367:         clr     nhyph
 368:         clr     hypedf
 369:         mov     $word,wordp
 370: 1:
 371:         jsr     pc,gettchar
 372:         bmi     4f
 373:         cmpb    r0,$'\n
 374:         bne     0f
 375:         clr     wne
 376:         clr     wch
 377:         br      3f
 378: 0:
 379:         cmpb    r0,ohc
 380:         bne     2f
 381:         inc     hypedf
 382:         br      1b
 383: 2:
 384:         cmpb    $' ,r0
 385:         bne     2f
 386:         jsr     pc,storeword
 387:         br      1b
 388: 2:
 389: 4:
 390:         mov     r0,-(sp)
 391:         mov     $' ,r0
 392: /	bis	chbits,r0
 393:         jsr     pc,storeword
 394:         tst     spaceflg
 395:         beq     2f
 396:         jsr     pc,storeword
 397:         clr     spaceflg
 398: 2:
 399:         mov     (sp)+,r0
 400: 2:
 401:         tst     r0
 402:         bmi     0f
 403:         cmpb    r0,$005
 404:         beq     6f
 405: 0:
 406:         inc     2(sp)
 407:         jsr     pc,storeword
 408:         bisb    (sp),-1(r2)     /add in hyphen
 409:         clr     (sp)
 410: 5:
 411:         jsr     pc,gettchar
 412:         bmi     1f
 413:         cmpb    r0,ohc
 414:         bne     1f
 415:         inc     hypedf
 416:         jsr     pc,gettchar
 417:         mov     $200,(sp)
 418: 1:
 419:         tst     r0
 420:         bmi     2b
 421:         cmpb    $' ,r0
 422:         beq     1f
 423:         cmpb    $'\n,r0
 424:         bne     2b
 425:         cmpb    -1(r2),$'.
 426:         beq     0f
 427:         cmpb    -1(r2),$'!
 428:         beq     0f
 429:         cmpb    -1(r2),$'?
 430:         bne     1f
 431: 0:
 432:         inc     spaceflg
 433: 1:
 434:         add     $2,4(sp)
 435:         clrb    (r2)+
 436: 3:
 437:         clr     pendw
 438:         cmp     (sp)+,(sp)+
 439:         mov     $word,wordp
 440:         jsr     pc,setnel
 441: /	jsr	pc,wordout
 442:         rts     pc
 443: 6:
 444:         tst     (sp)+
 445:         tst     (sp)+
 446:         beq     7f
 447:         mov     r2,pendw
 448: 0:
 449:         clr     nflush
 450:         jsr     pc,flushi
 451:         rts     pc
 452: 7:
 453:         clr     wch
 454:         br      0b
 455: 
 456: setnel:
 457:         tst     nc
 458:         bne     2f
 459:         mov     $line,linep
 460:         mov     ll,nel
 461:         tst     un1
 462:         blt     1f
 463:         mov     un1,un
 464:         mov     $-1,un1
 465: 1:
 466:         sub     un,nel
 467:         clr     ne
 468:         clr     fac
 469:         clr     fmq
 470: 2:
 471:         rts     pc
 472: 
 473: storeword:
 474:         cmp     r2,$eword
 475:         bhis    1f
 476:         jsr     pc,width
 477:         add     r1,wne
 478:         inc     wch
 479:         movb    r0,(r2)+
 480:         rts     pc
 481: 1:
 482:         tst     over
 483:         bne     2f
 484:         jsr     r5,stringfl; wordmes
 485: 2:
 486:         inc     over
 487:         rts     pc
 488: wordmes: <Word overflow\n\0>
 489:         .even
 490: 
 491: need:
 492: need2:
 493:         mov     r0,-(sp)
 494:         clr     r0
 495:         jsr     pc,findt
 496:         cmp     (sp)+,r1
 497:         ble     1f
 498: /	mov	ilistp,r0
 499: /	jsr	pc,eject
 500:         mov     r1,r0
 501:         clr     nls
 502:         jsr     r5,nlines;newline
 503: 1:
 504:         rts     pc
 505: 
 506: min:
 507:         tst     r0
 508:         bge     1f
 509:         clr     r0
 510: 1:
 511:         rts     pc
 512: 
 513: getname:
 514:         mov     r1,-(sp)
 515:         mov     r2,-(sp)
 516:         mov     (r5),r1
 517:         mov     $namesiz,r2
 518: 1:
 519:         jsr     pc,getchar
 520:         tst     nlflg
 521:         bne     2f
 522:         cmp     r0,$040
 523:         beq     2f
 524:         cmp     r0,$0176
 525:         blos    4f
 526: 2:
 527:         mov     r0,ch
 528: 3:
 529:         clrb    (r1)+
 530:         mov     (sp)+,r2
 531:         mov     (sp)+,r1
 532:         tstb    *(r5)+
 533:         rts     r5
 534: 4:
 535:         movb    r0,(r1)+
 536:         dec     r2
 537:         beq     3b
 538:         br      1b
 539: 
 540: copyb:
 541:         inc     copyf
 542:         jsr     pc,flushi
 543:         clr     nlflg
 544:         clr     -(sp)
 545:         mov     $1,-(sp)
 546: 1:
 547:         jsr     pc,getchar
 548:         bmi     9f
 549:         cmpb    r0,$'\n
 550:         bne     2f
 551:         mov     $1,(sp)
 552:         clr     nlflg
 553:         br      4f
 554: 2:
 555:         cmpb    r0,$'.
 556:         bne     9f
 557:         cmp     (sp),$1
 558:         bgt     3f
 559:         blt     9f
 560:         inc     (sp)
 561:         br      4f
 562: 3:
 563:         tst     skp
 564:         bne     0f
 565:         jsr     pc,wbfl
 566:         mov     2(sp),r1
 567:         clr     r0
 568:         jsr     pc,wbt
 569: 0:
 570:         inc     (sp)
 571:         br      5f
 572: 9:
 573:         clr     (sp)
 574: 4:
 575:         mov     r1,2(sp)
 576:         tst     skp
 577:         bne     5f
 578:         jsr     pc,wbf
 579: 5:
 580:         cmp     (sp),$3
 581:         bne     1b
 582:         cmp     (sp)+,(sp)+
 583: 6:
 584:         clr     copyf
 585:         rts     pc
 586: 
 587: allocmes: <Out of temp file space.\n\0>
 588:         .even
 589: 
 590: alloc:
 591:         mov     r1,-(sp)
 592:         clr     nextb
 593:         mov     $blist,r1
 594: 1:
 595:         tst     (r1)+
 596:         beq     3f
 597:         cmp     r1,$eblist
 598:         blo     1b
 599: 2:
 600:         mov     (sp)+,r1
 601:         tst     nextb
 602:         rts     pc
 603: 3:
 604:         mov     $-1,-(r1)
 605:         jsr     pc,offset
 606:         cmp     r1,first
 607:         blo     2b
 608:         mov     r1,nextb
 609:         br      2b
 610: 
 611: free:
 612:         mov     r1,-(sp)
 613:         mov     r0,r1
 614:         beq     2f
 615: 1:
 616:         jsr     pc,blistptr
 617:         tst     (r1)
 618:         beq     2f
 619:         cmp     (r1),$-1
 620:         bne     3f
 621:         clr     (r1)
 622: 2:
 623:         mov     (sp)+,r1
 624:         rts     pc
 625: 3:
 626:         mov     (r1),-(sp)
 627:         clr     (r1)
 628:         mov     (sp)+,r1
 629:         br      1b
 630: 
 631: offset:
 632:         sub     $blist,r1
 633:         ash     $7,r1
 634:         add     first,r1
 635:         rts     pc
 636: 
 637: blistptr:
 638:         mov     r0,-(sp)
 639:         clr     r0
 640:         sub     first,r1
 641:         ashc    $-7,r0
 642:         bic     $1,r1
 643:         add     $blist,r1
 644:         mov     (sp)+,r0
 645:         rts     pc
 646: 
 647: wbt:
 648:         jsr     pc,wbf
 649:         jsr     pc,wbfl
 650:         rts     pc
 651: wbf:
 652:         tst     woff
 653:         bne     0f
 654:         mov     r1,woff
 655:         mov     $wbuf,wbufp
 656: 0:
 657:         mov     r0,*wbufp
 658:         add     $2,wbufp
 659:         add     $2,r1
 660:         bit     $377,r1
 661:         bne     2f
 662:         sub     $2,r1
 663:         jsr     pc,blistptr
 664:         cmp     (r1),$-1
 665:         bne     1f
 666:         jsr     pc,wbfl
 667:         jsr     pc,alloc
 668:         bne     0f
 669:         jsr     r5,stringfl;allocmes
 670:         jmp     done
 671: 0:
 672:         mov     nextb,(r1)
 673: 1:
 674:         mov     (r1),r1
 675: 2:
 676:         cmp     wbufp,$wbufe
 677:         bhis    wbfl
 678:         rts     pc
 679: wbfl:
 680:         tst     woff
 681:         beq     0f
 682:         mov     wbufp,9f
 683:         sub     $wbuf,9f
 684:         beq     0f
 685:         mov     ibf,r0
 686:         sys     0;7f
 687: .data
 688: 7:      sys     seek; woff:..;0
 689: .text
 690:         mov     ibf,r0
 691:         sys     0;7f
 692: .data
 693: 7:      sys     write; wbuf; 9:..
 694: .text
 695:         clr     woff
 696:         mov     $-1,roff
 697: 0:
 698:         rts     pc
 699: rbf:
 700:         mov     ip,r1
 701:         jsr     pc,rbf0
 702:         bne     0f
 703:         tst     app
 704:         bne     1f
 705:         jsr     pc,popi
 706:         rts     pc
 707: 0:
 708:         jsr     pc,incoff
 709: 1:
 710:         mov     r1,ip
 711:         rts     pc
 712: 
 713: rbf0:
 714:         mov     r1,-(sp)
 715:         bic     $377,r1
 716:         cmp     r1,roff
 717:         beq     1f
 718:         mov     r1,roff
 719:         mov     ibf1,r0
 720:         sys     0;7f
 721: .data
 722: 7:      sys     seek; roff:-1 ;0
 723: .text
 724:         mov     ibf1,r0
 725:         sys     read;rbuf;256.
 726:         tst     r0
 727:         bne     1f
 728:         tst     (sp)+
 729:         sez
 730:         rts     pc
 731: 1:
 732:         mov     (sp),r0
 733:         bic     $!377,r0
 734:         mov     (sp)+,r1
 735:         mov     rbuf(r0),r0
 736:         rts     pc
 737: 
 738: incoff:
 739:         add     $2,r1
 740:         bit     $377,r1
 741:         bne     1f
 742:         sub     $2,r1
 743:         jsr     pc,blistptr
 744:         mov     (r1),r1
 745:         beq     5f
 746:         cmp     $-1,r1
 747:         beq     5f
 748: 1:
 749:         rts     pc
 750: 5:
 751:         jsr     r5,stringfl; badmes
 752:         jmp     place
 753: badmes: <Bad storage allocation\n\0>
 754:         .even
 755: 
 756: alph:
 757:         movb    (r0),r2
 758: alph2:
 759:         cmp     r2,$'A
 760:         blo     1f
 761:         cmp     r2,$'Z
 762:         blos    2f
 763:         cmp     r2,$'a
 764:         blo     1f
 765:         cmp     r2,$'z
 766:         bhi     1f
 767: 2:
 768:         sez
 769:         rts     pc
 770: 1:
 771:         clz
 772:         rts     pc
 773: rdsufb:
 774:         mov     r1,-(sp)
 775:         bic     $177,r1
 776:         cmp     r1,sufoff
 777:         beq     2f
 778:         mov     r1,sufoff
 779:         mov     suff,r0
 780:         sys     0;7f
 781: .data
 782: 7:      sys     seek; sufoff: -1; 0
 783: .text
 784:         mov     suff,r0
 785:         sys     read; sufbuf; 128.
 786: 2:
 787:         mov     (sp),r0
 788:         bic     $!177,r0
 789:         movb    sufbuf(r0),r0
 790:         mov     (sp)+,r1
 791:         rts     pc
 792: 
 793: 
 794: atoi:
 795:         jsr     pc,atoi1
 796:         bne     1f
 797:         rts     pc
 798: 1:
 799:         mov     r1,-(sp)
 800:         mov     r0,-(sp)
 801: 1:
 802:         jsr     pc,getchar
 803:         cmp     r0,$'+
 804:         beq     4f
 805:         cmp     r0,$'-
 806:         beq     5f
 807: 2:
 808:         cmp     r0,$'*
 809:         bne     2f
 810:         jsr     pc,atoi1
 811:         beq     3f
 812:         mov     r0,r1
 813:         mpy     (sp),r1
 814:         mov     r1,(sp)
 815:         br      1b
 816: 2:
 817:         cmp     r0,$'\/
 818:         bne     2f
 819:         jsr     pc,atoi1
 820:         beq     3f
 821:         mov     r0,-(sp)
 822:         mov     2(sp),r1
 823:         sxt     r0
 824:         dvd     (sp),r0
 825:         mov     r0,2(sp)
 826:         tst     (sp)+
 827:         br      1b
 828: 2:
 829:         mov     r0,ch
 830: 3:
 831:         mov     (sp)+,r0
 832:         mov     (sp)+,r1
 833:         tst     pc
 834:         rts     pc
 835: 4:
 836:         jsr     pc,atoi1
 837:         beq     3b
 838:         add     r0,(sp)
 839:         br      1b
 840: 5:
 841:         jsr     pc,atoi1
 842:         beq     3b
 843:         sub     r0,(sp)
 844:         br      1b
 845: 
 846: atoi1:
 847:         clr     -(sp)
 848:         mov     r3,-(sp)
 849:         clr     -(sp)
 850:         clr     r3
 851:         jsr     pc,getchar
 852:         cmp     r0,$'-
 853:         bne     2f
 854:         inc     (sp)
 855: 1:
 856:         jsr     pc,getchar
 857: 2:
 858:         sub     $'0,r0
 859:         cmp     r0,$9
 860:         bhi     1f
 861:         inc     4(sp)
 862:         mpy     $10.,r3
 863:         add     r0,r3
 864:         br      1b
 865: 1:
 866:         add     $'0,r0
 867:         mov     r0,ch
 868:         bne     0f
 869:         mov     $' ,ch
 870: 0:
 871:         tst     (sp)+
 872:         beq     1f
 873:         neg     r3
 874: 1:
 875:         mov     r3,r0
 876:         mov     (sp)+,r3
 877:         tst     (sp)+
 878:         rts     pc
 879: 
 880: findt:
 881:         mov     r0,-(sp)
 882:         mov     $-1,-(sp)
 883:         mov     $nlist,r1
 884: 1:
 885:         tst     [mlist-nlist](r1)
 886:         bne     3f
 887: 2:
 888:         tst     (r1)+
 889:         cmp     r1,$nliste
 890:         ble     1b
 891:         br      8f
 892: 3:
 893:         mov     (r1),r0
 894:         tst     2(sp)
 895:         bmi     6f      /- traps
 896:         beq     4f      /all traps
 897:         tst     (r1)    /+ traps
 898:         bmi     2b
 899: 4:
 900:         tst     (r1)
 901:         bpl     5f
 902:         mov     pl,r0
 903:         inc     r0
 904:         add     (r1),r0
 905: 5:
 906:         sub     nl,r0
 907:         ble     2b
 908:         cmp     r0,(sp)
 909:         bhis    2b
 910:         mov     r0,(sp)
 911:         br      2b
 912: 6:
 913:         tst     (r1)
 914:         bpl     2b
 915:         br      4b
 916: 8:
 917:         mov     (sp),r1
 918:         bpl     9f
 919:         mov     pl,r1
 920:         sub     nl,r1
 921: 9:
 922:         cmp     (sp)+,(sp)+
 923:         rts     pc
 924: 
 925: findr:
 926:         mov     $rlist,r1
 927: 1:
 928:         tst     (r1)
 929:         beq     2f
 930:         cmp     (r1)+,r0
 931:         beq     3f
 932:         cmp     r1,$rliste
 933:         blos    1b
 934:         tst     numerr
 935:         bne     0f
 936:         jsr     r5,stringfl; 9f
 937: 0:
 938:         inc     numerr
 939: /	clr	r1
 940: /	rts	pc
 941:         cmp     numerr,$1
 942:         jeq     edone
 943:         jmp     done2
 944: 2:
 945:         mov     r0,(r1)
 946:         br      4f
 947: 3:
 948:         tst     -(r1)
 949: 4:
 950:         add     $[vlist-rlist],r1
 951:         rts     pc
 952: 9: <No more number registers.\n\0>
 953:         .even
 954: 
 955: setn0:
 956:         clr     -(sp)
 957:         clr     -(sp)
 958:         mov     $1,nform
 959:         jbr     setn1
 960: setn:
 961:         mov     r1,-(sp)
 962:         clr     -(sp)
 963:         clr     temp
 964:         jsr     pc,get1
 965:         cmpb    r0,$'+
 966:         bne     1f
 967:         inc     (sp)
 968: 0:
 969:         jsr     pc,get1
 970: 1:
 971:         cmpb    r0,$'\\
 972:         bne     1f
 973: 3:
 974:         jsr     pc,get1
 975:         jsr     r5,switch;esctab
 976:         cmpb    r0,dolc
 977:         bne     1f
 978:         jsr     pc,seta
 979:         br      0b
 980: 1:
 981:         tst     temp
 982:         bne     2f
 983:         bic     $!177,r0
 984:         cmpb    r0,$'(
 985:         bne     1f
 986:         inc     temp
 987:         jsr     pc,get1
 988: 2:
 989:         bic     $!177,r0
 990:         cmpb    r0,$'\\
 991:         beq     3b
 992:         mov     r0,-(sp)
 993:         jsr     pc,get1
 994:         bic     $!177,r0
 995:         swab    r0
 996:         bis     (sp)+,r0
 997: 1:
 998:         cmpb    2(sp),$372
 999:         beq     5f /exit if called by \k
1000:         clr     nform
1001:         cmp     r0,$".v
1002:         bne     0f
1003:         mov     ls,r0
1004:         br      setn1
1005: 0:
1006:         cmp     r0,$".p
1007:         bne     0f
1008:         mov     pl,r0
1009:         br      setn1
1010: 0:
1011:         cmp     r0,$".t
1012:         bne     0f
1013:         clr     r0
1014:         jsr     pc,findt
1015:         mov     r1,r0
1016:         br      setn1
1017: 0:
1018:         cmp     r0,$".o
1019:         bne     0f
1020:         mov     po,r0
1021:         br      setn1
1022: 0:
1023:         cmp     r0,$".l
1024:         bne     0f
1025:         mov     ll,r0
1026:         br      setn1
1027: 0:
1028:         cmp     r0,$".i
1029:         bne     0f
1030:         mov     in,r0
1031:         br      setn1
1032: 0:
1033:         cmp     r0,$".$
1034:         bne     0f
1035:         mov     *frame,r0
1036:         br      setn1
1037: 0:
1038:         cmp     r0,$".x
1039:         bne     0f
1040:         mov     evp,r0
1041:         br      setn1
1042: 0:
1043:         cmp     r0,$".c
1044:         bne     0f
1045:         mov     iline,r0
1046:         br      setn1
1047: 0:
1048:         cmp     r0,$".h
1049:         bne     0f
1050:         mov     hnl,r0
1051:         br      setn1
1052: 0:
1053:         cmp     r0,$".n
1054:         bne     0f
1055:         mov     lastl,r0
1056:         br      setn1
1057: 0:
1058:         jsr     pc,findr
1059:         tst     r1
1060:         beq     5f
1061:         tst     (sp)
1062:         beq     1f
1063:         add     [inclist-vlist](r1),(r1)
1064: 1:
1065:         mov     (r1),r0
1066:         mov     [flist-vlist](r1),nform
1067: setn1:
1068:         mov     r4,-(sp)
1069:         mov     $cbuf,r4
1070:         tst     r0
1071:         bge     1f
1072:         movb    $'-,(r4)+
1073:         neg     r0
1074: 1:
1075:         jsr     r5,fnumb0;wrc
1076:         clrb    (r4)
1077:         mov     (sp)+,r4
1078:         mov     $cbuf,cp
1079: 5:
1080:         tst     (sp)+
1081:         mov     (sp)+,r1
1082:         rts     pc
1083: 
1084: wrc:
1085:         cmp     r4,$stk
1086:         bhis    1f
1087:         movb    r0,(r4)+
1088: 1:
1089:         rts     pc
1090: 
1091: seta:
1092:         jsr     pc,get1
1093:         cmp     r0,$'\\
1094:         bne     1f
1095:         jsr     pc,get1
1096:         jsr     r5,switch;esctab
1097:         cmp     r0,numc
1098:         bne     1f
1099:         clr     r1
1100:         jsr     pc,setn
1101:         br      seta
1102: 1:
1103:         sub     $060,r0
1104:         ble     2f
1105:         cmp     r0,$9.
1106:         bgt     2f
1107:         cmp     r0,*frame
1108:         bgt     2f
1109:         asl     r0
1110:         add     frame,r0
1111:         add     $stksiz-2,r0
1112:         mov     (r0),ap
1113: 2:
1114:         rts     pc
1115: 
1116:         stksiz = 16.
1117: pushi:
1118:         clr     r0
1119:         mov     enda,-(sp)
1120:         sub     $stksiz,(sp)
1121:         cmp     nxf,(sp)+
1122:         blo     0f
1123:         jsr     pc,setbrk
1124:         beq     2f
1125:         br      pushi
1126: 0:
1127:         mov     nxf,r0
1128:         tst     (r0)+  /nargs
1129:         mov     frame,(r0)+
1130:         mov     ip,(r0)+
1131:         mov     nspace,(r0)+
1132:         clr     nspace
1133:         mov     rchar,(r0)+
1134:         clr     rchar
1135:         mov     pendt,(r0)+
1136:         mov     ap,(r0)+
1137:         mov     ch,(r0)+
1138:         clr     ch
1139:         clr     ap
1140:         clr     pendt
1141:         mov     nxf,frame
1142:         tst     *nxf
1143:         bne     1f
1144:         add     $stksiz,nxf
1145:         br      2f
1146: 1:
1147:         mov     r1,nxf
1148: 2:
1149:         tst     r0
1150:         rts     pc
1151: 
1152: popi:
1153:         cmp     frame,$stk
1154:         beq     1f
1155:         mov     frame,r0
1156:         mov     r0,nxf
1157:         clr     (r0)+
1158:         mov     (r0)+,frame
1159:         mov     (r0)+,ip
1160:         mov     (r0)+,nspace
1161:         mov     (r0)+,rchar
1162:         mov     (r0)+,pendt
1163:         mov     (r0)+,ap
1164:         mov     (r0)+,r0
1165: /	cmp	frame,litlev
1166: /	bhis	1f
1167: /	clr	lit
1168: 1:
1169:         rts     pc
1170: 
1171: setbrk:
1172:         tst     noset
1173:         bne     2f
1174:         mov     enda,-(sp)
1175:         add     $516.,(sp)
1176:         bic     $777,(sp)
1177:         mov     (sp)+,0f
1178:         sys     0;7f
1179: .data
1180: 7:      sys     break; 0:..
1181: .text
1182:         bes     1f
1183:         mov     0b,enda
1184:         sub     $2,enda
1185:         clz
1186:         rts     pc
1187: 1:
1188:         inc     noset
1189: 2:
1190:         sez
1191:         rts     pc
1192: 
1193: collect:
1194:         inc     copyf
1195:         jsr     pc,skipcont
1196:         clr     *nxf
1197:         mov     nxf,r2
1198:         add     $stksiz,r2
1199:         mov     r2,r1
1200:         add     $18.,r1
1201:         mov     r1,-(sp)
1202:         mov     nxf,-(sp)
1203:         cmp     r1,enda
1204:         blo     1f
1205:         jsr     pc,setbrk
1206:         beq     7f
1207: 1:
1208:         clr     quote
1209:         cmp     r2,2(sp)
1210:         beq     9f
1211:         jsr     pc,skipcont
1212:         tst     nlflg
1213:         bne     9f
1214:         mov     r1,(r2)+
1215:         jsr     pc,getchar
1216:         cmp     r0,$'"
1217:         bne     3f
1218:         inc     quote
1219: 2:
1220:         jsr     pc,getchar
1221: 3:
1222:         tst     nlflg
1223:         bne     8f
1224:         tst     quote
1225:         bne     4f
1226:         cmp     r0,$' /
1227:         beq     8f
1228:         br      5f
1229: 4:
1230:         cmp     r0,$'"
1231:         bne     5f
1232:         jsr     pc,getchar
1233:         cmpb    r0,$'"
1234:         bne     8f
1235: 5:
1236:         movb    r0,(r1)+
1237:         mov     enda,-(sp)
1238:         sub     $4,(sp)
1239:         cmp     r1,(sp)+
1240:         blo     2b
1241:         jsr     pc,setbrk
1242:         beq     6f
1243:         br      2b
1244: 8:
1245:         mov     r0,ch
1246: 6:
1247:         clrb    (r1)+
1248:         tst     nlflg
1249:         bne     9f
1250:         tst     noset
1251:         beq     1b
1252: 9:
1253:         mov     (sp),nxf
1254:         sub     nxf,r2
1255:         sub     $stksiz,r2
1256:         asr     r2
1257:         mov     r2,*nxf
1258:         bit     $1,r1
1259:         beq     7f
1260:         inc     r1
1261: 7:
1262:         clr     copyf
1263:         cmp     (sp)+,(sp)+
1264:         rts     pc

Defined functions

alloc defined in line 590; used 1 times
allocmes defined in line 587; used 1 times
alph defined in line 756; never used
alph2 defined in line 758; never used
atoi defined in line 794; used 1 times
atoi1 defined in line 846; used 5 times
badmes defined in line 753; used 1 times
blistptr defined in line 637; used 3 times
collect defined in line 1193; never used
copyb defined in line 540; never used
donum defined in line 130; used 1 times
  • in line 64
eject defined in line 327; never used
findnl defined in line 254; used 1 times
findr defined in line 925; used 1 times
findt defined in line 880; used 3 times
free defined in line 611; never used
getname defined in line 513; never used
getword defined in line 358; never used
incoff defined in line 738; used 1 times
jfo defined in line 113; used 1 times
  • in line 67
linemes defined in line 355; used 1 times
min defined in line 506; never used
need defined in line 491; never used
need2 defined in line 492; never used
newline defined in line 169; used 6 times
newln1 defined in line 185; used 1 times
  • in line 36
number defined in line 276; never used
number1 defined in line 278; never used
offset defined in line 631; used 1 times
popi defined in line 1152; used 1 times
pushi defined in line 1117; used 1 times
rbf defined in line 699; never used
rbf0 defined in line 713; used 1 times
rbreak defined in line 24; never used
rbreak1 defined in line 28; used 1 times
  • in line 25
rdsufb defined in line 773; never used
seta defined in line 1091; used 2 times
setbrk defined in line 1171; used 3 times
setn defined in line 960; used 1 times
setn0 defined in line 955; never used
setn1 defined in line 1067; used 12 times
setnel defined in line 456; used 4 times
skipcont defined in line 6; used 3 times
stksiz defined in line 1116; used 5 times
storeline defined in line 338; never used
storeword defined in line 473; used 4 times
wbf defined in line 651; used 2 times
wbfl defined in line 679; used 4 times
wbt defined in line 647; used 1 times
wordmes defined in line 488; used 1 times
wrc defined in line 1084; used 1 times

Defined variables

roff defined in line 722; used 3 times
sufoff defined in line 782; used 2 times
woff defined in line 688; used 4 times
Last modified: 1975-07-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2244
Valid CSS Valid XHTML 1.0 Strict