1: / 2: / 3: 4: / a4 -- pdp-11 assembler pass1 5: 6: rname: 7: mov r1,-(sp) 8: mov r2,-(sp) 9: mov r3,-(sp) 10: mov $8,r5 11: mov $symbol+8.,r2 12: clr -(r2) 13: clr -(r2) 14: clr -(r2) 15: clr -(r2) 16: clr -(sp) 17: clr -(sp) 18: cmp r0,$'~ / symbol not for hash table 19: bne 1f 20: inc 2(sp) 21: clrb ch 22: 1: 23: jsr pc,rch 24: movb chartab(r0),r3 25: ble 1f 26: add r3,(sp) 27: swab (sp) 28: dec r5 29: blt 1b 30: movb r3,(r2)+ 31: br 1b 32: 1: 33: movb r0,ch 34: mov (sp)+,r1 35: clr r0 36: tst (sp)+ 37: beq 1f 38: mov symend,r4 39: br 4f 40: 1: 41: div $hshsiz,r0 42: ashc $1,r0 43: add $hshtab,r1 44: clr timesaround 45: 1: 46: sub r0,r1 47: cmp r1,$hshtab 48: bhi 2f 49: add $2*hshsiz,r1 50: tst timesaround 51: beq 3f 52: mov $1,r0 53: sys write; 9f; 8f-9f 54: jmp aexit 55: .data 56: timesaround: 57: .=.+2 58: 9: <as: symbol table overflow\n>; 8: .even 59: .text 60: 3: 61: inc timesaround 62: 2: 63: mov $symbol,r2 64: mov -(r1),r4 65: beq 3f 66: cmp (r2)+,(r4)+ 67: bne 1b 68: cmp (r2)+,(r4)+ 69: bne 1b 70: cmp (r2)+,(r4)+ 71: bne 1b 72: cmp (r2)+,(r4)+ 73: bne 1b 74: br 1f 75: 3: 76: mov symend,r4 77: mov r4,(r1) 78: 4: 79: mov $symbol,r2 80: mov r4,-(sp) 81: add $20,r4 82: cmp r4,0f 83: blos 4f 84: add $512.,0f 85: sys indir; 9f 86: .data 87: 9: sys break; 0:end 88: .text 89: 4: 90: mov (sp)+,r4 91: mov (r2)+,(r4)+ 92: mov (r2)+,(r4)+ 93: mov (r2)+,(r4)+ 94: mov (r2)+,(r4)+ 95: clr (r4)+ 96: clr (r4)+ 97: mov r4,symend 98: sub $4,r4 99: 1: 100: mov r4,-(sp) 101: mov r4,r3 102: sub $8,r3 103: cmp r3,$usymtab 104: blo 1f 105: sub $usymtab,r3 106: clr r2 107: div $3,r2 108: mov r2,r4 109: add $4000,r4 / user symbol 110: br 2f 111: 1: 112: sub $symtab,r3 113: clr r2 114: div $3,r2 115: mov r2,r4 116: add $1000,r4 / builtin symbol 117: 2: 118: jsr pc,putw 119: mov (sp)+,r4 120: mov (sp)+,r3 121: mov (sp)+,r2 122: mov (sp)+,r1 123: tst (sp)+ 124: rts pc 125: 126: number: 127: mov r2,-(sp) 128: mov r3,-(sp) 129: mov r5,-(sp) 130: clr r1 131: clr r5 132: 1: 133: jsr pc,rch 134: jsr r5,betwen; '0; '9 135: br 1f 136: sub $'0,r0 137: mpy $10.,r5 138: add r0,r5 139: als $3,r1 140: add r0,r1 141: br 1b 142: 1: 143: cmp r0,$'b 144: beq 1f 145: cmp r0,$'f 146: beq 1f 147: cmp r0,$'. 148: bne 2f 149: mov r5,r1 150: clr r0 151: 2: 152: movb r0,ch 153: mov r1,r0 154: mov (sp)+,r5 155: mov (sp)+,r3 156: mov (sp)+,r2 157: rts pc 158: 1: 159: mov r0,r3 160: mov r5,r0 161: jsr pc,fbcheck 162: add $141,r0 163: cmp r3,$'b 164: beq 1f 165: add $10.,r0 166: 1: 167: mov r0,r4 168: mov (sp)+,r5 169: mov (sp)+,r3 170: mov (sp)+,r2 171: add $2,(sp) 172: rts pc 173: 174: rch: 175: movb ch,r0 176: beq 1f 177: clrb ch 178: rts pc 179: 1: 180: dec inbfcnt 181: blt 2f 182: movb *inbfp,r0 183: inc inbfp 184: bic $!177,r0 185: beq 1b 186: rts pc 187: 2: 188: movb fin,r0 189: beq 3f 190: sys read; inbuf;512. 191: bcs 2f 192: tst r0 193: beq 2f 194: mov r0,inbfcnt 195: mov $inbuf,inbfp 196: br 1b 197: 2: 198: movb fin,r0 199: clrb fin 200: sys close 201: 3: 202: decb nargs 203: bgt 2f 204: mov $'\e,r0 205: rts pc 206: 2: 207: tst ifflg 208: beq 2f 209: jsr r5,error; 'i 210: jmp aexit 211: 2: 212: mov curarg,r0 213: tst (r0)+ 214: mov (r0),0f 215: mov r0,curarg 216: incb fileflg 217: sys indir; 9f 218: .data 219: 9: sys open; 0:0; 0 220: .text 221: bec 2f 222: mov 0b,r0 223: jsr r5,filerr; <?\n> 224: jmp aexit 225: 2: 226: movb r0,fin 227: mov $1,line 228: mov r4,-(sp) 229: mov r1,-(sp) 230: mov $5,r4 231: jsr pc,putw 232: mov *curarg,r1 233: 2: 234: movb (r1)+,r4 235: beq 2f 236: jsr pc,putw 237: br 2b 238: 2: 239: mov $-1,r4 240: jsr pc,putw 241: mov (sp)+,r1 242: mov (sp)+,r4 243: br 1b