# HG changeset patch # User lost@l-w.ca # Date 1313124496 21600 # Node ID 50d86baf4ea21f8784105c1658a72d154f3fe004 # Parent 5706712f8a205b6a099b1d1fd99731dd0e72a193 Fixed code generation bug with forced-size offsets from X,Y,U,S diff -r 5706712f8a20 -r 50d86baf4ea2 lwasm/insn_indexed.c --- a/lwasm/insn_indexed.c Thu Aug 11 22:25:29 2011 -0600 +++ b/lwasm/insn_indexed.c Thu Aug 11 22:48:16 2011 -0600 @@ -190,7 +190,7 @@ (*p)++; } - if (**p == '0' && *(*p+1) == ',') + if (**p == '0' && *((*p)+1) == ',') { f0 = 1; } @@ -230,6 +230,20 @@ (*p)++; } + if (rn <= 3) + { + // X,Y,U,S + if (l -> lint == 1) + { + l -> pb = 0x88 | (rn << 5) | (indir ? 0x10 : 0); + } + else if (l -> lint == 2) + { + l -> pb = 0x89 | (rn << 5) | (indir ? 0x10 : 0); + } + return; + } + // nnnn,W is only 16 bit (or 0 bit) if (rn == 4) {