1: / 2: / 3: 4: / a6 -- pdp-11 assembler pass 2 5: 6: opline: 7: mov r4,r0 8: jsr r5,betwen; 0; 177 9: br 2f 10: cmp r4,$5 11: beq opeof 12: cmp r4,$'< 13: bne xpr 14: jmp opl17 15: xxpr: 16: tst (sp)+ 17: xpr: 18: jsr pc,expres 19: jsr pc,outw 20: rts pc 21: 2: 22: movb (r4),r0 23: cmp r0,$24 /reg 24: beq xpr 25: cmp r0,$33 /est text 26: beq xpr 27: cmp r0,$34 / est data 28: beq xpr 29: jsr r5,betwen; 5; 36 30: br xpr 31: mov 2(r4),-(sp) 32: mov r0,-(sp) 33: jsr pc,readop 34: mov (sp)+,r0 35: asl r0 36: mov $adrbuf,r5 37: clr swapf 38: mov $-1,rlimit 39: jmp *1f-10.(r0) 40: 41: 1: 42: opl5 43: opl6 44: opl7 45: opl10 46: opl11 47: opl12 48: opl13 49: opl14 50: opl15 51: opl16 52: opl17 53: opl20 54: opl21 55: opl22 56: opl23 57: xxpr 58: opl25 59: opl26 60: opl27 61: opl30 62: opl31 63: opl32 64: xxpr 65: xxpr 66: opl35 67: opl36 68: 69: opeof: 70: mov $1,line 71: mov $20,-(sp) 72: mov $argb,r1 73: 1: 74: jsr pc,getw 75: tst r4 76: bmi 1f 77: movb r4,(r1)+ 78: dec (sp) 79: bgt 1b 80: tstb -(r1) 81: br 1b 82: 1: 83: movb $'\n,(r1)+ 84: clrb (r1)+ 85: tst (sp)+ 86: rts pc 87: 88: opl30: / mpy, dvd etc 89: inc swapf 90: mov $1000,rlimit 91: br opl13 92: 93: opl14: / flop freg,fsrc 94: inc swapf 95: 96: opl5: / flop src,freg 97: mov $400,rlimit 98: 99: /double 100: opl13: 101: jsr pc,addres 102: op2a: 103: mov r2,-(sp) 104: jsr pc,readop 105: op2b: 106: jsr pc,addres 107: tst swapf 108: beq 1f 109: mov (sp),r0 110: mov r2,(sp) 111: mov r0,r2 112: 1: 113: swab (sp) 114: asr (sp) 115: asr (sp) 116: cmp (sp),rlimit 117: blo 1f 118: jsr r5,error; 'x 119: 1: 120: bis (sp)+,r2 121: bis (sp)+,r2 122: clr r3 123: jsr pc,outw 124: mov $adrbuf,r1 125: 1: 126: cmp r1,r5 127: bhis 1f 128: mov (r1)+,r2 129: mov (r1)+,r3 130: mov (r1)+,xsymbol 131: jsr pc,outw 132: br 1b 133: 1: 134: rts pc 135: 136: opl15: / single operand 137: clr -(sp) 138: br op2b 139: 140: opl12: / movf 141: mov $400,rlimit 142: jsr pc,addres 143: cmp r2,$4 / see if source is fregister 144: blo 1f 145: inc swapf 146: br op2a 147: 1: 148: mov $174000,(sp) 149: br op2a 150: 151: / jbr 152: opl35: 153: / jeq, jne, etc 154: opl36: 155: jsr pc,expres 156: tstb passno 157: bne 1f 158: mov r2,r0 159: jsr pc,setbr 160: tst r2 161: beq 2f 162: cmp (sp),$br 163: beq 2f 164: add $2,r2 165: 2: 166: add r2,dot / if doesn't fit 167: add $2,dot 168: tst (sp)+ 169: rts pc 170: 1: 171: jsr pc,getbr 172: bcc dobranch 173: mov (sp)+,r0 174: mov r2,-(sp) 175: mov r3,-(sp) 176: cmp r0,$br 177: beq 2f 178: mov $402,r2 179: xor r0,r2 / flip cond, add ".+6" 180: mov $1,r3 181: jsr pc,outw 182: 2: 183: mov $1,r3 184: mov $jmp+37,r2 185: jsr pc,outw 186: mov (sp)+,r3 187: mov (sp)+,r2 188: jsr pc,outw 189: rts pc 190: 191: /sob 192: opl31: / sob 193: jsr pc,expres 194: jsr pc,checkreg 195: swab r2 196: asr r2 197: asr r2 198: bis r2,(sp) 199: jsr pc,readop 200: jsr pc,expres 201: tstb passno 202: beq 3f 203: sub dot,r2 204: neg r2 205: mov r2,r0 206: jsr r5,betwen; -2; 175 207: br 2f 208: add $4,r2 209: br 1f 210: 211: /branch 212: opl6: 213: jsr pc,expres 214: tstb passno 215: beq 3f 216: dobranch: 217: sub dot,r2 218: mov r2,r0 219: jsr r5,betwen; -254.; 256. 220: br 2f 221: 1: 222: bit $1,r2 223: bne 2f 224: cmp r3,dot-2 / same relocation as . 225: bne 2f 226: asr r2 227: dec r2 228: bic $177400,r2 229: 3: 230: bis (sp)+,r2 231: clr r3 232: jsr pc,outw 233: rts pc 234: 2: 235: jsr r5,error; 'b 236: clr r2 237: br 3b 238: 239: /jsr 240: opl7: 241: jsr pc,expres 242: jsr pc,checkreg 243: jmp op2a 244: 245: / rts 246: opl10: 247: jsr pc,expres 248: jsr pc,checkreg 249: br 1f 250: 251: / sys, emt etc 252: opl11: 253: jsr pc,expres 254: cmp r2,$256. 255: bhis 0f 256: cmp r3,$1 257: ble 1f 258: 0: 259: jsr pc,errora 260: 1: 261: bis (sp)+,r2 262: jsr pc,outw 263: rts pc 264: 265: / .byte 266: opl16: 267: jsr pc,expres 268: jsr pc,outb 269: cmp r4,$', 270: bne 1f 271: jsr pc,readop 272: br opl16 273: 1: 274: tst (sp)+ 275: rts pc 276: 277: / < (.ascii) 278: opl17: 279: jsr pc,getw 280: mov $1,r3 281: mov r4,r2 282: bmi 2f 283: bic $!377,r2 284: jsr pc,outb 285: br opl17 286: 2: 287: jsr pc,getw 288: rts pc 289: 290: /.even 291: opl20: 292: bit $1,dot 293: beq 1f 294: cmp dot-2,$4 295: beq 2f / bss mode 296: clr r2 297: clr r3 298: jsr pc,outb 299: br 1f 300: 2: 301: inc dot 302: 1: 303: tst (sp)+ 304: rts pc 305: opl21: /if 306: jsr pc,expres 307: opl22: 308: oplret: 309: tst (sp)+ 310: rts pc 311: 312: 313: /.globl 314: opl23: 315: cmp r4,$200 316: blo 1f 317: bisb $40,(r4) 318: jsr pc,readop 319: cmp r4,$', 320: bne 1f 321: jsr pc,readop 322: br opl23 323: 1: 324: tst (sp)+ 325: rts pc 326: 327: / .text, .data, .bss 328: opl25: 329: opl26: 330: opl27: 331: inc dot 332: bic $1,dot 333: mov r0,-(sp) 334: mov dot-2,r1 335: asl r1 336: mov dot,savdot-4(r1) 337: tstb passno 338: beq 1f 339: jsr r5,flush; txtp 340: jsr r5,flush; relp 341: mov (sp),r2 342: asl r2 343: add $txtseek-[4*25],r2 344: mov r2,tseekp 345: mov (r2),r0 346: mov 2(r2),r1 347: jsr r5,oset; txtp 348: add $trelseek-txtseek,r2 349: mov (r2),r0 350: mov 2(r2),r1 351: mov r2,rseekp 352: jsr r5,oset; relp 353: 1: 354: mov (sp)+,r0 355: mov savdot-[2*25](r0),dot 356: asr r0 357: sub $25-2,r0 358: mov r0,dot-2 / new . relocation 359: tst (sp)+ 360: rts pc 361: 362: opl32: 363: cmp r4,$200 364: blo 1f 365: mov r4,-(sp) 366: jsr pc,readop 367: jsr pc,readop 368: jsr pc,expres 369: mov (sp)+,r0 370: bit $37,(r0) 371: bne 1f 372: bis $40,(r0) 373: mov r2,2(r0) 374: 1: 375: tst (sp)+ 376: rts pc 377: 378: addres: 379: clr -(sp) 380: 4: 381: cmp r4,$'( 382: beq alp 383: cmp r4,$'- 384: beq amin 385: cmp r4,$'$ 386: beq adoll 387: cmp r4,$'* 388: bne getx 389: jmp astar 390: getx: 391: jsr pc,expres 392: cmp r4,$'( 393: bne 2f 394: jsr pc,readop 395: mov r2,(r5)+ 396: mov r3,(r5)+ 397: mov xsymbol,(r5)+ 398: jsr pc,expres 399: jsr pc,checkreg 400: jsr pc,checkrp 401: bis $60,r2 402: bis (sp)+,r2 403: rts pc 404: 405: 2: 406: cmp r3,$24 407: bne 1f 408: jsr pc,checkreg 409: bis (sp)+,r2 410: rts pc 411: 1: 412: mov r3,-(sp) 413: bic $40,r3 414: mov (sp)+,r3 415: bis $100000,r3 416: sub dot,r2 417: sub $4,r2 418: cmp r5,$adrbuf 419: beq 1f 420: sub $2,r2 421: 1: 422: mov r2,(r5)+ / index 423: mov r3,(r5)+ / index reloc. 424: mov xsymbol,(r5)+ / index global 425: mov $67,r2 / address mode 426: bis (sp)+,r2 427: rts pc 428: 429: alp: 430: jsr pc,readop 431: jsr pc,expres 432: jsr pc,checkrp 433: jsr pc,checkreg 434: cmp r4,$'+ 435: beq 1f 436: tst (sp)+ 437: beq 2f 438: bis $70,r2 439: clr (r5)+ 440: clr (r5)+ 441: mov xsymbol,(r5)+ 442: rts pc 443: 2: 444: bis $10,r2 445: rts pc 446: 1: 447: jsr pc,readop 448: bis $20,r2 449: bis (sp)+,r2 450: rts pc 451: 452: amin: 453: jsr pc,readop 454: cmp r4,$'( 455: beq 1f 456: mov r4,savop 457: mov $'-,r4 458: br getx 459: 1: 460: jsr pc,readop 461: jsr pc,expres 462: jsr pc,checkrp 463: jsr pc,checkreg 464: bis (sp)+,r2 465: bis $40,r2 466: rts pc 467: 468: adoll: 469: jsr pc,readop 470: jsr pc,expres 471: mov r2,(r5)+ 472: mov r3,(r5)+ 473: mov xsymbol,(r5)+ 474: mov (sp)+,r2 475: bis $27,r2 476: rts pc 477: 478: astar: 479: tst (sp) 480: beq 1f 481: jsr r5,error; '* 482: 1: 483: mov $10,(sp) 484: jsr pc,readop 485: jmp 4b 486: 487: errora: 488: jsr r5,error; 'a 489: rts pc 490: 491: checkreg: 492: cmp r2,$7 493: bhi 1f 494: cmp r1,$1 495: blos 2f 496: cmp r3,$5 497: blo 1f 498: 2: 499: rts pc 500: 1: 501: jsr pc,errora 502: clr r2 503: clr r3 504: rts pc 505: 506: errore: 507: jsr r5,error; 'e 508: rts pc 509: 510: checkrp: 511: cmp r4,$') 512: beq 1f 513: jsr r5,error; ') 514: rts pc 515: 1: 516: jsr pc,readop 517: rts pc 518: 519: setbr: 520: mov brtabp,r1 521: cmp r1,$brlen 522: blt 1f 523: mov $2,r2 524: rts pc 525: 1: 526: inc brtabp 527: clr -(sp) 528: sub dot,r0 529: ble 1f 530: sub brdelt,r0 531: 1: 532: jsr r5,betwen; -254.; 256. 533: br 1f 534: br 2f 535: 1: 536: mov r1,-(sp) 537: bic $!7,(sp) 538: mov $1,r0 539: ash (sp)+,r0 540: ash $-3,r1 541: bisb r0,brtab(r1) 542: mov $2,(sp) 543: 2: 544: mov (sp)+,r2 545: rts pc 546: 547: getbr: 548: mov brtabp,r1 549: cmp r1,$brlen 550: blt 1f 551: sec 552: rts pc 553: 1: 554: mov r1,-(sp) 555: bic $!7,(sp) 556: neg (sp) 557: inc brtabp 558: ash $-3,r1 559: movb brtab(r1),r1 560: ash (sp)+,r1 561: ror r1 / 0-bit into c-bit 562: rts pc