+ check whether the address sizes match for x86 string instructions with two

memory operands, when using the at&t syntax inline assembler

git-svn-id: trunk@37473 -
This commit is contained in:
nickysn 2017-10-16 16:01:38 +00:00
parent aacd13d347
commit cece021bd1
4 changed files with 291 additions and 280 deletions

View File

@ -2483,7 +2483,7 @@ cg_f_max_units_reached=06057_F_Maximum number of units ($1) reached for the curr
#
# Assembler reader
#
# 07133 is the last used one
# 07134 is the last used one
#
asmr_d_start_reading=07000_DL_Starting $1 styled assembler parsing
% This informs you that an assembler block is being parsed
@ -2809,6 +2809,9 @@ asmr_e_cannot_override_es_segment=07132_E_Cannot override ES segment
asmr_w_invalid_reference=07133_W_Reference is not valid here (expected "$1")
% Certain x86 instructions require a fixed source or destination reference
% (e.g. [ESI] or [EDI] for the string instructions source and destination)
asmr_e_address_sizes_do_not_match=07134_E_Address sizes do not match
% Caused by using two memory operands in the same instruction with mismatched
% address sizes (e.g. movs byte ptr [EDI], byte ptr [SI] )
#
# Assembler/binary writers
#

View File

@ -815,6 +815,7 @@ const
asmr_w_unable_to_determine_constant_size_using_word=07131;
asmr_e_cannot_override_es_segment=07132;
asmr_w_invalid_reference=07133;
asmr_e_address_sizes_do_not_match=07134;
asmw_f_too_many_asm_files=08000;
asmw_f_assembler_output_not_supported=08001;
asmw_f_comp_not_supported=08002;
@ -1085,9 +1086,9 @@ const
option_info=11024;
option_help_pages=11025;
MsgTxtSize = 80616;
MsgTxtSize = 80651;
MsgIdxMax : array[1..20] of longint=(
27,105,347,124,96,58,134,33,221,67,
27,105,347,124,96,58,135,33,221,67,
60,20,30,1,1,1,1,1,1,1
);

File diff suppressed because it is too large Load Diff

View File

@ -964,6 +964,16 @@ Implementation
{$endif}
end;
end;
{ if two memory parameters, check whether their address sizes are equal }
if (si_param<>-1) and (di_param<>-1) and
(si_param<=operandnum) and (di_param<=operandnum) and
(instr.operands[si_param].opr.typ=OPR_REFERENCE) and
(instr.operands[di_param].opr.typ=OPR_REFERENCE) then
begin
if get_ref_address_size(instr.operands[si_param].opr.ref)<>
get_ref_address_size(instr.operands[di_param].opr.ref) then
Message(asmr_e_address_sizes_do_not_match);
end;
end;
end;