[−][src]Enum chip_8::instructions::Instruction
Byte code instruction
Variants
Sys(Addr)
Jumps to machine routine at Addr
0nnn
- SYS addr
Clears the display
00E0
- CLS
Returns from a subroutine
00EE
- RET
Jump(Addr)
Jumps to Addr
1nnn
- JP addr
Call(Addr)
Calls subroutine at Addr
2nnn
- CALL addr
Skips next instruction if Vx
equals byte
3xkk
- SE Vx, byte
Skips next instruction if Vx
is not equal to byte
4xkk
- SNE Vx, byte
Skips next instruction if Vy
is equal to Vy
5xy0
- SE Vx, Vy
Loads byte
into Vx
6xkk
- LD Vx, byte
Adds byte
to Vx
, then stores it in Vx
7xkk
- ADD Vx, byte
Loads Vy
into Vx
8xy0
- LD Vx, Vy
Sets Vx
to Vx OR Vy
8xy1
- OR Vx, Vy
Sets Vx
to Vx AND Vy
8xy2
- AND Vx, Vy
Sets Vx
to Vx XOR Vy
8xy3
- XOR Vx, Vy
Sets Vx
to Vx + Vy
, VF
to carry
8xy4
- ADD Vx, Vy
Sets Vx
to Vx - Vy
, VF
to not borrow
8xy5
- SUB Vx, Vy
Sets Vx
to Vy SHR 1
8xy6
- SHR Vx {, Vy}
Sets Vx
to Vy - Vx
, VF
to not borrow
8xy7
- SUBN Vx, Vy
Sets Vx
to Vy SHL 1
8xyE
- SHL Vx {, Vy}
Skips next instruction if Vx
is not equal to Vy
9xy0
- SNE Vx, Vy
LoadI(Addr)
Loads Addr
into register I
Annn
- LD I, addr
LongJump(Addr)
Jumps to Addr + V0
Bnnn
- JP V0, addr
Sets Vx
to random number AND kk
Cxkk
- RND Vx, byte
Read n
bytes of memory from address I
, draw it at Vx
and Vy
screen coordinates and set VF
for erased pixels
Dxyn
- DRW Vx, Vy, nibble
SkipKeyPressed(Vx)
Skip next instruction if key Vx
is pressed
Ex9E
- SKP Vx
SkipKeyNotPressed(Vx)
Skip next instruction if key Vx
is not pressed
ExA1
- SKNP Vx
LoadRegisterDelayTimer(Vx)
Set Vx
to delay timer value
Fx07
- LD Vx, DT
LoadKey(Vx)
Wait for key press and store it in Vx
Fx0A
- LD Vx, K
LoadDelayTimerRegister(Vx)
Set delay timer to Vx
Fx15
- LD DT, Vx
LoadSoundTimerRegister(Vx)
Set sound timer to Vx
Fx18
- LD ST, Vx
AddI(Vx)
Add Vx
to I
Fx1E
- ADD I, Vx
LoadSprite(Vx)
Set I
to the address of the sprite Vx
Fx29
- LD F, Vx
LoadBinaryCodedDecimal(Vx)
Store binary-coded decimal (BCD) at I
, I
+1 and I
+2
Fx33
- LD B, Vx
LoadMemoryRegisters(Vx)
Store registers V0
..Vx
in memory at I
Fx55
- LD [I], Vx
LoadRegistersMemory(Vx)
Read registers V0
..Vx
from memory at I
Fx65
- LD Vx, [I]
Implementations
impl Instruction
[src]
pub fn decode(bits: u16) -> Result<Self>
[src]
Decodes raw bits
into a valid Instruction
Errors
Will return Chip8Error::UnknownInstruction
if given bits
don't match any known instruction.
Trait Implementations
impl Clone for Instruction
[src]
fn clone(&self) -> Instruction
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Instruction
[src]
impl Debug for Instruction
[src]
impl Eq for Instruction
[src]
impl PartialEq<Instruction> for Instruction
[src]
fn eq(&self, other: &Instruction) -> bool
[src]
fn ne(&self, other: &Instruction) -> bool
[src]
impl StructuralEq for Instruction
[src]
impl StructuralPartialEq for Instruction
[src]
Auto Trait Implementations
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
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> 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, 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,