1: / 2: / 3: 4: / a2 -- pdp-11 assembler pass 2 5: 6: outw: 7: cmp dot-2,$4 8: beq 9f 9: bit $1,dot 10: bne 1f 11: add $2,dot 12: tstb passno 13: beq 8f 14: clr -(sp) 15: rol r3 16: adc (sp) 17: asr r3 / get relative pc bit 18: cmp r3,$40 19: bne 2f 20: / external references 21: mov $666,outmod / make nonexecutable 22: mov xsymbol,r3 23: sub $usymtab,r3 24: asl r3 25: bis $4,r3 / external relocation 26: br 3f 27: 2: 28: bic $40,r3 / clear any ext bits 29: cmp r3,$5 30: blo 4f 31: cmp r3,$33 / est. text, data 32: beq 6f 33: cmp r3,$34 34: bne 7f 35: 6: 36: jsr r5,error; 'r 37: 7: 38: mov $1,r3 / make absolute 39: 4: 40: cmp r3,$2 41: blo 5f 42: cmp r3,$4 43: bhi 5f 44: tst (sp) 45: bne 4f 46: add dotdot,r2 47: br 4f 48: 5: 49: tst (sp) 50: beq 4f 51: sub dotdot,r2 52: 4: 53: dec r3 54: bpl 3f 55: clr r3 56: 3: 57: asl r3 58: bis (sp)+,r3 59: mov r2,r0 60: jsr r5,putw; txtp 61: mov tseekp,r0 62: add $2,2(r0) 63: adc (r0) 64: mov r3,r0 65: jsr r5,putw; relp 66: mov rseekp,r0 67: add $2,2(r0) 68: adc (r0) 69: 8: 70: rts pc 71: 1: 72: jsr r5,error; 'o 73: clr r3 74: jsr pc,outb 75: rts pc 76: 77: 9: 78: jsr r5,error; 'x 79: rts pc 80: 81: outb: 82: cmp dot-2,$4 / test bss mode 83: beq 9b 84: cmp r3,$1 85: blos 1f 86: jsr r5,error; 'r 87: 1: 88: tstb passno 89: beq 2f 90: mov r2,r0 91: bit $1,dot 92: bne 1f 93: jsr r5,putw; txtp 94: clr r0 95: jsr r5,putw; relp 96: mov tseekp,r0 97: add $2,2(r0) 98: adc (r0) 99: mov rseekp,r0 100: add $2,2(r0) 101: adc (r0) 102: br 2f 103: 1: 104: mov txtp,r0 105: movb r2,-1(r0) 106: 2: 107: inc dot 108: rts pc 109: 110: error: 111: mov pc,errflg 112: mov $666,outmod / make nonexecutable 113: mov r3,-(sp) 114: mov r2,-(sp) 115: mov r1,-(sp) 116: mov r0,-(sp) 117: mov $argb,r1 118: 1: 119: movb (r1),ch 120: beq 1f 121: clrb (r1)+ 122: mov $1,r0 123: sys write; ch; 1 124: br 1b 125: 1: 126: mov (r5)+,r0 127: movb r0,0f 128: mov line,r3 129: mov $0f+6,r0 130: mov $4,r1 131: 2: 132: clr r2 133: dvd $10.,r2 134: add $'0,r3 135: movb r3,-(r0) 136: mov r2,r3 137: sob r1,2b 138: mov $1,r0 139: sys write; 0f; 7 140: mov (sp)+,r0 141: mov (sp)+,r1 142: mov (sp)+,r2 143: mov (sp)+,r3 144: rts r5 145: 146: .data 147: 0: <f xxxx\n> 148: .even 149: .text 150: 151: betwen: 152: cmp r0,(r5)+ 153: blt 1f 154: cmp (r5)+,r0 155: blt 2f 156: 1: 157: tst (r5)+ 158: 2: 159: rts r5