Unified · Split
| @@ -233,7 +233,7 @@ void load(int r, SValue *sv) · 232 unmodified lines | |||
| 233 | } else if (v == VT_JMP || v == VT_JMPI) { | 233 | } else if (v == VT_JMP || v == VT_JMPI) { |
| 234 | t = v & 1; | 234 | t = v & 1; |
| 235 | oad(0xb8 + r, t); /* mov $1, r */ | 235 | oad(0xb8 + r, t); /* mov $1, r */ |
| 236 | oad(0xe9, 5); /* jmp after */ | 236 | o(0x05eb); /* jmp after */ |
| 237 | gsym(fc); | 237 | gsym(fc); |
| 238 | oad(0xb8 + r, t ^ 1); /* mov $0, r */ | 238 | oad(0xb8 + r, t ^ 1); /* mov $0, r */ |
| 239 | } else if (v != r) { | 239 | } else if (v != r) { |
| @@ -479,7 +479,14 @@ int gjmp(int t) · 239 unmodified lines | |||
| 479 | /* generate a jump to a fixed address */ | 479 | /* generate a jump to a fixed address */ |
| 480 | void gjmp_addr(int a) | 480 | void gjmp_addr(int a) |
| 481 | { | 481 | { |
| 482 | oad(0xe9, a - ind - 5); | 482 | int r; |
| 483 | r = a - ind - 2; | ||
| 484 | if (r == (char)r) { | ||
| 485 | g(0xeb); | ||
| 486 | g(r); | ||
| 487 | } else { | ||
| 488 | oad(0xe9, a - ind - 5); | ||
| 489 | } | ||
| 483 | } | 490 | } |
| 484 | 491 | ||
| 485 | /* generate a test. set 'inv' to invert test. Stack entry is popped */ | 492 | /* generate a test. set 'inv' to invert test. Stack entry is popped */ |