github.com/xushiwei/go@v0.0.0-20130601165731-2b9d83f45bc9/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  /*
     6   * void crosscall2(void (*fn)(void*, int32), void*, int32)
     7   * Save registers and call fn with two arguments.
     8   */
     9  TEXT crosscall2(SB),7,$0
    10  	PUSHL	BP
    11  	MOVL	SP, BP
    12  	PUSHL	BX
    13  	PUSHL	SI
    14  	PUSHL	DI
    15  	
    16  	SUBL	$8, SP
    17  	MOVL	16(BP), AX
    18  	MOVL	AX, 4(SP)
    19  	MOVL	12(BP), AX
    20  	MOVL	AX, 0(SP)
    21  	MOVL	8(BP), AX
    22  	CALL	AX
    23  	ADDL	$8, SP
    24  	
    25  	POPL	DI
    26  	POPL	SI
    27  	POPL	BX
    28  	POPL	BP
    29  	RET