汇编中怎么样才可以写出像__declspec(nake)那样的函数
我使用ML是Microsoft (R) Macro Assembler Version 6.14.8444
有些需要需要写一些完全控制的函数过程,换句话说,过程中不能有自动生成的任何代码
下边是我写的一个函数,要求连push eax都不能有
TestProc1 proc uses eax
jmp TestProc
TestProc1 endp
程序代码:OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE
align 16
arrget proc arr:DWORD,indx:DWORD
mov eax, [esp+4] ; write array adress to EAX
mov ecx, [esp+8] ; write required index to ECX
mov eax, [eax+ecx*4] ; write array member address to EAX
ret 8
arrget endp
OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef
程序代码: align 16
arrget:
mov eax, [esp+4] ; write array adress to EAX
mov ecx, [esp+8] ; write required index to ECX
mov eax, [eax+ecx*4] ; write array member address to EAX
ret 8
