home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / atari / st / tech / 6298 < prev    next >
Encoding:
Text File  |  1992-12-16  |  2.0 KB  |  54 lines

  1. Newsgroups: comp.sys.atari.st.tech
  2. Path: sparky!uunet!newsflash.concordia.ca!mizar.cc.umanitoba.ca!vspicer
  3. From: vspicer@ccu.umanitoba.ca
  4. Subject: HELP! how do i clear CACR on a TT without 68030 assembler??
  5. Message-ID: <BzCxFC.CEo@ccu.umanitoba.ca>
  6. Originator: vspicer@ccu.umanitoba.ca
  7. Sender: news@ccu.umanitoba.ca
  8. Nntp-Posting-Host: ccu.umanitoba.ca
  9. Organization: University of Manitoba, Winnipeg Manitoba Canada
  10. Date: Wed, 16 Dec 1992 14:42:35 GMT
  11. Lines: 41
  12.  
  13. hi again,
  14.  
  15.     we are working on modifying a piece of data acquisition and
  16. analysis software on our TT030. this code was originally written in
  17. Megamax C, and porting it to Lattice C's 68030-generating compiler is
  18. non-trivial due to the lack of in-line assembly in Lattice.
  19.  
  20.     anyway, i'm doing some DMA transfer stuff to a SCSI based
  21. CAMAC crate controller. the driver code is in C, not assembler. the
  22. problem is after a DMA transfer has finished the Cache Control Register
  23. (CACR) on the 68030 needs to be cleared of instructions and data
  24. queued (OR with 0x808). if this isn't done evil things happen when you
  25. try to do the next DMA transfer.
  26.  
  27.     is there any way in Megamax C to "hard code" the raw machine
  28. code to execute the "move cacr,d0" and "move d0,cacr" commands which
  29. Megamax's inline assembler doesn't understand? i can generate the
  30. raw machine code to do this in Lattice's assembler, it's just:
  31.  
  32.     move    sr,-(sp)         ; save sr
  33.     ori    #$700,sr        ; no interrupts
  34.     move    cacr,d0            ; get cacr
  35.     ori.w    #$808,d0        ; clear data and instruction caches
  36.     move    d0,cacr            ; reload cacr
  37.     move    (sp)+,sr        ; interrupts back on
  38.     rts                ; go back 
  39.  
  40.     i was thinking of just loading the bytes generated from this
  41. code into a char array then issuing an inline assembler command to
  42. jsr to the address of the array, then return back with the
  43. rts. or is this nuts?
  44.  
  45.     help appreciated. thanks in advance
  46.  
  47.         vic spicer
  48.  
  49.  
  50. ------
  51. vic spicer, recent PERL convert/ data systems,instrument electronics and
  52. software person with the Time of Flight Mass Spec. Lab
  53. at the University of Manitoba Dept. of Physics
  54.