From 5d4ebf0dca6748b86cf3fbec2b10d7fbc1af2d19 Mon Sep 17 00:00:00 2001 From: nickysn Date: Tue, 11 Jun 2013 21:08:43 +0000 Subject: [PATCH] + added extra_param_offset constant for accessing parameters in asm routines with nostackframe git-svn-id: trunk@24873 - --- rtl/msdos/system.pp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rtl/msdos/system.pp b/rtl/msdos/system.pp index fcb8b7fe37..853ef7cf00 100644 --- a/rtl/msdos/system.pp +++ b/rtl/msdos/system.pp @@ -83,6 +83,15 @@ implementation const fCarry = 1; + { used for an offset fixup for accessing the proc parameters in asm routines + that use nostackframe. We can't use the parameter name directly, because + i8086 doesn't support sp relative addressing. } +{$ifdef FPC_X86_CODE_FAR} + extra_param_offset = 2; +{$else FPC_X86_CODE_FAR} + extra_param_offset = 0; +{$endif FPC_X86_CODE_FAR} + type PFarByte = ^Byte;far; PFarChar = ^Char;far;