|
Post by stiggity on Jan 12, 2022 0:25:52 GMT
I set end of main file as follows.. a=(256*peek(4625)+peek(4624))-2, after main body is loaded.
Then set a$ to "module.z26":dv%(1)=8 bload(a$),d0,u(dv%(1)),p(a):sys20303:goto module line number
;------------------------------------------------------------------------------ I have a main body of code from 0 to 59999 (Not each line is occupied), which stays in memory the entire duration prg runs... i then call the above, and (module) loads, and links to the main body..
Is there a way to have like a "module2.z26" that links to the end of the first module? then if i load in another regular module, the 2nd and 3rd get overwritten, and the new module is linked as shown. Pretty much, im trying to link a NEW smaller module, and attach it to the end of the mainbody/module/(smaller module(module2)) I'm having no luck whatsoever. I fully understand this is BASIC,
|
|
|
Post by w on Jan 12, 2022 5:35:14 GMT
Instead of sys20303 try poke127,0:sysdec("9fc7"):poke127,128
|
|
|
Post by stiggity on Jan 13, 2022 4:28:53 GMT
guest? will that work for the smaller 2nd mod? or use that for the first mod?
|
|
|
Post by stiggity on Jan 13, 2022 22:29:45 GMT
I looked at the address, and it's got something to do with pushing variables someplace..?
|
|
|
Post by w on Jan 14, 2022 5:33:23 GMT
$4f4f(20303) relinks the basic lines, but does not change the end of the main body(4624/4625). Every module loaded with bload(moduleX),p(a) will load at the same place: the end of the main body. $9fc7 relinks and then sets 4624/4625 to the end of the bload(moduleX),p(a).
$9fc7 does the setting of 4624/4625 with $4f82. It seems like $4f4f does that too, but it does not. Check for yourself by peeking 4624/4625 before and after a=(256*peek(4625)+peek(4624))-2:bload(moduleX),p(a):sys20303
poke127,0 is direct mode, poke127,128 is program mode. 127($7f) needs to be 0 for $9fc7 to do only jsr $4f4f, jsr $4f82.
|
|
|
Post by stiggity on Jan 14, 2022 19:30:54 GMT
Whoah!!! that's amazing!! I constantly reference "Mapping the 128" but never ventured this far!!! After some testing it's, wonderful. Thank you for making the time to help, and explain. IDK your Handle, but your help's greatly appreciated!!!
|
|
|
Post by stiggity on Jan 15, 2022 1:41:39 GMT
wGuest?? What would proper setup look like. I tried in a crude manner, and it worked, but after testing it with the actual code, it isn't working. Would be be setup like this? after loading the main body into memory, I execute this.. q=(256*peek(4625)+peek(4624))-2 then, to load the first module in I.. a$="module1":bload(a$),d0,u(dv%(1)),p(q):poke127,0:sysdec("9fc7"):poke127,128:goto60000 that part is working, then to link a smaller module to the end of main body+first module i would do this..?? a$="module2":a=(256*peek(4625)+peek(4624))-2:bload(a$),d0,u(dv%(1)),p(a):poke127,0:sysdec("9fc7"):poke127,128:goto62000 or do i sys20303 at the end of module 2??? sorry, trying to grasp new technique.
|
|
|
Post by stiggity on Jan 19, 2022 23:05:28 GMT
i figured it out, and posted so days ago.. wGuest?? thanks alot.. your advice/method has opened all sorts of new windows/ideas!
|
|
|
Post by stiggity on Jan 22, 2022 22:28:04 GMT
wGuest? If in between flipping in/out BASIC overlays, would a bload"file",p(dec("9700")),dv do any damage to the hi/low pointers stashed in the first execution?
|
|
|
Post by w on Jan 23, 2022 4:18:37 GMT
No, but peek and print the pointers to screen before and after bload and you will know.
|
|