There is no need to alter the module and reload it, because that pair of
instructions is unique to the code. Here is a snippet that will make the
changes /in situ/, and remove the 'renumbering' message.
It works with a rom version as well if you have the ROMPatch module. Is
this available for RO 5? The 32-bit version from RO6 does not seem to
allow patches at that high memory, even if it were legal to use it. ;-)
I am not sure that my method for distinguishing between rom and rma, for
all versions of RISC OS, is the best, so suggestions are welcome.
SYS"OS_Module",18,"UtilityModule" TO ,,,r%
SYS"OS_Module",18,"BASIC" TO ,,,a%
FOR i%=a% TO a%+&D800:REM keep inside BASIC module
IF !i%=&E3A0400A THEN:REM MOV R4,#10
IF i%>r% THEN
OSCLI("ROMPatch &"+STR$~(i%+00)+" &E3A0400A &E3A04001")
OSCLI("ROMPatch &"+STR$~(i%+04)+" &E3A0500A &E3A05001")
OSCLI("ROMPatch &"+STR$~(i%+12)+" &E3A00007 &E8BD8000")
ELSE
i%!00=&E3A04001:REM MOV R4,#1
i%!04=&E3A05001:REM MOV R5,#1
i%!12=&E8BD8000:REM STMFD R13!,{PC}
ENDIF
i%=a%+&D800
ENDIF
NEXT i%