github.com/notti/go-dynamic@v0.0.0-20190619201224-fc443047424c/steps/2_go/prog/main.s (about)

     1  #include "textflag.h"
     2  
     3  // func asmcall3()
     4  TEXT ·asmcall3(SB),NOSPLIT,$8
     5      MOVQ DI, 0(SP) // for returning the argument
     6      
     7      MOVQ 0(DI), R8
     8      MOVQ 16(DI), SI
     9      MOVQ 24(DI), DX
    10      MOVQ 8(DI), DI
    11  
    12      XORQ AX, AX // no floating point
    13  
    14      CALL R8
    15  
    16      MOVQ 0(SP), DI
    17      MOVQ AX, 0(DI) // return argument in fn - r1 would get optimized away :()
    18  
    19      RET