10MODE 7 20PRINT"Program taken from directory X"'"Rom image placed in directory R" 30*EX X 40PRINT"Program name in lower case please" 50INPUT LINE "Program name: "File$ 60OSCLI("INFO X."+File$) 70PRINT"Remember hex chars in UPPER case please." 80INPUT LINE "Load address: &"lad$:loadaddress=EVAL("&"+lad$) 90INPUT LINE "Exec address: &"exe$:execaddress=EVAL("&"+exe$) 100INPUT LINE "Program length: &"len$:length=EVAL("&"+len$) 110Lang$ = File$ 120Comm$ = File$ 130Rev$ = FNrev(Comm$) 140from = &80 150to = &82 160osbyte = &FFF4 170DIM Code &4000 180FOR Pass = 4 TO 6 STEP 2 190P% = &8000 200O% = Code 210[OPT Pass 220.ROMstart 230 Jmp Language 240 Jmp Service 250 EQUB &C2 \ Service & Language ROM 260 EQUB Copyright-ROMstart 270 EQUB 0 280 EQUS Lang$ 290 EQUB 0 300 EQUS "0.00" 310.Copyright 320 EQUB 0 330 EQUS "(C) Ripsoft-84" 340 EQUB 0 350 360 370\ This ROM contains an image assembled to run at an address in RAM. 380\ It is started up by a star-command which copies it down & calls it. 390 400.Service 410 Php 420 Pha 430 Tya: Pha 440 Txa: Pha \ Note... X is on LAST 450 460 Tsx 470 Lda &103,X 480 Cmp #&04 490 Beq CommandLine 500 510 Jmp Restore 520 530.CommandLine \ ************* May ONLY use &A8 - &AF ************* 540 Ldx #LEN(Comm$) \ Load counter 550.Parse 560 Lda (&F2),Y \ Pointer to command line 570 Ora #32 580 Cmp Command-1,X 590 Bne Mismatch \ terminator or mis-match 600 Iny 610 Beq Restore 620 Dex 630 Bne Parse 640.StartLang 650 Ldx &F4 \ Get our ROM number 660 Lda #&8E 670 JSR osbyte \ Jump to language 680.Mismatch Cmp #ASC"." \ Check for abbreviation 690 Beq StartLang 700.Restore 710 Pla: Tax 720 Pla: Tay 730 Pla \ Pass command on 740 Plp 750 Rts 760 770 780 790.Command EQUS Rev$ 800.Start EQUW loadaddress 810.End EQUW loadaddress+length 820.Entry EQUW execaddress 830.Language 840 Ldx #&FF: Txs 850 Cli 860 Lda #(OBJECT MOD 256): Sta from 870 Lda #(OBJECT DIV 256): Sta from+1 880 Lda Start: Sta to 890 Lda Start+1: Sta to+1 900 Ldy #0 910.CopyLoop 920 Lda (from),Y 930 Sta (to),Y 940 Inc from 950 Bne zz1 960 Inc from+1 970.zz1 980 Inc to 990 Bne zz2 1000 inc to+1 1010.zz2 1020 Lda to 1030 Cmp End 1040 Bne CopyLoop 1050 Lda to+1 1060 Cmp End+1 1070 Bne CopyLoop 1080 Jmp (Entry) 1090.OBJECT 1100] 1110NEXT 1120IF length+OBJECT>=&C000 THEN PRINT"Program too big for Rom":END 1130OSCLI("LOAD X."+File$+" "+STR$~(OBJECT-P%+O%)) 1140OSCLI("SAVE R."+File$+" "+STR$~(Code)+" "+STR$~(Code+&4000)) 1150END 1160DEFFNrev(S$) 1170l=LEN(S$) 1180DIM s l:DIM news l 1190$s=S$ 1200e=l-1 1210FOR i=0 TO l-1 1220news?e=s?i 1230e=e-1 1240NEXT 1250news?l=13 1260=$news