<?xml version="1.0" ?><?xml-stylesheet type="text/xsl" encoding="UTF-8" href="iform.xsl" version="1.0"?><!DOCTYPE instructionsection  PUBLIC '-//ARM//DTD instructionsection //EN'  'iform-p.dtd'><!-- Copyright (c) 2010-2026 Arm Limited or its affiliates. All rights reserved. --><!-- This document is Non-Confidential. This document may only be used and distributed in accordance with the terms of the agreement entered into by Arm and the party that Arm delivered this document to. --><instructionsection id="DCPS1_a32" title="DCPS1 -- AArch32" type="instruction">
  <docvars>
    <docvar key="armarmheading" value="T1"/>
    <docvar key="instr-class" value="general"/>
    <docvar key="isa" value="T32"/>
    <docvar key="mnemonic" value="DCPS1"/>
  </docvars>
  <heading>DCPS1</heading>
  <desc>
    <brief>
      <para>Debug Change PE State to EL1</para>
    </brief>
    <authored>
      <para>Debug Change PE State to EL1 allows the debugger to move the PE into
EL1 from EL0 or to a specific mode at the current Exception level.</para>
      <para><instruction>DCPS1</instruction> is <arm-defined-word>UNDEFINED</arm-defined-word> if any of:</para>
      <list type="unordered">
        <listitem>
          <content>The PE is in Non-debug state.</content>
        </listitem>
        <listitem>
          <content>EL2 is implemented, EL2 is implemented and enabled in the current Security state, and any of:<list type="unordered">
              <listitem>
                <content>EL2 is using AArch32 and HCR.TGE is set to 1.</content>
              </listitem>
              <listitem>
                <content>EL2 is using AArch64 and HCR_EL2.TGE is set to 1.</content>
              </listitem>
            </list>
          </content>
        </listitem>
      </list>
      <para>When the PE executes <instruction>DCPS1</instruction> at EL0, EL1 or EL3:</para>
      <list type="unordered">
        <listitem>
          <content>If EL3 or EL1 is using AArch32, the PE enters SVC mode and LR_svc, SPSR_svc, DLR, and DSPSR become <arm-defined-word>UNKNOWN</arm-defined-word>. If <instruction>DCPS1</instruction> is executed in Monitor mode, SCR.NS is cleared to 0.</content>
        </listitem>
        <listitem>
          <content>If EL1 is using AArch64, the PE enters EL1 using AArch64, selects SP_EL1, and ELR_EL1, ESR_EL1, SPSR_EL1, DLR_EL0 and DSPSR_EL0 become <arm-defined-word>UNKNOWN</arm-defined-word>.</content>
        </listitem>
      </list>
      <para>When the PE executes <instruction>DCPS1</instruction> at EL2 the PE does not change mode,
and ELR_hyp, HSR, SPSR_hyp, DLR and DSPSR become
<arm-defined-word>UNKNOWN</arm-defined-word>.</para>
      <para>For more information on the operation of the DCPS&lt;n&gt; instructions, see <xref linkend="ARMARM_dcps">DCPS</xref>.</para>
    </authored>
  </desc>
  <alias_list howmany="0"/>
  <classes>
    <iclass name="T1" oneof="1" id="iclass_t1" no_encodings="1" isa="T32">
      <docvars>
        <docvar key="armarmheading" value="T1"/>
        <docvar key="instr-class" value="general"/>
        <docvar key="isa" value="T32"/>
        <docvar key="mnemonic" value="DCPS1"/>
      </docvars>
      <iclassintro count="1"/>
      <regdiagram form="16x2" psname="T32.w.bcrtrl.dcps.DCPS1_T1" tworows="1">
        <box hibit="31" width="3" settings="3">
          <c>1</c>
          <c>1</c>
          <c>1</c>
        </box>
        <box hibit="28" width="2" settings="2">
          <c>1</c>
          <c>0</c>
        </box>
        <box hibit="26" width="1" settings="1">
          <c>1</c>
        </box>
        <box hibit="25" width="4" settings="4">
          <c>1</c>
          <c>1</c>
          <c>1</c>
          <c>0</c>
        </box>
        <box hibit="21" width="2" settings="2">
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="19" width="4" name="imm4" usename="1" settings="4" psbits="xxxx">
          <c>1</c>
          <c>1</c>
          <c>1</c>
          <c>1</c>
        </box>
        <box hibit="15" width="1" settings="1">
          <c>1</c>
        </box>
        <box hibit="14" width="3" settings="3">
          <c>0</c>
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="11" width="10" name="imm10" usename="1" settings="10" psbits="xxxxxxxxxx">
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="1" width="2" name="opt" usename="1" settings="2" psbits="xx">
          <c>0</c>
          <c>1</c>
        </box>
      </regdiagram>
      <encoding name="DCPS1_T1" oneofinclass="1" oneof="1" label="">
        <docvars>
          <docvar key="armarmheading" value="T1"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="T32"/>
          <docvar key="mnemonic" value="DCPS1"/>
        </docvars>
        <asmtemplate><text>DCPS1</text></asmtemplate>
      </encoding>
      <ps_section howmany="1">
        <ps name="T32.w.bcrtrl.dcps.DCPS1_T1" sections="1" secttype="noheading">
          <pstext mayhavelinks="1" section="Decode" rep_section="decode">// No additional decoding required.</pstext></ps>
      </ps_section>
    </iclass>
  </classes>
  <explanations scope="all"/>
  <ps_section howmany="1">
    <ps name="T32.w.bcrtrl.dcps.DCPS1_T1" sections="1" secttype="Operation">
      <pstext mayhavelinks="1" section="Execute" rep_section="execute">if !<a link="func_Halted_0" file="shared_pseudocode.xml">Halted</a>() then Undefined(); end;

if <a link="func_EL2Enabled_0" file="shared_pseudocode.xml">EL2Enabled</a>() &amp;&amp; <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.EL == <a link="global_EL0" file="shared_pseudocode.xml">EL0</a> then
    let tge : bit = if <a link="func_ELUsingAArch32_1" file="shared_pseudocode.xml">ELUsingAArch32</a>(<a link="global_EL2" file="shared_pseudocode.xml">EL2</a>) then HCR().TGE else HCR_EL2().TGE;
    if tge == '1' then Undefined(); end;
end;

if <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.EL != <a link="global_EL0" file="shared_pseudocode.xml">EL0</a> || <a link="func_ELUsingAArch32_1" file="shared_pseudocode.xml">ELUsingAArch32</a>(<a link="global_EL1" file="shared_pseudocode.xml">EL1</a>) then
    if <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.M == <a link="global_M32_Monitor" file="shared_pseudocode.xml">M32_Monitor</a> then SCR().NS = '0'; end;
    if <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.EL != <a link="global_EL2" file="shared_pseudocode.xml">EL2</a> then
        <a link="func_AArch32_WriteMode_1" file="shared_pseudocode.xml">AArch32_WriteMode</a>(<a link="global_M32_Svc" file="shared_pseudocode.xml">M32_Svc</a>);
        <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.E = SCTLR().EE;
        if IsFeatureImplemented(FEAT_PAN) &amp;&amp; SCTLR().SPAN == '0' then <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.PAN = '1'; end;
        <a link="accessor_Rmode_2" file="shared_pseudocode.xml">Rmode</a>(14, <a link="global_M32_Svc" file="shared_pseudocode.xml">M32_Svc</a>) = ARBITRARY : bits(32);    // LR_svc
        SPSR_svc() = ARBITRARY : bits(32);
    else
        <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.E = HSCTLR().EE;
        ELR_hyp() = ARBITRARY : bits(32);
        HSR() = ARBITRARY : bits(32);
        SPSR_hyp() = ARBITRARY : bits(32);
    end;

    DLR() = ARBITRARY : bits(32);
    DSPSR() = ARBITRARY : bits(32);
else                                        // Targeting EL1 using AArch64
    <a link="func_AArch64_MaybeZeroRegisterUppers_0" file="shared_pseudocode.xml">AArch64_MaybeZeroRegisterUppers</a>();
    <a link="func_MaybeZeroSVEUppers_1" file="shared_pseudocode.xml">MaybeZeroSVEUppers</a>(<a link="global_EL1" file="shared_pseudocode.xml">EL1</a>);
    <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.nRW = '0';
    <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.SP = '1';
    <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.EL = <a link="global_EL1" file="shared_pseudocode.xml">EL1</a>;
    if IsFeatureImplemented(FEAT_PAN) &amp;&amp; SCTLR_EL1().SPAN == '0' then <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.PAN = '1'; end;
    if IsFeatureImplemented(FEAT_UAO) then <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.UAO = '0'; end;

    ELR_EL1() = ARBITRARY : bits(64);
    ESR_EL1() = ARBITRARY : bits(64);
    SPSR_EL1() = ARBITRARY : bits(64);

    DLR_EL0() = ARBITRARY : bits(64);
    DSPSR_EL0() = ARBITRARY : bits(64);

    // SCTLR_EL1.IESB might be ignored in Debug state.
    if (IsFeatureImplemented(FEAT_IESB) &amp;&amp; SCTLR_EL1().IESB == '1' &amp;&amp;
          !<a link="func_ConstrainUnpredictableBool_1" file="shared_pseudocode.xml">ConstrainUnpredictableBool</a>(<a link="enum_Unpredictable_IESBinDebug" file="shared_pseudocode.xml">Unpredictable_IESBinDebug</a>)) then
        SynchronizeErrors();
    end;
end;

<a link="func_UpdateEDSCRFields_0" file="shared_pseudocode.xml">UpdateEDSCRFields</a>();                        // Update EDSCR PE state flags</pstext></ps>
  </ps_section>
  <timestamp>2026-03-26 20:27:25</timestamp>
  <commit_id>2026-03_rel</commit_id>
</instructionsection>