diff z80_to_x86.c @ 285:021aeb6df19b

Implement HALT (sort of tested)
author Mike Pavone <pavone@retrodev.com>
date Sat, 04 May 2013 16:23:28 -0700
parents ed7098f717d7
children 872a8911e0f4
line wrap: on
line diff
--- a/z80_to_x86.c	Sat May 04 15:58:15 2013 -0700
+++ b/z80_to_x86.c	Sat May 04 16:23:28 2013 -0700
@@ -35,6 +35,7 @@
 void z80_retrans_stub();
 void z80_io_read();
 void z80_io_write();
+void z80_halt();
 
 uint8_t z80_size(z80inst * inst)
 {
@@ -898,7 +899,13 @@
 			dst = zcycles(dst, 4 * inst->immed);
 		}
 		break;
-	//case Z80_HALT:
+	case Z80_HALT:
+		dst = zcycles(dst, 4);
+		dst = mov_ir(dst, address, SCRATCH1, SZ_W);
+		uint8_t * call_inst = dst;
+		dst = call(dst, (uint8_t *)z80_halt);
+		dst = jmp(dst, call_inst);
+		break;
 	case Z80_DI:
 		dst = zcycles(dst, 4);
 		dst = mov_irdisp8(dst, 0, CONTEXT, offsetof(z80_context, iff1), SZ_B);