#include <stdio.h>
#include <stdint.h>

#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(void) {
  
  uint8_t ROM[16384];
  int i;
  int fh;
  
  for( i = 0; i < 16384; i++) {
   ROM[i] = 0xFF;
  }
  
  ROM[0xFFFC - 0xC000] = 0x00;
  ROM[0xFFFD - 0xC000] = 0xC0;
  
  ROM[0xC000 - 0xC000] = 0x4C;
  ROM[0xC001 - 0xC000] = 0x00;
  ROM[0xC002 - 0xC000] = 0xC0;
  
  if ((fh = open("binary.img", O_CREAT | O_RDWR )) == -1)   {  printf("arg, open fail.\n"); return 0; }
  
  write(fh, ROM, 16384);
  
  close(fh);
  
  return 0;
}
