1: signal = 48.
   2: testing = 0
   3: /	form letter generator
   4: /	command sequence
   5: /		form proto arg1 arg2...
   6: /			where proto is letter
   7: rfo:
   8:         sys     signal; 2; int
   9:         mov     $-1,buf
  10:         mov     (sp)+,r2        /arg count
  11:         tst     (sp)+           /skip first arg
  12:         sub     $2,r2
  13:         bge     2f
  14:         mov     $default,-(sp)
  15: 2:
  16:         mov     (sp)+,letter
  17: 
  18: 1:      sys     stat; otfil; buf
  19:         bec     2f
  20:         sys     creat; otfil; 666
  21:         bec     cont
  22: 2:      cmpb    $'z,otfil+4
  23:         beq     err3
  24:         incb    otfil+4
  25:         br      1b
  26: 
  27: err3:
  28:         mov     $1,r0
  29:         sys     write; mes3; 24.
  30:         sys     exit
  31: mes3:   <cannot open output file\n>
  32: otfil:  <forma\0>
  33: default:        <letter\0>
  34:         .even
  35: 
  36: cont:   mov     r0,rfo
  37:         clr     rfo+2
  38:         jsr     pc,initl
  39: 
  40: /	set up argument list
  41: /
  42:         mov     $arg,r3
  43:         mov     $10.,r0
  44:         jsr     pc,allocate
  45:         mov     r1,(r3)+
  46: 1:
  47:         dec     r2
  48:         blt     1f
  49:         mov     $10.,r0
  50:         jsr     pc,allocate
  51:         mov     r1,(r3)+
  52:         mov     (sp)+,r4
  53: 2:
  54:         movb    (r4)+,r0
  55:         beq     1b
  56:         jsr     pc,putchar
  57:         br      2b
  58: 
  59: 1:
  60:         sys     time
  61:         ashc    $-7,r0
  62:         div     $675.,r0
  63:         mov     $daytab,r2
  64:         sub     $1461.,r0
  65: 
  66: 1:      sub     (r2)+,r0
  67:         bge     1b
  68:         add     -(r2),r0
  69:         mov     r0,-(sp)
  70:         mov     arg,r1
  71:         mov     montab-daytab(r2),r2
  72: 1:
  73:         movb    (r2)+,r0
  74:         beq     1f
  75:         jsr     pc,putchar
  76:         br      1b
  77: 1:
  78:         movb    $' ,r0
  79:         jsr     pc,putchar
  80:         clr     r0
  81:         mov     (sp),r1
  82:         inc     r1
  83:         div     $10.,r0
  84:         mov     r1,(sp)
  85:         mov     arg,r1
  86:         tst     r0
  87:         beq     1f
  88:         add     $'0,r0
  89:         jsr     pc,putchar
  90: 1:
  91:         mov     (sp)+,r0
  92:         add     $'0,r0
  93:         jsr     pc,putchar
  94:         jmp     loop
  95: 
  96: daytab: 31.; 28.; 31.; 30.; 31.; 30.; 31.; 31.; 30.; 31.; 30.; 999.
  97: 
  98: montab: m1; m2; m3; m4; m5; m6; m7; m8; m9; m10; m11; m12
  99: 
 100: m1:     <January\0>
 101: m2:     <February\0>
 102: m3:     <March\0>
 103: m4:     <April\0>
 104: m5:     <May\0>
 105: m6:     <June\0>
 106: m7:     <July\0>
 107: m8:     <August\0>
 108: m9:     <September\0>
 109: m10:    <October\0>
 110: m11:    <November\0>
 111: m12:    <December\0>
 112: 
 113: buf:    .=.+34.
 114: .=rfo+516.
 115: 
 116: loop:
 117:         mov     $10.,r0
 118:         jsr     pc,allocate
 119:         mov     r1,opointer
 120:         jsr     pc,allocate
 121:         mov     r1,ipointer
 122:         jsr     pc,allocate
 123:         mov     r1,curly
 124:         mov     $10.,r0
 125:         jsr     pc,allocate
 126:         mov     r1,scr
 127:         mov     letter,r3
 128:         movb    $'\{,r0
 129:         jsr     pc,putchar
 130: 1:
 131:         movb    (r3)+,r0
 132:         beq     1f
 133:         jsr     pc,putchar
 134:         br      1b
 135: 1:
 136:         movb    $'\},r0
 137:         jsr     pc,putchar
 138: 
 139:         clr     switch
 140: 
 141:         tst     iflag
 142:         beq     1f
 143:         mov     $1,tflag
 144:         jmp     interrupt
 145: 1:
 146:         jsr     pc,scan
 147: 
 148:         movb    $'\n,r0
 149:         jsr     r5,putc
 150:         jsr     r5,flushb
 151: 
 152:         mov     scr,r1
 153:         jsr     pc,release
 154:         jsr     pc,relarg
 155:         mov     opointer,r1
 156:         jsr     pc,release
 157:         mov     ipointer,r1
 158:         jsr     pc,release
 159:         jsr     pc,relcurl
 160:         jsr     pc,flush
 161:         jsr     pc,whead
 162:         .if     testing
 163:         4
 164:         .endif
 165:         sys     exit

Defined functions

buf defined in line 113; used 2 times
  • in line 9, 18
cont defined in line 36; used 1 times
  • in line 21
daytab defined in line 96; used 2 times
default defined in line 33; used 1 times
  • in line 14
err3 defined in line 27; used 1 times
  • in line 23
loop defined in line 116; used 1 times
  • in line 94
m1 defined in line 100; used 1 times
  • in line 98
m10 defined in line 109; used 1 times
  • in line 98
m11 defined in line 110; used 1 times
  • in line 98
m12 defined in line 111; used 1 times
  • in line 98
m2 defined in line 101; used 1 times
  • in line 98
m3 defined in line 102; used 1 times
  • in line 98
m4 defined in line 103; used 1 times
  • in line 98
m5 defined in line 104; used 1 times
  • in line 98
m6 defined in line 105; used 1 times
  • in line 98
m7 defined in line 106; used 1 times
  • in line 98
m8 defined in line 107; used 1 times
  • in line 98
m9 defined in line 108; used 1 times
  • in line 98
mes3 defined in line 31; used 1 times
  • in line 29
montab defined in line 98; used 1 times
  • in line 71
otfil defined in line 32; used 4 times
rfo defined in line 7; used 3 times
signal defined in line 1; used 1 times
  • in line 8
testing defined in line 2; used 1 times
Last modified: 1975-05-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 716
Valid CSS Valid XHTML 1.0 Strict