 }
 
 // Send execute command
-void sendGt1Execute(word address, const byte data[])
+void sendGt1Execute(word address, byte data[])
 {
   noInterrupts();
   resetChecksum(0, address, data);

// concatenated frames to the Gigatron. Between segments
// it is communicating upstream with the serial port.

void sendGt1File(const byte *gt1)
{
  #define readNext() pgm_read_byte(gt1++)

  byte segment[300] = {0};
  word address = readNext();

  // Any number n of segments (n>0)
  do {
    // Segment start and length
    address = (address << 8) + readNext();
    int len = readNext();
    if (!len)
      len = 256;

    // Copy data into send buffer
    for (int i=0; i<len; i++)
      segment[i] = readNext();

    // Check that segment doesn't cross the page boundary
    if ((address & 255) + len > 256) {
      Serial.println("? Invalid GT1 data");
      return;
    }

    // Send downstream
    Serial.print("> Load $");
    Serial.print(address, HEX);
    Serial.print(" (");
    Serial.print(len);
    Serial.println(" bytes)");
    sendGt1Segment(address, len, segment);

    address = readNext();
  } while (address != 0);

  // Read start address
  address = readNext();
  address = (address << 8) + readNext();
  if (address != 0) {
    Serial.print("> Start $");
    Serial.println(address, HEX);
    sendGt1Execute(address, NULL);
  }
}

// Send a 1..256 byte code or data segment into the Gigatron by
// repacking it into Loader frames of max N=60 payload bytes each.
void sendGt1Segment(word address, int len, const byte data[])
{
  noInterrupts();
  byte n = min(N, len);


// Concept tester for loading programs into the
// Gigatron TTL microcomputer
// Marcel van Kervinck / Chris Lord
// May 2018

// The object file is embedded (in PROGMEM) in GT1 format. It would be
// GREAT if we can find a way to receive the file over the Arduino's
