 int SDReadInt (File file) {
   uint8_t b0 = file.read(); uint8_t b1 = file.read();
   return b0 | b1<<8;
+}
+#elif defined(FLASHWRITESIZE)
+uint8_t FlashReadByte (uint32_t *addr) {
+  return Flash.readByte((*addr)++);
+}
+
+int FlashReadInt (uint32_t *addr) {
+  int data = Flash.readWord(*addr);
+  (*addr)++; (*addr)++;
+  return data;
 }
 #else
 int EEPROMReadInt (unsigned int *addr) {

  }
  file.close();
  return imagesize;
#else
  if (!(arg == NULL || listp(arg))) error(SAVEIMAGE, invalidarg, arg);
  int SymbolUsed = SymbolTop - SymbolTable;

  file.close();
  gc(NULL, NULL);
  return imagesize;
#elif defined(FLASHWRITESIZE)
  if (!FlashSetup()) error2(LOADIMAGE, PSTR("no Flash found."));
  uint32_t addr = BASE_ADDRESS;
  FlashReadInt(&addr); // Skip eval address
  int imagesize = FlashReadInt(&addr);
  if (imagesize == 0 || imagesize == 0xFFFFFFFF) error2(LOADIMAGE, PSTR("no saved image"));
  GlobalEnv = (object *)FlashReadInt(&addr);
  GCStack = (object *)FlashReadInt(&addr);
  #if SYMBOLTABLESIZE > BUFFERSIZE
  SymbolTop = (char *)FlashReadInt(&addr);
  int SymbolUsed = SymbolTop - SymbolTable;
  for (int i=0; i<SymbolUsed; i++) SymbolTable[i] = FlashReadByte(&addr);
  #endif
  for (int i=0; i<imagesize; i++) {
    object *obj = &Workspace[i];
    car(obj) = (object *)FlashReadInt(&addr);
    cdr(obj) = (object *)FlashReadInt(&addr);
  }
  gc(NULL, NULL);
  return imagesize;
#else
  unsigned int addr = 2; // Skip eval address
  unsigned int imagesize = EEPROMReadInt(&addr);
