diff --git a/compiler/avr/aasmcpu.pas b/compiler/avr/aasmcpu.pas index c7f3900cdc..8d0861df55 100644 --- a/compiler/avr/aasmcpu.pas +++ b/compiler/avr/aasmcpu.pas @@ -482,7 +482,7 @@ implementation (taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset<-64*2)) then begin if inasmblock then - MessagePos(taicpu(curtai).fileinfo,asmw_e_brxx_out_of_range) + MessagePos1(taicpu(curtai).fileinfo,asmw_e_destination_out_of_range,'BR'+uppercond2str[taicpu(curtai).condition]) else begin current_asmdata.getjumplabel(l); @@ -497,6 +497,14 @@ implementation again:=true; end; end; + A_RJMP: + if inasmblock and (taicpu(curtai).oper[0]^.typ=top_ref) and + not(taicpu(curtai).oper[0]^.ref^.symbol.typ=AT_FUNCTION) and + ((taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset>2047*2) or + (taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset<-2048*2)) then + begin + MessagePos1(taicpu(curtai).fileinfo,asmw_e_destination_out_of_range,'RJMP'); + end; A_JMP: { replace JMP by RJMP? ... ... but do not mess with asm block. diff --git a/compiler/msg/errore.msg b/compiler/msg/errore.msg index fe26ef30e5..15e596b52d 100644 --- a/compiler/msg/errore.msg +++ b/compiler/msg/errore.msg @@ -3079,7 +3079,7 @@ asmw_e_32bit_not_supported=08029_E_Asm: 32 bit references not supported asmw_f_code_segment_too_large=08030_F_Code segment too large asmw_f_data_segment_too_large=08031_F_Data segment too large asmw_e_instruction_not_supported_by_cpu=08032_E_Instruction not supported by the selected instruction set -asmw_e_brxx_out_of_range=08033_E_Asm: conditional branch destination is out of range +asmw_e_destination_out_of_range=08033_E_Asm: $1 destination is out of range asmw_e_illegal_use_of_rip=08034_E_Asm: RIP cannot be used as index register or with another register in a reference asmw_e_seh_invalid_data_size=08035_F_Illegal function size for SEH function asmw_e_illegal_use_of_sp=08036_E_Asm: ESP/RSP cannot be used as index register