projects
/
YACASL2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ソースコードで、モードを表す構造体メンバーの名前とコメントを修正
[YACASL2.git]
/
src
/
casl2.c
diff --git
a/src/casl2.c
b/src/casl2.c
index
1b438e5
..
35f9a80
100644
(file)
--- a/
src/casl2.c
+++ b/
src/casl2.c
@@
-4,6
+4,7
@@
#define _GNU_SOURCE
#include <getopt.h>
#define _GNU_SOURCE
#include <getopt.h>
+/* casl2コマンドのオプション */
static struct option longopts[] = {
{"source", no_argument, NULL, 's'},
{"label", no_argument, NULL, 'l'},
static struct option longopts[] = {
{"source", no_argument, NULL, 's'},
{"label", no_argument, NULL, 'l'},
@@
-22,7
+23,9
@@
static struct option longopts[] = {
{0, 0, 0, 0},
};
{0, 0, 0, 0},
};
+/* アセンブルモード: src, label, onlylabel, asdetail, onlyassemble */
ASMODE asmode = {false, false, false, false, false};
ASMODE asmode = {false, false, false, false, false};
+/* 実行モード: trace, logical, dump */
EXECMODE execmode = {false, false, false};
/* エラー番号とエラーメッセージ */
EXECMODE execmode = {false, false, false};
/* エラー番号とエラーメッセージ */
@@
-84,7
+87,7
@@
const char *objfile_name(const char *str)
}
}
}
}
-/* casl2コマンド */
+/* casl2コマンド
のメイン
*/
int main(int argc, char *argv[])
{
int opt, i;
int main(int argc, char *argv[])
{
int opt, i;
@@
-98,38
+101,38
@@
int main(int argc, char *argv[])
while((opt = getopt_long(argc, argv, "tTdslLao::O::AM:C:h", longopts, NULL)) != -1) {
switch(opt) {
case 's':
while((opt = getopt_long(argc, argv, "tTdslLao::O::AM:C:h", longopts, NULL)) != -1) {
switch(opt) {
case 's':
- (&asmode)->src
mode
= true;
+ (&asmode)->src = true;
break;
case 'l':
break;
case 'l':
- (&asmode)->label
mode
= true;
+ (&asmode)->label = true;
break;
case 'L':
break;
case 'L':
- (&asmode)->label
mode
= true;
- (&asmode)->onlylabel
mode
= true;
+ (&asmode)->label = true;
+ (&asmode)->onlylabel = true;
break;
case 'a':
break;
case 'a':
- (&asmode)->asdetail
mode
= true;
+ (&asmode)->asdetail = true;
break;
case 'A':
break;
case 'A':
- (&asmode)->asdetail
mode
= true;
- (&asmode)->onlyassemble
mode
= true;
+ (&asmode)->asdetail = true;
+ (&asmode)->onlyassemble = true;
break;
case 'o':
objfile = strdup(objfile_name(optarg));
break;
case 'O':
break;
case 'o':
objfile = strdup(objfile_name(optarg));
break;
case 'O':
- (&asmode)->onlyassemble
mode
= true;
+ (&asmode)->onlyassemble = true;
objfile = strdup(objfile_name(optarg));
break;
case 't':
objfile = strdup(objfile_name(optarg));
break;
case 't':
- (&execmode)->trace
mode
= true;
+ (&execmode)->trace = true;
break;
case 'T':
break;
case 'T':
- (&execmode)->trace
mode
= true;
- (&execmode)->logical
mode
= true;
+ (&execmode)->trace = true;
+ (&execmode)->logical = true;
break;
case 'd':
break;
case 'd':
- (&execmode)->dump
mode
= true;
+ (&execmode)->dump = true;
break;
case 'M':
memsize = atoi(optarg);
break;
case 'M':
memsize = atoi(optarg);
@@
-161,9
+164,9
@@
int main(int argc, char *argv[])
} else if(pass == SECOND) {
ptr = beginptr[i];
}
} else if(pass == SECOND) {
ptr = beginptr[i];
}
- if((&execmode)->trace
mode == true || (&execmode)->dumpmode
== true ||
- (&asmode)->src
mode == true || (&asmode)->labelmode
== true ||
- (&asmode)->asdetail
mode
== true)
+ if((&execmode)->trace
== true || (&execmode)->dump
== true ||
+ (&asmode)->src
== true || (&asmode)->label
== true ||
+ (&asmode)->asdetail == true)
{
fprintf(stdout, "\nAssemble %s (%d)\n", argv[i], pass);
}
{
fprintf(stdout, "\nAssemble %s (%d)\n", argv[i], pass);
}
@@
-175,10
+178,10
@@
int main(int argc, char *argv[])
exit(-1);
}
}
exit(-1);
}
}
- if(pass == FIRST && (&asmode)->label
mode
== true) {
+ if(pass == FIRST && (&asmode)->label == true) {
fprintf(stdout, "\nLabel::::\n");
printlabel();
fprintf(stdout, "\nLabel::::\n");
printlabel();
- if((&asmode)->onlylabel
mode
== true) {
+ if((&asmode)->onlylabel == true) {
return 0;
}
}
return 0;
}
}
@@
-188,7
+191,7
@@
int main(int argc, char *argv[])
if(objfile != NULL) {
outassemble(objfile);
}
if(objfile != NULL) {
outassemble(objfile);
}
- if((&asmode)->onlyassemble
mode
== false) {
+ if((&asmode)->onlyassemble == false) {
exec(); /* プログラム実行 */
}
}
exec(); /* プログラム実行 */
}
}