# HG changeset patch # User Michael Pavone # Date 1435436335 25200 # Node ID e1dc98f7ed9fa26e6906aaeaaccb6724eeb95860 # Parent 7306b3967c513fc99bc8d9479355450917e2ea54 Preserve scratch2 when using it as a temporary in memory read functions. This fixes a bunch of issues with the Z80 core and possibly some issues with the 68K core as well diff -r 7306b3967c51 -r e1dc98f7ed9f backend_x86.c --- a/backend_x86.c Sat Jun 27 12:17:18 2015 -0700 +++ b/backend_x86.c Sat Jun 27 13:18:55 2015 -0700 @@ -171,8 +171,10 @@ pop_r(code, opts->scratch1); mov_rrind(code, opts->scratch1, opts->scratch2, tmp_size); } else { + push_r(code, opts->scratch2); mov_ir(code, (intptr_t)memmap[chunk].buffer, opts->scratch2, SZ_PTR); mov_rindexr(code, opts->scratch2, opts->scratch1, 1, opts->scratch1, tmp_size); + pop_r(code, opts->scratch2); } } if (size != tmp_size && !is_write) {