src/hermes/mmx_main.asm
changeset 0 74212992fb08
child 1166 da33b7e6d181
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/hermes/mmx_main.asm	Thu Apr 26 16:45:43 2001 +0000
     1.3 @@ -0,0 +1,74 @@
     1.4 +;
     1.5 +; mmx format converter main loops for HERMES
     1.6 +; Some routines Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk)
     1.7 +; This source code is licensed under the GNU LGPL
     1.8 +; 
     1.9 +; Please refer to the file COPYING.LIB contained in the distribution for
    1.10 +; licensing conditions		
    1.11 +;
    1.12 +
    1.13 +BITS 32
    1.14 +
    1.15 +GLOBAL _ConvertMMX
    1.16 +GLOBAL _mmxreturn
    1.17 +
    1.18 +
    1.19 +SECTION .text
    1.20 +		
    1.21 +;; _ConvertMMX:	 
    1.22 +;; [ESP+8] ConverterInfo*
    1.23 +;; --------------------------------------------------------------------------
    1.24 +;; ConverterInfo (ebp+..)
    1.25 +;;   0:	void *s_pixels
    1.26 +;;   4:	int s_width
    1.27 +;;   8:	int s_height
    1.28 +;;  12:	int s_add
    1.29 +;;  16:	void *d_pixels
    1.30 +;;  20:	int d_width
    1.31 +;;  24:	int d_height
    1.32 +;;  28:	int d_add
    1.33 +;;  32:	void (*converter_function)() 
    1.34 +;;  36: int32 *lookup
    1.35 +	
    1.36 +_ConvertMMX:
    1.37 +	push ebp
    1.38 +	mov ebp,esp
    1.39 +
    1.40 +; Save the registers used by the blitters, necessary for optimized code
    1.41 +	pusha
    1.42 +
    1.43 +	mov eax,[ebp+8]
    1.44 +
    1.45 +        cmp dword [eax+4],BYTE 0
    1.46 +	je endconvert
    1.47 +	
    1.48 +	mov ebp,eax
    1.49 +	
    1.50 +	mov esi,[ebp+0]
    1.51 +	mov edi,[ebp+16]
    1.52 +	
    1.53 +y_loop:	
    1.54 +	mov ecx,[ebp+4]
    1.55 +
    1.56 +	jmp [ebp+32]
    1.57 +
    1.58 +_mmxreturn:	
    1.59 +	add esi,[ebp+12]
    1.60 +	add edi,[ebp+28]
    1.61 +	
    1.62 +	dec dword  [ebp+8]
    1.63 +	jnz y_loop
    1.64 +
    1.65 +	
    1.66 +; Restore the registers used by the blitters, necessary for optimized code
    1.67 +	popa
    1.68 +
    1.69 +	pop ebp
    1.70 +
    1.71 +endconvert:
    1.72 +	emms
    1.73 +	
    1.74 +	ret		
    1.75 +
    1.76 +
    1.77 +