> SMLib v1.00 22-Jan-2001 % Create relocatable sideways ROM M Not suitable for BASIC 2 as OPT 2 does not suppress Branch out of range (: 2H mcode% &2000,L%-1: Must be enough space for two copies plus table <: F pass%=0 3 Popt%=sm_pass(pass%) Z [OPT opt% dEQUB 0:EQUW RelocTable nJMP Service x$EQUB &82:EQUB Copyright-RomStart EQUB &00:EQUS "ROM Title" &EQUB &00:EQUS "0.00 (00 Jan 0000)" .Copyright +EQUB &00:EQUS "(C)Author Name":EQUB &00 : .Service \ insert code here .... : .RelocTable ]:sm_table F"*Save ";~(mcode%+mclen%);" ";~O%;" FFFF0000 FFFBBC00"  : ݤsm_pass(pass%) pass%=0:mclen%=0 pass%=1:mclen%=O%-mcode% "P%=&8100-128*(pass%2) , O%=mcode%+mclen%*(pass%2)2 63pass%=1: O%+mclen%*2.125>L%:"Code overrun": @="4647",pass%+1,1) J: Tsm_table ^Bbase80%=mcode%+mclen%:base81%=mcode%:byte%=0:count%=0:off%=0: hTbyte80%=base80%?off%:byte81%=base81%?off%: off%>=mclen%:byte80%=&80:byte81%=&80 r] ((byte81%-byte80%) &FE)<>0 "ERROR: Offset by more than one page at &";~&8000+off% |M (byte80% &C0)=&80:byte%=byte%2+128*(byte81%-byte80%):count%=count%+1 1 count%=8:?O%=byte%:O%=O%+1:byte%=0:count%=0 (off%=off%+1:off%>=mclen% count%=0