From d9357d2f8b30c55ad5c761944a2be05bd80bdf89 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 24 Jul 2018 23:57:17 +0200 Subject: [PATCH] All six MOV memory,immadiate instruction variants now perform segment limit checks, 86Box now passes all TEST386 tests. --- src/cpu/x86_ops_mov.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cpu/x86_ops_mov.h b/src/cpu/x86_ops_mov.h index a8ed5d819..1eadee54f 100644 --- a/src/cpu/x86_ops_mov.h +++ b/src/cpu/x86_ops_mov.h @@ -195,6 +195,7 @@ static int opMOV_b_imm_a32(uint32_t fetchdat) fetch_ea_32(fetchdat); ILLEGAL_ON((rmdat & 0x38) != 0); temp = getbyte(); if (cpu_state.abrt) return 1; + CHECK_WRITE(cpu_state.ea_seg, cpu_state.eaaddr, cpu_state.eaaddr); seteab(temp); CLOCK_CYCLES(timing_rr); PREFETCH_RUN(timing_rr, 3, rmdat, 0,0,(cpu_mod == 3) ? 1:0,0, 1); @@ -207,6 +208,7 @@ static int opMOV_w_imm_a16(uint32_t fetchdat) fetch_ea_16(fetchdat); ILLEGAL_ON((rmdat & 0x38) != 0); temp = getword(); if (cpu_state.abrt) return 1; + CHECK_WRITE(cpu_state.ea_seg, cpu_state.eaaddr, cpu_state.eaaddr + 1); seteaw(temp); CLOCK_CYCLES(timing_rr); PREFETCH_RUN(timing_rr, 4, rmdat, 0,0,(cpu_mod == 3) ? 1:0,0, 0); @@ -218,6 +220,7 @@ static int opMOV_w_imm_a32(uint32_t fetchdat) fetch_ea_32(fetchdat); ILLEGAL_ON((rmdat & 0x38) != 0); temp = getword(); if (cpu_state.abrt) return 1; + CHECK_WRITE(cpu_state.ea_seg, cpu_state.eaaddr, cpu_state.eaaddr + 1); seteaw(temp); CLOCK_CYCLES(timing_rr); PREFETCH_RUN(timing_rr, 4, rmdat, 0,0,(cpu_mod == 3) ? 1:0,0, 1); @@ -229,6 +232,7 @@ static int opMOV_l_imm_a16(uint32_t fetchdat) fetch_ea_16(fetchdat); ILLEGAL_ON((rmdat & 0x38) != 0); temp = getlong(); if (cpu_state.abrt) return 1; + CHECK_WRITE(cpu_state.ea_seg, cpu_state.eaaddr, cpu_state.eaaddr + 3); seteal(temp); CLOCK_CYCLES(timing_rr); PREFETCH_RUN(timing_rr, 6, rmdat, 0,0,0,(cpu_mod == 3) ? 1:0, 0); @@ -240,6 +244,7 @@ static int opMOV_l_imm_a32(uint32_t fetchdat) fetch_ea_32(fetchdat); ILLEGAL_ON((rmdat & 0x38) != 0); temp = getlong(); if (cpu_state.abrt) return 1; + CHECK_WRITE(cpu_state.ea_seg, cpu_state.eaaddr, cpu_state.eaaddr + 3); seteal(temp); CLOCK_CYCLES(timing_rr); PREFETCH_RUN(timing_rr, 6, rmdat, 0,0,0,(cpu_mod == 3) ? 1:0, 1);