This commit is contained in:
folkert van heusden 2023-03-23 19:34:57 +01:00
parent 283fc29c81
commit 9fc748e7e5
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -684,10 +684,10 @@ void bus::write(const uint16_t a, const bool word_mode, uint16_t value, const bo
DOLOG(debug, true, "writeb Set stack limit register: %o", value);
uint16_t v = c->getStackLimitRegister();
if (a & 1)
v = (v & 0x00ff) | (value << 8);
else
if (a == ADDR_STACKLIM)
v = (v & 0xff00) | value;
else
v = (v & 0x00ff) | (value << 8);
c->setStackLimitRegister(v);
return;