1: / db1 -- debugger
   2: 
   3: fpp = 0
   4: eae = 0
   5: ldfps = 170100^tst
   6: 
   7: 
   8: db:
   9:         mov     sp,r5
  10:         mov     (r5)+,r4
  11:         tst     (r5)+
  12:         cmp     r4,$2
  13:         blt     1f
  14:         mov     (r5),dbfile
  15:         mov     (r5),odbfil
  16:         mov     (r5)+,namfil
  17:         cmp     r4,$2
  18:         beq     1f
  19:         mov     (r5)+,namfil
  20: 1:
  21:         sys     open; dbfile: core; 0
  22:         bec     9f
  23:         jmp     fnfnd
  24: 9:
  25:         mov     r0,dbfin
  26:         clr     dbfout
  27:         sys     open; odbfil:core; 1
  28:         bes     1f
  29:         mov     r0,dbfout
  30: 1:
  31:         sys     open; namfil: a.out; 0
  32:         bes     1f
  33:         mov     r0,r1
  34:         mov     r0,symfin
  35:         sys     read; nambuf; 20
  36:         cmp     nambuf,nobjmagic
  37:         beq     2f
  38:         cmp     nambuf,objmagic
  39:         bne     1f
  40: 2:
  41:         mov     nambuf+2,r0     / text
  42:         add     nambuf+4,r0     / data
  43:         cmp     nambuf+16,$1    / relocation?
  44:         beq     6f
  45:         asl     r0              / sym origin
  46: 6:
  47:         add     $20,r0
  48:         mov     r0,0f
  49:         mov     r1,r0
  50:         sys     seek; 0:..; 0
  51:         mov     nambuf+10,r0    / symbol size
  52:         cmp     r0,$maxsym
  53:         blos    3f
  54:         mov     $maxsym,r0
  55: 3:
  56:         add     r0,0f
  57:         sys     break; 0: nambuf
  58:         mov     r0,0f
  59:         mov     r1,r0
  60:         sys     read; nambuf; 0:..
  61:         add     $nambuf,r0
  62:         mov     r0,namsiz
  63: 1:
  64:         jsr     r5,get; zero    / test new object
  65:         cmp     r0,nobjmagic
  66:         beq     2f
  67:         cmp     r0,objmagic
  68:         bne     1f
  69: 2:
  70:         mov     $20,getoff
  71: 1:
  72:         mov     sp,savsp
  73:         sys     signal; 2; 1
  74:         ror     r0
  75:         bcs     1f
  76:         sys     signal; 2; errexit
  77: 1:
  78:         cmp     r4,$2           / arg count
  79:         beq     9f              / not core image
  80:         cmp     r4,$4           / no-core image flag
  81:         beq     9f
  82:         mov     $1024.,getoff
  83:         mov     dbfin,r0
  84:         sys     seek; 0; 0
  85:         mov     dbfin,r0
  86:         sys     read; regbuf; 1024.
  87:         mov     txtsiz,r0
  88:         ash     $6,r0
  89:         mov     r0,txtsiz
  90:         add     $17777,r0
  91:         bic     $17777,r0
  92:         mov     r0,rtxtsiz
  93:         mov     datsiz,r0
  94:         ash     $6,r0
  95:         mov     r0,datsiz
  96:         mov     stksiz,r0
  97:         ash     $6,r0
  98:         mov     r0,stksiz
  99:         mov     *locfpsr,r0
 100:         bic     $!200,r0
 101:         mov     r0,fpsr
 102:         br      loop
 103: 9:
 104: loop:
 105:         clr     error
 106:         jsr     pc,readlin
 107:         jsr     pc,readexp
 108:         tst     error
 109:         bne     errexit
 110:         mov     $1,count
 111:         cmpb    r0,$',
 112:         bne     2f
 113:         movb    (r4)+,r0
 114:         mov     addres,-(sp)
 115:         mov     adrflg,-(sp)
 116:         jsr     pc,readexp
 117:         mov     addres,count
 118:         mov     (sp)+,adrflg
 119:         mov     (sp)+,addres
 120:         tst     error
 121:         bne     errexit
 122: 2:
 123:         movb    (r4),r0
 124:         jsr     pc,command
 125:         tst     error
 126:         beq     loop
 127: errexit:
 128:         sys     signal; 2; errexit
 129:         mov     savsp,sp
 130:         jsr     r5,mesg; <?\n\0>; .even
 131:         br      loop
 132: 
 133: fnfnd:
 134:         jsr     r5,mesg; <File not found.\n\0>; .even
 135: ex:
 136:         sys     exit
 137: 
 138: readlin:
 139:         mov     $inbuf,r4
 140: 1:
 141:         mov     ttyfin,r0
 142:         sys     read; ch; 1
 143:         tst     r0
 144:         beq     ex
 145:         cmpb    ch,$'\n
 146:         beq     1f
 147:         movb    ch,(r4)+
 148:         br      1b
 149: 1:
 150:         clrb    (r4)
 151:         mov     $inbuf,r4
 152:         rts     pc
 153: 
 154: switch:
 155:         mov     (r5)+,r1
 156: 2:
 157:         cmp     r0,(r1)+
 158:         bne     1f
 159:         tst     (sp)+
 160:         jmp     *(r1)
 161: 1:
 162:         tst     (r1)+
 163:         bne     2b
 164:         rts     r5
 165: 
 166: readexp:
 167:         mov     $'+,lastop
 168:         clr     addres
 169:         clr     starmod
 170:         clr     taddr
 171:         clr     adrflg
 172: nextxp:
 173:         movb    (r4)+,r0
 174:         cmp     r0,$'0
 175:         blt     1f
 176:         cmp     r0,$'9
 177:         ble     numin
 178:         cmp     r0,$'a
 179:         blt     1f
 180:         cmp     r0,$'z
 181:         bgt     1f
 182:         jmp     letin
 183: 1:
 184:         cmp     r0,$'a-40
 185:         blt     1f
 186:         cmp     r0,$'z-40
 187:         ble     letin
 188: 1:
 189:         jsr     r5,switch; expsw
 190:         tstb    -(r4)
 191:         tst     starmod
 192:         beq     1f
 193:         mov     dot,taddr
 194:         br      operand
 195: 1:
 196:         rts     pc
 197: 
 198: expsw:
 199:         '+;     opex
 200:         '-;     opex
 201:         ' ;     nextxp
 202:         '.;     letin
 203:         '_;     letin
 204:         '^;     circumf
 205:         '*;     star
 206:         -1;     0
 207: 
 208: star:
 209:         mov     pc,starmod
 210:         br      nextxp
 211: 
 212: operand:
 213:         inc     adrflg
 214:         tst     starmod
 215:         beq     1f
 216:         clr     starmod
 217:         bis     bytemod,error
 218:         jsr     r5,get; taddr
 219:         tst     error
 220:         bne     1f
 221:         mov     r0,taddr
 222: 1:
 223:         cmp     lastop,$'+
 224:         beq     1f
 225:         sub     taddr,addres
 226:         br      2f
 227: 1:
 228:         add     taddr,addres
 229: 2:
 230:         mov     $'+,lastop
 231:         br      nextxp
 232: 
 233: circumf:
 234:         mov     dot,taddr
 235:         dec     taddr
 236:         tst     bytemod
 237:         bne     operand
 238:         dec     taddr
 239:         br      operand
 240: 
 241: numin:
 242:         clr     r1
 243:         clr     r3
 244: 1:
 245:         sub     $'0,r0
 246:         asl     r1
 247:         asl     r1
 248:         asl     r1
 249:         mpy     $10.,r3
 250:         bis     r0,r1
 251:         add     r0,r3
 252:         movb    (r4)+,r0
 253:         cmp     r0,$'0
 254:         blo     1f
 255:         cmp     r0,$'9
 256:         blos    1b
 257: 1:
 258:         cmp     r0,$'.
 259:         bne     1f
 260:         mov     r3,r1
 261:         inc     r4
 262: 1:
 263:         mov     r1,taddr
 264:         dec     r4
 265:         br      operand
 266: 
 267: letin:
 268:         dec     r4
 269:         mov     $nambuf,namstrt
 270: letin1:
 271:         mov     $symbol,r1
 272:         clr     (r1)+
 273:         clr     (r1)+
 274:         clr     (r1)+
 275:         clr     (r1)
 276:         mov     $symbol,r1
 277:         mov     $8.,-(sp)
 278:         br      2f
 279: 1:
 280:         tstb    (r4)+
 281:         cmpb    (r4),$'.
 282:         beq     2f
 283:         cmpb    (r4),$'0
 284:         blo     3f
 285:         cmpb    (r4),$'9
 286:         blos    2f
 287:         cmpb    (r4),$'A
 288:         blo     3f
 289:         cmpb    (r4),$'Z
 290:         blos    2f
 291:         cmpb    (r4),$'_
 292:         beq     2f
 293:         cmpb    (r4),$'a
 294:         blo     3f
 295:         cmpb    (r4),$'z
 296:         bhi     3f
 297: 2:
 298:         dec     (sp)
 299:         blt     1b
 300:         movb    (r4),(r1)+
 301:         br      1b
 302: 3:
 303:         tst     (sp)+
 304:         jsr     pc,lookupn
 305:         tst     error
 306:         bne     1f
 307:         cmpb    (r4),$';
 308:         beq     2f
 309: 1:
 310:         jmp     operand
 311: 2:
 312:         tstb    (r4)+
 313:         mov     r1,namstrt
 314:         br      letin1
 315: 
 316: opex:
 317:         mov     r0,lastop
 318:         jmp     nextxp
 319: 
 320: 
 321: command:
 322:         jsr     r5,switch; comsw
 323:         inc     error
 324:         rts     pc
 325: 
 326: comsw:
 327:         '/;     slash
 328:         '\\;    bslash
 329:         '?;     quest
 330:         '\0;    newln
 331:         '^;     circumf
 332:         '=;     equal
 333:         ':;     colon
 334:         '!;     excla
 335:         '';     squote
 336:         '";     dquote
 337:         '$;     dolr
 338:         '&;     amper
 339:         '%;     ex
 340:         '`;     grave
 341:         -1;     0
 342: 
 343: dolr:
 344:         mov     sigp,r1
 345:         bic     $!17,r1
 346:         asl     r1
 347:         mov     traptab(r1),r1
 348:         jsr     pc,string
 349:         jsr     pc,pnl
 350:         mov     $doltab,r5
 351: 1:
 352:         mov     (r5)+,r1
 353:         beq     1f
 354:         jsr     pc,*(r5)+
 355:         br      1b
 356:         .if     fpp
 357: 1:
 358:         mov     (r5)+,r1
 359:         beq     1f
 360:         ldfps   fpsr
 361:         jsr     pc,*(r5)+
 362:         br      1b
 363: 1:
 364:         mov     (r5)+,r1
 365:         jsr     pc,*(r5)+
 366:         .endif
 367: 1:
 368:         rts     pc
 369: 
 370: traptab:
 371:         1f; .data; 1:<?0\0>; .text
 372:         1f; .data; 1:<Hangup\0>; .text
 373:         1f; .data; 1:<Interrupt\0>; .text
 374:         1f; .data; 1:<Quit\0>; .text
 375:         1f; .data; 1:<Illegal instruction\0>; .text
 376:         1f; .data; 1:<Trace/BPT\0>; .text
 377:         1f; .data; 1:<IOT\0>; .text
 378:         1f; .data; 1:<EMT\0>; .text
 379:         1f; .data; 1:<FP exception\0>; .text
 380:         1f; .data; 1:<Killed\0>; .text
 381:         1f; .data; 1:<Bus error\0>; .text
 382:         1f; .data; 1:<Segmentation violation\0>; .text
 383:         1f; .data; 1:<Bad system call\0>; .text
 384:         1f; .data; 1:<?15\0>; .text
 385:         1f; .data; 1:<?16\0>; .text
 386:         1f; .data; 1:<?17\0>; .text
 387: 
 388: locps:  regbuf+1776
 389: locpc:  regbuf+1774
 390: locr0:  regbuf+1772
 391: locr1:  regbuf+1766
 392: locr2:  regbuf+1750
 393: locr3:  regbuf+1752
 394: locr4:  regbuf+1754
 395: locsp:  regbuf+1764
 396: locr5:  regbuf+1756
 397: locfpsr: regbuf+4
 398: locfr0: regbuf+6
 399: locfr4: regbuf+16
 400: locfr5: regbuf+26
 401: locfr1: regbuf+36
 402: locfr2: regbuf+46
 403: locfr3: regbuf+56
 404: 
 405: doltab:
 406:         1f; prgreg; locsp; .data; 1:<sp	\0>; .text
 407:         1f; proct; locps; .data; 1:<ps	\0>; .text
 408:         1f; prgreg; locpc; .data; 1:<pc	\0>; .text
 409:         1f; prgreg; locr0; .data; 1:<r0	\0>; .text
 410:         1f; prgreg; locr1; .data; 1:<r1	\0>; .text
 411:         1f; prgreg; locr2; .data; 1:<r2	\0>; .text
 412:         1f; prgreg; locr3; .data; 1:<r3	\0>; .text
 413:         1f; prgreg; locr4; .data; 1:<r4	\0>; .text
 414:         1f; prgreg; locr5; .data; 1:<r5	\0>; .text
 415:         0
 416:         .if     fpp
 417:         1f; prfreg; locfr0; .data; 1:<fr0	\0>; .text
 418:         1f; prfreg; locfr1; .data; 1:<fr1	\0>; .text
 419:         1f; prfreg; locfr2; .data; 1:<fr2	\0>; .text
 420:         1f; prfreg; locfr3; .data; 1:<fr3	\0>; .text
 421:         1f; prfreg; locfr4; .data; 1:<fr4	\0>; .text
 422:         1f; prfreg; locfr5; .data; 1:<fr5	\0>; .text
 423:         0
 424:         1f; proct; locfpsr; .data; 1:<fpsr	\0>; .text
 425:         .endif
 426: .data
 427: .even
 428: .text
 429: 
 430:         .if     fpp
 431: prfreg:
 432:         mov     *(r5)+,r4
 433:         movf    (r4),fr0
 434:         cfcc
 435:         beq     1f
 436:         jsr     pc,string
 437:         jsr     pc,printf
 438:         jsr     pc,pnl
 439: 1:
 440:         rts     pc
 441:         .endif
 442: 
 443: prgreg:
 444:         jsr     pc,string
 445:         mov     *(r5)+,r4
 446:         mov     (r4),r0
 447:         jsr     pc,printo
 448:         mov     (r4),r0
 449:         jsr     pc,lookupv
 450:         tst     r2
 451:         beq     1f
 452:         jsr     r5,mesg; <	\0>; .even
 453:         mov     (r4),r0
 454:         jsr     pc,pname
 455: 1:
 456:         jsr     pc,pnl
 457:         rts     pc
 458: 
 459: proct:
 460:         jsr     pc,string
 461:         mov     *(r5)+,r4
 462:         mov     (r4),r0
 463:         jsr     pc,printo
 464:         jsr     pc,pnl
 465:         rts     pc
 466: 
 467: string:
 468:         movb    (r1)+,r0
 469:         beq     1f
 470:         jsr     pc,putc
 471:         br      string
 472: 1:
 473:         rts     pc
 474: 
 475: putc:
 476:         mov     r0,och
 477:         mov     $1,r0
 478:         sys     write; och; 1
 479:         rts     pc
 480: 
 481: equal:
 482:         jsr     r5,coleq; printo
 483:         rts     pc
 484: amper:
 485:         clr     bytemod
 486:         mov     $2,incdot
 487:         jsr     r5,cycle; asymp
 488:         rts     pc
 489: 
 490: asymp:
 491:         jsr     pc,pname
 492:         jsr     pc,pnl
 493:         rts     pc
 494: 
 495: bslash:
 496:         inc     bytemod
 497:         mov     $1,incdot
 498:         br      1f
 499: 
 500: slash:
 501:         clr     bytemod
 502:         mov     $2,incdot
 503: 1:
 504:         jsr     r5,cycle; octp
 505:         rts     pc
 506: 
 507: grave:
 508:         clr     bytemod
 509:         mov     $2,incdot
 510:         jsr     r5,cycle;  decp
 511:         rts     pc
 512: 
 513: quest:
 514:         clr     bytemod
 515:         jsr     r5,cycle; psym
 516:         rts     pc
 517: 
 518: decp:
 519:         jsr     pc,printd
 520:         jsr     r5,mesg; <.\n\0>; .even
 521:         rts     pc
 522: 
 523: octp:
 524:         jsr     pc,printo
 525:         jsr     pc,pnl
 526:         rts     pc
 527: 
 528: newln:
 529:         tst     adrflg
 530:         bne     1f
 531:         add     incdot,dot
 532: 1:
 533:         mov     nlcom,r0
 534:         jmp     command
 535: 
 536: excla:
 537:         tst     adrflg
 538:         bne     1f
 539: 2:
 540:         inc     error
 541:         rts     pc
 542: 1:
 543:         bit     $1,dot
 544:         beq     1f
 545:         tst     bytemod
 546:         beq     2b
 547: 1:
 548:         jsr     r5,put; dot; addres
 549:         rts     pc
 550: 
 551: squote:
 552:         inc     bytemod
 553:         mov     $1,incdot
 554:         br      2f
 555: dquote:
 556:         clr     bytemod
 557:         mov     $2,incdot
 558: 2:
 559:         jsr     r5,cycle; ascp
 560:         rts     pc
 561: 
 562: ascp:
 563:         mov     r0,-(sp)
 564:         jsr     pc,ascp1
 565:         mov     (sp)+,r0
 566:         tst     bytemod
 567:         bne     1f
 568:         swab    r0
 569:         jsr     pc,ascp1
 570: 1:
 571:         cmp     count,$1
 572:         bgt     1f
 573:         jsr     pc,pnl
 574: 1:
 575:         rts     pc
 576: 
 577: ascp1:
 578:         bic     $!377,r0
 579:         cmp     r0,$'\n
 580:         beq     2f
 581:         cmp     r0,$011
 582:         beq     2f
 583:         cmp     r0,$40
 584:         blo     1f
 585:         cmp     r0,$177
 586:         bhis    1f
 587: 2:
 588:         jsr     pc,putc
 589:         rts     pc
 590: 1:
 591:         mov     r0,r1
 592:         jsr     r5,mesg; <\\\0>
 593:         clr     r0
 594:         alsc    $10.,r0
 595:         add     $'0,r0
 596:         jsr     pc,putc
 597:         clr     r0
 598:         alsc    $3,r0
 599:         add     $'0,r0
 600:         jsr     pc,putc
 601:         clr     r0
 602:         alsc    $3,r0
 603:         add     $'0,r0
 604:         jsr     pc,putc
 605:         rts     pc
 606: 
 607: colon:
 608:         jsr     r5,coleq; pname
 609:         rts     pc
 610: 
 611: coleq:
 612:         jsr     pc,setadr
 613:         mov     addres,r0
 614:         jsr     pc,*(r5)+
 615:         jsr     pc,pnl
 616:         rts     r5
 617: 
 618: cycle:
 619:         mov     r0,nlcom
 620:         jsr     pc,setadr
 621:         mov     addres,dot
 622:         tst     bytemod
 623:         bne     1f
 624:         bic     $1,dot
 625: 1:
 626:         jsr     r5,get; dot
 627:         tst     error
 628:         bne     1f
 629:         tst     bytemod
 630:         beq     2f
 631:         bic     $!377,r0
 632: 2:
 633:         jsr     pc,*(r5)
 634:         tst     error
 635:         bne     1f
 636:         dec     count
 637:         ble     1f
 638:         add     incdot,dot
 639:         br      1b
 640: 1:
 641:         tst     (r5)+
 642:         rts     r5
 643: 
 644: setadr:
 645:         tst     adrflg
 646:         bne     1f
 647:         mov     dot,addres
 648: 1:
 649:         rts     pc
 650: 
 651:         .if     fpp
 652: printf:
 653:         ldfps   $200            / round+double
 654:         mov     r4,-(sp)
 655:         mov     r3,-(sp)
 656:         movif   $10.,r3
 657:         movif   $1,r2
 658:         clr     r4
 659:         tstf    r0
 660:         cfcc
 661:         beq     2f
 662:         bge     1f
 663:         negf    r0
 664:         mov     $'-,r0
 665:         jsr     pc,putc
 666: 1:
 667:         cmpf    r3,r0
 668:         cfcc
 669:         bgt     1f
 670:         inc     r4
 671:         divf    r3,r0
 672:         br      1b
 673: 1:
 674:         cmpf    r2,r0
 675:         cfcc
 676:         ble     2f
 677:         dec     r4
 678:         mulf    r3,r0
 679:         br      1b
 680: 2:
 681:         modf    r2,r0
 682:         movfi   r1,r0
 683:         add     $'0,r0
 684:         jsr     pc,putc
 685:         mov     $'.,r0
 686:         jsr     pc,putc
 687:         mov     $8.,r3
 688: 1:
 689:         modf    r3,r0
 690:         movfi   r1,r0
 691:         add     $'0,r0
 692:         jsr     pc,putc
 693:         dec     r3
 694:         bgt     1b
 695:         mov     $'E,r0
 696:         jsr     pc,putc
 697:         mov     r4,r0
 698:         mov     (sp)+,r3
 699:         mov     (sp)+,r4
 700:         br      printd
 701:         .endif
 702: 
 703: printd:
 704:         mov     r1,-(sp)
 705:         mov     r0,r1
 706:         bpl     1f
 707:         neg     r1
 708:         mov     $'-,r0
 709:         jsr     pc,putc
 710: 1:
 711:         jsr     pc,1f
 712:         mov     (sp)+,r1
 713:         rts     pc
 714: 1:
 715:         clr     r0
 716:         dvd     $10.,r0
 717:         mov     r1,-(sp)
 718:         mov     r0,r1
 719:         beq     1f
 720:         jsr     pc,1b
 721: 1:
 722:         mov     (sp)+,r0
 723:         add     $'0,r0
 724:         jsr     pc,putc
 725:         rts     pc

Defined functions

amper defined in line 484; used 1 times
ascp defined in line 562; used 1 times
ascp1 defined in line 577; used 2 times
asymp defined in line 490; used 1 times
bslash defined in line 495; used 1 times
circumf defined in line 233; used 2 times
coleq defined in line 611; used 2 times
colon defined in line 607; used 1 times
command defined in line 321; used 2 times
comsw defined in line 326; used 1 times
cycle defined in line 618; used 5 times
db defined in line 8; never used
dbfile defined in line 21; used 1 times
  • in line 14
decp defined in line 518; used 1 times
dolr defined in line 343; used 1 times
doltab defined in line 405; used 1 times
dquote defined in line 555; used 1 times
eae defined in line 4; never used
equal defined in line 481; used 1 times
errexit defined in line 127; used 4 times
ex defined in line 135; used 2 times
excla defined in line 536; used 1 times
expsw defined in line 198; used 1 times
fnfnd defined in line 133; used 1 times
  • in line 23
fpp defined in line 3; used 4 times
grave defined in line 507; used 1 times
letin defined in line 267; used 4 times
letin1 defined in line 270; used 1 times
locfpsr defined in line 397; used 2 times
locfr0 defined in line 398; used 1 times
locfr1 defined in line 401; used 1 times
locfr2 defined in line 402; used 1 times
locfr3 defined in line 403; used 1 times
locfr4 defined in line 399; used 1 times
locfr5 defined in line 400; used 1 times
locpc defined in line 389; used 1 times
locps defined in line 388; used 1 times
locr0 defined in line 390; used 1 times
locr1 defined in line 391; used 1 times
locr2 defined in line 392; used 1 times
locr3 defined in line 393; used 1 times
locr4 defined in line 394; used 1 times
locr5 defined in line 396; used 1 times
locsp defined in line 395; used 1 times
loop defined in line 104; used 3 times
namfil defined in line 31; used 2 times
newln defined in line 528; used 1 times
nextxp defined in line 172; used 4 times
numin defined in line 241; used 1 times
octp defined in line 523; used 1 times
odbfil defined in line 27; used 1 times
  • in line 15
operand defined in line 212; used 5 times
opex defined in line 316; used 2 times
prfreg defined in line 431; used 6 times
prgreg defined in line 443; used 8 times
printd defined in line 703; used 2 times
printf defined in line 652; used 1 times
proct defined in line 459; used 2 times
putc defined in line 475; used 12 times
quest defined in line 513; used 1 times
readexp defined in line 166; used 2 times
readlin defined in line 138; used 1 times
setadr defined in line 644; used 2 times
slash defined in line 500; used 1 times
squote defined in line 551; used 1 times
star defined in line 208; used 1 times
string defined in line 467; used 5 times
switch defined in line 154; used 2 times
traptab defined in line 370; used 1 times
Last modified: 1975-05-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 639
Valid CSS Valid XHTML 1.0 Strict