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

pub enum AluOperationShiftOrRotateType {
    Lsf,
    Asf,
    Rtc,
    Rtw,
}

All shifts can be performed left or right, as designated by the D bit of the instruction.

If D is a 1, the shift is to the left, all bits will move to a higher value, if D is 0, it's a right shift, moving bits to lower values.

There are then four types of shift that can be performed designated by the final two bits of the ALU instruction.

The name should be appended with an L or R for the direction of the shift, left or right respectively.

For all shift operations, the bit shifted out is set into the Carry flag.

TTNameDescription
00LSFLogical shift - a zero is inserted
01ASFArithmetic shift - a zero is inserted for left shift, bit-7 (MSB) is inserted for right shift
10RTCRotate with carry - the Carry flag is inserted (Carry flag value before it is updated is used)
11RTWRotate without carry - the bit shifted out is inserted

An example of a Arithmetic shift right; AXXX XXXB would become AAXX XXXX, with B copied to the Carry bit.

NB: An 'Arithmetic shift left' is the same as performing a 'Logical shift left', they can be used interchangeably, but 'Arithmetic shift left' should be avoided.

Variants

Lsf

Logical shift - a zero is inserted

Asf

Arithmetic shift - a zero is inserted for left shift, bit-8 is inserted for right shift

Rtc

Rotate with carry - the Carry flag is inserted (Carry flag value before it is updated is used)

Rtw

Rotate without carry - the bit shifted out is is inserted

Trait Implementations

impl Clone for AluOperationShiftOrRotateType[src]

impl Copy for AluOperationShiftOrRotateType[src]

impl Debug for AluOperationShiftOrRotateType[src]

impl Display for AluOperationShiftOrRotateType[src]

impl Eq for AluOperationShiftOrRotateType[src]

impl Hash for AluOperationShiftOrRotateType[src]

impl Into<u8> for AluOperationShiftOrRotateType[src]

impl Ord for AluOperationShiftOrRotateType[src]

impl PartialEq<AluOperationShiftOrRotateType> for AluOperationShiftOrRotateType[src]

impl PartialOrd<AluOperationShiftOrRotateType> for AluOperationShiftOrRotateType[src]

impl StructuralEq for AluOperationShiftOrRotateType[src]

impl StructuralPartialEq for AluOperationShiftOrRotateType[src]

impl TryFrom<u8> for AluOperationShiftOrRotateType[src]

type Error = ()

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for AluOperationShiftOrRotateType

impl Send for AluOperationShiftOrRotateType

impl Sync for AluOperationShiftOrRotateType

impl Unpin for AluOperationShiftOrRotateType

impl UnwindSafe for AluOperationShiftOrRotateType

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.