I have revisited my HMLOADER from 20 or more years ago. This is a way to embed assembly code inside an XB program and have it run directly from high memory using CALL LINK. Most of it has been rewritten and the code was greatly improved. Now you can resequence and even load an XB program without overwriting the embedded code.
One of the neat tricks I discovered recently is that you can do useful things by modifying the “Highest Address in Expansion Memory” located at >8384 or -31868. With the 32K memory expansion this will normally contain >FFE7. If you CALL LOAD(-31868,0,0) then the XB interpreter thinks there is no expansion memory and will use VDP ram to load and run a program. But even though the program is running from VDP ram, all the 32K can be seen by XB. It can still CALL PEEK, CALL LOAD and CALL LINK as before!
With this trick you could use 32K of assembly subroutines with an XB program. Also, I think you could run XB programs from VDP and CPU ram at the same time. You'd need to store the scratchpad when going from one to the other. Not sure how useful this would be, but it is a neat trick.
Similarly, changing this address makes it possible to OLD DSKn.PROGRAM without overwriting embedded code.
The included docs tell how to do this with HMLOADER2.