comparison fteeprom/ftee-mkblank.c @ 46:e5d89313bc00

ftee-mkblank written to replace fteeprom-prog -e
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 22 Apr 2019 19:44:57 +0000
parents
children
comparison
equal deleted inserted replaced
45:1f3a4115375f 46:e5d89313bc00
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <strings.h>
5
6 main(argc, argv)
7 char **argv;
8 {
9 unsigned size;
10 unsigned n, col;
11
12 if (argc == 1)
13 size = 64;
14 else if (argc == 2 && !strcmp(argv[1], "-b"))
15 size = 128;
16 else if (argc == 2 && !strcmp(argv[1], "-B"))
17 size = 256;
18 else {
19 fprintf(stderr, "usage: %s [-b|-B]\n", argv[0]);
20 exit(1);
21 }
22 for (n = 0; n < size; n++) {
23 col = n & 7;
24 if (col == 0)
25 printf("%02X:", n * 2);
26 printf(" %04X", 0xFFFF);
27 if (col == 7)
28 putchar('\n');
29 }
30 exit(0);
31 }