Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!apple!motcsd!starnet!sschaem From: sschaem@starnet.uucp (Stephan Schaem) Newsgroups: comp.sys.amiga.programmer Subject: Re: Correct code for turning off 020/030 caches? Message-ID: <1991Jun8.132157.8194@starnet.uucp> Date: 8 Jun 91 13:21:57 GMT References: <1991Jun5.033401.27422@en.ecn.purdue.edu> Organization: Starnet-Public Access UNIX-Los Altos,CA 415-949-3133, login:info Lines: 33 Just a qucky to turn cache off: Check the CPU with exec (Execbase, attflags) if 2.x or greater use the exec function: CacheControl Otherwise try the following... move.w #$4000,($dff09a).l lea NoCache(pc),a0 lea ($80).w,a1 move.l (a1),-(sp) move.l a0,(a1) trap #0 move.l (sp)+,(a1) moveq #0,d0 rts NoCache: movec CACR,d0 and.b #$fe,d0 movec d0,CACR rte The obove should work, I dont know any other way to do it on 1.0+. Any comment will be apreciated. I sugest You save the cache state and write a library with cache function instead if working in multitasking under <2.x. I only use a variant of the obove when I dont have the ROM loaded using a trap library for supervisor function. Hope this what you where looking for? Stephan.