Ver Fonte

+ added new i8086 compiler options -Wtexe and -Wtcom for specifying the MS-DOS
binary format (.exe or .com)
* the default format for i8086 tiny model binaries changed to .exe

git-svn-id: trunk@25528 -

nickysn há 12 anos atrás
pai
commit
567cdf875b
4 ficheiros alterados com 26 adições e 6 exclusões
  1. 2 0
      compiler/globals.pas
  2. 1 0
      compiler/globtype.pas
  3. 17 0
      compiler/options.pas
  4. 6 6
      compiler/systems/t_msdos.pas

+ 2 - 0
compiler/globals.pas

@@ -156,6 +156,7 @@ interface
 
 {$if defined(i8086)}
          x86memorymodel  : tx86memorymodel;
+         msdostargetformat : tmsdostargetformat;
 {$endif defined(i8086)}
 
 {$if defined(ARM)}
@@ -487,6 +488,7 @@ interface
         disabledircache : false;
 {$if defined(i8086)}
         x86memorymodel : mm_small;
+        msdostargetformat : msdos_exe;
 {$endif defined(i8086)}
 {$if defined(ARM)}
         instructionset : is_arm;

+ 1 - 0
compiler/globtype.pas

@@ -682,6 +682,7 @@ interface
 
     type
       tx86memorymodel = (mm_tiny,mm_small,mm_medium,mm_compact,mm_large,mm_huge);
+      tmsdostargetformat = (msdos_exe, msdos_com);
 
   { hide Sysutils.ExecuteProcess in units using this one after SysUtils}
   const

+ 17 - 0
compiler/options.pas

@@ -1950,6 +1950,23 @@ begin
                         else
                           IllegalPara(opt);
                       end;
+                    't':
+                      begin
+{$if defined(i8086)}
+                        if (target_info.system in [system_i8086_msdos]) then
+                          begin
+                            case Upper(Copy(More,j+1,255)) of
+                              'EXE': init_settings.msdostargetformat:=msdos_exe;
+                              'COM': init_settings.msdostargetformat:=msdos_com;
+                              else
+                                IllegalPara(opt);
+                            end;
+                            break;
+                          end
+                        else
+{$endif defined(i8086)}
+                          IllegalPara(opt);
+                      end;
                     'T':
                       begin
                         if target_info.system in systems_macos then

+ 6 - 6
compiler/systems/t_msdos.pas

@@ -268,13 +268,13 @@ begin
     if s<>'' then
       LinkRes.Add('library '+MaybeQuoted(s));
   end;
-  if current_settings.x86memorymodel=mm_tiny then
-    LinkRes.Add('format dos com')
-  else
-    LinkRes.Add('format dos');
+  case current_settings.msdostargetformat of
+    msdos_exe: LinkRes.Add('format dos');
+    msdos_com: LinkRes.Add('format dos com');
+    else
+      InternalError(2013092101);
+  end;
   LinkRes.Add('option dosseg');
-{  if current_settings.x86memorymodel=mm_tiny then
-    LinkRes.Add('system com');}
   LinkRes.Add('name ' + maybequoted(current_module.exefilename));
 
   { Write and Close response }