/* file yasep/JScore/group_ctl.js
created 2006-09-09 by whygee@f-cpu.org
2007-04-01 : corrected forms of GET & PUT, added FORM_RI to PUT
2007-04-15 : added the USE_ flags (none here, for now)
2007-11-05 : rebranding to YASEP
2008-11-30 : 16-bit action
2009-01-06 : moved NOP to group_ie
2009-07-15 : new forms
2009-07-15 : Y.IgnoreImmSign
2009-08-10 : Y.IGNORE_SND | Y.IGNORE_SI4 | Y.IGNORE_IMM16 | Y.NO_WRITEBACK | Y.NO_CONDITION
2009-08-23 : removed FORM_X

This file defines the YASEP's instructions of the "control" group.
Since the simulator is not ready, the simulation part is not yet implemented.

dependency :
 yasep_messages.js+handling [if undesired, define : function add_message() {} ]
 yasep_forms.js, yasep_flags.js, yasep_opcodes.js
*/

Y.prefix=Y.GROUP_CTL;

Y.NewOpcode("GET",
  null,
  null,
  Y.FORM_RR|Y.FORM_iR|Y.FORM_IR,
  Y.IgnoreImmSign | Y.IGNORE_SND | Y.SWAP_IR,
  "Read from the Special Registers space"
);

Y.NewOpcode("PUT",
  null,
  null,
  Y.FORM_RR|Y.FORM_RI|Y.FORM_Ri,
  Y.IgnoreImmSign | Y.NO_WRITEBACK | Y.NO_CONDITION,
  "Write to the Special Registers space"
);

Y.NewOpcode("HALT",
  null,  /* alter the flags to halt the core */
  null,
  Y.FORM_ALONE,
  Y.NO_WRITEBACK | Y.NO_CONDITION | Y.IGNORE_SND | Y.IGNORE_SI4 | Y.IGNORE_IMM16,
  "Stop the core and wait for an interrupt");

Y.NewOpcode("CRIT",
  null,  /* alter the flags to prevent IRQs */
  null,
  Y.FORM_i,
  Y.IgnoreImmSign | Y.NO_WRITEBACK | Y.NO_CONDITION | Y.IGNORE_SND | Y.IGNORE_SI4 | Y.IGNORE_IMM16,
  "Start a CRITical section to perform an atomic sequence of operations");
