<?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>S12 / MagniV MicrocontrollersのトピックWhen will CCR.V be set? Could you give an example?</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/When-will-CCR-V-be-set-Could-you-give-an-example/m-p/1963925#M20169</link>
    <description>&lt;P&gt;The MCU is MC9S12ZVCA96, and the IDE is codewarrior 10.7.&lt;/P&gt;&lt;P&gt;We need to check the overflow bit CCR.V after an addition operation.&lt;/P&gt;&lt;P&gt;There is no intrinsic function for CCR.V checking. So we can't let the compiler to generate BVC/BVS instruction except assembly language.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 29 Sep 2024 06:28:13 GMT</pubDate>
    <dc:creator>fqh</dc:creator>
    <dc:date>2024-09-29T06:28:13Z</dc:date>
    <item>
      <title>When will CCR.V be set? Could you give an example?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/When-will-CCR-V-be-set-Could-you-give-an-example/m-p/1963925#M20169</link>
      <description>&lt;P&gt;The MCU is MC9S12ZVCA96, and the IDE is codewarrior 10.7.&lt;/P&gt;&lt;P&gt;We need to check the overflow bit CCR.V after an addition operation.&lt;/P&gt;&lt;P&gt;There is no intrinsic function for CCR.V checking. So we can't let the compiler to generate BVC/BVS instruction except assembly language.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2024 06:28:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/When-will-CCR-V-be-set-Could-you-give-an-example/m-p/1963925#M20169</guid>
      <dc:creator>fqh</dc:creator>
      <dc:date>2024-09-29T06:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: When will CCR.V be set? Could you give an example?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/When-will-CCR-V-be-set-Could-you-give-an-example/m-p/1965582#M20173</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;yes you can do any of ASM branch instructions or you can use following code and then work with C and defined variable. The OV test is not a standard function because it would require&amp;nbsp; application SW reaction. It would enter additional code which is usually not necessary. This must be handled by app. engineer which also leads him to think about used variables ranges.&lt;/P&gt;
&lt;P&gt;//================= GLOBAL VARIABLES ===================================&lt;BR /&gt;unsigned char CCRbackup;&amp;nbsp; // temp variable to store CCRL, byte because CCRL is only used &lt;BR /&gt;//================= MACROS ==========================================&lt;/P&gt;
&lt;P&gt;// save CCR to variable CCRbackup ... reg. D0 is used as an information carrier&lt;BR /&gt;#define getCCR() { asm PSH D0;&amp;nbsp;&amp;nbsp; asm TFR CCL,D0;&amp;nbsp;&amp;nbsp; asm ST D0, CCRbackup;&amp;nbsp;&amp;nbsp; asm PUL D0; }&lt;/P&gt;
&lt;P&gt;//==================================================================&lt;BR /&gt;// Main&lt;BR /&gt;//==================================================================&lt;BR /&gt;void main(void) &lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; //------------------------&lt;BR /&gt;&amp;nbsp; // example of reading CCR start, the CCR is tored into the global variable CCRbackup&lt;BR /&gt;&amp;nbsp; //------------------------&lt;BR /&gt;&amp;nbsp; getCCR();&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; // the CCRL is stored in the CCRbackup variable&lt;BR /&gt;&amp;nbsp; //------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Ladislav&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 09:19:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/When-will-CCR-V-be-set-Could-you-give-an-example/m-p/1965582#M20173</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2024-10-02T09:19:02Z</dc:date>
    </item>
  </channel>
</rss>

