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