mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 11:28:06 +02:00
* refactored tcgtypeconvnode.second_ansistring_to_pchar to use the high level
code generator and work in all i8086 memory models. Removed the i8086-specific overriden version. git-svn-id: trunk@27278 -
This commit is contained in:
parent
897802c7c4
commit
a9f56d2714
@ -33,7 +33,6 @@ interface
|
||||
protected
|
||||
procedure second_proc_to_procvar;override;
|
||||
procedure second_nil_to_methodprocvar;override;
|
||||
procedure second_ansistring_to_pchar;override;
|
||||
end;
|
||||
|
||||
|
||||
@ -162,30 +161,6 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure t8086typeconvnode.second_ansistring_to_pchar;
|
||||
var
|
||||
l1 : tasmlabel;
|
||||
hr : treference;
|
||||
begin
|
||||
if current_settings.x86memorymodel in x86_far_data_models then
|
||||
begin
|
||||
location_reset(location,LOC_REGISTER,OS_32);
|
||||
current_asmdata.getjumplabel(l1);
|
||||
location.register:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
|
||||
cg.a_load_loc_reg(current_asmdata.CurrAsmList,OS_32,
|
||||
left.location,location.register);
|
||||
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,OS_32,OC_NE,0,location.register,l1);
|
||||
{ FPC_EMPTYCHAR is a widechar -> 2 bytes }
|
||||
reference_reset(hr,2);
|
||||
hr.symbol:=current_asmdata.RefAsmSymbol('FPC_EMPTYCHAR');
|
||||
cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,hr,location.register);
|
||||
cg.a_label(current_asmdata.CurrAsmList,l1);
|
||||
end
|
||||
else
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
ctypeconvnode:=t8086typeconvnode
|
||||
end.
|
||||
|
@ -658,17 +658,17 @@ interface
|
||||
l1 : tasmlabel;
|
||||
hr : treference;
|
||||
begin
|
||||
location_reset(location,LOC_REGISTER,OS_ADDR);
|
||||
location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
|
||||
current_asmdata.getjumplabel(l1);
|
||||
location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
|
||||
cg.a_load_loc_reg(current_asmdata.CurrAsmList,OS_ADDR,
|
||||
location.register:=hlcg.getaddressregister(current_asmdata.CurrAsmList,resultdef);
|
||||
hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,left.resultdef,resultdef,
|
||||
left.location,location.register);
|
||||
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,OS_ADDR,OC_NE,0,location.register,l1);
|
||||
hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,resultdef,OC_NE,0,location.register,l1);
|
||||
{ FPC_EMPTYCHAR is a widechar -> 2 bytes }
|
||||
reference_reset(hr,2);
|
||||
hr.symbol:=current_asmdata.RefAsmSymbol('FPC_EMPTYCHAR');
|
||||
cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,hr,location.register);
|
||||
cg.a_label(current_asmdata.CurrAsmList,l1);
|
||||
hlcg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,left.resultdef,resultdef,hr,location.register);
|
||||
hlcg.a_label(current_asmdata.CurrAsmList,l1);
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user