📄 microsoftinternal.c
字号:
/*
* Copyright (c) 2003. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// These functions are only there to allow linking with Microsoft Visual C tools 6.0.
//
// The functions are generated by Microsoft Compiler, for special purposes, like
// 64 bits multiplication.
// Usually, these function are defined in the msvcrt.lib.
// But, for symbian program, it is impossible to link with this library, it is
// confliting with symbian File I/O.
// The functions are just assembly dump of some of the functions contained in msvcrt.lib
#include <e32def.h>
#ifdef __VC32__
#define __NAKED__ __declspec( naked )
#ifdef OGGPLAYPLUGIN
#define EXPORTED
#else
#define EXPORTED IMPORT_C
#endif
__NAKED__ EXPORTED _allmul()
{
_asm mov eax,dword ptr [esp+8]
_asm mov ecx,dword ptr [esp+10h]
_asm or ecx,eax
_asm mov ecx,dword ptr [esp+0Ch]
_asm jne label1
_asm mov eax,dword ptr [esp+4]
_asm mul ecx
_asm ret 16
label1:
_asm push ebx
_asm mul ecx
_asm mov ebx , eax
_asm mov eax,dword ptr [esp+8]
_asm mul dword ptr [esp+14h]
_asm add ebx,eax
_asm mov eax,dword ptr [esp+8]
_asm mul ecx
_asm add edx,ebx
_asm pop ebx
_asm ret 10h
}
__NAKED__ EXPORTED _allshl()
{
_asm cmp cl,40h
_asm jae label3
_asm cmp cl,20h
_asm jae label2
_asm shld edx,eax,cl
_asm shl eax,cl
_asm ret
label2:
_asm mov edx,eax
_asm xor eax,eax
_asm and cl,1Fh
_asm shl edx,cl
_asm ret
label3:
_asm xor eax,eax
_asm xor edx,edx
_asm ret
}
__NAKED__ EXPORTED _alldiv()
{
_asm push edi
_asm push esi
_asm push ebx
_asm xor edi,edi
_asm mov eax,dword ptr [esp+14h]
_asm or eax,eax
_asm jge label4
_asm inc edi
_asm mov edx,dword ptr [esp+10h]
_asm neg eax
_asm neg edx
_asm sbb eax,0
_asm mov dword ptr [esp+14h],eax
_asm mov dword ptr [esp+10h],edx
label4:
_asm mov eax,dword ptr [esp+1Ch]
_asm or eax,eax
_asm jge label5
_asm inc edi
_asm mov edx,dword ptr [esp+18h]
_asm neg eax
_asm neg edx
_asm sbb eax,0
_asm mov dword ptr [esp+1Ch],eax
_asm mov dword ptr [esp+18h],edx
label5:
_asm or eax,eax
_asm jne label6
_asm mov ecx,dword ptr [esp+18h]
_asm mov eax,dword ptr [esp+14h]
_asm xor edx,edx
_asm div ecx
_asm mov ebx,eax
_asm mov eax,dword ptr [esp+10h]
_asm div ecx
_asm mov edx,ebx
_asm jmp label8
label6:
_asm mov ebx,eax
_asm mov ecx,dword ptr [esp+18h]
_asm mov edx,dword ptr [esp+14h]
_asm mov eax,dword ptr [esp+10h]
label7:
_asm shr ebx,1
_asm rcr ecx,1
_asm shr edx,1
_asm rcr eax,1
_asm or ebx,ebx
_asm jne label7
_asm div ecx
_asm mov esi,eax
_asm mul dword ptr [esp+1Ch]
_asm mov ecx,eax
_asm mov eax,dword ptr [esp+18h]
_asm mul esi
_asm add edx,ecx
_asm jb label9
_asm cmp edx,dword ptr [esp+14h]
_asm ja label9
_asm jb label10
_asm cmp eax,dword ptr [esp+10h]
_asm jbe label10
label9:
_asm dec esi
label10:
_asm xor edx,edx
_asm mov eax,esi
label8:
_asm dec edi
_asm jne label11
_asm neg edx
_asm neg eax
_asm sbb edx,0
label11:
_asm pop ebx
_asm pop esi
_asm pop edi
_asm ret 10h
}
__NAKED__ EXPORTED _alloca_probe()
{
_asm push ecx
_asm cmp eax,1000h
_asm lea ecx,[esp+8]
_asm jb label101
label100:
_asm sub ecx,1000h
_asm sub eax,1000h
_asm test dword ptr [ecx],eax
_asm cmp eax,1000h
_asm jae label100
label101:
_asm sub ecx,eax
_asm mov eax,esp
_asm test dword ptr [ecx],eax
_asm mov esp,ecx
_asm mov ecx,dword ptr [eax]
_asm mov eax,dword ptr [eax+4]
_asm push eax
_asm ret
}
#endif //__VC32__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -