summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Patrick Mackinlay <pmackinlay@hotmail.com>2022-05-23 11:12:00 +0700
committer Vas Crabb <vas@vastheman.com>2022-05-23 14:18:48 +1000
commit6e54ab76fcfffb8b1efc7d9209ece4f938ba5306 (patch)
tree6fe0b08d109daf77a0a81c402725d8c424c91640 /src
parent09e3fefeadb13d96cdb583a1291077addb5c60c5 (diff)
z80: bug fix for 16-bit operands
Diffstat (limited to 'src')
-rw-r--r--src/devices/cpu/z80/z80.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/devices/cpu/z80/z80.cpp b/src/devices/cpu/z80/z80.cpp
index 86a65ed3169..a43fec45327 100644
--- a/src/devices/cpu/z80/z80.cpp
+++ b/src/devices/cpu/z80/z80.cpp
@@ -555,7 +555,9 @@ uint8_t z80_device::arg()
uint16_t z80_device::arg16()
{
- return arg() | (arg() << 8);
+ u8 const res = arg();
+
+ return (u16(arg()) << 8) | res;
}
/***************************************************************