Ejemplo n.º 1
0
 public void write_word(int offset)
 {
     FileStream fs = File.OpenWrite(AGC_file);
     if (is_ErType)
     {
         fs.Seek(b_adress + offset, SeekOrigin.Begin);
         temp = new sWord(MEM_ARRAY[offset]);
         byte[] tmp = temp.getWord();
         Array.Reverse(tmp);
         fs.Write(tmp, 0, 16);
     }
     fs.Close();
     fs.Dispose();
 }
Ejemplo n.º 2
0
 //file operation
 /// <summary>
 /// write the bank to the binary output file
 /// </summary>
 public void write_bank()
 {
     if (is_ErType | compiling) { //only erasable bank is writable
         FileStream fs = File.OpenWrite (AGC_file);
         int j = 0;
         for (int i = 0; i < size; i++) {
             fs.Seek (b_adress + j, SeekOrigin.Begin);
             temp = new sWord (MEM_ARRAY [i]);
             byte[] tmp = temp.getWord ();
             Array.Reverse (tmp);
             fs.Write (tmp, 0, 16);
             j += 16;
         }
         fs.Close ();
         fs.Dispose ();
     }
 }