"Fossies" - the Fresh Open Source Software Archive

Member "AutoHotkey_L-1.1.33.09/source/libx64call/x64stub.asm" (8 May 2021, 867 Bytes) of package /windows/misc/AutoHotkey_L-1.1.33.09.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Generic Assembler source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 ;///////////////////////////////////////////////////////////////////////
    2 ;
    3 ;   Windows x64 RegisterCallback stub
    4 ;   written by fincs
    5 ;
    6 ;///////////////////////////////////////////////////////////////////////
    7 
    8 .code
    9 
   10 CallbackFunctionOffset = 8*3
   11 
   12 RegisterCallbackAsmStub proc frame
   13     option prologue:none, epilogue:none
   14 .allocstack 8*5
   15 .endprolog
   16 
   17     ; For the 'mov' further below
   18     add rsp, 8
   19 
   20     ; Save the parameters in the spill area for consistency
   21     mov qword ptr[rsp+8*0], rcx
   22     mov qword ptr[rsp+8*1], rdx
   23     mov qword ptr[rsp+8*2], r8
   24     mov qword ptr[rsp+8*3], r9
   25 
   26     ; Set parameters for the upcoming function call
   27     mov rcx, rsp ; UINT_PTR* aParams
   28     mov rdx, rax ; RCCallbackFunc* cbAddress
   29 
   30     ; Call callback stub function
   31     sub rsp, 8*6 ; retaddr+padding+spill area
   32     call qword ptr[rax+CallbackFunctionOffset]
   33     add rsp, 8*5
   34 
   35     ; Return
   36     ret
   37 RegisterCallbackAsmStub endp
   38 
   39 end