[][src]Enum zeerust::ops::Op

pub enum Op {
    ADC(Location8Location8),
    ADD8(Location8Location8),
    INC(Location8),
    SBC(Location8Location8),
    SUB8(Location8Location8),
    DEC(Location8),
    AND(Location8),
    OR(Location8),
    XOR(Location8),
    CP(Location8),
    CPL,
    NEG,
    CCF,
    SCF,
    NOP,
    HALT,
    DAA,
    RLCA,
    RLA,
    RRCA,
    RRA,
    RLC(Location8),
    RL(Location8),
    RRC(Location8),
    RR(Location8),
    SLA(Location8),
    SRL(Location8),
    SRA(Location8),
    RLD,
    RRD,
    BIT(u8Location8),
    SET(u8Location8),
    RES(u8Location8),
    IN(Location8Location8),
    OUT(Location8Location8),
    JP(JumpConditionalLocation16),
    JR(JumpConditionali8),
    DJNZ(i8),
    CALL(JumpConditionalu16),
    RET(JumpConditional),
    POP(Location16),
    PUSH(Location16),
    LD8(Location8Location8),
    LD16(Location16Location16),
}

Op represents a single operation. This representation (and backing implementation) is more expressive than the processor itself. For example ADD8(Location8::Reg(Reg8::D), Location8::Immediate(10)) is a valid representation, but the Z80 features no such instruction. Usually executing an instruction like this will just work, but in some cases a panic will occur (Such as attempting to store to an immediate, which doesn't make any sense). It is probably best to stick to the "guide rails" of the Z80 operations.

Variants

ADC(Location8Location8)

ADd including Carry

ADD8(Location8Location8)

ADD (8-bit)

INC(Location8)

INCrement

SBC(Location8Location8)

SuBtract including borrow (Carry bit)

SUB8(Location8Location8)

SUBtraction (8-bit)

DEC(Location8)

DECrement

AND(Location8)

bitwise AND

OR(Location8)

bitwise OR

XOR(Location8)

bitwise XOR

CP(Location8)

two's ComPliment

CPL

One's ComPLiment

NEG

sign NEGation (two's compliment)

CCF

toggle the Carry Flag

SCF

Set the Carry Flag unconditionally

NOP

Do nothing (No-OPeration)

HALT

HALT execution (until woken)

DAA

BCD nonsense. Not implemented

RLCA

Rotate Accumulator Left, set Carry

RLA

Rotate Accumulator Left, through carry

RRCA

Rotate Accumulator Right, set Carry

RRA

Rotate Accumulator Left, through carry

RLC(Location8)

Rotate Left, set Carry

RL(Location8)

Rotate Left, through carry

RRC(Location8)

Rotate Right, set Carry

RR(Location8)

Rotate Right, through carry

SLA(Location8)

Shift Left

SRL(Location8)

Shift Right

SRA(Location8)

Shift Right, preserving 7th bit

RLD

Rotate nibbles Left through accumulator

RRD

Rotate nibbles Right through accumulator

BIT(u8Location8)

set zero flag if BIT is on

SET(u8Location8)

SET b bit in location

RES(u8Location8)

RESet b bit in location

IN(Location8Location8)

INput from a peripheral

OUT(Location8Location8)

OUTput to a peripheral

JP(JumpConditionalLocation16)

JumP to the given position

JR(JumpConditionali8)

Jump to the given Relative position

DJNZ(i8)

Decrement register b, then Jump if register b is Non Zero

CALL(JumpConditionalu16)

CALL a method

RET(JumpConditional)

RETurn from a method call

POP(Location16)

Pop an address off of the stack

PUSH(Location16)

Push an address onto a stack

LD8(Location8Location8)

LoaD the given address (8-bit)

LD16(Location16Location16)

LoaD the given address (16-bit)

Trait Implementations

impl PartialEq<Op> for Op[src]

impl Clone for Op[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Op[src]

Auto Trait Implementations

impl Send for Op

impl Sync for Op

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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