* correctly handle push <imm> on 80186+

git-svn-id: trunk@35455 -
This commit is contained in:
florian 2017-02-19 19:15:16 +00:00
parent 7213a13081
commit c4fe4ab1f5
4 changed files with 326 additions and 297 deletions

View File

@ -2786,6 +2786,14 @@ asmr_e_const16bit_for_segment=07128_E_Not enough space (16 bits required) for th
% less, for example, if you use 'DB SEG symbol' instead of 'DW SEG symbol'.
asmr_e_invalid_code_value=07129_E_Invalid value of .code directive constant
% The ARM assembler only allows the values 16 and 32 to be used as arguments to the .code directive
asmr_w_unable_to_determine_constant_size_using_byte=07130_W_No size specified and unable to determine the size of the constant, using BYTE as default
% You should specify explicitly a size for the reference, because
% the compiler is unable to determine what size (byte, word, dword, etc.) it
% should use for the constant. Based on its value, BYTE is used.
asmr_w_unable_to_determine_constant_size_using_word=07131_W_No size specified and unable to determine the size of the constant, using WORD as default
% You should specify explicitly a size for the reference, because
% the compiler is unable to determine what size (byte, word, dword, etc.) it
% should use for the constant. Based on its value, WORD is used.
#
# Assembler/binary writers
#

View File

@ -808,6 +808,8 @@ const
asmr_e_CODE_or_DATA_without_SEG=07127;
asmr_e_const16bit_for_segment=07128;
asmr_e_invalid_code_value=07129;
asmr_w_unable_to_determine_constant_size_using_byte=07130;
asmr_w_unable_to_determine_constant_size_using_word=07131;
asmw_f_too_many_asm_files=08000;
asmw_f_assembler_output_not_supported=08001;
asmw_f_comp_not_supported=08002;
@ -1066,9 +1068,9 @@ const
option_info=11024;
option_help_pages=11025;
MsgTxtSize = 79107;
MsgTxtSize = 79303;
MsgIdxMax : array[1..20] of longint=(
27,102,347,124,96,58,130,33,209,67,
27,102,347,124,96,58,132,33,209,67,
60,20,30,1,1,1,1,1,1,1
);

File diff suppressed because it is too large Load Diff

View File

@ -1104,10 +1104,24 @@ begin
siz:=S_W;
if (ops=1) and (opcode=A_PUSH) then
begin
{We are a 32 compiler, assume 32-bit by default. This is Delphi
compatible but bad coding practise.}
{$ifdef i8086}
if (tx86operand(operands[1]).opr.val>=-128) and (tx86operand(operands[1]).opr.val<=127) then
begin
siz:=S_B;
message(asmr_w_unable_to_determine_constant_size_using_byte);
end
else
begin
siz:=S_W;
message(asmr_w_unable_to_determine_constant_size_using_word);
end;
{$else i8086}
{ We are a 32 compiler, assume 32-bit by default. This is Delphi
compatible but bad coding practise.}
siz:=S_L;
message(asmr_w_unable_to_determine_reference_size_using_dword);
{$endif i8086}
end;
if (opcode=A_JMP) or (opcode=A_JCC) or (opcode=A_CALL) then
if ops=1 then