Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!hybrid!becker!cbmtor!jb From: jb@cbmtor.UUCP (Jim Butterfield ) Newsgroups: comp.sys.cbm Subject: Re: C-128 programming questions concerning memory and ML Summary: brief answers Keywords: C128, bank switching Message-ID: <302@cbmtor.UUCP> Date: 5 Sep 90 06:14:41 GMT References: <685.26dbd201@iccgcc.decnet.ab.com> Reply-To: jb@cbmtor.UUCP (Jim Butterfield ) Organization: (courtesy) Commodore Business Machines (CANADA) Lines: 39 Short responses to bank switch questions: 1) You cannot literally bankswitch to another bank in the same address area. The usual transfer sequences ($FF6E, $FF71 == JSRFAR, JMPFAR) will get you there in many cases, but if you have switched out ROM, even the above will obviously get you nowhere. In that case, replace the above addresses with $02CD and $02E3 .. it's instructive to read the code of these. Unless you have good reason, try not to put code in the RAM areas above $C000, where this kind of problem arises. 2) I've never MMU-relocated zero page, but since it's a hardware operation, I suspect that if you did switch it, EVERYTHING would go to the newly defined area. Doubt that there is much use for this feature on the 128. 3) The location of ML code may be a matter of style. Generally, I prefer Bank 0, above any area that Basic might want. Be careful here: it's not safe to assume that Basic always starts at $1C00 .. graphics activities can move it and the DOS wedge does truly horrible things. Keep in mind that your Basic trigger program can SYS anywhere to any RAM bank with code such as BANK 0 : SYS xxxxx. The moment you get there, however, you are running M/L that has the whole Kernal switched out (interrupts will be OK). It is strongly desirable that you put the main Kernal back with LDA #$0E : STA $FF00. Before you RTS back to Basic, if ever, you should return to the BANK 0 setup with LDA #$3F : STA $FF00. Remember to have the resuming Basic program go back to BANK 15. ... The 128 gets little play these days, but I've slipped a short article on this into a forthcoming issue of (the reconfigured) COMPUTE! magazine. Watch for it sometime in autumn. --Jim Butterfield -- -- : My boss doesn't understand me... : Jim Butterfield, Toronto : : .. and I'm my own boss! : jb@cbmtor :