Using RAM Hooks with DOS
Posted: Sat Mar 05, 2016 12:19 pm
Hi all,
I was just tinkering with some old code of mine that made use of input/output RAM hooks ($167/$16A) on my lovely new DOSPlus system, and noticed that instead of the RTS I was expecting to see, DOS had written them over with JSRs of its own. I didn't know it did that! (I never had DOS back in the day). In fact, looking at http://dragon32.info/info/memmap.html, I see it does it to all the RAM hooks.
Why does it do this? Should my code adapt to being under DOS, and pass control to that address rather than simply RTS? What happens if I just overwrite these vectors (which my code had been doing quite happily until I just noticed!)?
Cheers, Tony
I was just tinkering with some old code of mine that made use of input/output RAM hooks ($167/$16A) on my lovely new DOSPlus system, and noticed that instead of the RTS I was expecting to see, DOS had written them over with JSRs of its own. I didn't know it did that! (I never had DOS back in the day). In fact, looking at http://dragon32.info/info/memmap.html, I see it does it to all the RAM hooks.
Why does it do this? Should my code adapt to being under DOS, and pass control to that address rather than simply RTS? What happens if I just overwrite these vectors (which my code had been doing quite happily until I just noticed!)?
Cheers, Tony