0100 ;SAVE#D:DMPT1.M65 0110 .OPT NO LIST 0120 ;---------------------------- 0130 ; 0140 ;Disk Master 0150 ;the Disk Editor/Disassembler 0160 ; 0170 ; (C) 1989 BY ST-LOG 0180 ; 0190 ;by: Barry Kolbe 0200 ;and Bryan Schappel 0210 ; 0220 ;---------------------------- 0230 ; 0240 *= 0 0250 PASS .= PASS+1 0260 .IF PASS=1 0270 .INCLUDE #D:SYSEQU.M65 0280 .ENDIF 0290 ; 0300 ;Zero Page Usage 0310 ; 0320 *= $80 0330 Y1 1 ;save x/y hold 0340 Y2 1 ;areas 0350 Y3 1 0360 X1 1 0370 X2 1 0380 X3 1 0390 TMP1 1 ;temp variables 0400 TMP2 1 0410 TMP3 1 0420 AIFLAG 1 ;asc/internal 0430 T 2 ;pntr 0440 L 2 ;pntr 0450 CTMP 1 ;extra temp 0460 SECL 1 ;sec # lo 0470 SECH 1 ;sec # hi 0480 UNITS 1 ;units digit 0490 TENS 1 ;tens digit 0500 IV 1 ;inverse flag 0510 HDF 1 ;hex/dex flag 0520 ICNT 1 ;counter 0530 NMD 1 0540 TOTD 1 0550 HXL 1 ;hex lo 0560 HXH 1 ;hex hi 0570 HXORST 1 ;hex/string 0580 FBYTE 1 ;first byte 0590 MATFLG 1 ;match flag 0600 LNKLO 1 ;link lo 0610 LNKHI 1 ;link hi 0620 SSECL 1 ;save sec lo 0630 SSECH 1 ;save sec hi 0640 DENSITY 1 ;density flag 0650 SRCDRV 1 ;source drive 0660 DESDRV 1 ;dest'n drive 0670 ADDR 2 ;disa address 0680 INDR 2 ;pointer 0690 OP 1 ;first disa byte 0700 DTEMP 2 ;next 2 bytes 0710 NBYTE 1 ;# instr bytes 0720 HXDC 1 ;hex/dec flag 0730 ADD_ON 1 ;address offset 0740 LOC_S 2 ;address start 0750 LOC_E 2 ;address end 0760 CNTLO 2 ;counter 0770 DINS 2 ;disa hold 0780 IMODE 1 ;input mode 0790 MAXLEN 1 ;max length 0800 SRFLG 1 ;srch data flag 0810 INPLOC 2 ;input loc 0820 BYTCNT 2 ;segment cnt 0830 GETPTR 1 ;sec offset 0840 STLOAD 2 ;start load 0850 ENLOAD 2 ;end load 0860 TYPE 1 ;disa/file 0870 LABELS? 1 ;label flag 0880 S.SIZE 1 ;sector size 0890 BUFPNT 2 ;output pntr 0900 LINES 1 ;#line in bigbuf 0910 BYTES 1 ;bytes gotten 0920 SFLAG 1 ;source flag 0930 SECCNT 2 ;sector count 0940 SECBYTES 1 ;bytes/sector 0950 SM = $2800 ;screen memory 0960 LINE0 = SM+16*40 ;text window 0970 BIGBUF = $8000 ;P: buffer 0980 PRNBUF = $03C0 0990 ; 1000 ;PRINT macro 1010 ; 1020 .MACRO PRINT 1030 LDA # <%1 1040 LDY # >%1 1050 JSR EPRINT 1060 .ENDM 1070 ; 1080 ;Work Buffers 1090 ; 1100 *= $2C00 1110 MYBUF 128 ;sec work buf 1120 DSBUF 128 ;data buffer 1130 INPLIN 40 ;input line 1140 SRBUF 45 ;search buffer 1150 IBUF 45 ;input buffer 1160 SRCFILE 20 ;source file 1170 DSTFILE 20 ;dest'n file 1180 ; 1190 ;Program Start 1200 ; 1210 *= $3000 ;origin 1220 START JMP INTRO ;go intro! 1230 ; 1240 ;Intro Display List 1250 ; 1260 INDL .BYTE $70,$70,$70,$70,$70 1270 .BYTE $70,$70,$70,$70,$46 1280 .WORD CREDIT 1290 .BYTE $70,$42 1300 .WORD IL0 1310 .BYTE $02,$70,$06,$20 1320 .BYTE $06,$20,$06,$41 1330 .WORD INDL 1340 ; 1350 ;Info Display List 1360 ; 1370 INFODL .BYTE $70,$70,$70,$46 1380 .WORD CR2 1390 .BYTE $06,$40,$42 1400 .WORD SM+40 1410 .BYTE $02,$02,$02,$02,$02 1420 .BYTE $02,$02,$02,$02,$41 1430 .WORD INFODL 1440 ; 1450 ;Disassembler Display List 1460 ; 1470 DISADL .BYTE $70,$70,$70,$46 1480 .WORD CR2 1490 .BYTE $20,$42 1500 .WORD INFOLN 1510 .BYTE $20,$00,$42 1520 .WORD SM 1530 .BYTE $02,$02,$02,$02,$02 1540 .BYTE $02,$02,$02,$02,$02 1550 .BYTE $02,$02,$02,$02,$02 1560 .BYTE $02,$02,$02,$02,$02 1570 .BYTE $41 1580 .WORD DISADL 1590 ; 1600 IL0 .SBYTE " by: Barry Ko" 1610 .SBYTE "lbe and Bryan S" 1620 .SBYTE "chappel " 1630 .SBYTE " Produced for:" 1640 .SBYTE " A.N.A.L.O.G. C" 1650 .SBYTE "omputing " 1660 .SBYTE "option di" 1670 .SBYTE "sk editor " 1680 .SBYTE "select di" 1690 .SBYTE "sassembler" 1700 .SBYTE " start ex" 1710 .SBYTE "it " 1720 ; 1730 INFOLN .SBYTE " MNE Operand" 1740 .SBYTE " ADDR " 1750 .SBYTE "B1 B2 B3 " 1760 ; 1770 ;Disassembler prompts 1780 ; 1790 P0 .BYTE "Disa Type [F/D]",0 1800 P3 .BYTE "Dest'n [E/P/Dn]",0 1810 P4 .BYTE " Labels [Y/N]",0 1820 P5 .BYTE " Source File",0 1830 P1 .BYTE "Src Drive [1-8]",0 1840 P2 .BYTE " Density [1-2]",0 1850 P6 .BYTE " Sector [1-2D0]",0 1860 P7 .BYTE " # of Sectors",0 1870 P8 .BYTE " Offset [0-7F]",0 1880 P9 .BYTE "Origin [0-FFFF]",0 1890 PA .BYTE "Byt/Sec [7D/80]",0 1900 ; 1910 ;INCLUDE Support Files 1920 ; 1930 .INCLUDE #D1:DMPT2.M65 1940 .INCLUDE #D1:DMPT3.M65 1950 .INCLUDE #D1:DMPT4.M65 1960 ; 1970 ;Intro Screen 1980 ; 1990 INTRO CLD ;chill decimal 2000 LDX #$FF ;clear stack 2010 TXS 2020 LDA POKMSK 2030 AND #$7F 2040 STA POKMSK 2050 STA IRQEN 2060 LDA # INDL ;list. 2090 STA SDLSTL+1 2100 LDA #$22 ;normal PF 2110 STA SDMCTL 2120 LDA #$0A ;white text 2130 STA COLOR1 2140 LDA #$00 ;black border 2150 STA COLOR4 2160 LDA #2 ;grey backgrnd 2170 STA LMARGN ;left marg=2 2180 STA COLOR2 2190 LDA #$94 ;blue gr1 text 2200 STA COLOR3 2210 I_LOOP LDA CONSOL ;get consol 2220 CMP #6 ;start? 2230 BNE T_5 ;no. 2240 JMP WARMSV ;yes, so long! 2250 T_5 CMP #5 ;select? 2260 BEQ GO_DIS ;yes. disa. 2270 CMP #3 ;option? 2280 BNE I_LOOP ;no, loop 2290 JMP DISKED ;Disk Editor. 2300 ; 2310 ;Disassembler Data Entry 2320 ; 2330 GO_DIS LDA # INFODL ;entry DLIST 2360 STA SDLSTL+1 2370 JSR CLRSCN ;clear screen 2380 LDA # P0 2410 STA INDR+1 2420 JSR PROMPT ;Disk/Files 2430 ; 2440 P00 JSR GETONE ;get input 2450 BCC P01 ;ok? 2460 GO_INT JMP INTRO ;no way. 2470 ; 2480 P01 LDA IBUF ;get char 2490 AND #223 ;make upper/norm 2500 LDX #0 ;0=files 2510 CMP #'F ;was it F? 2520 BEQ P02 ;yes! 2530 CMP #'D ;a D? 2540 BNE P00 ;no. 2550 INX ;up flag 2560 P02 STX TYPE ;save type 2570 ; 2580 JSR PROMPT ;dest'n device 2590 P30 JSR GETFN ;get name 2600 BCS GO_INT ;bad input 2610 LDY #20 ;copy to pos 20 2620 JSR CHECKFN ;check filename 2630 BCS P30 ;oops, bad one. 2640 JSR G.DRV ;get drive # 2650 STA DESDRV ;save it. 2660 ; 2670 JSR PROMPT ;want labels? 2680 P40 JSR GETONE ;get response. 2690 BCS GO_INT ;bad one. 2700 LDA IBUF ;get char 2710 AND #223 2720 LDX #0 ;0=labels. 2730 CMP #'Y ;a Y? 2740 BEQ P41 ;yes. 2750 CMP #'N ;try N? 2760 BNE P40 ;no. 2770 INX ;1=no labels 2780 P41 STX LABELS? ;save choice 2790 ; 2800 LDA TYPE ;files or disk? 2810 BNE F_SECS ;want disk. 2820 JSR PROMPT ;filename 2830 ; 2840 P50 JSR GETFN ;get filename 2850 G.0 BCS GO_INT ;bad one. 2860 LDY #0 ;posit 0 2870 JSR CHECKFN ;check Fname 2880 BCS P50 ;oops. 2890 JSR G.DRV ;get drive 2900 STA SRCDRV ;save it. 2910 JMP DIS_IT ;and disa! 2920 ; 2930 F_SECS JSR UP_INDR ;skip fname 2940 JSR PROMPT ;source drive 2950 P10 JSR GETONE ;get response 2960 BCS GO_INT ;bad one. 2970 LDA IBUF ;get the char 2980 AND #$7F 2990 SEC ;make 1-8 3000 SBC #'0 3010 BMI P10 ;<0? yes! 3020 CMP #9 ;=>9? 3030 BCS P10 ;yes. 3040 STA SRCDRV ;save it 3050 ; 3060 JSR PROMPT ;density 3070 P20 JSR GETONE ;input. 3080 G.1 BCS G.0 ;bad input. 3090 LDA IBUF ;get char 3100 AND #$7F ;mask inverse 3110 SEC ;make 0-1 3120 SBC #'1 3130 BMI P20 ;<0?, yes. 3140 CMP #2 ;>1? 3150 BCS P20 ;yes. 3160 STA DENSITY ;save density 3170 TAX ;X=A 3180 LDA SDLO,X ;get max sec # 3190 STA FR0 ;and put it in 3200 LDA SDHI,X ;FR0. 3210 STA FR0+1 3220 JSR BIN2HEX ;make hex. 3230 LDY #1 ;copy max # 3240 D.CP LDA LBUFF,Y ;into the next 3250 STA P6+10,Y ;prompt. 3260 INY 3270 CPY #4 3280 BNE D.CP 3290 ; 3300 JSR PROMPT ;sector 3310 P60 JSR SPC_NUM ;get number 3320 BCS G.1 3330 JSR TESTFR0 ;in range? 3340 BCS P60 ;no. 3350 LDA FR0 ;yes, so we 3360 STA SECL ;save the sector 3370 LDA FR0+1 ;number for 3380 STA SECH ;later. 3390 ; 3400 JSR PROMPT ;#secs 3410 P70 JSR SPC_NUM ;get number 3420 G.2 BCS G.1 ;bad one. 3430 LDA FR0 ;is number 0? 3440 ORA FR0+1 3450 BEQ P70 ;yes, that's bad 3460 LDA FR0 ;save the number 3470 STA SECCNT ;of sectors for 3480 CLC ;later & add on 3490 ADC SECL ;start sector 3500 STA FR0 ;so we can test 3510 LDA FR0+1 ;to see if too 3520 STA SECCNT+1 ;many sec's 3530 ADC SECH ;will be read. 3540 STA FR0+1 3550 JSR TESTFR0 ;in range? 3560 BCS P70 ;no way. 3570 ; 3580 JSR PROMPT ;offset 3590 P80 JSR SPC_NUM ;get number 3600 BCS G.2 3610 LDA FR0+1 ;test hi byte 3620 BNE P80 ;>? yes! 3630 LDA FR0 ;get lo byte 3640 CMP #$80 ;=> $80? 3650 BCS P80 ;yes. 3660 STA GETPTR ;save for later 3670 ; 3680 JSR PROMPT ;origin 3690 P90 JSR SPC_NUM ;get number 3700 BCS G.2 3710 LDA FR0 ;copy the num 3720 STA ADDR ;into the addr 3730 LDA FR0+1 ;for the disa- 3740 STA ADDR+1 ;ssembler. 3750 ; 3760 JSR PROMPT ;sector size. 3770 PA0 JSR SPC_NUM ;get number 3780 BCS G.2 3790 LDA FR0+1 ;no hi byte 3800 BNE PA0 ;allowed! 3810 LDA FR0 ;test lo byte 3820 CMP #125 ;125 bytes? 3830 BEQ G.SZ ;yes! 3840 CMP #128 ;128 bytes? 3850 BNE PA0 ;no. 3860 G.SZ STA S.SIZE ;save size 3870 ; 3880 ;Disassembly Entry Point 3890 ; 3900 DIS_IT JSR CLRSCN ;zap screen 3910 STY SFLAG ;clear flag 3920 LDA # DISADL 3950 STA SDLSTL+1 3960 JSR OPENIN ;open input 3970 JSR OPENOUT ;open output 3980 ; 3990 D_LOOP JSR DISAMEM ;do instr. 4000 JSR PRINT.IT ;print it 4010 LDA #0 ;clear counter 4020 STA BYTES 4030 LDX #$FF ;get a $FF 4040 C_LOOP LDA CH ;key press? 4050 CMP #$FF 4060 BEQ D_LOOP ;no. 4070 STX CH ;clear CH 4080 CMP #28 ;escape? 4090 BNE T.SPC ;no. 4100 END.IT STX CH ;clear CH and 4110 JMP D_OVER ;exit. 4120 ; 4130 T.SPC CMP #33 ;Space=pause 4140 BNE D_LOOP 4150 ; 4160 K.WAIT LDA CH ;get keypress 4170 CMP #28 ;escape? 4180 BEQ END.IT ;yes, exit 4190 CMP #33 ;wait for SPC 4200 BNE K.WAIT ;to stop the 4210 STX CH ;pause. 4220 JMP D_LOOP ;loop again. 4230 ; 4240 ;Get drive number 4250 ; 4260 G.DRV LDA IBUF+1 ;get char 4270 SEC ;set carry 4280 SBC #'0 ;subtract '0 4290 RTS ;and leave 4300 ; 4310 ;E: Print routine 4320 ; 4330 EPRINT STA E.LP+1 ;save lo byte 4340 STY E.LP+2 ;save hi byte 4350 E.LP LDA $FFFF ;get char 4360 BEQ E.DN ;if 0, all done 4370 JSR E.PUT ;put the char 4380 INC E.LP+1 ;bump pointer 4390 BNE E.LP 4400 INC E.LP+2 4410 BNE E.LP ;and loop 4420 E.DN RTS ;so long. 4430 ; 4440 ;E: Put byte routine 4450 ; 4460 E.PUT CMP #EOL ;is it a CR? 4470 BNE E.EOL ;no. 4480 PUTCR LDA LMARGN ;set xpos to 4490 STA COLCRS ;the margin 4500 INC ROWCRS ;bump ypos 4510 JMP SCROLL ;check scroll 4520 ; 4530 E.EOL JSR ASC2IC ;make icode 4540 PHA ;save it 4550 LDY ROWCRS ;get ypos 4560 LDA GL,Y ;look up the 4570 STA L ;address of this 4580 LDA GH,Y ;line and store 4590 STA L+1 ;in temp area 4600 PLA ;get char back 4610 LDY COLCRS ;get xpos 4620 STA (L),Y ;on screen! 4630 ; 4640 INY ;up xpos 4650 CPY #39 ;at rmargn? 4660 BCC E.LV ;no. 4670 BEQ E.LV ;just there. 4680 INC ROWCRS ;next line 4690 JSR SCROLL ;scroll screen 4700 LDY LMARGN ;get margin 4710 E.LV STY COLCRS ;set xpos 4720 RTS ;and leave 4730 ; 4740 ;Check to see if screen must 4750 ;be scrolled. 4760 ; 4770 SCROLL LDY ROWCRS ;get ypos 4780 CPY #21 ;at line 21? 4790 BCC S.NO ;no. 4800 LDA # SM 4830 STA T+1 4840 LDA # <[SM+40] 4850 STA L 4860 LDA # >[SM+40] 4870 STA L+1 4880 LDX #0 ;line counter 4890 S.M1 LDY #39 ;now move 1 line 4900 S.M2 LDA (L),Y ;up 40 bytes 4910 STA (T),Y 4920 DEY 4930 BPL S.M2 4940 LDA L+1 ;now update the 4950 STA T+1 ;pointers. 4960 LDA L 4970 STA T 4980 CLC 4990 ADC #40 5000 STA L 5010 LDA L+1 5020 ADC #0 5030 STA L+1 5040 INX ;up line count 5050 CPX #21 ;at end? 5060 BNE S.M1 ;no way. 5070 DEC ROWCRS ;dec ypos 5080 S.NO RTS ;and leave 5090 ; 5100 ;Print a Prompt 5110 ; 5120 PROMPT JSR PUTCR ;print CR 5130 LDA #$40 ;force uppercase 5140 STA SHFLOK 5150 LDA #0 ;and no inverse 5160 STA INVFLG 5170 LDA INDR ;get addr of 5180 LDY INDR+1 ;the prompt 5190 JSR EPRINT ;print it 5200 LDA #': ;put a ':' 5210 JSR E.PUT 5220 LDA #$20 ;and a space 5230 JSR E.PUT 5240 JSR G_SCR ;clear line 5250 UP_INDR LDA INDR ;add 16 to get 5260 CLC ;to the next 5270 ADC #16 ;prompt. 5280 STA INDR 5290 BCC UP_HI 5300 INC INDR+1 5310 UP_HI RTS ;so long. 5320 G_SCR LDA COLCRS ;get xpos 5330 LDY ROWCRS ;and ypos 5340 CLC ;add line addr 5350 ADC GL,Y 5360 STA INPLOC 5370 LDA GH,Y 5380 ADC #0 5390 STA INPLOC+1 5400 LDY #20 ;zap 21 chars 5410 LDA #0 ;a space 5420 G_CLR STA (INPLOC),Y ;on screen 5430 DEY ;down counter 5440 BPL G_CLR ;and loop 5450 RTS ;so long. 5460 ; 5470 ;Get 1 byte via INPUT 5480 ; 5490 GETONE JSR G_SCR ;clear line 5500 LDY #0 ;force text mode 5510 STY IMODE 5520 INY ;1 char 5530 JMP INPUT ;get input 5540 ; 5550 ;Get a Filename 5560 ; 5570 GETFN JSR G_SCR ;zap line 5580 LDY #0 ;force text mode 5590 STY IMODE 5600 LDY #15 ;get 15 chars 5610 JMP INPUT 5620 ; 5630 ;Special get number 5640 ; 5650 SPC_NUM JSR G_SCR ;zap line 5660 JMP G_NUM ;get a number 5670 ; 5680 ;Test FR0 for sector range 5690 ; 5700 TESTFR0 LDA FR0 ;is FR0 a 0? 5710 ORA FR0+1 5720 BEQ T.ERR ;yes! 5730 LDX DENSITY ;get density 5740 LDA FR0+1 ;check to see 5750 CMP SDHI,X ;if the sector 5760 BCC T.GD ;number in FR0 5770 BEQ T.LO ;is allowed. 5780 BCS T.ERR 5790 T.LO LDA FR0 5800 CMP SDLO,X 5810 BCC T.GD 5820 BEQ T.GD 5830 T.ERR SEC ;signal error 5840 RTS 5850 T.GD CLC ;signal good 5860 RTS 5870 ; 5880 ;Check Filename for Dx: 5890 ; 5900 CHECKFN LDA IBUF ;get 1st char 5910 CMP #EOL ;is it EOL? 5920 BEQ CH.B ;yes. 5930 CMP #'D ;is it 'D'? 5940 BEQ FN.D ;yes. 5950 CMP #'P ;is it 'P'? 5960 BEQ CH.C ;yes. 5970 CMP #'E ;is it 'E'? 5980 BNE CH.B ;no. 5990 CH.C LDA #': ;make 2nd char 6000 STA IBUF+1 a ':' and the 6010 LDA #EOL ;3rd char an EOL 6020 STA IBUF+2 6030 CH.R LDX #0 ;zero index 6040 CH.L LDA IBUF,X ;get input char 6050 STA SRCFILE,Y ;save in buf 6060 INY ;up buf index 6070 INX ;up input indx 6080 CPX #20 ;done 20 yet? 6090 BNE CH.L ;no. 6100 CLC ;signal good. 6110 RTS ;and leave. 6120 ; 6130 FN.D LDA IBUF+2 ;get 3rd char 6140 CMP #': ;3rd char a ':'? 6150 BNE CH.B ;no, bad name 6160 LDA IBUF+1 ;get drive # 6170 CMP #'1 ;less than 1? 6180 BCC CH.B ;yes. 6190 CMP #'9 ;greater than 8? 6200 BCC CH.R 6210 CH.B SEC ;signal bad 6220 RTS 6230 ; 6240 ;Dump Editor Screen to Printer 6250 ; 6260 DMPSCN JSR PRNLFD 6270 BMI PRERR 6280 LDA # BORDER ;border 6300 JSR DMPSUB 6310 BMI PRERR 6320 LDA #0 ;count lines 6330 STA T ;of sectr info 6340 DMLP LDX T ;get index 6350 LDA GL,X ;Lo/Hi bytes 6360 LDY GH,X ;line address 6370 JSR DMPSUB ;print it 6380 BMI PRERR 6390 INC T ;next line 6400 LDA T 6410 CMP #16 ;done 16? 6420 BNE DMLP ;nope 6430 LDA # STATUS ;status line 6450 JSR DMPSUB 6460 BPL DMOK ;Y has error 6470 PRERR JMP IOERR ;dble return 6480 DMOK RTS 6490 ; 6500 ;Printer Linefeed 6510 ; 6520 PRNLFD LDA #$20 6530 STA PRNBUF 6540 LDA #EOL 6550 STA PRNBUF+1 6560 BNE SAP 6570 ; 6580 ;Print a Line using SIO 6590 ; 6600 DMPSUB STA L ;save address 6610 STY L+1 ;for indirect 6620 LDY #0 6630 DML LDX #0 ;use as an 6640 STX TMP1 ;inverse flag 6650 LDA (L),Y ;get byte 6660 BPL DMJ ;inversed? 6670 INC TMP1 ;yes-set flag 6680 DMJ AND #$7F ;mask it off 6690 CMP #123 ;skip control 6700 BCS PERD ;characters 6710 CMP #96 6720 BCS PRK 6730 CMP #64 6740 BCS PERD 6750 CLC ;change to 6760 ADC #$20 ;ATASCII 6770 PRK LDX TMP1 ;was it inverse? 6780 BEQ PORK ;no 6790 ORA #$80 ;add back in 6800 BNE PORK 6810 PERD LDA #'. ;'.' for contrls 6820 PORK STA PRNBUF,Y ;into buffer 6830 INY 6840 CPY #$27 ;done w/line? 6850 BNE DML ;no 6860 LDA #EOL ;add EOL 6870 STA PRNBUF+$27 6880 ; 6890 SAP LDX #$0B ;copy cmds 6900 SIP LDA PSIOCB,X ;to DDEVIC 6910 STA $0300,X 6920 DEX 6930 BPL SIP 6940 JSR SIOV ;let SIO print 6950 RTS 6960 ; 6970 PSIOCB .BYTE $40 ;printer 6980 .BYTE $01 ;unit 1 6990 .BYTE $57 ;write 7000 .BYTE $80 ;send bit 7=out 7010 .WORD PRNBUF ;buffer 7020 .WORD $30 ;time out 7030 .WORD $28 ;buf length 7040 .BYTE $4E ;normal prnt 7050 .BYTE $00 ;unused 7060 ; 7070 ;Get Label Data 7080 ; 7090 .INCLUDE #D:DMPT5.M65 7100 ; 7110 ;Find where program ends 7120 ; 7130 .OPT LIST 7140 ENDPROG = * 7150 .OPT NO LIST 7160 ; 7170 ;Add Run address 7180 ; 7190 *= RUNAD 7200 .WORD START 7210 .END