From 376bef93cfadf5d0f778ac887500ee8d5d70fbcc Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sun, 7 Apr 2019 00:06:29 -0700 Subject: Get 64-bit builds working for Windows target --- m68k_core_x86.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'm68k_core_x86.c') diff --git a/m68k_core_x86.c b/m68k_core_x86.c index a0a6f06..6455e70 100644 --- a/m68k_core_x86.c +++ b/m68k_core_x86.c @@ -2658,8 +2658,11 @@ void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chu opts->start_context = (start_fun)code->cur; save_callee_save_regs(code); #ifdef X86_64 - if (opts->gen.scratch2 != RDI) { - mov_rr(code, RDI, opts->gen.scratch2, SZ_PTR); + if (opts->gen.scratch2 != FIRST_ARG_REG) { + mov_rr(code, FIRST_ARG_REG, opts->gen.scratch2, SZ_PTR); + } + if (opts->gen.context_reg != SECOND_ARG_REG) { + mov_rr(code, SECOND_ARG_REG, opts->gen.context_reg, SZ_PTR); } #else mov_rdispr(code, RSP, 20, opts->gen.scratch2, SZ_D); -- cgit v1.2.3