Created
July 1, 2023 17:09
-
-
Save Lokathor/f526c5754b2666fe09110a5c5330b888 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub enum CpuOp { | |
Alu{op:AluOp, rhs:AluArg}, | |
Data{op:DataOp, data:DataArg}, | |
Rst(u8), | |
Load{dst:DataArg, src:AluArg}, | |
Call{cond:Cond, addr:u16}, | |
Jump{cond:Cond, addr:u16}, | |
JumpRel{cond:Cond, delta:i8}, | |
Ret{cond:Cond} | |
Stop, Halt, Di, Ei, Ccf, Cpl, | |
Daa, Reti, Rla, Rlca, Rra, Rrca, | |
Scf, | |
NotA16{op:NoaA16Op, rhs:NotA16}, | |
Nop, | |
SpecialLdA{to_a:bool, other:SpecialLd}, | |
Ldh{to_a:bool, index:u8}, | |
AddSP(i8), | |
JpHL, | |
LdImm16SP(u16), | |
LdHlSpDelta(i8), | |
LdSpHl, | |
} | |
pub enum AluArg { | |
Data(DataArg), Imm(u8) | |
} | |
pub enum AluOp { | |
Xor, Sub, Sbc, Or, Cp, And, Add, Adc | |
} | |
pub enum DataArg { | |
HLA, A, B, C, D, E, H, L | |
} | |
pub enum U8Bit { | |
_0, _1, _2, _3, _4, _5, _6, _7 | |
} | |
pub enum DataOp { | |
Swap, Srl, Sra, Sla, Set(U8Bit), Rrc, Rr, Rlc, Rl, Res(U8Bit), Inc, Dec, Bit(U8Bit), | |
} | |
pub enum Cond { | |
Cy, NC, Z, NZ, Al | |
} | |
pub enum NotA16Op { | |
AddHL, Dec, Inc, Ld(u16), Pop, Push | |
} | |
pub enum NotA16 { | |
Bc, De, Hl, Sp | |
} | |
pub enum SpecialLd { | |
Addr(u16), Bc, C, De, HLp, HLm | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment