If you want to do it for larger programs, instead of using OPL string extension which is slow, you could call this:
Code: Select all
BYTES:(A%,H$)
REM CODE:18EC02DD43EE00DF414FE6003A54DD4509EC00814025028007C1402502C00748484848C40F1B36099C4122E4DE43D64632A700085A26F9DE4539
LOCAL C$(58),S$(255),V%(2)
C$="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
S$=H$ :V%(1)=ADDR(S$) :V%(2)=A%
RETURN USR(ADDR(C$)+1,ADDR(V%()))
When that is translated to OB3, replacing the string of XXXXX... with the hex code in the comment will make a procedure that can stow an arbitrary string of code or data input by H$ anywhere you can point it to by the input A%. The reason for this weird method is that the procedure cannot build itself.

Once you have it transferred to an Organiser pack, it will solve (or in a moment of misguided boredom, cause) some tough problems.
It can replace both POKCNV% and CONV$ when working with machine code in OPL.
If anyone wants to see a full listing of the ASM (and more explanation of why I did it) there's one on my site at lostgallifreyan.org in the software section.