<<<
[#insns-cm_push,reftext="Create stack frame: push registers, allocate additional stack space."]
=== cm.push

Synopsis::
Create stack frame: store ra and 0 to 12 saved registers to the stack frame, optionally allocate additional stack space.

Mnemonic::
cm.push _{reg_list}, -stack_adj_

Encoding (RV32, RV64)::
[wavedrom, , svg]
....
{reg:[
    { bits:  2, name: 0x2,             attr: ['C2'] },
    { bits:  2, name: 'spimm\[5:4\]',  attr: [] },
    { bits:  4, name: 'rlist',         attr: [] },
    { bits:  5, name: 0x18,            attr: [] },
    { bits:  3, name: 0x5,             attr: ['FUNCT3'] },
],config:{bits:16}}
....

[NOTE]

  _rlist_ values 0 to 3 are reserved for a future EABI variant called _cm.push.e_

Assembly Syntax::

[source,sail]
--
cm.push {reg_list},  -stack_adj
cm.push {xreg_list}, -stack_adj
--

include::variable_def.adoc[]
include::pushpop_vars.adoc[]

<<<
Description::
This instruction pushes (stores) the registers in _reg_list_ to the memory below the stack pointer, 
and then creates the stack frame by decrementing the stack pointer by _stack_adj_, 
including any additional stack space requested by the value of _spimm_.

include::pushpop_extra_info.adoc[]
include::cm_push_stores_pseudo_code.adoc[]
include::cm_push_pseudo_code.adoc[]

include::Zcmp_footer.adoc[]
