| * Convert a data file into a .S file suitable for assembly. |
| * This reads from stdin and writes to stdout and takes a single |
| * argument for the name of the symbol in the assembly file. |
| int main(int argc, char *argv[]) { |
| fprintf(stderr, "usage: %s NAME < DAT_FILE > ASM_FILE\n", argv[0]); |
| fprintf(stderr, " '%s'", argv[i]); |
| * The mid-2007 version of gcc that ships with Macs requires a\n\ |
| * comma on the .section line, but the rest of the world thinks\n\ |
| * that's a syntax error. It also wants globals to be explicitly\n\ |
| * prefixed with \"_\" as opposed to modern gccs that do the\n\ |
| ", name, name, name, name); |
| amt = fread(buf, 1, sizeof(buf), stdin); |
| for (i = 0; i < amt; i++) { |
| printf("0x%02x", buf[i]); |
| } else if (col % 4 == 0) { |