diff --git a/compiler/cgbase.pas b/compiler/cgbase.pas index dcaf96c12e..9ec3c5ee57 100644 --- a/compiler/cgbase.pas +++ b/compiler/cgbase.pas @@ -99,6 +99,7 @@ interface {$ENDIF} {$IFDEF i8086} ,addr_dgroup // the data segment group + ,addr_far // used for emitting 'call far' or 'jmp far' instructions {$ENDIF} ); diff --git a/compiler/x86/agx86nsm.pas b/compiler/x86/agx86nsm.pas index f5feff4016..8034e9a1a7 100644 --- a/compiler/x86/agx86nsm.pas +++ b/compiler/x86/agx86nsm.pas @@ -382,7 +382,10 @@ interface asmwrite('dword '); {$endif i386} {$ifdef i8086} - asmwrite('word '); + if o.ref^.refaddr=addr_far then + asmwrite('far ') + else + asmwrite('word '); {$endif i8086} if assigned(o.ref^.symbol) then begin