could not change msb of stack limit register

This commit is contained in:
folkert van heusden 2023-03-26 15:24:10 +02:00
parent 2ecdc53061
commit 9d0bc9eea5
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -736,13 +736,14 @@ void bus::write(const uint16_t addr_in, const word_mode_t word_mode, uint16_t va
if (a == ADDR_STACKLIM || a == ADDR_STACKLIM + 1) { // stack limit register
DOLOG(debug, true, "WRITE-I/O stack limit register %s: %03o", a & 1 ? "MSB" : "LSB", value);
if (a == ADDR_STACKLIM + 1) {
uint16_t v = c->getStackLimitRegister();
uint16_t v = c->getStackLimitRegister();
if (a == ADDR_STACKLIM)
v = (v & 0xff00) | value;
else
v = (v & 0x00ff) | (value << 8);
c->setStackLimitRegister(v);
}
c->setStackLimitRegister(v);
return;
}