[][src]Enum pir_8_emu::isa::instruction::InstructionJumpCondition

pub enum InstructionJumpCondition {
    Jmpz,
    Jmpp,
    Jmpg,
    Jmpc,
    Jmzg,
    Jmzl,
    Jmpl,
    Jump,
}

This Instruction takes a three bit operand indicating under what condition the jump should be performed.

If the condition is met, the value of ADR is loaded into the PC.

If the condition is not met, no further special action is taken; the PC would have already been incremented as part of loading the instruction.

NB: The value of ADR must have been set with the desired target location prior to the JUMP instruction being performed.

This table shows what combination of bits to the JUMP instruction check what flags and in what combination

FFFNameDescription
000JMPZZero flag
001JMPPParity flag
010JMPGNOT Zero AND Greater than flag (i.e. greater than)
011JMPCCarry flag
100JMZGZero OR Greater than flags
101JMZLZero OR NOT Greater than flag
110JMPLNOT Zero AND NOT Greater than flag (i.e. less than)
111JUMPUnconditional Jump (always jumps)

Variants

Jmpz
Jmpp
Jmpg
Jmpc
Jmzg
Jmzl
Jmpl
Jump

Methods

impl InstructionJumpCondition[src]

pub fn is_satisfied(self, flags: u8) -> bool[src]

Check, whether the specified flagset satisfies this jump condition

Examples

assert!(InstructionJumpCondition::Jmpg.is_satisfied(0b10100));

assert!(!InstructionJumpCondition::Jmpl.is_satisfied(0b00101));

Trait Implementations

impl Clone for InstructionJumpCondition[src]

impl Copy for InstructionJumpCondition[src]

impl Debug for InstructionJumpCondition[src]

impl Display for InstructionJumpCondition[src]

impl Eq for InstructionJumpCondition[src]

impl Hash for InstructionJumpCondition[src]

impl Ord for InstructionJumpCondition[src]

impl PartialEq<InstructionJumpCondition> for InstructionJumpCondition[src]

impl PartialOrd<InstructionJumpCondition> for InstructionJumpCondition[src]

impl StructuralEq for InstructionJumpCondition[src]

impl StructuralPartialEq for InstructionJumpCondition[src]

impl TryFrom<u8> for InstructionJumpCondition[src]

type Error = ()

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for InstructionJumpCondition

impl Send for InstructionJumpCondition

impl Sync for InstructionJumpCondition

impl Unpin for InstructionJumpCondition

impl UnwindSafe for InstructionJumpCondition

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.