 extern byte ram[];
 extern byte pia[];
 
-uint8_t memRead(uint16_t addr) {
+#define ADDR ((addrh << 8) | addrl)
+
+uint8_t memRead(const uint8_t addrh, const uint8_t addrl) {
+  const uint16_t addr = ADDR;
   uint8_t val;
   switch (addr >> 12) {
     default:

byte ram[0x1000];
byte pia[0x14];

void printAddr(uint16_t addr, uint8_t col, uint8_t row) {

  lcd.setCursor(col, row);
  lcd.print((addr >> 12) & 0x0f, HEX);
  lcd.print((addr >> 8) & 0x0f, HEX);

      if (LCD) printAddr(addr, 8, 0);
      if (LCD) printByte(val, 14, 0);
      return val;
  }
}

void memWrite(const uint16_t addr, const uint8_t val) {
  switch (addr >> 12) {
    default:
      // nothing in the address space ignore the write;
