I just realized that I never needed to load with the Amsdos after destroying the entire ram.
I know how to reinitialise ROM 7:
ld hl,(#be7d)
ld a,(hl)
ld (num_drive),a
% !! TRASH everything here !!
ld hl,#abff
ld de,#40
ld c,7
call #bcce
ld hl,(#be7d)
num_drive = $+1
ld (hl),0
But I need to reinit #00-&40 and >#a600 areas.
How do you do it?
I saw some methods here and here, but I am not sure of their reliability.
Hi,
you will find some ideas here :
https://amstradplus.forumforever.com/t427-Loader-sous-Amsdos.htm
or
https://amstradplus.forumforever.com/t381-Loader-universel.htm
But, but, but... In my mind, restoring rom 7 wil make it difficult to maintain mass memory compatibility.
The only solution I see is to restore the memory range from #a6xx to #bfff (So it will need to save it previously wherever you want before restore it!)
I've been looking in to this a bit myself lately, and have been wondering about mass storage devices. Are you saying you would need to save &a600-&bfff somewhere to maintain compatibility with mass storage? That seems ludicrous if I've understood you correctly.
it's more complicated.
If you want a better way, you'll have to do a basic program which could execute your asm code, because, unfortunately, when you
run" your binaries code, all i/o system is reseted and i/o tape is reinstalled. That's why you need to re-activate rom 7 (except on a
basic program).
So first step is :
-doing a basic program
-save #A6xx-#bfff plage
-execute your code
-restore saved plage
-load your next code
...etc...
Using this way will do you code compatible with ALL mass storage and amsdos, of course !
"The only solution I see is to restore the memory range from #a6xx to #bfff (So it will need to save it previously wherever you want before restore it!)"
So AST, You're describing what I did, right?
I prefer "the best solution" and yes, it's probably what you did.
I will probably write an article about that.