   if (!(arg == NULL || listp(arg))) error(SAVEIMAGE, PSTR("illegal argument"), arg);
   int bytesneeded = imagesize*4 + SYMBOLTABLESIZE + 10;
   if (bytesneeded > EEPROMSIZE) error(SAVEIMAGE, PSTR("image size too large"), number(imagesize));
-  eeprom_update_word(&image.datasize, imagesize);
-  eeprom_update_word(&image.eval, (unsigned int)arg);
-  eeprom_update_word(&image.globalenv, (unsigned int)GlobalEnv);
-  eeprom_update_word(&image.gcstack, (unsigned int)GCStack);
+  unsigned int addr = 0;
+  EEPROMWriteInt(&addr, (unsigned int)arg);
+  EEPROMWriteInt(&addr, imagesize);
+  EEPROMWriteInt(&addr, (unsigned int)GlobalEnv);
+  EEPROMWriteInt(&addr, (unsigned int)GCStack);
   #if SYMBOLTABLESIZE > BUFFERSIZE
-  eeprom_update_word(&image.symboltop, (unsigned int)SymbolTop);
-  eeprom_update_block(SymbolTable, image.table, SYMBOLTABLESIZE);
+  EEPROMWriteInt(&addr, (unsigned int)SymbolTop);
+  for (int i=0; i<SYMBOLTABLESIZE; i++) EEPROM.write(addr++, SymbolTable[i]);
   #endif
-  eeprom_update_block(Workspace, image.data, imagesize*4);
+  for (unsigned int i=0; i<imagesize; i++) {
+    object *obj = &Workspace[i];
+    EEPROMWriteInt(&addr, (uintptr_t)car(obj));
+    EEPROMWriteInt(&addr, (uintptr_t)cdr(obj));
+  }
   return imagesize;
 #endif
 }
 
 #if defined(sdcardsupport)
 int SDReadInt (File file) {
-  uintptr_t b0 = file.read(); uintptr_t b1 = file.read();
+  uint8_t b0 = file.read(); uint8_t b1 = file.read();
+  return b0 | b1<<8;
+}
+#else
+int EEPROMReadInt (unsigned int *addr) {
+  uint8_t b0 = EEPROM.read((*addr)++); uint8_t b1 = EEPROM.read((*addr)++);
   return b0 | b1<<8;
 }
 #endif

      args = cdr(args);
    }
  }
}

object *sp_push (object *args, object *env) {

const char notastring[] PROGMEM = "argument is not a string";
const char notalist[] PROGMEM = "argument is not a list";
const char notproper[] PROGMEM = "argument is not a proper list";
const char noargument[] PROGMEM = "missing argument";
const char nostream[] PROGMEM = "missing stream argument";
const char overflow[] PROGMEM = "arithmetic overflow";
const char invalidpin[] PROGMEM = "invalid pin";
const char resultproper[] PROGMEM = "result is not a proper list";

// Tracing

