disassembler disassembles
This commit is contained in:
@@ -8,7 +8,7 @@ use crate::chip8::computer::{Chip8Computer};
|
||||
use crate::chip8::cpu_states::Chip8CpuStates::WaitingForKey;
|
||||
use crate::chip8::instructions::Chip8CpuInstructions::XXXXERRORINSTRUCTION;
|
||||
use crate::chip8::util::InstructionUtil;
|
||||
use crate::constants::{INST_ADD, INST_ADDI, INST_ADDR, INST_AND, INST_BCD, INST_CALL, INST_CLS, INST_DRW, INST_EXIT, INST_JPA, INST_JPI, INST_LDD, INST_LDF, INST_LDF2, INST_LDIA, INST_LDIX, INST_LDR, INST_LDRD, INST_LDRI, INST_LDRK, INST_LDRY, INST_LIDR, INST_LIDS};
|
||||
use crate::constants::{*};
|
||||
|
||||
/*
|
||||
nnn or addr - A 12-bit value, the lowest 12 bits of the instruction
|
||||
@@ -286,27 +286,27 @@ impl Chip8CpuInstructions {
|
||||
Chip8CpuInstructions::LDRI(_) => INST_LDRI,
|
||||
Chip8CpuInstructions::LDRK(_) => INST_LDRK,
|
||||
Chip8CpuInstructions::LDR_Y(_, _) => INST_LDRY,
|
||||
Chip8CpuInstructions::OR(_, _) => "OR",
|
||||
Chip8CpuInstructions::RET => "RET",
|
||||
Chip8CpuInstructions::RND(_, _) => "RND",
|
||||
Chip8CpuInstructions::SDN(_) => "SDN",
|
||||
Chip8CpuInstructions::SLF => "SLF",
|
||||
Chip8CpuInstructions::SRT => "SRT",
|
||||
Chip8CpuInstructions::SEX(_, _) => "SEX",
|
||||
Chip8CpuInstructions::SEY(_, _) => "SEY",
|
||||
Chip8CpuInstructions::SHL(_, _) => "SHL",
|
||||
Chip8CpuInstructions::SHR(_, _) => "SHR",
|
||||
Chip8CpuInstructions::SKP(_) => "SKP",
|
||||
Chip8CpuInstructions::SNEB(_, _) => "SNEB",
|
||||
Chip8CpuInstructions::SNEY(_, _) => "SNEY",
|
||||
Chip8CpuInstructions::SKNP(_) => "SNKP",
|
||||
Chip8CpuInstructions::STR(x) => "STR",
|
||||
Chip8CpuInstructions::SUB(_, _) => "SUB",
|
||||
Chip8CpuInstructions::SUBC(_, _) => "SUBC",
|
||||
Chip8CpuInstructions::SYS(_) => "SYS",
|
||||
Chip8CpuInstructions::DIS => "DIS",
|
||||
Chip8CpuInstructions::ENA => "ENA",
|
||||
Chip8CpuInstructions::ORY(_, _) => "ORY",
|
||||
Chip8CpuInstructions::OR(_, _) => INST_OR,
|
||||
Chip8CpuInstructions::RET => INST_RET,
|
||||
Chip8CpuInstructions::RND(_, _) => INST_RND,
|
||||
Chip8CpuInstructions::SDN(_) => INST_SDN,
|
||||
Chip8CpuInstructions::SLF => INST_SLF,
|
||||
Chip8CpuInstructions::SRT => INST_SRT,
|
||||
Chip8CpuInstructions::SEX(_, _) => INST_SEX,
|
||||
Chip8CpuInstructions::SEY(_, _) => INST_SEY,
|
||||
Chip8CpuInstructions::SHL(_, _) => INST_SHL,
|
||||
Chip8CpuInstructions::SHR(_, _) => INST_SHR,
|
||||
Chip8CpuInstructions::SKP(_) => INST_SKP,
|
||||
Chip8CpuInstructions::SNEB(_, _) => INST_SNEB,
|
||||
Chip8CpuInstructions::SNEY(_, _) => INST_SNEY,
|
||||
Chip8CpuInstructions::SKNP(_) => INST_SNKP,
|
||||
Chip8CpuInstructions::STR(x) => INST_STR,
|
||||
Chip8CpuInstructions::SUB(_, _) => INST_SUB,
|
||||
Chip8CpuInstructions::SUBC(_, _) => INST_SUBC,
|
||||
Chip8CpuInstructions::SYS(_) => INST_SYS,
|
||||
Chip8CpuInstructions::DIS => INST_DIS,
|
||||
Chip8CpuInstructions::ENA => INST_ENA,
|
||||
Chip8CpuInstructions::ORY(_, _) => INST_ORY,
|
||||
XXXXERRORINSTRUCTION => "XX ERROR XX",
|
||||
}
|
||||
}
|
||||
@@ -889,7 +889,6 @@ impl Chip8CpuInstructions {
|
||||
println!("SCROLLING LEFT 4 LINES");
|
||||
}
|
||||
Chip8CpuInstructions::DIS => {
|
||||
|
||||
println!("DISABLE VIDEO MODE");
|
||||
}
|
||||
Chip8CpuInstructions::ENA => {
|
||||
|
||||
@@ -39,3 +39,27 @@ pub const INST_LDRD: &str = "LDRD";
|
||||
pub const INST_LDRI: &str = "LDRI";
|
||||
pub const INST_LDRK: &str = "LDRK";
|
||||
pub const INST_LDRY: &str = "LDRY";
|
||||
pub const INST_OR: &str = "OR";
|
||||
pub const INST_RET: &str = "RET";
|
||||
pub const INST_RND: &str = "RND";
|
||||
pub const INST_SDN: &str = "SDN";
|
||||
pub const INST_SRT: &str = "SRT";
|
||||
pub const INST_SLF: &str = "SLF";
|
||||
pub const INST_SEX: &str = "SEX";
|
||||
pub const INST_SEY: &str = "SEY";
|
||||
pub const INST_SHL: &str = "SHL";
|
||||
pub const INST_SHR: &str = "SHR";
|
||||
pub const INST_SKP: &str = "SKP";
|
||||
pub const INST_SNEB: &str = "SNEB";
|
||||
pub const INST_SNEY: &str = "SNEY";
|
||||
pub const INST_SNKP: &str = "SNKP";
|
||||
pub const INST_STR : &str = "STR";
|
||||
pub const INST_SUB: &str = "SUB";
|
||||
pub const INST_SUBC: &str = "SUBC";
|
||||
pub const INST_SYS: &str = "SYS";
|
||||
pub const INST_DIS: &str = "DIS";
|
||||
pub const INST_ENA: &str = "ENA";
|
||||
pub const INST_ORY: &str = "ORY";
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user