<?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: Processor Status Register</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Processor-Status-Register/m-p/149167#M3697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read "1.5 Supervisor Programming Model﻿" in "cfprm.pdf" from here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/dsp/doc/ref_manual/CFPRM.pdf" rel="nofollow" target="_blank"&gt;http://cache.freescale.com/files/dsp/doc/ref_manual/CFPRM.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chapter 8 for the "Move from Status Register" and "Move to Status Register" instructions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The CPU registers are read by special instructions. The peripheral control registers are memory mapped. There's a big difference between the CPU Core and its peripherals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jul 2011 08:24:16 GMT</pubDate>
    <dc:creator>TomE</dc:creator>
    <dc:date>2011-07-14T08:24:16Z</dc:date>
    <item>
      <title>Processor Status Register</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Processor-Status-Register/m-p/149165#M3695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello iam working with a MCF5282 and at the moment i am searching the adress of the Proseccor Status Registers (SR). I found the makros but no pointer to the momory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does any one know the answer for my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 18:12:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Processor-Status-Register/m-p/149165#M3695</guid>
      <dc:creator>PEGE</dc:creator>
      <dc:date>2011-07-13T18:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Processor Status Register</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Processor-Status-Register/m-p/149166#M3696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I am not mistaken, the processor status register does not lie in the normal address space. It is accessed with special CPU instructions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 21:57:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Processor-Status-Register/m-p/149166#M3696</guid>
      <dc:creator>scifi</dc:creator>
      <dc:date>2011-07-13T21:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Processor Status Register</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Processor-Status-Register/m-p/149167#M3697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read "1.5 Supervisor Programming Model﻿" in "cfprm.pdf" from here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/dsp/doc/ref_manual/CFPRM.pdf" rel="nofollow" target="_blank"&gt;http://cache.freescale.com/files/dsp/doc/ref_manual/CFPRM.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chapter 8 for the "Move from Status Register" and "Move to Status Register" instructions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The CPU registers are read by special instructions. The peripheral control registers are memory mapped. There's a big difference between the CPU Core and its peripherals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2011 08:24:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Processor-Status-Register/m-p/149167#M3697</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2011-07-14T08:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Processor Status Register</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Processor-Status-Register/m-p/149168#M3698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for your help and the link.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;I&lt;/SPAN&gt;&lt;SPAN&gt;'ve&lt;/SPAN&gt; &lt;SPAN&gt;realized as follows&lt;/SPAN&gt;&lt;/SPAN&gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;asm {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp;&amp;nbsp; #0x00002000,d0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.w&amp;nbsp;&amp;nbsp; d0,SR&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2011 13:22:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Processor-Status-Register/m-p/149168#M3698</guid>
      <dc:creator>PEGE</dc:creator>
      <dc:date>2011-07-14T13:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Processor Status Register</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Processor-Status-Register/m-p/149169#M3699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be using the MACROS provided by your development system for this purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We're using standard headers with our GCC-based build environment. If you're using something else, check what they're using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance this is what we use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 8pt; font-family: courier new,courier;"&gt;/*&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt; * Functions provided by mcf5xxx.s&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;uint32_t asm_set_ipl(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_cacr(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_acr0(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_acr1(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_acr2(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_acr3(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_other_a7(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_other_sp(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_vbr(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_macsr(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_mask(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_acc0(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_accext01(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_accext23(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_acc1(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_acc2(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_acc3(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_sr(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_rambar0(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_rambar1(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_mbar(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_mbar0(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;void mcf5xxx_wr_mbar1(uint32_t);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to write directly to the status register, use "mcf5xxx_wr_sr(MCF5XXX_SR_S)".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you always consistently use these functions to write to these registers, then a simple search will find all the places in your code where you are writing to these registers. If you scatter "asm" statements around and aren't consistent in the formatting it makes it a lot harder to check and reverse-engineer the code when needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want to change the CPU Interrupt Priority Level (which after initialisation is the only thing you should be changing in the SR) then use "asm_set_ipl()" instead.And you should always use this like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Disable interrupts */
&amp;nbsp;&amp;nbsp;&amp;nbsp; uint16_t old_ipl = asm_set_ipl( 7 );

&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Do whatever needed protecting... */

&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Restore interrupts */
&amp;nbsp;&amp;nbsp;&amp;nbsp; asm_set_ipl(old_ipl);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for the "save and restore" is that the above code can be called from routines that have already disabled interrupts. This is a far better practice that using simple "disable" and "enable" calls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:51:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Processor-Status-Register/m-p/149169#M3699</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2020-10-29T08:51:13Z</dc:date>
    </item>
  </channel>
</rss>

