Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!gem.mps.ohio-state.edu!ginosko!uunet!mcvax!ukc!tcdcs!csvax1.cs.tcd.ie!ecarroll From: ecarroll@csvax1.cs.tcd.ie (Eddy Carroll) Newsgroups: comp.sys.cbm Subject: Re: memory management Message-ID: <52833@csvax1.cs.tcd.ie> Date: 21 Aug 89 13:07:18 GMT References: <9313@cs.Buffalo.EDU> Organization: Computer Science Department, Trinity College Dublin Lines: 32 In article <9313@cs.Buffalo.EDU>, bowen@cs.Buffalo.EDU (Devon E Bowen) writes: > I'm working under C Power which seems to shut down the BASIC ROM for > extra program space, but it leaves the I/O section and the kernal ROM. > I need some extra buffer space for my code and I don't need any of the > kernal functions, so I want to shut down that ROM area. I grab byte > $01, and it with $fd (to clear the kernel ROM bit) and put it back. [ Goes on to describe how accessing the 80-column chip locks up the system ] > Maybe having both the BASIC ROM and kernal ROMs > shut off automatically shuts off the I/O area? Hi there, your last comment above is exactly what is happening. When you switch out the Kernal ROM, this ALWAYS switches out the BASIC ROM as well. In this situation, Bit 0 of loc $01 now controls whether RAM or I/O is mapped into the $D000 area. With the bit set, the I/O area is mapped in, with the bit clear, RAM is mapped in. Since C-Power is clearing that bit, and you then clear the Kernal bit, you end up with a full 64K of continuous RAM. The solution is very simple: After ANDing the contents of $01 with $FD, just OR it with $01 before storing it back. BTW, as an aside: be very careful if you are accessing the 80 column chip from within interrupts as well as from your main code. (This caused me some trouble in a comms package I did 18 months go, which had an onscreen clock). You need to setup a semaphore to guarantee exclusive access to the registers, otherwise weird things will happen. Eddy -- Eddy Carroll ----* Genuine MUD Wizard | "You haven't lived until INTER: ecarroll@cs.tcd.ie | you've died in MUD!" UUCP: {..uunet}!mcvax!ukc!cs.tcd.ie!csvax1!ecarroll | -- Richard Bartle