github.com/primecitizens/pcz/std@v0.2.1/rt0/rt0_amd64.s (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 //go:build !noos && amd64 5 6 #include "textflag.h" 7 8 #ifdef GOOS_linux 9 10 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 11 MOVQ 0(SP), AX // argc 12 LEAQ 8(SP), BX // argv 13 JMP ·rt0<ABIInternal>(SB) 14 15 #endif 16 17 #ifdef GOOS_android 18 19 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 20 MOVQ 0(SP), AX // argc 21 LEAQ 8(SP), BX // argv 22 JMP ·rt0<ABIInternal>(SB) 23 24 #endif 25 26 #ifdef GOOS_freebsd 27 // On FreeBSD argc/argv are passed in DI, not SP 28 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 29 MOVQ 0(DI), AX // argc 30 LEAQ 8(DI), BX // argv 31 JMP ·rt0<ABIInternal>(SB) 32 33 #endif 34 35 #ifdef GOOS_netbsd 36 37 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 38 MOVQ 0(SP), AX // argc 39 LEAQ 8(SP), BX // argv 40 JMP ·rt0<ABIInternal>(SB) 41 42 #endif 43 44 #ifdef GOOS_openbsd 45 46 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 47 MOVQ 0(SP), AX // argc 48 LEAQ 8(SP), BX // argv 49 JMP ·rt0<ABIInternal>(SB) 50 51 #endif 52 53 #ifdef GOOS_dragonfly 54 // On Dragonfly argc/argv are passed in DI, not SP 55 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 56 MOVQ 0(DI), AX // argc 57 LEAQ 8(DI), BX // argv 58 JMP ·rt0<ABIInternal>(SB) 59 60 #endif 61 62 #ifdef GOOS_solaris 63 64 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 65 MOVQ 0(SP), AX // argc 66 LEAQ 8(SP), BX // argv 67 JMP ·rt0<ABIInternal>(SB) 68 69 #endif 70 71 #ifdef GOOS_darwin 72 73 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 74 MOVQ 0(SP), AX // argc 75 LEAQ 8(SP), BX // argv 76 JMP ·rt0<ABIInternal>(SB) 77 78 #endif 79 80 #ifdef GOOS_ios 81 82 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 83 MOVQ 0(SP), AX // argc 84 MOVQ 8(SP), BX // argv 85 JMP ·rt0<ABIInternal>(SB) 86 87 #endif 88 89 #ifdef GOOS_windows 90 91 TEXT rt0(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 92 MOVQ 0(SP), AX // argc 93 LEAQ 8(SP), BX // argv 94 JMP ·rt0<ABIInternal>(SB) 95 96 #endif