mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 23:39:31 +02:00
+ $ASMMODE
This commit is contained in:
parent
a9e0837f1e
commit
4fc1780fe4
@ -32,7 +32,7 @@ Unit aopt386;
|
||||
implementation
|
||||
|
||||
uses
|
||||
cobjects,globals,symtable,strings,verbose,hcodegen
|
||||
cobjects,globals,systems,symtable,strings,verbose,hcodegen
|
||||
{$ifdef i386}
|
||||
,i386
|
||||
,cgi386
|
||||
@ -1631,7 +1631,10 @@ end;
|
||||
End.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.13 1998-05-24 18:42:37 jonas
|
||||
Revision 1.14 1998-05-30 14:31:02 peter
|
||||
+ $ASMMODE
|
||||
|
||||
Revision 1.13 1998/05/24 18:42:37 jonas
|
||||
* final bugfilx for mov optimizes, remake3 with optimizations works again!
|
||||
|
||||
Revision 1.12 1998/05/24 15:20:59 jonas
|
||||
|
@ -60,7 +60,7 @@ begin
|
||||
'x' : initswitches:=initswitches+[cs_optimize,cs_maxoptimieren];
|
||||
'z' : initswitches:=initswitches+[cs_optimize,cs_uncertainopts];
|
||||
'2' : initoptprocessor:=pentium2;
|
||||
'3' : initoptprocessor:=globals.i386;
|
||||
'3' : initoptprocessor:=systems.i386;
|
||||
'4' : initoptprocessor:=i486;
|
||||
'5' : initoptprocessor:=pentium;
|
||||
'6' : initoptprocessor:=pentiumpro;
|
||||
@ -89,7 +89,10 @@ end;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.6 1998-05-28 17:26:48 peter
|
||||
Revision 1.7 1998-05-30 14:31:05 peter
|
||||
+ $ASMMODE
|
||||
|
||||
Revision 1.6 1998/05/28 17:26:48 peter
|
||||
* fixed -R switch, it didn't work after my previous akt/init patch
|
||||
* fixed bugs 110,130,136
|
||||
|
||||
|
@ -40,7 +40,7 @@ unit pstatmnt;
|
||||
|
||||
uses
|
||||
cobjects,scanner,globals,symtable,aasm,pass_1,
|
||||
types,hcodegen,files,verbose
|
||||
types,hcodegen,files,verbose,systems
|
||||
{$ifdef NEWPPU}
|
||||
,ppu
|
||||
{$endif}
|
||||
@ -1121,7 +1121,10 @@ unit pstatmnt;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.14 1998-05-29 09:58:14 pierre
|
||||
Revision 1.15 1998-05-30 14:31:06 peter
|
||||
+ $ASMMODE
|
||||
|
||||
Revision 1.14 1998/05/29 09:58:14 pierre
|
||||
* OPR_REGISTER for 1 arg was missing in ratti386.pas
|
||||
(probably a merging problem)
|
||||
* errors at start of line were lost
|
||||
|
@ -82,7 +82,7 @@ var
|
||||
Implementation
|
||||
|
||||
Uses
|
||||
files,aasm,globals,AsmUtils,strings,hcodegen,scanner,
|
||||
systems,files,aasm,globals,AsmUtils,strings,hcodegen,scanner,
|
||||
cobjects,verbose,types;
|
||||
|
||||
|
||||
@ -1345,7 +1345,7 @@ var
|
||||
{ this makes cpu.pp uncompilable, but i think this code should be }
|
||||
{ inserted in the system unit anyways. }
|
||||
if (instruc >= lastop_in_table) and
|
||||
((cs_compilesystem in aktswitches) or (aktoptprocessor > globals.i386)) then
|
||||
((cs_compilesystem in aktswitches) or (aktoptprocessor > systems.i386)) then
|
||||
begin
|
||||
Message(assem_w_opcode_not_in_table);
|
||||
fits:=true;
|
||||
@ -3369,7 +3369,10 @@ Begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.7 1998-05-28 16:32:05 carl
|
||||
Revision 1.8 1998-05-30 14:31:07 peter
|
||||
+ $ASMMODE
|
||||
|
||||
Revision 1.7 1998/05/28 16:32:05 carl
|
||||
* bugfix with operands main branch version (patched manually)
|
||||
|
||||
Revision 1.6 1998/05/23 01:21:26 peter
|
||||
|
@ -75,7 +75,7 @@ var
|
||||
Implementation
|
||||
|
||||
Uses
|
||||
files,aasm,globals,AsmUtils,strings,hcodegen,scanner,
|
||||
files,aasm,globals,AsmUtils,strings,hcodegen,scanner,systems,
|
||||
cobjects,verbose,symtable,types;
|
||||
|
||||
type
|
||||
@ -1536,7 +1536,7 @@ const
|
||||
{ the att version only if the processor > i386 or we are compiling }
|
||||
{ the system unit then this will be allowed... }
|
||||
if (instruc >= lastop_in_table) and
|
||||
((cs_compilesystem in aktswitches) or (aktoptprocessor > globals.i386)) then
|
||||
((cs_compilesystem in aktswitches) or (aktoptprocessor >systems.i386)) then
|
||||
begin
|
||||
Message1(assem_w_opcode_not_in_table,att_op2str[instruc]);
|
||||
fits:=true;
|
||||
@ -3683,7 +3683,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.9 1998-05-29 09:58:16 pierre
|
||||
Revision 1.10 1998-05-30 14:31:08 peter
|
||||
+ $ASMMODE
|
||||
|
||||
Revision 1.9 1998/05/29 09:58:16 pierre
|
||||
* OPR_REGISTER for 1 arg was missing in ratti386.pas
|
||||
(probably a merging problem)
|
||||
* errors at start of line were lost
|
||||
|
@ -26,7 +26,7 @@ type
|
||||
directivestr=string[directivelen];
|
||||
tdirectivetoken=(
|
||||
_DIR_NONE,
|
||||
_DIR_ALIGN,
|
||||
_DIR_ALIGN,_DIR_ASMMODE,
|
||||
_DIR_D,_DIR_DEFINE,_DIR_DESCRIPTION,
|
||||
_DIR_ELSE,_DIR_ENDIF,_DIR_ERROR,
|
||||
_DIR_FATAL,
|
||||
@ -46,7 +46,7 @@ const
|
||||
lastdirective=_DIR_WARNING;
|
||||
directive:array[tdirectivetoken] of directivestr=(
|
||||
'',
|
||||
'ALIGN',
|
||||
'ALIGN','ASMMODE',
|
||||
'D','DEFINE','DESCRIPTION',
|
||||
'ELSE','ENDIF','ERROR',
|
||||
'FATAL',
|
||||
@ -697,6 +697,19 @@ const
|
||||
end;
|
||||
|
||||
procedure dir_asmmode(t:tdirectivetoken);
|
||||
var
|
||||
s : string;
|
||||
begin
|
||||
skipspace;
|
||||
s:=readid;
|
||||
if s='DEFAULT' then
|
||||
aktasmmode:=initasmmode
|
||||
else
|
||||
if not set_string_asmmode(s,aktasmmode) then
|
||||
Comment(V_Warning,'Unsupported asm mode specified '+s);
|
||||
end;
|
||||
|
||||
procedure dir_oldasmmode(t:tdirectivetoken);
|
||||
begin
|
||||
{$ifdef i386}
|
||||
case t of
|
||||
@ -730,6 +743,7 @@ const
|
||||
directiveproc:array[tdirectivetoken] of tdirectiveproc=(
|
||||
{_DIR_NONE} nil,
|
||||
{_DIR_ALIGN} dir_delphiswitch,
|
||||
{_DIR_ASMMODE} dir_asmmode,
|
||||
{_DIR_D} dir_description,
|
||||
{_DIR_DEFINE} dir_define,
|
||||
{_DIR_DESCRIPTION} dir_description,
|
||||
@ -738,9 +752,9 @@ const
|
||||
{_DIR_ERROR} dir_message,
|
||||
{_DIR_FATAL} dir_message,
|
||||
{_DIR_I} dir_include,
|
||||
{_DIR_I386_ATT} dir_asmmode,
|
||||
{_DIR_I386_DIRECT} dir_asmmode,
|
||||
{_DIR_I386_INTEL} dir_asmmode,
|
||||
{_DIR_I386_ATT} dir_oldasmmode,
|
||||
{_DIR_I386_DIRECT} dir_oldasmmode,
|
||||
{_DIR_I386_INTEL} dir_oldasmmode,
|
||||
{_DIR_IOCHECKS} dir_delphiswitch,
|
||||
{_DIR_IF} dir_conditional,
|
||||
{_DIR_IFDEF} dir_conditional,
|
||||
@ -816,7 +830,10 @@ const
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.9 1998-05-23 01:21:28 peter
|
||||
Revision 1.10 1998-05-30 14:31:10 peter
|
||||
+ $ASMMODE
|
||||
|
||||
Revision 1.9 1998/05/23 01:21:28 peter
|
||||
+ aktasmmode, aktoptprocessor, aktoutputformat
|
||||
+ smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
|
||||
+ $LIBNAME to set the library name where the unit will be put in
|
||||
|
@ -26,6 +26,27 @@ unit systems;
|
||||
interface
|
||||
|
||||
type
|
||||
tendian = (endian_little,en_big_endian);
|
||||
|
||||
tprocessors = (
|
||||
{$ifdef i386}
|
||||
i386,i486,pentium,pentiumpro,cx6x86,pentium2,amdk6
|
||||
{$endif}
|
||||
{$ifdef m68k}
|
||||
MC68000,MC68020
|
||||
{$endif}
|
||||
);
|
||||
|
||||
|
||||
tasmmode = (
|
||||
{$ifdef i386}
|
||||
I386_ATT,I386_INTEL,I386_DIRECT
|
||||
{$endif}
|
||||
{$ifdef m68k}
|
||||
M68K_MOT
|
||||
{$endif}
|
||||
);
|
||||
|
||||
ttarget = (target_GO32V1,target_GO32V2,target_LINUX,target_OS2,
|
||||
target_WIN32,target_Amiga,target_Atari,target_Mac68k);
|
||||
|
||||
@ -49,7 +70,6 @@ unit systems;
|
||||
{$endif}
|
||||
);
|
||||
|
||||
tendian = (endian_little,en_big_endian);
|
||||
|
||||
tosinfo = record
|
||||
name : string[30];
|
||||
@ -106,6 +126,10 @@ unit systems;
|
||||
assem : tasm;
|
||||
end;
|
||||
|
||||
tasmmodeinfo=record
|
||||
id : tasmmode;
|
||||
idtxt : string[8];
|
||||
end;
|
||||
|
||||
var
|
||||
target_info : ttargetinfo;
|
||||
@ -116,7 +140,7 @@ unit systems;
|
||||
|
||||
function set_string_target(const s : string) : boolean;
|
||||
function set_string_asm(const s : string) : boolean;
|
||||
|
||||
function set_string_asmmode(const s:string;var t:tasmmode):boolean;
|
||||
|
||||
implementation
|
||||
|
||||
@ -545,6 +569,31 @@ implementation
|
||||
)
|
||||
);
|
||||
|
||||
{****************************************************************************
|
||||
AsmModeInfo
|
||||
****************************************************************************}
|
||||
asmmodeinfos : array[tasmmode] of tasmmodeinfo = (
|
||||
{$ifdef i386}
|
||||
(
|
||||
id : I386_DIRECT;
|
||||
idtxt : 'DIRECT';
|
||||
),
|
||||
(
|
||||
id : I386_INTEL;
|
||||
idtxt : 'INTEL';
|
||||
),
|
||||
(
|
||||
id : I386_ATT;
|
||||
idtxt : 'ATT'
|
||||
)
|
||||
{$endif}
|
||||
{$ifdef m68k}
|
||||
(
|
||||
id : M68K_MOT;
|
||||
idtxt : 'MOT';
|
||||
)
|
||||
{$endif}
|
||||
);
|
||||
|
||||
{****************************************************************************
|
||||
Helpers
|
||||
@ -591,6 +640,20 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function set_string_asmmode(const s:string;var t:tasmmode):boolean;
|
||||
var
|
||||
i : longint;
|
||||
begin
|
||||
set_string_asmmode:=false;
|
||||
for i:=0 to (sizeof(asmmodeinfos) div sizeof(tasmmodeinfo))-1 do
|
||||
if asmmodeinfos[tasmmode(i)].idtxt=s then
|
||||
begin
|
||||
t:=asmmodeinfos[tasmmode(i)].id;
|
||||
set_string_asmmode:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
{****************************************************************************
|
||||
Initialization of default target
|
||||
****************************************************************************}
|
||||
@ -637,7 +700,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.14 1998-05-29 13:24:45 peter
|
||||
Revision 1.15 1998-05-30 14:31:11 peter
|
||||
+ $ASMMODE
|
||||
|
||||
Revision 1.14 1998/05/29 13:24:45 peter
|
||||
+ asw assembler
|
||||
|
||||
Revision 1.13 1998/05/27 00:20:33 peter
|
||||
|
Loading…
Reference in New Issue
Block a user