⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 map.c

📁 CC386 is a general-purpose 32-bit C compiler. It is not an optimizing compiler but given that the co
💻 C
📖 第 1 页 / 共 2 页
字号:
         When 1:
          grp = (group_entry_ptr) fixup.frame_referent;
          print("Grp(%s)", (*Grp.group_name).symbol);
          break;
         When 2:
          pub = (public_entry_ptr) fixup.frame_referent;
          print("Ext(%s)", unmangle(Pub.symbol));
          break;
         When 3:
          print("Abs(%04lX)", ((bit_32)(fixup.frame_referent)));
          break;
         When 4:
          print("Location");
          break;
         When 5:
          print("Target");
          break;
         When 6:
          print("None");
          break;
        EndCase;
       print(") Target(");
       Using fixup.target_method
        BeginCase
         When 0:
          lseg = (lseg_ptr) fixup.target_referent;
          seg  = Lseg.segment;
          print("Seg(%s)+%06lX",
                unmangle((*Seg.segment_name).symbol),
                Bit_32(fixup.target_offset) +
                 (Lseg.address - Seg.address));
          break;
         When 1:
          grp = (group_entry_ptr) fixup.target_referent;
          print("Grp(%s)+%06lX",
                (*Grp.group_name).symbol,
                Bit_32(fixup.target_offset));
          break;
         When 2:
          pub = (public_entry_ptr) fixup.target_referent;
          print("Ext(%s)+%06lX",
                unmangle(Pub.symbol),
                Bit_32(fixup.target_offset));
          break;
         When 3:
          print("Abs(%06lX)", ((bit_32)(fixup.target_referent)));
          break;
        EndCase;
       print(")\n");
	   fixup_temp = (*fixup_temp).next ;
      EndWhile;
    EndIf;
  EndIf;
 file_close_for_write();
 return;
EndCode
#undef File
#undef Grp
#undef Pub
#undef Seg
#undef Lseg

/*+-------------------------------------------------------------------------+
  |                                                                         |
  |                               map_memory                                |
  |                                                                         |
  +-------------------------------------------------------------------------+*/
void map_memory(byte_ptr data, bit_32 address, bit_32 length)
BeginDeclarations
bit_16                                 i;
bit_32                                 line_address;
char                                   ascii[20];
EndDeclarations
BeginCode
 line_address = address & 0xFFFFFFF0L;
 While length Exceeds 0
  BeginWhile
   print("%05X: ", line_address);
   far_set(BytePtr(ascii), 0, 20);
   For i=0; i<16; i++
    BeginFor
     If i Is 8
      Then
       print(" :");
//       strcat(ascii, " : ");
      EndIf;
     If (line_address LessThan address) OrIf (length IsZero)
      Then
       print(" ..");
       ascii[i] = ' ';
       line_address++;
      Else
       print(" %02X", *data);
       If isprint(*data)
        Then
         ascii[i] = (char) *data;
        Else
         ascii[i] = '.';
        EndIf;
       data++;
       line_address++;
       address++;
       length--;
      EndIf;
    EndFor;
    ascii[16] = 0 ;
   print("  %s\n", ascii);
  EndWhile;
 return;
EndCode

/*+-------------------------------------------------------------------------+
  |                                                                         |
  |                          sort_publics_by_name                           |
  |                                                                         |
  +-------------------------------------------------------------------------+*/
void sort_publics_by_name(bit_16 left, bit_16 right)
BeginDeclarations
bit_16                                 i;
bit_16                                 j;
char                                   buf1[256] ;
char                                   buf2[256] ;
public_entry_ptr                       temp;
EndDeclarations
BeginCode
 If left NotLessThan right
  Then
   return;
  EndIf;
 i = left;
 j = right;
 While i LessThan j
  BeginWhile
   While i LessThan j
    BeginWhile
     strcpy(buf1,unmangle((*public_sort_array[i]).symbol)) ;
     strcpy(buf2,unmangle((*public_sort_array[j]).symbol)) ;
     If strcmp(buf1,buf2) Exceeds 0
//     If far_compare((*public_sort_array[i]).symbol,
//                    (*public_sort_array[j]).symbol,
//                    (*public_sort_array[i]).length+1) Exceeds 0
      Then
       temp                 = public_sort_array[i];
       public_sort_array[i] = public_sort_array[j];
       public_sort_array[j] = temp;
       ExitLoop;
      EndIf;
     j--;
    EndWhile;
   While i LessThan j
    BeginWhile
     strcpy(buf1,unmangle((*public_sort_array[i]).symbol)) ;
     strcpy(buf2,unmangle((*public_sort_array[j]).symbol)) ;
     If strcmp(buf1,buf2) Exceeds 0
//     If far_compare((*public_sort_array[i]).symbol,
//                    (*public_sort_array[j]).symbol,
//                    (*public_sort_array[i]).length+1) Exceeds 0
      Then
       temp                 = public_sort_array[i];
       public_sort_array[i] = public_sort_array[j];
       public_sort_array[j] = temp;
       ExitLoop;
      EndIf;
     i++;
    EndWhile;
  EndWhile;
  If i Exceeds 0
   Then
    sort_publics_by_name(left, i-1);
   EndIf;
 sort_publics_by_name(i+1,  right);
 return;
EndCode

/*+-------------------------------------------------------------------------+
  |                                                                         |
  |                          sort_publics_by_value                          |
  |                                                                         |
  +-------------------------------------------------------------------------+*/
void sort_publics_by_value(bit_16 left, bit_16 right)
BeginDeclarations
bit_16                                 i;
bit_16                                 j;
public_entry_ptr                       temp;
EndDeclarations
BeginCode
 If left NotLessThan right
  Then
   return;
  EndIf;
 i = left;
 j = right;
 While i LessThan j
  BeginWhile
   While i LessThan j
    BeginWhile
     If (((*public_sort_array[i]).Internal.lseg IsNull) AndIf
         ((*public_sort_array[j]).Internal.lseg IsNotNull)) OrIf
        (public_target_address(public_sort_array[i]) Exceeds
         public_target_address(public_sort_array[j]))
      Then
       temp                 = public_sort_array[i];
       public_sort_array[i] = public_sort_array[j];
       public_sort_array[j] = temp;
       ExitLoop;
      EndIf;
     j--;
    EndWhile;
   While i LessThan j
    BeginWhile
     If (((*public_sort_array[i]).Internal.lseg IsNull) AndIf
         ((*public_sort_array[j]).Internal.lseg IsNotNull)) OrIf
        (public_target_address(public_sort_array[i]) Exceeds
         public_target_address(public_sort_array[j]))
      Then
       temp                 = public_sort_array[i];
       public_sort_array[i] = public_sort_array[j];
       public_sort_array[j] = temp;
       ExitLoop;
      EndIf;
     i++;
    EndWhile;
  EndWhile;
  If i Exceeds 0
   Then
    sort_publics_by_value(left, i-1);
   EndIf;
 sort_publics_by_value(i+1,  right);
 return;
EndCode


/*
 Start  Stop   Length Name                   Class
 00000H 016F7H 016F8H _TEXT                  CODE
 016F8H 016F8H 00000H C_ETEXT                ENDCODE
 01700H 01741H 00042H NULL                   BEGDATA
 01742H 01967H 00226H _DATA                  DATA
 01968H 01975H 0000EH CDATA                  DATA
 01976H 01976H 00000H XIFB                   DATA
 01976H 01976H 00000H XIF                    DATA
 01976H 01976H 00000H XIFE                   DATA
 01976H 01976H 00000H XIB                    DATA
 01976H 01976H 00000H XI                     DATA
 01976H 01976H 00000H XIE                    DATA
 01976H 01976H 00000H XPB                    DATA
 01976H 01977H 00002H XP                     DATA
 01978H 01978H 00000H XPE                    DATA
 01978H 01978H 00000H XCB                    DATA
 01978H 01978H 00000H XC                     DATA
 01978H 01978H 00000H XCE                    DATA
 01978H 01978H 00000H XCFB                   DATA
 01978H 01978H 00000H XCF                    DATA
 01978H 01978H 00000H XCFE                   DATA
 01978H 01978H 00000H CONST                  CONST
 01978H 0197FH 00008H HDR                    MSG
 01980H 01A4DH 000CEH MSG                    MSG
 01A4EH 01A4FH 00002H PAD                    MSG
 01A50H 01A50H 00001H EPAD                   MSG
 01A52H 01A77H 00026H _BSS                   BSS
 01A78H 01A78H 00000H XOB                    BSS
 01A78H 01A78H 00000H XO                     BSS
 01A78H 01A78H 00000H XOE                    BSS
 01A80H 02085H 00606H c_common               BSS
 02090H 0288FH 00800H STACK                  STACK

 Origin   Group
 0170:0   DGROUP

  Address         Publics by Name

 0170:005C       STKHQQ

  Address         Publics by Value

 0000:0010       _main
 0000:9876  Abs  __acrtmsg
 0000:9876  Abs  __acrtused

Program entry point at 0000:0294


*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -