diff gen_x86.c @ 207:c82f65a87a53

Fix overflow flag on ASL
author Mike Pavone <pavone@retrodev.com>
date Fri, 25 Jan 2013 18:39:22 -0800
parents 811163790e6c
children d9bf8e61c33c
line wrap: on
line diff
--- a/gen_x86.c	Wed Jan 23 21:54:58 2013 -0800
+++ b/gen_x86.c	Fri Jan 25 18:39:22 2013 -0800
@@ -35,6 +35,7 @@
 #define OP_MOV_IEA 0xC6
 #define OP_SHIFTROT_1 0xD0
 #define OP_SHIFTROT_CL 0xD2
+#define OP_LOOP 0xE2
 #define OP_CALL 0xE8
 #define OP_JMP 0xE9
 #define OP_JMP_BYTE 0xEB
@@ -1533,4 +1534,10 @@
 	return out;
 }
 
-
+uint8_t * loop(uint8_t * out, uint8_t * dst)
+{
+	ptrdiff_t disp = dst-(out+2);
+	*(out++) = OP_LOOP;
+	*(out++) = disp;
+	return out;
+}