Esempio n. 1
0
 static void Main(string[] args) {
   if(args.Length > 0 && File.Exists(args[0]) && Path.GetExtension(args[0]).ToLower() == ".asm") {
     var asm = new Assembler();
     byte[] prg = asm.Load(args[0]);
     if(prg == null) {
       Log.Warning("programm is empty");
     } else {
       var fo = Path.ChangeExtension(args[0], ".hex");
       var text = BitConverter.ToString(prg);
       File.WriteAllText(fo, text);
       fo = Path.ChangeExtension(args[0], ".lst");
       text = asm.ToLst();
       File.WriteAllText(fo, text);
       Log.Info("ok - {0} bytes", prg.Length);
     }
   } else {
     Log.Warning("USE: Assembler <sourcer file>.asm");
   }
   Log.Finish();
 }
Esempio n. 2
0
 public Inst(Assembler owner, int line) {
   _own = owner;
   this.line = line;
   this.pos = -1;
 }