pub fn disassemble_next_instruction(&mut self) -> String {
		// @TODO: Fetching can make a side effect,
		// for example updating page table entry or update peripheral hardware registers.
		// But ideally disassembling doesn't want to cause any side effect.
		// How can we avoid side effect?
		let mut original_word = match self.mmu.fetch_word(self.pc) {
			Ok(data) => data,
			Err(_e) => {
				return format!("PC:{:016x}, InstructionPageFault Trap!\n", self.pc);
			}
		};

		let word = match (original_word & 0x3) == 0x3 {
			true => original_word,
			false => {
				original_word &= 0xffff;
				self.uncompress(original_word)
			}
		};

		let inst = {
			match self.decode_raw(word) {
				Ok(inst) => inst,
				Err(()) => {
					return format!(
						"Unknown instruction PC:{:x} WORD:{:x}",
						self.pc, original_word
					);
				}
			}
		};

		let mut s = format!("PC:{:016x} ", self.unsigned_data(self.pc as i64));
		match self.pc {
			0x00010298u64 | 0x0001029au64 | 0x0001029cu64 | 0x0001029eu64 => {
				return String::from("");
			}
			_ => {}
		}
		s += &format!("{:08x} ", original_word);
		s += &format!("{} ", inst.name);
		s += &format!("{}", (inst.disassemble)(self, word, self.pc, true));
		s
	}
/// Disassembles an instruction pointed by Program Counter.
Disassembles an instruction pointed by Program Counter.
Disassembles an instruction pointed by Program Counter .
pub fn disassemble_next_instruction(&mut self) -> String {
		// @TODO: Fetching can make a side effect,
		// for example updating page table entry or update peripheral hardware registers.
		// But ideally disassembling doesn't want to cause any side effect.
		// How can we avoid side effect?
		let mut original_word = match self.mmu.fetch_word(self.pc) {
			Ok(data) => data,
			Err(_e) => {
				return format!("PC:{:016x}, InstructionPageFault Trap!\n", self.pc);
			}
		};
		let word = match (original_word & 0x3) == 0x3 {
			true => original_word,
			false => {
				original_word &= 0xffff;
				self.uncompress(original_word)
			}
		};
		let inst = {
			match self.decode_raw(word) {
				Ok(inst) => inst,
				Err(()) => {
					return format!(
						"Unknown instruction PC:{:x} WORD:{:x}",
						self.pc, original_word
					);
				}
			}
		};
		let mut s = format!("PC:{:016x} ", self.unsigned_data(self.pc as i64));
		match self.pc {
			0x00010298u64 | 0x0001029au64 | 0x0001029cu64 | 0x0001029eu64 => {
				return String::from("");
			}
			_ => {}
		}
		s += &format!("{:08x} ", original_word);
		s += &format!("{} ", inst.name);
		s += &format!("{}", (inst.disassemble)(self, word, self.pc, true));
		s
	}
pub fn disassemble_next_instruction ( & mut self ) -> String { // @TODO: Fetching can make a side effect, // for example updating page table entry or update peripheral hardware registers. // But ideally disassembling doesn't want to cause any side effect. // How can we avoid side effect? let mut original_word = match self . mmu . fetch_word ( self . pc ) { Ok ( data ) => data , Err ( _e ) => { return format ! ( " \n " self pc ) ; } } ; let word = match ( original_word & 0x3 ) == 0x3 { true => original_word , false => { original_word &= 0xffff ; self . uncompress ( original_word ) } } ; let inst = { match self . decode_raw ( word ) { Ok ( inst ) => inst , Err ( ( ) ) => { return format ! ( " " self pc original_word ) ; } } } ; let mut s = format ! ( " " self unsigned_data ( self pc as i64 ) ) ; match self . pc { 0x00010298u64 | 0x0001029au64 | 0x0001029cu64 | 0x0001029eu64 => { return String :: from ( " " ) ; } _ => { } } s += & format ! ( " " original_word ) ; s += & format ! ( " " inst name ) ; s += & format ! ( " " ( inst disassemble ) ( self word self pc true ) ) ; s }
Disassembles an instruction pointed by Program Counter.
Disassembles an instruction pointed by Program Counter .
&mut self