Home » Archimedes archive » Acorn User » AU 1994-05.adf » !StarInfo_StarInfo » Salt/!ChrEd/RMEnsure
Salt/!ChrEd/RMEnsure
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Acorn User » AU 1994-05.adf » !StarInfo_StarInfo |
Filename: | Salt/!ChrEd/RMEnsure |
Read OK: | ✔ |
File size: | 0487 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM > RMEnsure 20: 30REM If module not active, attempts to initialise ROM copy 40REM If module not present or too old, loads specified file as a module 50REM If module is initialised and is too old, a suitable error is generated 60: 70END=&A000 80syntax$="Syntax: */RMEnsure <moduletitle> <version number> <filename>" 90DIM buf 8:$buf="12345678" 100SYS "XOS_ReadVarVal","Wimp$State",buf,8 110wimp%=$buf<>"commands" 120IF wimp%:SYS "Wimp_Initialise",200,&4B534154,"RMEnsure" TO v%,t% 130SYS "OS_GetEnv" TO c% 140IF c% ELSE ERROR 220,syntax$ 150t$=FNread(c%)+FNread(c%)+FNread(c%) 160module$=FNread(c%):IF module$="":ERROR 220,syntax$ 170version$=FNread(c%):IF version$="":ERROR 220,syntax$ 180file$=FNread(c%):IF file$="":ERROR 220,syntax$ 190SYS "OS_Byte",0,1 TO ,os% 200rmensure$="RMEnsure "+module$+" "+version$ 210IF os%>5:SYS "XOS_CLI",rmensure$+" RMReInit "+module$ TO a%;f% 220IF f% AND 1:IF !a%<>258:SYS "OS_GenerateError",a% 230OSCLI rmensure$+" RMLoad "+file$ 240OSCLI rmensure$+" Error Version "+version$+" or later of "+module$+" is required" 250IF wimp%:SYS "Wimp_CloseDown",t%,&4B534154 260END 270: 280DEF FNread(RETURN c%) 290t$="" 300WHILE ?c%>32 310 t$+=CHR$ ?c% 320 c%+=1 330ENDWHILE 340WHILE ?c%=32 350 c%+=1 360ENDWHILE 370=t$
� > RMEnsure : ;� If module not active, attempts to initialise ROM copy (H� If module not present or too old, loads specified file as a module 2L� If module is initialised and is too old, a suitable error is generated <: F�=&A000 PJsyntax$="Syntax: */RMEnsure <moduletitle> <version number> <filename>" Z� buf 8:$buf="12345678" d*ș "XOS_ReadVarVal","Wimp$State",buf,8 nwimp%=$buf<>"commands" xA� wimp%:ș "Wimp_Initialise",200,&4B534154,"RMEnsure" � v%,t% �ș "OS_GetEnv" � c% �� c% � � 220,syntax$ �$t$=�read(c%)+�read(c%)+�read(c%) �0module$=�read(c%):� module$="":� 220,syntax$ �2version$=�read(c%):� version$="":� 220,syntax$ �,file$=�read(c%):� file$="":� 220,syntax$ �ș "OS_Byte",0,1 � ,os% �.rmensure$="RMEnsure "+module$+" "+version$ �?� os%>5:ș "XOS_CLI",rmensure$+" RMReInit "+module$ � a%;f% �0� f% � 1:� !a%<>258:ș "OS_GenerateError",a% � � rmensure$+" RMLoad "+file$ �Q� rmensure$+" Error Version "+version$+" or later of "+module$+" is required" �,� wimp%:ș "Wimp_CloseDown",t%,&4B534154 � : � �read(� c%) " t$="" , ȕ ?c%>32 6 t$+=� ?c% @ c%+=1 J� T ȕ ?c%=32 ^ c%+=1 h� r=t$ �
00000000 0d 00 0a 10 f4 20 3e 20 52 4d 45 6e 73 75 72 65 |..... > RMEnsure| 00000010 0d 00 14 05 3a 0d 00 1e 3b f4 20 49 66 20 6d 6f |....:...;. If mo| 00000020 64 75 6c 65 20 6e 6f 74 20 61 63 74 69 76 65 2c |dule not active,| 00000030 20 61 74 74 65 6d 70 74 73 20 74 6f 20 69 6e 69 | attempts to ini| 00000040 74 69 61 6c 69 73 65 20 52 4f 4d 20 63 6f 70 79 |tialise ROM copy| 00000050 0d 00 28 48 f4 20 49 66 20 6d 6f 64 75 6c 65 20 |..(H. If module | 00000060 6e 6f 74 20 70 72 65 73 65 6e 74 20 6f 72 20 74 |not present or t| 00000070 6f 6f 20 6f 6c 64 2c 20 6c 6f 61 64 73 20 73 70 |oo old, loads sp| 00000080 65 63 69 66 69 65 64 20 66 69 6c 65 20 61 73 20 |ecified file as | 00000090 61 20 6d 6f 64 75 6c 65 0d 00 32 4c f4 20 49 66 |a module..2L. If| 000000a0 20 6d 6f 64 75 6c 65 20 69 73 20 69 6e 69 74 69 | module is initi| 000000b0 61 6c 69 73 65 64 20 61 6e 64 20 69 73 20 74 6f |alised and is to| 000000c0 6f 20 6f 6c 64 2c 20 61 20 73 75 69 74 61 62 6c |o old, a suitabl| 000000d0 65 20 65 72 72 6f 72 20 69 73 20 67 65 6e 65 72 |e error is gener| 000000e0 61 74 65 64 0d 00 3c 05 3a 0d 00 46 0b e0 3d 26 |ated..<.:..F..=&| 000000f0 41 30 30 30 0d 00 50 4a 73 79 6e 74 61 78 24 3d |A000..PJsyntax$=| 00000100 22 53 79 6e 74 61 78 3a 20 2a 2f 52 4d 45 6e 73 |"Syntax: */RMEns| 00000110 75 72 65 20 3c 6d 6f 64 75 6c 65 74 69 74 6c 65 |ure <moduletitle| 00000120 3e 20 3c 76 65 72 73 69 6f 6e 20 6e 75 6d 62 65 |> <version numbe| 00000130 72 3e 20 3c 66 69 6c 65 6e 61 6d 65 3e 22 0d 00 |r> <filename>"..| 00000140 5a 1b de 20 62 75 66 20 38 3a 24 62 75 66 3d 22 |Z.. buf 8:$buf="| 00000150 31 32 33 34 35 36 37 38 22 0d 00 64 2a c8 99 20 |12345678"..d*.. | 00000160 22 58 4f 53 5f 52 65 61 64 56 61 72 56 61 6c 22 |"XOS_ReadVarVal"| 00000170 2c 22 57 69 6d 70 24 53 74 61 74 65 22 2c 62 75 |,"Wimp$State",bu| 00000180 66 2c 38 0d 00 6e 1a 77 69 6d 70 25 3d 24 62 75 |f,8..n.wimp%=$bu| 00000190 66 3c 3e 22 63 6f 6d 6d 61 6e 64 73 22 0d 00 78 |f<>"commands"..x| 000001a0 41 e7 20 77 69 6d 70 25 3a c8 99 20 22 57 69 6d |A. wimp%:.. "Wim| 000001b0 70 5f 49 6e 69 74 69 61 6c 69 73 65 22 2c 32 30 |p_Initialise",20| 000001c0 30 2c 26 34 42 35 33 34 31 35 34 2c 22 52 4d 45 |0,&4B534154,"RME| 000001d0 6e 73 75 72 65 22 20 b8 20 76 25 2c 74 25 0d 00 |nsure" . v%,t%..| 000001e0 82 17 c8 99 20 22 4f 53 5f 47 65 74 45 6e 76 22 |.... "OS_GetEnv"| 000001f0 20 b8 20 63 25 0d 00 8c 18 e7 20 63 25 20 8b 20 | . c%..... c% . | 00000200 85 20 32 32 30 2c 73 79 6e 74 61 78 24 0d 00 96 |. 220,syntax$...| 00000210 24 74 24 3d a4 72 65 61 64 28 63 25 29 2b a4 72 |$t$=.read(c%)+.r| 00000220 65 61 64 28 63 25 29 2b a4 72 65 61 64 28 63 25 |ead(c%)+.read(c%| 00000230 29 0d 00 a0 30 6d 6f 64 75 6c 65 24 3d a4 72 65 |)...0module$=.re| 00000240 61 64 28 63 25 29 3a e7 20 6d 6f 64 75 6c 65 24 |ad(c%):. module$| 00000250 3d 22 22 3a 85 20 32 32 30 2c 73 79 6e 74 61 78 |="":. 220,syntax| 00000260 24 0d 00 aa 32 76 65 72 73 69 6f 6e 24 3d a4 72 |$...2version$=.r| 00000270 65 61 64 28 63 25 29 3a e7 20 76 65 72 73 69 6f |ead(c%):. versio| 00000280 6e 24 3d 22 22 3a 85 20 32 32 30 2c 73 79 6e 74 |n$="":. 220,synt| 00000290 61 78 24 0d 00 b4 2c 66 69 6c 65 24 3d a4 72 65 |ax$...,file$=.re| 000002a0 61 64 28 63 25 29 3a e7 20 66 69 6c 65 24 3d 22 |ad(c%):. file$="| 000002b0 22 3a 85 20 32 32 30 2c 73 79 6e 74 61 78 24 0d |":. 220,syntax$.| 000002c0 00 be 1b c8 99 20 22 4f 53 5f 42 79 74 65 22 2c |..... "OS_Byte",| 000002d0 30 2c 31 20 b8 20 2c 6f 73 25 0d 00 c8 2e 72 6d |0,1 . ,os%....rm| 000002e0 65 6e 73 75 72 65 24 3d 22 52 4d 45 6e 73 75 72 |ensure$="RMEnsur| 000002f0 65 20 22 2b 6d 6f 64 75 6c 65 24 2b 22 20 22 2b |e "+module$+" "+| 00000300 76 65 72 73 69 6f 6e 24 0d 00 d2 3f e7 20 6f 73 |version$...?. os| 00000310 25 3e 35 3a c8 99 20 22 58 4f 53 5f 43 4c 49 22 |%>5:.. "XOS_CLI"| 00000320 2c 72 6d 65 6e 73 75 72 65 24 2b 22 20 52 4d 52 |,rmensure$+" RMR| 00000330 65 49 6e 69 74 20 22 2b 6d 6f 64 75 6c 65 24 20 |eInit "+module$ | 00000340 b8 20 61 25 3b 66 25 0d 00 dc 30 e7 20 66 25 20 |. a%;f%...0. f% | 00000350 80 20 31 3a e7 20 21 61 25 3c 3e 32 35 38 3a c8 |. 1:. !a%<>258:.| 00000360 99 20 22 4f 53 5f 47 65 6e 65 72 61 74 65 45 72 |. "OS_GenerateEr| 00000370 72 6f 72 22 2c 61 25 0d 00 e6 20 ff 20 72 6d 65 |ror",a%... . rme| 00000380 6e 73 75 72 65 24 2b 22 20 52 4d 4c 6f 61 64 20 |nsure$+" RMLoad | 00000390 22 2b 66 69 6c 65 24 0d 00 f0 51 ff 20 72 6d 65 |"+file$...Q. rme| 000003a0 6e 73 75 72 65 24 2b 22 20 45 72 72 6f 72 20 56 |nsure$+" Error V| 000003b0 65 72 73 69 6f 6e 20 22 2b 76 65 72 73 69 6f 6e |ersion "+version| 000003c0 24 2b 22 20 6f 72 20 6c 61 74 65 72 20 6f 66 20 |$+" or later of | 000003d0 22 2b 6d 6f 64 75 6c 65 24 2b 22 20 69 73 20 72 |"+module$+" is r| 000003e0 65 71 75 69 72 65 64 22 0d 00 fa 2c e7 20 77 69 |equired"...,. wi| 000003f0 6d 70 25 3a c8 99 20 22 57 69 6d 70 5f 43 6c 6f |mp%:.. "Wimp_Clo| 00000400 73 65 44 6f 77 6e 22 2c 74 25 2c 26 34 42 35 33 |seDown",t%,&4B53| 00000410 34 31 35 34 0d 01 04 05 e0 0d 01 0e 05 3a 0d 01 |4154.........:..| 00000420 18 11 dd 20 a4 72 65 61 64 28 f8 20 63 25 29 0d |... .read(. c%).| 00000430 01 22 09 74 24 3d 22 22 0d 01 2c 0d c8 95 20 3f |.".t$=""..,... ?| 00000440 63 25 3e 33 32 0d 01 36 0e 20 74 24 2b 3d bd 20 |c%>32..6. t$+=. | 00000450 3f 63 25 0d 01 40 0a 20 63 25 2b 3d 31 0d 01 4a |?c%..@. c%+=1..J| 00000460 05 ce 0d 01 54 0d c8 95 20 3f 63 25 3d 33 32 0d |....T... ?c%=32.| 00000470 01 5e 0a 20 63 25 2b 3d 31 0d 01 68 05 ce 0d 01 |.^. c%+=1..h....| 00000480 72 07 3d 74 24 0d ff |r.=t$..| 00000487