home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.atari.st.tech
- Path: sparky!uunet!newsflash.concordia.ca!mizar.cc.umanitoba.ca!vspicer
- From: vspicer@ccu.umanitoba.ca
- Subject: HELP! how do i clear CACR on a TT without 68030 assembler??
- Message-ID: <BzCxFC.CEo@ccu.umanitoba.ca>
- Originator: vspicer@ccu.umanitoba.ca
- Sender: news@ccu.umanitoba.ca
- Nntp-Posting-Host: ccu.umanitoba.ca
- Organization: University of Manitoba, Winnipeg Manitoba Canada
- Date: Wed, 16 Dec 1992 14:42:35 GMT
- Lines: 41
-
- hi again,
-
- we are working on modifying a piece of data acquisition and
- analysis software on our TT030. this code was originally written in
- Megamax C, and porting it to Lattice C's 68030-generating compiler is
- non-trivial due to the lack of in-line assembly in Lattice.
-
- anyway, i'm doing some DMA transfer stuff to a SCSI based
- CAMAC crate controller. the driver code is in C, not assembler. the
- problem is after a DMA transfer has finished the Cache Control Register
- (CACR) on the 68030 needs to be cleared of instructions and data
- queued (OR with 0x808). if this isn't done evil things happen when you
- try to do the next DMA transfer.
-
- is there any way in Megamax C to "hard code" the raw machine
- code to execute the "move cacr,d0" and "move d0,cacr" commands which
- Megamax's inline assembler doesn't understand? i can generate the
- raw machine code to do this in Lattice's assembler, it's just:
-
- move sr,-(sp) ; save sr
- ori #$700,sr ; no interrupts
- move cacr,d0 ; get cacr
- ori.w #$808,d0 ; clear data and instruction caches
- move d0,cacr ; reload cacr
- move (sp)+,sr ; interrupts back on
- rts ; go back
-
- i was thinking of just loading the bytes generated from this
- code into a char array then issuing an inline assembler command to
- jsr to the address of the array, then return back with the
- rts. or is this nuts?
-
- help appreciated. thanks in advance
-
- vic spicer
-
-
- ------
- vic spicer, recent PERL convert/ data systems,instrument electronics and
- software person with the Time of Flight Mass Spec. Lab
- at the University of Manitoba Dept. of Physics
-