summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/nec
diff options
context:
space:
mode:
author Sergey Svishchev <shattered@users.noreply.github.com>2018-11-11 14:16:27 +0300
committer Sergey Svishchev <shattered@users.noreply.github.com>2018-11-13 19:44:52 +0300
commit3ae59bf35d3fdf1c0c31e60098db1fc97547b041 (patch)
treec7c02dfdba92afd3f5763876e8c9078ff6cc711d /src/devices/cpu/nec
parent0d948ec7e238e8bdd6ab7559bd04359283e6b318 (diff)
cpu/nec: force bits 12..15 of flag word to 1 in POPF, to match Intel 8086. (nw)
Avoids runtime error 200 in Turbo Pascal 7 runtime.
Diffstat (limited to 'src/devices/cpu/nec')
-rw-r--r--src/devices/cpu/nec/necinstr.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/devices/cpu/nec/necinstr.hxx b/src/devices/cpu/nec/necinstr.hxx
index f1209d675a9..54009b957bf 100644
--- a/src/devices/cpu/nec/necinstr.hxx
+++ b/src/devices/cpu/nec/necinstr.hxx
@@ -360,7 +360,7 @@ OP( 0x99, i_cwd ) { Wreg(DW) = (Breg(AH) & 0x80) ? 0xffff : 0; CLK(4);
OP( 0x9a, i_call_far ) { uint32_t tmp, tmp2; tmp = fetchword(); tmp2 = fetchword(); PUSH(Sreg(PS)); PUSH(m_ip); m_ip = (WORD)tmp; Sreg(PS) = (WORD)tmp2; CHANGE_PC; CLKW(29,29,13,29,21,9,Wreg(SP)); }
OP( 0x9b, i_wait ) { if (!m_poll_state) m_ip--; CLK(5); }
OP( 0x9c, i_pushf ) { uint16_t tmp = CompressFlags(); PUSH( tmp ); CLKS(12,8,3); }
-OP( 0x9d, i_popf ) { uint32_t tmp; POP(tmp); ExpandFlags(tmp); CLKS(12,8,5); if (m_TF) nec_trap(); }
+OP( 0x9d, i_popf ) { uint32_t tmp; POP(tmp); ExpandFlags(tmp | 0xf000); CLKS(12,8,5); if (m_TF) nec_trap(); }
OP( 0x9e, i_sahf ) { uint32_t tmp = (CompressFlags() & 0xff00) | (Breg(AH) & 0xd5); ExpandFlags(tmp); CLKS(3,3,2); }
OP( 0x9f, i_lahf ) { Breg(AH) = CompressFlags() & 0xff; CLKS(3,3,2); }