Esempio n. 1
0
func (e *Emulator) Step(st *emu.State, diff *emu.Diff) emu.Code {
	st16 := &state{
		mem: newMemory(st.Mem),
		reg: emu.NewReg16State(st.Reg),
	}
	return st16.Step(diff)
}
Esempio n. 2
0
func Disassemble(mem []byte) (string, emu.Code) {
	st16 := &state{
		mem: newMemory(mem),
		reg: emu.NewReg16State(make([]uint64, 30)),
	}
	diff := new(emu.Diff)
	if code := st16.Step(diff); code != emu.OK {
		return "", code
	}
	if st16.opcode == SPECIAL_OP {
		return "SPECIAL_OP", emu.OK
	}
	return fmt.Sprintf("%v %v, %v", opcodeStr(st16.opcode), argStr(st16.argB), argStr(st16.argA)), emu.OK
}