diff lwasm/insn_indexed.c @ 415:2d7255509130

Fixed error with indexed posbytes
author lost@l-w.ca
date Tue, 10 Aug 2010 21:59:49 -0600
parents eacdae8a1575
children 7b8d89435f30
line wrap: on
line diff
--- a/lwasm/insn_indexed.c	Tue Aug 10 17:33:56 2010 -0600
+++ b/lwasm/insn_indexed.c	Tue Aug 10 21:59:49 2010 -0600
@@ -327,7 +327,7 @@
 				case 1:
 				case 2:
 				case 3:
-					pb = 0x89 | (l -> pb & 0x03) | (0x10 * (l -> pb & 0x80));
+					pb = 0x89 | ((l -> pb & 0x03) << 5) | (0x10 * (l -> pb & 0x80));
 					break;
 			
 				case 4: // W
@@ -355,7 +355,7 @@
 				case 1:
 				case 2:
 				case 3:
-					pb = 0x88 | (l -> pb & 0x03) | (0x10 * (l -> pb & 0x80));
+					pb = 0x88 | ((l -> pb & 0x03) << 5) | (0x10 * (l -> pb & 0x80));
 					break;
 			
 				case 4: // W
@@ -414,7 +414,7 @@
 			case 1:
 			case 2:
 			case 3:
-				pb = 0x89 | (l -> pb & 0x03) | (0x10 * (l -> pb & 0x80));
+				pb = 0x89 | (l -> pb & 0x03) << 5 | (0x10 * (l -> pb & 0x80));
 				break;
 			
 			case 4: // W
@@ -440,7 +440,7 @@
 			case 1:
 			case 2:
 			case 3:
-				pb = 0x88 | (l -> pb & 0x03) | (0x10 * (l -> pb & 0x80));
+				pb = 0x88 | (l -> pb & 0x03) << 5 | (0x10 * (l -> pb & 0x80));
 				break;
 			
 			case 4: // W