comparison lwasm/insn_indexed.c @ 45:c42d6dc7df68

Fixed code generation error with indirect indexing using 8 or 16 bit offsets from X,Y,U,S
author lost@l-w.ca
date Mon, 04 Apr 2011 18:17:31 -0600
parents 7317fbe024af
children 35f6d6a5510f
comparison
equal deleted inserted replaced
44:1bff302e62a3 45:c42d6dc7df68
347 { 347 {
348 case 0: 348 case 0:
349 case 1: 349 case 1:
350 case 2: 350 case 2:
351 case 3: 351 case 3:
352 pb = 0x89 | ((l -> pb & 0x03) << 5) | (0x10 * (l -> pb & 0x80)); 352 pb = 0x89 | ((l -> pb & 0x03) << 5) | ((l -> pb & 0x80) ? 0x10 : 0);
353 break; 353 break;
354 354
355 case 4: // W 355 case 4: // W
356 pb = (l -> pb & 0x80) ? 0xD0 : 0xCF; 356 pb = (l -> pb & 0x80) ? 0xD0 : 0xCF;
357 break; 357 break;
375 { 375 {
376 case 0: 376 case 0:
377 case 1: 377 case 1:
378 case 2: 378 case 2:
379 case 3: 379 case 3:
380 pb = 0x88 | ((l -> pb & 0x03) << 5) | (0x10 * (l -> pb & 0x80)); 380 pb = 0x88 | ((l -> pb & 0x03) << 5) | ((l -> pb & 0x80) ? 0x10 : 0);
381 break; 381 break;
382 382
383 case 4: // W 383 case 4: // W
384 // use 16 bit because W doesn't have 8 bit, unless 0 384 // use 16 bit because W doesn't have 8 bit, unless 0
385 if (v == 0 && !(CURPRAGMA(l, PRAGMA_NOINDEX0TONONE) || l -> pb & 0x40)) 385 if (v == 0 && !(CURPRAGMA(l, PRAGMA_NOINDEX0TONONE) || l -> pb & 0x40))
434 { 434 {
435 case 0: 435 case 0:
436 case 1: 436 case 1:
437 case 2: 437 case 2:
438 case 3: 438 case 3:
439 pb = 0x89 | (l -> pb & 0x03) << 5 | (0x10 * (l -> pb & 0x80)); 439 pb = 0x89 | (l -> pb & 0x03) << 5 | ((l -> pb & 0x80) ? 0x10 : 0);
440 break; 440 break;
441 441
442 case 4: // W 442 case 4: // W
443 pb = (l -> pb & 0x80) ? 0xD0 : 0xCF; 443 pb = (l -> pb & 0x80) ? 0xD0 : 0xCF;
444 break; 444 break;
460 { 460 {
461 case 0: 461 case 0:
462 case 1: 462 case 1:
463 case 2: 463 case 2:
464 case 3: 464 case 3:
465 pb = 0x88 | (l -> pb & 0x03) << 5 | (0x10 * (l -> pb & 0x80)); 465 pb = 0x88 | (l -> pb & 0x03) << 5 | ((l -> pb & 0x80) ? 0x10 : 0);
466 break; 466 break;
467 467
468 case 4: // W 468 case 4: // W
469 // use 16 bit because W doesn't have 8 bit, unless 0 469 // use 16 bit because W doesn't have 8 bit, unless 0
470 if (v == 0 && !(CURPRAGMA(l, PRAGMA_NOINDEX0TONONE) || l -> pb & 0x40)) 470 if (v == 0 && !(CURPRAGMA(l, PRAGMA_NOINDEX0TONONE) || l -> pb & 0x40))