*** empty log message ***
authorhachti <hachti>
Mon, 20 Nov 2006 01:19:00 +0000 (01:19 +0000)
committerhachti <hachti>
Mon, 20 Nov 2006 01:19:00 +0000 (01:19 +0000)
21 files changed:
pc-tools/ldc2/src/data_block_0.cpp
pc-tools/ldc2/src/data_block_0.hh
pc-tools/ldc2/src/data_block_0_0.cpp
pc-tools/ldc2/src/data_block_0_0.hh
pc-tools/ldc2/src/data_block_0_1.cpp
pc-tools/ldc2/src/data_block_0_14.cpp
pc-tools/ldc2/src/data_block_0_2.cpp
pc-tools/ldc2/src/data_block_0_24.cpp
pc-tools/ldc2/src/data_block_0_3.cpp
pc-tools/ldc2/src/data_block_0_30.cpp
pc-tools/ldc2/src/data_block_0_4.cpp
pc-tools/ldc2/src/data_block_0_44.cpp
pc-tools/ldc2/src/data_block_0_44.hh
pc-tools/ldc2/src/data_block_0_50.cpp
pc-tools/ldc2/src/data_block_0_50.hh
pc-tools/ldc2/src/data_block_0_54.cpp
pc-tools/ldc2/src/data_block_0_60.cpp
pc-tools/ldc2/src/data_block_0_label_extractor.cpp
pc-tools/ldc2/src/data_block_0_label_extractor.hh
pc-tools/ldc2/src/main.cpp
pc-tools/ldc2/src/tape_block.cpp

index f43c016151bea4e18f5d5585c6cab17f468bc01d..84e630fd369fa3deabee28b3e3b52a28da04b096 100644 (file)
@@ -1,7 +1,7 @@
 #include "data_block_0.hh"
 
 /*!
- *\brief Parent class copy constructor.
+ *\brief Specialisation constructor.
  */
 data_block_0::data_block_0(data_block & org)
   :data_block(org)
index 61b2b7a7d9f49c68641780249ea8dae7ae988352..86756b2affc0662d3b2782fdb04faf7367177b4c 100644 (file)
@@ -14,7 +14,7 @@ class data_block_0
 {
   friend tape_block * tape_block::gen_from_fd(int,void(*)(void*),
                                              void(*)(void*),void*);
-private:
+protected:
   data_block_0(data_block&);
 
 public:  
index 815d33f4c1c828708a2fb473f65d689121e5312b..ece243dad8f19b108a1cf7a84418c806a4c20918 100644 (file)
@@ -3,10 +3,10 @@
 #include <stdio.h>
 
 /*!
- *\brief Parent class copy constructor.
+ *\brief Specialisation constructor.
  */
 data_block_0_0::data_block_0_0(data_block_0 & org)
-  :data_block_0_label_extractor(org),data_block_0(org)
+  :data_block_0_label_extractor(org)
 {}
 
 /*!
index a74dd5400600300d91cde126cc22bba64092b829..c0f50ed51255d48f7a1eee159ead08df8a2a50f8 100644 (file)
@@ -19,7 +19,6 @@ public:
 
 protected:
   data_block_0_0(data_block_0&);
-  
 
 };
 
index 1b590bd92bbfb61e491e16397be831c99dfbc562..33b3f28a919b83e840fe54a74f6b4fea79c64122 100644 (file)
@@ -15,7 +15,7 @@ data_block_0_1::data_block_0_1(data_block_0 & org)
  */
 vector<string> data_block_0_1::get_description(){
   vector<string> result;
-  result.insert(result.end(),"Fixme!     "+get_typestring()+"Default 0-* block");
+  result.insert(result.end(),"           "+get_typestring()+"Turn off non-load flag");
   return result;
 }
 
index 3dc139f61d0eef4b46f7b0a0e2b65b520a11f93b..7fbfdd224095435a8a7bce1908c8da2ffa8a122b 100644 (file)
@@ -15,7 +15,7 @@ data_block_0_14::data_block_0_14(data_block_0 & org)
  */
 vector<string> data_block_0_14::get_description(){
   vector<string> result;
-  result.insert(result.end(),"Fixme!     "+get_typestring()+"Default 0-* block");
+  result.insert(result.end(),"           "+get_typestring()+"End");
   return result;
 }
 
index f95f905f96db1ff2842884eb7523255644992483..9320a77ca204f9a180448f4283fb140b2c3c598f 100644 (file)
@@ -15,7 +15,7 @@ data_block_0_2::data_block_0_2(data_block_0 & org)
  */
 vector<string> data_block_0_2::get_description(){
   vector<string> result;
-  result.insert(result.end(),"Fixme!     "+get_typestring()+"Default 0-* block");
+  result.insert(result.end(),"           "+get_typestring()+"Turn on chain flag");
   return result;
 }
 
index e16435871e8448d109985e422df2b217bd37f7b1..7f622927ed6f60205eeeeec13fd7871739c15414 100644 (file)
@@ -15,7 +15,7 @@ data_block_0_24::data_block_0_24(data_block_0 & org)
  */
 vector<string> data_block_0_24::get_description(){
   vector<string> result;
-  result.insert(result.end(),"Fixme!     "+get_typestring()+"Default 0-* block");
+  result.insert(result.end(),"           "+get_typestring()+"Switch to relocatable mode");
   return result;
 }
 
index fc751e4b1edefdc156b56702cf4686375d257870..0652862761c67ab5d57e1e26732102da2b78fc55 100644 (file)
@@ -15,7 +15,7 @@ data_block_0_3::data_block_0_3(data_block_0 & org)
  */
 vector<string> data_block_0_3::get_description(){
   vector<string> result;
-  result.insert(result.end(),"Fixme!     "+get_typestring()+"Default 0-* block");
+  result.insert(result.end(),"           "+get_typestring()+"End of Job");
   return result;
 }
 
index 2df9232b944a4959569c98b3f74495844cba09af..140ef3742a5318cea752662a85299f61054270df 100644 (file)
@@ -15,7 +15,7 @@ data_block_0_30::data_block_0_30(data_block_0 & org)
  */
 vector<string> data_block_0_30::get_description(){
   vector<string> result;
-  result.insert(result.end(),"Fixme!     "+get_typestring()+"Default 0-* block");
+  result.insert(result.end(),"           "+get_typestring()+"Switch to absolute mode");
   return result;
 }
 
index 962a0ad09d1090716fd8afbd30915d93a5231291..e02e28bada80ec0eecc713902a8b88e33117337a 100644 (file)
@@ -3,7 +3,7 @@
 #include <stdio.h>
 
 /*!
- *\brief Parent class copy constructor.
+ *\brief Specialising constructor.
  */
 data_block_0_4::data_block_0_4(data_block_0 & org)
   :data_block_0(org)
@@ -15,7 +15,7 @@ data_block_0_4::data_block_0_4(data_block_0 & org)
  */
 vector<string> data_block_0_4::get_description(){
   vector<string> result;
-  result.insert(result.end(),"Fixme!     "+get_typestring()+"Default 0-* block");
+  result.insert(result.end(),"           "+get_typestring()+"Data");
   return result;
 }
 
index e07f3420196899d248142bc77dc7a3a1193aa320..b3bce3c83c4933ef92aba0c3a1c25e294a7a417e 100644 (file)
@@ -6,7 +6,7 @@
  *\brief Parent class copy constructor.
  */
 data_block_0_44::data_block_0_44(data_block_0 & org)
-  :data_block_0(org)
+  :data_block_0_label_extractor(org)
 {}
 
 /*!
@@ -15,7 +15,8 @@ data_block_0_44::data_block_0_44(data_block_0 & org)
  */
 vector<string> data_block_0_44::get_description(){
   vector<string> result;
-  result.insert(result.end(),"Fixme!     "+get_typestring()+"Default 0-* block");
+  string label=get_labels()[0];
+  result.insert(result.end(),
+                           label+"     "+get_typestring()+"Subprogram Call");
   return result;
 }
-
index 64ac98b2e695b5099b0bdc53335922be93cc06b2..4384e148a6dd2b29d8420082e27c5de0909f3dc8 100644 (file)
@@ -4,13 +4,13 @@
 #include <vector>
 #include <string>
 
-#include "data_block_0.hh"
+#include "data_block_0_label_extractor.hh"
 
 /*!
  *\brief Class for block type (0-0).
  */
 class data_block_0_44
-  : public data_block_0
+  : public data_block_0_label_extractor
 {
   friend tape_block * tape_block::gen_from_fd(int,void(*)(void*),
                                              void(*)(void*),void*);
index 753fe031157ecf8760d591d226747c23772c8907..4954f83da6cd0a7aa472884dceebef4d7c733e04 100644 (file)
@@ -6,7 +6,7 @@
  *\brief Parent class copy constructor.
  */
 data_block_0_50::data_block_0_50(data_block_0 & org)
-  :data_block_0(org)
+  :data_block_0_label_extractor(org)
 {}
 
 /*!
@@ -15,7 +15,14 @@ data_block_0_50::data_block_0_50(data_block_0 & org)
  */
 vector<string> data_block_0_50::get_description(){
   vector<string> result;
-  result.insert(result.end(),"Fixme!     "+get_typestring()+"Default 0-* block");
+  vector<string> labels=get_labels();
+  for (int i=0; i<labels.size();i++){
+    if (i==0) result.insert(result.end(),
+                           labels[i]+"     "+get_typestring()+"Subprogram Entry Point Definition");
+    else 
+      result.insert(result.end(),
+                   labels[i]+"     "+get_typestring()        +"    \"        \"");
+  }
   return result;
 }
 
index c8e8def45c1e3d402788403294e0e3309996080e..d2559757ec9adbd5a95a08387efb44592d88b914 100644 (file)
@@ -4,13 +4,13 @@
 #include <vector>
 #include <string>
 
-#include "data_block_0.hh"
+#include "data_block_0_label_extractor.hh"
 
 /*!
  *\brief Class for block type (0-0).
  */
 class data_block_0_50
-  : public data_block_0
+  : public data_block_0_label_extractor
 {
   friend tape_block * tape_block::gen_from_fd(int,void(*)(void*),
                                              void(*)(void*),void*);
index 33a4b64dfb7d8bcabca11fdf914d302d755abb25..e8bed988327eab0ab27492e0b459b3cab6b80c50 100644 (file)
@@ -15,7 +15,7 @@ data_block_0_54::data_block_0_54(data_block_0 & org)
  */
 vector<string> data_block_0_54::get_description(){
   vector<string> result;
-  result.insert(result.end(),"Fixme!     "+get_typestring()+"Default 0-* block");
+  result.insert(result.end(),"           "+get_typestring()+"Enter extended-memory desectorizing");
   return result;
 }
 
index b342cb540067e674fd055e95c16ecca1805dcb9f..6bf2b61a470198ecec6924ebaca8db6cd6e88adb 100644 (file)
@@ -15,7 +15,7 @@ data_block_0_60::data_block_0_60(data_block_0 & org)
  */
 vector<string> data_block_0_60::get_description(){
   vector<string> result;
-  result.insert(result.end(),"Fixme!     "+get_typestring()+"Default 0-* block");
+  result.insert(result.end(),"           "+get_typestring()+"Leave extended-memory desectorizing");
   return result;
 }
 
index cd53bb2b7dd54d62b141f1dd6a3468a6653a68bc..537099c41b853d89de980b9ff6701c73d6c50ed2 100644 (file)
@@ -1,6 +1,6 @@
 #include "data_block_0_label_extractor.hh"
 /*!
- *\brief Constructor.
+ *\brief Specialisation constructor.
  */
 data_block_0_label_extractor::data_block_0_label_extractor(data_block_0& org)
   : data_block_0(org)
index bc42bd9e47a20cb854e2a4b8170bb21be3dd1dad..797c088d1400808c83ba6d7db3ac9e00907a5bbb 100644 (file)
  * This class cannot be instantiated.\n
  */
 class data_block_0_label_extractor
-  : public virtual data_block_0
+  : public data_block_0
 {
 
 protected:
   data_block_0_label_extractor(data_block_0 &);
 
-protected:  
+protected:
   vector<string> get_labels();
 
 };
index 36cb22ed22c06fb9b1463f4e176cfb3073154f29..311774605888b0f378021184224f8b8b99abc0df 100644 (file)
@@ -1,4 +1,14 @@
+/*
+r
+$Id: main.cpp,v 1.4 2006/11/20 01:20:11 hachti Exp $
+$Log: main.cpp,v $
+Revision 1.4  2006/11/20 01:20:11  hachti
+*** empty log message ***
 
+Revision 1.3  2006-11-20 01:19:48  hachti
+Another revision
+
+*/
 #include <stdio.h>
 #include <unistd.h>
 
@@ -18,22 +28,11 @@ int main(){
   do{
     if (myblock) delete myblock;
     myblock=tape_block::gen_from_fd(0);
-
+    
     vector<string> desc=myblock->get_description();
     for (vector<string>::iterator iter=desc.begin();
         iter!=desc.end();iter++)
       printf("%s\n",(*iter).c_str());
-
-
-//     if ((myblock->get_type()==0)&&(myblock->get_subtype()==050)){
-//       data_block * dp=(data_block *)myblock;
-//       printf ("0-50 symbol name: %s\n",dp->extract_string(4).c_str());
-//       printf ("0-50 symbol name: %s\n",dp->extract_string(11).c_str());
-//       printf ("Block size:%i\n",dp->get_word_size());
-//     }
   } while (myblock->get_state()==tape_block::TBS_OK);
-  printf("---");
-  printf("State:%i\n",myblock->get_state());
-  printf("raw size:%i\n",myblock->get_raw_size());
     return 0;
 }
index 0d011ebb0392b59635a3becec22f5c71eb3776c6..abba1d62945371d70ae6f0f7202f7328b4b85b8f 100644 (file)
 #include "data_block_0_54.hh"
 #include "data_block_0_60.hh"
 #include "data_block_0_50.hh"
+#include "data_block_0_64.hh"
+#include "data_block_1.hh"
+#include "data_block_2.hh"
+#include "data_block_3.hh"
+#include "data_block_4.hh"
+#include "data_block_5.hh"
+#include "data_block_6.hh"
+#include "data_block_7.hh"
 
 #include "eot_block.hh"
 #include "discard_block.hh"
@@ -176,6 +184,7 @@ unsigned char * tape_block::get_raw_data(){
  *     - data_block_0_50
  *     - data_block_0_54
  *     - data_block_0_60
+ *     - data_block_0_64
  *   - data_block_1
  *   - data_block_2
  *   - data_block_3
@@ -199,75 +208,75 @@ tape_block * tape_block::gen_from_fd(int  fd,
                                     void (*input_stop)(void *),
                                     void * start_stop_arg)
 {
-  tape_block * res_block;
-  res_block=new tape_block(fd,input_start,input_stop,start_stop_arg);
-  data_block    * d_block;
-  data_block_0  * d0_block;
-  eot_block     * e_block;
-  discard_block * di_block;
-
-  // Retype to data_block if possible
-  switch(res_block->get_type()){
-  case tape_block::TBT_DATA:    // Make pointer a data block
-    d_block=new data_block(*res_block);
-    delete res_block;
-    res_block=d_block;
+  tape_block  * n_tape_block=0;
+  data_block  * n_data_block=0;
+  data_block  * n_data_block_x=0;
+  data_block_0  * n_data_block_0=0;
+  data_block_0  * n_data_block_0_x=0;
+  eot_block * n_eot_block=0;
+  discard_block * n_discard_block=0;
+  
+  n_tape_block=new tape_block(fd,input_start,input_stop,start_stop_arg);
+  
+  // Retype to data_block, eot_block, discard_block - if possible
+  switch(n_tape_block->get_type()){
+  case tape_block::TBT_DATA:
+    n_data_block = new data_block(*n_tape_block); 
     break;
   case tape_block::TBT_EOT:
-    e_block=new eot_block(*res_block);
-    delete res_block;
-    res_block=e_block;
-    break;
+    n_eot_block=new eot_block(*n_tape_block); 
+    delete n_tape_block;
+    return n_eot_block;
   case tape_block::TBT_DISCARD:
-    di_block=new discard_block(*res_block);
-    delete res_block;
-    res_block=di_block;
-    break;
-  default:          // All other cases
-    return res_block;
+    n_discard_block = new discard_block(*n_tape_block); 
+    delete n_tape_block;
+    return n_discard_block;
+  default:          
+    return n_tape_block;
   }
-  
-  // Retype again, if it's a data_block now
-  
-  switch(res_block->get_type()){
-  case 00: 
-    d0_block=new data_block_0(*d_block); 
-    d_block=d0_block;
-    break;
-//   case 01: d_block=new data_block_1(*d_block); break;
-//   case 02: d_block=new data_block_2(*d_block); break;
-//   case 03: d_block=new data_block_3(*d_block); break;
-//   case 04: d_block=new data_block_4(*d_block); break;
-//   case 05: d_block=new data_block_5(*d_block); break;
-//   case 06: d_block=new data_block_6(*d_block); break;
-//   case 07: d_block=new data_block_7(*d_block); break;
+  delete n_tape_block;
+
+  // Now only data blocks are left
+
+  switch(n_data_block->get_type()){
+  case 00: n_data_block_0=new data_block_0(*n_data_block); break;
+  case 01: n_data_block_x=new data_block_1(*n_data_block); break;
+  case 02: n_data_block_x=new data_block_2(*n_data_block); break;
+  case 03: n_data_block_x=new data_block_3(*n_data_block); break;
+  case 04: n_data_block_x=new data_block_4(*n_data_block); break;
+  case 05: n_data_block_x=new data_block_5(*n_data_block); break;
+  case 06: n_data_block_x=new data_block_6(*n_data_block); break;
+  case 07: n_data_block_x=new data_block_7(*n_data_block); break;
   default:
-    return res_block;
+    return n_data_block;
+  }
+  if (n_data_block_0==0){ // So we must have found another one
+    delete n_data_block;
+    return n_data_block_x;
   }
-  delete res_block;
-  res_block=d_block;
   
-  if (res_block->get_type()==0) switch(d0_block->get_subtype()){
-  case 000: d0_block=new data_block_0_0(*d0_block); break;
-  case 001: d0_block=new data_block_0_1(*d0_block); break;
-  case 002: d0_block=new data_block_0_2(*d0_block); break;
-  case 003: d0_block=new data_block_0_3(*d0_block); break;
-  case 004: d0_block=new data_block_0_4(*d0_block); break;
-  case 010: d0_block=new data_block_0_10(*d0_block); break;
-  case 014: d0_block=new data_block_0_14(*d0_block); break;
-  case 024: d0_block=new data_block_0_24(*d0_block); break;
-  case 044: d0_block=new data_block_0_44(*d0_block); break;
-  case 030: d0_block=new data_block_0_30(*d0_block); break;
-  case 054: d0_block=new data_block_0_54(*d0_block); break;
-  case 060: d0_block=new data_block_0_60(*d0_block); break;
-  case 050: d0_block=new data_block_0_50(*d0_block); break;
+  // Here only type 0 left
+
+  switch(n_data_block_0->get_subtype()){
+  case 000: n_data_block_0_x=new data_block_0_0(*n_data_block_0); break;
+  case 001: n_data_block_0_x=new data_block_0_1(*n_data_block_0); break;
+  case 002: n_data_block_0_x=new data_block_0_2(*n_data_block_0); break;
+  case 003: n_data_block_0_x=new data_block_0_3(*n_data_block_0); break;
+  case 004: n_data_block_0_x=new data_block_0_4(*n_data_block_0); break;
+  case 010: n_data_block_0_x=new data_block_0_10(*n_data_block_0); break;
+  case 014: n_data_block_0_x=new data_block_0_14(*n_data_block_0); break;
+  case 024: n_data_block_0_x=new data_block_0_24(*n_data_block_0); break;
+  case 044: n_data_block_0_x=new data_block_0_44(*n_data_block_0); break;
+  case 030: n_data_block_0_x=new data_block_0_30(*n_data_block_0); break;
+  case 054: n_data_block_0_x=new data_block_0_54(*n_data_block_0); break;
+  case 060: n_data_block_0_x=new data_block_0_60(*n_data_block_0); break;
+  case 064: n_data_block_0_x=new data_block_0_64(*n_data_block_0); break;
+  case 050: n_data_block_0_x=new data_block_0_50(*n_data_block_0); break;
   default:
-    return res_block;
+    return n_data_block_0;
   }
-  delete res_block;
-  res_block=d0_block;
-  return res_block;
+  delete n_data_block_0;
+  return n_data_block_0_x;
 }
 
 /***************************************************************/