1: / 2: / 3: 4: / fx2 -- error setting and printing 5: 6: .globl error 7: .globl perror 8: 9: .globl tput 10: .globl tdecml 11: 12: error: 13: inc nerror 14: mov r0,-(sp) 15: mov r2,-(sp) 16: mov (r5)+,r0 17: mov $errb,r2 18: 1: 19: cmp r2,errp 20: bhis 1f 21: cmp r0,(r2)+ 22: beq 2f 23: tst (r2)+ 24: br 1b 25: 1: 26: cmp r2,$eerrb 27: bhis 2f 28: mov r0,(r2)+ 29: mov r1,(r2) 30: dec (r2)+ / r1 is often 1 too far 31: mov r2,errp 32: 2: 33: mov (sp)+,r2 34: mov (sp)+,r0 35: rts r5 36: 37: perror: 38: cmp errp,$errb 39: beq 1f 40: mov r1,-(sp) 41: mov r2,-(sp) 42: mov ifno,r0 43: jsr r5,tdecml 44: mov $'\t,r0 45: jsr r5,tput 46: mov $line,r1 47: 2: 48: movb (r1),r0 49: beq 2f 50: jsr r5,tput 51: mov $errb+2,r2 52: 3: 53: cmp r1,(r2)+ 54: bne 4f 55: mov $1,r0 56: sys write; mes2; 2 / bs, _ 57: br 3f 58: 4: 59: cmp r2,errp 60: blo 3b 61: 3: 62: inc r1 63: br 2b 64: 2: 65: mov $errb,r1 66: 2: 67: mov $1,r0 68: sys write; mes1; 4 69: 3: 70: sys open; errfil; 0 71: bec 3f 72: mov (r1)+,r0 73: tst (r1)+ 74: jsr r5,tdecml 75: cmp r1,errp 76: bhis 2f 77: mov $',,r0 78: jsr r5,tput 79: br 3b 80: 3: 81: mov r0,-(sp) 82: mov (r1)+,r2 83: tst (r1)+ 84: 3: 85: dec r2 86: ble 3f 87: 4: 88: mov (sp),r0 89: sys read; ich; 1 90: bes 4f 91: tst r0 92: beq 4f 93: cmpb ich,$'\n 94: bne 4b 95: br 3b 96: 3: 97: mov (sp),r0 98: sys read; ich; 1 99: bes 4f 100: tst r0 101: beq 4f 102: movb ich,r0 103: cmp r0,$'\n 104: beq 3f 105: jsr r5,tput 106: br 3b 107: 4: 108: mov $1,r0 109: sys write; mes3; 18. 110: 3: 111: mov (sp)+,r0 112: sys close 113: cmp r1,$errp 114: blo 2b 115: 2: 116: mov $'\n,r0 117: jsr r5,tput 118: mov $errb,errp 119: mov (sp)+,r2 120: mov (sp)+,r1 121: 1: 122: rts r5 123: 124: mes1: 125: <\n** > 126: mes2: 127: .byte 010, '_ 128: mes3: 129: <Unknown diagnostic> 130: errfil: 131: </usr/fort/errors\0> 132: .even 133: .bss 134: ich: .=.+2