Explicitly Initializing A,B & X Registers

38 views
Skip to first unread message

Dennis Zabawa

unread,
Jan 24, 2025, 10:19:11 AMJan 24
to uKenbak-1
The code snippet starts like this

INIT: 000: 000 000 000 004 RESET: 004: 023 000 LDA 000 006: 123 000 LDB 000 010: 223 000 LDX 000 012: 234 377 STX BUTTONS (CLEAR BUTTONS)
...........

If memory locations 000-002 (Registers A, B & X) are loaded with 000, why do we need to execute three explicit Load instructions to set them to 000? Is this not three bytes of memory wasted?

Mark Wilson

unread,
Jan 24, 2025, 2:59:43 PMJan 24
to uKenbak-1
The real Kenbak-1 did not clear memory at startup. I added that to the emulation because it seemed useful.  Also CLEAR+STORE does it any time (but sets P=004).
For the verisimilitude of random memory, remove
  // unlike the real thing, clear memory
  ClearAllMemory();
from
void ExtendedCPU::Init()

Mark

Wayne Verish

unread,
Jan 25, 2025, 7:43:34 PMJan 25
to Mark Wilson, uKenbak-1
--
You received this message because you are subscribed to the Google Groups "uKenbak-1" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukenbak-1+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ukenbak-1/6e492c25-3395-4c89-bef2-c384a7cab690n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages