<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: simple assembly &amp;quot;illegal instruction&amp;quot; exception handler</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simple-assembly-quot-illegal-instruction-quot-exception-handler/m-p/167000#M5859</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Niel,&lt;/P&gt;&lt;P&gt;since you try to return with a RTE the processor expects to find&lt;/P&gt;&lt;P&gt;a format field on the stack. You probably intended to return with&lt;/P&gt;&lt;P&gt;a RTS instruction. Take a look into the documentation about&lt;/P&gt;&lt;P&gt;"Exception Stack Frame Definition".&lt;/P&gt;&lt;P&gt;Regards, Georg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2009 17:27:22 GMT</pubDate>
    <dc:creator>taigbr</dc:creator>
    <dc:date>2009-03-26T17:27:22Z</dc:date>
    <item>
      <title>simple assembly "illegal instruction" exception handler</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simple-assembly-quot-illegal-instruction-quot-exception-handler/m-p/166999#M5858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any one have a simple assembly "illegal instruction" exception handler that allows the program to continue after skipping over the illegal instruction?&amp;nbsp; Here is what I have so far (it executes the routine but the routine doesn't work):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;DEBUG_EXC_HANDLER:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l #0x00000001,%D0 || put 1 in D0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add.l %D0,%D3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; || add D0 to D3 and put the result in D3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ||(simple counter so I can see what's happening) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l (%A7)+,%D7&amp;nbsp; || pop status off stack&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l (%A7)+,%D7&amp;nbsp; || pop pc off stack&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l #0x00000002,%D1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l %D7,%D0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add.l %D1,%D0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; || add D1 to D0 and put the result in D0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l %D0,-(%A7)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; || set top of stack to be error pc+2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rte&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;|| end&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this handler, I get a "format error" exception (different exception) right after the rte.&amp;nbsp; Clearly I am not manipulating the stack correctly.&amp;nbsp; Any ideas?&amp;nbsp; Is it even possible to recover?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Niel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 03:46:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simple-assembly-quot-illegal-instruction-quot-exception-handler/m-p/166999#M5858</guid>
      <dc:creator>order324</dc:creator>
      <dc:date>2009-03-26T03:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: simple assembly "illegal instruction" exception handler</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simple-assembly-quot-illegal-instruction-quot-exception-handler/m-p/167000#M5859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Niel,&lt;/P&gt;&lt;P&gt;since you try to return with a RTE the processor expects to find&lt;/P&gt;&lt;P&gt;a format field on the stack. You probably intended to return with&lt;/P&gt;&lt;P&gt;a RTS instruction. Take a look into the documentation about&lt;/P&gt;&lt;P&gt;"Exception Stack Frame Definition".&lt;/P&gt;&lt;P&gt;Regards, Georg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 17:27:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simple-assembly-quot-illegal-instruction-quot-exception-handler/m-p/167000#M5859</guid>
      <dc:creator>taigbr</dc:creator>
      <dc:date>2009-03-26T17:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: simple assembly "illegal instruction" exception handler</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simple-assembly-quot-illegal-instruction-quot-exception-handler/m-p/167001#M5860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok that seemed to fix it.&amp;nbsp; I had read the section about the two entries on the stack but it was not clear to me that the rte read back that info and used it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Niel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 04:00:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simple-assembly-quot-illegal-instruction-quot-exception-handler/m-p/167001#M5860</guid>
      <dc:creator>order324</dc:creator>
      <dc:date>2009-03-27T04:00:41Z</dc:date>
    </item>
  </channel>
</rss>

