[−][src]Enum pir_8_emu::isa::instruction::AluOperationShiftOrRotateType
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.
TT | Name | Description |
---|---|---|
00 | LSF | Logical shift - a zero is inserted |
01 | ASF | Arithmetic shift - a zero is inserted for left shift, bit-7 (MSB) is inserted for right shift |
10 | RTC | Rotate with carry - the Carry flag is inserted (Carry flag value before it is updated is used) |
11 | RTW | Rotate 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
Logical shift - a zero is inserted
Arithmetic shift - a zero is inserted for left shift, bit-8 is inserted for right shift
Rotate with carry - the Carry flag is inserted (Carry flag value before it is updated is used)
Rotate without carry - the bit shifted out is is inserted
Trait Implementations
impl Clone for AluOperationShiftOrRotateType
[src]
fn clone(&self) -> AluOperationShiftOrRotateType
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<u8> for AluOperationShiftOrRotateType
[src]
impl Ord for AluOperationShiftOrRotateType
[src]
fn cmp(&self, other: &AluOperationShiftOrRotateType) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<AluOperationShiftOrRotateType> for AluOperationShiftOrRotateType
[src]
fn eq(&self, other: &AluOperationShiftOrRotateType) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<AluOperationShiftOrRotateType> for AluOperationShiftOrRotateType
[src]
fn partial_cmp(&self, other: &AluOperationShiftOrRotateType) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for AluOperationShiftOrRotateType
[src]
impl StructuralPartialEq for AluOperationShiftOrRotateType
[src]
impl TryFrom<u8> for AluOperationShiftOrRotateType
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,