version 2009-07-11

CRIT : start CRITical section

This instruction temporarily disables interrupts during the next instruction. The length of this critical section is given by the immediate value, register fields are ignored. The maximum length depends on the hardware implementation but should be 16 (which fits in a short immediate's range).

Software traps are not prevented, this is useful only to provide atomic operations (like complex semaphores) if they can't be delegated to the SRs. When another CRIT instruction is found in a critical section, the latter is closed and IRQs are asserted before starting the new critical section.