Mercurial > pub > dyncall > dyncall
comparison doc/disas_examples/ppc64.elfabi.disas @ 327:c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
author | Tassilo Philipp |
---|---|
date | Fri, 22 Nov 2019 23:08:59 +0100 |
parents | |
children | 74c056b597b7 |
comparison
equal
deleted
inserted
replaced
326:09aaa2e774cd | 327:c0390dc85a07 |
---|---|
1 ; #include <stdlib.h> | |
2 ; | |
3 ; void leaf_call(int b, int c, int d, int e, int f, int g, int h) | |
4 ; { | |
5 ; } | |
6 ; | |
7 ; void nonleaf_call(int a, int b, int c, int d, int e, int f, int g, int h) | |
8 ; { | |
9 ; /* use some local data */ | |
10 ; *(char*)alloca(220) = 'L'; | |
11 ; leaf_call(b, c, d, e, f, g, h); | |
12 ; } | |
13 ; | |
14 ; int main() | |
15 ; { | |
16 ; nonleaf_call(0, 1, 2, 3, 4, 5, 6, 7); | |
17 ; return 0; | |
18 ; } | |
19 | |
20 | |
21 | |
22 ; output from freebsd-11.0-ppc64 w/ gcc 4.2.1 | |
23 | |
24 0000000000000000 <.leaf_call>: | |
25 0: fb e1 ff f8 std r31,-8(r1) | |
26 4: f8 21 ff c1 stdu r1,-64(r1) | |
27 8: 7c 3f 0b 78 mr r31,r1 | |
28 c: 7c 60 1b 78 mr r0,r3 | |
29 10: 7c 8b 23 78 mr r11,r4 | |
30 14: 7c aa 2b 78 mr r10,r5 | |
31 18: 90 1f 00 70 stw r0,112(r31) | |
32 1c: 91 7f 00 78 stw r11,120(r31) | |
33 20: 91 5f 00 80 stw r10,128(r31) | |
34 24: 90 df 00 88 stw r6,136(r31) | |
35 28: 90 ff 00 90 stw r7,144(r31) | |
36 2c: 91 1f 00 98 stw r8,152(r31) | |
37 30: 91 3f 00 a0 stw r9,160(r31) | |
38 34: e8 21 00 00 ld r1,0(r1) | |
39 38: eb e1 ff f8 ld r31,-8(r1) | |
40 3c: 4e 80 00 20 blr | |
41 ... | |
42 48: 80 01 00 01 lwz r0,1(r1) | |
43 | |
44 000000000000004c <.nonleaf_call>: | |
45 4c: 7c 08 02 a6 mflr r0 | |
46 50: fb e1 ff f8 std r31,-8(r1) | |
47 54: f8 01 00 10 std r0,16(r1) | |
48 58: f8 21 ff 71 stdu r1,-144(r1) | |
49 5c: 7c 3f 0b 78 mr r31,r1 | |
50 60: 7c 60 1b 78 mr r0,r3 | |
51 64: 7c 8b 23 78 mr r11,r4 | |
52 68: 90 1f 00 c0 stw r0,192(r31) | |
53 6c: 91 7f 00 c8 stw r11,200(r31) | |
54 70: 90 bf 00 d0 stw r5,208(r31) | |
55 74: 90 df 00 d8 stw r6,216(r31) | |
56 78: 90 ff 00 e0 stw r7,224(r31) | |
57 7c: 91 1f 00 e8 stw r8,232(r31) | |
58 80: 91 3f 00 f0 stw r9,240(r31) | |
59 84: 91 5f 00 f8 stw r10,248(r31) | |
60 88: e8 01 00 00 ld r0,0(r1) | |
61 8c: f8 01 ff 11 stdu r0,-240(r1) | |
62 90: 39 21 00 70 addi r9,r1,112 | |
63 94: f9 3f 00 70 std r9,112(r31) | |
64 98: e9 3f 00 70 ld r9,112(r31) | |
65 9c: 38 09 00 0f addi r0,r9,15 | |
66 a0: 78 00 e1 02 rldicl r0,r0,60,4 | |
67 a4: 78 00 26 e4 rldicr r0,r0,4,59 | |
68 a8: f8 1f 00 70 std r0,112(r31) | |
69 ac: e9 3f 00 70 ld r9,112(r31) | |
70 b0: 38 00 00 4c li r0,76 | |
71 b4: 98 09 00 00 stb r0,0(r9) | |
72 b8: 80 1f 00 c8 lwz r0,200(r31) | |
73 bc: 7c 08 07 b4 extsw r8,r0 | |
74 c0: 80 1f 00 d0 lwz r0,208(r31) | |
75 c4: 7c 07 07 b4 extsw r7,r0 | |
76 c8: 80 1f 00 d8 lwz r0,216(r31) | |
77 cc: 7c 06 07 b4 extsw r6,r0 | |
78 d0: 80 1f 00 e0 lwz r0,224(r31) | |
79 d4: 7c 09 07 b4 extsw r9,r0 | |
80 d8: 80 1f 00 e8 lwz r0,232(r31) | |
81 dc: 7c 0b 07 b4 extsw r11,r0 | |
82 e0: 80 1f 00 f0 lwz r0,240(r31) | |
83 e4: 7c 0a 07 b4 extsw r10,r0 | |
84 e8: 80 1f 00 f8 lwz r0,248(r31) | |
85 ec: 7c 00 07 b4 extsw r0,r0 | |
86 f0: 7d 03 43 78 mr r3,r8 | |
87 f4: 7c e4 3b 78 mr r4,r7 | |
88 f8: 7c c5 33 78 mr r5,r6 | |
89 fc: 7d 26 4b 78 mr r6,r9 | |
90 100: 7d 67 5b 78 mr r7,r11 | |
91 104: 7d 48 53 78 mr r8,r10 | |
92 108: 7c 09 03 78 mr r9,r0 | |
93 10c: 48 00 00 01 bl 10c <.nonleaf_call+0xc0> | |
94 110: e8 21 00 00 ld r1,0(r1) | |
95 114: e8 01 00 10 ld r0,16(r1) | |
96 118: 7c 08 03 a6 mtlr r0 | |
97 11c: eb e1 ff f8 ld r31,-8(r1) | |
98 120: 4e 80 00 20 blr | |
99 124: 00 00 00 00 .long 0x0 | |
100 128: 00 00 00 01 .long 0x1 | |
101 12c: 80 01 00 01 lwz r0,1(r1) | |
102 | |
103 0000000000000130 <.main>: | |
104 130: 7c 08 02 a6 mflr r0 | |
105 134: fb e1 ff f8 std r31,-8(r1) | |
106 138: f8 01 00 10 std r0,16(r1) | |
107 13c: f8 21 ff 81 stdu r1,-128(r1) | |
108 140: 7c 3f 0b 78 mr r31,r1 | |
109 144: 38 60 00 00 li r3,0 | |
110 148: 38 80 00 01 li r4,1 | |
111 14c: 38 a0 00 02 li r5,2 | |
112 150: 38 c0 00 03 li r6,3 | |
113 154: 38 e0 00 04 li r7,4 | |
114 158: 39 00 00 05 li r8,5 | |
115 15c: 39 20 00 06 li r9,6 | |
116 160: 39 40 00 07 li r10,7 | |
117 164: 48 00 00 01 bl 164 <.main+0x34> | |
118 168: 38 00 00 00 li r0,0 | |
119 16c: 7c 03 03 78 mr r3,r0 | |
120 170: e8 21 00 00 ld r1,0(r1) | |
121 174: e8 01 00 10 ld r0,16(r1) | |
122 178: 7c 08 03 a6 mtlr r0 | |
123 17c: eb e1 ff f8 ld r31,-8(r1) | |
124 180: 4e 80 00 20 blr | |
125 184: 00 00 00 00 .long 0x0 | |
126 188: 00 00 00 01 .long 0x1 | |
127 18c: 80 01 00 01 lwz r0,1(r1) | |
128 | |
129 ; vim: ft=asm | |
130 |