Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version P 1.00 3/01/86; site pucc.BITNET Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!puvax2!pucc.BITNET!6101695 From: 6101695@pucc.BITNET (Raymond Chen) Newsgroups: net.micro.apple Subject: Re: ROM to RAM Message-ID: <566@pucc.BITNET> Date: Sun, 18-May-86 11:28:39 EDT Article-I.D.: pucc.566 Posted: Sun May 18 11:28:39 1986 Date-Received: Fri, 23-May-86 04:35:06 EDT References: <203@neoucom.UUCP> <3440@reed.UUCP> Reply-To: 6101695@pucc.BITNET Distribution: net Organization: Princeton University Computing Center Lines: 66 > DOS links into BASIC's "charget" routine. Well, sort of. DOS actually links into KSW, which is a part of the system, not BASIC. This explains how DOS can operate from within the monitor or from Integer BASIC. (Integer BASIC does not have a CHARGET routine.) KSW is not a subroutine. KSW is a vector which resides at $38/$39 (zero page). It is referenced by KEYIN ($FD0C) which is the "official" way of getting characters from the keyboard. DOS doesn't worry too much about KSW. The only reasons it bothers to trap input is so that (a) it can act upon DOS commands typed directly at the keyboard (like CATALOG), (b) it can feed INPUT statements when you are reading from the disk (with OPEN file, READ file) and (c) it can feed GETLN (the "official" line input routine) when you are EXECing a file. Actually, most of DOS's work is done by its vector into CSW. CSW is yet another vector (at $36/$37) which is called by COUT, the "official" Character OUTput routine.) It is there that DOS sniffs for a RETURN followed by Ctrl-D. > The other way to extend function is with the "&" function . . . I have found the Apple PugetSound Program Library Exchange (the people who put out Call -APPLE) publication "All About Applesoft" to be very handy, especially the section on Applesoft internal entry points. > DOS is very tenacious about giving up control. > . . . I've found the best way to take over control from DOS is >to attack DOS itself. I recommend the "official" method of installing custom routines: 1. Install your routine as if DOS didn't exist. 2. Call $03EA. $03EA (DOSCONN) connects DOS to your routine by copying the CSW and KSW vectors into the DOS table at $AA53/AA54 and $AA55/AA56. If you want to disconnect DOS completely, just put $FDF0 into CSW and $FD1B into KSW, and DON'T call DOSCONN. Warning: Once DOS is disconnected, you can't do things like CATALOG and such. If you want to reconnect DOS, just call $03EA. (CALL 1002 from BASIC) >You can use this: > > 10 FOR I=13*4096 to 65535 > 20 POKE I,PEEK(I) > 30 NEXT > >to move the ROM version to RAM. It may work, but it is excruciatingly slow. My method: 1. Drop into the monitor (CALL -151) 2. C081 C081 (This write-enables the bank-switched RAM, but does not read-enable it. If it were read-enabled, the system would hang, since there is nothing there to read.) 3. D000