mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-30 19:26:05 +00:00
[WIN32K]
Convert asm files into new syntax svn path=/branches/cmake-bringup/; revision=49640
This commit is contained in:
@@ -6,13 +6,12 @@
|
||||
* PROGRAMMERS: Magnus Olsen
|
||||
*/
|
||||
|
||||
.globl _DIB_24BPP_HLine
|
||||
.intel_syntax noprefix
|
||||
#include <asm.inc>
|
||||
|
||||
.code
|
||||
|
||||
PUBLIC _DIB_24BPP_HLine
|
||||
|
||||
.def _DIB_24BPP_HLine;
|
||||
.scl 2;
|
||||
.type 32;
|
||||
.endef
|
||||
_DIB_24BPP_HLine:
|
||||
push edi
|
||||
push esi
|
||||
@@ -151,3 +150,5 @@
|
||||
pop esi
|
||||
pop edi
|
||||
ret
|
||||
|
||||
END
|
||||
|
||||
@@ -7,15 +7,16 @@
|
||||
* Timo Kreuzer (timo.kreuzer@reactos.org)
|
||||
*/
|
||||
|
||||
.intel_syntax noprefix
|
||||
#include <asm.inc>
|
||||
|
||||
.code
|
||||
/*
|
||||
* BOOLEAN
|
||||
* _cdecl
|
||||
* DIB_32BPP_ColorFill(SURFOBJ* pso, RECTL* prcl, ULONG iColor);
|
||||
*/
|
||||
|
||||
.globl _DIB_32BPP_ColorFill
|
||||
PUBLIC _DIB_32BPP_ColorFill
|
||||
_DIB_32BPP_ColorFill:
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
@@ -27,22 +28,22 @@ _DIB_32BPP_ColorFill:
|
||||
mov edx, [ebp+12] /* edx = prcl */
|
||||
mov ecx, [ebp+8] /* ecx = pso */
|
||||
|
||||
mov ebx, [ecx+0x24] /* ebx = pso->lDelta; */
|
||||
mov ebx, [ecx+36] /* ebx = pso->lDelta; */
|
||||
mov [esp], ebx /* lDelta = pso->lDelta; */
|
||||
mov edi, [edx+4] /* edi = prcl->top; */
|
||||
mov eax, edi /* eax = prcl->top; */
|
||||
imul eax, ebx /* eax = prcl->top * pso->lDelta; */
|
||||
add eax, [ecx+0x20] /* eax += pso->pvScan0; */
|
||||
add eax, [ecx+32] /* eax += pso->pvScan0; */
|
||||
mov ebx, [edx] /* ebx = prcl->left; */
|
||||
lea esi, [eax+ebx*4] /* esi = pvLine0 = eax + 4 * prcl->left; */
|
||||
|
||||
mov ebx, [edx+8] /* ebx = prcl->right; */
|
||||
sub ebx, [edx] /* ebx = prcl->right - prcl->left; */
|
||||
jbe end /* if (ebx <= 0) goto end; */
|
||||
jbe .end /* if (ebx <= 0) goto end; */
|
||||
|
||||
mov edx, [edx+12] /* edx = prcl->bottom; */
|
||||
sub edx, edi /* edx -= prcl->top; */
|
||||
jbe end /* if (eax <= 0) goto end; */
|
||||
jbe .end /* if (eax <= 0) goto end; */
|
||||
|
||||
mov eax, [ebp+16] /* eax = iColor; */
|
||||
cld
|
||||
@@ -55,7 +56,7 @@ for_loop: /* do { */
|
||||
dec edx /* cy--; */
|
||||
jnz for_loop /* } while (cy > 0); */
|
||||
|
||||
end:
|
||||
.end:
|
||||
mov eax, 1
|
||||
add esp, 4
|
||||
pop edi
|
||||
@@ -63,3 +64,5 @@ end:
|
||||
pop ebx
|
||||
pop ebp
|
||||
ret
|
||||
|
||||
END
|
||||
|
||||
@@ -6,13 +6,11 @@
|
||||
* PROGRAMMERS: Magnus Olsen
|
||||
*/
|
||||
|
||||
.globl _DIB_32BPP_HLine
|
||||
.intel_syntax noprefix
|
||||
#include <asm.inc>
|
||||
|
||||
.def _DIB_32BPP_HLine;
|
||||
.scl 2;
|
||||
.type 32;
|
||||
.endef
|
||||
.code
|
||||
|
||||
PUBLIC _DIB_32BPP_HLine
|
||||
|
||||
_DIB_32BPP_HLine:
|
||||
sub esp, 12 // rember the base is not hex it is dec
|
||||
@@ -55,3 +53,4 @@ _save_rest:
|
||||
add esp, 12
|
||||
ret
|
||||
|
||||
END
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
* PROGRAMMER: Timo Kreuzer
|
||||
*/
|
||||
|
||||
#include <asm.inc>
|
||||
|
||||
.code
|
||||
|
||||
/*******************************************************************************
|
||||
* IEEE 754-1985 single precision floating point
|
||||
@@ -72,9 +75,6 @@
|
||||
* FLOATOBJ_SubLong - wrapper
|
||||
*/
|
||||
|
||||
.intel_syntax noprefix
|
||||
.text
|
||||
|
||||
#define lMant 0
|
||||
#define lExp 4
|
||||
|
||||
@@ -87,24 +87,24 @@
|
||||
* FLOATOBJ_SetFloat(IN OUT PFLOATOBJ pf, IN FLOATL f);
|
||||
*/
|
||||
_FLOATOBJ_SetFloat@8:
|
||||
.global _FLOATOBJ_SetFloat@8
|
||||
PUBLIC _FLOATOBJ_SetFloat@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
mov ecx, [esp + PARAM2] /* Load the float into ecx */
|
||||
mov eax, ecx /* Copy float to eax for later */
|
||||
|
||||
test ecx, 0x7f800000 /* Check for zero exponent - 0 or denormal */
|
||||
test ecx, HEX(7f800000) /* Check for zero exponent - 0 or denormal */
|
||||
jz SetFloat0 /* If it's all zero, ... */
|
||||
|
||||
shl ecx, 7 /* Put the bits for the mantissa in place */
|
||||
|
||||
cdq /* Fill edx with the sign from the FLOATL in eax */
|
||||
and ecx, 0x7fffffff /* Mask out invalid field in the mantissa */
|
||||
and ecx, HEX(7fffffff) /* Mask out invalid field in the mantissa */
|
||||
|
||||
shr eax, 23 /* Shift the exponent in eax in place */
|
||||
or ecx, 0x40000000 /* Set bit for 1 in the mantissa */
|
||||
and eax, 0xff /* Mask out invalid fields in the exponent in eax */
|
||||
or ecx, HEX(40000000) /* Set bit for 1 in the mantissa */
|
||||
and eax, HEX(0ff) /* Mask out invalid fields in the exponent in eax */
|
||||
|
||||
xor ecx, edx /* Make use of the sign bit expanded to full edx */
|
||||
|
||||
@@ -136,7 +136,7 @@ SetFloat0:
|
||||
*
|
||||
*/
|
||||
_FLOATOBJ_GetFloat@4:
|
||||
.global _FLOATOBJ_GetFloat@4
|
||||
PUBLIC _FLOATOBJ_GetFloat@4
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -152,13 +152,13 @@ _FLOATOBJ_GetFloat@4:
|
||||
sub eax, edx
|
||||
jz GetFloatRet
|
||||
|
||||
and ecx, 0xff /* Mask out invalid fields in the exponent */
|
||||
and eax, 0x3fffffff /* Mask out invalid fields in mantissa */
|
||||
and ecx, HEX(0ff) /* Mask out invalid fields in the exponent */
|
||||
and eax, HEX(3fffffff) /* Mask out invalid fields in mantissa */
|
||||
|
||||
shl ecx, 23 /* Shift exponent in place */
|
||||
shr eax, 7 /* Shift mantissa in place */
|
||||
|
||||
and edx, 0x80000000 /* Reduce edx to sign bit only */
|
||||
and edx, HEX(80000000) /* Reduce edx to sign bit only */
|
||||
|
||||
or eax, ecx /* Set exponent in result */
|
||||
or eax, edx /* Set sign bit in result */
|
||||
@@ -178,7 +178,7 @@ GetFloatRet:
|
||||
* Instead of using abs(l), which is 3 + 2 instructions, use a branch.
|
||||
*/
|
||||
_FLOATOBJ_SetLong@8:
|
||||
.global _FLOATOBJ_SetLong@8
|
||||
PUBLIC _FLOATOBJ_SetLong@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -236,7 +236,7 @@ SetLong0:
|
||||
*
|
||||
*/
|
||||
_FLOATOBJ_GetLong@4:
|
||||
.global _FLOATOBJ_GetLong@4
|
||||
PUBLIC _FLOATOBJ_GetLong@4
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -263,7 +263,7 @@ GetLong2:
|
||||
* FLOATOBJ_Equal(IN PFLOATOBJ pf1, IN PFLOATOBJ pf2);
|
||||
*/
|
||||
_FLOATOBJ_Equal@8:
|
||||
.global _FLOATOBJ_Equal@8
|
||||
PUBLIC _FLOATOBJ_Equal@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -291,7 +291,7 @@ _FLOATOBJ_Equal@8:
|
||||
* FLOATOBJ_EqualLong(IN PFLOATOBJ pf, IN LONG l);
|
||||
*/
|
||||
_FLOATOBJ_EqualLong@8:
|
||||
.global _FLOATOBJ_EqualLong@8
|
||||
PUBLIC _FLOATOBJ_EqualLong@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -325,7 +325,7 @@ EqualLongFalse:
|
||||
*
|
||||
*/
|
||||
_FLOATOBJ_GreaterThan@8:
|
||||
.global _FLOATOBJ_GreaterThan@8
|
||||
PUBLIC _FLOATOBJ_GreaterThan@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -415,7 +415,7 @@ GreaterThan_neg2:
|
||||
* LOATOBJ_GreaterThan
|
||||
*/
|
||||
_FLOATOBJ_GreaterThanLong@8:
|
||||
.global _FLOATOBJ_GreaterThanLong@8
|
||||
PUBLIC _FLOATOBJ_GreaterThanLong@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -445,7 +445,7 @@ _FLOATOBJ_GreaterThanLong@8:
|
||||
*
|
||||
*/
|
||||
_FLOATOBJ_LessThan@8:
|
||||
.global _FLOATOBJ_LessThan@8
|
||||
PUBLIC _FLOATOBJ_LessThan@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -536,7 +536,7 @@ LessThan_neg2:
|
||||
* Currently implemented as a wrapper around FLOATOBJ_SetLong and FLOATOBJ_LessThan
|
||||
*/
|
||||
_FLOATOBJ_LessThanLong@8:
|
||||
.global _FLOATOBJ_LessThanLong@8
|
||||
PUBLIC _FLOATOBJ_LessThanLong@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -569,7 +569,7 @@ _FLOATOBJ_LessThanLong@8:
|
||||
* No special handling for 0, where mantissa is 0
|
||||
*/
|
||||
_FLOATOBJ_Mul@8:
|
||||
.global _FLOATOBJ_Mul@8
|
||||
PUBLIC _FLOATOBJ_Mul@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -620,7 +620,7 @@ MulNeg:
|
||||
|
||||
|
||||
lea edx, [edx + ecx -2] /* Normalize exponent in edx */
|
||||
or eax, 0x80000000 /* Set sign bit */
|
||||
or eax, HEX(80000000) /* Set sign bit */
|
||||
|
||||
mov ecx, [esp + PARAM1] /* Load pf1 into ecx */
|
||||
mov [ecx + lMant], eax /* Save back mantissa */
|
||||
@@ -646,7 +646,7 @@ Mul0:
|
||||
* Currently implemented as a wrapper around FLOATOBJ_SetFloat and FLOATOBJ_Mul
|
||||
*/
|
||||
_FLOATOBJ_MulFloat@8:
|
||||
.global _FLOATOBJ_MulFloat@8
|
||||
PUBLIC _FLOATOBJ_MulFloat@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -675,7 +675,7 @@ _FLOATOBJ_MulFloat@8:
|
||||
* Currently implemented as a wrapper around FLOATOBJ_SetLong and FLOATOBJ_Mul
|
||||
*/
|
||||
_FLOATOBJ_MulLong@8:
|
||||
.global _FLOATOBJ_MulLong@8
|
||||
PUBLIC _FLOATOBJ_MulLong@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -703,7 +703,7 @@ _FLOATOBJ_MulLong@8:
|
||||
*
|
||||
*/
|
||||
_FLOATOBJ_Div@8:
|
||||
.global _FLOATOBJ_Div@8
|
||||
PUBLIC _FLOATOBJ_Div@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
push ebx
|
||||
@@ -736,7 +736,7 @@ _FLOATOBJ_Div@8:
|
||||
div ecx /* Do an unsigned divide */
|
||||
|
||||
xor ecx, ecx /* Adjust result */
|
||||
test eax, 0x80000000
|
||||
test eax, HEX(80000000)
|
||||
setnz cl
|
||||
shr eax, cl
|
||||
|
||||
@@ -773,7 +773,7 @@ Div0:
|
||||
* Currently implemented as a wrapper around FLOATOBJ_SetFloat and FLOATOBJ_Div
|
||||
*/
|
||||
_FLOATOBJ_DivFloat@8:
|
||||
.global _FLOATOBJ_DivFloat@8
|
||||
PUBLIC _FLOATOBJ_DivFloat@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
sub esp, 8 /* Make room for a FLOATOBJ on the stack */
|
||||
@@ -802,7 +802,7 @@ _FLOATOBJ_DivFloat@8:
|
||||
* Currently implemented as a wrapper around FLOATOBJ_SetLong and FLOATOBJ_Div
|
||||
*/
|
||||
_FLOATOBJ_DivLong@8:
|
||||
.global _FLOATOBJ_DivLong@8
|
||||
PUBLIC _FLOATOBJ_DivLong@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
sub esp, 8 /* Make room for a FLOATOBJ on the stack */
|
||||
@@ -829,7 +829,7 @@ _FLOATOBJ_DivLong@8:
|
||||
*
|
||||
*/
|
||||
_FLOATOBJ_Add@8:
|
||||
.global _FLOATOBJ_Add@8
|
||||
PUBLIC _FLOATOBJ_Add@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
push ebx
|
||||
@@ -928,7 +928,7 @@ AddIs0:
|
||||
* Currently implemented as a wrapper around FLOATOBJ_SetFloat and FLOATOBJ_Add
|
||||
*/
|
||||
_FLOATOBJ_AddFloat@8:
|
||||
.global _FLOATOBJ_AddFloat@8
|
||||
PUBLIC _FLOATOBJ_AddFloat@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
sub esp, 8 /* Make room for a FLOATOBJ on the stack */
|
||||
@@ -957,7 +957,7 @@ _FLOATOBJ_AddFloat@8:
|
||||
* Currently implemented as a wrapper around FLOATOBJ_SetLong and FLOATOBJ_Add
|
||||
*/
|
||||
_FLOATOBJ_AddLong@8:
|
||||
.global _FLOATOBJ_AddLong@8
|
||||
PUBLIC _FLOATOBJ_AddLong@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
sub esp, 8 /* Make room for a FLOATOBJ on the stack */
|
||||
@@ -985,7 +985,7 @@ _FLOATOBJ_AddLong@8:
|
||||
*
|
||||
*/
|
||||
_FLOATOBJ_Sub@8:
|
||||
.global _FLOATOBJ_Sub@8
|
||||
PUBLIC _FLOATOBJ_Sub@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
push ebx
|
||||
@@ -1083,7 +1083,7 @@ SubIs0:
|
||||
* Currently implemented as a wrapper around FLOATOBJ_SetFloat and FLOATOBJ_Sub
|
||||
*/
|
||||
_FLOATOBJ_SubFloat@8:
|
||||
.global _FLOATOBJ_SubFloat@8
|
||||
PUBLIC _FLOATOBJ_SubFloat@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
sub esp, 8 /* Make room for a FLOATOBJ on the stack */
|
||||
@@ -1112,7 +1112,7 @@ _FLOATOBJ_SubFloat@8:
|
||||
* Currently implemented as a wrapper around FLOATOBJ_SetLong and FLOATOBJ_Sub
|
||||
*/
|
||||
_FLOATOBJ_SubLong@8:
|
||||
.global _FLOATOBJ_SubLong@8
|
||||
PUBLIC _FLOATOBJ_SubLong@8
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
sub esp, 8 /* Make room for a FLOATOBJ on the stack */
|
||||
@@ -1140,7 +1140,7 @@ _FLOATOBJ_SubLong@8:
|
||||
*
|
||||
*/
|
||||
_FLOATOBJ_Neg@4:
|
||||
.global _FLOATOBJ_Neg@4
|
||||
PUBLIC _FLOATOBJ_Neg@4
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
@@ -1150,5 +1150,5 @@ _FLOATOBJ_Neg@4:
|
||||
pop ebp /* Return */
|
||||
ret 4
|
||||
|
||||
|
||||
END
|
||||
/* EOF */
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
.globl _atan2
|
||||
|
||||
.intel_syntax noprefix
|
||||
|
||||
#include <asm.inc>
|
||||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
.code
|
||||
|
||||
PUBLIC _atan2
|
||||
_atan2:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
@@ -49,3 +49,5 @@ _atan2:
|
||||
mov esp,ebp
|
||||
pop ebp
|
||||
ret
|
||||
|
||||
END
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
.globl _ceil
|
||||
|
||||
.intel_syntax noprefix
|
||||
#include <asm.inc>
|
||||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
.code
|
||||
|
||||
PUBLIC _ceil
|
||||
_ceil:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
@@ -47,7 +47,7 @@ _ceil:
|
||||
fld qword ptr [ebp+8] // Load real from stack
|
||||
fstcw [ebp-2] // Save control word
|
||||
fclex // Clear exceptions
|
||||
mov word ptr [ebp-4],0xb63 // Rounding control word
|
||||
mov word ptr [ebp-4],HEX(b63) // Rounding control word
|
||||
fldcw [ebp-4] // Set new rounding control
|
||||
frndint // Round to integer
|
||||
fclex // Clear exceptions
|
||||
@@ -55,3 +55,5 @@ _ceil:
|
||||
mov esp,ebp // Deallocate temporary space
|
||||
pop ebp
|
||||
ret
|
||||
|
||||
END
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
.globl _cos
|
||||
|
||||
.intel_syntax noprefix
|
||||
#include <asm.inc>
|
||||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
.code
|
||||
|
||||
PUBLIC _cos
|
||||
_cos:
|
||||
push ebp
|
||||
mov ebp,esp // Point to the stack frame
|
||||
@@ -47,3 +47,5 @@ _cos:
|
||||
fcos // Take the cosine
|
||||
pop ebp
|
||||
ret
|
||||
|
||||
END
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
.globl _floor
|
||||
|
||||
.intel_syntax noprefix
|
||||
|
||||
#include <asm.inc>
|
||||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
.code
|
||||
|
||||
PUBLIC _floor
|
||||
_floor:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
@@ -47,7 +47,7 @@ _floor:
|
||||
fld qword ptr [ebp+8] // Load real from stack
|
||||
fstcw [ebp-2] // Save control word
|
||||
fclex // Clear exceptions
|
||||
mov word ptr [ebp-4],0x763 // Rounding control word
|
||||
mov word ptr [ebp-4],HEX(763) // Rounding control word
|
||||
fldcw [ebp-4] // Set new rounding control
|
||||
frndint // Round to integer
|
||||
fclex // Clear exceptions
|
||||
@@ -55,3 +55,5 @@ _floor:
|
||||
mov esp,ebp
|
||||
pop ebp
|
||||
ret
|
||||
|
||||
END
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
.globl _sin
|
||||
|
||||
.intel_syntax noprefix
|
||||
#include <asm.inc>
|
||||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
.code
|
||||
|
||||
PUBLIC _sin
|
||||
_sin:
|
||||
push ebp // Save register bp
|
||||
mov ebp,esp // Point to the stack frame
|
||||
@@ -47,3 +47,5 @@ _sin:
|
||||
fsin // Take the sine
|
||||
pop ebp // Restore register bp
|
||||
ret
|
||||
|
||||
END
|
||||
|
||||
Reference in New Issue
Block a user