github.com/ader1990/go@v0.0.0-20140630135419-8c24447fa791/src/pkg/runtime/cgo/asm_386.s (about)

     1  // Copyright 2009 The Go Authors.  All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  #include "../../../cmd/ld/textflag.h"
     6  
     7  /*
     8   * void crosscall2(void (*fn)(void*, int32), void*, int32)
     9   * Save registers and call fn with two arguments.
    10   */
    11  TEXT crosscall2(SB),NOSPLIT,$0
    12  	PUSHL	BP
    13  	MOVL	SP, BP
    14  	PUSHL	BX
    15  	PUSHL	SI
    16  	PUSHL	DI
    17  	
    18  	SUBL	$8, SP
    19  	MOVL	16(BP), AX
    20  	MOVL	AX, 4(SP)
    21  	MOVL	12(BP), AX
    22  	MOVL	AX, 0(SP)
    23  	MOVL	8(BP), AX
    24  	CALL	AX
    25  	ADDL	$8, SP
    26  	
    27  	POPL	DI
    28  	POPL	SI
    29  	POPL	BX
    30  	POPL	BP
    31  	RET