6 /* 指定されたファイルからCOMET II仮想メモリ(アセンブル結果)を読込 */
7 bool inassemble(char *file) {
9 if((fp = fopen(file, "r")) == NULL) {
13 fread(memory, sizeof(WORD), MEMSIZE, fp);
18 static struct option longopts[] = {
19 {"trace", no_argument, NULL, 't'},
20 {"tracearithmetic", no_argument, NULL, 't'},
21 {"tracelogical", no_argument, NULL, 'T'},
22 {"dump", no_argument, NULL, 'd'},
23 {"help", no_argument, NULL, 'h'},
27 int main(int argc, char *argv[])
30 const char *usage = "Usage: %s [-tTdh] FILE\n";
32 while((opt = getopt_long(argc, argv, "tTdh", longopts, NULL)) != -1) {
45 fprintf(stdout, usage, argv[0]);
48 fprintf(stderr, usage, argv[0]);
52 if(inassemble(argv[optind]) == true) {