1000 ;BINARY RUN FOR ACE C 1010 *= $0590 1020 BEGADR = $D4 1030 ENDADR = $D6 1040 LENGTH = $D8 1050 RUNFLG = $0589 1060 ; CLOSE #7 1070 BRUN LDX #$70 1080 LDA #$0C 1090 STA $0342,X 1100 JSR $E456 1110 ; GET FSPEC POINTER 1120 LDY #0 1130 LDA ($C6),Y 1140 STA $0344,X 1150 INY 1160 LDA ($C6),Y 1170 STA $0345,X 1180 ; OPEN FILE FOR READ 1190 LDA #$03 1200 STA $0342,X 1210 LDA #$04 1220 STA $034A,X 1230 JSR $E456 1240 BPL LD1 1250 JMP EXITOUT 1260 ; MAKE SURE IT IS BINARY 1270 LD1 LDA #0 1280 STA $0348,X 1290 STA $0349,X 1300 LDA #7 1310 STA $0342,X 1320 JSR $E456 1330 CMP #255 1340 BNE ERR 1350 JSR $E456 1360 CMP #255 1370 BEQ LD2 1380 ERR JMP EXITOUT 1390 ; SET RUNADR TO START 1400 LD2 JSR $E456 1410 STA $02E0 1420 STA BEGADR 1430 JSR $E456 1440 STA $02E1 1450 STA BEGADR+1 1460 ; IF RUNFLG=0 NO RUN UNLESS 1470 ; RUN ADDR IN FILE 1480 LDA RUNFLG 1490 BNE LP2 1500 LDA # <EXITOUT 1510 STA $02E0 1520 LDA # >EXITOUT 1530 STA $02E1 1540 BNE LP2 1550 ; LOOP UNTIL ALL SEGMENTS LOADED 1560 LOOP LDX #$70 1570 LDA #0 1580 STA $0348,X 1590 STA $0349,X 1600 LDA #7 1610 STA $0342,X 1620 LP1 JSR $E456 1630 BPL LP1A 1640 JMP RUNIT ; END OF FILE 1650 LP1A STA BEGADR 1660 JSR $E456 1670 STA BEGADR+1 1680 CMP #255 1690 BNE LP2 1700 LDA BEGADR 1710 CMP #255 1720 BEQ LP1 ; SKIP FFFF 1730 LP2 JSR $E456 1740 STA ENDADR 1750 JSR $E456 1760 STA ENDADR+1 1770 ; SET INIT ADR TO 0 1780 LDA #0 1790 STA $02E2 1800 STA $02E3 1810 ; LENGTH=ENDADR-BEGADR+1 1820 SEC 1830 LDA ENDADR 1840 SBC BEGADR 1850 STA LENGTH 1860 LDA ENDADR+1 1870 SBC BEGADR+1 1880 STA LENGTH+1 1890 INC LENGTH 1900 BNE LP3 1910 INC LENGTH+1 1920 ; LOAD IN SEGMENT 1930 LP3 LDA LENGTH 1940 STA $0348,X 1950 LDA LENGTH+1 1960 STA $0349,X 1970 LDA BEGADR 1980 STA $0344,X 1990 LDA BEGADR+1 2000 STA $0345,X 2010 LDA #7 2020 STA $0342,X 2030 JSR $E456 2040 ; CHECK FOR INIT ADR 2050 LDA $02E2 2060 BNE DOINIT 2070 LDA $02E3 2080 BNE DOINIT 2090 BEQ DOIN0 2100 ; JSR TO INIT 2110 DOINIT JSR DOIN1 2120 DOIN0 JMP LOOP 2130 DOIN1 JMP ($02E2) 2140 ; EXECUTE PROGRAM 2150 RUNIT JMP ($02E0) 2160 ; ERR! 2170 EXITOUT RTS 2180 ZZZZ