Fixed some more bugs, added #if/#else/#endif and more opcodes, and .DATA stat

This commit is contained in:
David Anderson
2004-08-09 05:23:32 +00:00
parent 1dc16b835e
commit b14708d6f2
9 changed files with 215 additions and 51 deletions

View File

@ -26,21 +26,25 @@ std::string filename;
int main(int argc, char **argv)
{
printf("debug clamp.\n");
getchar();
get_options(argc, argv);
Compiler Program;
get_options(argc, argv, Program);
if (filename.size() < 1)
{
print_version();
exit(0);
}
Program.Load(filename);
Program.Parse();
Program.Compile();
if (Program.Parse())
if (Program.Compile())
printf("Done.\n");
exit(0);
}
void get_options(int argc, char **argv)
void get_options(int argc, char **argv, Compiler &Prog)
{
int i = 0; /* index */
int opt_flag = 0; /* flag for option detection */
@ -56,9 +60,15 @@ void get_options(int argc, char **argv)
case 'v':
{
opt_flag = 0; /* no options expected */
//print_version();
print_version();
break;
} /* case */
case 'd':
{
opt_flag = 0;
Prog.SetDebug();
break;
}
} /* switch */
} else { /* - */
if (!opt_flag)
@ -70,3 +80,10 @@ void get_options(int argc, char **argv)
} /* if */
}
}
void print_version()
{
printf("AMX Assembler 1.00\n");
printf("(C)2004 David 'BAILOPAN' Anderson\n");
exit(0);
}