* use apptype to indicate that the target is a DOS .COM file, instead of introducing a new field in tsettings (as suggested by Sven)

git-svn-id: trunk@25544 -
This commit is contained in:
nickysn 2013-09-24 12:13:47 +00:00
parent 139b498296
commit 52a5ffc386
5 changed files with 25 additions and 24 deletions

View File

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

View File

@ -400,7 +400,8 @@ interface
app_tool, { tool application, (MPW tool for MacOS, MacOS only) } app_tool, { tool application, (MPW tool for MacOS, MacOS only) }
app_arm7, { for Nintendo DS target } app_arm7, { for Nintendo DS target }
app_arm9, { for Nintendo DS target } app_arm9, { for Nintendo DS target }
app_bundle { dynamically loadable bundle, Darwin only } app_bundle, { dynamically loadable bundle, Darwin only }
app_com { DOS .COM file }
); );
{ interface types } { interface types }
@ -682,7 +683,6 @@ interface
type type
tx86memorymodel = (mm_tiny,mm_small,mm_medium,mm_compact,mm_large,mm_huge); 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} { hide Sysutils.ExecuteProcess in units using this one after SysUtils}
const const

View File

@ -1956,18 +1956,8 @@ begin
if (target_info.system in [system_i8086_msdos]) then if (target_info.system in [system_i8086_msdos]) then
begin begin
case Upper(Copy(More,j+1,255)) of case Upper(Copy(More,j+1,255)) of
'EXE': 'EXE': SetAppType(app_cui);
begin 'COM': SetAppType(app_com);
init_settings.msdostargetformat:=msdos_exe;
targetinfos[system_i8086_msdos]^.exeext:='.exe';
target_info.exeext:='.exe';
end;
'COM':
begin
init_settings.msdostargetformat:=msdos_com;
targetinfos[system_i8086_msdos]^.exeext:='.com';
target_info.exeext:='.com';
end;
else else
IllegalPara(opt); IllegalPara(opt);
end; end;

View File

@ -633,10 +633,25 @@ implementation
procedure SetAppType(NewAppType:tapptype); procedure SetAppType(NewAppType:tapptype);
begin begin
if apptype=app_cui then {$ifdef i8086}
if (target_info.system=system_i8086_msdos) and (apptype<>NewAppType) then
begin
if NewAppType=app_com then
begin
targetinfos[system_i8086_msdos]^.exeext:='.com';
target_info.exeext:='.com';
end
else
begin
targetinfos[system_i8086_msdos]^.exeext:='.exe';
target_info.exeext:='.exe';
end;
end;
{$endif i8086}
if apptype in [app_cui,app_com] then
undef_system_macro('CONSOLE'); undef_system_macro('CONSOLE');
apptype:=NewAppType; apptype:=NewAppType;
if apptype=app_cui then if apptype in [app_cui,app_com] then
def_system_macro('CONSOLE'); def_system_macro('CONSOLE');
end; end;
{***************************************************************************** {*****************************************************************************

View File

@ -268,12 +268,10 @@ begin
if s<>'' then if s<>'' then
LinkRes.Add('library '+MaybeQuoted(s)); LinkRes.Add('library '+MaybeQuoted(s));
end; end;
case current_settings.msdostargetformat of if apptype=app_com then
msdos_exe: LinkRes.Add('format dos'); LinkRes.Add('format dos com')
msdos_com: LinkRes.Add('format dos com'); else
else LinkRes.Add('format dos');
InternalError(2013092101);
end;
LinkRes.Add('option dosseg'); LinkRes.Add('option dosseg');
LinkRes.Add('name ' + maybequoted(current_module.exefilename)); LinkRes.Add('name ' + maybequoted(current_module.exefilename));