1/* 2 * PROJECT: Win32 subsystem 3 * LICENSE: See COPYING in the top level directory 4 * FILE: win32ss/gdi/dib/i386/dib32bpp_hline.s 5 * PURPOSE: ASM optimised 32bpp HLine 6 * PROGRAMMERS: Magnus Olsen 7 */ 8 9#include <asm.inc> 10 11.code 12 13PUBLIC _DIB_32BPP_HLine 14 15_DIB_32BPP_HLine: 16 sub esp, 12 // rember the base is not hex it is dec 17 mov ecx, [esp+16] 18 mov [esp+4], ebx 19 mov edx, [esp+20] // edx = LONG x1 20 mov [esp+8], edi 21 mov edi, [esp+28] 22 mov eax, [ecx+36] 23 mov ebx, [esp+24] // ebx = LONG x2 24 imul eax, edi 25 mov edi, [ecx+32] 26 sub ebx, edx // cx = (x2 - x1) ; 27 add eax, edi 28 lea edx, [eax+edx*4] 29 mov [esp], edx 30 cld 31 mov eax, [esp+32] 32 mov edi, [esp] 33 test edi, 3 // Align to fullword boundary 34 jnz short _save_rest 35 mov ecx, ebx // Setup count of fullwords to fill 36 rep stosd 37 38 mov ebx, [esp+4] 39 mov edi, [esp+8] 40 add esp, 12 41 ret 42_save_rest: 43 stosw 44 ror eax, 16 45 mov ecx, ebx // Setup count of fullwords to fill 46 dec ecx 47 rep stosd // The actual fill 48 shr eax, 16 49 stosw 50 51 mov ebx, [esp+4] 52 mov edi, [esp+8] 53 add esp, 12 54 ret 55 56END 57