#include "asm.h"

/*

Author: Matthew William Coan
Date: Wed Aug 28 23:24:38 EDT 2013

*/

using namespace std;
using namespace asm_tools;

int
main(int argc, char ** argv, char ** envp)
{
   if(argc != 3) {
      cerr << "usage: " << argv[0] 
           << " <input>.asm <output>.o" 
           << endl;
      exit(1);
   }

   try {
      Program prog(argv[2]);

      program_ptr = &prog;

      prog.load(argv[1]); 

      prog.gen_code();

      prog.emit(argv[2]);
   }
   catch(...) {
      cerr << "unknown exception..." << endl;
      exit(1);
   }

   return 0;
}
