@@ -32,7 +32,7 @@ func init() {
32
32
func AbiHelp () string {
33
33
return "view abi details with ret\n \n " +
34
34
"output includes calling conventions, register volatility and more\n \n " +
35
- "for architecture specify one of `x86`, `32`, `x64`, `64` " + theme .ColorGray + "~ the default is `x64`\n \n " + theme .ColorReset +
35
+ "for architecture specify one of `x86`, `32`, `x64`, `64`, `arm64`, `aapcs64` " + theme .ColorGray + "~ the default is `x64`\n \n " + theme .ColorReset +
36
36
"for os specify one of `linux`, `windows` " + theme .ColorGray + "~ the default is `linux`\n \n " + theme .ColorReset +
37
37
"for example:\n " +
38
38
"```bash\n " +
@@ -90,6 +90,40 @@ func showLinuxAbix64() {
90
90
fmt .Println (theme .ColorGray + " 128-byte area below the stack pointer see -mno-red-zone" + theme .ColorReset )
91
91
}
92
92
93
+ func showLinuxAbiAAPCS64 () {
94
+ fmt .Println (theme .ColorPurple + "linux 🐧 " + theme .ColorPurple + "AAPCS64" + theme .ColorReset )
95
+
96
+ fmt .Println (theme .ColorPurple + " X31 Stack Pointer " + theme .ColorReset + "(" + theme .ColorPurple + "SP" + theme .ColorReset + ") - " + theme .ColorPurple +
97
+ "X30 Link Register " + theme .ColorReset + "(" + theme .ColorPurple + "LR" + theme .ColorReset + ") - " + theme .ColorPurple +
98
+ "X29 Frame Pointer " + theme .ColorReset + "(" + theme .ColorPurple + "FP" + theme .ColorReset + ")" )
99
+
100
+ fmt .Println (theme .ColorYellow + "\n scratch" + theme .ColorReset + "/" + theme .ColorYellow + "caller-save" + theme .ColorReset + "/" + theme .ColorYellow + "volatile" + theme .ColorReset + ":" )
101
+
102
+ fmt .Println (theme .ColorYellow + " X9 X10 X11 X12 X13 X14 X15" + theme .ColorReset )
103
+
104
+ fmt .Println (theme .ColorGreen + "\n callee-save" + theme .ColorReset + "/" + theme .ColorGreen + "non-volatile" + theme .ColorReset + ":" )
105
+
106
+ fmt .Println (theme .ColorGreen + " X19 X20 X21 X22 X23 X24 X25 X26 X27 X28" + theme .ColorReset )
107
+
108
+ fmt .Println (theme .ColorBlue + "\n intraprocedure" + theme .ColorReset + "/" + theme .ColorBlue + "platform" + theme .ColorReset + ":" )
109
+
110
+ fmt .Println (theme .ColorBlue + " X16 " + theme .ColorReset + "(" + theme .ColorBlue + "IP0" + theme .ColorReset + ") - " + theme .ColorBlue +
111
+ "X17 " + theme .ColorReset + "(" + theme .ColorBlue + "IP1" + theme .ColorReset + ") - " + theme .ColorBlue +
112
+ "X18 Platform Register " + theme .ColorReset + "(" + theme .ColorBlue + "PR" + theme .ColorReset + ")" )
113
+
114
+ fmt .Println (theme .ColorCyan + "\n call" + theme .ColorReset + ":" )
115
+
116
+ fmt .Println (theme .ColorCyan + " X0 X1 X2 X3 X4 X5 X6 X7 STACK => X0 X1 X2 X3 X4 X5 X6 X7" + theme .ColorReset )
117
+
118
+ fmt .Println (theme .ColorGray + " X8 can be used to pass the address location of an indirect result" + theme .ColorReset )
119
+
120
+ fmt .Println (theme .ColorGray + " arguments on the stack should be sign or zero extended and aligned to 8 bytes" + theme .ColorReset )
121
+
122
+ fmt .Println (theme .ColorRed + "\n syscall" + theme .ColorReset + ":" + theme .ColorReset )
123
+
124
+ fmt .Println (theme .ColorRed + " X8 X0 X1 X2 X3 X4 X5 => X0" + theme .ColorReset )
125
+ }
126
+
93
127
func showWindowsAbix86 () {
94
128
fmt .Println (theme .ColorBlue + "windows 🪟 " + theme .ColorBlue + "x86" + theme .ColorReset )
95
129
@@ -154,6 +188,10 @@ func Abi(args []string) {
154
188
} else {
155
189
showWindowsAbix64 ()
156
190
}
191
+ case "arm64" , "aapcs64" :
192
+ if opsys == "linux" {
193
+ showLinuxAbiAAPCS64 ()
194
+ }
157
195
default :
158
196
{
159
197
log .Fatalf ("💥 " + theme .ColorRed + "error" + theme .ColorReset + ": unsupported architecture. use 'x86/32' or 'x64/64'\n " + theme .ColorReset )
0 commit comments