1: /
   2: /
   3: 
   4: / a4 -- pdp-11 assembler pass 2
   5: 
   6: oset:
   7:         mov     r2,-(sp)
   8:         mov     r3,-(sp)
   9:         mov     (r5)+,r3
  10:         mov     r1,r2
  11:         bic     $!777,r1
  12:         add     r3,r1
  13:         add     $8,r1
  14:         mov     r1,(r3)+        / next slot
  15:         mov     r3,r1
  16:         add     $1006,r1
  17:         mov     r1,(r3)+        / buf max
  18:         mov     r0,(r3)+
  19:         mov     r2,(r3)+        / seek addr
  20:         mov     (sp)+,r3
  21:         mov     (sp)+,r2
  22:         rts     r5
  23: 
  24: putw:
  25:         mov     r1,-(sp)
  26:         mov     r2,-(sp)
  27:         mov     (r5)+,r2
  28:         mov     (r2)+,r1        / slot
  29:         cmp     r1,(r2)         / buf max
  30:         bhis    1f
  31:         mov     r0,(r1)+
  32:         mov     r1,-(r2)
  33:         br      2f
  34: 1:
  35:         tst     (r2)+
  36:         mov     r0,-(sp)
  37:         jsr     r5,flush1
  38:         mov     (sp)+,r0
  39:         mov     r0,*(r2)+
  40:         add     $2,-(r2)
  41: 2:
  42:         mov     (sp)+,r2
  43:         mov     (sp)+,r1
  44:         rts     r5
  45: 
  46: flush:
  47:         mov     (r5)+,r2
  48:         cmp     (r2)+,(r2)+
  49: flush1:
  50:         mov     (r2)+,0f
  51:         mov     (r2)+,r1
  52:         mov     r1,0f+2         / seek address
  53:         mov     fout,r0
  54:         sys     indir; 9f
  55:         .data
  56: 9:      sys     lseek; 0:..; ..; 0
  57:         .text
  58:         bic     $!777,r1
  59:         add     r2,r1           / write address
  60:         mov     r1,0f
  61:         mov     r2,r0
  62:         bis     $777,-(r2)
  63:         add     $1,(r2)         / new seek addr
  64:         adc     -(r2)
  65:         cmp     -(r2),-(r2)
  66:         sub     (r2),r1
  67:         neg     r1
  68:         mov     r1,0f+2         / count
  69:         mov     r0,(r2)         / new next slot
  70:         mov     fout,r0
  71:         sys     indir; 9f
  72:         jes     wrterr
  73:         .data
  74: 9:      sys     write; 0:..; ..
  75:         .text
  76:         rts     r5
  77: 
  78: wrterr:
  79:         mov     $1,r0
  80:         sys     write; 9f; 8f-9f
  81:         jmp     saexit
  82: 9:      <as: write error on output\n>; 8:
  83: 
  84: readop:
  85:         mov     savop,r4
  86:         beq     1f
  87:         clr     savop
  88:         rts     pc
  89: 1:
  90:         jsr     pc,getw1
  91:         cmp     r4,$200
  92:         blo     1f
  93:         cmp     r4,$4000
  94:         blo     2f
  95:         add     $usymtab-4000,r4
  96:         rts     pc
  97: 2:
  98:         add     $symtab-1000,r4
  99: 1:
 100:         rts     pc
 101: 
 102: getw:
 103:         mov     savop,r4
 104:         beq     getw1
 105:         clr     savop
 106:         rts     pc
 107: getw1:
 108:         dec     ibufc
 109:         bgt     1f
 110:         movb    fin,r0
 111:         sys     read; inbuf; 512.
 112:         bes     3f
 113:         asr     r0
 114:         mov     r0,ibufc
 115:         bne     2f
 116: 3:
 117:         mov     $4,r4
 118:         sev
 119:         rts     pc
 120: 2:
 121:         mov     $inbuf,ibufp
 122: 1:
 123:         mov     *ibufp,r4
 124:         add     $2,ibufp
 125:         rts     pc

Defined functions

flush defined in line 46; never used
flush1 defined in line 49; used 1 times
  • in line 37
getw defined in line 102; never used
getw1 defined in line 107; used 2 times
oset defined in line 6; never used
putw defined in line 24; never used
readop defined in line 84; never used
wrterr defined in line 78; used 1 times
  • in line 72
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 483
Valid CSS Valid XHTML 1.0 Strict