Skip to content

Conversation

fabio-d
Copy link
Contributor

@fabio-d fabio-d commented Oct 8, 2025

  • The initial value is read from internal RAM (IRAM_IR).
  • The final value must be written to the internal RAM too (IRAM_IW instead of IRAM_W).

I and @jyaif have found an issue in the mcs51's implementation of the XCHD ("Exchange Digit") instruction: it reads the old value with IRAM_IR but writes the new value with IRAM_W.

Instead, it should have written the new value symmetrically with IRAM_IW:
XCHD documentation

We found the issue while investigating a bad Dynamical Redefinable Character Set (DRCS) rendering on the minitel2 (src/mame/philips/minitel_2_rpic.cpp).

Before this patch:
before

After this patch:
after

(from MiniPavi service -> code 6212*DRCS -> image 1)

cc @jfdelnero

- The initial value is read from internal RAM (IRAM_IR).
- The final value must be written to the internal RAM too
  (IRAM_IW instead of IRAM_W).
@rb6502 rb6502 merged commit b5a4802 into mamedev:master Oct 8, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants