From 85c8be531a09376ce0ae9fd95ea43b0c4ffe0f56 Mon Sep 17 00:00:00 2001 From: nickysn Date: Sat, 26 Oct 2013 16:52:57 +0000 Subject: [PATCH] + added an asm implementation of FillWord for i8086 as well git-svn-id: trunk@25854 - --- rtl/i8086/i8086.inc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/rtl/i8086/i8086.inc b/rtl/i8086/i8086.inc index e4b26d9249..b1d983269b 100644 --- a/rtl/i8086/i8086.inc +++ b/rtl/i8086/i8086.inc @@ -46,6 +46,32 @@ asm end; {$endif FPC_SYSTEM_HAS_FILLCHAR} + +{$ifndef FPC_SYSTEM_HAS_FILLWORD} +{$define FPC_SYSTEM_HAS_FILLWORD} +procedure FillWord(var x;count : SizeInt;value : word);assembler;nostackframe; +asm + mov bx, sp + mov cx, ss:[bx + 4 + extra_param_offset] // count + or cx, cx + jle @@Done +{$ifdef FPC_X86_DATA_NEAR} + mov di, ss:[bx + 6 + extra_param_offset] // @x + mov ax, ds + mov es, ax +{$else FPC_X86_DATA_NEAR} + les di, ss:[bx + 6 + extra_param_offset] // @x +{$endif FPC_X86_DATA_NEAR} + mov ax, ss:[bx + 2 + extra_param_offset] // value +{$ifdef FPC_ENABLED_CLD} + cld +{$endif FPC_ENABLED_CLD} + rep stosw + @@Done: +end; +{$endif FPC_SYSTEM_HAS_FILLWORD} + + {$define FPC_SYSTEM_HAS_SPTR} Function Sptr : Pointer;assembler;nostackframe; asm