forked from cs107e/cs107e.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstack_abs.html
193 lines (193 loc) · 15.7 KB
/
stack_abs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<html>
<style type='text/css'>
table
{ font-family: Inconsolata, Consolas, Menlo, monospace;
font-size: 9pt;
border-collapse: collapse;
}
th {
padding: 4px;
margin: 0;
background-color: #cccccc;
border-bottom: 1px black solid;
}
th:nth-child(5) {
text-align: left;
}
td {
padding: 1px 10px 1px 10px;
margin: 0;
}
tr.gap td {
height: 30px;
background: linear-gradient(left, white 30%, #8b0 70%);
}
tr.gap td:nth-child(3) {
background: linear-gradient(gray, white, gray);
}
td:nth-child(2) {
text-align: right;
padding-right: 2px;
}
td:nth-child(3) {
border: 1px solid black;
}
td:nth-child(4) {
font-style: italic;
}
td:nth-child(1) {
font-weight: bold;
text-align: right;
padding-right: 0px;
}
tr.stackframe1line td:nth-child(4), tr.stackframe2line td:nth-child(4), tr.stackframe3line td:nth-child(4), tr.stackframe4line td:nth-child(4) {
border-top: 1px solid black;
}
tr.stackframe2 td:nth-child(3), tr.stackframe2line td:nth-child(3) {
background-color:#ffccff;
}
tr.stackframe3 td:nth-child(3), tr.stackframe3line td:nth-child(3) {
background-color:#ccffcc;
}
tr.stackframe1 td:nth-child(3), tr.stackframe1line td:nth-child(3) {
background-color:#ccffff;
}
tr.stackframe4 td:nth-child(3), tr.stackframe4line td:nth-child(3) {
background-color:#ffffcc;
}
tr.stack td:nth-child(3), tr.stackline td:nth-child(3) {
background-color:#FFFF66;
}
tr.bss td:nth-child(3) {
background-color:#66CCFF;
}
tr.rodata td:nth-child(3) {
background-color:#66FF66;
}
tr.data td:nth-child(3){
background-color:#FF6666;
}
tr.text td:nth-child(3) {
background-color:#ffcc99;
}
</style>
<tt>Diagram of simple.elf, stopped in abs (simple.c:5)</tt>
<table><tr><th> </th><th>Address</th><th>Contents</th><th> </th><th>decoded</th></tr>
<tr class=stackframe2line><td></td><td>[0x7fffffc]</td><td>00 00 81 30</td><td>saved pc</td><td>_cstart frame</td></tr>
<tr class=stackframe2><td></td><td>[0x7fffff8]</td><td>00 00 80 0c</td><td>saved lr</td><td></td></tr>
<tr class=stackframe2><td></td><td>[0x7fffff4]</td><td>08 00 00 00</td><td>saved sp</td><td></td></tr>
<tr class=stackframe2><td></td><td>[0x7fffff0]</td><td>00 00 00 00</td><td>saved fp</td><td></td></tr>
<tr class=stackframe3line><td></td><td>[0x7ffffec]</td><td>00 00 80 f0</td><td>saved pc</td><td>main frame</td></tr>
<tr class=stackframe3><td></td><td>[0x7ffffe8]</td><td>00 00 81 54</td><td>saved lr</td><td></td></tr>
<tr class=stackframe3><td></td><td>[0x7ffffe4]</td><td>07 ff ff f0</td><td>saved sp</td><td></td></tr>
<tr class=stackframe3><td></td><td>[0x7ffffe0]</td><td>07 ff ff fc</td><td>saved fp</td><td></td></tr>
<tr class=stackframe3><td></td><td>[0x7ffffdc]</td><td>00 00 00 00</td><td>saved r5</td><td></td></tr>
<tr class=stackframe3><td></td><td>[0x7ffffd8]</td><td>00 00 00 00</td><td>saved r4</td><td></td></tr>
<tr class=stackframe4line><td></td><td>[0x7ffffd4]</td><td>00 00 80 d0</td><td>saved pc</td><td>diff frame</td></tr>
<tr class=stackframe4><td></td><td>[0x7ffffd0]</td><td>00 00 80 fc</td><td>saved lr</td><td></td></tr>
<tr class=stackframe4><td></td><td>[0x7ffffcc]</td><td>07 ff ff d8</td><td>saved sp</td><td></td></tr>
<tr class=stackframe4><td></td><td>[0x7ffffc8]</td><td>07 ff ff ec</td><td>saved fp</td><td></td></tr>
<tr class=stackframe1line><td>fp =></td><td>[0x7ffffc4]</td><td>00 00 80 1c</td><td>saved pc</td><td>abs frame</td></tr>
<tr class=stackframe1><td></td><td>[0x7ffffc0]</td><td>00 00 80 d8</td><td>saved lr</td><td></td></tr>
<tr class=stackframe1><td></td><td>[0x7ffffbc]</td><td>07 ff ff c8</td><td>saved sp</td><td></td></tr>
<tr class=stackframe1><td>sp =></td><td>[0x7ffffb8]</td><td>07 ff ff d4</td><td>saved fp</td><td></td></tr>
<tr class=gap><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr class=text><td></td><td>[ 0x8184]</td><td>20 20 00 00</td><td><_cstart+96></td><td>.word 0x20200000</td></tr>
<tr class=text><td></td><td>[ 0x8180]</td><td>00 00 81 88</td><td><_cstart+92></td><td>.word 0x8188</td></tr>
<tr class=text><td></td><td>[ 0x817c]</td><td>00 00 81 88</td><td><_cstart+88></td><td>.word 0x8188</td></tr>
<tr class=text><td></td><td>[ 0x8178]</td><td>e1 2f ff 1e</td><td><_cstart+84></td><td>bx lr</td></tr>
<tr class=text><td></td><td>[ 0x8174]</td><td>e8 9d 68 00</td><td><_cstart+80></td><td>ldm sp, {fp, sp, lr}</td></tr>
<tr class=text><td></td><td>[ 0x8170]</td><td>e2 4b d0 0c</td><td><_cstart+76></td><td>sub sp, fp, #12</td></tr>
<tr class=text><td></td><td>[ 0x816c]</td><td>e5 83 20 20</td><td><_cstart+72></td><td>str r2, [r3, #32]</td></tr>
<tr class=text><td></td><td>[ 0x8168]</td><td>e3 a0 29 02</td><td><_cstart+68></td><td>mov r2, #32768 </td></tr>
<tr class=text><td></td><td>[ 0x8164]</td><td>e5 83 20 10</td><td><_cstart+64></td><td>str r2, [r3, #16]</td></tr>
<tr class=text><td></td><td>[ 0x8160]</td><td>e3 82 26 02</td><td><_cstart+60></td><td>orr r2, r2, #2097152 </td></tr>
<tr class=text><td></td><td>[ 0x815c]</td><td>e3 c2 26 0e</td><td><_cstart+56></td><td>bic r2, r2, #14680064 </td></tr>
<tr class=text><td></td><td>[ 0x8158]</td><td>e5 93 20 10</td><td><_cstart+52></td><td>ldr r2, [r3, #16]</td></tr>
<tr class=text><td></td><td>[ 0x8154]</td><td>e5 9f 30 28</td><td><_cstart+48></td><td>ldr r3, [pc, #40] </td></tr>
<tr class=text><td></td><td>[ 0x8150]</td><td>eb ff ff e3</td><td><_cstart+44></td><td>bl 0x80e4 <main></td></tr>
<tr class=text><td></td><td>[ 0x814c]</td><td>3a ff ff fb</td><td><_cstart+40></td><td>bcc 0x8140 <_cstart+28></td></tr>
<tr class=text><td></td><td>[ 0x8148]</td><td>e1 53 00 02</td><td><_cstart+36></td><td>cmp r3, r2</td></tr>
<tr class=text><td></td><td>[ 0x8144]</td><td>e2 83 30 04</td><td><_cstart+32></td><td>add r3, r3, #4</td></tr>
<tr class=text><td></td><td>[ 0x8140]</td><td>e5 83 10 00</td><td><_cstart+28></td><td>str r1, [r3]</td></tr>
<tr class=text><td></td><td>[ 0x813c]</td><td>ea 00 00 01</td><td><_cstart+24></td><td>b 0x8148 <_cstart+36></td></tr>
<tr class=text><td></td><td>[ 0x8138]</td><td>e3 a0 10 00</td><td><_cstart+20></td><td>mov r1, #0</td></tr>
<tr class=text><td></td><td>[ 0x8134]</td><td>e5 9f 20 44</td><td><_cstart+16></td><td>ldr r2, [pc, #68] </td></tr>
<tr class=text><td></td><td>[ 0x8130]</td><td>e5 9f 30 44</td><td><_cstart+12></td><td>ldr r3, [pc, #68] </td></tr>
<tr class=text><td></td><td>[ 0x812c]</td><td>e2 4c b0 04</td><td><_cstart+8></td><td>sub fp, r12, #4</td></tr>
<tr class=text><td></td><td>[ 0x8128]</td><td>e9 2d d8 00</td><td><_cstart+4></td><td>push {fp, r12, lr, pc}</td></tr>
<tr class=text><td></td><td>[ 0x8124]</td><td>e1 a0 c0 0d</td><td><_cstart+0></td><td>mov r12, sp</td></tr>
<tr class=text><td></td><td>[ 0x8120]</td><td>e1 2f ff 1e</td><td><main+60></td><td>bx lr</td></tr>
<tr class=text><td></td><td>[ 0x811c]</td><td>e8 9d 68 30</td><td><main+56></td><td>ldm sp, {r4, r5, fp, sp, lr}</td></tr>
<tr class=text><td></td><td>[ 0x8118]</td><td>e2 4b d0 14</td><td><main+52></td><td>sub sp, fp, #20</td></tr>
<tr class=text><td></td><td>[ 0x8114]</td><td>e0 84 00 00</td><td><main+48></td><td>add r0, r4, r0</td></tr>
<tr class=text><td></td><td>[ 0x8110]</td><td>e0 85 40 04</td><td><main+44></td><td>add r4, r5, r4</td></tr>
<tr class=text><td></td><td>[ 0x810c]</td><td>eb ff ff d5</td><td><main+40></td><td>bl 0x8068 <make_array></td></tr>
<tr class=text><td></td><td>[ 0x8108]</td><td>e1 a0 40 00</td><td><main+36></td><td>mov r4, r0</td></tr>
<tr class=text><td></td><td>[ 0x8104]</td><td>eb ff ff c9</td><td><main+32></td><td>bl 0x8030 <factorial></td></tr>
<tr class=text><td></td><td>[ 0x8100]</td><td>e3 a0 00 07</td><td><main+28></td><td>mov r0, #7</td></tr>
<tr class=text><td></td><td>[ 0x80fc]</td><td>e1 a0 50 00</td><td><main+24></td><td>mov r5, r0</td></tr>
<tr class=text><td></td><td>[ 0x80f8]</td><td>eb ff ff f1</td><td><main+20></td><td>bl 0x80c4 <diff></td></tr>
<tr class=text><td></td><td>[ 0x80f4]</td><td>e3 a0 10 6b</td><td><main+16></td><td>mov r1, #107 </td></tr>
<tr class=text><td></td><td>[ 0x80f0]</td><td>e3 a0 00 21</td><td><main+12></td><td>mov r0, #33 </td></tr>
<tr class=text><td></td><td>[ 0x80ec]</td><td>e2 4c b0 04</td><td><main+8></td><td>sub fp, r12, #4</td></tr>
<tr class=text><td></td><td>[ 0x80e8]</td><td>e9 2d d8 30</td><td><main+4></td><td>push {r4, r5, fp, r12, lr, pc}</td></tr>
<tr class=text><td></td><td>[ 0x80e4]</td><td>e1 a0 c0 0d</td><td><main+0></td><td>mov r12, sp</td></tr>
<tr class=text><td></td><td>[ 0x80e0]</td><td>e1 2f ff 1e</td><td><diff+28></td><td>bx lr</td></tr>
<tr class=text><td></td><td>[ 0x80dc]</td><td>e8 9d 68 00</td><td><diff+24></td><td>ldm sp, {fp, sp, lr}</td></tr>
<tr class=text><td></td><td>[ 0x80d8]</td><td>e2 4b d0 0c</td><td><diff+20></td><td>sub sp, fp, #12</td></tr>
<tr class=text><td></td><td>[ 0x80d4]</td><td>eb ff ff cd</td><td><diff+16></td><td>bl 0x8010 <abs></td></tr>
<tr class=text><td></td><td>[ 0x80d0]</td><td>e0 61 00 00</td><td><diff+12></td><td>rsb r0, r1, r0</td></tr>
<tr class=text><td></td><td>[ 0x80cc]</td><td>e2 4c b0 04</td><td><diff+8></td><td>sub fp, r12, #4</td></tr>
<tr class=text><td></td><td>[ 0x80c8]</td><td>e9 2d d8 00</td><td><diff+4></td><td>push {fp, r12, lr, pc}</td></tr>
<tr class=text><td></td><td>[ 0x80c4]</td><td>e1 a0 c0 0d</td><td><diff+0></td><td>mov r12, sp</td></tr>
<tr class=text><td></td><td>[ 0x80c0]</td><td>e1 2f ff 1e</td><td><make_array+88></td><td>bx lr</td></tr>
<tr class=text><td></td><td>[ 0x80bc]</td><td>e8 9d 68 00</td><td><make_array+84></td><td>ldm sp, {fp, sp, lr}</td></tr>
<tr class=text><td></td><td>[ 0x80b8]</td><td>e2 4b d0 0c</td><td><make_array+80></td><td>sub sp, fp, #12</td></tr>
<tr class=text><td></td><td>[ 0x80b4]</td><td>eb ff ff d5</td><td><make_array+76></td><td>bl 0x8010 <abs></td></tr>
<tr class=text><td></td><td>[ 0x80b0]</td><td>e5 1b 00 18</td><td><make_array+72></td><td>ldr r0, [fp, #-24]</td></tr>
<tr class=text><td></td><td>[ 0x80ac]</td><td>da ff ff f5</td><td><make_array+68></td><td>ble 0x8088 <make_array+32></td></tr>
<tr class=text><td></td><td>[ 0x80a8]</td><td>e3 53 00 04</td><td><make_array+64></td><td>cmp r3, #4</td></tr>
<tr class=text><td></td><td>[ 0x80a4]</td><td>e1 a0 30 02</td><td><make_array+60></td><td>mov r3, r2</td></tr>
<tr class=text><td></td><td>[ 0x80a0]</td><td>e5 03 10 18</td><td><make_array+56></td><td>str r1, [r3, #-24]</td></tr>
<tr class=text><td></td><td>[ 0x809c]</td><td>e0 80 31 02</td><td><make_array+52></td><td>add r3, r0, r2, lsl #2</td></tr>
<tr class=text><td></td><td>[ 0x8098]</td><td>e2 81 10 02</td><td><make_array+48></td><td>add r1, r1, #2</td></tr>
<tr class=text><td></td><td>[ 0x8094]</td><td>e5 13 10 18</td><td><make_array+44></td><td>ldr r1, [r3, #-24]</td></tr>
<tr class=text><td></td><td>[ 0x8090]</td><td>e0 80 31 03</td><td><make_array+40></td><td>add r3, r0, r3, lsl #2</td></tr>
<tr class=text><td></td><td>[ 0x808c]</td><td>e2 4b 00 0c</td><td><make_array+36></td><td>sub r0, fp, #12</td></tr>
<tr class=text><td></td><td>[ 0x8088]</td><td>e2 83 20 01</td><td><make_array+32></td><td>add r2, r3, #1</td></tr>
<tr class=text><td></td><td>[ 0x8084]</td><td>ea 00 00 07</td><td><make_array+28></td><td>b 0x80a8 <make_array+64></td></tr>
<tr class=text><td></td><td>[ 0x8080]</td><td>e3 a0 30 00</td><td><make_array+24></td><td>mov r3, #0</td></tr>
<tr class=text><td></td><td>[ 0x807c]</td><td>e5 0b 30 24</td><td><make_array+20></td><td>str r3, [fp, #-36] </td></tr>
<tr class=text><td></td><td>[ 0x8078]</td><td>e3 a0 30 01</td><td><make_array+16></td><td>mov r3, #1</td></tr>
<tr class=text><td></td><td>[ 0x8074]</td><td>e2 4d d0 18</td><td><make_array+12></td><td>sub sp, sp, #24</td></tr>
<tr class=text><td></td><td>[ 0x8070]</td><td>e2 4c b0 04</td><td><make_array+8></td><td>sub fp, r12, #4</td></tr>
<tr class=text><td></td><td>[ 0x806c]</td><td>e9 2d d8 00</td><td><make_array+4></td><td>push {fp, r12, lr, pc}</td></tr>
<tr class=text><td></td><td>[ 0x8068]</td><td>e1 a0 c0 0d</td><td><make_array+0></td><td>mov r12, sp</td></tr>
<tr class=text><td></td><td>[ 0x8064]</td><td>e1 2f ff 1e</td><td><factorial+52></td><td>bx lr</td></tr>
<tr class=text><td></td><td>[ 0x8060]</td><td>e8 9d 68 18</td><td><factorial+48></td><td>ldm sp, {r3, r4, fp, sp, lr}</td></tr>
<tr class=text><td></td><td>[ 0x805c]</td><td>e2 4b d0 14</td><td><factorial+44></td><td>sub sp, fp, #20</td></tr>
<tr class=text><td></td><td>[ 0x8058]</td><td>e3 a0 00 01</td><td><factorial+40></td><td>mov r0, #1</td></tr>
<tr class=text><td></td><td>[ 0x8054]</td><td>ea 00 00 00</td><td><factorial+36></td><td>b 0x805c <factorial+44></td></tr>
<tr class=text><td></td><td>[ 0x8050]</td><td>e0 00 00 94</td><td><factorial+32></td><td>mul r0, r4, r0</td></tr>
<tr class=text><td></td><td>[ 0x804c]</td><td>eb ff ff f7</td><td><factorial+28></td><td>bl 0x8030 <factorial></td></tr>
<tr class=text><td></td><td>[ 0x8048]</td><td>e2 40 00 01</td><td><factorial+24></td><td>sub r0, r0, #1</td></tr>
<tr class=text><td></td><td>[ 0x8044]</td><td>da 00 00 03</td><td><factorial+20></td><td>ble 0x8058 <factorial+40></td></tr>
<tr class=text><td></td><td>[ 0x8040]</td><td>e3 50 00 01</td><td><factorial+16></td><td>cmp r0, #1</td></tr>
<tr class=text><td></td><td>[ 0x803c]</td><td>e1 a0 40 00</td><td><factorial+12></td><td>mov r4, r0</td></tr>
<tr class=text><td></td><td>[ 0x8038]</td><td>e2 4c b0 04</td><td><factorial+8></td><td>sub fp, r12, #4</td></tr>
<tr class=text><td></td><td>[ 0x8034]</td><td>e9 2d d8 18</td><td><factorial+4></td><td>push {r3, r4, fp, r12, lr, pc}</td></tr>
<tr class=text><td></td><td>[ 0x8030]</td><td>e1 a0 c0 0d</td><td><factorial+0></td><td>mov r12, sp</td></tr>
<tr class=text><td></td><td>[ 0x802c]</td><td>e1 2f ff 1e</td><td><abs+28></td><td>bx lr</td></tr>
<tr class=text><td></td><td>[ 0x8028]</td><td>e8 9d 68 00</td><td><abs+24></td><td>ldm sp, {fp, sp, lr}</td></tr>
<tr class=text><td></td><td>[ 0x8024]</td><td>e2 4b d0 0c</td><td><abs+20></td><td>sub sp, fp, #12</td></tr>
<tr class=text><td></td><td>[ 0x8020]</td><td>b2 60 00 00</td><td><abs+16></td><td>rsblt r0, r0, #0</td></tr>
<tr class=text><td>pc =></td><td>[ 0x801c]</td><td>e3 50 00 00</td><td><abs+12></td><td>cmp r0, #0</td></tr>
<tr class=text><td></td><td>[ 0x8018]</td><td>e2 4c b0 04</td><td><abs+8></td><td>sub fp, r12, #4</td></tr>
<tr class=text><td></td><td>[ 0x8014]</td><td>e9 2d d8 00</td><td><abs+4></td><td>push {fp, r12, lr, pc}</td></tr>
<tr class=text><td></td><td>[ 0x8010]</td><td>e1 a0 c0 0d</td><td><abs+0></td><td>mov r12, sp</td></tr>
<tr class=text><td></td><td>[ 0x800c]</td><td>ea ff ff fe</td><td><hang+0></td><td>b 0x800c <hang></td></tr>
<tr class=text><td></td><td>[ 0x8008]</td><td>eb 00 00 45</td><td><_start+8></td><td>bl 0x8124 <_cstart></td></tr>
<tr class=text><td></td><td>[ 0x8004]</td><td>e3 a0 b0 00</td><td><_start+4></td><td>mov fp, #0</td></tr>
<tr class=text><td></td><td>[ 0x8000]</td><td>e3 a0 d3 02</td><td><_start+0></td><td>mov sp, #134217728 </td></tr>
</table></html>