diff options
author | 2022-05-23 11:12:00 +0700 | |
---|---|---|
committer | 2022-05-23 11:12:00 +0700 | |
commit | 85866c83192f598fabb960b4b1a87cdbf5245905 (patch) | |
tree | 552b76f98bcf7fbcc1108584c4cbeaeab42bbf45 | |
parent | 98bcdbd3204b315907bf187b2bc5e2ff8c75b9ff (diff) |
z80: bug fix for 16-bit operands
-rw-r--r-- | src/devices/cpu/z80/z80.cpp | 4 |
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; } /*************************************************************** |