From 3e8a64144e034f14b9d6373e3b789d8b9de15e92 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Thu, 2 May 2024 21:32:42 +0200 Subject: [PATCH] assert --- cpu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu.cpp b/cpu.cpp index deffbe8..e76be6a 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -539,11 +539,15 @@ gam_rc_t cpu::getGAM(const uint8_t mode, const uint8_t reg, const word_mode_t wo break; } + assert(g.value < 256 || word_mode == wm_word); + return g; } bool cpu::putGAM(const gam_rc_t & g, const uint16_t value) { + assert(value < 256 || g.word_mode == wm_word); + if (g.addr.has_value()) { auto rc = b->write(g.addr.value(), g.word_mode, value, g.mode_selection, g.space);