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