Determine the number of bytes that the routine needs.
Bump the pointer in 45:46 by that number of bytes.
Put the routine in that space.
SAVEing the program will include the ML routine.
Adding, modifying or deleting lines will not destroy your ML code, it stays there as long as you don't do a NEW.
Determine entry points of your routine relative to the contents of 45:46.
For an example check out the routine I developed for Jeff-20 at http://sleepingelephant.com/ipw-web/bul ... 5688#65688
The routine is relocatable and is 60 bytes long. The entry point is at the first location.
Load the routine first into e.g. the tapebuffer at 828.
Code: Select all
LOAD"PKW.PRG",8,1
Code: Select all
NEW
Code: Select all
X=PEEK(45)+256*PEEK(46)
?X
(returns 1027 for example, remember it)
X=X+60:PRINT X AND 255; INT(X/256)
(results in 63 and 4 for example)
POKE 45,63:POKE 46,4:CLR
Code: Select all
FOR I=0 to 59:POKE 1027+I,PEEK(828+I):NEXT
Code: Select all
10 X=PEEK(45)+256*PEEK(46)-60
20 POKE1,XAND255:POKE2,X/256
Code: Select all
110 K$=USR(131)
Regards,
Wim