* moved section names to systems

* fixed nasm,intel writer
This commit is contained in:
peter 1999-05-02 22:41:46 +00:00
parent 116e172bbc
commit adda83dac6
9 changed files with 277 additions and 181 deletions

View File

@ -25,7 +25,7 @@ unit aasm;
interface
uses
cobjects,files,globals;
systems,cobjects,files,globals;
type
{$ifdef i386}
@ -70,13 +70,6 @@ unit aasm;
{ never used, makes insertation of new ait_ easier to type }
ait_dummy);
tsection=(sec_none,
sec_code,sec_data,sec_bss,
sec_stab,sec_stabstr,
sec_idata2,sec_idata4,sec_idata5,sec_idata6,sec_idata7,sec_edata,
sec_fake
);
{ asm symbol functions }
type
@ -350,7 +343,7 @@ type
implementation
uses
strings,verbose,systems,globtype;
strings,verbose,globtype;
{****************************************************************************
TAI
@ -1013,7 +1006,11 @@ uses
end.
{
$Log$
Revision 1.40 1999-04-21 09:43:28 peter
Revision 1.41 1999-05-02 22:41:46 peter
* moved section names to systems
* fixed nasm,intel writer
Revision 1.40 1999/04/21 09:43:28 peter
* storenumber works
* fixed some typos in double_checksum
+ incompatible types type1 and type2 message (with storenumber)

View File

@ -338,9 +338,6 @@ unit ag386int;
ait_const2str:array[ait_const_32bit..ait_const_8bit] of string[8]=
(#9'DD'#9,#9'DW'#9,#9'DB'#9);
ait_section2masmstr : array[tsection] of string[6]=
('','CODE','DATA','BSS','','','','','','','','','');
Function PadTabs(const p:string;addch:char):string;
var
s : string;
@ -395,13 +392,13 @@ unit ag386int;
ait_tempalloc : ;
ait_section : begin
if LastSec<>sec_none then
AsmWriteLn('_'+ait_section2masmstr[LastSec]+#9#9'ENDS');
AsmWriteLn('_'+target_asm.secnames[LastSec]+#9#9'ENDS');
if pai_section(hp)^.sec<>sec_none then
begin
AsmLn;
AsmWriteLn('_'+ait_section2masmstr[pai_section(hp)^.sec]+#9#9+
AsmWriteLn('_'+target_asm.secnames[pai_section(hp)^.sec]+#9#9+
'SEGMENT'#9'PARA PUBLIC USE32 '''+
ait_section2masmstr[pai_section(hp)^.sec]+'''');
target_asm.secnames[pai_section(hp)^.sec]+'''');
end;
LastSec:=pai_section(hp)^.sec;
end;
@ -554,6 +551,7 @@ ait_labeled_instruction : AsmWriteLn(#9#9+int_op2str[pai386_labeled(hp)^.opcode]
ait_instruction : begin
suffix:='';
prefix:= '';
s:='';
{$ifndef OLDASM}
{ added prefix instructions, must be on same line as opcode }
if (pai386(hp)^.ops = 0) and
@ -582,7 +580,7 @@ ait_labeled_instruction : AsmWriteLn(#9#9+int_op2str[pai386_labeled(hp)^.opcode]
if pai386(hp)^.ops<>0 then
begin
if pai386(hp)^.opcode=A_CALL then
s:='dword ptr '+getopstr_jmp(pai386(hp)^.oper[0])
s:=#9+getopstr_jmp(pai386(hp)^.oper[0])
else
begin
for i:=0to pai386(hp)^.ops-1 do
@ -594,30 +592,6 @@ ait_labeled_instruction : AsmWriteLn(#9#9+int_op2str[pai386_labeled(hp)^.opcode]
s:=s+sep+getopstr(pai386(hp)^.oper[i],pai386(hp)^.opsize,pai386(hp)^.opcode,(i=1));
end;
end;
end
else
begin
{ check if string instruction }
{ long form, otherwise may give range check errors }
{ in turbo pascal... }
{ if ((pai386(hp)^.opcode = A_CMPS) or
(pai386(hp)^.opcode = A_INS) or
(pai386(hp)^.opcode = A_OUTS) or
(pai386(hp)^.opcode = A_SCAS) or
(pai386(hp)^.opcode = A_STOS) or
(pai386(hp)^.opcode = A_MOVS) or
(pai386(hp)^.opcode = A_LODS) or
(pai386(hp)^.opcode = A_XLAT)) then
Begin
case pai386(hp)^.opsize of
S_B: suffix:='b';
S_W: suffix:='w';
S_L: suffix:='d';
else
Message(assem_f_invalid_suffix_intel);
end;
end; }
s:='';
end;
AsmWriteLn(#9#9+prefix+int_op2str[pai386(hp)^.opcode]+cond2str[pai386_labeled(hp)^.condition]+suffix+s);
{$else}
@ -722,7 +696,7 @@ ait_stab_function_name : ;
else
begin
if LastSec<>sec_none then
AsmWriteLn('_'+ait_section2masmstr[LastSec]+#9#9'ENDS');
AsmWriteLn('_'+target_asm.secnames[LastSec]+#9#9'ENDS');
AsmLn;
AsmWriteLn(#9'END');
AsmClose;
@ -743,9 +717,9 @@ ait_stab_function_name : ;
AsmWriteLn(#9'.386p');
AsmWriteLn(#9'LOCALS '+target_asm.labelprefix);
if lastsec<>sec_none then
AsmWriteLn('_'+ait_section2masmstr[lastsec]+#9#9+
AsmWriteLn('_'+target_asm.secnames[lastsec]+#9#9+
'SEGMENT'#9'PARA PUBLIC USE32 '''+
ait_section2masmstr[lastsec]+'''');
target_asm.secnames[lastsec]+'''');
AsmStartSize:=AsmSize;
end;
ait_marker: ;
@ -795,7 +769,11 @@ ait_stab_function_name : ;
end.
{
$Log$
Revision 1.34 1999-05-01 13:23:58 peter
Revision 1.35 1999-05-02 22:41:49 peter
* moved section names to systems
* fixed nasm,intel writer
Revision 1.34 1999/05/01 13:23:58 peter
* merged nasm compiler
* old asm moved to oldasm/

View File

@ -344,12 +344,6 @@ unit ag386nsm;
ait_const2str:array[ait_const_32bit..ait_const_8bit] of string[8]=
(#9'DD'#9,#9'DW'#9,#9'DB'#9);
ait_section2nasmstr : array[tsection] of string[8]=
('','.text','.data','.bss',
'.stab','.stabstr',
'.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
'');
Function PadTabs(const p:string;addch:char):string;
var
s : string;
@ -408,7 +402,7 @@ unit ag386nsm;
if pai_section(hp)^.sec<>sec_none then
begin
AsmLn;
AsmWriteLn('SECTION '+ait_section2nasmstr[pai_section(hp)^.sec]);
AsmWriteLn('SECTION '+target_asm.secnames[pai_section(hp)^.sec]);
end;
LastSec:=pai_section(hp)^.sec;
end;
@ -557,6 +551,7 @@ ait_labeled_instruction :
ait_instruction : begin
suffix:='';
prefix:='';
s:='';
{$ifndef OLDASM}
if pai386(hp)^.ops<>0 then
begin
@ -573,9 +568,7 @@ ait_labeled_instruction :
s:=s+sep+getopstr(pai386(hp)^.oper[i],pai386(hp)^.opsize,pai386(hp)^.opcode,(i=1));
end;
end;
end
else
s:='';
end;
if pai386(hp)^.opcode=A_FWAIT then
AsmWriteln(#9#9'DB'#9'09bh')
else
@ -696,7 +689,7 @@ ait_stab_function_name : ;
hp:=pai(hp^.next);
end;
if lastsec<>sec_none then
AsmWriteLn('SECTION '+ait_section2nasmstr[lastsec]);
AsmWriteLn('SECTION '+target_asm.secnames[lastsec]);
AsmStartSize:=AsmSize;
end;
ait_marker : ;
@ -740,7 +733,11 @@ ait_stab_function_name : ;
end.
{
$Log$
Revision 1.29 1999-05-01 13:23:59 peter
Revision 1.30 1999-05-02 22:41:50 peter
* moved section names to systems
* fixed nasm,intel writer
Revision 1.29 1999/05/01 13:23:59 peter
* merged nasm compiler
* old asm moved to oldasm/

View File

@ -85,7 +85,7 @@ uses
{$endif}
,strings
{$ifdef i386}
{$ifndef OLDASM}
{$ifndef NoAg386Bin}
,ag386bin
{$endif}
{$ifndef NoAg386Att}
@ -446,14 +446,14 @@ Procedure GenerateAsm;
var
a : PAsmList;
{$ifdef i386}
{$ifndef OLDASM}
{$ifndef NoAg386Bin}
b : Pi386binasmlist;
{$endif}
{$endif}
begin
case aktoutputformat of
{$ifdef i386}
{$ifndef OLDASM}
{$ifndef NoAg386Bin}
as_i386_dbg,
as_i386_coff,
as_i386_pecoff :
@ -479,7 +479,7 @@ begin
SynchronizeFileTime(current_module^.ppufilename^,current_module^.objfilename^);
exit;
end;
{$endif Ag386Bin}
{$endif NoAg386Bin}
{$ifndef NoAg386Att}
as_i386_as,
as_i386_as_aout,
@ -541,7 +541,11 @@ end;
end.
{
$Log$
Revision 1.42 1999-05-01 13:24:00 peter
Revision 1.43 1999-05-02 22:41:51 peter
* moved section names to systems
* fixed nasm,intel writer
Revision 1.42 1999/05/01 13:24:00 peter
* merged nasm compiler
* old asm moved to oldasm/

View File

@ -209,6 +209,8 @@ uses
procedure tai386.loadconst(opidx:longint;l:longint);
begin
if opidx>=ops then
ops:=opidx+1;
with oper[opidx] do
begin
if typ=top_ref then
@ -220,6 +222,8 @@ uses
procedure tai386.loadsymbol(opidx:longint;s:pasmsymbol;sofs:longint);
begin
if opidx>=ops then
ops:=opidx+1;
with oper[opidx] do
begin
if typ=top_ref then
@ -232,6 +236,8 @@ uses
procedure tai386.loadref(opidx:longint;p:preference);
begin
if opidx>=ops then
ops:=opidx+1;
with oper[opidx] do
begin
if typ=top_ref then
@ -257,6 +263,8 @@ uses
procedure tai386.loadreg(opidx:longint;r:tregister);
begin
if opidx>=ops then
ops:=opidx+1;
with oper[opidx] do
begin
if typ=top_ref then
@ -268,6 +276,8 @@ uses
procedure tai386.loadoper(opidx:longint;o:toper);
begin
if opidx>=ops then
ops:=opidx+1;
if oper[opidx].typ=top_ref then
disposereference(oper[opidx].ref);
oper[opidx]:=o;
@ -1569,7 +1579,11 @@ end;
end.
{
$Log$
Revision 1.2 1999-05-02 21:33:52 florian
Revision 1.3 1999-05-02 22:41:53 peter
* moved section names to systems
* fixed nasm,intel writer
Revision 1.2 1999/05/02 21:33:52 florian
* several bugs regarding -Or fixed
Revision 1.1 1999/05/01 13:24:23 peter

View File

@ -30,7 +30,7 @@ unit og386;
uses
dos,
owbase,owar,
i386base,aasm;
systems,i386base,aasm;
type
tsecsize = array[tsection] of longint;
@ -77,7 +77,7 @@ unit og386;
implementation
uses
systems,globtype,globals,verbose,files,
globtype,globals,verbose,files,
assemble;
@ -236,7 +236,11 @@ unit og386;
end.
{
$Log$
Revision 1.1 1999-05-01 13:24:23 peter
Revision 1.2 1999-05-02 22:41:54 peter
* moved section names to systems
* fixed nasm,intel writer
Revision 1.1 1999/05/01 13:24:23 peter
* merged nasm compiler
* old asm moved to oldasm/

View File

@ -28,7 +28,7 @@ unit og386dbg;
interface
uses
i386base,
systems,i386base,
aasm,
og386;
@ -189,7 +189,11 @@ unit og386dbg;
end.
{
$Log$
Revision 1.1 1999-05-01 13:24:24 peter
Revision 1.2 1999-05-02 22:41:55 peter
* moved section names to systems
* fixed nasm,intel writer
Revision 1.1 1999/05/01 13:24:24 peter
* merged nasm compiler
* old asm moved to oldasm/

View File

@ -403,10 +403,14 @@ Var
Token : String15;
opr: TExprOperator;
begin
OpTop := 0; { Reset stacks }
Evaluate:=0;
{ Reset stacks }
OpTop :=0;
RPNTop:=0;
Token :='';
{ nothing to do ? }
if Expr='' then
exit;
For I:=1 to Length(Expr) DO
begin
if Expr[I] in ['0'..'9'] then
@ -1397,7 +1401,11 @@ end;
end.
{
$Log$
Revision 1.10 1999-05-01 13:24:41 peter
Revision 1.11 1999-05-02 22:41:57 peter
* moved section names to systems
* fixed nasm,intel writer
Revision 1.10 1999/05/01 13:24:41 peter
* merged nasm compiler
* old asm moved to oldasm/

View File

@ -37,6 +37,12 @@ unit systems;
,MC68000,MC68100,MC68020
);
tsection=(sec_none,
sec_code,sec_data,sec_bss,
sec_stab,sec_stabstr,
sec_idata2,sec_idata4,sec_idata5,sec_idata6,sec_idata7,sec_edata,
sec_fake
);
type
tasmmode= (asmmode_none
@ -150,6 +156,7 @@ unit systems;
externals : boolean;
labelprefix : string[2];
comment : string[2];
secnames : array[tsection] of string[20];
end;
tlinkinfo = packed record
@ -471,7 +478,12 @@ implementation
asmcmd : '-o $OBJ $ASM';
externals : false;
labelprefix : '.L';
comment : '# '
comment : '# ';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'','','','','','',
'')
)
,(
id : as_i386_as_aout;
@ -480,7 +492,12 @@ implementation
asmcmd : '-o $OBJ $ASM';
externals : false;
labelprefix : 'L';
comment : '# '
comment : '# ';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'','','','','','',
'')
)
,(
id : as_i386_asw;
@ -489,7 +506,13 @@ implementation
asmcmd : '-o $OBJ $ASM';
externals : false;
labelprefix : '.L';
comment : '# '
comment : '# ';
secnames : ('',
'.text','.data','.section .bss',
'.stab','.stabstr',
'.section .idata$2','.section .idata$4','.section .idata$5',
'.section .idata$6','.section .idata$7','.section .edata',
'')
)
,(
id : as_i386_nasmcoff;
@ -498,7 +521,12 @@ implementation
asmcmd : '-f coff -o $OBJ $ASM';
externals : true;
labelprefix : 'L';
comment : '; '
comment : '; ';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
'')
)
,(
id : as_i386_nasmelf;
@ -507,7 +535,12 @@ implementation
asmcmd : '-f elf -o $OBJ $ASM';
externals : true;
labelprefix : 'L';
comment : '; '
comment : '; ';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
'')
)
,(
id : as_i386_nasmobj;
@ -516,7 +549,12 @@ implementation
asmcmd : '-f obj -o $OBJ $ASM';
externals : true;
labelprefix : 'L';
comment : '; '
comment : '; ';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
'')
)
,(
id : as_i386_tasm;
@ -524,8 +562,12 @@ implementation
asmbin : 'tasm';
asmcmd : '/m2 $ASM $OBJ';
externals : true;
labelprefix : 'L';
comment : '; '
labelprefix : '@@';
comment : '; ';
secnames : ('',
'CODE','DATA','BSS',
'','','','','','','','',
'')
)
,(
id : as_i386_masm;
@ -534,7 +576,11 @@ implementation
asmcmd : '$ASM $OBJ';
externals : true;
labelprefix : '.L';
comment : '; '
comment : '; ';
secnames : ('',
'CODE','DATA','BSS',
'','','','','','','','',
'')
)
,(
id : as_i386_dbg;
@ -543,7 +589,12 @@ implementation
asmcmd : '';
externals : true;
labelprefix : 'L';
comment : ''
comment : '';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
'.fake')
)
,(
id : as_i386_coff;
@ -552,7 +603,12 @@ implementation
asmcmd : '';
externals : true;
labelprefix : '.L';
comment : ''
comment : '';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
'.fake')
)
,(
id : as_i386_pecoff;
@ -561,7 +617,12 @@ implementation
asmcmd : '';
externals : true;
labelprefix : '.L';
comment : ''
comment : '';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
'.fake')
)
{$endif i386}
{$ifdef m68k}
@ -572,7 +633,12 @@ implementation
asmcmd : '-o $OBJ $ASM';
externals : false;
labelprefix : '.L';
comment : '# '
comment : '# ';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
'.fake')
)
,(
id : as_m68k_gas;
@ -581,7 +647,12 @@ implementation
asmcmd : '--register-prefix-optional -o $OBJ $ASM';
externals : false;
labelprefix : '.L';
comment : '| '
comment : '| ';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
'.fake')
)
,(
id : as_m68k_mit;
@ -590,7 +661,12 @@ implementation
asmcmd : '-o $OBJ $ASM';
externals : false;
labelprefix : '.L';
comment : '| '
comment : '| ';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
'.fake')
)
,(
id : as_m68k_mot;
@ -599,7 +675,12 @@ implementation
asmcmd : '-o $OBJ $ASM';
externals : false;
labelprefix : '__L';
comment : '| '
comment : '| ';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
'.fake')
)
,(
id : as_m68k_mpw;
@ -608,7 +689,12 @@ implementation
asmcmd : '-model far -o $OBJ $ASM';
externals : false;
labelprefix : '__L';
comment : '| '
comment : '| ';
secnames : ('',
'.text','.data','.bss',
'.stab','.stabstr',
'.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
'.fake')
)
{$endif m68k}
);
@ -1369,7 +1455,11 @@ begin
end.
{
$Log$
Revision 1.67 1999-05-01 14:18:12 peter
Revision 1.68 1999-05-02 22:41:59 peter
* moved section names to systems
* fixed nasm,intel writer
Revision 1.67 1999/05/01 14:18:12 peter
* win32 pecoff disabled because it's still not ok
Revision 1.66 1999/05/01 13:24:44 peter