embedded systems developers tools, cross compilers
  Home  |   SwiftX Archive  |   SwiftForth Archive  |

68k exception handling

From: Kenneth Butterfield <kbutterfield_at_lanl.gov>
Date: Wed, 15 Oct 2003 16:28:51 -0600

I ran into an interesting problem with exception handling on the 68332 switfx system.

I found I could save and restore all of the data registers and a0...a3 within an exception handler. The system crashes if I save a4, a5, or a6. I was not even doing anything with the registers as I was just trying out the mmov command. (I was clearing the source of the exception)

My question is two fold. How did anything in the system know I had saved and restored these registers? and Is it possible to call a forth level word from within the exception routine?

A third item is in the nature of a bug report about the assembler. I have included an instruction that I found would not assemble correctly in <xx> along with the dasm.
Thanks in advance,
Ken Butterfield

LABEL <works> RL R -) MMOV D0 D7 // A0 A3 ///
        4 INVERT #W CISR AB AND \ CLEAR INTERRUPT FLAG
       0hist # a0 mov
       adc AB d1 w. mov
       fff # d1 and
       D1 PHSUM AB ADD
       CDATA 52B01400 , IDATA
\ 1 #Q 0 D1 +X A0) ADD ( THIS DOES NOT COMPILE CORRECTLY )
       1 #Q HIT AB ADD
       r )+ d1 mov
       r )+ a0 mov
        R )+ RL MMOV D0 D7 // A0 A3 ///
       RTE

END-CODE

LABEL <fails> RL R -) MMOV D0 D7 // A0 A5 ///
        4 INVERT #W CISR AB AND \ CLEAR INTERRUPT FLAG
       0hist # a0 mov
       adc AB d1 w. mov
       fff # d1 and
       D1 PHSUM AB ADD
       CDATA 52B01400 , IDATA
\ 1 #Q 0 D1 +X A0) ADD ( THIS DOES NOT COMPILE CORRECTLY )
       1 #Q HIT AB ADD
       r )+ d1 mov
       r )+ a0 mov
        R )+ RL MMOV D0 D7 // A0 A5 ///
       RTE

END-CODE

code <xx>
    a0 r -) mov
    d1 r -) mov
    4 INVERT #W CISR AB AND \ CLEAR INTERRUPT FLAG \ CLEAR INTERRUPT FLAG
    0hist # a0 mov
    adc AB d1 w. mov
    fff # d1 and
    D1 PHSUM AB ADD
\ CDATA 52B01400 , IDATA
    1 #Q 0 D1 +X A0) ADD ( THIS DOES NOT COMPILE CORRECTLY )
    1 #Q HIT AB ADD
    r )+ d1 mov
    r )+ a0 mov
   RTE
end-code

 see <xx>
1142D4 A0 A7 -) MOV 2F08
1142D6 D1 A7 -) MOV 2F01
1142D8 FFFB #W CISR AB AND 0278FFFBFE20
1142DE 145090 # A0 MOV 207C00145090
1142E4 ADC AB D1 W. MOV 323900220000
1142EA FFF # D1 AND 028100000FFF
1142F0 D1 PHSUM AB ADD D3B900149098
1142F6 1 #Q 0 D1 +X A0) ADD 52B01000 <==== should be 52B01400
1142FA 1 #Q HIT AB ADD 52B900149094
114300 A7 )+ D1 MOV 221F
114302 A7 )+ A0 MOV 205F
114304 RTE 4E73 ok

Dr. Kenneth B Butterfield

phone: 505 667 8944

PO Box 1663
ms J562
Los Alamos National Laboratory
Los Alamos New Mexico 87545

"I do not trust a computer that I am not carrying!"

----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe" to swiftx-request_at_forth.com
For list command help, send subject "help" to swiftx-request_at_forth.com
Message archives are located at http://www.forth.com/archive/swiftx
----------------------------------------------------------------------
This list is a forum for SwiftX users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Wed Oct 15 2003 - 15:32:11 PDT

This archive was generated by hypermail 2.2.0 : Mon Dec 01 2008 - 03:04:48 PST