Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!lll-crg!lll-lcc!well!ptsfa!ski!dr From: dr@ski.UUCP (David Robins) Newsgroups: net.micro.apple Subject: Re: Apple //e Interrupts Message-ID: <283@ski.UUCP> Date: Tue, 8-Jul-86 18:58:17 EDT Article-I.D.: ski.283 Posted: Tue Jul 8 18:58:17 1986 Date-Received: Thu, 10-Jul-86 05:00:12 EDT Reply-To: dr@ski.UUCP (David Robins) Organization: Smith-Kettlewell Institute, S.F., CA. Lines: 109 >Subject: Apple 2E/enhanced monitor rom >Keywords: interrupt response time > > I just got in an Apple 2E/enhanced computer that is >replacing an older vanilla Apple 2E in an lab application that we >are running. The application uses an ADC driven by interrupts to >look at a process every 100 cpu clocks. > > Everything was fine when we used regular Apple 2s and 2Es. >Now our application bombs, as the monitor ROM (under DOS 3.3) seems >to do something that regularly shuts off interrupts for 250-300 uS. > > For my application, I don't give a hoot about the mouse >support. What I was wondering, does anybody know if I can >de-enhance my computer by putting old ROMs in it? Anybody happen >to know if the EF and CD ROMs can be replaced with 2764s? It would >save us a lot of time to burn our own. The original enhancement kit had an available "About Your Enhanced Apple //e: Programmer's Guide", Apple Product number A2L2072, which was available FREE! The same information is in the new Apple //e Technical Reference Manual, published by Addison-Wesley, and available at some bookstores. (The older //e reference manual covered the old //e.) On pages 24-25 of the Programmer's Guide, and/or pages 154-155 on the new tech manual, the interrupt handler is discussed. "Once the built-in interrupt handler is called, it takes at least 150-200 microseconds for it to call your interrupt handling routine. After your routine returns, it takes 40 to 140 microseconds fto restore memory and return to the interrupted program." "If memory is in the standard state when the interrupt occurs, the total overhead for interrupt processing is about 150 muicroseconds less than if memeory is the worst state. (The sorst state is one that requires the most work to set up for: 80STORE and PAGE2 on; auxiliary memory switched in for reading and writing; bank-switched memory page 2 in the auxiliary bank switched in for reading and writing; and internal $Cn00 ROM switched in)." "Interrupt overhead will be greater if your interrupt handler is installed through an operating system's interrupt dispatcher." ie. the ProDOS MLI interrupt handler. Therefore, if your time requirements need the faster handling as on the old //e, which jumped right to your routine after a few instructions, then you can "unenhance" the new //e by using the older CD and EF ROMs. Yes, they can be copied onto 2764 EPROMs with a copier. (see Jim Sather's book "Understanding the Apple //e"). Don Lancaster, in "Enhancing Your Apple II and //e, Volume 2", recommends the 2764n EPROM, which he says MUST be an INTEL or HITACHI brand with 28 pins and an access time of 250 nanoseconds or less. The old interrupt handling on the old //e was somewhat troublesome, because it sometimes interfered with DOS 3.3. The handler saved the accumulator in $45, which is used by DOS as a scratchpad location during disk accesses and possibly other functions. There was the probability of clobbering DOS with your interrupts. The new handler doesn't do it the same way. If you're going to the trouble to burn your own CD and EF ROMs, why not also add the correction to the handler as advocated by Morgan Caffrey, and published in several places, as well as used inthe old Roger Wagner Double-Time interrupt driven printer routine. From Apple Orchard, March, 1983, Interrupts and the //e: old //e code improved code FA40 STA $45 FA40 JMP ($03FE) FA42 PLA FA43 STA $45 FA43 PHA FA45 PLA FA44 ASL FA46 PHA FA45 ASL FA47 ASL FA46 ASL FA48 ASL FA47 BMI $FA4C FA49 ASL FA49 JMP ($03FE) FA4A BPL $FA5F FA4C PLP You also have to make the DOS interrupt vector at $3FE point to $FA43 rather than $FA40. (DOS patch with sector editor is track 0, sector $0D, bytes $7F and $80, changed from $65,FF to $43,FA.) (In memory, using virgin DOS 3.3, the locations are $9E7F,9E80 changed from $65,FF to $43,FA, and then INIT a blank disk.) I highly recommend the Roger Wagner Publication called the Interrupt Experimenter's Kit. For about $35 (??) or so, you get a manual about interrupts, a disk full of demo programs and assembler subroutines, and a hardware card whic is a 200 interrupts/seconds generator. Finally, the Applied Engineering Timemaster H.O. clock comes with a disk than had a DOS intrrupt patch. This replaces every reference in DOS that uses $45, to some other value so DOS doesn't bomb. -- ==================================================================== David Robins, M.D. Smith-Kettlewell Eye Research Foundation (previously known as: Smith-Kettlewell Institute of Visual Sciences) 2232 Webster St; San Francisco CA 94115 415/561-1705 (voice) {ihnp4,qantel,dual}!ptsfa!ski!dr The opinions expressed herein do not reflect the opinion of the Institute!