changeset 415:2d7255509130

Fixed error with indexed posbytes
author lost@l-w.ca
date Tue, 10 Aug 2010 21:59:49 -0600
parents 010fb62b9f18
children 1d69ed28f175
files lwasm/insn_indexed.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
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