hexsha stringlengths 40 40 | size int64 6 1.05M | ext stringclasses 3 values | lang stringclasses 1 value | max_stars_repo_path stringlengths 4 232 | max_stars_repo_name stringlengths 7 106 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 7 | max_stars_count int64 1 33.5k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 232 | max_issues_repo_name stringlengths 7 106 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 7 | max_issues_count int64 1 37.5k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 232 | max_forks_repo_name stringlengths 7 106 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 7 | max_forks_count int64 1 12.6k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 1.05M | avg_line_length float64 1.16 19.7k | max_line_length int64 2 938k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
77e4a55c89aaa5d1bd11147b6b037da595135d72 | 44,942 | asm | Assembly | wc.asm | Anson-Doan/-CS537-Spring2021-P3b-xv6KernelThreads | 1f48674b6c30c9b5bdc66f85708823fa4a261f1a | [
"MIT-0"
] | null | null | null | wc.asm | Anson-Doan/-CS537-Spring2021-P3b-xv6KernelThreads | 1f48674b6c30c9b5bdc66f85708823fa4a261f1a | [
"MIT-0"
] | null | null | null | wc.asm | Anson-Doan/-CS537-Spring2021-P3b-xv6KernelThreads | 1f48674b6c30c9b5bdc66f85708823fa4a261f1a | [
"MIT-0"
] | null | null | null |
_wc: file format elf32-i386
Disassembly of section .text:
00000000 <wc>:
char buf[512];
void
wc(int fd, char *name)
{
0: f3 0f 1e fb endbr32
4: 55 push %ebp
5: 89 e5 mov %esp,%ebp
7: 57 push %edi
8: 56 push %esi
9: 53 push %ebx
a: 83 ec 1c sub $0x1c,%esp
int i, n;
int l, w, c, inword;
l = w = c = 0;
inword = 0;
d: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
l = w = c = 0;
14: be 00 00 00 00 mov $0x0,%esi
19: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp)
20: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp)
while((n = read(fd, buf, sizeof(buf))) > 0){
27: 83 ec 04 sub $0x4,%esp
2a: 68 00 02 00 00 push $0x200
2f: 68 80 0c 00 00 push $0xc80
34: ff 75 08 pushl 0x8(%ebp)
37: e8 65 04 00 00 call 4a1 <read>
3c: 89 c7 mov %eax,%edi
3e: 83 c4 10 add $0x10,%esp
41: 85 c0 test %eax,%eax
43: 7e 54 jle 99 <wc+0x99>
for(i=0; i<n; i++){
45: bb 00 00 00 00 mov $0x0,%ebx
4a: eb 22 jmp 6e <wc+0x6e>
c++;
if(buf[i] == '\n')
l++;
if(strchr(" \r\t\n\v", buf[i]))
4c: 83 ec 08 sub $0x8,%esp
4f: 0f be c0 movsbl %al,%eax
52: 50 push %eax
53: 68 88 08 00 00 push $0x888
58: e8 98 01 00 00 call 1f5 <strchr>
5d: 83 c4 10 add $0x10,%esp
60: 85 c0 test %eax,%eax
62: 74 22 je 86 <wc+0x86>
inword = 0;
64: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
for(i=0; i<n; i++){
6b: 83 c3 01 add $0x1,%ebx
6e: 39 fb cmp %edi,%ebx
70: 7d b5 jge 27 <wc+0x27>
c++;
72: 83 c6 01 add $0x1,%esi
if(buf[i] == '\n')
75: 0f b6 83 80 0c 00 00 movzbl 0xc80(%ebx),%eax
7c: 3c 0a cmp $0xa,%al
7e: 75 cc jne 4c <wc+0x4c>
l++;
80: 83 45 e0 01 addl $0x1,-0x20(%ebp)
84: eb c6 jmp 4c <wc+0x4c>
else if(!inword){
86: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
8a: 75 df jne 6b <wc+0x6b>
w++;
8c: 83 45 dc 01 addl $0x1,-0x24(%ebp)
inword = 1;
90: c7 45 e4 01 00 00 00 movl $0x1,-0x1c(%ebp)
97: eb d2 jmp 6b <wc+0x6b>
}
}
}
if(n < 0){
99: 78 24 js bf <wc+0xbf>
printf(1, "wc: read error\n");
exit();
}
printf(1, "%d %d %d %s\n", l, w, c, name);
9b: 83 ec 08 sub $0x8,%esp
9e: ff 75 0c pushl 0xc(%ebp)
a1: 56 push %esi
a2: ff 75 dc pushl -0x24(%ebp)
a5: ff 75 e0 pushl -0x20(%ebp)
a8: 68 9e 08 00 00 push $0x89e
ad: 6a 01 push $0x1
af: e8 16 05 00 00 call 5ca <printf>
}
b4: 83 c4 20 add $0x20,%esp
b7: 8d 65 f4 lea -0xc(%ebp),%esp
ba: 5b pop %ebx
bb: 5e pop %esi
bc: 5f pop %edi
bd: 5d pop %ebp
be: c3 ret
printf(1, "wc: read error\n");
bf: 83 ec 08 sub $0x8,%esp
c2: 68 8e 08 00 00 push $0x88e
c7: 6a 01 push $0x1
c9: e8 fc 04 00 00 call 5ca <printf>
exit();
ce: e8 ae 03 00 00 call 481 <exit>
000000d3 <main>:
int
main(int argc, char *argv[])
{
d3: f3 0f 1e fb endbr32
d7: 8d 4c 24 04 lea 0x4(%esp),%ecx
db: 83 e4 f0 and $0xfffffff0,%esp
de: ff 71 fc pushl -0x4(%ecx)
e1: 55 push %ebp
e2: 89 e5 mov %esp,%ebp
e4: 57 push %edi
e5: 56 push %esi
e6: 53 push %ebx
e7: 51 push %ecx
e8: 83 ec 18 sub $0x18,%esp
eb: 8b 01 mov (%ecx),%eax
ed: 89 45 e4 mov %eax,-0x1c(%ebp)
f0: 8b 51 04 mov 0x4(%ecx),%edx
f3: 89 55 e0 mov %edx,-0x20(%ebp)
int fd, i;
if(argc <= 1){
f6: 83 f8 01 cmp $0x1,%eax
f9: 7e 40 jle 13b <main+0x68>
wc(0, "");
exit();
}
for(i = 1; i < argc; i++){
fb: be 01 00 00 00 mov $0x1,%esi
100: 3b 75 e4 cmp -0x1c(%ebp),%esi
103: 7d 60 jge 165 <main+0x92>
if((fd = open(argv[i], 0)) < 0){
105: 8b 45 e0 mov -0x20(%ebp),%eax
108: 8d 3c b0 lea (%eax,%esi,4),%edi
10b: 83 ec 08 sub $0x8,%esp
10e: 6a 00 push $0x0
110: ff 37 pushl (%edi)
112: e8 b2 03 00 00 call 4c9 <open>
117: 89 c3 mov %eax,%ebx
119: 83 c4 10 add $0x10,%esp
11c: 85 c0 test %eax,%eax
11e: 78 2f js 14f <main+0x7c>
printf(1, "wc: cannot open %s\n", argv[i]);
exit();
}
wc(fd, argv[i]);
120: 83 ec 08 sub $0x8,%esp
123: ff 37 pushl (%edi)
125: 50 push %eax
126: e8 d5 fe ff ff call 0 <wc>
close(fd);
12b: 89 1c 24 mov %ebx,(%esp)
12e: e8 7e 03 00 00 call 4b1 <close>
for(i = 1; i < argc; i++){
133: 83 c6 01 add $0x1,%esi
136: 83 c4 10 add $0x10,%esp
139: eb c5 jmp 100 <main+0x2d>
wc(0, "");
13b: 83 ec 08 sub $0x8,%esp
13e: 68 9d 08 00 00 push $0x89d
143: 6a 00 push $0x0
145: e8 b6 fe ff ff call 0 <wc>
exit();
14a: e8 32 03 00 00 call 481 <exit>
printf(1, "wc: cannot open %s\n", argv[i]);
14f: 83 ec 04 sub $0x4,%esp
152: ff 37 pushl (%edi)
154: 68 ab 08 00 00 push $0x8ab
159: 6a 01 push $0x1
15b: e8 6a 04 00 00 call 5ca <printf>
exit();
160: e8 1c 03 00 00 call 481 <exit>
}
exit();
165: e8 17 03 00 00 call 481 <exit>
0000016a <strcpy>:
ptr_storage ptr_pairs[NPROC];
int cell_full[NPROC];
char*
strcpy(char *s, const char *t)
{
16a: f3 0f 1e fb endbr32
16e: 55 push %ebp
16f: 89 e5 mov %esp,%ebp
171: 56 push %esi
172: 53 push %ebx
173: 8b 75 08 mov 0x8(%ebp),%esi
176: 8b 55 0c mov 0xc(%ebp),%edx
char *os;
os = s;
while((*s++ = *t++) != 0)
179: 89 f0 mov %esi,%eax
17b: 89 d1 mov %edx,%ecx
17d: 83 c2 01 add $0x1,%edx
180: 89 c3 mov %eax,%ebx
182: 83 c0 01 add $0x1,%eax
185: 0f b6 09 movzbl (%ecx),%ecx
188: 88 0b mov %cl,(%ebx)
18a: 84 c9 test %cl,%cl
18c: 75 ed jne 17b <strcpy+0x11>
;
return os;
}
18e: 89 f0 mov %esi,%eax
190: 5b pop %ebx
191: 5e pop %esi
192: 5d pop %ebp
193: c3 ret
00000194 <strcmp>:
int
strcmp(const char *p, const char *q)
{
194: f3 0f 1e fb endbr32
198: 55 push %ebp
199: 89 e5 mov %esp,%ebp
19b: 8b 4d 08 mov 0x8(%ebp),%ecx
19e: 8b 55 0c mov 0xc(%ebp),%edx
while(*p && *p == *q)
1a1: 0f b6 01 movzbl (%ecx),%eax
1a4: 84 c0 test %al,%al
1a6: 74 0c je 1b4 <strcmp+0x20>
1a8: 3a 02 cmp (%edx),%al
1aa: 75 08 jne 1b4 <strcmp+0x20>
p++, q++;
1ac: 83 c1 01 add $0x1,%ecx
1af: 83 c2 01 add $0x1,%edx
1b2: eb ed jmp 1a1 <strcmp+0xd>
return (uchar)*p - (uchar)*q;
1b4: 0f b6 c0 movzbl %al,%eax
1b7: 0f b6 12 movzbl (%edx),%edx
1ba: 29 d0 sub %edx,%eax
}
1bc: 5d pop %ebp
1bd: c3 ret
000001be <strlen>:
uint
strlen(const char *s)
{
1be: f3 0f 1e fb endbr32
1c2: 55 push %ebp
1c3: 89 e5 mov %esp,%ebp
1c5: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
1c8: b8 00 00 00 00 mov $0x0,%eax
1cd: 80 3c 01 00 cmpb $0x0,(%ecx,%eax,1)
1d1: 74 05 je 1d8 <strlen+0x1a>
1d3: 83 c0 01 add $0x1,%eax
1d6: eb f5 jmp 1cd <strlen+0xf>
;
return n;
}
1d8: 5d pop %ebp
1d9: c3 ret
000001da <memset>:
void*
memset(void *dst, int c, uint n)
{
1da: f3 0f 1e fb endbr32
1de: 55 push %ebp
1df: 89 e5 mov %esp,%ebp
1e1: 57 push %edi
1e2: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
1e5: 89 d7 mov %edx,%edi
1e7: 8b 4d 10 mov 0x10(%ebp),%ecx
1ea: 8b 45 0c mov 0xc(%ebp),%eax
1ed: fc cld
1ee: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
1f0: 89 d0 mov %edx,%eax
1f2: 5f pop %edi
1f3: 5d pop %ebp
1f4: c3 ret
000001f5 <strchr>:
char*
strchr(const char *s, char c)
{
1f5: f3 0f 1e fb endbr32
1f9: 55 push %ebp
1fa: 89 e5 mov %esp,%ebp
1fc: 8b 45 08 mov 0x8(%ebp),%eax
1ff: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for(; *s; s++)
203: 0f b6 10 movzbl (%eax),%edx
206: 84 d2 test %dl,%dl
208: 74 09 je 213 <strchr+0x1e>
if(*s == c)
20a: 38 ca cmp %cl,%dl
20c: 74 0a je 218 <strchr+0x23>
for(; *s; s++)
20e: 83 c0 01 add $0x1,%eax
211: eb f0 jmp 203 <strchr+0xe>
return (char*)s;
return 0;
213: b8 00 00 00 00 mov $0x0,%eax
}
218: 5d pop %ebp
219: c3 ret
0000021a <gets>:
char*
gets(char *buf, int max)
{
21a: f3 0f 1e fb endbr32
21e: 55 push %ebp
21f: 89 e5 mov %esp,%ebp
221: 57 push %edi
222: 56 push %esi
223: 53 push %ebx
224: 83 ec 1c sub $0x1c,%esp
227: 8b 7d 08 mov 0x8(%ebp),%edi
int i, cc;
char c;
for(i=0; i+1 < max; ){
22a: bb 00 00 00 00 mov $0x0,%ebx
22f: 89 de mov %ebx,%esi
231: 83 c3 01 add $0x1,%ebx
234: 3b 5d 0c cmp 0xc(%ebp),%ebx
237: 7d 2e jge 267 <gets+0x4d>
cc = read(0, &c, 1);
239: 83 ec 04 sub $0x4,%esp
23c: 6a 01 push $0x1
23e: 8d 45 e7 lea -0x19(%ebp),%eax
241: 50 push %eax
242: 6a 00 push $0x0
244: e8 58 02 00 00 call 4a1 <read>
if(cc < 1)
249: 83 c4 10 add $0x10,%esp
24c: 85 c0 test %eax,%eax
24e: 7e 17 jle 267 <gets+0x4d>
break;
buf[i++] = c;
250: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
254: 88 04 37 mov %al,(%edi,%esi,1)
if(c == '\n' || c == '\r')
257: 3c 0a cmp $0xa,%al
259: 0f 94 c2 sete %dl
25c: 3c 0d cmp $0xd,%al
25e: 0f 94 c0 sete %al
261: 08 c2 or %al,%dl
263: 74 ca je 22f <gets+0x15>
buf[i++] = c;
265: 89 de mov %ebx,%esi
break;
}
buf[i] = '\0';
267: c6 04 37 00 movb $0x0,(%edi,%esi,1)
return buf;
}
26b: 89 f8 mov %edi,%eax
26d: 8d 65 f4 lea -0xc(%ebp),%esp
270: 5b pop %ebx
271: 5e pop %esi
272: 5f pop %edi
273: 5d pop %ebp
274: c3 ret
00000275 <stat>:
int
stat(const char *n, struct stat *st)
{
275: f3 0f 1e fb endbr32
279: 55 push %ebp
27a: 89 e5 mov %esp,%ebp
27c: 56 push %esi
27d: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
27e: 83 ec 08 sub $0x8,%esp
281: 6a 00 push $0x0
283: ff 75 08 pushl 0x8(%ebp)
286: e8 3e 02 00 00 call 4c9 <open>
if(fd < 0)
28b: 83 c4 10 add $0x10,%esp
28e: 85 c0 test %eax,%eax
290: 78 24 js 2b6 <stat+0x41>
292: 89 c3 mov %eax,%ebx
return -1;
r = fstat(fd, st);
294: 83 ec 08 sub $0x8,%esp
297: ff 75 0c pushl 0xc(%ebp)
29a: 50 push %eax
29b: e8 41 02 00 00 call 4e1 <fstat>
2a0: 89 c6 mov %eax,%esi
close(fd);
2a2: 89 1c 24 mov %ebx,(%esp)
2a5: e8 07 02 00 00 call 4b1 <close>
return r;
2aa: 83 c4 10 add $0x10,%esp
}
2ad: 89 f0 mov %esi,%eax
2af: 8d 65 f8 lea -0x8(%ebp),%esp
2b2: 5b pop %ebx
2b3: 5e pop %esi
2b4: 5d pop %ebp
2b5: c3 ret
return -1;
2b6: be ff ff ff ff mov $0xffffffff,%esi
2bb: eb f0 jmp 2ad <stat+0x38>
000002bd <atoi>:
int
atoi(const char *s)
{
2bd: f3 0f 1e fb endbr32
2c1: 55 push %ebp
2c2: 89 e5 mov %esp,%ebp
2c4: 53 push %ebx
2c5: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
2c8: ba 00 00 00 00 mov $0x0,%edx
while('0' <= *s && *s <= '9')
2cd: 0f b6 01 movzbl (%ecx),%eax
2d0: 8d 58 d0 lea -0x30(%eax),%ebx
2d3: 80 fb 09 cmp $0x9,%bl
2d6: 77 12 ja 2ea <atoi+0x2d>
n = n*10 + *s++ - '0';
2d8: 8d 1c 92 lea (%edx,%edx,4),%ebx
2db: 8d 14 1b lea (%ebx,%ebx,1),%edx
2de: 83 c1 01 add $0x1,%ecx
2e1: 0f be c0 movsbl %al,%eax
2e4: 8d 54 10 d0 lea -0x30(%eax,%edx,1),%edx
2e8: eb e3 jmp 2cd <atoi+0x10>
return n;
}
2ea: 89 d0 mov %edx,%eax
2ec: 5b pop %ebx
2ed: 5d pop %ebp
2ee: c3 ret
000002ef <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
2ef: f3 0f 1e fb endbr32
2f3: 55 push %ebp
2f4: 89 e5 mov %esp,%ebp
2f6: 56 push %esi
2f7: 53 push %ebx
2f8: 8b 75 08 mov 0x8(%ebp),%esi
2fb: 8b 4d 0c mov 0xc(%ebp),%ecx
2fe: 8b 45 10 mov 0x10(%ebp),%eax
char *dst;
const char *src;
dst = vdst;
301: 89 f2 mov %esi,%edx
src = vsrc;
while(n-- > 0)
303: 8d 58 ff lea -0x1(%eax),%ebx
306: 85 c0 test %eax,%eax
308: 7e 0f jle 319 <memmove+0x2a>
*dst++ = *src++;
30a: 0f b6 01 movzbl (%ecx),%eax
30d: 88 02 mov %al,(%edx)
30f: 8d 49 01 lea 0x1(%ecx),%ecx
312: 8d 52 01 lea 0x1(%edx),%edx
while(n-- > 0)
315: 89 d8 mov %ebx,%eax
317: eb ea jmp 303 <memmove+0x14>
return vdst;
}
319: 89 f0 mov %esi,%eax
31b: 5b pop %ebx
31c: 5e pop %esi
31d: 5d pop %ebp
31e: c3 ret
0000031f <thread_create>:
int thread_create(void (*start_routine)(void *, void *), void *arg1, void *arg2) {
31f: f3 0f 1e fb endbr32
323: 55 push %ebp
324: 89 e5 mov %esp,%ebp
326: 53 push %ebx
327: 83 ec 10 sub $0x10,%esp
void *curr_ptr = malloc(PGSIZE*2);
32a: 68 00 20 00 00 push $0x2000
32f: e8 c7 04 00 00 call 7fb <malloc>
void *user_stack = curr_ptr;
if ((uint)user_stack % PGSIZE != 0) {
334: 83 c4 10 add $0x10,%esp
337: 89 c2 mov %eax,%edx
339: 81 e2 ff 0f 00 00 and $0xfff,%edx
33f: 74 22 je 363 <thread_create+0x44>
user_stack += (PGSIZE - ((uint)user_stack % PGSIZE));
341: b9 00 10 00 00 mov $0x1000,%ecx
346: 29 d1 sub %edx,%ecx
348: 01 c1 add %eax,%ecx
}
int i;
for (i = 0; i < NPROC; i++) {
34a: ba 00 00 00 00 mov $0x0,%edx
34f: 83 fa 3f cmp $0x3f,%edx
352: 7f 13 jg 367 <thread_create+0x48>
if (cell_full[i] != 1) { break; }
354: 83 3c 95 80 11 00 00 cmpl $0x1,0x1180(,%edx,4)
35b: 01
35c: 75 09 jne 367 <thread_create+0x48>
for (i = 0; i < NPROC; i++) {
35e: 83 c2 01 add $0x1,%edx
361: eb ec jmp 34f <thread_create+0x30>
void *user_stack = curr_ptr;
363: 89 c1 mov %eax,%ecx
365: eb e3 jmp 34a <thread_create+0x2b>
}
if (cell_full[i] == 1) {
367: 83 3c 95 80 11 00 00 cmpl $0x1,0x1180(,%edx,4)
36e: 01
36f: 74 34 je 3a5 <thread_create+0x86>
return -1;
}
ptr_pairs[i].orig_ptr = curr_ptr;
371: 8d 1c 52 lea (%edx,%edx,2),%ebx
374: c1 e3 02 shl $0x2,%ebx
377: 89 83 80 0e 00 00 mov %eax,0xe80(%ebx)
ptr_pairs[i].offset_ptr = user_stack;
37d: 89 8b 84 0e 00 00 mov %ecx,0xe84(%ebx)
cell_full[i] = 1;
383: c7 04 95 80 11 00 00 movl $0x1,0x1180(,%edx,4)
38a: 01 00 00 00
// curr_ptrs->next->orig_ptr = curr_ptr;
// curr_ptrs->next->offset_ptr = user_stack;
// curr_ptrs->next->next = NULL;
// }
return clone(user_stack, start_routine, arg1, arg2);
38e: ff 75 10 pushl 0x10(%ebp)
391: ff 75 0c pushl 0xc(%ebp)
394: ff 75 08 pushl 0x8(%ebp)
397: 51 push %ecx
398: e8 dc 00 00 00 call 479 <clone>
39d: 83 c4 10 add $0x10,%esp
}
3a0: 8b 5d fc mov -0x4(%ebp),%ebx
3a3: c9 leave
3a4: c3 ret
return -1;
3a5: b8 ff ff ff ff mov $0xffffffff,%eax
3aa: eb f4 jmp 3a0 <thread_create+0x81>
000003ac <thread_join>:
int thread_join(){
3ac: f3 0f 1e fb endbr32
3b0: 55 push %ebp
3b1: 89 e5 mov %esp,%ebp
3b3: 56 push %esi
3b4: 53 push %ebx
3b5: 83 ec 1c sub $0x1c,%esp
void* diov;
int out = join(&diov);
3b8: 8d 45 f4 lea -0xc(%ebp),%eax
3bb: 50 push %eax
3bc: e8 d0 00 00 00 call 491 <join>
3c1: 89 c6 mov %eax,%esi
// free(curr_ptrs->orig_ptr);
// prev_ptrs->next = curr_ptrs->next;
// free(curr_ptrs);
int i;
for (i = 0; i < NPROC; i++) {
3c3: 83 c4 10 add $0x10,%esp
3c6: bb 00 00 00 00 mov $0x0,%ebx
3cb: 83 fb 3f cmp $0x3f,%ebx
3ce: 7f 14 jg 3e4 <thread_join+0x38>
if (ptr_pairs[i].offset_ptr == diov) { break; }
3d0: 8d 04 5b lea (%ebx,%ebx,2),%eax
3d3: 8b 55 f4 mov -0xc(%ebp),%edx
3d6: 39 14 85 84 0e 00 00 cmp %edx,0xe84(,%eax,4)
3dd: 74 05 je 3e4 <thread_join+0x38>
for (i = 0; i < NPROC; i++) {
3df: 83 c3 01 add $0x1,%ebx
3e2: eb e7 jmp 3cb <thread_join+0x1f>
}
if (ptr_pairs[i].offset_ptr != diov) { return -1; }
3e4: 8d 04 5b lea (%ebx,%ebx,2),%eax
3e7: 8b 4d f4 mov -0xc(%ebp),%ecx
3ea: 39 0c 85 84 0e 00 00 cmp %ecx,0xe84(,%eax,4)
3f1: 75 26 jne 419 <thread_join+0x6d>
free(ptr_pairs[i].orig_ptr);
3f3: 83 ec 0c sub $0xc,%esp
3f6: ff 34 85 80 0e 00 00 pushl 0xe80(,%eax,4)
3fd: e8 35 03 00 00 call 737 <free>
cell_full[i] = 0;
402: c7 04 9d 80 11 00 00 movl $0x0,0x1180(,%ebx,4)
409: 00 00 00 00
return out;
40d: 83 c4 10 add $0x10,%esp
}
410: 89 f0 mov %esi,%eax
412: 8d 65 f8 lea -0x8(%ebp),%esp
415: 5b pop %ebx
416: 5e pop %esi
417: 5d pop %ebp
418: c3 ret
if (ptr_pairs[i].offset_ptr != diov) { return -1; }
419: be ff ff ff ff mov $0xffffffff,%esi
41e: eb f0 jmp 410 <thread_join+0x64>
00000420 <lock_init>:
: "memory"
);
return value;
}
void lock_init(lock_t *lock) {
420: f3 0f 1e fb endbr32
424: 55 push %ebp
425: 89 e5 mov %esp,%ebp
427: 8b 45 08 mov 0x8(%ebp),%eax
lock->ticket = 0;
42a: c7 00 00 00 00 00 movl $0x0,(%eax)
lock->turn = 0;
430: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
}
437: 5d pop %ebp
438: c3 ret
00000439 <lock_acquire>:
void lock_acquire(lock_t *lock) {
439: f3 0f 1e fb endbr32
43d: 55 push %ebp
43e: 89 e5 mov %esp,%ebp
440: 8b 55 08 mov 0x8(%ebp),%edx
__asm__ volatile("lock; xaddl %0, %1"
443: b9 01 00 00 00 mov $0x1,%ecx
448: f0 0f c1 0a lock xadd %ecx,(%edx)
44c: b8 00 00 00 00 mov $0x0,%eax
451: f0 0f c1 42 04 lock xadd %eax,0x4(%edx)
int myturn = fetch_and_add(&lock->ticket, 1);
while( fetch_and_add(&lock->turn, 0) != myturn ) { //changed
456: 39 c1 cmp %eax,%ecx
458: 75 f2 jne 44c <lock_acquire+0x13>
; // spin
}
}
45a: 5d pop %ebp
45b: c3 ret
0000045c <lock_release>:
void lock_release(lock_t *lock) {
45c: f3 0f 1e fb endbr32
460: 55 push %ebp
461: 89 e5 mov %esp,%ebp
463: 8b 55 08 mov 0x8(%ebp),%edx
lock->turn = lock->turn + 1;
466: 8b 42 04 mov 0x4(%edx),%eax
469: 83 c0 01 add $0x1,%eax
46c: 89 42 04 mov %eax,0x4(%edx)
}
46f: 5d pop %ebp
470: c3 ret
00000471 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
471: b8 01 00 00 00 mov $0x1,%eax
476: cd 40 int $0x40
478: c3 ret
00000479 <clone>:
SYSCALL(clone)
479: b8 16 00 00 00 mov $0x16,%eax
47e: cd 40 int $0x40
480: c3 ret
00000481 <exit>:
SYSCALL(exit)
481: b8 02 00 00 00 mov $0x2,%eax
486: cd 40 int $0x40
488: c3 ret
00000489 <wait>:
SYSCALL(wait)
489: b8 03 00 00 00 mov $0x3,%eax
48e: cd 40 int $0x40
490: c3 ret
00000491 <join>:
SYSCALL(join)
491: b8 17 00 00 00 mov $0x17,%eax
496: cd 40 int $0x40
498: c3 ret
00000499 <pipe>:
SYSCALL(pipe)
499: b8 04 00 00 00 mov $0x4,%eax
49e: cd 40 int $0x40
4a0: c3 ret
000004a1 <read>:
SYSCALL(read)
4a1: b8 05 00 00 00 mov $0x5,%eax
4a6: cd 40 int $0x40
4a8: c3 ret
000004a9 <write>:
SYSCALL(write)
4a9: b8 10 00 00 00 mov $0x10,%eax
4ae: cd 40 int $0x40
4b0: c3 ret
000004b1 <close>:
SYSCALL(close)
4b1: b8 15 00 00 00 mov $0x15,%eax
4b6: cd 40 int $0x40
4b8: c3 ret
000004b9 <kill>:
SYSCALL(kill)
4b9: b8 06 00 00 00 mov $0x6,%eax
4be: cd 40 int $0x40
4c0: c3 ret
000004c1 <exec>:
SYSCALL(exec)
4c1: b8 07 00 00 00 mov $0x7,%eax
4c6: cd 40 int $0x40
4c8: c3 ret
000004c9 <open>:
SYSCALL(open)
4c9: b8 0f 00 00 00 mov $0xf,%eax
4ce: cd 40 int $0x40
4d0: c3 ret
000004d1 <mknod>:
SYSCALL(mknod)
4d1: b8 11 00 00 00 mov $0x11,%eax
4d6: cd 40 int $0x40
4d8: c3 ret
000004d9 <unlink>:
SYSCALL(unlink)
4d9: b8 12 00 00 00 mov $0x12,%eax
4de: cd 40 int $0x40
4e0: c3 ret
000004e1 <fstat>:
SYSCALL(fstat)
4e1: b8 08 00 00 00 mov $0x8,%eax
4e6: cd 40 int $0x40
4e8: c3 ret
000004e9 <link>:
SYSCALL(link)
4e9: b8 13 00 00 00 mov $0x13,%eax
4ee: cd 40 int $0x40
4f0: c3 ret
000004f1 <mkdir>:
SYSCALL(mkdir)
4f1: b8 14 00 00 00 mov $0x14,%eax
4f6: cd 40 int $0x40
4f8: c3 ret
000004f9 <chdir>:
SYSCALL(chdir)
4f9: b8 09 00 00 00 mov $0x9,%eax
4fe: cd 40 int $0x40
500: c3 ret
00000501 <dup>:
SYSCALL(dup)
501: b8 0a 00 00 00 mov $0xa,%eax
506: cd 40 int $0x40
508: c3 ret
00000509 <getpid>:
SYSCALL(getpid)
509: b8 0b 00 00 00 mov $0xb,%eax
50e: cd 40 int $0x40
510: c3 ret
00000511 <sbrk>:
SYSCALL(sbrk)
511: b8 0c 00 00 00 mov $0xc,%eax
516: cd 40 int $0x40
518: c3 ret
00000519 <sleep>:
SYSCALL(sleep)
519: b8 0d 00 00 00 mov $0xd,%eax
51e: cd 40 int $0x40
520: c3 ret
00000521 <uptime>:
SYSCALL(uptime)
521: b8 0e 00 00 00 mov $0xe,%eax
526: cd 40 int $0x40
528: c3 ret
00000529 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
529: 55 push %ebp
52a: 89 e5 mov %esp,%ebp
52c: 83 ec 1c sub $0x1c,%esp
52f: 88 55 f4 mov %dl,-0xc(%ebp)
write(fd, &c, 1);
532: 6a 01 push $0x1
534: 8d 55 f4 lea -0xc(%ebp),%edx
537: 52 push %edx
538: 50 push %eax
539: e8 6b ff ff ff call 4a9 <write>
}
53e: 83 c4 10 add $0x10,%esp
541: c9 leave
542: c3 ret
00000543 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
543: 55 push %ebp
544: 89 e5 mov %esp,%ebp
546: 57 push %edi
547: 56 push %esi
548: 53 push %ebx
549: 83 ec 2c sub $0x2c,%esp
54c: 89 45 d0 mov %eax,-0x30(%ebp)
54f: 89 d6 mov %edx,%esi
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
551: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
555: 0f 95 c2 setne %dl
558: 89 f0 mov %esi,%eax
55a: c1 e8 1f shr $0x1f,%eax
55d: 84 c2 test %al,%dl
55f: 74 42 je 5a3 <printint+0x60>
neg = 1;
x = -xx;
561: f7 de neg %esi
neg = 1;
563: c7 45 d4 01 00 00 00 movl $0x1,-0x2c(%ebp)
} else {
x = xx;
}
i = 0;
56a: bb 00 00 00 00 mov $0x0,%ebx
do{
buf[i++] = digits[x % base];
56f: 89 f0 mov %esi,%eax
571: ba 00 00 00 00 mov $0x0,%edx
576: f7 f1 div %ecx
578: 89 df mov %ebx,%edi
57a: 83 c3 01 add $0x1,%ebx
57d: 0f b6 92 c8 08 00 00 movzbl 0x8c8(%edx),%edx
584: 88 54 3d d8 mov %dl,-0x28(%ebp,%edi,1)
}while((x /= base) != 0);
588: 89 f2 mov %esi,%edx
58a: 89 c6 mov %eax,%esi
58c: 39 d1 cmp %edx,%ecx
58e: 76 df jbe 56f <printint+0x2c>
if(neg)
590: 83 7d d4 00 cmpl $0x0,-0x2c(%ebp)
594: 74 2f je 5c5 <printint+0x82>
buf[i++] = '-';
596: c6 44 1d d8 2d movb $0x2d,-0x28(%ebp,%ebx,1)
59b: 8d 5f 02 lea 0x2(%edi),%ebx
59e: 8b 75 d0 mov -0x30(%ebp),%esi
5a1: eb 15 jmp 5b8 <printint+0x75>
neg = 0;
5a3: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp)
5aa: eb be jmp 56a <printint+0x27>
while(--i >= 0)
putc(fd, buf[i]);
5ac: 0f be 54 1d d8 movsbl -0x28(%ebp,%ebx,1),%edx
5b1: 89 f0 mov %esi,%eax
5b3: e8 71 ff ff ff call 529 <putc>
while(--i >= 0)
5b8: 83 eb 01 sub $0x1,%ebx
5bb: 79 ef jns 5ac <printint+0x69>
}
5bd: 83 c4 2c add $0x2c,%esp
5c0: 5b pop %ebx
5c1: 5e pop %esi
5c2: 5f pop %edi
5c3: 5d pop %ebp
5c4: c3 ret
5c5: 8b 75 d0 mov -0x30(%ebp),%esi
5c8: eb ee jmp 5b8 <printint+0x75>
000005ca <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
5ca: f3 0f 1e fb endbr32
5ce: 55 push %ebp
5cf: 89 e5 mov %esp,%ebp
5d1: 57 push %edi
5d2: 56 push %esi
5d3: 53 push %ebx
5d4: 83 ec 1c sub $0x1c,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
5d7: 8d 45 10 lea 0x10(%ebp),%eax
5da: 89 45 e4 mov %eax,-0x1c(%ebp)
state = 0;
5dd: be 00 00 00 00 mov $0x0,%esi
for(i = 0; fmt[i]; i++){
5e2: bb 00 00 00 00 mov $0x0,%ebx
5e7: eb 14 jmp 5fd <printf+0x33>
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
} else {
putc(fd, c);
5e9: 89 fa mov %edi,%edx
5eb: 8b 45 08 mov 0x8(%ebp),%eax
5ee: e8 36 ff ff ff call 529 <putc>
5f3: eb 05 jmp 5fa <printf+0x30>
}
} else if(state == '%'){
5f5: 83 fe 25 cmp $0x25,%esi
5f8: 74 25 je 61f <printf+0x55>
for(i = 0; fmt[i]; i++){
5fa: 83 c3 01 add $0x1,%ebx
5fd: 8b 45 0c mov 0xc(%ebp),%eax
600: 0f b6 04 18 movzbl (%eax,%ebx,1),%eax
604: 84 c0 test %al,%al
606: 0f 84 23 01 00 00 je 72f <printf+0x165>
c = fmt[i] & 0xff;
60c: 0f be f8 movsbl %al,%edi
60f: 0f b6 c0 movzbl %al,%eax
if(state == 0){
612: 85 f6 test %esi,%esi
614: 75 df jne 5f5 <printf+0x2b>
if(c == '%'){
616: 83 f8 25 cmp $0x25,%eax
619: 75 ce jne 5e9 <printf+0x1f>
state = '%';
61b: 89 c6 mov %eax,%esi
61d: eb db jmp 5fa <printf+0x30>
if(c == 'd'){
61f: 83 f8 64 cmp $0x64,%eax
622: 74 49 je 66d <printf+0xa3>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
624: 83 f8 78 cmp $0x78,%eax
627: 0f 94 c1 sete %cl
62a: 83 f8 70 cmp $0x70,%eax
62d: 0f 94 c2 sete %dl
630: 08 d1 or %dl,%cl
632: 75 63 jne 697 <printf+0xcd>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
634: 83 f8 73 cmp $0x73,%eax
637: 0f 84 84 00 00 00 je 6c1 <printf+0xf7>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
63d: 83 f8 63 cmp $0x63,%eax
640: 0f 84 b7 00 00 00 je 6fd <printf+0x133>
putc(fd, *ap);
ap++;
} else if(c == '%'){
646: 83 f8 25 cmp $0x25,%eax
649: 0f 84 cc 00 00 00 je 71b <printf+0x151>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
64f: ba 25 00 00 00 mov $0x25,%edx
654: 8b 45 08 mov 0x8(%ebp),%eax
657: e8 cd fe ff ff call 529 <putc>
putc(fd, c);
65c: 89 fa mov %edi,%edx
65e: 8b 45 08 mov 0x8(%ebp),%eax
661: e8 c3 fe ff ff call 529 <putc>
}
state = 0;
666: be 00 00 00 00 mov $0x0,%esi
66b: eb 8d jmp 5fa <printf+0x30>
printint(fd, *ap, 10, 1);
66d: 8b 7d e4 mov -0x1c(%ebp),%edi
670: 8b 17 mov (%edi),%edx
672: 83 ec 0c sub $0xc,%esp
675: 6a 01 push $0x1
677: b9 0a 00 00 00 mov $0xa,%ecx
67c: 8b 45 08 mov 0x8(%ebp),%eax
67f: e8 bf fe ff ff call 543 <printint>
ap++;
684: 83 c7 04 add $0x4,%edi
687: 89 7d e4 mov %edi,-0x1c(%ebp)
68a: 83 c4 10 add $0x10,%esp
state = 0;
68d: be 00 00 00 00 mov $0x0,%esi
692: e9 63 ff ff ff jmp 5fa <printf+0x30>
printint(fd, *ap, 16, 0);
697: 8b 7d e4 mov -0x1c(%ebp),%edi
69a: 8b 17 mov (%edi),%edx
69c: 83 ec 0c sub $0xc,%esp
69f: 6a 00 push $0x0
6a1: b9 10 00 00 00 mov $0x10,%ecx
6a6: 8b 45 08 mov 0x8(%ebp),%eax
6a9: e8 95 fe ff ff call 543 <printint>
ap++;
6ae: 83 c7 04 add $0x4,%edi
6b1: 89 7d e4 mov %edi,-0x1c(%ebp)
6b4: 83 c4 10 add $0x10,%esp
state = 0;
6b7: be 00 00 00 00 mov $0x0,%esi
6bc: e9 39 ff ff ff jmp 5fa <printf+0x30>
s = (char*)*ap;
6c1: 8b 45 e4 mov -0x1c(%ebp),%eax
6c4: 8b 30 mov (%eax),%esi
ap++;
6c6: 83 c0 04 add $0x4,%eax
6c9: 89 45 e4 mov %eax,-0x1c(%ebp)
if(s == 0)
6cc: 85 f6 test %esi,%esi
6ce: 75 28 jne 6f8 <printf+0x12e>
s = "(null)";
6d0: be bf 08 00 00 mov $0x8bf,%esi
6d5: 8b 7d 08 mov 0x8(%ebp),%edi
6d8: eb 0d jmp 6e7 <printf+0x11d>
putc(fd, *s);
6da: 0f be d2 movsbl %dl,%edx
6dd: 89 f8 mov %edi,%eax
6df: e8 45 fe ff ff call 529 <putc>
s++;
6e4: 83 c6 01 add $0x1,%esi
while(*s != 0){
6e7: 0f b6 16 movzbl (%esi),%edx
6ea: 84 d2 test %dl,%dl
6ec: 75 ec jne 6da <printf+0x110>
state = 0;
6ee: be 00 00 00 00 mov $0x0,%esi
6f3: e9 02 ff ff ff jmp 5fa <printf+0x30>
6f8: 8b 7d 08 mov 0x8(%ebp),%edi
6fb: eb ea jmp 6e7 <printf+0x11d>
putc(fd, *ap);
6fd: 8b 7d e4 mov -0x1c(%ebp),%edi
700: 0f be 17 movsbl (%edi),%edx
703: 8b 45 08 mov 0x8(%ebp),%eax
706: e8 1e fe ff ff call 529 <putc>
ap++;
70b: 83 c7 04 add $0x4,%edi
70e: 89 7d e4 mov %edi,-0x1c(%ebp)
state = 0;
711: be 00 00 00 00 mov $0x0,%esi
716: e9 df fe ff ff jmp 5fa <printf+0x30>
putc(fd, c);
71b: 89 fa mov %edi,%edx
71d: 8b 45 08 mov 0x8(%ebp),%eax
720: e8 04 fe ff ff call 529 <putc>
state = 0;
725: be 00 00 00 00 mov $0x0,%esi
72a: e9 cb fe ff ff jmp 5fa <printf+0x30>
}
}
}
72f: 8d 65 f4 lea -0xc(%ebp),%esp
732: 5b pop %ebx
733: 5e pop %esi
734: 5f pop %edi
735: 5d pop %ebp
736: c3 ret
00000737 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
737: f3 0f 1e fb endbr32
73b: 55 push %ebp
73c: 89 e5 mov %esp,%ebp
73e: 57 push %edi
73f: 56 push %esi
740: 53 push %ebx
741: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*)ap - 1;
744: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
747: a1 60 0c 00 00 mov 0xc60,%eax
74c: eb 02 jmp 750 <free+0x19>
74e: 89 d0 mov %edx,%eax
750: 39 c8 cmp %ecx,%eax
752: 73 04 jae 758 <free+0x21>
754: 39 08 cmp %ecx,(%eax)
756: 77 12 ja 76a <free+0x33>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
758: 8b 10 mov (%eax),%edx
75a: 39 c2 cmp %eax,%edx
75c: 77 f0 ja 74e <free+0x17>
75e: 39 c8 cmp %ecx,%eax
760: 72 08 jb 76a <free+0x33>
762: 39 ca cmp %ecx,%edx
764: 77 04 ja 76a <free+0x33>
766: 89 d0 mov %edx,%eax
768: eb e6 jmp 750 <free+0x19>
break;
if(bp + bp->s.size == p->s.ptr){
76a: 8b 73 fc mov -0x4(%ebx),%esi
76d: 8d 3c f1 lea (%ecx,%esi,8),%edi
770: 8b 10 mov (%eax),%edx
772: 39 d7 cmp %edx,%edi
774: 74 19 je 78f <free+0x58>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
776: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
779: 8b 50 04 mov 0x4(%eax),%edx
77c: 8d 34 d0 lea (%eax,%edx,8),%esi
77f: 39 ce cmp %ecx,%esi
781: 74 1b je 79e <free+0x67>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
783: 89 08 mov %ecx,(%eax)
freep = p;
785: a3 60 0c 00 00 mov %eax,0xc60
}
78a: 5b pop %ebx
78b: 5e pop %esi
78c: 5f pop %edi
78d: 5d pop %ebp
78e: c3 ret
bp->s.size += p->s.ptr->s.size;
78f: 03 72 04 add 0x4(%edx),%esi
792: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
795: 8b 10 mov (%eax),%edx
797: 8b 12 mov (%edx),%edx
799: 89 53 f8 mov %edx,-0x8(%ebx)
79c: eb db jmp 779 <free+0x42>
p->s.size += bp->s.size;
79e: 03 53 fc add -0x4(%ebx),%edx
7a1: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
7a4: 8b 53 f8 mov -0x8(%ebx),%edx
7a7: 89 10 mov %edx,(%eax)
7a9: eb da jmp 785 <free+0x4e>
000007ab <morecore>:
static Header*
morecore(uint nu)
{
7ab: 55 push %ebp
7ac: 89 e5 mov %esp,%ebp
7ae: 53 push %ebx
7af: 83 ec 04 sub $0x4,%esp
7b2: 89 c3 mov %eax,%ebx
char *p;
Header *hp;
if(nu < 4096)
7b4: 3d ff 0f 00 00 cmp $0xfff,%eax
7b9: 77 05 ja 7c0 <morecore+0x15>
nu = 4096;
7bb: bb 00 10 00 00 mov $0x1000,%ebx
p = sbrk(nu * sizeof(Header));
7c0: 8d 04 dd 00 00 00 00 lea 0x0(,%ebx,8),%eax
7c7: 83 ec 0c sub $0xc,%esp
7ca: 50 push %eax
7cb: e8 41 fd ff ff call 511 <sbrk>
if(p == (char*)-1)
7d0: 83 c4 10 add $0x10,%esp
7d3: 83 f8 ff cmp $0xffffffff,%eax
7d6: 74 1c je 7f4 <morecore+0x49>
return 0;
hp = (Header*)p;
hp->s.size = nu;
7d8: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
7db: 83 c0 08 add $0x8,%eax
7de: 83 ec 0c sub $0xc,%esp
7e1: 50 push %eax
7e2: e8 50 ff ff ff call 737 <free>
return freep;
7e7: a1 60 0c 00 00 mov 0xc60,%eax
7ec: 83 c4 10 add $0x10,%esp
}
7ef: 8b 5d fc mov -0x4(%ebp),%ebx
7f2: c9 leave
7f3: c3 ret
return 0;
7f4: b8 00 00 00 00 mov $0x0,%eax
7f9: eb f4 jmp 7ef <morecore+0x44>
000007fb <malloc>:
void*
malloc(uint nbytes)
{
7fb: f3 0f 1e fb endbr32
7ff: 55 push %ebp
800: 89 e5 mov %esp,%ebp
802: 53 push %ebx
803: 83 ec 04 sub $0x4,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
806: 8b 45 08 mov 0x8(%ebp),%eax
809: 8d 58 07 lea 0x7(%eax),%ebx
80c: c1 eb 03 shr $0x3,%ebx
80f: 83 c3 01 add $0x1,%ebx
if((prevp = freep) == 0){
812: 8b 0d 60 0c 00 00 mov 0xc60,%ecx
818: 85 c9 test %ecx,%ecx
81a: 74 04 je 820 <malloc+0x25>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
81c: 8b 01 mov (%ecx),%eax
81e: eb 4b jmp 86b <malloc+0x70>
base.s.ptr = freep = prevp = &base;
820: c7 05 60 0c 00 00 64 movl $0xc64,0xc60
827: 0c 00 00
82a: c7 05 64 0c 00 00 64 movl $0xc64,0xc64
831: 0c 00 00
base.s.size = 0;
834: c7 05 68 0c 00 00 00 movl $0x0,0xc68
83b: 00 00 00
base.s.ptr = freep = prevp = &base;
83e: b9 64 0c 00 00 mov $0xc64,%ecx
843: eb d7 jmp 81c <malloc+0x21>
if(p->s.size >= nunits){
if(p->s.size == nunits)
845: 74 1a je 861 <malloc+0x66>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
847: 29 da sub %ebx,%edx
849: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
84c: 8d 04 d0 lea (%eax,%edx,8),%eax
p->s.size = nunits;
84f: 89 58 04 mov %ebx,0x4(%eax)
}
freep = prevp;
852: 89 0d 60 0c 00 00 mov %ecx,0xc60
return (void*)(p + 1);
858: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
85b: 83 c4 04 add $0x4,%esp
85e: 5b pop %ebx
85f: 5d pop %ebp
860: c3 ret
prevp->s.ptr = p->s.ptr;
861: 8b 10 mov (%eax),%edx
863: 89 11 mov %edx,(%ecx)
865: eb eb jmp 852 <malloc+0x57>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
867: 89 c1 mov %eax,%ecx
869: 8b 00 mov (%eax),%eax
if(p->s.size >= nunits){
86b: 8b 50 04 mov 0x4(%eax),%edx
86e: 39 da cmp %ebx,%edx
870: 73 d3 jae 845 <malloc+0x4a>
if(p == freep)
872: 39 05 60 0c 00 00 cmp %eax,0xc60
878: 75 ed jne 867 <malloc+0x6c>
if((p = morecore(nunits)) == 0)
87a: 89 d8 mov %ebx,%eax
87c: e8 2a ff ff ff call 7ab <morecore>
881: 85 c0 test %eax,%eax
883: 75 e2 jne 867 <malloc+0x6c>
885: eb d4 jmp 85b <malloc+0x60>
| 33.143068 | 82 | 0.422945 |
63b2595968dbd062a6c6f1fbcbe02f96157b2613 | 882 | asm | Assembly | header/000/NROM-368.asm | freem/nes_corelib | a890aa3c436e931a765866265f24ccf3c432f71d | [
"0BSD"
] | 16 | 2015-06-23T03:17:40.000Z | 2021-10-05T23:40:28.000Z | nes_corelib/header/000/NROM-368.asm | master-g/childhood | 7cd2a6a13f7e862df6d239e78371df6222b30a53 | [
"Apache-2.0"
] | null | null | null | nes_corelib/header/000/NROM-368.asm | master-g/childhood | 7cd2a6a13f7e862df6d239e78371df6222b30a53 | [
"Apache-2.0"
] | 3 | 2015-11-12T01:29:55.000Z | 2020-07-06T05:15:06.000Z | ; NROM-368: 46KB PRG-ROM + 8KB CHR-ROM
; http://wiki.nesdev.com/w/index.php/NROM-368
; An unofficial configuration that allows up to 46KB of ROM instead of 32.
; Important Note!
; "The PRG ROM is 47104 bytes in size. Due to constraints of the iNES format,
; it is padded at the beginning with 2048 bytes of ignored data so that it is
; an even multiple of 16384 bytes; the rest is loaded in order into $4800-$7FFF,
; $8000-$BFFF, and $C000-$FFFF."
;------------------------------------------------------------------------------;
; NROM mirroring is hardwired via solder pads.
; %0000 = Horizontal
; %0001 = Vertical
MIRRORING = %0001
; Mapper 000 (NROM-368) iNES header
.byte "NES",$1A
.byte $03 ; 3x 16K PRG banks (just under 48K)
.byte $01 ; 1x 8K CHR banks
.byte $00|MIRRORING ; flags 6
.byte $00 ; flags 7
.byte $00 ; no PRG RAM
.dsb 7, $00 ; clear the remaining bytes
| 36.75 | 80 | 0.638322 |
14e1e7503362bd05a6c18485690d888f7a92c750 | 1,246 | asm | Assembly | Web/asm/examples/Add 16-bit.asm | visrealm/vrcpu | f42ae80bd1e89e3877b88f1766f5facc5841594f | [
"MIT"
] | 102 | 2019-09-24T21:12:05.000Z | 2022-02-20T06:51:25.000Z | Web/asm/examples/Add 16-bit.asm | visrealm/vrcpu | f42ae80bd1e89e3877b88f1766f5facc5841594f | [
"MIT"
] | null | null | null | Web/asm/examples/Add 16-bit.asm | visrealm/vrcpu | f42ae80bd1e89e3877b88f1766f5facc5841594f | [
"MIT"
] | 13 | 2019-09-25T19:52:10.000Z | 2021-09-24T00:44:40.000Z | ; Add two 16 bit numbers.
; Place result high byte in Rc, low byte in Rb
; Carry flag will be set if result is > 16 bits
FIRST = 0x00
SECOND = FIRST + 0x02
NUMBER1 = 12345
NUMBER2 = 12122
.setup:
clra
data SP, 0xff
; first number
data Ra, NUMBER1 >> 8 ; high byte
data Rd, NUMBER1 ; low byte
sto Rd, FIRST
sto Ra, FIRST + 0x01
; second number
data Ra, NUMBER2 >> 8 ; high byte
data Rd, NUMBER2 ; low byte
sto Rd, SECOND
sto Ra, SECOND + 0x01
data Ra, FIRST
data Rd, SECOND
call .add16
lod Rd, FIRST
lod Rc, FIRST + 0x01
data Rb, 0xff
add Ra ; ensure the carry flag is set if we overflowed
mov Rb, Rd
hlt
; adds 16-bit numbers in memory.
; Number 1 address in Ra
; Number 2 address in Rd
.add16:
lod Rb, Ra ; load first low byte into Rb
lod Rc, Rd ; load second low byte into Rc
add Rc ; sum to Rc
sto Ra, Rc ; write back to first address
jnc .addHigh
.addCarry:
inc Ra
lod Rb, Ra
inc Rb
sto Ra, Rb
dec Ra
.addHigh:
inc Ra ; go to high byte
inc Rd ; go to high byte
lod Rb, Ra ; load first low byte into Rb
lod Rc, Rd ; load second low byte into Rc
add Rc ; sum to Rc
sto Ra, Rc ; write back to first address
data Ra, 0
jnc .done
inc Ra ; overflow
.done:
ret | 18.323529 | 55 | 0.655698 |
cfba454b8ae1a94441228e64b55b086225f78060 | 4,852 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_22.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_22.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_22.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x10d18, %rsi
lea addresses_UC_ht+0x10798, %rdi
nop
nop
cmp $23264, %r14
mov $65, %rcx
rep movsq
nop
nop
nop
nop
nop
sub $35100, %r9
lea addresses_normal_ht+0x2f98, %rdi
nop
xor $22460, %rcx
mov (%rdi), %si
nop
cmp %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r15
push %r8
push %rax
push %rbx
// Store
lea addresses_D+0x6798, %r11
nop
xor $37269, %r15
movl $0x51525354, (%r11)
nop
nop
nop
nop
nop
xor %r13, %r13
// Load
lea addresses_normal+0xce98, %r8
nop
xor $16465, %r10
mov (%r8), %ebx
xor %r15, %r15
// Faulty Load
lea addresses_WT+0x17798, %rax
nop
nop
nop
nop
xor %r10, %r10
vmovups (%rax), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $1, %xmm3, %r11
lea oracles, %r8
and $0xff, %r11
shlq $12, %r11
mov (%r8,%r11,1), %r11
pop %rbx
pop %rax
pop %r8
pop %r15
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_D', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_normal', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 48.52 | 2,999 | 0.65911 |
0723bca0c585f98d51b36cce52b4d6d705df9024 | 550 | asm | Assembly | oeis/017/A017445.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/017/A017445.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/017/A017445.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A017445: a(n) = (11*n + 4)^9.
; 262144,38443359375,5429503678976,129961739795077,1352605460594688,8662995818654939,40353607000000000,150094635296999121,472161363286556672,1304773183829244583,3251948521156637184,7450580596923828125,15916595351771938816,32052064847671367667,61364017143100579328,112455406951957393129,198359290368000000000,338298681559573317311,559966859614392781312,902436039641232277173,1419816323814495617024,2185801705278841796875,3299255610714283193856,4891005035897482905857,7132029752782342586368
mul $0,11
add $0,4
pow $0,9
| 78.571429 | 488 | 0.894545 |
cb20425d8233b073e7ba5a5309b168a3de204bd7 | 634 | asm | Assembly | oeis/119/A119737.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/119/A119737.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/119/A119737.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A119737: a(n) = Sum{k=1..n} Fibonacci(floor(n/k)).
; Submitted by Simon Strandgaard
; 1,2,4,6,9,14,20,30,45,69,104,165,255,405,642,1029,1640,2645,4243,6852,11040,17840,28787,46567,75227,121685,196725,318269,514688,832760,1346990,2179417,3525722,5704642,9229228,14933176,24160642,39092592
mov $6,$0
mov $8,$0
add $8,1
lpb $8
mov $0,$6
mov $1,0
mov $5,0
sub $8,1
sub $0,$8
add $0,1
mov $2,$0
lpb $0
mov $3,$2
dif $3,$0
sub $0,1
max $0,2
cmp $3,$2
sub $3,$1
cmp $4,2
sub $4,1
mul $5,$4
add $5,1
sub $5,$3
add $1,$5
lpe
mov $0,$1
add $0,1
add $7,$0
lpe
mov $0,$7
| 18.114286 | 203 | 0.577287 |
9fe6a4267f90b6d83b404ddb585478b6418ccb91 | 402 | asm | Assembly | programs/oeis/037/A037482.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/037/A037482.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/037/A037482.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A037482: Base 5 digits are, in order, the first n terms of the periodic sequence with initial period 1,2.
; 1,7,36,182,911,4557,22786,113932,569661,2848307,14241536,71207682,356038411,1780192057,8900960286,44504801432,222524007161,1112620035807,5563100179036,27815500895182,139077504475911,695387522379557
add $0,1
mov $1,5
pow $1,$0
mul $1,7
div $1,6
mul $1,2
sub $1,10
div $1,8
add $1,1
mov $0,$1
| 28.714286 | 199 | 0.768657 |
dd9f3847d0b48701253da383477d16fc9a243536 | 5,498 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_715.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_715.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_715.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x13d05, %rsi
lea addresses_WT_ht+0x1942d, %rdi
nop
nop
nop
nop
sub %rbx, %rbx
mov $15, %rcx
rep movsw
nop
and $21162, %r15
lea addresses_WT_ht+0x1e471, %rdi
cmp $41965, %rdx
and $0xffffffffffffffc0, %rdi
movntdqa (%rdi), %xmm3
vpextrq $1, %xmm3, %rsi
nop
nop
nop
nop
nop
add $60241, %rdx
lea addresses_A_ht+0x1825, %rdi
sub $60398, %rsi
movl $0x61626364, (%rdi)
nop
nop
xor %r15, %r15
lea addresses_D_ht+0x2a25, %rsi
lea addresses_normal_ht+0xf77e, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
xor %rdx, %rdx
mov $5, %rcx
rep movsw
nop
nop
nop
xor $24367, %rbx
lea addresses_D_ht+0x97a5, %r15
nop
sub %rbp, %rbp
mov $0x6162636465666768, %rcx
movq %rcx, (%r15)
nop
nop
and $64109, %r15
lea addresses_WC_ht+0x11225, %rsi
lea addresses_UC_ht+0x9525, %rdi
sub %r14, %r14
mov $83, %rcx
rep movsq
nop
nop
nop
xor %rbp, %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %r8
push %rcx
push %rdi
// Faulty Load
lea addresses_WT+0xa225, %rcx
nop
nop
nop
nop
nop
add $61164, %rdi
mov (%rcx), %r15d
lea oracles, %r11
and $0xff, %r15
shlq $12, %r15
mov (%r11,%r15,1), %r15
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 9}}
{'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 44.699187 | 2,999 | 0.662241 |
ed100158393724e48a71bb7c03c2f4a9d7e0dce4 | 316 | asm | Assembly | ITS_Assembler/testAnd.asm | RobertGageStroud/Portfolio | 7e2f915cd34eb7f818b94398ba261f65c7135db9 | [
"MIT"
] | null | null | null | ITS_Assembler/testAnd.asm | RobertGageStroud/Portfolio | 7e2f915cd34eb7f818b94398ba261f65c7135db9 | [
"MIT"
] | null | null | null | ITS_Assembler/testAnd.asm | RobertGageStroud/Portfolio | 7e2f915cd34eb7f818b94398ba261f65c7135db9 | [
"MIT"
] | 1 | 2020-10-27T16:58:32.000Z | 2020-10-27T16:58:32.000Z | ;Test file for assembly of the AnD instruction
;This is a comment
.orig x4000
AND R0, R1, R2
and R1, R2, R3
And R2, R3, R4
And R3, R4, R5
AnD R4, R5, R6
AnD R5, R6, R7
AnD R6, R7, R0
AnD R7, R0, R1
AnD R0, R0, #15
AnD R1, R1, #-15
AnD R2, R2, #10
AnD R3, R3, #-10
AND R5, R4, #0
AND R7, R5, #-1
.END
| 15.047619 | 46 | 0.594937 |
7ec07a41918dbdce306544d23d3487aea3296476 | 5,797 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1970.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1970.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1970.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r9
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1deb4, %rsi
lea addresses_A_ht+0x197fc, %rdi
nop
nop
add $21876, %rdx
mov $51, %rcx
rep movsl
nop
xor %rsi, %rsi
lea addresses_WC_ht+0x133b4, %r9
nop
and %rbp, %rbp
mov $0x6162636465666768, %rdx
movq %rdx, %xmm5
vmovups %ymm5, (%r9)
add $31300, %rdx
lea addresses_WC_ht+0x195f8, %rcx
nop
add %rdx, %rdx
movl $0x61626364, (%rcx)
cmp $28412, %rbp
lea addresses_WC_ht+0x116c4, %rcx
nop
nop
nop
add %r9, %r9
mov (%rcx), %edi
nop
nop
add $36780, %rdi
lea addresses_UC_ht+0x2724, %rsi
nop
nop
nop
sub $13812, %r9
mov (%rsi), %di
nop
nop
nop
nop
nop
dec %rdi
lea addresses_WT_ht+0x13864, %rsi
lea addresses_WC_ht+0xe1b4, %rdi
nop
and $47411, %rax
mov $47, %rcx
rep movsw
add %rsi, %rsi
lea addresses_WC_ht+0x13db4, %rsi
nop
inc %rcx
mov (%rsi), %bp
nop
nop
nop
nop
xor %rax, %rax
lea addresses_A_ht+0x17320, %rsi
lea addresses_WC_ht+0x3bb4, %rdi
add $62195, %rbx
mov $74, %rcx
rep movsw
cmp $6891, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r9
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r8
push %r9
push %rcx
push %rsi
// Faulty Load
lea addresses_WC+0xf7b4, %rsi
nop
cmp %rcx, %rcx
mov (%rsi), %r8
lea oracles, %rsi
and $0xff, %r8
shlq $12, %r8
mov (%rsi,%r8,1), %r8
pop %rsi
pop %rcx
pop %r9
pop %r8
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 2, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
| 45.645669 | 2,999 | 0.657237 |
367dcda2bc1c154a240adfa74ad18ebf9ecd8604 | 2,954 | asm | Assembly | libsrc/graphics/aussie/w_pixladdr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/graphics/aussie/w_pixladdr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/graphics/aussie/w_pixladdr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; Aussie Byte graphics library
;
; by Stefano Bodrato - 2016
;
;
; $Id: w_pixladdr.asm,v 1.1 2016-11-17 09:39:03 stefano Exp $
;
SECTION code_clib
PUBLIC w_pixeladdress
EXTERN rdchar
EXTERN update
EXTERN row
INCLUDE "graphics/grafix.inc"
;
; ******************************************************************
; Get absolute pixel address in map of virtual (x,y) coordinate.
; in: (x,y) coordinate of pixel (hl,de)
;
; out: hl = address of pixel byte
; b = bit number of byte where pixel is to be placed
; a = "character" currently being edited
; fz = 1 if bit number is 0 of pixel position
;
; registers changed after return:
; ..bc..../ixiy same
; af..dehl/.... different
.w_pixeladdress
;****************************************************************
;* POINT Routine sets point at x,y on *
;* HL=X, DE=Y A=0 for off, 1 for on, 2 for complement *
;****************************************************************
;LD (xloc),HL
;LD (yloc),DE ; save locations
push de ; save locations
;LD (mode),A ; save operation code
; Determine the character position along row, remainder
; is the dot position within row.
;LD DE,8 ; determine byte along line
;call divhd ; divide by 8 bits / byte
ld a,h
and 7
xor 7
ld b,a
;LD (xleft),A ; bits left in X (pos in byte)
srl h
rr l
srl h
rr l
srl h
rr l
;LD (xleft),HL ; bits left in X (pos in byte)
;LD (xloc),BC ; character loc
;LD (xloc),HL ; character loc
;push hl ; character loc
; Now determine the character row, using remainder as row within
; the character.
;LD HL,(yloc)
ex (sp),hl
;LD DE,16 ; now for character
;call divhd
ld a,h
and 15
xor 15
;LD (yleft),A ; row number
ex af,af ; row number
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
;LD (yleft),HL ; row number
;LD (yloc),BC ; character row number
;LD (yloc),HL ; character row number
; Now we read the byte location, and either :- Or, And or Compl bit
;****************************************************************
;* XY$to$ABS converts Xloc and Yloc to absoloute character *
;* location, and saves this in CHRLOC for updating *
;****************************************************************
; take X,Y loc, and make abs character
; location for reading / writing
;LD HL,(yloc)
ADD HL,HL ; * 2
ADD HL,HL ; * 4
ADD HL,HL ; * 8
ADD HL,HL ; * 16
PUSH HL ; save * 16 value
ADD HL,HL ; * 32
ADD HL,HL ; * 64
POP DE ; restore * 16 value
ADD HL,DE ; HL = HL*64 + HL*16
;LD DE,(xloc)
pop de
ADD HL,DE
;LD (chrloc),HL ; absolute loc saved.
;LD HL,(chrloc) ; set by xy abs routine
LD (update),HL
;LD A,(yleft)
ex af,af
LD (row),A ; row from 0 to 15
call rdchar ; get current value at addr
;PUSH AF ; save it
;LD A,(xleft)
ret
| 23.632 | 68 | 0.531821 |
823afa05083c5a2ec9e2ab8435087a84b3c039d4 | 318 | asm | Assembly | Retired/Assemblearning_Modulo.asm | UlrichBerntien/Codewars-Katas | bbd025e67aa352d313564d3862db19fffa39f552 | [
"MIT"
] | null | null | null | Retired/Assemblearning_Modulo.asm | UlrichBerntien/Codewars-Katas | bbd025e67aa352d313564d3862db19fffa39f552 | [
"MIT"
] | null | null | null | Retired/Assemblearning_Modulo.asm | UlrichBerntien/Codewars-Katas | bbd025e67aa352d313564d3862db19fffa39f552 | [
"MIT"
] | null | null | null | section .text
global mod
; uint64_t mod(uint64_t a, uint64_t n)
; input:
; rdi - value a
; rsi - value n
; return:
; ryx - a mod n
mod:
mov rax,rdi
xor rdx,rdx ; rdx:rax = value a, unsigned expanded
div rsi ; rax = quotient, rdx = remainded
mov rax,rdx ; return remainder
ret | 21.2 | 57 | 0.600629 |
96e227d40822ede6a751dbad4d2ac8f0f7e6af74 | 4,638 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_974.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_974.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_974.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0xf0b3, %r10
nop
nop
nop
xor $3558, %r13
mov $0x6162636465666768, %r8
movq %r8, %xmm7
movups %xmm7, (%r10)
nop
nop
nop
nop
inc %rdx
lea addresses_A_ht+0x1cb69, %r14
nop
nop
nop
nop
xor $13858, %r10
movw $0x6162, (%r14)
nop
nop
nop
nop
nop
inc %r13
lea addresses_D_ht+0x1772f, %rsi
lea addresses_WT_ht+0x10859, %rdi
nop
nop
inc %r13
mov $118, %rcx
rep movsl
add $25280, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r15
push %rbp
push %rbx
// Faulty Load
lea addresses_UC+0xbed9, %rbx
nop
nop
nop
nop
cmp %r14, %r14
mov (%rbx), %bp
lea oracles, %r10
and $0xff, %rbp
shlq $12, %rbp
mov (%r10,%rbp,1), %rbp
pop %rbx
pop %rbp
pop %r15
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': True, 'same': False, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2}}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 47.814433 | 2,999 | 0.662786 |
be485b373b2caf20adabbd38bbef1f6c752beef0 | 829 | asm | Assembly | oeis/232/A232031.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/232/A232031.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/232/A232031.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A232031: Number of (n+1) X (1+1) 0..1 arrays with every element equal to some horizontal, vertical or antidiagonal neighbor, with top left element zero.
; Submitted by Jon Maiga
; 3,11,37,129,450,1568,5464,19041,66354,231230,805789,2808009,9785334,34099877,118831060,414101811,1443059667,5028766229,17524216333,61068290730,212810436816,741600615908,2584325664397,9005843571858,31383513137730,109365090455693,381114853454773,1328106902473578,4628179480302729,16128253879262840,56203648605464707,195858159241162299,682525414152679893,2378460732854596841,8288446613748725170,28883532244197224592,100653171067993364976,350755605664473139049,1222311166152354325666
add $0,1
lpb $0
sub $0,1
mov $2,$1
add $1,$3
max $2,2
add $5,2
add $5,$4
mov $3,$5
add $4,$1
add $5,$2
add $1,$5
lpe
mov $0,$1
add $0,$3
div $0,2
| 39.47619 | 481 | 0.788902 |
70d65c265bd7ca3bfffa4bb11c0e5ab37760830f | 561 | asm | Assembly | data/baseStats_original/honchkrow.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | data/baseStats_original/honchkrow.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 5 | 2019-04-03T19:53:11.000Z | 2022-03-11T22:49:34.000Z | data/baseStats_original/honchkrow.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 2 | 2019-12-09T19:46:02.000Z | 2020-12-05T21:36:30.000Z | ;HonchkrowBaseStats: ; 3860e (e:460e)
db DEX_HONCHKROW ; pokedex id
db 100 ; base hp
db 125 ; base attack
db 52 ; base defense
db 71 ; base speed
db 105 ; base special
db DARK ; species type 1
db FLYING ; species type 2
db 34 ; catch rate
db 177 ; base exp yield
INCBIN "pic/ymon/honchkrow.pic",0,1 ; sprite dimensions
dw HonchkrowPicFront
dw HonchkrowPicBack
db BITE
db 0
db 0
db 0
db 0 ; growth rate
; learnset
tmlearn 4,6
tmlearn 9,10,15
tmlearn 18
tmlearn 29,30,31,32
tmlearn 34,39
tmlearn 41,42,43,44,45
tmlearn 52
db BANK(HonchkrowPicFront)
| 19.344828 | 55 | 0.73262 |
c3a32020f4a58298793e46539d6626064adb5747 | 2,507 | asm | Assembly | Driver/Printer/PrintCom/Color/Correct/correctGamma22.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Printer/PrintCom/Color/Correct/correctGamma22.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Printer/PrintCom/Color/Correct/correctGamma22.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1993 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: DotMatrix printers
FILE: correctGamma22.asm
AUTHOR: Jim DeFrisco
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 6/21/93 Initial revision
DESCRIPTION:
Gamma correction table for printing
$Id: correctGamma22.asm,v 1.1 97/04/18 11:51:35 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
; A Gamma-correction table for GAMMA = 2.20
gamma22 segment resource
byte 0x00, 0x15, 0x1c, 0x22, 0x27, 0x2b, 0x2e, 0x32
byte 0x35, 0x38, 0x3b, 0x3d, 0x40, 0x42, 0x44, 0x46
byte 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x55
byte 0x57, 0x59, 0x5a, 0x5c, 0x5d, 0x5f, 0x60, 0x62
byte 0x63, 0x65, 0x66, 0x67, 0x69, 0x6a, 0x6b, 0x6d
byte 0x6e, 0x6f, 0x70, 0x72, 0x73, 0x74, 0x75, 0x76
byte 0x77, 0x78, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
byte 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87
byte 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f
byte 0x90, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96
byte 0x97, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9c
byte 0x9d, 0x9e, 0x9f, 0xa0, 0xa0, 0xa1, 0xa2, 0xa3
byte 0xa4, 0xa4, 0xa5, 0xa6, 0xa7, 0xa7, 0xa8, 0xa9
byte 0xaa, 0xaa, 0xab, 0xac, 0xad, 0xad, 0xae, 0xaf
byte 0xaf, 0xb0, 0xb1, 0xb2, 0xb2, 0xb3, 0xb4, 0xb4
byte 0xb5, 0xb6, 0xb6, 0xb7, 0xb8, 0xb8, 0xb9, 0xba
byte 0xba, 0xbb, 0xbc, 0xbc, 0xbd, 0xbe, 0xbe, 0xbf
byte 0xc0, 0xc0, 0xc1, 0xc2, 0xc2, 0xc3, 0xc3, 0xc4
byte 0xc5, 0xc5, 0xc6, 0xc7, 0xc7, 0xc8, 0xc8, 0xc9
byte 0xca, 0xca, 0xcb, 0xcb, 0xcc, 0xcd, 0xcd, 0xce
byte 0xce, 0xcf, 0xcf, 0xd0, 0xd1, 0xd1, 0xd2, 0xd2
byte 0xd3, 0xd4, 0xd4, 0xd5, 0xd5, 0xd6, 0xd6, 0xd7
byte 0xd7, 0xd8, 0xd9, 0xd9, 0xda, 0xda, 0xdb, 0xdb
byte 0xdc, 0xdc, 0xdd, 0xdd, 0xde, 0xdf, 0xdf, 0xe0
byte 0xe0, 0xe1, 0xe1, 0xe2, 0xe2, 0xe3, 0xe3, 0xe4
byte 0xe4, 0xe5, 0xe5, 0xe6, 0xe6, 0xe7, 0xe7, 0xe8
byte 0xe8, 0xe9, 0xe9, 0xea, 0xea, 0xeb, 0xeb, 0xec
byte 0xec, 0xed, 0xed, 0xee, 0xee, 0xef, 0xef, 0xf0
byte 0xf0, 0xf1, 0xf1, 0xf2, 0xf2, 0xf3, 0xf3, 0xf4
byte 0xf4, 0xf5, 0xf5, 0xf6, 0xf6, 0xf7, 0xf7, 0xf8
byte 0xf8, 0xf9, 0xf9, 0xf9, 0xfa, 0xfa, 0xfb, 0xfb
byte 0xfc, 0xfc, 0xfd, 0xfd, 0xfe, 0xfe, 0xff, 0xff
gamma22 ends
| 41.098361 | 79 | 0.590347 |
6025e979f165a4e2fdadc9864e1693d70943acde | 434 | asm | Assembly | 2_writeups/3_robot_exploitation/tutorial7/lab-06/vuln2.asm | araujorayza/robot_hacking_manual | d11feecc8931b1449b0ab30a51a55f71f51dd965 | [
"Apache-2.0"
] | 141 | 2021-11-14T15:27:04.000Z | 2022-03-30T00:44:48.000Z | 2_writeups/3_robot_exploitation/tutorial7/lab-06/vuln2.asm | araujorayza/robot_hacking_manual | d11feecc8931b1449b0ab30a51a55f71f51dd965 | [
"Apache-2.0"
] | 1 | 2021-11-17T06:38:44.000Z | 2021-11-17T06:38:45.000Z | 2_writeups/3_robot_exploitation/tutorial7/lab-06/vuln2.asm | araujorayza/robot_hacking_manual | d11feecc8931b1449b0ab30a51a55f71f51dd965 | [
"Apache-2.0"
] | 18 | 2021-11-15T09:55:48.000Z | 2022-03-08T10:25:58.000Z | extern printf, strcpy
section .data
fmstr: db "Here's your leek: %p",0xa,0
section .text
global main
main:
push ebp
mov ebp, esp
sub esp, 64
lea edi, [ebp - 64] ; buf
push edi
push fmstr
call printf
mov eax, [ebp + 8] ; argc
cmp eax, 2
jne away
mov ebx, dword [ebp + 12] ; argv
mov ebx, dword [ebx + 4] ; argv[1]
push ebx
push edi
call strcpy
leave
ret
away:
mov eax, 1
mov ebx, -1
int 0x80
| 14.965517 | 38 | 0.617512 |
2711b9f7cda878a7af0b8c787029cc8275b14787 | 229 | asm | Assembly | libmikeos/src.os/__lsrl.asm | mynameispyo/InpyoOS | b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d | [
"BSD-3-Clause",
"MIT"
] | null | null | null | libmikeos/src.os/__lsrl.asm | mynameispyo/InpyoOS | b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d | [
"BSD-3-Clause",
"MIT"
] | null | null | null | libmikeos/src.os/__lsrl.asm | mynameispyo/InpyoOS | b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d | [
"BSD-3-Clause",
"MIT"
] | null | null | null |
section .text
use16
; (signed) bx:ax >>= di;
global lsrl
lsrl:
mov cx, di
cmp cx, 32
jb lsrl_main
mov ax, 0xffff
mov bx, ax
ret
lsrl_main:
push bx
push ax
pop eax
sar eax, cl
push eax
pop ax
pop bx
ret
| 7.633333 | 25 | 0.624454 |
6a7222940578dea0454419c214cc7f6df1922ac7 | 18,486 | asm | Assembly | drivers/NVMSIM/test/bandwidth-1.9.3/routines-arm-rpi-32bit.asm | huqianshan/OperatingSystemAndCompiler | 2117263d39e9166cfc5c32014ca2b875c7f97de2 | [
"Unlicense"
] | 1 | 2020-03-22T10:37:05.000Z | 2020-03-22T10:37:05.000Z | code/NVMSIM/test/bandwidth-1.9.3/routines-arm-rpi-32bit.asm | huqianshan/linux-drivers-study | cb39f4e3821184abc46e46f9f0bfed7187ee11fa | [
"MIT"
] | null | null | null | code/NVMSIM/test/bandwidth-1.9.3/routines-arm-rpi-32bit.asm | huqianshan/linux-drivers-study | cb39f4e3821184abc46e46f9f0bfed7187ee11fa | [
"MIT"
] | null | null | null | @============================================================================
@ bandwidth, a benchmark to estimate memory transfer bandwidth.
@ ARM assembly module.
@ Copyright (C) 2010, 2016 by Zack T Smith.
@
@ This program is free software; you can redistribute it and/or modify
@ it under the terms of the GNU General Public License as published by
@ the Free Software Foundation; either version 2 of the License, or
@ (at your option) any later version.
@
@ This program is distributed in the hope that it will be useful,
@ but WITHOUT ANY WARRANTY; without even the implied warranty of
@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ GNU General Public License for more details.
@
@ You should have received a copy of the GNU General Public License
@ along with this program; if not, write to the Free Software
@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
@
@ The author may be reached at 1@zsmith.co.
@=============================================================================
@ Version 0.9 for the Raspberry pi.
@ Note, some instructions are not supported by the ARM CPU in the Raspberry pi 2.
.section code
.globl Writer
.globl WriterVector
.globl RandomWriter
.globl RandomWriterVector
.globl Reader
.globl ReaderVector
.globl RandomReader
.globl RandomReaderVector
.globl RegisterToRegister
.globl VectorToVector
.globl StackReader
.globl StackWriter
.text
@-----------------------------------------------------------------------------
@ Name: Writer
@ Purpose: Performs sequential write into memory, as fast as possible.
@ Params:
@ r0 = address
@ r1 = length, multiple of 256
@ r2 = count
@ r3 = value to write
@-----------------------------------------------------------------------------
Writer:
stmfd sp!,{r4, r5, r6, r7, r8, r9, r10, r11, r12, lr}
@ r4 = temp
@ r5 = temp
and r1, #0xffffff80
mov r4, r0
mov r5, r1
mov r6, r3
mov r7, r3
mov r8, r3
mov r9, r3
mov r10, r3
mov r11, r3
mov r12, r3
.L0:
mov r0, r4
mov r1, r5
.L1:
@ Does 64 transfers, 4 bytes each = 256 bytes total.
@ The "stmia" instruction automatically increments r0.
stmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
stmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
stmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
stmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
stmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
stmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
stmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
stmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
sub r1, #256
cmp r1, #0
bne .L1
sub r2, #1
cmp r2, #0
bne .L0
@ return.
ldmfd sp!,{r4, r5, r6, r7, r8, r9, r10, r11, r12, pc}
@-----------------------------------------------------------------------------
@ Name: WriterVector
@ Purpose: Performs sequential write into memory, as fast as possible.
@ Params:
@ r0 = address
@ r1 = length, multiple of 256
@ r2 = count
@ r3 = value to write
@-----------------------------------------------------------------------------
WriterVector:
stmfd sp!,{r4, r5, lr}
@ r4 = temp
@ r5 = temp
and r1, #0xffffff80
mov r4, r0
mov r5, r1
.L0v:
mov r0, r4
mov r1, r5
.L1v:
@ The vstmia instruction will automatically increment r0.
@ This does 32 transfers, 8 bytes each = 256 bytes total.
@ vstmia r0!, { d0 - d7 }
@ vstmia r0!, { d0 - d7 }
@ vstmia r0!, { d0 - d7 }
@ vstmia r0!, { d0 - d7 }
@ This does 16 transfers, 16 bytes each = 256 bytes total.
vstmia r0!, {q0,q1,q2,q3,q4,q5,q6,q7}
vstmia r0!, {q0,q1,q2,q3,q4,q5,q6,q7}
sub r1, #256
cmp r1, #0
bne .L1v
sub r2, #1
cmp r2, #0
bne .L0v
@ return.
ldmfd sp!,{r4, r5, pc}
@-----------------------------------------------------------------------------
@ Name: Reader
@ Purpose: Performs sequential reads from memory, as fast as possible.
@ Params:
@ r0 = address
@ r1 = length, multiple of 256
@ r2 = count
@-----------------------------------------------------------------------------
Reader:
stmfd sp!,{r4, r5, r6, r7, r8, r9, r10, r11, r12, lr}
@ r3 = temp
and r1, #0xffffff80
mov r4, r0
mov r5, r1
.L2:
mov r0, r4
mov r1, r5
.L3:
@ Does 64 transfers, 4 bytes each = 256 bytes total.
@ The "ldmia" instruction automatically increments r0.
ldmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
ldmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
ldmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
ldmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
ldmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
ldmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
ldmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
ldmia r0!, { r3, r6, r7, r8, r9, r10, r11, r12 }
sub r1, #256
cmp r1, #0
bne .L3
sub r2, #1
cmp r2, #0
bne .L2
@ return.
ldmfd sp!,{r4, r5, r6, r7, r8, r9, r10, r11, r12, pc}
@-----------------------------------------------------------------------------
@ Name: ReaderVector
@ Purpose: Performs sequential reads from memory, as fast as possible.
@ Params:
@ r0 = address
@ r1 = length, multiple of 256
@ r2 = count
@-----------------------------------------------------------------------------
ReaderVector:
stmfd sp!,{r4, r5, lr}
@ r3 = temp
and r1, #0xffffff80
mov r4, r0
mov r5, r1
.L2v:
mov r0, r4
mov r1, r5
.L3v:
@ NOTE: The vldmia instruction will automatically increment r0.
@ 16 bytes * 16 = 256
vldmia r0!, {q0,q1,q2,q3,q4,q5,q6,q7}
vldmia r0!, {q0,q1,q2,q3,q4,q5,q6,q7}
sub r1, #256
cmp r1, #0
bne .L3v
sub r2, #1
cmp r2, #0
bne .L2v
@ return.
ldmfd sp!,{r4, r5, pc}
@-----------------------------------------------------------------------------
@ Name: RandomWriter
@ Purpose: Performs random write into memory, as fast as possible.
@ Params:
@ r0 = pointer to array of chunk pointers
@ r1 = # of 256-byte chunks
@ r2 = # loops to do
@ r3 = value to write
@-----------------------------------------------------------------------------
RandomWriter:
stmfd sp!,{r4, r5, lr}
@ r4 = temp
@ r5 = temp
.L4:
mov r5, #0
.L5:
@ Get pointer to chunk in memory.
ldr r4, [r0, r5, LSL #2]
@ Does 64 transfers, 4 bytes each = 256 bytes total.
str r3, [r4, #160]
str r3, [r4, #232]
str r3, [r4, #224]
str r3, [r4, #96]
str r3, [r4, #164]
str r3, [r4, #76]
str r3, [r4, #100]
str r3, [r4, #220]
str r3, [r4, #248]
str r3, [r4, #104]
str r3, [r4, #4]
str r3, [r4, #136]
str r3, [r4, #112]
str r3, [r4, #200]
str r3, [r4, #12]
str r3, [r4, #128]
str r3, [r4, #148]
str r3, [r4, #196]
str r3, [r4, #216]
str r3, [r4]
str r3, [r4, #84]
str r3, [r4, #140]
str r3, [r4, #204]
str r3, [r4, #184]
str r3, [r4, #124]
str r3, [r4, #48]
str r3, [r4, #64]
str r3, [r4, #212]
str r3, [r4, #240]
str r3, [r4, #236]
str r3, [r4, #24]
str r3, [r4, #252]
str r3, [r4, #68]
str r3, [r4, #20]
str r3, [r4, #72]
str r3, [r4, #32]
str r3, [r4, #28]
str r3, [r4, #52]
str r3, [r4, #244]
str r3, [r4, #180]
str r3, [r4, #80]
str r3, [r4, #60]
str r3, [r4, #8]
str r3, [r4, #56]
str r3, [r4, #208]
str r3, [r4, #228]
str r3, [r4, #40]
str r3, [r4, #172]
str r3, [r4, #120]
str r3, [r4, #176]
str r3, [r4, #108]
str r3, [r4, #132]
str r3, [r4, #16]
str r3, [r4, #44]
str r3, [r4, #92]
str r3, [r4, #168]
str r3, [r4, #152]
str r3, [r4, #156]
str r3, [r4, #188]
str r3, [r4, #36]
str r3, [r4, #88]
str r3, [r4, #116]
str r3, [r4, #192]
str r3, [r4, #144]
add r5, #1
cmp r5, r1
bne .L5
sub r2, #1
cmp r2, #0
bne .L4
@ return.
ldmfd sp!,{r4, r5, pc}
@-----------------------------------------------------------------------------
@ Name: RandomWriterVector
@ Purpose: Performs random write into memory, as fast as possible.
@ Params:
@ r0 = pointer to array of chunk pointers
@ r1 = # of 256-byte chunks
@ r2 = # loops to do
@ r3 = value to write
@-----------------------------------------------------------------------------
RandomWriterVector:
stmfd sp!,{r4, r5, lr}
@ r4 = temp
@ r5 = temp
.L4v:
mov r5, #0
.L5v:
@ Get pointer to chunk in memory.
ldr r4, [r0, r5, LSL #2]
@ Does 16 transfers, 16 bytes each = 256 bytes total.
@ vstr q0, [r4, #48]
@ vstr q0, [r4, #128]
@ vstr q0, [r4, #16]
@ vstr q0, [r4, #208]
@ vstr q0, [r4, #80]
@ vstr q0, [r4, #0]
@ vstr q0, [r4, #32]
@ vstr q0, [r4, #224]
@ vstr q0, [r4, #112]
@ vstr q0, [r4, #96]
@ vstr q0, [r4, #192]
@ vstr q0, [r4, #160]
@ vstr q0, [r4, #96]
@ vstr q0, [r4, #144]
@ vstr q0, [r4, #64]
@ vstr q0, [r4, #240]
@ Does 32 transfers, 8 bytes each = 256 bytes total.
vstr d0, [r4, #56]
vstr d0, [r4, #136]
vstr d0, [r4, #200]
vstr d0, [r4, #80]
vstr d0, [r4, #16]
vstr d0, [r4, #64]
vstr d0, [r4, #192]
vstr d0, [r4, #240]
vstr d0, [r4, #24]
vstr d0, [r4, #104]
vstr d0, [r4, #192]
vstr d0, [r4, #168]
vstr d0, [r4, #96]
vstr d0, [r4, #16]
vstr d0, [r4, #152]
vstr d0, [r4, #56]
vstr d0, [r4, #184]
vstr d0, [r4, #136]
vstr d0, [r4, #192]
vstr d0, [r4, #160]
vstr d0, [r4, #120]
vstr d0, [r4, #136]
vstr d0, [r4, #104]
vstr d0, [r4, #40]
vstr d0, [r4, #192]
vstr d0, [r4, #168]
vstr d0, [r4, #88]
vstr d0, [r4, #176]
vstr d0, [r4, #64]
vstr d0, [r4, #56]
vstr d0, [r4, #200]
vstr d0, [r4, #144]
add r5, #1
cmp r5, r1
bne .L5v
sub r2, #1
cmp r2, #0
bne .L4v
@ return.
ldmfd sp!,{r4, r5, pc}
@-----------------------------------------------------------------------------
@ Name: RandomReader
@ Purpose: Performs random reads from memory, as fast as possible.
@ Params:
@ r0 = pointer to array of chunk pointers
@ r1 = # of 256-byte chunks
@ r2 = # loops to do
@-----------------------------------------------------------------------------
RandomReader:
stmfd sp!,{r4, r5, lr}
@ r3 = temp
@ r4 = temp
@ r5 = temp
.L6:
mov r5, #0
.L7:
@ Get pointer to chunk in memory.
ldr r4, [r0, r5, LSL #2]
@ Does 64 transfers, 4 bytes each = 256 bytes total.
ldr r3, [r4, #160]
ldr r3, [r4, #232]
ldr r3, [r4, #224]
ldr r3, [r4, #96]
ldr r3, [r4, #164]
ldr r3, [r4, #76]
ldr r3, [r4, #100]
ldr r3, [r4, #220]
ldr r3, [r4, #248]
ldr r3, [r4, #104]
ldr r3, [r4, #4]
ldr r3, [r4, #136]
ldr r3, [r4, #112]
ldr r3, [r4, #200]
ldr r3, [r4, #12]
ldr r3, [r4, #128]
ldr r3, [r4, #148]
ldr r3, [r4, #196]
ldr r3, [r4, #216]
ldr r3, [r4]
ldr r3, [r4, #84]
ldr r3, [r4, #140]
ldr r3, [r4, #204]
ldr r3, [r4, #184]
ldr r3, [r4, #124]
ldr r3, [r4, #48]
ldr r3, [r4, #64]
ldr r3, [r4, #212]
ldr r3, [r4, #240]
ldr r3, [r4, #236]
ldr r3, [r4, #24]
ldr r3, [r4, #252]
ldr r3, [r4, #68]
ldr r3, [r4, #20]
ldr r3, [r4, #72]
ldr r3, [r4, #32]
ldr r3, [r4, #28]
ldr r3, [r4, #52]
ldr r3, [r4, #244]
ldr r3, [r4, #180]
ldr r3, [r4, #80]
ldr r3, [r4, #60]
ldr r3, [r4, #8]
ldr r3, [r4, #56]
ldr r3, [r4, #208]
ldr r3, [r4, #228]
ldr r3, [r4, #40]
ldr r3, [r4, #172]
ldr r3, [r4, #120]
ldr r3, [r4, #176]
ldr r3, [r4, #108]
ldr r3, [r4, #132]
ldr r3, [r4, #16]
ldr r3, [r4, #44]
ldr r3, [r4, #92]
ldr r3, [r4, #168]
ldr r3, [r4, #152]
ldr r3, [r4, #156]
ldr r3, [r4, #188]
ldr r3, [r4, #36]
ldr r3, [r4, #88]
ldr r3, [r4, #116]
ldr r3, [r4, #192]
ldr r3, [r4, #144]
add r5, #1
cmp r5, r1
bne .L7
sub r2, #1
cmp r2, #0
bne .L6
@ return.
ldmfd sp!,{r4, r5, pc}
@-----------------------------------------------------------------------------
@ Name: RandomReaderVector
@ Purpose: Performs random reads from memory, as fast as possible.
@ Params:
@ r0 = pointer to array of chunk pointers
@ r1 = # of 256-byte chunks
@ r2 = # loops to do
@-----------------------------------------------------------------------------
RandomReaderVector:
stmfd sp!,{r4, r5, lr}
@ r3 = temp
@ r4 = temp
@ r5 = temp
.L6v:
mov r5, #0
.L7v:
@ Get pointer to chunk in memory.
ldr r4, [r0, r5, LSL #2]
@ Does 16 transfers, 16 bytes each = 256 bytes total.
@ vldr q0, [r4, #48]
@ vldr q0, [r4, #128]
@ vldr q0, [r4, #16]
@ vldr q0, [r4, #208]
@ vldr q0, [r4, #80]
@ vldr q0, [r4, #0]
@ vldr q0, [r4, #32]
@ vldr q0, [r4, #224]
@ vldr q0, [r4, #112]
@ vldr q0, [r4, #96]
@ vldr q0, [r4, #192]
@ vldr q0, [r4, #160]
@ vldr q0, [r4, #96]
@ vldr q0, [r4, #144]
@ vldr q0, [r4, #64]
@ vldr q0, [r4, #240]
@ Does 32 transfers, 8 bytes each = 256 bytes total.
vldr d0, [r4, #56]
vldr d0, [r4, #136]
vldr d0, [r4, #200]
vldr d0, [r4, #80]
vldr d0, [r4, #16]
vldr d0, [r4, #64]
vldr d0, [r4, #192]
vldr d0, [r4, #240]
vldr d0, [r4, #24]
vldr d0, [r4, #104]
vldr d0, [r4, #192]
vldr d0, [r4, #168]
vldr d0, [r4, #96]
vldr d0, [r4, #16]
vldr d0, [r4, #152]
vldr d0, [r4, #56]
vldr d0, [r4, #184]
vldr d0, [r4, #136]
vldr d0, [r4, #192]
vldr d0, [r4, #160]
vldr d0, [r4, #120]
vldr d0, [r4, #136]
vldr d0, [r4, #104]
vldr d0, [r4, #40]
vldr d0, [r4, #192]
vldr d0, [r4, #168]
vldr d0, [r4, #88]
vldr d0, [r4, #176]
vldr d0, [r4, #64]
vldr d0, [r4, #56]
vldr d0, [r4, #200]
vldr d0, [r4, #144]
add r5, #1
cmp r5, r1
bne .L7v
sub r2, #1
cmp r2, #0
bne .L6v
@ return.
ldmfd sp!,{r4, r5, pc}
@-----------------------------------------------------------------------------
@ Name: RegisterToRegister
@ Purpose: Performs register-to-register transfers.
@ Params:
@ r0 = count
@-----------------------------------------------------------------------------
RegisterToRegister:
stmfd sp!,{lr}
@ r1 = temp
.L8:
@ Does 64 transfers, 4 bytes each = 256 bytes total.
mov r1, r2
mov r1, r3
mov r1, r4
mov r1, r5
mov r1, r6
mov r1, r7
mov r1, r8
mov r1, r9
mov r2, r1
mov r2, r3
mov r2, r4
mov r2, r5
mov r2, r6
mov r2, r7
mov r2, r8
mov r2, r9
mov r1, r2
mov r1, r3
mov r1, r4
mov r1, r5
mov r1, r6
mov r1, r7
mov r1, r8
mov r1, r9
mov r1, r2
mov r1, r3
mov r1, r4
mov r1, r5
mov r1, r6
mov r1, r7
mov r1, r8
mov r1, r9
mov r1, r2
mov r1, r3
mov r1, r4
mov r1, r5
mov r1, r6
mov r1, r7
mov r1, r8
mov r1, r9
mov r1, r2
mov r1, r3
mov r1, r4
mov r1, r5
mov r1, r6
mov r1, r7
mov r1, r8
mov r1, r9
mov r1, r2
mov r1, r3
mov r1, r4
mov r1, r5
mov r1, r6
mov r1, r7
mov r1, r8
mov r1, r9
mov r1, r2
mov r1, r3
mov r1, r4
mov r1, r5
mov r1, r6
mov r1, r7
mov r1, r8
mov r1, r9
sub r0, #1
cmp r0, #0
bne .L8
@ return.
ldmfd sp!,{pc}
@-----------------------------------------------------------------------------
@ Name: VectorToVector
@ Purpose: Performs register-to-register transfers.
@ Params:
@ r0 = count
@-----------------------------------------------------------------------------
VectorToVector:
stmfd sp!,{lr}
@ r1 = temp
.L8v:
@ Does 16 transfers, 16 bytes each = 256 bytes total.
vmov q1, q2
vmov q1, q3
vmov q1, q4
vmov q1, q5
vmov q1, q6
vmov q1, q7
vmov q1, q8
vmov q1, q9
vmov q1, q10
vmov q1, q11
vmov q1, q12
vmov q1, q13
vmov q1, q14
vmov q1, q15
vmov q2, q13
vmov q2, q3
@ Does 32 transfers, 8 bytes each = 256 bytes total.
@ vmov d1, d2
@ vmov d1, d3
@ vmov d1, d4
@ vmov d1, d5
@ vmov d1, d6
@ vmov d1, d7
@ vmov d1, d8
@ vmov d1, d9
@ vmov d2, d1
@ vmov d2, d3
@ vmov d2, d4
@ vmov d2, d5
@ vmov d2, d6
@ vmov d2, d7
@ vmov d2, d8
@ vmov d2, d9
@ vmov d1, d2
@ vmov d1, d3
@ vmov d1, d4
@ vmov d1, d5
@ vmov d1, d6
@ vmov d1, d7
@ vmov d1, d8
@ vmov d1, d9
@ vmov d2, d1
@ vmov d2, d3
@ vmov d2, d4
@ vmov d2, d5
@ vmov d2, d6
@ vmov d2, d7
@ vmov d2, d8
@ vmov d2, d9
sub r0, #1
cmp r0, #0
bne .L8v
@ return.
ldmfd sp!,{pc}
@-----------------------------------------------------------------------------
@ Name: StackReader
@ Purpose: Performs stack-to-register transfers.
@ Params:
@ r0 = count
@-----------------------------------------------------------------------------
StackReader:
stmfd sp!,{lr}
@ r1 = temp
sub sp, #32
.L9:
@ Does 64 transfers, 4 bytes each = 256 bytes total.
ldr r1, [sp]
ldr r1, [sp, #4]
ldr r1, [sp, #8]
ldr r1, [sp, #12]
ldr r1, [sp, #16]
ldr r1, [sp, #20]
ldr r1, [sp, #24]
ldr r1, [sp, #28]
ldr r1, [sp]
ldr r1, [sp, #4]
ldr r1, [sp, #8]
ldr r1, [sp, #12]
ldr r1, [sp, #16]
ldr r1, [sp, #20]
ldr r1, [sp, #24]
ldr r1, [sp, #28]
ldr r1, [sp]
ldr r1, [sp, #4]
ldr r1, [sp, #8]
ldr r1, [sp, #12]
ldr r1, [sp, #16]
ldr r1, [sp, #20]
ldr r1, [sp, #24]
ldr r1, [sp, #28]
ldr r1, [sp]
ldr r1, [sp, #4]
ldr r1, [sp, #8]
ldr r1, [sp, #12]
ldr r1, [sp, #16]
ldr r1, [sp, #20]
ldr r1, [sp, #24]
ldr r1, [sp, #28]
ldr r1, [sp]
ldr r1, [sp, #4]
ldr r1, [sp, #8]
ldr r1, [sp, #12]
ldr r1, [sp, #16]
ldr r1, [sp, #20]
ldr r1, [sp, #24]
ldr r1, [sp, #28]
ldr r1, [sp]
ldr r1, [sp, #4]
ldr r1, [sp, #8]
ldr r1, [sp, #12]
ldr r1, [sp, #16]
ldr r1, [sp, #20]
ldr r1, [sp, #24]
ldr r1, [sp, #28]
ldr r1, [sp]
ldr r1, [sp, #4]
ldr r1, [sp, #8]
ldr r1, [sp, #12]
ldr r1, [sp, #16]
ldr r1, [sp, #20]
ldr r1, [sp, #24]
ldr r1, [sp, #28]
ldr r1, [sp]
ldr r1, [sp, #4]
ldr r1, [sp, #8]
ldr r1, [sp, #12]
ldr r1, [sp, #16]
ldr r1, [sp, #20]
ldr r1, [sp, #24]
ldr r1, [sp, #28]
sub r0, #1
cmp r0, #0
bne .L9
add sp, #32
@ return.
ldmfd sp!,{pc}
@-----------------------------------------------------------------------------
@ Name: StackWriter
@ Purpose: Performs register-to-stack transfers.
@ Params:
@ r0 = count
@-----------------------------------------------------------------------------
StackWriter:
stmfd sp!,{lr}
@ r1 = temp
sub sp, #32
.L10:
@ Does 64 transfers, 4 bytes each = 256 bytes total.
str r1, [sp]
str r1, [sp, #4]
str r1, [sp, #8]
str r1, [sp, #12]
str r1, [sp, #16]
str r1, [sp, #20]
str r1, [sp, #24]
str r1, [sp, #28]
str r1, [sp]
str r1, [sp, #4]
str r1, [sp, #8]
str r1, [sp, #12]
str r1, [sp, #16]
str r1, [sp, #20]
str r1, [sp, #24]
str r1, [sp, #28]
str r1, [sp]
str r1, [sp, #4]
str r1, [sp, #8]
str r1, [sp, #12]
str r1, [sp, #16]
str r1, [sp, #20]
str r1, [sp, #24]
str r1, [sp, #28]
str r1, [sp]
str r1, [sp, #4]
str r1, [sp, #8]
str r1, [sp, #12]
str r1, [sp, #16]
str r1, [sp, #20]
str r1, [sp, #24]
str r1, [sp, #28]
str r1, [sp]
str r1, [sp, #4]
str r1, [sp, #8]
str r1, [sp, #12]
str r1, [sp, #16]
str r1, [sp, #20]
str r1, [sp, #24]
str r1, [sp, #28]
str r1, [sp]
str r1, [sp, #4]
str r1, [sp, #8]
str r1, [sp, #12]
str r1, [sp, #16]
str r1, [sp, #20]
str r1, [sp, #24]
str r1, [sp, #28]
str r1, [sp]
str r1, [sp, #4]
str r1, [sp, #8]
str r1, [sp, #12]
str r1, [sp, #16]
str r1, [sp, #20]
str r1, [sp, #24]
str r1, [sp, #28]
str r1, [sp]
str r1, [sp, #4]
str r1, [sp, #8]
str r1, [sp, #12]
str r1, [sp, #16]
str r1, [sp, #20]
str r1, [sp, #24]
str r1, [sp, #28]
sub r0, #1
cmp r0, #0
bne .L10
add sp, #32
@ return.
ldmfd sp!,{pc}
| 19.541226 | 81 | 0.505842 |
9ede9073965fe3a68894372cdbcf3e8563e24be0 | 394 | asm | Assembly | programs/oeis/324/A324904.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/324/A324904.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/324/A324904.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A324904: The 2-adic valuation of A318466(n), where A318466(n) = 2*n OR sigma(n).
; 0,0,1,0,1,2,1,0,0,1,1,2,1,2,1,0,1,0,1,1,1,2,1,2,0,1,1,3,1,2,1,0,1,1,1,0,1,2,1,1,1,2,1,2,1,2,1,2,0,0,1,1,1,2,1,3,1,1,1,3,1,2,1,0,1,2,1,1,1,2,1,0,1,1,1,2,1,2,1,1,0,1,1,3,1,2,1,2,1,1,1,3,1,2,1,2,1,0,1,0
mul $0,2
add $0,1
seq $0,324902 ; The 2-adic valuation of A318456(n), where A318456(n) = n OR (sigma(n)-n).
| 56.285714 | 201 | 0.576142 |
b0c802326619ee4d7b79d7b4bf39749e3a28f5fc | 254 | asm | Assembly | programs/oeis/105/A105279.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/105/A105279.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/105/A105279.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A105279: a(0)=0; a(n) = 10*a(n-1) + 10.
; 0,10,110,1110,11110,111110,1111110,11111110,111111110,1111111110,11111111110,111111111110,1111111111110,11111111111110,111111111111110,1111111111111110,11111111111111110
mov $1,10
pow $1,$0
div $1,9
mul $1,10
| 31.75 | 171 | 0.76378 |
7feaf03e1fd8cb9fa3f8038cc501b952a5ae4db3 | 144 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver0/chip/Gdefchr.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver0/chip/Gdefchr.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver0/chip/Gdefchr.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: Gdefchr.asm
Type: file
Size: 7232
Last-Modified: '2016-05-13T04:50:33Z'
SHA-1: 2E75E1ABE4F81FE9F42FD8D9BC62C397B4973D00
Description: null
| 20.571429 | 47 | 0.8125 |
73d23d38b72913d0e46dfd735802ae25913a8fa2 | 1,639 | asm | Assembly | dv3/atari/setdma.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | dv3/atari/setdma.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | dv3/atari/setdma.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; Atari DMA set address and count 1990 Tony Tebby QJUMP
section adma
xdef at_seta
xdef at_setra
xdef at_setrf
xdef at_setwa
xdef at_setwf
include 'dev8_keys_atari'
include 'dev8_smsq_smsq_base_keys'
;+++
; This routine sets DMA address
;
; d0 s
; a1 c p address
;
; status return arbitrary
;
;---
at_seta
move.l a1,d0
move.b d0,dma_low ; set dma address
ror.w #8,d0
move.b d0,dma_mid
swap d0
move.b d0,dma_high
rts
;+++
; This routine sets DMA address for write ACSI and count
;
; d2 c p word number of sectors
;
; status return arbitrary
;
;---
at_setwa
move.w #dma.awct,dma_mode
move.w #dma.arct,dma_mode ; toggle to clear internal status
move.w #dma.awct,dma_mode
move.w d2,dma_scnt
rts
;+++
; This routine sets DMA address for write floppy and count
;
; d0 s smashed
; d2 c p word number of sectors
;
; status return arbitrary
;
;---
at_setwf
move.w #dma.fwct,dma_mode
move.w #dma.frct,dma_mode ; toggle to clear internal status
move.w #dma.fwct,dma_mode
move.w d2,dma_scnt
rts
;+++
; This routine sets DMA address for read ACSI and count
;
; d0 s smashed
; d2 c p word number of sectors
;
; status return arbitrary
;
;---
at_setra
move.w #dma.arct,dma_mode
move.w #dma.awct,dma_mode ; toggle to clear internal status
move.w #dma.arct,dma_mode
move.w d2,dma_scnt
jmp sms.cinvd
;+++
; This routine sets DMA address for read floppy and count
;
; d2 c p word number of sectors
;
; status return arbitrary
;
;---
at_setrf
move.w #dma.frct,dma_mode
move.w #dma.fwct,dma_mode ; toggle to clear internal status
move.w #dma.frct,dma_mode
move.w d2,dma_scnt
jmp sms.cinvd
end
| 17.252632 | 61 | 0.710189 |
f0e04ef5b61e17f90f4a712f5f244f86a88728d8 | 1,703 | asm | Assembly | Engine Hacks/FE8-Item Range Fix/Range Write.asm | sme23/Christmas2 | f3f3daeda1afe2b78bfed38cbf60d8bc17ca9f79 | [
"CC0-1.0"
] | 3 | 2020-06-15T14:22:38.000Z | 2020-06-28T19:44:52.000Z | Wizardry/Necessary/ItemRangeFix/RangeDisplay/RangeWrite.asm | sme23/WhatHeck | 746a2be83358aaa4e855182176b47c4808f2587a | [
"CC0-1.0"
] | null | null | null | Wizardry/Necessary/ItemRangeFix/RangeDisplay/RangeWrite.asm | sme23/WhatHeck | 746a2be83358aaa4e855182176b47c4808f2587a | [
"CC0-1.0"
] | null | null | null | .thumb
.org 0x0
@r0 = char data pointer, r1 = item id
push {r4-r7,r14}
mov r7,r8
push {r7}
mov r7,r0
mov r6,#0xFF
and r6,r1 @item id
mov r8,r6
lsl r1,r6,#0x3
add r1,r1,r6
lsl r1,r1,#0x2
ldr r6,Item_Table
add r1,r1,r6
ldrb r6,[r1,#0x19] @range byte
mov r4,#0x10
ldsb r4,[r0,r4] @x coord
mov r5,#0x11
ldsb r5,[r0,r5] @y coord
ldr r1,Pointer1
str r0,[r1]
ldr r0,Pointer2 @points to beginning of table of row pointers for range map
ldr r0,[r0]
mov r1,#0x0
ldr r3,Function1
bl goto_r3 @zeroes out the range map
mov r0,r4
mov r1,r5
ldr r3,Function2
bl goto_r3 @stores coordinates at 204DCF4 and 0x00000000 at 203DFF8
mov r3,#0x1
mov r0,r6
mov r1,r7
bl Get_Range_Nibble @returns max range nibble
mov r2,r0
mov r0,r4
mov r1,r5
push {r4}
ldr r4,Function4
bl goto_r4 @fills in the range map
pop {r4}
mov r3,#0x1
neg r3,r3
mov r0,r6
bl Get_Range_Nibble @returns min range nibble
mov r2,r0
mov r0,r4
mov r1,r5
push {r4}
ldr r4,Function4
bl goto_r4 @clears the range map of unreacheable tiles
pop {r4}
mov r0,r8
pop {r7}
mov r8,r7
pop {r4-r7}
pop {r1}
bx r1
Get_Range_Nibble:
push {r14}
cmp r3,#0x1
beq MaxNibble
cmp r0,#0xFF
beq ReturnZero
lsr r0,r0,#0x4
sub r0,#0x1
b GoBack
ReturnZero:
mov r0,#0x0
b GoBack
MaxNibble:
cmp r0,#0xFF
beq GoBack
mov r2,#0xF
and r0,r2
cmp r0,#0x0
bne GoBack
mov r0,r1
ldr r3,Function3
bl goto_r3 @given char data, returns mag/2 range
mov r3,#0x1
GoBack:
pop {r1}
bx r1
goto_r3:
bx r3
goto_r4:
bx r4
.align
Pointer1:
.long 0x02033F3C
Pointer2:
.long 0x0202E4E4
Function1:
.long 0x080197E4+1
Function2:
.long 0x0804F8A4+1
Function3:
.long 0x08018A1C+1
Function4:
.long 0x0801AABC+1
Item_Table:
| 15.623853 | 77 | 0.703464 |
aa392d3f2279374704fc374c76e0460e96e60132 | 414 | asm | Assembly | oeis/011/A011676.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/011/A011676.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/011/A011676.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A011676: A binary m-sequence: expansion of reciprocal of x^7+x^6+x^4+x^2+1.
; Submitted by Jamie Morken(s4)
; 0,0,0,0,0,0,1,0,1,0,0,0,0,1,1,0,1,1,0,0,1,0,0,0,0,0,1,1,1,1,0,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,0,0,0,1,0,0,1,1,1,0,1,1,1,1,0,1,0,0,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,0,1,1,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0
lpb $0
sub $0,1
mod $1,2
add $2,5
mov $3,$0
bin $3,$2
add $1,$3
add $2,1
lpe
mov $0,$1
| 27.6 | 201 | 0.545894 |
e87bdba41287ff463613f78aa91f7defe222b3f1 | 851 | asm | Assembly | smsq/ioa/cnam.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/ioa/cnam.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/ioa/cnam.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | * Fetch Channel Name V2.00 1996 Tony Tebby
* SMSQ compatible version +
*
section ioa
*
xdef ioa_cnam
*
xref io_ckchn
xref sms_rte
*
include dev8_keys_err
include dev8_keys_sys
include dev8_keys_chn
include dev8_keys_iod
include 'dev8_mac_assert'
*
* d2 c p max length of string
* a0 c p channel ID
* a1 c p pointer to buffer for name >=d2+2
*
* all other registers preserved
*
reglist reg d1-d6/a0-a4
ioa_cnam
movem.l reglist,-(sp)
bsr.l io_ckchn ; check the channel ID (a0,a3)
bne.s icn_exit
cmp.l #iod.sqio,iod_sqio(a3) ; upgraded device
bne.s icn_nimp ; ... no
assert iod..scn,18
btst #iod..scn,iod_sqfb+1(a3) ; channel name supported?
beq.s icn_nimp ; ... no
move.l iod_cnam(a3),a4
jsr (a4) ; fetch name
icn_exit
movem.l (sp)+,reglist
bra.l sms_rte
icn_nimp
moveq #err.nimp,d0
bra.s icn_exit
end
| 17.367347 | 56 | 0.700353 |
b3646cb0674e51129b097e4ae87a701624fa4cf9 | 7,129 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i7-7700_9_0x48_notsx.log_21829_1666.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i7-7700_9_0x48_notsx.log_21829_1666.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i7-7700_9_0x48_notsx.log_21829_1666.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x559d, %rdi
inc %r13
movups (%rdi), %xmm5
vpextrq $0, %xmm5, %r8
nop
nop
nop
nop
sub $12185, %rax
lea addresses_WT_ht+0x13a5, %rsi
lea addresses_normal_ht+0x103ad, %rdi
nop
nop
nop
nop
nop
xor $16770, %rdx
mov $62, %rcx
rep movsw
nop
nop
nop
nop
cmp $17193, %rax
lea addresses_D_ht+0x1c3e5, %rcx
nop
nop
nop
and $48445, %rdx
mov (%rcx), %r13
nop
nop
nop
nop
nop
xor %rax, %rax
lea addresses_WC_ht+0x14896, %r13
nop
nop
nop
nop
nop
xor $53280, %rdx
vmovups (%r13), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $0, %xmm1, %rax
and %rcx, %rcx
lea addresses_normal_ht+0x1b3e5, %rsi
lea addresses_WT_ht+0x7665, %rdi
nop
nop
sub $49969, %r13
mov $110, %rcx
rep movsb
nop
nop
nop
nop
dec %rax
lea addresses_WC_ht+0xb235, %r13
nop
nop
nop
sub %rcx, %rcx
movw $0x6162, (%r13)
nop
nop
sub $52598, %rax
lea addresses_D_ht+0x9be5, %rdi
nop
lfence
movb (%rdi), %r8b
cmp $8237, %rcx
lea addresses_normal_ht+0xfe5, %rsi
nop
nop
nop
add %rcx, %rcx
movl $0x61626364, (%rsi)
nop
nop
nop
dec %rsi
lea addresses_A_ht+0x95af, %rsi
lea addresses_UC_ht+0x13d1, %rdi
nop
nop
and %rbp, %rbp
mov $126, %rcx
rep movsq
nop
nop
inc %rsi
lea addresses_D_ht+0x52c5, %rsi
lea addresses_D_ht+0x155e5, %rdi
nop
nop
nop
nop
nop
cmp $2833, %rax
mov $17, %rcx
rep movsl
add $31373, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
// Load
lea addresses_normal+0x17675, %r9
xor %rbx, %rbx
mov (%r9), %rdx
nop
nop
nop
cmp $53010, %rdx
// Store
lea addresses_RW+0x91d5, %rcx
nop
nop
nop
nop
xor %rax, %rax
mov $0x5152535455565758, %r12
movq %r12, %xmm0
vmovups %ymm0, (%rcx)
nop
nop
nop
xor $9150, %r9
// Faulty Load
lea addresses_RW+0x10be5, %rdx
nop
nop
sub $6284, %rax
vmovntdqa (%rdx), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %rcx
lea oracles, %r12
and $0xff, %rcx
shlq $12, %rcx
mov (%r12,%rcx,1), %rcx
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_RW', 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal', 'congruent': 4}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_RW', 'congruent': 4}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_RW', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC_ht', 'congruent': 3}}
{'dst': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC_ht', 'congruent': 0}}
{'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WC_ht', 'congruent': 4}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D_ht', 'congruent': 2}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 9}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}}
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}}
{'48': 4782, '49': 15753, '72': 19, '45': 2, '08': 10, '44': 1262, '00': 1}
49 49 49 49 48 49 48 49 49 49 49 49 48 49 44 48 49 49 49 49 48 49 48 49 48 49 49 49 48 49 49 49 48 49 49 48 49 49 49 48 49 49 48 49 49 48 49 49 49 49 49 49 49 48 49 49 49 49 49 49 48 49 44 49 49 48 49 49 49 44 49 49 49 49 49 48 49 49 49 48 49 49 48 49 49 49 44 49 48 48 49 48 49 49 49 48 49 49 49 48 48 48 49 49 49 49 48 49 49 49 49 49 49 49 48 48 48 49 49 49 49 49 49 48 44 49 49 49 49 48 49 44 49 49 48 49 44 48 49 49 44 49 49 48 49 49 49 49 48 49 48 48 49 49 49 48 48 44 48 49 49 48 49 48 49 49 49 49 49 49 49 48 49 49 49 49 48 49 49 49 48 49 49 48 44 48 49 49 49 49 49 49 49 49 48 48 49 48 48 49 48 49 49 48 48 49 49 49 49 44 49 49 48 49 48 48 48 49 48 49 49 49 49 49 49 49 49 49 48 49 49 48 49 49 49 49 49 48 49 49 48 48 49 49 49 49 49 49 48 49 48 44 48 49 49 48 48 49 48 48 49 49 48 49 48 49 49 48 49 48 49 48 49 49 49 49 49 44 49 49 49 49 49 44 49 49 44 49 49 48 44 48 49 48 49 49 49 49 49 49 49 48 49 49 49 44 49 49 48 49 49 49 49 49 49 44 49 49 48 49 48 49 49 48 49 49 44 49 48 49 49 49 49 49 49 48 49 49 49 49 49 49 49 49 48 49 49 49 48 49 48 49 49 49 48 49 49 49 48 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 48 49 49 49 44 49 48 49 48 49 49 44 49 48 49 49 48 49 49 49 49 49 49 49 49 49 49 49 49 49 44 44 49 49 49 49 49 49 49 48 49 49 49 49 49 49 49 49 48 44 49 49 49 49 48 49 49 48 49 49 48 44 49 49 49 48 48 49 49 44 49 49 49 48 49 44 44 49 49 49 49 49 49 49 48 49 44 49 49 49 44 48 44 49 49 49 49 49 49 49 49 49 49 49 49 49 44 49 48 49 49 49 49 49 48 49 49 44 49 49 49 44 48 49 44 49 49 49 49 48 49 48 49 49 49 49 49 49 49 49 49 48 49 49 48 48 49 49 49 49 48 49 49 48 49 49 49 49 48 49 49 48 49 49 49 49 49 49 48 49 49 49 48 48 48 49 48 49 49 49 49 49 49 49 48 48 49 48 48 49 49 49 48 49 44 48 48 48 48 49 48 49 49 49 48 49 49 49 48 49 49 49 49 49 49 49 49 49 49 44 49 44 48 49 49 49 49 49 49 49 49 49 44 49 49 49 49 49 49 49 44 49 49 49 49 48 49 49 49 49 48 49 49 49 49 48 49 49 49 44 49 49 49 49 44 49 49 49 48 49 44 49 49 48 48 48 48 48 49 49 48 49 49 49 49 48 49 49 48 49 49 48 49 49 49 49 48 48 49 49 49 44 44 49 49 49 49 49 48 49 49 48 48 48 49 49 48 49 49 49 49 49 44 49 49 49 49 49 44 49 49 48 44 49 49 44 49 48 48 49 49 48 49 49 49 49 49 48 49 48 44 49 48 48 49 49 49 48 48 49 49 49 49 49 49 49 49 49 44 49 49 49 49 48 49 49 49 48 49 48 48 49 49 49 49 49 48 49 49 49 49 49 49 49 49 49 44 48 49 48 49 49 49 49 49 48 49 49 48 49 49 49 49 49 49 49 49 48 44 48 48 49 48 49 49 49 49 44 49 48 49 49 48 49 49 49 49 49 49 49 49 49 49 49 49 48 49 48 49 49 49 49 44 48 49 44 49 49 49 49 48 49 44 49 49 49 49 49 49 48 49 49 49 49 49 49 49 49 49 49 49 49 49 44 49 49 49 49 48 44 48 49 49 49 49 49 48 49 49 48 49 49 44 48 48 49 49 49 49 49 48 48 49 44 49 49 48 49 49 48 49 49 48 49 48 49 48 48 49 49 49 49 48 49 49 49 48 49 48 48 49 49 49 48 49 49 48 49 49 49 49 49 48 48 49 49 48 49 48 49 49 49 49 49 49 49 48 49 49 49 48 48 49 49 49 48 48 48 49 49 49 49 49 48 49 48 49 49 44 49 44 49 48 49 48 49 49 49 49 49 48 49 49 49 49 49 49 49 48 44 49 49 49 48 49 48 49 44 48 49 49 49 44 49 49
*/
| 35.292079 | 2,999 | 0.656474 |
8e5a91e8df12cc98aae352dddecd01cde9e9b382 | 169 | asm | Assembly | data/wildPokemon/route2.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | null | null | null | data/wildPokemon/route2.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | null | null | null | data/wildPokemon/route2.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | null | null | null | Route2Mons:
db $19
db 3,RATTATA
db 5,TOGEPI
db 4,PIDGEY
db 4,NIDORAN_M
db 4,NIDORAN_F
db 5,SANDSHREW
db 6,ZUBAT
db 6,MANKEY
db 7,RATTATA
db 7,PIDGEY
db $00
| 11.266667 | 15 | 0.698225 |
5bde11fccf80075f207624958cc22b4dc34d5b6d | 451 | asm | Assembly | tests/hello2.asm | paul-nameless/lc3-asm | 38ac008c4665515dc82bf0d972920cef62253cee | [
"Unlicense"
] | null | null | null | tests/hello2.asm | paul-nameless/lc3-asm | 38ac008c4665515dc82bf0d972920cef62253cee | [
"Unlicense"
] | null | null | null | tests/hello2.asm | paul-nameless/lc3-asm | 38ac008c4665515dc82bf0d972920cef62253cee | [
"Unlicense"
] | null | null | null | ; Print "Hello World!" 5 times
; Use Loops to achieve the aforementioned output
; Execution Phase
.ORIG x3000
LEA R0, HELLO ; R0 = "Hello....!"
LD R1, COUNTER ; R1 = 5
LOOP TRAP x22 ; Print Hello World
ADD R1, R1, #-1 ; Decrement Counter
BRp LOOP ; Returns to LOOP label until Counter is 0 (nonpositive)
HALT
; Non-Exec. phase
HELLO .STRINGZ "Hello, World!\n" ; \n = new line
COUNTER .fill #5 ; Counter = 5
.END ; End Program
| 20.5 | 68 | 0.656319 |
21caf493cf0ebcd3b02bebdcc346ff2b40acafa0 | 944 | asm | Assembly | src/LKS/old/MC_DMA.asm | Kannagi/LKS | 363ccbfbe93a78e227349967053075ba67f4e50c | [
"MIT"
] | 6 | 2019-04-18T12:08:23.000Z | 2021-07-07T08:07:28.000Z | src/LKS/old/MC_DMA.asm | Kannagi/LKS | 363ccbfbe93a78e227349967053075ba67f4e50c | [
"MIT"
] | null | null | null | src/LKS/old/MC_DMA.asm | Kannagi/LKS | 363ccbfbe93a78e227349967053075ba67f4e50c | [
"MIT"
] | null | null | null |
.MACRO LKS_DMA_PORTX
lda #1
sta LKS_DMA.Enable,x
lda \1
sta LKS_DMA.Bank,x
rep #$20
lda #\2
sta LKS_DMA.SrcR,x
lda \3
sta LKS_DMA.Src1,x
lda #\4
sta LKS_DMA.Dst1,x
sep #$20
lda #\5
sta LKS_DMA.Type1,x
.ENDM
.MACRO LKS_DMA_VRAM2
lda LKS_DMA_SEND.Enable+\1
cmp #0
beq +
rep #$20
lda LKS_DMA_SEND.dma+\1
tax
stx MEM_TEMPFUNC+0
lda LKS_DMA.Bank,x
sta MEM_TEMPFUNC+2
lda LKS_DMA.SrcR,x
sta MEM_TEMPFUNC+4
lda LKS_DMA.Func,x
sta 0
sep #$20
ldx #0
;jsr (0,x)
lda #0
sta LKS_DMA.Enable+$20*\1
+:
.ENDM
.MACRO LKS_DMA_VRAM
lda LKS_DMA.Enable+$20*\1
cmp #0
beq +
ldx #$20*\1
stx MEM_TEMPFUNC
lda LKS_DMA.Bank+$20*\1
sta MEM_TEMPFUNC+2
rep #$20
lda LKS_DMA.SrcR+$20*\1
sta MEM_TEMPFUNC+4
lda LKS_DMA.Func+$20*\1
sta 0
sep #$20
ldx #0
jsr (0,x)
lda #0
sta LKS_DMA.Enable+$20*\1
+:
.ENDM
| 9.731959 | 27 | 0.591102 |
57d77fefc98c217ca807cd86d571132d4a5f361e | 728 | asm | Assembly | oeis/249/A249183.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/249/A249183.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/249/A249183.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A249183: a(n) = row n of triangle A249133, concatenated.
; Submitted by Christian Krause
; 1,111,11011,1110111,110101011,11100000111,1101100011011,111011101110111,11010101010101011,1110000000000000111,110110000000000011011,11101110000000001110111,1101010110000000110101011,111000001110000011100000111,11011000110110001101100011011,1110111011101110111011101110111,110101010101010101010101010101011,11100000000000000000000000000000111,1101100000000000000000000000000011011,111011100000000000000000000000001110111,11010101100000000000000000000000110101011
seq $0,249184 ; A249183 seen as binary numbers.
seq $0,7088 ; The binary numbers (or binary words, or binary vectors, or binary expansion of n): numbers written in base 2.
| 104 | 463 | 0.876374 |
f1755c9240bf29c015b9cb59ddf0f33e70ab140f | 362 | asm | Assembly | programs/oeis/170/A170881.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/170/A170881.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/170/A170881.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A170881: a(0)=0; thereafter a(n) = (3*n+1)*2^(n-2)+1.
; 1,3,8,21,53,129,305,705,1601,3585,7937,17409,37889,81921,176129,376833,802817,1703937,3604481,7602177,15990785,33554433,70254593,146800641,306184193,637534209,1325400065,2751463425,5704253441,11811160065,24427626497,50465865729
mov $1,$0
mul $0,3
add $0,1
mov $2,2
pow $2,$1
mul $0,$2
div $0,4
add $0,1
| 30.166667 | 229 | 0.732044 |
e4cae75c14a4c1e2eecddd22aa3a7e05e51af7b4 | 685 | asm | Assembly | oeis/002/A002328.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/002/A002328.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/002/A002328.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A002328: Numbers n such that n^2 - n - 1 is prime.
; Submitted by Jon Maiga
; 3,4,5,6,7,9,10,11,12,14,16,17,20,21,22,25,27,29,31,32,36,39,40,42,45,46,47,49,51,54,55,56,57,60,61,65,66,67,69,71,77,84,86,87,90,94,95,97,101,102,104,115,116,121,126,127,131,132,135,139,141,142,145,146,149,150,154,155,156,159,160,161,164,165,170,172,175,177,181,182,185,187,189,192,194,196,197,200,204,207,210,216,219,220,221,226,231,232,234,237
mov $2,$0
add $2,2
pow $2,2
mov $5,2
lpb $2
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $5,2
add $1,$5
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
lpe
mov $0,$5
add $0,2
div $0,2
| 28.541667 | 347 | 0.643796 |
5be781d94a54b998af2b86574aea6f0912ece178 | 8,058 | asm | Assembly | src/camera/pixy/src/misc/gcc/m0/Release/qqueue.asm | wowHollis/SmartCart | f377f34fc452f90866e9d4c8a4e031314e633adb | [
"MIT"
] | null | null | null | src/camera/pixy/src/misc/gcc/m0/Release/qqueue.asm | wowHollis/SmartCart | f377f34fc452f90866e9d4c8a4e031314e633adb | [
"MIT"
] | null | null | null | src/camera/pixy/src/misc/gcc/m0/Release/qqueue.asm | wowHollis/SmartCart | f377f34fc452f90866e9d4c8a4e031314e633adb | [
"MIT"
] | null | null | null | 1 .syntax unified
2 .cpu cortex-m0
3 .fpu softvfp
4 .eabi_attribute 20, 1
5 .eabi_attribute 21, 1
6 .eabi_attribute 23, 3
7 .eabi_attribute 24, 1
8 .eabi_attribute 25, 1
9 .eabi_attribute 26, 1
10 .eabi_attribute 30, 6
11 .eabi_attribute 34, 0
12 .eabi_attribute 18, 4
13 .thumb
14 .syntax unified
15 .file "qqueue.c"
16 .text
17 .Ltext0:
18 .cfi_sections .debug_frame
19 .global g_qqueue
20 .section .data.g_qqueue,"aw",%progbits
21 .align 2
24 g_qqueue:
25 0000 00C00020 .word 536920064
26 .section .text.qq_enqueue,"ax",%progbits
27 .align 2
28 .global qq_enqueue
29 .code 16
30 .thumb_func
32 qq_enqueue:
33 .LFB0:
34 .file 1 "../src/qqueue.c"
1:../src/qqueue.c **** //
2:../src/qqueue.c **** // begin license header
3:../src/qqueue.c **** //
4:../src/qqueue.c **** // This file is part of Pixy CMUcam5 or "Pixy" for short
5:../src/qqueue.c **** //
6:../src/qqueue.c **** // All Pixy source code is provided under the terms of the
7:../src/qqueue.c **** // GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
8:../src/qqueue.c **** // Those wishing to use Pixy source code, software and/or
9:../src/qqueue.c **** // technologies under different licensing terms should contact us at
10:../src/qqueue.c **** // cmucam@cs.cmu.edu. Such licensing terms are available for
11:../src/qqueue.c **** // all portions of the Pixy codebase presented here.
12:../src/qqueue.c **** //
13:../src/qqueue.c **** // end license header
14:../src/qqueue.c **** //
15:../src/qqueue.c ****
16:../src/qqueue.c **** #include "qqueue.h"
17:../src/qqueue.c **** #include "pixyvals.h"
18:../src/qqueue.c ****
19:../src/qqueue.c **** struct QqueueFields *g_qqueue = (struct QqueueFields *)QQ_LOC;
20:../src/qqueue.c ****
21:../src/qqueue.c **** uint32_t qq_enqueue(Qval val)
22:../src/qqueue.c **** {
35 .loc 1 22 0
36 .cfi_startproc
37 0000 80B5 push {r7, lr}
38 .cfi_def_cfa_offset 8
39 .cfi_offset 7, -8
40 .cfi_offset 14, -4
41 0002 82B0 sub sp, sp, #8
42 .cfi_def_cfa_offset 16
43 0004 00AF add r7, sp, #0
44 .cfi_def_cfa_register 7
45 0006 7860 str r0, [r7, #4]
23:../src/qqueue.c **** if (qq_free()>0)
46 .loc 1 23 0
47 0008 FFF7FEFF bl qq_free
48 000c 031E subs r3, r0, #0
49 000e 21D0 beq .L2
24:../src/qqueue.c **** {
25:../src/qqueue.c **** g_qqueue->data[g_qqueue->writeIndex++] = val;
50 .loc 1 25 0
51 0010 134B ldr r3, .L5
52 0012 1968 ldr r1, [r3]
53 0014 124B ldr r3, .L5
54 0016 1B68 ldr r3, [r3]
55 0018 5A88 ldrh r2, [r3, #2]
56 001a 92B2 uxth r2, r2
57 001c 501C adds r0, r2, #1
58 001e 80B2 uxth r0, r0
59 0020 5880 strh r0, [r3, #2]
60 0022 1300 movs r3, r2
61 0024 0233 adds r3, r3, #2
62 0026 9B00 lsls r3, r3, #2
63 0028 7A68 ldr r2, [r7, #4]
64 002a 5A50 str r2, [r3, r1]
26:../src/qqueue.c **** g_qqueue->produced++;
65 .loc 1 26 0
66 002c 0C4B ldr r3, .L5
67 002e 1B68 ldr r3, [r3]
68 0030 9A88 ldrh r2, [r3, #4]
69 0032 92B2 uxth r2, r2
70 0034 0132 adds r2, r2, #1
71 0036 92B2 uxth r2, r2
72 0038 9A80 strh r2, [r3, #4]
27:../src/qqueue.c **** if (g_qqueue->writeIndex==QQ_MEM_SIZE)
73 .loc 1 27 0
74 003a 094B ldr r3, .L5
75 003c 1B68 ldr r3, [r3]
76 003e 5B88 ldrh r3, [r3, #2]
77 0040 9BB2 uxth r3, r3
78 0042 084A ldr r2, .L5+4
79 0044 9342 cmp r3, r2
80 0046 03D1 bne .L3
28:../src/qqueue.c **** g_qqueue->writeIndex = 0;
81 .loc 1 28 0
82 0048 054B ldr r3, .L5
83 004a 1B68 ldr r3, [r3]
84 004c 0022 movs r2, #0
85 004e 5A80 strh r2, [r3, #2]
86 .L3:
29:../src/qqueue.c **** return 1;
87 .loc 1 29 0
88 0050 0123 movs r3, #1
89 0052 00E0 b .L4
90 .L2:
30:../src/qqueue.c **** }
31:../src/qqueue.c **** return 0;
91 .loc 1 31 0
92 0054 0023 movs r3, #0
93 .L4:
32:../src/qqueue.c **** }
94 .loc 1 32 0
95 0056 1800 movs r0, r3
96 0058 BD46 mov sp, r7
97 005a 02B0 add sp, sp, #8
98 @ sp needed
99 005c 80BD pop {r7, pc}
100 .L6:
101 005e C046 .align 2
102 .L5:
103 0060 00000000 .word g_qqueue
104 0064 FE0B0000 .word 3070
105 .cfi_endproc
106 .LFE0:
108 .section .text.qq_free,"ax",%progbits
109 .align 2
110 .global qq_free
111 .code 16
112 .thumb_func
114 qq_free:
115 .LFB1:
33:../src/qqueue.c ****
34:../src/qqueue.c **** uint16_t qq_free(void)
35:../src/qqueue.c **** {
116 .loc 1 35 0
117 .cfi_startproc
118 0000 80B5 push {r7, lr}
119 .cfi_def_cfa_offset 8
120 .cfi_offset 7, -8
121 .cfi_offset 14, -4
122 0002 82B0 sub sp, sp, #8
123 .cfi_def_cfa_offset 16
124 0004 00AF add r7, sp, #0
125 .cfi_def_cfa_register 7
36:../src/qqueue.c **** uint16_t len = g_qqueue->produced - g_qqueue->consumed;
126 .loc 1 36 0
127 0006 0A4B ldr r3, .L9
128 0008 1B68 ldr r3, [r3]
129 000a 9B88 ldrh r3, [r3, #4]
130 000c 99B2 uxth r1, r3
131 000e 084B ldr r3, .L9
132 0010 1B68 ldr r3, [r3]
133 0012 DB88 ldrh r3, [r3, #6]
134 0014 9AB2 uxth r2, r3
135 0016 BB1D adds r3, r7, #6
136 0018 8A1A subs r2, r1, r2
137 001a 1A80 strh r2, [r3]
37:../src/qqueue.c **** return QQ_MEM_SIZE-len;
138 .loc 1 37 0
139 001c BB1D adds r3, r7, #6
140 001e 1B88 ldrh r3, [r3]
141 0020 044A ldr r2, .L9+4
142 0022 D31A subs r3, r2, r3
143 0024 9BB2 uxth r3, r3
38:../src/qqueue.c **** }
144 .loc 1 38 0
145 0026 1800 movs r0, r3
146 0028 BD46 mov sp, r7
147 002a 02B0 add sp, sp, #8
148 @ sp needed
149 002c 80BD pop {r7, pc}
150 .L10:
151 002e C046 .align 2
152 .L9:
153 0030 00000000 .word g_qqueue
154 0034 FE0B0000 .word 3070
155 .cfi_endproc
156 .LFE1:
158 .text
159 .Letext0:
160 .file 2 "/usr/local/lpcxpresso_8.1.4_606/lpcxpresso/tools/redlib/include/stdint.h"
161 .file 3 "/home/weyoui/PROJECTS/SmartCart/Pixy/pixy/misc/gcc/m0/inc/qqueue.h"
DEFINED SYMBOLS
*ABS*:00000000 qqueue.c
/tmp/cckzgME9.s:24 .data.g_qqueue:00000000 g_qqueue
/tmp/cckzgME9.s:21 .data.g_qqueue:00000000 $d
/tmp/cckzgME9.s:27 .text.qq_enqueue:00000000 $t
/tmp/cckzgME9.s:32 .text.qq_enqueue:00000000 qq_enqueue
/tmp/cckzgME9.s:114 .text.qq_free:00000000 qq_free
/tmp/cckzgME9.s:103 .text.qq_enqueue:00000060 $d
/tmp/cckzgME9.s:109 .text.qq_free:00000000 $t
/tmp/cckzgME9.s:153 .text.qq_free:00000030 $d
.debug_frame:00000010 $d
NO UNDEFINED SYMBOLS
| 38.927536 | 102 | 0.503723 |
56e00b59863d674d9e869a9425a29412cec75799 | 659 | asm | Assembly | programs/oeis/304/A304374.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/304/A304374.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/304/A304374.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A304374: a(n) = 9*n^2 + 21*n - 6 (n>=1).
; 24,72,138,222,324,444,582,738,912,1104,1314,1542,1788,2052,2334,2634,2952,3288,3642,4014,4404,4812,5238,5682,6144,6624,7122,7638,8172,8724,9294,9882,10488,11112,11754,12414,13092,13788,14502,15234,15984,16752,17538,18342,19164,20004,20862,21738,22632,23544,24474,25422,26388,27372,28374,29394,30432,31488,32562,33654,34764,35892,37038,38202,39384,40584,41802,43038,44292,45564,46854,48162,49488,50832,52194,53574,54972,56388,57822,59274,60744,62232,63738,65262,66804,68364,69942,71538,73152,74784,76434,78102,79788,81492,83214,84954,86712,88488,90282,92094
mul $0,6
add $0,13
pow $0,2
div $0,24
sub $0,3
mul $0,6
| 65.9 | 558 | 0.769347 |
3ef49b622b186dccce2505f68dc2cb27da9075c3 | 102,780 | asm | Assembly | non_regression/other_x64_linux_7.att.s.asm | LRGH/plasmasm | 4cd50546c3dc895763d72dd60b7c46179c1916bc | [
"Apache-2.0"
] | 1 | 2021-02-28T21:31:18.000Z | 2021-02-28T21:31:18.000Z | non_regression/other_x64_linux_7.att.s.asm | LRGH/plasmasm | 4cd50546c3dc895763d72dd60b7c46179c1916bc | [
"Apache-2.0"
] | null | null | null | non_regression/other_x64_linux_7.att.s.asm | LRGH/plasmasm | 4cd50546c3dc895763d72dd60b7c46179c1916bc | [
"Apache-2.0"
] | null | null | null | .file "deflate.c"
.section .text.unlikely,"ax",@progbits
.LCOLDB0:
.LCOLDE0:
.LCOLDB1:
.LCOLDE1:
.LCOLDB2:
.LCOLDE2:
.LCOLDB3:
.LCOLDE3:
.LCOLDB4:
.LCOLDE4:
.LCOLDB5:
.LCOLDE5:
.LCOLDB6:
.LCOLDE6:
.LCOLDB7:
.LCOLDE7:
.LCOLDB8:
.LCOLDE8:
.LCOLDB9:
.LCOLDE9:
.LCOLDB10:
.LCOLDE10:
.LCOLDB11:
.LCOLDE11:
.LCOLDB12:
.LCOLDE12:
.LCOLDB13:
.LCOLDE13:
.LCOLDB14:
.LCOLDE14:
.LCOLDB15:
.LCOLDE15:
.LCOLDB16:
.LCOLDE16:
.LCOLDB17:
.LCOLDE17:
.LCOLDB18:
.LCOLDE18:
# ----------------------
.text
.LHOTB0:
# ----------------------
.p2align 4,,15
# ----------------------
.local longest_match
.type longest_match, @function
longest_match:
.cfi_startproc
pushq %r15
pushq %r14
xorl %r11d, %r11d
pushq %r13
pushq %r12
pushq %rbp
pushq %rbx
movl 192(%rdi), %ebx
movl 156(%rdi), %r9d
movq 80(%rdi), %r10
movl 168(%rdi), %r8d
movl 172(%rdi), %ecx
movl %ebx, -20(%rsp)
movl 68(%rdi), %ebx
leaq (%r10,%r9), %r13
movl %r8d, %eax
leal -262(%rbx), %ebp
cmpl %ebp, %r9d
jbe .L2
leal 262(%r9), %r11d
subl %ebx, %r11d
.L2:
leaq 258(%r10,%r9), %rbx
movslq %r8d, %rdx
movl 164(%rdi), %r15d
movzbl -1(%r13,%rdx), %r14d
movq 96(%rdi), %r12
movq %rbx, -8(%rsp)
movzbl (%r13,%rdx), %ebx
movl %ecx, %edx
shrl $2, %edx
cmpl 188(%rdi), %r8d
movl 76(%rdi), %ebp
movq %rdi, -16(%rsp)
cmovae %edx, %ecx
movl -20(%rsp), %edx
cmpl %r15d, %edx
cmova %r15d, %edx
movl %edx, -20(%rsp)
jmp .L17
.p2align 4,,10
.p2align 3
.L5:
andl %ebp, %esi
movzwl (%r12,%rsi,2), %esi
cmpl %esi, %r11d
jae .L16
subl $1, %ecx
je .L16
.L17:
movl %esi, %edx
movslq %eax, %r9
addq %r10, %rdx
movzbl (%rdx,%r9), %r8d
cmpb %bl, %r8b
jne .L5
movzbl -1(%rdx,%r9), %r9d
cmpb %r14b, %r9b
jne .L5
movzbl (%r13), %edi
cmpb %dil, (%rdx)
jne .L5
movzbl 1(%r13), %edi
cmpb %dil, 1(%rdx)
jne .L5
addq $2, %r13
addq $2, %rdx
movq -8(%rsp), %rbx
movq -16(%rsp), %rdi
jmp .L14
.p2align 4,,10
.p2align 3
.L6:
movzbl 2(%rdx), %r14d
cmpb %r14b, 2(%r13)
jne .L33
movzbl 3(%rdx), %r14d
cmpb %r14b, 3(%r13)
jne .L34
movzbl 4(%rdx), %r14d
cmpb %r14b, 4(%r13)
jne .L35
movzbl 5(%rdx), %r14d
cmpb %r14b, 5(%r13)
jne .L36
movzbl 6(%rdx), %r14d
cmpb %r14b, 6(%r13)
jne .L37
movzbl 7(%rdx), %r14d
cmpb %r14b, 7(%r13)
jne .L38
addq $8, %rdx
addq $8, %r13
movzbl (%rdx), %r14d
cmpb %r14b, (%r13)
jne .L29
cmpq %r13, %rbx
jbe .L29
.L14:
movzbl 1(%rdx), %r14d
cmpb %r14b, 1(%r13)
je .L6
movq %rdi, -16(%rsp)
addq $1, %r13
.L7:
movq -8(%rsp), %rdi
movl $258, %ebx
movq %rdi, %rdx
subq %r13, %rdx
leaq -258(%rdi), %r13
subl %edx, %ebx
cmpl %ebx, %eax
movl %ebx, %edx
jge .L22
cmpl %ebx, -20(%rsp)
movq -16(%rsp), %rax
movl %esi, 160(%rax)
jle .L23
movslq %ebx, %rax
movzbl -1(%r13,%rax), %r14d
movzbl -258(%rdi,%rax), %ebx
movl %edx, %eax
jmp .L5
.L23:
movl %ebx, %eax
.p2align 4,,10
.p2align 3
.L16:
cmpl %r15d, %eax
popq %rbx
cmova %r15d, %eax
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.L22:
movl %r8d, %ebx
movl %r9d, %r14d
jmp .L5
.L36:
movq %rdi, -16(%rsp)
addq $5, %r13
jmp .L7
.L35:
movq %rdi, -16(%rsp)
addq $4, %r13
jmp .L7
.L34:
movq %rdi, -16(%rsp)
addq $3, %r13
jmp .L7
.L33:
movq %rdi, -16(%rsp)
addq $2, %r13
jmp .L7
.L38:
movq %rdi, -16(%rsp)
addq $7, %r13
jmp .L7
.L37:
movq %rdi, -16(%rsp)
addq $6, %r13
jmp .L7
.L29:
movq %rdi, -16(%rsp)
jmp .L7
.LHOTE0:
.LHOTB1:
.cfi_endproc
.size longest_match, .-longest_match
# ----------------------
.p2align 4,,15
# ----------------------
.local fill_window
.type fill_window, @function
fill_window:
.cfi_startproc
pushq %r15
pushq %r14
movq $-2, %rcx
pushq %r13
pushq %r12
xorl %r14d, %r14d
pushq %rbp
pushq %rbx
movq %rdi, %rbx
subq $56, %rsp
movl 68(%rdi), %r12d
movl 164(%rdi), %edx
movq %rcx, %rdi
movq %rcx, 32(%rsp)
leaq (%r12,%r12), %rax
movq %r12, %r13
movq %r12, 40(%rsp)
movq %rax, 16(%rsp)
leal -1(%r12), %eax
addq %rax, %rax
subq %rax, %rdi
movl %r12d, %eax
movq %rdi, 24(%rsp)
leal -262(%r12), %edi
movl %edi, 12(%rsp)
.p2align 4,,10
.p2align 3
.L56:
movl 156(%rbx), %ecx
movl 88(%rbx), %r15d
addl 12(%rsp), %eax
subl %edx, %r15d
subl %ecx, %r15d
cmpl %eax, %ecx
jae .L72
movq (%rbx), %r12
movl 8(%r12), %ebp
testl %ebp, %ebp
je .L52
.L43:
cmpl %ebp, %r15d
movq 80(%rbx), %rsi
movl 164(%rbx), %edx
jae .L62
testl %r15d, %r15d
jne .L73
xorl %r8d, %r8d
.L47:
movl 5916(%rbx), %esi
addl %r8d, %edx
movl %edx, 164(%rbx)
leal (%rdx,%rsi), %eax
cmpl $2, %eax
jbe .L54
movl 156(%rbx), %edi
movq 80(%rbx), %r11
movl 128(%rbx), %ecx
movl 124(%rbx), %r15d
subl %esi, %edi
movl %edi, %eax
movzbl (%r11,%rax), %r8d
leal 1(%rdi), %eax
movl %r8d, 112(%rbx)
movzbl (%r11,%rax), %r9d
movl %r8d, %eax
sall %cl, %eax
xorl %r9d, %eax
andl %r15d, %eax
movl %eax, 112(%rbx)
jmp .L53
.p2align 4,,10
.p2align 3
.L55:
leal 2(%rdi), %r8d
sall %cl, %eax
movl %edi, %r10d
andl 76(%rbx), %r10d
subl $1, %esi
movzbl (%r11,%r8), %r8d
xorl %r8d, %eax
movq 104(%rbx), %r8
andl %r15d, %eax
movl %eax, %r9d
movl %eax, 112(%rbx)
leaq (%r8,%r9,2), %r8
movq 96(%rbx), %r9
movzwl (%r8), %ebp
movw %bp, (%r9,%r10,2)
movw %di, (%r8)
leal (%rsi,%rdx), %r8d
addl $1, %edi
movl %esi, 5916(%rbx)
cmpl $2, %r8d
jbe .L54
.L53:
testl %esi, %esi
jne .L55
.L54:
cmpl $261, %edx
ja .L52
movq (%rbx), %rax
movl 8(%rax), %r8d
testl %r8d, %r8d
je .L52
movl 68(%rbx), %eax
jmp .L56
.p2align 4,,10
.p2align 3
.L62:
xorl %eax, %eax
.L46:
addq %rdx, %rcx
movl %ebp, %r15d
movl %eax, 8(%r12)
addq %rsi, %rcx
movq (%r12), %rsi
movq %r15, %rdx
movq %rcx, %rdi
call memcpy
movq %rax, %rcx
movq 56(%r12), %rax
movl 44(%rax), %eax
cmpl $1, %eax
je .L74
cmpl $2, %eax
je .L75
.L49:
addq %r15, (%r12)
addq %r15, 16(%r12)
movl %ebp, %r8d
movl 164(%rbx), %edx
jmp .L47
.p2align 4,,10
.p2align 3
.L72:
movq 40(%rsp), %rbp
movq 80(%rbx), %rdi
leaq (%rdi,%rbp), %rsi
movq %rbp, %rdx
call memcpy
movl 116(%rbx), %esi
movq 104(%rbx), %rax
movl 156(%rbx), %ecx
movq 32(%rsp), %rdi
subl %r13d, 160(%rbx)
subq %rbp, 136(%rbx)
movq %rsi, %rdx
leaq (%rax,%rsi,2), %rax
subl %r13d, %ecx
subl $1, %edx
addq %rdx, %rdx
subq %rdx, %rdi
movl %ecx, 156(%rbx)
addq %rax, %rdi
.p2align 4,,10
.p2align 3
.L41:
subq $2, %rax
movzwl (%rax), %esi
movl %esi, %edx
subl %r13d, %edx
cmpl %esi, %r13d
cmova %r14d, %edx
cmpq %rdi, %rax
movw %dx, (%rax)
jne .L41
movq 16(%rsp), %rax
addq 96(%rbx), %rax
movq 24(%rsp), %rdi
addq %rax, %rdi
.p2align 4,,10
.p2align 3
.L42:
subq $2, %rax
movzwl (%rax), %esi
movl %esi, %edx
subl %r13d, %edx
cmpl %esi, %r13d
cmova %r14d, %edx
cmpq %rdi, %rax
movw %dx, (%rax)
jne .L42
movq (%rbx), %r12
addl %r13d, %r15d
movl 8(%r12), %ebp
testl %ebp, %ebp
jne .L43
.p2align 4,,10
.p2align 3
.L52:
movq 5928(%rbx), %rcx
movq 88(%rbx), %rax
cmpq %rax, %rcx
jae .L39
movl 164(%rbx), %esi
movl 156(%rbx), %edx
addq %rdx, %rsi
cmpq %rsi, %rcx
jae .L57
subq %rsi, %rax
movl $258, %edx
cmpq $258, %rax
cmovbe %rax, %rdx
movq %rsi, %rax
addq 80(%rbx), %rax
cmpl $8, %edx
jae .L58
testb $4, %dl
jne .L76
testl %edx, %edx
je .L59
testb $2, %dl
movb $0, (%rax)
jne .L77
.L59:
addq %rsi, %rdx
movq %rdx, 5928(%rbx)
.L39:
addq $56, %rsp
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.L74:
movq 96(%r12), %rdi
movl %ebp, %edx
movq %rcx, %rsi
call adler32
movq %rax, 96(%r12)
jmp .L49
.L75:
movq 96(%r12), %rdi
movl %ebp, %edx
movq %rcx, %rsi
call crc32
movq %rax, 96(%r12)
jmp .L49
.L57:
leaq 258(%rsi), %rdx
cmpq %rdx, %rcx
jae .L39
subq %rcx, %rsi
subq %rcx, %rax
leaq 258(%rsi), %rbp
cmpq %rax, %rbp
cmova %rax, %rbp
addq 80(%rbx), %rcx
xorl %esi, %esi
movl %ebp, %edx
movq %rcx, %rdi
call memset
addq %rbp, 5928(%rbx)
addq $56, %rsp
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.L58:
leaq 8(%rax), %rdi
movl %edx, %ecx
movq $0, (%rax)
movq $0, -8(%rax,%rcx)
andq $-8, %rdi
subq %rdi, %rax
leal (%rdx,%rax), %ecx
xorl %eax, %eax
shrl $3, %ecx
rep stosq
jmp .L59
.L76:
movl %edx, %ecx
movl $0, (%rax)
movl $0, -4(%rax,%rcx)
jmp .L59
.L77:
movl %edx, %ecx
xorl %edi, %edi
movw %di, -2(%rax,%rcx)
jmp .L59
.L73:
movl %ebp, %eax
movl %r15d, %ebp
subl %r15d, %eax
jmp .L46
.LHOTE1:
.LHOTB2:
.cfi_endproc
.size fill_window, .-fill_window
# ----------------------
.p2align 4,,15
# ----------------------
.local deflate_fast
.type deflate_fast, @function
deflate_fast:
.cfi_startproc
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbp
pushq %rbx
movq %rdi, %rbx
subq $24, %rsp
movl %esi, 12(%rsp)
.L99:
movl 164(%rbx), %r8d
.p2align 4,,10
.p2align 3
.L93:
cmpl $261, %r8d
jbe .L125
.L83:
movl 156(%rbx), %edx
movq 80(%rbx), %rcx
leal 2(%rdx), %eax
movl %edx, %edi
andl 76(%rbx), %edi
movzbl (%rcx,%rax), %esi
movl 128(%rbx), %ecx
movl 112(%rbx), %eax
sall %cl, %eax
movq 104(%rbx), %rcx
xorl %esi, %eax
andl 124(%rbx), %eax
movl %eax, 112(%rbx)
leaq (%rcx,%rax,2), %rax
movq 96(%rbx), %rcx
movzwl (%rax), %esi
testl %esi, %esi
movw %si, (%rcx,%rdi,2)
movw %dx, (%rax)
je .L124
movl 68(%rbx), %eax
movl %edx, %ecx
subl %esi, %ecx
subl $262, %eax
cmpl %eax, %ecx
jbe .L86
.L124:
movl 144(%rbx), %eax
.L84:
cmpl $2, %eax
jbe .L87
subw 160(%rbx), %dx
movl 5884(%rbx), %esi
subl $3, %eax
movq 5888(%rbx), %rdi
movw %dx, (%rdi,%rsi,2)
movq 5872(%rbx), %rdi
movq %rsi, %rcx
addl $1, %ecx
subl $1, %edx
movl %ecx, 5884(%rbx)
movb %al, (%rdi,%rsi)
movzbl %al, %eax
movzbl _length_code(%rax), %eax
addw $1, 1224(%rbx,%rax,4)
cmpw $255, %dx
ja .L88
movzwl %dx, %edx
movzbl _dist_code(%rdx), %eax
.L89:
addw $1, 2488(%rbx,%rax,4)
xorl %r10d, %r10d
movl 5880(%rbx), %eax
movl 164(%rbx), %r8d
movl 144(%rbx), %r9d
subl $1, %eax
cmpl %eax, 5884(%rbx)
sete %r10b
subl %r9d, %r8d
cmpl $2, %r8d
movl %r8d, 164(%rbx)
jbe .L90
cmpl 176(%rbx), %r9d
ja .L90
movl 156(%rbx), %eax
leal -1(%r9), %edi
movq 96(%rbx), %r14
movl 76(%rbx), %r13d
movq 104(%rbx), %r12
movq 80(%rbx), %rbp
movl 128(%rbx), %ecx
movl %eax, %esi
movl %eax, 4(%rsp)
movl 124(%rbx), %r11d
movl 112(%rbx), %eax
leal 1(%rsi), %edx
movl %edi, 144(%rbx)
movl %r8d, 8(%rsp)
.p2align 4,,10
.p2align 3
.L91:
leal 2(%rdx), %esi
movl %edx, 156(%rbx)
sall %cl, %eax
movl %edx, %r15d
subl $1, %edi
movzbl (%rbp,%rsi), %esi
andl %r13d, %r15d
xorl %esi, %eax
andl %r11d, %eax
movl %eax, %esi
movl %eax, 112(%rbx)
leaq (%r12,%rsi,2), %rsi
movzwl (%rsi), %r8d
movw %r8w, (%r14,%r15,2)
movw %dx, (%rsi)
addl $1, %edx
testl %edi, %edi
movl %edi, 144(%rbx)
jne .L91
addl 4(%rsp), %r9d
movl 8(%rsp), %r8d
movl %r9d, 156(%rbx)
.p2align 4,,10
.p2align 3
.L92:
testl %r10d, %r10d
je .L93
movq 136(%rbx), %rax
movl %r9d, %edx
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L94
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L94:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r12
movl 156(%rbx), %eax
movq 56(%r12), %r13
movq %rax, 136(%rbx)
movq %r13, %rdi
call _tr_flush_bits
movl 40(%r13), %ebp
movl 32(%r12), %eax
cmpl %ebp, %eax
cmovbe %eax, %ebp
testl %ebp, %ebp
jne .L126
.L96:
movq (%rbx), %rax
movl 32(%rax), %esi
testl %esi, %esi
jne .L99
.L98:
addq $24, %rsp
xorl %eax, %eax
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.p2align 4,,10
.p2align 3
.L87:
movl 5884(%rbx), %ecx
movq 80(%rbx), %rax
xorl %edi, %edi
movq 5888(%rbx), %rsi
xorl %r10d, %r10d
movzbl (%rax,%rdx), %eax
movw %di, (%rsi,%rcx,2)
movq 5872(%rbx), %rsi
movq %rcx, %rdx
addl $1, %edx
movl %edx, 5884(%rbx)
movb %al, (%rsi,%rcx)
addw $1, 196(%rbx,%rax,4)
movl 5880(%rbx), %eax
subl $1, %eax
cmpl %eax, 5884(%rbx)
movl 164(%rbx), %eax
leal -1(%rax), %r8d
movl 156(%rbx), %eax
sete %r10b
movl %r8d, 164(%rbx)
leal 1(%rax), %r9d
movl %r9d, 156(%rbx)
jmp .L92
.p2align 4,,10
.p2align 3
.L90:
addl 156(%rbx), %r9d
movq 80(%rbx), %rdx
movl $0, 144(%rbx)
movl %r9d, %eax
movl %r9d, 156(%rbx)
leal 1(%r9), %ecx
movzbl (%rdx,%rax), %eax
movl %eax, 112(%rbx)
movzbl (%rdx,%rcx), %edx
movl 128(%rbx), %ecx
sall %cl, %eax
xorl %edx, %eax
andl 124(%rbx), %eax
movl %eax, 112(%rbx)
jmp .L92
.p2align 4,,10
.p2align 3
.L125:
movq %rbx, %rdi
call fill_window
movl 164(%rbx), %eax
cmpl $261, %eax
ja .L83
movl 12(%rsp), %r8d
testl %r8d, %r8d
je .L98
testl %eax, %eax
je .L82
cmpl $2, %eax
ja .L83
movl 144(%rbx), %eax
movl 156(%rbx), %edx
jmp .L84
.p2align 4,,10
.p2align 3
.L88:
shrw $7, %dx
leaq 256(%rdx), %rax
andl $1023, %eax
movzbl _dist_code(%rax), %eax
jmp .L89
.p2align 4,,10
.p2align 3
.L86:
movq %rbx, %rdi
call longest_match
movl 156(%rbx), %edx
movl %eax, 144(%rbx)
jmp .L84
.L126:
movq 24(%r12), %rdi
movq 32(%r13), %rsi
movl %ebp, %r14d
movq %r14, %rdx
call memcpy
addq %r14, 24(%r12)
addq %r14, 32(%r13)
addq %r14, 40(%r12)
subl %ebp, 32(%r12)
subl %ebp, 40(%r13)
jne .L96
movq 16(%r13), %rax
movq %rax, 32(%r13)
jmp .L96
.L82:
movl 156(%rbx), %edx
movl $2, %eax
cmpl $2, %edx
cmovbe %edx, %eax
cmpl $4, 12(%rsp)
movl %eax, 5916(%rbx)
je .L127
movl 5884(%rbx), %ecx
movl $1, %eax
testl %ecx, %ecx
je .L81
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L105
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L105:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r13
movl 156(%rbx), %eax
movq 56(%r13), %rbp
movq %rax, 136(%rbx)
movq %rbp, %rdi
call _tr_flush_bits
movl 40(%rbp), %r12d
movl 32(%r13), %eax
cmpl %r12d, %eax
cmovbe %eax, %r12d
testl %r12d, %r12d
jne .L128
.L107:
movq (%rbx), %rax
movl 32(%rax), %eax
testl %eax, %eax
setne %al
movzbl %al, %eax
.L81:
addq $24, %rsp
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.L127:
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L101
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L101:
movl $1, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r12
movl 156(%rbx), %eax
movq 56(%r12), %rbp
movq %rax, 136(%rbx)
movq %rbp, %rdi
call _tr_flush_bits
movl 40(%rbp), %r13d
movl 32(%r12), %eax
cmpl %r13d, %eax
cmovbe %eax, %r13d
testl %r13d, %r13d
jne .L129
.L103:
movq (%rbx), %rax
cmpl $1, 32(%rax)
sbbl %eax, %eax
addq $24, %rsp
popq %rbx
addl $3, %eax
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.L128:
movq 24(%r13), %rdi
movq 32(%rbp), %rsi
movl %r12d, %r14d
movq %r14, %rdx
call memcpy
addq %r14, 24(%r13)
addq %r14, 32(%rbp)
addq %r14, 40(%r13)
subl %r12d, 32(%r13)
subl %r12d, 40(%rbp)
jne .L107
movq 16(%rbp), %rax
movq %rax, 32(%rbp)
jmp .L107
.L129:
movq 24(%r12), %rdi
movq 32(%rbp), %rsi
movl %r13d, %r14d
movq %r14, %rdx
call memcpy
addq %r14, 24(%r12)
addq %r14, 32(%rbp)
addq %r14, 40(%r12)
subl %r13d, 32(%r12)
subl %r13d, 40(%rbp)
jne .L103
movq 16(%rbp), %rax
movq %rax, 32(%rbp)
jmp .L103
.LHOTE2:
.LHOTB3:
.cfi_endproc
.size deflate_fast, .-deflate_fast
# ----------------------
.p2align 4,,15
# ----------------------
.local deflate_slow
.type deflate_slow, @function
deflate_slow:
.cfi_startproc
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbp
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
subq $8, %rsp
.L184:
movl 164(%rbx), %edi
.p2align 4,,10
.p2align 3
.L131:
cmpl $261, %edi
jbe .L187
.L168:
movl 156(%rbx), %edx
movq 80(%rbx), %rcx
leal 2(%rdx), %eax
movl %edx, %edi
andl 76(%rbx), %edi
movzbl (%rcx,%rax), %esi
movl 128(%rbx), %ecx
movl 112(%rbx), %eax
sall %cl, %eax
movq 104(%rbx), %rcx
xorl %esi, %eax
andl 124(%rbx), %eax
movl %eax, 112(%rbx)
leaq (%rcx,%rax,2), %rax
movq 96(%rbx), %rcx
movzwl (%rax), %esi
movw %si, (%rcx,%rdi,2)
movw %dx, (%rax)
testl %esi, %esi
movl 144(%rbx), %ecx
movl 160(%rbx), %eax
movl $2, 144(%rbx)
movl %eax, 148(%rbx)
movl %ecx, 168(%rbx)
movl $2, %eax
je .L137
cmpl 176(%rbx), %ecx
jae .L137
movl 68(%rbx), %edi
movl %edx, %r8d
subl %esi, %r8d
subl $262, %edi
cmpl %edi, %r8d
jbe .L188
.p2align 4,,10
.p2align 3
.L137:
cmpl $2, %ecx
jbe .L142
cmpl %eax, %ecx
jb .L142
movl 164(%rbx), %eax
movl 5884(%rbx), %esi
subl $3, %ecx
movq 5888(%rbx), %rdi
leal -3(%rdx,%rax), %r8d
subw 148(%rbx), %dx
movq %rsi, %rax
addl $1, %eax
leal -1(%rdx), %r9d
subl $2, %edx
movw %r9w, (%rdi,%rsi,2)
movq 5872(%rbx), %rdi
movl %eax, 5884(%rbx)
movb %cl, (%rdi,%rsi)
movzbl %cl, %ecx
movzbl _length_code(%rcx), %eax
addw $1, 1224(%rbx,%rax,4)
cmpw $255, %dx
ja .L143
movzwl %dx, %edx
movzbl _dist_code(%rdx), %eax
.L144:
addw $1, 2488(%rbx,%rax,4)
movl 5880(%rbx), %eax
movl 168(%rbx), %r10d
movl 156(%rbx), %r11d
movl 5884(%rbx), %r12d
leal -1(%rax), %r9d
movl 164(%rbx), %eax
leal -2(%r10), %esi
movl %esi, 168(%rbx)
leal 1(%rax), %edi
leal 1(%r11), %eax
subl %r10d, %edi
movl %edi, 164(%rbx)
.p2align 4,,10
.p2align 3
.L146:
cmpl %r8d, %eax
movl %eax, 156(%rbx)
ja .L145
movq 80(%rbx), %rcx
leal 2(%rax), %edx
movzbl (%rcx,%rdx), %r13d
movl 128(%rbx), %ecx
movl 112(%rbx), %edx
sall %cl, %edx
movq 104(%rbx), %rcx
xorl %r13d, %edx
andl 124(%rbx), %edx
movl %eax, %r13d
andl 76(%rbx), %r13d
movl %edx, 112(%rbx)
leaq (%rcx,%rdx,2), %rdx
movq 96(%rbx), %rcx
movzwl (%rdx), %r15d
movw %r15w, (%rcx,%r13,2)
movw %ax, (%rdx)
.L145:
subl $1, %esi
addl $1, %eax
testl %esi, %esi
movl %esi, 168(%rbx)
jne .L146
leal -1(%r10,%r11), %eax
cmpl %r9d, %r12d
movl $0, 152(%rbx)
movl $2, 144(%rbx)
movl %eax, 156(%rbx)
jne .L131
movq 136(%rbx), %rcx
movl %eax, %edx
xorl %esi, %esi
subq %rcx, %rdx
testq %rcx, %rcx
js .L148
movl %ecx, %ecx
movq %rcx, %rsi
addq 80(%rbx), %rsi
.L148:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r13
movl 156(%rbx), %eax
movq 56(%r13), %r14
movq %rax, 136(%rbx)
movq %r14, %rdi
call _tr_flush_bits
movl 40(%r14), %r12d
movl 32(%r13), %eax
cmpl %r12d, %eax
cmovbe %eax, %r12d
testl %r12d, %r12d
jne .L189
.L150:
movq (%rbx), %rax
movl 32(%rax), %r12d
testl %r12d, %r12d
jne .L184
.L152:
xorl %eax, %eax
.L180:
addq $8, %rsp
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.p2align 4,,10
.p2align 3
.L142:
movl 152(%rbx), %r11d
testl %r11d, %r11d
je .L153
movl 5884(%rbx), %ecx
movq 80(%rbx), %rax
subl $1, %edx
movq 5888(%rbx), %rsi
xorl %r10d, %r10d
movzbl (%rax,%rdx), %eax
movw %r10w, (%rsi,%rcx,2)
movq 5872(%rbx), %rsi
movq %rcx, %rdx
addl $1, %edx
movl %edx, 5884(%rbx)
movb %al, (%rsi,%rcx)
addw $1, 196(%rbx,%rax,4)
movl 5880(%rbx), %eax
subl $1, %eax
cmpl %eax, 5884(%rbx)
je .L190
.L155:
movl 164(%rbx), %eax
addl $1, 156(%rbx)
leal -1(%rax), %edi
movq (%rbx), %rax
movl %edi, 164(%rbx)
movl 32(%rax), %r9d
testl %r9d, %r9d
je .L152
cmpl $261, %edi
ja .L168
.L187:
movq %rbx, %rdi
call fill_window
movl 164(%rbx), %eax
cmpl $261, %eax
ja .L168
testl %ebp, %ebp
je .L152
testl %eax, %eax
je .L135
cmpl $2, %eax
ja .L168
movl 144(%rbx), %ecx
movl 160(%rbx), %eax
movl $2, 144(%rbx)
movl 156(%rbx), %edx
movl %eax, 148(%rbx)
movl %ecx, 168(%rbx)
movl $2, %eax
jmp .L137
.p2align 4,,10
.p2align 3
.L153:
movl 164(%rbx), %eax
addl $1, %edx
movl $1, 152(%rbx)
movl %edx, 156(%rbx)
leal -1(%rax), %edi
movl %edi, 164(%rbx)
jmp .L131
.p2align 4,,10
.p2align 3
.L143:
shrw $7, %dx
leaq 256(%rdx), %rax
andl $1023, %eax
movzbl _dist_code(%rax), %eax
jmp .L144
.p2align 4,,10
.p2align 3
.L190:
movl 156(%rbx), %edx
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L156
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L156:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r13
movl 156(%rbx), %eax
movq 56(%r13), %r14
movq %rax, 136(%rbx)
movq %r14, %rdi
call _tr_flush_bits
movl 40(%r14), %r12d
movl 32(%r13), %eax
cmpl %r12d, %eax
cmovbe %eax, %r12d
testl %r12d, %r12d
je .L155
movq 24(%r13), %rdi
movq 32(%r14), %rsi
movl %r12d, %r15d
movq %r15, %rdx
call memcpy
addq %r15, 24(%r13)
addq %r15, 32(%r14)
addq %r15, 40(%r13)
subl %r12d, 32(%r13)
subl %r12d, 40(%r14)
jne .L155
movq 16(%r14), %rax
movq %rax, 32(%r14)
jmp .L155
.p2align 4,,10
.p2align 3
.L188:
movq %rbx, %rdi
call longest_match
cmpl $5, %eax
movl %eax, 144(%rbx)
ja .L185
cmpl $1, 184(%rbx)
je .L191
cmpl $3, %eax
je .L141
.L185:
movl 168(%rbx), %ecx
movl 156(%rbx), %edx
jmp .L137
.L189:
movq 24(%r13), %rdi
movq 32(%r14), %rsi
movl %r12d, %r15d
movq %r15, %rdx
call memcpy
addq %r15, 24(%r13)
addq %r15, 32(%r14)
addq %r15, 40(%r13)
subl %r12d, 32(%r13)
subl %r12d, 40(%r14)
jne .L150
movq 16(%r14), %rax
movq %rax, 32(%r14)
jmp .L150
.L191:
movl 156(%rbx), %edx
.L140:
movl $2, 144(%rbx)
movl 168(%rbx), %ecx
movl $2, %eax
jmp .L137
.L141:
movl 156(%rbx), %edx
movl %edx, %ecx
subl 160(%rbx), %ecx
cmpl $4096, %ecx
ja .L140
movl 168(%rbx), %ecx
jmp .L137
.L135:
movl 152(%rbx), %r8d
testl %r8d, %r8d
jne .L192
.L158:
movl 156(%rbx), %edx
movl $2, %eax
cmpl $2, %edx
cmovbe %edx, %eax
cmpl $4, %ebp
movl %eax, 5916(%rbx)
je .L193
movl 5884(%rbx), %ecx
movl $1, %eax
testl %ecx, %ecx
je .L180
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L164
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L164:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r12
movl 156(%rbx), %eax
movq 56(%r12), %rbp
movq %rax, 136(%rbx)
movq %rbp, %rdi
call _tr_flush_bits
movl 40(%rbp), %r13d
movl 32(%r12), %eax
cmpl %r13d, %eax
cmovbe %eax, %r13d
testl %r13d, %r13d
jne .L194
.L166:
movq (%rbx), %rax
movl 32(%rax), %eax
testl %eax, %eax
setne %al
addq $8, %rsp
popq %rbx
movzbl %al, %eax
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.L192:
movl 156(%rbx), %eax
movq 80(%rbx), %rdx
xorl %edi, %edi
movl 5884(%rbx), %ecx
movq 5888(%rbx), %rsi
subl $1, %eax
movzbl (%rdx,%rax), %eax
movw %di, (%rsi,%rcx,2)
movq 5872(%rbx), %rsi
movq %rcx, %rdx
addl $1, %edx
movl %edx, 5884(%rbx)
movb %al, (%rsi,%rcx)
addw $1, 196(%rbx,%rax,4)
movl $0, 152(%rbx)
jmp .L158
.L193:
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L160
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L160:
movl $1, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r12
movl 156(%rbx), %eax
movq 56(%r12), %rbp
movq %rax, 136(%rbx)
movq %rbp, %rdi
call _tr_flush_bits
movl 40(%rbp), %r13d
movl 32(%r12), %eax
cmpl %r13d, %eax
cmovbe %eax, %r13d
testl %r13d, %r13d
jne .L195
.L162:
movq (%rbx), %rax
cmpl $1, 32(%rax)
sbbl %eax, %eax
addq $8, %rsp
popq %rbx
addl $3, %eax
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.L194:
movq 24(%r12), %rdi
movq 32(%rbp), %rsi
movl %r13d, %r14d
movq %r14, %rdx
call memcpy
addq %r14, 24(%r12)
addq %r14, 32(%rbp)
addq %r14, 40(%r12)
subl %r13d, 32(%r12)
subl %r13d, 40(%rbp)
jne .L166
movq 16(%rbp), %rax
movq %rax, 32(%rbp)
jmp .L166
.L195:
movq 24(%r12), %rdi
movq 32(%rbp), %rsi
movl %r13d, %r14d
movq %r14, %rdx
call memcpy
addq %r14, 24(%r12)
addq %r14, 32(%rbp)
addq %r14, 40(%r12)
subl %r13d, 32(%r12)
subl %r13d, 40(%rbp)
jne .L162
movq 16(%rbp), %rax
movq %rax, 32(%rbp)
jmp .L162
.LHOTE3:
.LHOTB4:
.cfi_endproc
.size deflate_slow, .-deflate_slow
# ----------------------
.p2align 4,,15
# ----------------------
.local deflate_stored
.type deflate_stored, @function
deflate_stored:
.cfi_startproc
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbp
pushq %rbx
movq %rdi, %rbx
subq $24, %rsp
movq 24(%rdi), %rax
movl %esi, 4(%rsp)
leaq -5(%rax), %rbp
movl $65535, %eax
cmpq $65535, %rbp
cmovae %rax, %rbp
jmp .L208
.p2align 4,,10
.p2align 3
.L205:
movq (%rbx), %rax
movl 32(%rax), %ecx
testl %ecx, %ecx
je .L207
.L237:
movl 156(%rbx), %eax
movq 136(%rbx), %rcx
.L202:
movl 68(%rbx), %edi
movl %eax, %esi
subl %ecx, %esi
leal -262(%rdi), %edx
cmpl %edx, %esi
jae .L235
.L208:
movl 164(%rbx), %eax
cmpl $1, %eax
jbe .L236
.L198:
addl 156(%rbx), %eax
movq 136(%rbx), %rcx
movl $0, 164(%rbx)
leaq (%rbp,%rcx), %rdx
testl %eax, %eax
movl %eax, 156(%rbx)
je .L201
movl %eax, %esi
cmpq %rsi, %rdx
ja .L202
.L201:
subl %edx, %eax
movl %edx, 156(%rbx)
movl %edx, %edx
subq %rcx, %rdx
xorl %esi, %esi
testq %rcx, %rcx
movl %eax, 164(%rbx)
js .L203
movl %ecx, %esi
addq 80(%rbx), %rsi
.L203:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r14
movl 156(%rbx), %eax
movq 56(%r14), %r15
movq %rax, 136(%rbx)
movq %r15, %rdi
call _tr_flush_bits
movl 40(%r15), %r13d
movl 32(%r14), %eax
cmpl %r13d, %eax
cmovbe %eax, %r13d
testl %r13d, %r13d
je .L205
movq 24(%r14), %rdi
movq 32(%r15), %rsi
movl %r13d, %r12d
movq %r12, %rdx
call memcpy
addq %r12, 24(%r14)
addq %r12, 32(%r15)
addq %r12, 40(%r14)
subl %r13d, 32(%r14)
subl %r13d, 40(%r15)
jne .L205
movq 16(%r15), %rax
movq %rax, 32(%r15)
movq (%rbx), %rax
movl 32(%rax), %ecx
testl %ecx, %ecx
jne .L237
.L207:
xorl %eax, %eax
.L200:
addq $24, %rsp
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.p2align 4,,10
.p2align 3
.L236:
movq %rbx, %rdi
call fill_window
movl 164(%rbx), %eax
testl %eax, %eax
jne .L198
movl 4(%rsp), %esi
testl %esi, %esi
je .L207
cmpl $4, 4(%rsp)
movl $0, 5916(%rbx)
je .L238
movl 156(%rbx), %edx
movq 136(%rbx), %rcx
movl $1, %eax
cmpq %rcx, %rdx
jle .L200
subq %rcx, %rdx
xorl %esi, %esi
testq %rcx, %rcx
js .L219
movl %ecx, %ecx
addq 80(%rbx), %rcx
movq %rcx, %rsi
.L219:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r12
movl 156(%rbx), %eax
movq 56(%r12), %rbp
movq %rax, 136(%rbx)
movq %rbp, %rdi
call _tr_flush_bits
movl 40(%rbp), %r13d
movl 32(%r12), %eax
cmpl %r13d, %eax
cmovbe %eax, %r13d
testl %r13d, %r13d
jne .L239
.L221:
movq (%rbx), %rax
movl 32(%rax), %eax
testl %eax, %eax
setne %al
movzbl %al, %eax
jmp .L200
.p2align 4,,10
.p2align 3
.L235:
movl %eax, %edx
xorl %esi, %esi
subq %rcx, %rdx
testq %rcx, %rcx
js .L209
movl %ecx, %ecx
addq 80(%rbx), %rcx
movq %rcx, %rsi
.L209:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r14
movl 156(%rbx), %eax
movq 56(%r14), %r15
movq %rax, 136(%rbx)
movq %r15, %rdi
call _tr_flush_bits
movl 40(%r15), %r13d
movl 32(%r14), %eax
cmpl %r13d, %eax
cmovbe %eax, %r13d
testl %r13d, %r13d
jne .L240
.L211:
movq (%rbx), %rax
movl 32(%rax), %edx
testl %edx, %edx
jne .L208
jmp .L207
.p2align 4,,10
.p2align 3
.L240:
movq 24(%r14), %rdi
movq 32(%r15), %rsi
movl %r13d, %ecx
movq %rcx, %rdx
movq %rcx, 8(%rsp)
call memcpy
movq 8(%rsp), %rcx
addq %rcx, 24(%r14)
addq %rcx, 32(%r15)
addq %rcx, 40(%r14)
subl %r13d, 32(%r14)
subl %r13d, 40(%r15)
jne .L211
movq 16(%r15), %rax
movq %rax, 32(%r15)
jmp .L211
.L238:
movl 156(%rbx), %edx
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L215
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L215:
movl $1, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r12
movl 156(%rbx), %eax
movq 56(%r12), %rbp
movq %rax, 136(%rbx)
movq %rbp, %rdi
call _tr_flush_bits
movl 40(%rbp), %r13d
movl 32(%r12), %eax
cmpl %r13d, %eax
cmovbe %eax, %r13d
testl %r13d, %r13d
jne .L241
.L217:
movq (%rbx), %rax
cmpl $1, 32(%rax)
sbbl %eax, %eax
addl $3, %eax
jmp .L200
.L239:
movq 24(%r12), %rdi
movq 32(%rbp), %rsi
movl %r13d, %r14d
movq %r14, %rdx
call memcpy
addq %r14, 24(%r12)
addq %r14, 32(%rbp)
addq %r14, 40(%r12)
subl %r13d, 32(%r12)
subl %r13d, 40(%rbp)
jne .L221
movq 16(%rbp), %rax
movq %rax, 32(%rbp)
jmp .L221
.L241:
movq 24(%r12), %rdi
movq 32(%rbp), %rsi
movl %r13d, %r14d
movq %r14, %rdx
call memcpy
addq %r14, 24(%r12)
addq %r14, 32(%rbp)
addq %r14, 40(%r12)
subl %r13d, 32(%r12)
subl %r13d, 40(%rbp)
jne .L217
movq 16(%rbp), %rax
movq %rax, 32(%rbp)
jmp .L217
.LHOTE4:
.LHOTB5:
.cfi_endproc
.size deflate_stored, .-deflate_stored
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflateSetDictionary
.type deflateSetDictionary, @function
deflateSetDictionary:
.cfi_startproc
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbp
pushq %rbx
movq %rdi, %rbx
subq $24, %rsp
testq %rdi, %rdi
je .L261
testq %rsi, %rsi
movq %rsi, %r15
movq 56(%rdi), %r13
je .L261
testq %r13, %r13
je .L261
movl 44(%r13), %ebp
cmpl $2, %ebp
je .L261
cmpl $1, %ebp
movl %edx, %r14d
je .L270
movl 164(%r13), %eax
testl %eax, %eax
jne .L261
movl 68(%r13), %eax
movl $0, 44(%r13)
cmpl %eax, %r14d
jae .L271
.L247:
movl 8(%rbx), %eax
movq (%rbx), %r12
movl %r14d, 8(%rbx)
movq %r15, (%rbx)
movl %eax, 12(%rsp)
.p2align 4,,10
.p2align 3
.L269:
movq %r13, %rdi
call fill_window
movl 164(%r13), %esi
cmpl $2, %esi
jbe .L249
movl 156(%r13), %edx
movl 112(%r13), %eax
movl 128(%r13), %ecx
movq 80(%r13), %r15
movl 124(%r13), %r14d
movq 96(%r13), %r11
movl 76(%r13), %r10d
movq 104(%r13), %r9
leal -2(%rdx,%rsi), %r8d
movq %rbx, (%rsp)
.p2align 4,,10
.p2align 3
.L250:
leal 2(%rdx), %esi
sall %cl, %eax
movl %edx, %edi
andl %r10d, %edi
movzbl (%r15,%rsi), %esi
xorl %esi, %eax
andl %r14d, %eax
movl %eax, %esi
movl %eax, 112(%r13)
leaq (%r9,%rsi,2), %rsi
movzwl (%rsi), %ebx
movw %bx, (%r11,%rdi,2)
movw %dx, (%rsi)
addl $1, %edx
cmpl %r8d, %edx
jne .L250
movq (%rsp), %rbx
movl %edx, 156(%r13)
movl $2, 164(%r13)
jmp .L269
.L249:
movl %esi, %eax
addl 156(%r13), %eax
movl %esi, 5916(%r13)
movl $0, 164(%r13)
movl $2, 168(%r13)
movl $2, 144(%r13)
movl $0, 152(%r13)
movl %eax, 156(%r13)
movq %rax, 136(%r13)
movl 12(%rsp), %eax
movq %r12, (%rbx)
movl %eax, 8(%rbx)
movl %ebp, 44(%r13)
xorl %eax, %eax
.L262:
addq $24, %rsp
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.L271:
testl %ebp, %ebp
je .L272
.L246:
subl %eax, %r14d
addq %r14, %r15
movl %eax, %r14d
jmp .L247
.L270:
cmpl $42, 8(%r13)
movl $-2, %eax
jne .L262
movl 164(%r13), %edx
testl %edx, %edx
jne .L262
movq 96(%rbx), %rdi
movl %r14d, %edx
movq %r15, %rsi
call adler32
movq %rax, 96(%rbx)
movl 68(%r13), %eax
movl $0, 44(%r13)
cmpl %eax, %r14d
jae .L246
jmp .L247
.L272:
movl 116(%r13), %eax
movq 104(%r13), %rdi
xorl %ecx, %ecx
xorl %esi, %esi
subl $1, %eax
leaq (%rax,%rax), %rdx
movw %cx, (%rdi,%rax,2)
call memset
movl $0, 156(%r13)
movq $0, 136(%r13)
movl $0, 5916(%r13)
movl 68(%r13), %eax
jmp .L246
.L261:
movl $-2, %eax
jmp .L262
.LHOTE5:
.LHOTB6:
.cfi_endproc
.size deflateSetDictionary, .-deflateSetDictionary
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflateResetKeep
.type deflateResetKeep, @function
deflateResetKeep:
.cfi_startproc
testq %rdi, %rdi
je .L280
pushq %rbp
pushq %rbx
subq $8, %rsp
movq 56(%rdi), %rbp
testq %rbp, %rbp
je .L283
cmpq $0, 64(%rdi)
je .L283
cmpq $0, 72(%rdi)
je .L283
movq 16(%rbp), %rax
movq $0, 40(%rdi)
movq %rdi, %rbx
movq $0, 16(%rdi)
movq $0, 48(%rdi)
movl $2, 88(%rdi)
movl $0, 40(%rbp)
movq %rax, 32(%rbp)
movl 44(%rbp), %eax
testl %eax, %eax
js .L286
jne .L276
movl $113, 8(%rbp)
.L278:
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
call adler32
.L279:
movq %rax, 96(%rbx)
movq %rbp, %rdi
movl $0, 64(%rbp)
call _tr_init
xorl %eax, %eax
.L284:
addq $8, %rsp
popq %rbx
popq %rbp
ret
.p2align 4,,10
.p2align 3
.L286:
negl %eax
movl %eax, 44(%rbp)
.L276:
cmpl $2, %eax
movl $42, 8(%rbp)
jne .L278
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
call crc32
jmp .L279
.p2align 4,,10
.p2align 3
.L283:
movl $-2, %eax
jmp .L284
.L280:
movl $-2, %eax
ret
.LHOTE6:
.LHOTB7:
.cfi_endproc
.size deflateResetKeep, .-deflateResetKeep
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflateReset
.type deflateReset, @function
deflateReset:
.cfi_startproc
testq %rdi, %rdi
je .L294
pushq %rbp
pushq %rbx
subq $8, %rsp
movq 56(%rdi), %rbp
testq %rbp, %rbp
je .L297
cmpq $0, 64(%rdi)
je .L297
cmpq $0, 72(%rdi)
je .L297
movq 16(%rbp), %rax
movq $0, 40(%rdi)
movq %rdi, %rbx
movq $0, 16(%rdi)
movq $0, 48(%rdi)
movl $2, 88(%rdi)
movl $0, 40(%rbp)
movq %rax, 32(%rbp)
movl 44(%rbp), %eax
testl %eax, %eax
js .L300
jne .L290
movl $113, 8(%rbp)
.L292:
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
call adler32
.L293:
movq %rax, 96(%rbx)
movq %rbp, %rdi
movl $0, 64(%rbp)
call _tr_init
movq 56(%rbx), %rbx
xorl %ecx, %ecx
xorl %esi, %esi
movl 68(%rbx), %eax
movq 104(%rbx), %rdi
addq %rax, %rax
movq %rax, 88(%rbx)
movl 116(%rbx), %eax
subl $1, %eax
leaq (%rax,%rax), %rdx
movw %cx, (%rdi,%rax,2)
call memset
movslq 180(%rbx), %rax
movl $0, 156(%rbx)
movq $0, 136(%rbx)
movl $0, 164(%rbx)
movl $0, 5916(%rbx)
movl $2, 168(%rbx)
movl $2, 144(%rbx)
movl $0, 152(%rbx)
salq $4, %rax
movl $0, 112(%rbx)
leaq configuration_table(%rax), %rdx
movzwl configuration_table+2(%rax), %ecx
movzwl configuration_table(%rax), %eax
movl %eax, 188(%rbx)
movzwl 4(%rdx), %eax
movl %ecx, 176(%rbx)
movl %eax, 192(%rbx)
movzwl 6(%rdx), %eax
movl %eax, 172(%rbx)
xorl %eax, %eax
.L298:
addq $8, %rsp
popq %rbx
popq %rbp
ret
.p2align 4,,10
.p2align 3
.L300:
negl %eax
movl %eax, 44(%rbp)
.L290:
cmpl $2, %eax
movl $42, 8(%rbp)
jne .L292
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
call crc32
jmp .L293
.p2align 4,,10
.p2align 3
.L297:
movl $-2, %eax
jmp .L298
.L294:
movl $-2, %eax
ret
.LHOTE7:
.LHOTB8:
.cfi_endproc
.size deflateReset, .-deflateReset
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflateSetHeader
.type deflateSetHeader, @function
deflateSetHeader:
.cfi_startproc
testq %rdi, %rdi
je .L303
movq 56(%rdi), %rdx
movl $-2, %eax
testq %rdx, %rdx
je .L302
cmpl $2, 44(%rdx)
jne .L302
movq %rsi, 48(%rdx)
xorl %eax, %eax
ret
.p2align 4,,10
.p2align 3
.L302:
rep; ret
.L303:
movl $-2, %eax
ret
.LHOTE8:
.LHOTB9:
.cfi_endproc
.size deflateSetHeader, .-deflateSetHeader
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflatePending
.type deflatePending, @function
deflatePending:
.cfi_startproc
testq %rdi, %rdi
je .L310
movq 56(%rdi), %rax
testq %rax, %rax
je .L310
testq %rsi, %rsi
je .L308
movl 40(%rax), %ecx
movl %ecx, (%rsi)
.L308:
testq %rdx, %rdx
je .L311
movl 5924(%rax), %eax
movl %eax, (%rdx)
xorl %eax, %eax
ret
.p2align 4,,10
.p2align 3
.L311:
xorl %eax, %eax
ret
.p2align 4,,10
.p2align 3
.L310:
movl $-2, %eax
ret
.LHOTE9:
.LHOTB10:
.cfi_endproc
.size deflatePending, .-deflatePending
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflatePrime
.type deflatePrime, @function
deflatePrime:
.cfi_startproc
testq %rdi, %rdi
je .L318
pushq %r14
pushq %r13
pushq %r12
pushq %rbp
pushq %rbx
movq 56(%rdi), %r12
testq %r12, %r12
je .L319
movq 32(%r12), %rax
addq $2, %rax
cmpq %rax, 5888(%r12)
jb .L320
movl %esi, %r13d
movl %edx, %r14d
movl $16, %ebx
.p2align 4,,10
.p2align 3
.L317:
movl 5924(%r12), %r8d
movl %ebx, %ebp
movl $1, %eax
movq %r12, %rdi
subl %r8d, %ebp
cmpl %ebp, %r13d
cmovle %r13d, %ebp
movl %ebp, %ecx
sall %cl, %eax
movl %r8d, %ecx
addl %ebp, %r8d
subl $1, %eax
movl %r8d, 5924(%r12)
andl %r14d, %eax
sall %cl, %eax
orw %ax, 5920(%r12)
call _tr_flush_bits
movl %ebp, %ecx
sarl %cl, %r14d
subl %ebp, %r13d
jne .L317
xorl %eax, %eax
.L316:
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
ret
.L320:
movl $-5, %eax
jmp .L316
.L319:
movl $-2, %eax
jmp .L316
.L318:
movl $-2, %eax
ret
.LHOTE10:
.LHOTB11:
.cfi_endproc
.size deflatePrime, .-deflatePrime
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflateTune
.type deflateTune, @function
deflateTune:
.cfi_startproc
testq %rdi, %rdi
je .L326
movq 56(%rdi), %rax
testq %rax, %rax
je .L326
movl %esi, 188(%rax)
movl %edx, 176(%rax)
movl %ecx, 192(%rax)
movl %r8d, 172(%rax)
xorl %eax, %eax
ret
.p2align 4,,10
.p2align 3
.L326:
movl $-2, %eax
ret
.LHOTE11:
.LHOTB12:
.cfi_endproc
.size deflateTune, .-deflateTune
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflateBound
.type deflateBound, @function
deflateBound:
.cfi_startproc
leaq 7(%rsi), %r8
leaq 63(%rsi), %rax
movq %r8, %rdx
shrq $6, %rax
shrq $3, %rdx
addq %rdx, %rax
addq %rsi, %rax
testq %rdi, %rdi
je .L328
movq 56(%rdi), %rcx
testq %rcx, %rcx
je .L328
movl 44(%rcx), %edx
cmpl $1, %edx
je .L332
cmpl $2, %edx
je .L333
cmpl $1, %edx
sbbq %rdx, %rdx
notq %rdx
andl $6, %edx
.L334:
cmpl $15, 72(%rcx)
je .L353
.L340:
leaq 5(%rdx,%rax), %rax
ret
.p2align 4,,10
.p2align 3
.L333:
movq 48(%rcx), %r9
testq %r9, %r9
je .L344
cmpq $0, 24(%r9)
je .L345
movl 32(%r9), %edx
addl $2, %edx
addq $18, %rdx
.L335:
movq 40(%r9), %rdi
testq %rdi, %rdi
je .L336
subq %rdx, %rdi
.p2align 4,,10
.p2align 3
.L337:
addq $1, %rdx
cmpb $0, -1(%rdi,%rdx)
jne .L337
.L336:
movq 56(%r9), %rdi
testq %rdi, %rdi
je .L338
subq %rdx, %rdi
.p2align 4,,10
.p2align 3
.L339:
addq $1, %rdx
cmpb $0, -1(%rdi,%rdx)
jne .L339
.L338:
movl 68(%r9), %r9d
leaq 2(%rdx), %rdi
testl %r9d, %r9d
cmovne %rdi, %rdx
cmpl $15, 72(%rcx)
jne .L340
.L353:
cmpl $15, 120(%rcx)
jne .L340
movq %rsi, %rax
shrq $12, %rax
addq %rax, %r8
movq %rsi, %rax
shrq $25, %rsi
shrq $14, %rax
addq %rax, %r8
leaq (%r8,%rsi), %rax
addq %rdx, %rax
ret
.p2align 4,,10
.p2align 3
.L332:
cmpl $1, 156(%rcx)
sbbq %rdx, %rdx
andq $-4, %rdx
addq $10, %rdx
jmp .L334
.p2align 4,,10
.p2align 3
.L328:
addq $11, %rax
ret
.p2align 4,,10
.p2align 3
.L344:
movl $18, %edx
jmp .L334
.p2align 4,,10
.p2align 3
.L345:
movl $18, %edx
jmp .L335
.LHOTE12:
.LHOTB13:
.cfi_endproc
.size deflateBound, .-deflateBound
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflate
.type deflate, @function
deflate:
.cfi_startproc
testq %rdi, %rdi
je .L524
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbp
pushq %rbx
subq $40, %rsp
movq 56(%rdi), %rbx
testq %rbx, %rbx
je .L526
cmpl $5, %esi
ja .L526
cmpq $0, 24(%rdi)
je .L356
cmpq $0, (%rdi)
je .L624
.L357:
cmpl $4, %esi
movl 8(%rbx), %eax
setne 27(%rsp)
je .L358
cmpl $666, %eax
je .L356
.L358:
movl 32(%rdi), %r9d
testl %r9d, %r9d
je .L625
cmpl $42, %eax
movl 64(%rbx), %r13d
movl %esi, %ebp
movq %rdi, %r14
movq %rdi, (%rbx)
movl %esi, 64(%rbx)
je .L626
cmpl $69, %eax
je .L609
.L643:
cmpl $73, %eax
movl 40(%rbx), %edi
je .L627
.L364:
movl %edi, %edx
.L509:
cmpl $91, %eax
je .L628
.L402:
cmpl $103, %eax
je .L629
.L413:
testl %edx, %edx
jne .L630
movl 8(%r14), %esi
testl %esi, %esi
je .L631
cmpl $666, 8(%rbx)
je .L522
.L431:
movl 184(%rbx), %eax
cmpl $2, %eax
je .L429
cmpl $3, %eax
je .L632
movslq 180(%rbx), %rax
movl %ebp, %esi
movq %rbx, %rdi
salq $4, %rax
call *configuration_table+8(%rax)
leal -2(%rax), %edx
cmpl $1, %edx
jbe .L491
movl %eax, %edx
andl $-3, %edx
.L492:
testl %edx, %edx
jne .L494
.L493:
movl 32(%r14), %r10d
testl %r10d, %r10d
je .L633
.L618:
xorl %eax, %eax
.L608:
addq $40, %rsp
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.p2align 4,,10
.p2align 3
.L631:
xorl %eax, %eax
cmpl $5, %ebp
leal (%rbp,%rbp), %ecx
sete %al
leal (%r13,%r13), %edx
leal (%rax,%rax,8), %eax
subl %eax, %ecx
xorl %eax, %eax
cmpl $4, %r13d
setg %al
leal (%rax,%rax,8), %eax
subl %eax, %edx
cmpl %edx, %ecx
jg .L426
cmpb $0, 27(%rsp)
jne .L522
.L426:
movl 8(%rbx), %eax
.L428:
movl 164(%rbx), %r15d
testl %r15d, %r15d
jne .L431
testl %ebp, %ebp
je .L618
cmpl $666, %eax
jne .L431
jmp .L433
.p2align 4,,10
.p2align 3
.L634:
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L438
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L438:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r15
movl 156(%rbx), %eax
movq 56(%r15), %rcx
movq %rax, 136(%rbx)
movq %rcx, %rdi
movq %rcx, 8(%rsp)
call _tr_flush_bits
movq 8(%rsp), %rcx
movl 32(%r15), %eax
movl 40(%rcx), %r13d
cmpl %r13d, %eax
cmovbe %eax, %r13d
testl %r13d, %r13d
je .L440
movq 32(%rcx), %rsi
movq 24(%r15), %rdi
movl %r13d, %r8d
movq %r8, %rdx
movq %rcx, 16(%rsp)
movq %r8, 8(%rsp)
call memcpy
movq 16(%rsp), %rcx
movq 8(%rsp), %r8
addq %r8, 24(%r15)
addq %r8, 32(%rcx)
addq %r8, 40(%r15)
subl %r13d, 32(%r15)
subl %r13d, 40(%rcx)
jne .L440
movq 16(%rcx), %rax
movq %rax, 32(%rcx)
.L440:
movq (%rbx), %rax
movl 32(%rax), %r11d
testl %r11d, %r11d
je .L493
.L429:
movl 164(%rbx), %eax
jmp .L437
.p2align 4,,10
.p2align 3
.L434:
movl 156(%rbx), %eax
movl 5884(%rbx), %ecx
xorl %r12d, %r12d
movq 80(%rbx), %rdx
movq 5888(%rbx), %rsi
movl $0, 144(%rbx)
movzbl (%rdx,%rax), %eax
movw %r12w, (%rsi,%rcx,2)
movq %rcx, %rdx
movq 5872(%rbx), %rsi
addl $1, %edx
movl %edx, 5884(%rbx)
movb %al, (%rsi,%rcx)
addw $1, 196(%rbx,%rax,4)
movl 5880(%rbx), %eax
movl 156(%rbx), %edi
leal -1(%rax), %ecx
movl 164(%rbx), %eax
leal 1(%rdi), %edx
movl %edx, 156(%rbx)
subl $1, %eax
cmpl %ecx, 5884(%rbx)
movl %eax, 164(%rbx)
je .L634
.L437:
testl %eax, %eax
jne .L434
movq %rbx, %rdi
call fill_window
movl 164(%rbx), %r13d
testl %r13d, %r13d
jne .L434
testl %ebp, %ebp
je .L493
cmpl $4, %ebp
movl $0, 5916(%rbx)
je .L635
movl 5884(%rbx), %r9d
testl %r9d, %r9d
je .L585
movl 156(%rbx), %edx
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L451
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L451:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r15
movl 156(%rbx), %eax
movq 56(%r15), %r13
movq %rax, 136(%rbx)
movq %r13, %rdi
call _tr_flush_bits
movl 40(%r13), %ecx
movl 32(%r15), %eax
cmpl %ecx, %eax
cmovbe %eax, %ecx
testl %ecx, %ecx
jne .L636
.L489:
movq (%rbx), %rax
movl 32(%rax), %r11d
xorl %eax, %eax
testl %r11d, %r11d
setne %al
movl %eax, %edx
jmp .L492
.p2align 4,,10
.p2align 3
.L494:
cmpl $1, %eax
je .L585
.L433:
cmpb $0, 27(%rsp)
jne .L618
movl 44(%rbx), %eax
testl %eax, %eax
jle .L552
cmpl $2, %eax
je .L637
movl 40(%rbx), %eax
movq 96(%r14), %rdx
movq 16(%rbx), %rcx
shrq $16, %rdx
leal 1(%rax), %esi
movl %esi, 40(%rbx)
movl %edx, %esi
shrl $8, %esi
movb %sil, (%rcx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %esi
movl %esi, 40(%rbx)
movb %dl, (%rcx,%rax)
movl 40(%rbx), %eax
movzwl 96(%r14), %edx
movq 16(%rbx), %rcx
leal 1(%rax), %esi
movl %esi, 40(%rbx)
movl %edx, %esi
shrl $8, %esi
movb %sil, (%rcx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %esi
movl %esi, 40(%rbx)
movb %dl, (%rcx,%rax)
.L503:
movq 56(%r14), %r12
movq %r12, %rdi
call _tr_flush_bits
movl 40(%r12), %ebp
movl 32(%r14), %eax
cmpl %ebp, %eax
cmovbe %eax, %ebp
testl %ebp, %ebp
jne .L638
.L505:
movl 44(%rbx), %eax
testl %eax, %eax
jle .L507
negl %eax
movl %eax, 44(%rbx)
.L507:
movl 40(%rbx), %esi
xorl %eax, %eax
testl %esi, %esi
sete %al
addq $40, %rsp
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.p2align 4,,10
.p2align 3
.L630:
movq 56(%r14), %r15
movq %r15, %rdi
call _tr_flush_bits
movl 40(%r15), %r13d
movl 32(%r14), %eax
cmpl %r13d, %eax
cmovbe %eax, %r13d
testl %r13d, %r13d
jne .L639
testl %eax, %eax
je .L617
.L422:
movl 8(%rbx), %eax
cmpl $666, %eax
je .L640
movl 8(%r14), %edx
testl %edx, %edx
je .L428
jmp .L431
.p2align 4,,10
.p2align 3
.L626:
cmpl $2, 44(%rbx)
je .L641
movl 72(%rbx), %eax
xorl %ecx, %ecx
sall $12, %eax
subl $30720, %eax
cmpl $1, 184(%rbx)
jle .L642
.L373:
movl 156(%rbx), %r12d
orl %eax, %ecx
movl $138547333, %edx
movl %ecx, %eax
movl $113, 8(%rbx)
orl $32, %eax
testl %r12d, %r12d
cmovne %eax, %ecx
movl %ecx, %eax
mull %edx
subl %edx, %ecx
shrl $1, %ecx
addl %ecx, %edx
movq 16(%rbx), %rcx
shrl $4, %edx
movl %edx, %eax
sall $5, %eax
subl %edx, %eax
movl 40(%rbx), %edx
addl $31, %eax
leal 1(%rdx), %esi
movl %esi, 40(%rbx)
movl %eax, %esi
shrl $8, %esi
movb %sil, (%rcx,%rdx)
movl 40(%rbx), %edx
movq 16(%rbx), %rcx
leal 1(%rdx), %esi
movl %esi, 40(%rbx)
movb %al, (%rcx,%rdx)
movl 156(%rbx), %r15d
testl %r15d, %r15d
je .L375
movl 40(%rbx), %eax
movq 96(%r14), %rdx
movq 16(%rbx), %rcx
shrq $16, %rdx
leal 1(%rax), %esi
movl %esi, 40(%rbx)
movl %edx, %esi
shrl $8, %esi
movb %sil, (%rcx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %esi
movl %esi, 40(%rbx)
movb %dl, (%rcx,%rax)
movl 40(%rbx), %eax
movzwl 96(%r14), %edx
movq 16(%rbx), %rcx
leal 1(%rax), %esi
movl %esi, 40(%rbx)
movl %edx, %esi
shrl $8, %esi
movb %sil, (%rcx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %esi
movl %esi, 40(%rbx)
movb %dl, (%rcx,%rax)
.L375:
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
call adler32
movq %rax, 96(%r14)
movl 8(%rbx), %eax
cmpl $69, %eax
jne .L643
.L609:
movq 48(%rbx), %rax
.L372:
cmpq $0, 24(%rax)
je .L377
movl 56(%rbx), %ecx
movl 32(%rax), %esi
movl 40(%rbx), %edi
movzwl %si, %edx
cmpl %ecx, %edx
jbe .L388
movl %edi, %r8d
movl %edi, %edx
jmp .L386
.p2align 4,,10
.p2align 3
.L379:
movq 24(%rax), %rax
addl $1, %edx
movq 16(%rbx), %r9
movl %edx, 40(%rbx)
movzbl (%rax,%rcx), %eax
movb %al, (%r9,%rsi)
movl 56(%rbx), %eax
leal 1(%rax), %ecx
movq 48(%rbx), %rax
movl %ecx, 56(%rbx)
movl 32(%rax), %esi
movzwl %si, %edx
cmpl %ecx, %edx
jbe .L385
movl 40(%rbx), %edx
.L386:
movl %edx, %esi
cmpq 24(%rbx), %rsi
jne .L379
cmpl %edx, %edi
jae .L380
movl 68(%rax), %r11d
testl %r11d, %r11d
jne .L644
.L380:
movq 56(%r14), %r12
movq %r12, %rdi
call _tr_flush_bits
movl 40(%r12), %r15d
movl 32(%r14), %eax
cmpl %r15d, %eax
cmovbe %eax, %r15d
testl %r15d, %r15d
jne .L645
.L382:
movl 40(%rbx), %esi
cmpq 24(%rbx), %rsi
movq %rsi, %rdi
movl %esi, %r8d
je .L646
movq 48(%rbx), %rax
movl 56(%rbx), %ecx
movl %esi, %edx
jmp .L379
.p2align 4,,10
.p2align 3
.L385:
movl 68(%rax), %r10d
movl 40(%rbx), %edi
testl %r10d, %r10d
je .L388
cmpl %r8d, %edi
jbe .L388
subl %r8d, %edi
movq %r8, %rsi
addq 16(%rbx), %rsi
movl %edi, %edx
movq 96(%r14), %rdi
call crc32
movq %rax, 96(%r14)
movq 48(%rbx), %rax
movl 56(%rbx), %ecx
movl 40(%rbx), %edi
movl 32(%rax), %esi
.p2align 4,,10
.p2align 3
.L388:
cmpl %esi, %ecx
je .L390
movl 8(%rbx), %eax
cmpl $73, %eax
jne .L364
.p2align 4,,10
.p2align 3
.L627:
movq 48(%rbx), %rax
.L517:
cmpq $0, 40(%rax)
je .L392
movl %edi, %esi
movl %esi, %edx
jmp .L400
.p2align 4,,10
.p2align 3
.L393:
movq 40(%rax), %rdi
movl 56(%rbx), %eax
addl $1, %edx
leal 1(%rax), %r8d
movl %r8d, 56(%rbx)
movzbl (%rdi,%rax), %eax
movq 16(%rbx), %rdi
movl %edx, 40(%rbx)
testb %al, %al
movb %al, (%rdi,%rcx)
je .L399
movl 40(%rbx), %edx
movq 48(%rbx), %rax
.L400:
movl %edx, %ecx
cmpq 24(%rbx), %rcx
jne .L393
cmpl %edx, %esi
jae .L394
movl 68(%rax), %r9d
testl %r9d, %r9d
jne .L647
.L394:
movq 56(%r14), %r12
movq %r12, %rdi
call _tr_flush_bits
movl 40(%r12), %r15d
movl 32(%r14), %eax
cmpl %r15d, %eax
cmovbe %eax, %r15d
testl %r15d, %r15d
jne .L648
.L396:
movl 40(%rbx), %esi
movq 48(%rbx), %rax
movl %esi, %ecx
cmpq 24(%rbx), %rcx
je .L508
movl %esi, %edx
jmp .L393
.p2align 4,,10
.p2align 3
.L640:
movl 8(%r14), %ecx
testl %ecx, %ecx
je .L428
.p2align 4,,10
.p2align 3
.L522:
movq z_errmsg+56(%rip), %rax
movq %rax, 48(%r14)
addq $40, %rsp
movl $-5, %eax
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.p2align 4,,10
.p2align 3
.L633:
movl $-1, 64(%rbx)
jmp .L618
.L457:
cmpl $4, %ebp
movl $0, 5916(%rbx)
je .L649
movl 5884(%rbx), %r12d
testl %r12d, %r12d
jne .L650
.L585:
cmpl $1, %ebp
je .L651
cmpl $5, %ebp
je .L497
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
movq %rbx, %rdi
call _tr_stored_block
cmpl $3, %ebp
jne .L497
movl 116(%rbx), %eax
movq 104(%rbx), %rdi
xorl %r8d, %r8d
xorl %esi, %esi
subl $1, %eax
leaq (%rax,%rax), %rdx
movw %r8w, (%rdi,%rax,2)
call memset
movl 164(%rbx), %r9d
testl %r9d, %r9d
jne .L497
movl $0, 156(%rbx)
movq $0, 136(%rbx)
movl $0, 5916(%rbx)
.L497:
movq 56(%r14), %r13
movq %r13, %rdi
call _tr_flush_bits
movl 40(%r13), %ebp
movl 32(%r14), %eax
cmpl %ebp, %eax
cmovbe %eax, %ebp
testl %ebp, %ebp
jne .L652
.L500:
testl %eax, %eax
jne .L433
.L617:
movl $-1, 64(%rbx)
addq $40, %rsp
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.L639:
movq 24(%r14), %rdi
movq 32(%r15), %rsi
movl %r13d, %ecx
movq %rcx, %rdx
movq %rcx, 8(%rsp)
call memcpy
movq 8(%rsp), %rcx
addq %rcx, 24(%r14)
addq %rcx, 32(%r15)
addq %rcx, 40(%r14)
subl %r13d, 32(%r14)
subl %r13d, 40(%r15)
jne .L614
movq 16(%r15), %rax
movq %rax, 32(%r15)
.L614:
movl 32(%r14), %eax
testl %eax, %eax
jne .L422
jmp .L617
.L390:
movl $0, 56(%rbx)
movl $73, 8(%rbx)
jmp .L517
.L642:
movl 180(%rbx), %edx
cmpl $1, %edx
jle .L373
cmpl $5, %edx
movb $64, %cl
jle .L373
cmpl $6, %edx
movb $-64, %cl
movl $128, %edx
cmove %edx, %ecx
jmp .L373
.p2align 4,,10
.p2align 3
.L648:
movq 24(%r14), %rdi
movq 32(%r12), %rsi
movl %r15d, %r8d
movq %r8, %rdx
movq %r8, 8(%rsp)
call memcpy
movq 8(%rsp), %r8
addq %r8, 24(%r14)
addq %r8, 32(%r12)
addq %r8, 40(%r14)
subl %r15d, 32(%r14)
subl %r15d, 40(%r12)
jne .L396
movq 16(%r12), %rax
movq %rax, 32(%r12)
jmp .L396
.p2align 4,,10
.p2align 3
.L645:
movq 24(%r14), %rdi
movq 32(%r12), %rsi
movl %r15d, %r8d
movq %r8, %rdx
movq %r8, 8(%rsp)
call memcpy
movq 8(%rsp), %r8
addq %r8, 24(%r14)
addq %r8, 32(%r12)
addq %r8, 40(%r14)
subl %r15d, 32(%r14)
subl %r15d, 40(%r12)
jne .L382
movq 16(%r12), %rax
movq %rax, 32(%r12)
jmp .L382
.p2align 4,,10
.p2align 3
.L399:
movq 48(%rbx), %rax
movl 40(%rbx), %edx
movl 68(%rax), %ecx
testl %ecx, %ecx
je .L511
cmpl %esi, %edx
jbe .L511
movl %edx, %eax
movl %esi, %edx
movq 96(%r14), %rdi
subl %esi, %eax
movq %rdx, %rsi
addq 16(%rbx), %rsi
movl %eax, %edx
call crc32
movl 40(%rbx), %edx
movq %rax, 96(%r14)
movq 48(%rbx), %rax
.p2align 4,,10
.p2align 3
.L511:
movl $0, 56(%rbx)
movl $91, 8(%rbx)
.L519:
cmpq $0, 56(%rax)
je .L403
movl %edx, %edi
movl %edi, %esi
jmp .L411
.p2align 4,,10
.p2align 3
.L404:
movq 56(%rax), %rdx
movl 56(%rbx), %eax
addl $1, %esi
leal 1(%rax), %r8d
movl %r8d, 56(%rbx)
movzbl (%rdx,%rax), %eax
movq 16(%rbx), %r8
movl %esi, 40(%rbx)
testb %al, %al
movb %al, (%r8,%rcx)
je .L410
movl 40(%rbx), %esi
movq 48(%rbx), %rax
.L411:
movl %esi, %ecx
cmpq 24(%rbx), %rcx
jne .L404
cmpl %esi, %edi
jae .L405
movl 68(%rax), %r8d
testl %r8d, %r8d
jne .L653
.L405:
movq 56(%r14), %r12
movq %r12, %rdi
call _tr_flush_bits
movl 40(%r12), %r15d
movl 32(%r14), %eax
cmpl %r15d, %eax
cmovbe %eax, %r15d
testl %r15d, %r15d
jne .L654
.L407:
movl 40(%rbx), %edi
movq 48(%rbx), %rax
movl %edi, %ecx
cmpq 24(%rbx), %rcx
je .L409
movl %edi, %esi
jmp .L404
.p2align 4,,10
.p2align 3
.L654:
movq 24(%r14), %rdi
movq 32(%r12), %rsi
movl %r15d, %r8d
movq %r8, %rdx
movq %r8, 8(%rsp)
call memcpy
movq 8(%rsp), %r8
addq %r8, 24(%r14)
addq %r8, 32(%r12)
addq %r8, 40(%r14)
subl %r15d, 32(%r14)
subl %r15d, 40(%r12)
jne .L407
movq 16(%r12), %rax
movq %rax, 32(%r12)
jmp .L407
.p2align 4,,10
.p2align 3
.L410:
movq 48(%rbx), %rax
movl 68(%rax), %edx
testl %edx, %edx
movl 40(%rbx), %edx
je .L403
cmpl %edi, %edx
jbe .L403
movl %edx, %eax
movl %edi, %edx
movq %rdx, %rsi
addq 16(%rbx), %rsi
subl %edi, %eax
movq 96(%r14), %rdi
movl %eax, %edx
call crc32
movl 40(%rbx), %edx
movq %rax, 96(%r14)
movq 48(%rbx), %rax
.p2align 4,,10
.p2align 3
.L403:
movl $103, 8(%rbx)
.L521:
movl 68(%rax), %edi
testl %edi, %edi
je .L414
leal 2(%rdx), %eax
cmpq 24(%rbx), %rax
ja .L655
.L415:
leal 1(%rdx), %ecx
movq 16(%rbx), %rax
xorl %esi, %esi
xorl %edi, %edi
movl %ecx, 40(%rbx)
movq 96(%r14), %rcx
movb %cl, (%rax,%rdx)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %edx
movl %edx, 40(%rbx)
movq 96(%r14), %rdx
shrq $8, %rdx
movb %dl, (%rcx,%rax)
xorl %edx, %edx
call crc32
movl 40(%rbx), %edx
movq %rax, 96(%r14)
movl $113, 8(%rbx)
jmp .L413
.p2align 4,,10
.p2align 3
.L632:
movzbl _dist_code(%rip), %eax
movl $258, %r12d
leaq (%rbx,%rax,4), %r15
.L479:
movl 164(%rbx), %eax
jmp .L474
.p2align 4,,10
.p2align 3
.L456:
movl $0, 144(%rbx)
.L523:
movl 156(%rbx), %ecx
movq 80(%rbx), %rsi
testl %ecx, %ecx
jne .L459
xorl %ecx, %ecx
.L460:
movzbl (%rsi,%rcx), %eax
movl 5884(%rbx), %ecx
xorl %edi, %edi
movq 5888(%rbx), %rsi
movw %di, (%rsi,%rcx,2)
movq 5872(%rbx), %rsi
movq %rcx, %rdx
addl $1, %edx
movl %edx, 5884(%rbx)
movb %al, (%rsi,%rcx)
addw $1, 196(%rbx,%rax,4)
xorl %ecx, %ecx
movl 5880(%rbx), %eax
movl 156(%rbx), %edi
subl $1, %eax
cmpl %eax, 5884(%rbx)
leal 1(%rdi), %edx
movl 164(%rbx), %eax
movl %edx, 156(%rbx)
sete %cl
subl $1, %eax
testl %ecx, %ecx
movl %eax, 164(%rbx)
jne .L656
.L474:
cmpl $258, %eax
ja .L456
movq %rbx, %rdi
call fill_window
movl 164(%rbx), %eax
cmpl $258, %eax
ja .L456
testl %ebp, %ebp
je .L493
testl %eax, %eax
je .L457
cmpl $2, %eax
movl $0, 144(%rbx)
ja .L523
movq 80(%rbx), %rsi
movl 156(%rbx), %ecx
jmp .L460
.p2align 4,,10
.p2align 3
.L459:
leaq -1(%rsi,%rcx), %rdx
movzbl (%rdx), %r11d
movzbl (%rdx), %edi
cmpb %r11b, 1(%rdx)
jne .L460
movzbl 2(%rdx), %r8d
cmpl %r8d, %edi
jne .L460
movzbl 3(%rdx), %r8d
cmpl %r8d, %edi
jne .L460
addq $3, %rdx
leaq 258(%rsi,%rcx), %r9
jmp .L469
.p2align 4,,10
.p2align 3
.L461:
movzbl 2(%rdx), %r8d
cmpl %r8d, %edi
jne .L657
movzbl 3(%rdx), %r8d
cmpl %r8d, %edi
jne .L658
movzbl 4(%rdx), %r8d
cmpl %r8d, %edi
jne .L659
movzbl 5(%rdx), %r8d
cmpl %r8d, %edi
jne .L660
movzbl 6(%rdx), %r8d
cmpl %r8d, %edi
jne .L661
movzbl 7(%rdx), %r8d
cmpl %r8d, %edi
jne .L662
addq $8, %rdx
movzbl (%rdx), %r8d
cmpl %r8d, %edi
jne .L462
cmpq %r9, %rdx
jae .L462
.L469:
movzbl 1(%rdx), %r8d
cmpl %r8d, %edi
je .L461
addq $1, %rdx
.L462:
subq %rdx, %r9
movl %r12d, %edx
subl %r9d, %edx
cmpl %eax, %edx
movl %edx, 144(%rbx)
jbe .L471
movl %eax, 144(%rbx)
movl %eax, %edx
.L472:
movl 5884(%rbx), %ecx
movq 5888(%rbx), %rsi
movl $1, %r8d
leal -3(%rdx), %eax
movw %r8w, (%rsi,%rcx,2)
movq 5872(%rbx), %rsi
movq %rcx, %rdx
addl $1, %edx
movl %edx, 5884(%rbx)
movb %al, (%rsi,%rcx)
movzbl %al, %eax
xorl %ecx, %ecx
movzbl _length_code(%rax), %eax
addw $1, 1224(%rbx,%rax,4)
addw $1, 2488(%r15)
movl 5880(%rbx), %eax
movl 144(%rbx), %edx
movl $0, 144(%rbx)
subl $1, %eax
cmpl %eax, 5884(%rbx)
movl 164(%rbx), %eax
sete %cl
subl %edx, %eax
addl 156(%rbx), %edx
testl %ecx, %ecx
movl %eax, 164(%rbx)
movl %edx, 156(%rbx)
je .L474
.L656:
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L475
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L475:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r8
movl 156(%rbx), %eax
movq 56(%r8), %r13
movq %r8, 8(%rsp)
movq %rax, 136(%rbx)
movq %r13, %rdi
call _tr_flush_bits
movq 8(%rsp), %r8
movl 40(%r13), %ecx
movl 32(%r8), %eax
cmpl %ecx, %eax
cmovbe %eax, %ecx
testl %ecx, %ecx
jne .L663
.L477:
movq (%rbx), %rax
movl 32(%rax), %r13d
testl %r13d, %r13d
jne .L479
jmp .L493
.p2align 4,,10
.p2align 3
.L647:
subl %esi, %edx
addq 16(%rbx), %rsi
movq 96(%r14), %rdi
call crc32
movq %rax, 96(%r14)
jmp .L394
.p2align 4,,10
.p2align 3
.L653:
subl %edi, %esi
addq 16(%rbx), %rdi
movl %esi, %edx
movq %rdi, %rsi
movq 96(%r14), %rdi
call crc32
movq %rax, 96(%r14)
jmp .L405
.p2align 4,,10
.p2align 3
.L624:
movl 8(%rdi), %r10d
testl %r10d, %r10d
je .L357
.L356:
movq z_errmsg+32(%rip), %rax
movq %rax, 48(%rdi)
movl $-2, %eax
jmp .L608
.p2align 4,,10
.p2align 3
.L644:
movl %edi, %esi
addq 16(%rbx), %rsi
subl %edi, %edx
movq 96(%r14), %rdi
call crc32
movq %rax, 96(%r14)
jmp .L380
.p2align 4,,10
.p2align 3
.L491:
andl $-3, %eax
.L516:
testl %eax, %eax
movl $666, 8(%rbx)
je .L493
jmp .L433
.p2align 4,,10
.p2align 3
.L663:
movq 24(%r8), %rdi
movq 32(%r13), %rsi
movl %ecx, %r10d
movq %r10, %rdx
movl %ecx, 28(%rsp)
movq %r8, 16(%rsp)
movq %r10, 8(%rsp)
call memcpy
movq 16(%rsp), %r8
movq 8(%rsp), %r10
movl 28(%rsp), %ecx
addq %r10, 24(%r8)
addq %r10, 32(%r13)
addq %r10, 40(%r8)
subl %ecx, 32(%r8)
subl %ecx, 40(%r13)
jne .L477
movq 16(%r13), %rax
movq %rax, 32(%r13)
jmp .L477
.L664:
cmpl $103, 8(%rbx)
movl %edi, %edx
jne .L413
.p2align 4,,10
.p2align 3
.L414:
movl $113, 8(%rbx)
jmp .L413
.L629:
movq 48(%rbx), %rax
jmp .L521
.L628:
movq 48(%rbx), %rax
jmp .L519
.L650:
movl 156(%rbx), %edx
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L487
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L487:
xorl %ecx, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %rcx
movl 156(%rbx), %eax
movq 56(%rcx), %r15
movq %rcx, 8(%rsp)
movq %rax, 136(%rbx)
movq %r15, %rdi
call _tr_flush_bits
movq 8(%rsp), %rcx
movl 40(%r15), %r13d
movl 32(%rcx), %eax
cmpl %r13d, %eax
cmovbe %eax, %r13d
testl %r13d, %r13d
je .L489
movq 24(%rcx), %rdi
movq 32(%r15), %rsi
movl %r13d, %r8d
movq %r8, %rdx
movq %rcx, 16(%rsp)
movq %r8, 8(%rsp)
call memcpy
movq 16(%rsp), %rcx
movq 8(%rsp), %r8
addq %r8, 24(%rcx)
addq %r8, 32(%r15)
addq %r8, 40(%rcx)
subl %r13d, 32(%rcx)
subl %r13d, 40(%r15)
jne .L489
movq 16(%r15), %rax
movq %rax, 32(%r15)
jmp .L489
.L471:
cmpl $2, %edx
ja .L472
jmp .L460
.p2align 4,,10
.p2align 3
.L526:
movl $-2, %eax
jmp .L608
.L638:
movq 24(%r14), %rdi
movq 32(%r12), %rsi
movl %ebp, %r13d
movq %r13, %rdx
call memcpy
addq %r13, 24(%r14)
addq %r13, 32(%r12)
addq %r13, 40(%r14)
subl %ebp, 32(%r14)
subl %ebp, 40(%r12)
jne .L505
movq 16(%r12), %rax
movq %rax, 32(%r12)
jmp .L505
.L508:
movl 8(%rbx), %eax
movl %esi, %edx
jmp .L509
.L409:
movl 68(%rax), %eax
testl %eax, %eax
je .L664
movl 8(%rbx), %eax
movl %edi, %edx
jmp .L402
.L646:
movq 48(%rbx), %rax
movl 56(%rbx), %ecx
movl 32(%rax), %esi
jmp .L388
.L392:
movl $91, 8(%rbx)
movl %edi, %edx
jmp .L519
.L625:
movq z_errmsg+56(%rip), %rax
movq %rax, 48(%rdi)
movl $-5, %eax
jmp .L608
.L377:
movl $73, 8(%rbx)
movl 40(%rbx), %edi
jmp .L517
.L655:
movq 56(%r14), %rcx
movq %rcx, %rdi
movq %rcx, 8(%rsp)
call _tr_flush_bits
movq 8(%rsp), %rcx
movl 32(%r14), %eax
movl 40(%rcx), %r15d
cmpl %r15d, %eax
cmovbe %eax, %r15d
testl %r15d, %r15d
jne .L665
.L417:
movl 40(%rbx), %edx
leal 2(%rdx), %eax
cmpq 24(%rbx), %rax
ja .L413
jmp .L415
.p2align 4,,10
.p2align 3
.L637:
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movq 96(%r14), %rcx
movb %cl, (%rdx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %edx
movl %edx, 40(%rbx)
movq 96(%r14), %rdx
shrq $8, %rdx
movb %dl, (%rcx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %edx
movl %edx, 40(%rbx)
movq 96(%r14), %rdx
shrq $16, %rdx
movb %dl, (%rcx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %edx
movl %edx, 40(%rbx)
movq 96(%r14), %rdx
shrq $24, %rdx
movb %dl, (%rcx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movq 16(%r14), %rcx
movb %cl, (%rdx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %edx
movl %edx, 40(%rbx)
movq 16(%r14), %rdx
shrq $8, %rdx
movb %dl, (%rcx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %edx
movl %edx, 40(%rbx)
movq 16(%r14), %rdx
shrq $16, %rdx
movb %dl, (%rcx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %edx
movl %edx, 40(%rbx)
movq 16(%r14), %rdx
shrq $24, %rdx
movb %dl, (%rcx,%rax)
jmp .L503
.L652:
movq 24(%r14), %rdi
movq 32(%r13), %rsi
movl %ebp, %r15d
movq %r15, %rdx
call memcpy
addq %r15, 24(%r14)
addq %r15, 32(%r13)
addq %r15, 40(%r14)
subl %ebp, 32(%r14)
subl %ebp, 40(%r13)
jne .L616
movq 16(%r13), %rax
movq %rax, 32(%r13)
.L616:
movl 32(%r14), %eax
jmp .L500
.L641:
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
call crc32
movq %rax, 96(%r14)
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movb $31, (%rdx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movb $-117, (%rdx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movb $8, (%rdx,%rax)
movq 48(%rbx), %rcx
testq %rcx, %rcx
je .L666
movl (%rcx), %r8d
movl 40(%rbx), %esi
movq 16(%rbx), %rdi
testl %r8d, %r8d
setne %dl
cmpl $1, 68(%rcx)
leal 1(%rsi), %eax
movl %eax, 40(%rbx)
sbbl %eax, %eax
notl %eax
andl $2, %eax
addl %eax, %edx
cmpq $1, 24(%rcx)
sbbl %eax, %eax
notl %eax
andl $4, %eax
addl %eax, %edx
cmpq $1, 40(%rcx)
sbbl %eax, %eax
notl %eax
andl $8, %eax
addl %eax, %edx
cmpq $1, 56(%rcx)
sbbl %eax, %eax
notl %eax
andl $16, %eax
addl %edx, %eax
movb %al, (%rdi,%rsi)
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movq 48(%rbx), %rcx
movq 8(%rcx), %rcx
movb %cl, (%rdx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %edx
movl %edx, 40(%rbx)
movq 48(%rbx), %rdx
movq 8(%rdx), %rdx
shrq $8, %rdx
movb %dl, (%rcx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %edx
movl %edx, 40(%rbx)
movq 48(%rbx), %rdx
movq 8(%rdx), %rdx
shrq $16, %rdx
movb %dl, (%rcx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %edx
movl %edx, 40(%rbx)
movq 48(%rbx), %rdx
movq 8(%rdx), %rdx
shrq $24, %rdx
movb %dl, (%rcx,%rax)
movl 40(%rbx), %eax
movl 180(%rbx), %ecx
leal 1(%rax), %edx
addq 16(%rbx), %rax
cmpl $9, %ecx
movl %edx, 40(%rbx)
movl $2, %edx
je .L369
cmpl $1, 184(%rbx)
jg .L534
cmpl $1, %ecx
jle .L534
xorl %edx, %edx
.L369:
movb %dl, (%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movq 48(%rbx), %rcx
movl 20(%rcx), %ecx
movb %cl, (%rdx,%rax)
movq 48(%rbx), %rax
cmpq $0, 24(%rax)
je .L370
movl 40(%rbx), %edx
movl 32(%rax), %eax
movq 16(%rbx), %rcx
leal 1(%rdx), %esi
movl %esi, 40(%rbx)
movb %al, (%rcx,%rdx)
movl 40(%rbx), %eax
movq 16(%rbx), %rcx
leal 1(%rax), %edx
movl %edx, 40(%rbx)
movq 48(%rbx), %rdx
movl 32(%rdx), %edx
shrl $8, %edx
movb %dl, (%rcx,%rax)
movq 48(%rbx), %rax
.L370:
movl 68(%rax), %edx
testl %edx, %edx
jne .L667
.L371:
movl $0, 56(%rbx)
movl $69, 8(%rbx)
jmp .L372
.L552:
movl $1, %eax
jmp .L608
.L649:
movl 156(%rbx), %edx
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L481
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L481:
movl $1, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r15
movl 156(%rbx), %eax
movq 56(%r15), %rbp
movq %rax, 136(%rbx)
movq %rbp, %rdi
call _tr_flush_bits
movl 40(%rbp), %r13d
movl 32(%r15), %eax
cmpl %r13d, %eax
cmovbe %eax, %r13d
testl %r13d, %r13d
jne .L668
.L445:
movq (%rbx), %rax
movl 32(%rax), %r10d
movl $1, %eax
testl %r10d, %r10d
jne .L516
xorl %eax, %eax
jmp .L516
.L665:
movq 32(%rcx), %rsi
movq 24(%r14), %rdi
movl %r15d, %r8d
movq %r8, %rdx
movq %rcx, 16(%rsp)
movq %r8, 8(%rsp)
call memcpy
movq 16(%rsp), %rcx
movq 8(%rsp), %r8
addq %r8, 24(%r14)
addq %r8, 32(%rcx)
addq %r8, 40(%r14)
subl %r15d, 32(%r14)
subl %r15d, 40(%rcx)
jne .L417
movq 16(%rcx), %rax
movq %rax, 32(%rcx)
jmp .L417
.L635:
movl 156(%rbx), %edx
movq 136(%rbx), %rax
xorl %esi, %esi
subq %rax, %rdx
testq %rax, %rax
js .L443
movl %eax, %eax
addq 80(%rbx), %rax
movq %rax, %rsi
.L443:
movl $1, %ecx
movq %rbx, %rdi
call _tr_flush_block
movq (%rbx), %r13
movl 156(%rbx), %eax
movq 56(%r13), %rbp
movq %rax, 136(%rbx)
movq %rbp, %rdi
call _tr_flush_bits
movl 40(%rbp), %r15d
movl 32(%r13), %eax
cmpl %r15d, %eax
cmovbe %eax, %r15d
testl %r15d, %r15d
je .L445
movq 24(%r13), %rdi
movq 32(%rbp), %rsi
movl %r15d, %ecx
movq %rcx, %rdx
movq %rcx, 8(%rsp)
call memcpy
movq 8(%rsp), %rcx
addq %rcx, 24(%r13)
addq %rcx, 32(%rbp)
addq %rcx, 40(%r13)
subl %r15d, 32(%r13)
subl %r15d, 40(%rbp)
jne .L445
.L619:
movq 16(%rbp), %rax
movq %rax, 32(%rbp)
jmp .L445
.L651:
movq %rbx, %rdi
call _tr_align
jmp .L497
.L668:
movq 24(%r15), %rdi
movq 32(%rbp), %rsi
movl %r13d, %ecx
movq %rcx, %rdx
movq %rcx, 8(%rsp)
call memcpy
movq 8(%rsp), %rcx
addq %rcx, 24(%r15)
addq %rcx, 32(%rbp)
addq %rcx, 40(%r15)
subl %r13d, 32(%r15)
subl %r13d, 40(%rbp)
je .L619
jmp .L445
.L667:
movl 40(%rbx), %edx
movq 16(%rbx), %rsi
movq 96(%r14), %rdi
call crc32
movq %rax, 96(%r14)
movq 48(%rbx), %rax
jmp .L371
.L524:
movl $-2, %eax
ret
.L636:
movq 24(%r15), %rdi
movq 32(%r13), %rsi
movl %ecx, %r8d
movq %r8, %rdx
movl %ecx, 16(%rsp)
movq %r8, 8(%rsp)
call memcpy
movq 8(%rsp), %r8
movl 16(%rsp), %ecx
addq %r8, 24(%r15)
addq %r8, 32(%r13)
addq %r8, 40(%r15)
subl %ecx, 32(%r15)
subl %ecx, 40(%r13)
jne .L489
movq 16(%r13), %rax
movq %rax, 32(%r13)
jmp .L489
.L662:
addq $7, %rdx
jmp .L462
.L657:
addq $2, %rdx
jmp .L462
.L661:
addq $6, %rdx
jmp .L462
.L660:
addq $5, %rdx
jmp .L462
.L659:
addq $4, %rdx
jmp .L462
.L658:
addq $3, %rdx
jmp .L462
.L666:
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movb $0, (%rdx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movb $0, (%rdx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movb $0, (%rdx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movb $0, (%rdx,%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movb $0, (%rdx,%rax)
movl 40(%rbx), %eax
movl 180(%rbx), %ecx
leal 1(%rax), %edx
addq 16(%rbx), %rax
cmpl $9, %ecx
movl %edx, 40(%rbx)
movl $2, %edx
je .L363
cmpl $1, 184(%rbx)
jg .L528
cmpl $1, %ecx
jle .L528
xorl %edx, %edx
.L363:
movb %dl, (%rax)
movl 40(%rbx), %eax
movq 16(%rbx), %rdx
leal 1(%rax), %ecx
movl %ecx, 40(%rbx)
movb $3, (%rdx,%rax)
movl $113, %eax
movl $113, 8(%rbx)
movl 40(%rbx), %edi
jmp .L364
.L534:
movl $4, %edx
jmp .L369
.L528:
movl $4, %edx
jmp .L363
.LHOTE13:
.LHOTB14:
.cfi_endproc
.size deflate, .-deflate
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflateParams
.type deflateParams, @function
deflateParams:
.cfi_startproc
pushq %rbp
pushq %rbx
movslq %esi, %rbx
subq $24, %rsp
testq %rdi, %rdi
je .L680
movq 56(%rdi), %rbp
testq %rbp, %rbp
je .L680
cmpl $-1, %ebx
je .L679
cmpl $9, %ebx
ja .L680
.L683:
cmpl $4, %edx
ja .L680
movslq 180(%rbp), %rax
movq %rax, %rcx
salq $4, %rax
cmpl %edx, 184(%rbp)
movq configuration_table+8(%rax), %rax
je .L685
.L672:
xorl %eax, %eax
cmpq $0, 16(%rdi)
jne .L686
.L673:
cmpl %ecx, %ebx
je .L676
movl %ebx, 180(%rbp)
salq $4, %rbx
movzwl configuration_table+2(%rbx), %esi
movzwl configuration_table+6(%rbx), %ecx
movl %esi, 176(%rbp)
movzwl configuration_table(%rbx), %esi
movl %ecx, 172(%rbp)
movl %esi, 188(%rbp)
movzwl configuration_table+4(%rbx), %esi
movl %esi, 192(%rbp)
.L676:
movl %edx, 184(%rbp)
.L670:
addq $24, %rsp
popq %rbx
popq %rbp
ret
.p2align 4,,10
.p2align 3
.L679:
movl $6, %ebx
jmp .L683
.p2align 4,,10
.p2align 3
.L685:
movslq %ebx, %rsi
salq $4, %rsi
cmpq %rax, configuration_table+8(%rsi)
jne .L672
xorl %eax, %eax
jmp .L673
.p2align 4,,10
.p2align 3
.L686:
movl $5, %esi
movl %edx, 12(%rsp)
call deflate
cmpl $-5, %eax
movl 12(%rsp), %edx
je .L674
movl 180(%rbp), %ecx
jmp .L673
.p2align 4,,10
.p2align 3
.L674:
movl 40(%rbp), %ecx
testl %ecx, %ecx
movl 180(%rbp), %ecx
jne .L673
xorl %eax, %eax
jmp .L673
.p2align 4,,10
.p2align 3
.L680:
movl $-2, %eax
jmp .L670
.LHOTE14:
.LHOTB15:
.cfi_endproc
.size deflateParams, .-deflateParams
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflateEnd
.type deflateEnd, @function
deflateEnd:
.cfi_startproc
testq %rdi, %rdi
je .L696
movq 56(%rdi), %rdx
testq %rdx, %rdx
je .L696
pushq %rbp
pushq %rbx
subq $8, %rsp
movl 8(%rdx), %ebp
cmpl $42, %ebp
je .L689
leal -69(%rbp), %eax
andl $-5, %eax
je .L689
cmpl $91, %ebp
je .L689
cmpl $103, %ebp
setne %cl
cmpl $113, %ebp
setne %al
testb %al, %cl
je .L689
cmpl $666, %ebp
movl $-2, %eax
jne .L688
.p2align 4,,10
.p2align 3
.L689:
movq 16(%rdx), %rsi
movq %rdi, %rbx
testq %rsi, %rsi
je .L691
movq 80(%rdi), %rdi
call *72(%rbx)
movq 56(%rbx), %rdx
.L691:
movq 104(%rdx), %rsi
testq %rsi, %rsi
je .L692
movq 80(%rbx), %rdi
call *72(%rbx)
movq 56(%rbx), %rdx
.L692:
movq 96(%rdx), %rsi
testq %rsi, %rsi
je .L693
movq 80(%rbx), %rdi
call *72(%rbx)
movq 56(%rbx), %rdx
.L693:
movq 80(%rdx), %rsi
testq %rsi, %rsi
je .L694
movq 80(%rbx), %rdi
call *72(%rbx)
movq 56(%rbx), %rdx
.L694:
movq 80(%rbx), %rdi
movq %rdx, %rsi
call *72(%rbx)
xorl %eax, %eax
cmpl $113, %ebp
movq $0, 56(%rbx)
setne %al
leal -3(%rax,%rax,2), %eax
.L688:
addq $8, %rsp
popq %rbx
popq %rbp
ret
.p2align 4,,10
.p2align 3
.L696:
movl $-2, %eax
ret
.LHOTE15:
.LHOTB16:
.cfi_endproc
.size deflateEnd, .-deflateEnd
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflateInit2_
.type deflateInit2_, @function
deflateInit2_:
.cfi_startproc
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbp
pushq %rbx
subq $24, %rsp
movq 80(%rsp), %rax
testq %rax, %rax
je .L744
cmpb $49, (%rax)
jne .L744
cmpl $112, 88(%rsp)
jne .L744
testq %rdi, %rdi
movq %rdi, %rbp
je .L733
movq 64(%rdi), %rax
movl %esi, %r14d
movl %ecx, %r12d
movl %r8d, %r13d
movl %r9d, %r15d
movq $0, 48(%rdi)
testq %rax, %rax
je .L753
cmpq $0, 72(%rbp)
je .L754
.L729:
cmpl $-1, %r14d
movl $6, %ecx
cmove %ecx, %r14d
testl %r12d, %r12d
js .L755
cmpl $15, %r12d
movl $1, %ecx
jg .L756
.L732:
leal -1(%r13), %esi
cmpl $8, %esi
ja .L733
cmpl $8, %edx
jne .L733
leal -8(%r12), %edx
cmpl $7, %edx
ja .L733
cmpl $4, %r15d
ja .L733
cmpl $9, %r14d
ja .L733
cmpl $8, %r12d
movl %r12d, %r8d
je .L757
.L734:
movl %r8d, 12(%rsp)
movl %ecx, 8(%rsp)
movl $5936, %edx
movq 80(%rbp), %rdi
movl $1, %esi
call *%rax
testq %rax, %rax
movq %rax, %rbx
je .L747
movl 12(%rsp), %r8d
movl 8(%rsp), %ecx
movl $-1431655765, %edx
movq %rax, 56(%rbp)
movq %rbp, (%rax)
movq $0, 48(%rax)
movq 80(%rbp), %rdi
movl %r8d, 72(%rax)
movl $1, %r8d
movl %ecx, 44(%rax)
movl %r8d, %esi
movl %r12d, %ecx
movl %r8d, 8(%rsp)
sall %cl, %esi
leal 7(%r13), %ecx
movl %esi, 68(%rax)
leal -1(%rsi), %eax
movl %ecx, 120(%rbx)
movl %eax, 76(%rbx)
movl %r8d, %eax
sall %cl, %eax
movl %eax, 116(%rbx)
subl $1, %eax
movl %eax, 124(%rbx)
leal 9(%r13), %eax
mull %edx
shrl $1, %edx
movl %edx, 128(%rbx)
movl $2, %edx
call *64(%rbp)
movl 68(%rbx), %esi
movq 80(%rbp), %rdi
movl $2, %edx
movq %rax, 80(%rbx)
call *64(%rbp)
movl 116(%rbx), %esi
movq 80(%rbp), %rdi
movl $2, %edx
movq %rax, 96(%rbx)
call *64(%rbp)
movl 8(%rsp), %r8d
leal 6(%r13), %ecx
movl $4, %edx
movq %rax, 104(%rbx)
movq $0, 5928(%rbx)
movq 80(%rbp), %rdi
movl %r8d, %esi
sall %cl, %esi
movl %esi, 5880(%rbx)
call *64(%rbp)
movl 5880(%rbx), %ecx
cmpq $0, 80(%rbx)
movq %rax, 16(%rbx)
leaq 0(,%rcx,4), %rsi
movq %rcx, %rdx
movq %rsi, 24(%rbx)
je .L735
cmpq $0, 96(%rbx)
je .L735
testq %rax, %rax
je .L735
cmpq $0, 104(%rbx)
je .L735
shrl $1, %edx
movl %r14d, 180(%rbx)
movl %r15d, 184(%rbx)
leaq (%rax,%rdx,2), %rdx
movb $8, 60(%rbx)
movq %rdx, 5888(%rbx)
leaq (%rcx,%rcx,2), %rdx
addq %rdx, %rax
movq %rax, 5872(%rbx)
movq 56(%rbp), %rbx
testq %rbx, %rbx
je .L733
cmpq $0, 64(%rbp)
je .L733
cmpq $0, 72(%rbp)
je .L733
movq 16(%rbx), %rax
movq $0, 40(%rbp)
movq $0, 16(%rbp)
movq $0, 48(%rbp)
movl $2, 88(%rbp)
movl $0, 40(%rbx)
movq %rax, 32(%rbx)
movl 44(%rbx), %eax
testl %eax, %eax
js .L758
jne .L739
movl $113, 8(%rbx)
.L741:
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
call adler32
.L742:
movq %rax, 96(%rbp)
movq %rbx, %rdi
movl $0, 64(%rbx)
call _tr_init
movq 56(%rbp), %rbx
xorl %ecx, %ecx
xorl %esi, %esi
movl 68(%rbx), %eax
movq 104(%rbx), %rdi
addq %rax, %rax
movq %rax, 88(%rbx)
movl 116(%rbx), %eax
subl $1, %eax
leaq (%rax,%rax), %rdx
movw %cx, (%rdi,%rax,2)
call memset
movslq 180(%rbx), %rax
movl $0, 156(%rbx)
movq $0, 136(%rbx)
movl $0, 164(%rbx)
movl $0, 5916(%rbx)
movl $2, 168(%rbx)
movl $2, 144(%rbx)
movl $0, 152(%rbx)
salq $4, %rax
movl $0, 112(%rbx)
leaq configuration_table(%rax), %rdx
movzwl configuration_table+2(%rax), %ecx
movzwl configuration_table(%rax), %eax
movl %eax, 188(%rbx)
movzwl 4(%rdx), %eax
movl %ecx, 176(%rbx)
movl %eax, 192(%rbx)
movzwl 6(%rdx), %eax
movl %eax, 172(%rbx)
xorl %eax, %eax
.L751:
addq $24, %rsp
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.p2align 4,,10
.p2align 3
.L756:
subl $16, %r12d
movb $2, %cl
jmp .L732
.p2align 4,,10
.p2align 3
.L758:
negl %eax
movl %eax, 44(%rbx)
.L739:
cmpl $2, %eax
movl $42, 8(%rbx)
jne .L741
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
call crc32
jmp .L742
.p2align 4,,10
.p2align 3
.L755:
negl %r12d
xorb %cl, %cl
jmp .L732
.p2align 4,,10
.p2align 3
.L757:
movl $9, %r8d
movb $9, %r12b
jmp .L734
.p2align 4,,10
.p2align 3
.L753:
cmpq $0, 72(%rbp)
movq $zcalloc, 64(%rdi)
movl $zcalloc, %eax
movq $0, 80(%rdi)
jne .L729
.p2align 4,,10
.p2align 3
.L754:
movq $zcfree, 72(%rbp)
jmp .L729
.p2align 4,,10
.p2align 3
.L733:
addq $24, %rsp
movl $-2, %eax
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.p2align 4,,10
.p2align 3
.L744:
addq $24, %rsp
movl $-6, %eax
popq %rbx
popq %rbp
popq %r12
popq %r13
popq %r14
popq %r15
ret
.p2align 4,,10
.p2align 3
.L735:
movq z_errmsg+48(%rip), %rax
movl $666, 8(%rbx)
movq %rbp, %rdi
movq %rax, 48(%rbp)
call deflateEnd
movl $-4, %eax
jmp .L751
.p2align 4,,10
.p2align 3
.L747:
movl $-4, %eax
jmp .L751
.LHOTE16:
.LHOTB17:
.cfi_endproc
.size deflateInit2_, .-deflateInit2_
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflateInit_
.type deflateInit_, @function
deflateInit_:
.cfi_startproc
testq %rdx, %rdx
je .L775
cmpb $49, (%rdx)
jne .L775
cmpl $112, %ecx
jne .L775
testq %rdi, %rdi
pushq %r12
pushq %rbp
movq %rdi, %rbp
pushq %rbx
je .L765
movq 64(%rdi), %rax
movl %esi, %r12d
movq $0, 48(%rdi)
testq %rax, %rax
je .L784
cmpq $0, 72(%rbp)
je .L785
.L763:
cmpl $-1, %r12d
je .L776
cmpl $9, %r12d
ja .L765
.L764:
movq 80(%rbp), %rdi
movl $5936, %edx
movl $1, %esi
call *%rax
testq %rax, %rax
movq %rax, %rbx
je .L777
movq %rax, 56(%rbp)
movq 80(%rbp), %rdi
movl $2, %edx
movl $32768, %esi
movq %rbp, (%rax)
movl $1, 44(%rax)
movq $0, 48(%rax)
movl $15, 72(%rax)
movl $32768, 68(%rax)
movl $32767, 76(%rax)
movl $15, 120(%rax)
movl $32768, 116(%rax)
movl $32767, 124(%rax)
movl $5, 128(%rax)
call *64(%rbp)
movl 68(%rbx), %esi
movq 80(%rbp), %rdi
movl $2, %edx
movq %rax, 80(%rbx)
call *64(%rbp)
movl 116(%rbx), %esi
movq 80(%rbp), %rdi
movl $2, %edx
movq %rax, 96(%rbx)
call *64(%rbp)
movl $4, %edx
movl $16384, %esi
movq %rax, 104(%rbx)
movq $0, 5928(%rbx)
movl $16384, 5880(%rbx)
movq 80(%rbp), %rdi
call *64(%rbp)
movl 5880(%rbx), %ecx
cmpq $0, 80(%rbx)
movq %rax, 16(%rbx)
leaq 0(,%rcx,4), %rsi
movq %rcx, %rdx
movq %rsi, 24(%rbx)
je .L766
cmpq $0, 96(%rbx)
je .L766
testq %rax, %rax
je .L766
cmpq $0, 104(%rbx)
je .L766
shrl $1, %edx
movl %r12d, 180(%rbx)
movl $0, 184(%rbx)
leaq (%rax,%rdx,2), %rdx
movb $8, 60(%rbx)
movq %rdx, 5888(%rbx)
leaq (%rcx,%rcx,2), %rdx
addq %rdx, %rax
movq %rax, 5872(%rbx)
movq 56(%rbp), %rbx
testq %rbx, %rbx
je .L765
cmpq $0, 64(%rbp)
je .L765
cmpq $0, 72(%rbp)
je .L765
movq 16(%rbx), %rax
movq $0, 40(%rbp)
movq $0, 16(%rbp)
movq $0, 48(%rbp)
movl $2, 88(%rbp)
movl $0, 40(%rbx)
movq %rax, 32(%rbx)
movl 44(%rbx), %eax
testl %eax, %eax
js .L786
jne .L770
movl $113, 8(%rbx)
.L772:
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
call adler32
.L773:
movq %rax, 96(%rbp)
movq %rbx, %rdi
movl $0, 64(%rbx)
call _tr_init
movq 56(%rbp), %rbx
xorl %ecx, %ecx
xorl %esi, %esi
movl 68(%rbx), %eax
movq 104(%rbx), %rdi
addq %rax, %rax
movq %rax, 88(%rbx)
movl 116(%rbx), %eax
subl $1, %eax
leaq (%rax,%rax), %rdx
movw %cx, (%rdi,%rax,2)
call memset
movslq 180(%rbx), %rax
movl $0, 156(%rbx)
movq $0, 136(%rbx)
movl $0, 164(%rbx)
movl $0, 5916(%rbx)
movl $2, 168(%rbx)
movl $2, 144(%rbx)
movl $0, 152(%rbx)
salq $4, %rax
movl $0, 112(%rbx)
leaq configuration_table(%rax), %rdx
movzwl configuration_table+2(%rax), %ecx
movzwl configuration_table(%rax), %eax
movl %eax, 188(%rbx)
movzwl 4(%rdx), %eax
movl %ecx, 176(%rbx)
movl %eax, 192(%rbx)
movzwl 6(%rdx), %eax
movl %eax, 172(%rbx)
xorl %eax, %eax
.L781:
popq %rbx
popq %rbp
popq %r12
ret
.p2align 4,,10
.p2align 3
.L786:
negl %eax
movl %eax, 44(%rbx)
.L770:
cmpl $2, %eax
movl $42, 8(%rbx)
jne .L772
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
call crc32
jmp .L773
.p2align 4,,10
.p2align 3
.L776:
movl $6, %r12d
jmp .L764
.p2align 4,,10
.p2align 3
.L784:
cmpq $0, 72(%rbp)
movq $zcalloc, 64(%rdi)
movl $zcalloc, %eax
movq $0, 80(%rdi)
jne .L763
.p2align 4,,10
.p2align 3
.L785:
movq $zcfree, 72(%rbp)
jmp .L763
.p2align 4,,10
.p2align 3
.L775:
movl $-6, %eax
ret
.p2align 4,,10
.p2align 3
.L765:
movl $-2, %eax
jmp .L781
.p2align 4,,10
.p2align 3
.L766:
movq z_errmsg+48(%rip), %rax
movl $666, 8(%rbx)
movq %rbp, %rdi
movq %rax, 48(%rbp)
call deflateEnd
movl $-4, %eax
jmp .L781
.p2align 4,,10
.p2align 3
.L777:
movl $-4, %eax
jmp .L781
.LHOTE17:
.LHOTB18:
.cfi_endproc
.size deflateInit_, .-deflateInit_
# ----------------------
.p2align 4,,15
# ----------------------
.globl deflateCopy
.type deflateCopy, @function
deflateCopy:
.cfi_startproc
testq %rsi, %rsi
je .L792
testq %rdi, %rdi
je .L792
pushq %r13
pushq %r12
pushq %rbp
pushq %rbx
subq $8, %rsp
movq 56(%rsi), %r12
testq %r12, %r12
je .L793
movq (%rsi), %rax
movq %rdi, %rbp
movq %rax, (%rdi)
movq 8(%rsi), %rax
movq %rax, 8(%rdi)
movq 16(%rsi), %rax
movq %rax, 16(%rdi)
movq 24(%rsi), %rax
movq %rax, 24(%rdi)
movq 32(%rsi), %rax
movq %rax, 32(%rdi)
movq 40(%rsi), %rax
movq %rax, 40(%rdi)
movq 48(%rsi), %rax
movq %rax, 48(%rdi)
movq 56(%rsi), %rax
movq %rax, 56(%rdi)
movq 64(%rsi), %rax
movq %rax, 64(%rdi)
movq 72(%rsi), %rdx
movq %rdx, 72(%rdi)
movq 80(%rsi), %rdi
movq %rdi, 80(%rbp)
movq 88(%rsi), %rdx
movq %rdx, 88(%rbp)
movq 96(%rsi), %rdx
movq %rdx, 96(%rbp)
movq 104(%rsi), %rdx
movl $1, %esi
movq %rdx, 104(%rbp)
movl $5936, %edx
call *%rax
testq %rax, %rax
movq %rax, %rbx
je .L794
movq %rax, 56(%rbp)
movq (%r12), %rax
leaq 8(%rbx), %rdi
movq %rbx, %rcx
movq %r12, %rsi
movl $2, %edx
andq $-8, %rdi
movq %rax, (%rbx)
movq 5928(%r12), %rax
subq %rdi, %rcx
subq %rcx, %rsi
addl $5936, %ecx
shrl $3, %ecx
movq %rax, 5928(%rbx)
rep movsq
movq %rbp, (%rbx)
movl 68(%rbx), %esi
movq 80(%rbp), %rdi
call *64(%rbp)
movl 68(%rbx), %esi
movq 80(%rbp), %rdi
movl $2, %edx
movq %rax, 80(%rbx)
call *64(%rbp)
movl 116(%rbx), %esi
movq 80(%rbp), %rdi
movl $2, %edx
movq %rax, 96(%rbx)
call *64(%rbp)
movq 80(%rbp), %rdi
movq %rax, 104(%rbx)
movl $4, %edx
movl 5880(%rbx), %esi
call *64(%rbp)
movq 80(%rbx), %rdi
movq %rax, %r13
movq %rax, 16(%rbx)
testq %rdi, %rdi
je .L789
cmpq $0, 96(%rbx)
je .L789
testq %rax, %rax
je .L789
cmpq $0, 104(%rbx)
je .L789
movl 68(%rbx), %eax
movq 80(%r12), %rsi
leal (%rax,%rax), %edx
call memcpy
movl 68(%rbx), %edx
movq 96(%rbx), %rdi
movq 96(%r12), %rsi
addq %rdx, %rdx
call memcpy
movl 116(%rbx), %edx
movq 104(%rbx), %rdi
movq 104(%r12), %rsi
addq %rdx, %rdx
call memcpy
movl 24(%rbx), %edx
movq 16(%r12), %rsi
movq 16(%rbx), %rdi
call memcpy
movq 16(%rbx), %rsi
movq %rsi, %rdx
addq 32(%r12), %rdx
subq 16(%r12), %rdx
movq %rdx, 32(%rbx)
movl 5880(%rbx), %edx
movl %edx, %ecx
shrl $1, %ecx
leaq (%r13,%rcx,2), %rax
movq %rax, 5888(%rbx)
movl %edx, %eax
leaq (%rax,%rax,2), %rax
addq %rsi, %rax
movq %rax, 5872(%rbx)
leaq 196(%rbx), %rax
movq %rax, 2888(%rbx)
leaq 2488(%rbx), %rax
movq %rax, 2912(%rbx)
leaq 2732(%rbx), %rax
movq %rax, 2936(%rbx)
xorl %eax, %eax
.L788:
addq $8, %rsp
popq %rbx
popq %rbp
popq %r12
popq %r13
ret
.p2align 4,,10
.p2align 3
.L792:
movl $-2, %eax
ret
.p2align 4,,10
.p2align 3
.L789:
movq %rbp, %rdi
call deflateEnd
movl $-4, %eax
jmp .L788
.p2align 4,,10
.p2align 3
.L793:
movl $-2, %eax
jmp .L788
.p2align 4,,10
.p2align 3
.L794:
movl $-4, %eax
jmp .L788
.LHOTE18:
.cfi_endproc
.size deflateCopy, .-deflateCopy
# ----------------------
.section .rodata
.align 64
.local configuration_table
.type configuration_table, @object
configuration_table:
.value 0
.value 0
.value 0
.value 0
.quad deflate_stored
.value 4
.value 4
.value 8
.value 4
.quad deflate_fast
.value 4
.value 5
.value 16
.value 8
.quad deflate_fast
.value 4
.value 6
.value 32
.value 32
.quad deflate_fast
.value 4
.value 4
.value 16
.value 16
.quad deflate_slow
.value 8
.value 16
.value 32
.value 32
.quad deflate_slow
.value 8
.value 16
.value 128
.value 128
.quad deflate_slow
.value 8
.value 32
.value 128
.value 256
.quad deflate_slow
.value 32
.value 128
.value 258
.value 1024
.quad deflate_slow
.value 32
.value 258
.value 258
.value 4096
.quad deflate_slow
.size configuration_table, 160
# ----------------------
.align 64
.globl deflate_copyright
.type deflate_copyright, @object
deflate_copyright:
.string " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler "
.size deflate_copyright, 68
# ----------------------
.hidden zcfree
.hidden zcalloc
.hidden _tr_align
.hidden _tr_stored_block
.hidden _tr_init
.hidden _tr_flush_bits
.hidden _tr_flush_block
.hidden _dist_code
.hidden _length_code
.ident "GCC: (Debian 4.9.2-10) 4.9.2"
.section .note.GNU-stack,"",@progbits
| 20.898739 | 78 | 0.475248 |
692f3f674877c6507ef6eba79fddcf4d82070064 | 1,338 | asm | Assembly | Library/GrObj/Main/mainManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/GrObj/Main/mainManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/GrObj/Main/mainManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Main
FILE: mainManager.asm
AUTHOR: Steve Scholl, November 15, 1989
REVISION HISTORY:
Name Date Description
---- ---- -----------
ss 11/15/89 Initial revision.
DESCRIPTION:
Manager for this module.
$Id: mainManager.asm,v 1.1 97/04/04 18:05:16 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
include grobjGeode.def
;------------------------------------------------------------------------------
; Include definitions.
;------------------------------------------------------------------------------
include mainConstant.def
include mainMacro.def
;------------------------------------------------------------------------------
; Local variables.
;------------------------------------------------------------------------------
include mainVariable.def
;------------------------------------------------------------------------------
; Here comes the code...
;------------------------------------------------------------------------------
include globalUtils.asm
include largeRect.asm
include strings.asm
if ERROR_CHECK
include globalErrorUtils.asm
endif
end
| 27.306122 | 80 | 0.360239 |
9d537b3a706b9e23ca87d80067421b8f87ea8edc | 6,159 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_953.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_953.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_953.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r8
push %r9
push %rcx
push %rdx
lea addresses_UC_ht+0xfa8c, %rdx
nop
nop
nop
xor %rcx, %rcx
mov $0x6162636465666768, %r8
movq %r8, %xmm3
and $0xffffffffffffffc0, %rdx
movntdq %xmm3, (%rdx)
nop
add $50463, %r9
lea addresses_UC_ht+0xd6cc, %r11
nop
nop
nop
nop
nop
inc %r14
mov $0x6162636465666768, %rcx
movq %rcx, (%r11)
nop
nop
nop
nop
nop
cmp $45421, %r14
pop %rdx
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %rax
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_WT+0x20a6, %rsi
lea addresses_WC+0x1d50c, %rdi
clflush (%rdi)
nop
nop
nop
nop
dec %r11
mov $42, %rcx
rep movsb
nop
and %r13, %r13
// Load
lea addresses_WT+0xc68c, %rax
nop
sub %r10, %r10
movups (%rax), %xmm0
vpextrq $0, %xmm0, %r11
nop
cmp $44663, %rdi
// Store
lea addresses_A+0x8d6c, %rax
nop
nop
nop
nop
nop
xor %r13, %r13
mov $0x5152535455565758, %rcx
movq %rcx, (%rax)
nop
nop
sub $1511, %rcx
// Store
lea addresses_PSE+0x175cc, %rdi
sub %rcx, %rcx
movb $0x51, (%rdi)
nop
nop
sub %rdi, %rdi
// Store
lea addresses_normal+0x1b28c, %r13
nop
nop
add %rax, %rax
movw $0x5152, (%r13)
nop
nop
nop
sub %rax, %rax
// Load
lea addresses_WC+0x728c, %rdi
nop
xor $35599, %rcx
mov (%rdi), %r10d
nop
nop
nop
add %rsi, %rsi
// Store
lea addresses_normal+0x1b28c, %r13
nop
nop
nop
nop
cmp %r11, %r11
movb $0x51, (%r13)
nop
nop
and $17462, %rcx
// Faulty Load
lea addresses_normal+0x1b28c, %rcx
nop
nop
nop
nop
dec %r13
mov (%rcx), %ax
lea oracles, %r11
and $0xff, %rax
shlq $12, %rax
mov (%r11,%rax,1), %rax
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WT'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WC'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 5}}
{'51': 21829}
51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51
*/
| 36.017544 | 2,999 | 0.654814 |
1881bd83e423b12835ae74070e2d2b5f4ce9a278 | 938 | asm | Assembly | oeis/260/A260513.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/260/A260513.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/260/A260513.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A260513: a(n) = (8*n+13*n^3+3*n^5)/24; also the sum of triangular numbers taken in successive groups of increasing size (see Example).
; Submitted by Christian Krause
; 1,9,46,164,460,1091,2289,4376,7779,13045,20856,32044,47606,68719,96755,133296,180149,239361,313234,404340,515536,649979,811141,1002824,1229175,1494701,1804284,2163196,2577114,3052135,3594791,4212064,4911401,5700729,6588470,7583556,8695444,9934131,11310169,12834680,14519371,16376549,18419136,20660684,23115390,25798111,28724379,31910416,35373149,39130225,43200026,47601684,52355096,57480939,63000685,68936616,75311839,82150301,89476804,97317020,105697506,114645719,124190031,134359744,145185105
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
trn $0,1
seq $0,198833 ; The number of inequivalent ways to color the vertices of a regular octahedron using at most n colors.
mov $2,$3
mul $2,$0
add $4,$2
lpe
min $5,1
mul $5,$0
mov $0,$4
sub $0,$5
| 44.666667 | 496 | 0.766525 |
25b4f17b941bf3be97043096ec869bc14300b12d | 8,587 | asm | Assembly | Transynther/x86/_processed/NONE/_ht_st_zr_un_/i9-9900K_12_0xa0.log_21829_1408.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_ht_st_zr_un_/i9-9900K_12_0xa0.log_21829_1408.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_ht_st_zr_un_/i9-9900K_12_0xa0.log_21829_1408.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r15
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1db3, %r10
sub $39992, %rbx
movb (%r10), %r15b
cmp $19166, %rsi
lea addresses_UC_ht+0x701, %rbp
nop
nop
nop
nop
nop
sub $45388, %rsi
mov $0x6162636465666768, %r14
movq %r14, %xmm6
movups %xmm6, (%rbp)
nop
nop
and $42014, %r10
lea addresses_UC_ht+0x1c6b3, %rsi
lea addresses_normal_ht+0x144a1, %rdi
nop
nop
add $29951, %r10
mov $75, %rcx
rep movsq
nop
nop
nop
nop
nop
sub $882, %r15
lea addresses_D_ht+0x1aef3, %r14
clflush (%r14)
nop
nop
nop
xor $56412, %rbp
vmovups (%r14), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %rsi
nop
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0xfd33, %r14
nop
nop
nop
nop
nop
sub %r15, %r15
vmovups (%r14), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rsi
nop
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_normal_ht+0x3673, %rsi
lea addresses_WC_ht+0x1760, %rdi
nop
nop
and $53535, %rbx
mov $4, %rcx
rep movsb
and %rbp, %rbp
lea addresses_WT_ht+0xb763, %rsi
lea addresses_WC_ht+0x7ccf, %rdi
nop
nop
nop
nop
sub %r15, %r15
mov $89, %rcx
rep movsw
nop
nop
nop
nop
nop
cmp %r15, %r15
lea addresses_UC_ht+0xb9b3, %rdi
sub $41801, %rbx
vmovups (%rdi), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $1, %xmm7, %rsi
nop
nop
sub $4419, %r14
lea addresses_WC_ht+0x15d0f, %rsi
lea addresses_normal_ht+0x169b3, %rdi
nop
nop
nop
nop
sub $41951, %r15
mov $29, %rcx
rep movsq
cmp $13408, %r14
lea addresses_WC_ht+0x17bc3, %r10
nop
nop
nop
nop
nop
xor %r15, %r15
mov (%r10), %esi
nop
cmp %rdi, %rdi
lea addresses_WC_ht+0x149d3, %rsi
nop
nop
and $58866, %r14
mov (%rsi), %rbx
sub $13926, %rsi
lea addresses_D_ht+0x6fb3, %rsi
lea addresses_UC_ht+0xd5b3, %rdi
clflush (%rsi)
nop
nop
nop
mfence
mov $78, %rcx
rep movsb
nop
add %rcx, %rcx
lea addresses_normal_ht+0x85b3, %r14
nop
nop
and %r10, %r10
mov (%r14), %rdi
nop
nop
nop
nop
add $38654, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %rbp
push %rbx
push %rdi
push %rdx
// Store
lea addresses_A+0xfaab, %r12
nop
nop
cmp %rbx, %rbx
mov $0x5152535455565758, %r13
movq %r13, %xmm1
movups %xmm1, (%r12)
nop
nop
nop
dec %r15
// Store
mov $0xe9f, %rdi
nop
nop
nop
nop
and %rdx, %rdx
mov $0x5152535455565758, %r12
movq %r12, %xmm0
movups %xmm0, (%rdi)
xor $31803, %rdi
// Load
lea addresses_normal+0xd5bb, %r12
nop
nop
nop
nop
inc %rdi
movb (%r12), %r13b
nop
nop
nop
nop
add $4989, %rbx
// Store
mov $0xadc, %rdx
nop
nop
nop
nop
add $17383, %rbx
mov $0x5152535455565758, %rdi
movq %rdi, %xmm0
vmovups %ymm0, (%rdx)
nop
nop
nop
and $27455, %rdx
// Faulty Load
lea addresses_A+0x161b3, %rdi
nop
nop
nop
nop
sub %rbx, %rbx
movups (%rdi), %xmm1
vpextrq $1, %xmm1, %r15
lea oracles, %r13
and $0xff, %r15
shlq $12, %r15
mov (%r13,%r15,1), %r15
pop %rdx
pop %rdi
pop %rbx
pop %rbp
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_A', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_P', 'AVXalign': False, 'size': 16}}
{'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_normal', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_P', 'AVXalign': False, 'size': 32}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16}}
{'src': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 0, 'type': 'addresses_normal_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': True, 'congruent': 5, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 8, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 9, 'type': 'addresses_UC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'44': 3895, '46': 12723, '49': 192, '54': 1, '00': 2319, '48': 2696, '08': 3}
00 46 46 46 46 48 44 46 46 46 48 44 44 46 46 48 44 46 46 46 00 44 00 46 46 00 44 46 46 46 48 44 46 46 46 46 00 44 46 46 46 48 44 46 46 46 48 44 46 46 46 46 00 46 46 46 48 44 44 46 46 46 00 44 46 00 46 46 44 46 46 46 46 48 44 00 46 46 48 44 46 46 46 46 44 46 46 48 44 46 46 00 48 44 46 46 48 44 46 46 46 46 00 44 46 46 48 44 44 46 46 46 44 46 46 46 48 44 44 46 46 46 49 46 00 46 48 44 46 46 48 00 44 46 46 46 46 46 46 46 46 48 44 46 46 46 00 44 46 00 46 46 44 46 46 46 48 44 46 46 46 46 44 46 46 46 48 44 46 46 46 48 00 00 46 46 46 48 44 00 00 46 48 44 46 46 46 46 49 00 46 46 48 44 46 46 46 44 46 46 46 46 48 46 46 46 48 44 46 46 46 00 46 46 46 46 48 44 46 46 46 46 00 44 00 46 46 48 44 00 46 46 48 46 46 46 46 00 44 46 46 46 48 44 46 46 46 46 00 44 00 46 46 48 44 46 46 46 48 44 46 46 46 46 00 44 46 46 46 00 44 46 46 00 46 48 44 46 46 00 44 46 46 46 46 00 44 46 48 44 46 46 00 48 44 46 00 46 48 44 46 46 46 46 00 44 46 46 46 46 00 44 46 46 46 48 44 46 46 46 48 44 46 46 46 48 44 46 46 46 46 48 44 46 46 48 44 46 00 46 46 00 46 46 46 48 44 46 46 46 48 44 46 46 46 48 44 46 46 46 48 44 44 00 46 44 44 46 46 46 48 44 46 46 46 48 46 46 46 46 00 44 00 46 46 48 44 46 46 46 46 46 46 46 46 48 44 46 46 48 44 46 46 46 00 49 46 46 46 46 48 44 46 46 48 44 46 46 46 46 44 00 46 48 44 46 46 46 46 49 46 46 46 48 44 46 46 46 46 00 44 00 46 46 48 44 46 46 46 48 00 46 46 46 46 00 44 46 46 46 46 00 44 00 46 46 44 00 46 46 48 44 46 46 46 48 44 46 46 46 46 00 00 46 46 46 46 00 44 46 46 46 48 44 46 46 00 48 44 46 46 46 46 44 00 46 48 44 46 46 46 48 00 46 46 46 48 44 44 46 48 00 46 46 46 46 46 44 46 46 46 48 44 00 46 46 46 00 44 46 46 46 46 00 44 46 46 46 48 44 46 46 46 48 44 46 46 46 48 44 46 46 48 44 46 46 46 46 46 46 46 48 44 46 46 46 46 00 44 46 46 46 46 49 46 46 46 48 44 00 00 46 46 48 44 46 46 46 00 46 44 46 46 46 48 44 46 46 48 44 46 00 46 46 00 00 46 46 46 48 44 46 46 46 48 44 46 00 46 48 44 46 46 46 48 44 46 46 48 00 44 46 46 00 48 44 00 46 48 44 46 46 46 46 46 46 46 48 00 46 00 46 46 48 44 46 46 00 46 00 44 46 46 46 48 44 46 46 48 44 46 46 46 46 44 46 46 46 48 44 46 46 00 46 48 44 46 46 46 48 44 46 46 46 48 44 00 46 46 46 00 44 46 46 46 46 00 44 00 46 46 48 44 46 46 46 48 44 46 46 46 46 00 44 00 46 46 46 48 44 46 46 46 48 44 46 46 46 46 48 44 46 46 46 48 44 46 46 46 48 44 46 46 46 46 48 44 46 00 46 48 44 46 46 46 48 44 46 46 46 00 00 44 46 46 46 46 00 44 46 46 46 48 44 46 46 48 00 46 46 46 48 44 46 46 46 00 44 00 46 48 00 44 46 46 46 46 44 46 46 46 48 44 46 46 46 46 00 44 46 46 46 48 44 46 46 48 44 46 00 46 48 00 46 46 46 00 48 44 46 46 46 48 44 46 46 46 00 44 46 46 46 48 44 46 46 46 48 44 46 46 46 00 00 46 46 46 48 44 46 46 00 44 46 46 46 48 44 46 46 46 48 44 46 46 46 46 00 44 00 46 46 46 44 46 46 46 48 44 46 46 46 48 44 46 46 00 48 48 44 46 46 46 46 48 00 46 46 46 48 44 46 46 46 46 00 44 46 46 46 46 44 46 46 46 48 48 44 46 46 46 48 44 46 46 46 46 00 44 46 46 46 48 44 00 46 46 48 00 46 46 46 46 00 44 46 46 46 48 44 00 46 46 00 44 46 46 46 46 49 46 46 00 48 44 46 46 48 44 46
*/
| 31.803704 | 2,999 | 0.654711 |
2007942925c3c03398bd25212e7729ad6ed10bb5 | 2,572 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_13_1616.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_13_1616.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_13_1616.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r8
push %r9
push %rdi
push %rdx
lea addresses_A_ht+0x16d75, %r12
nop
nop
xor %r14, %r14
movb $0x61, (%r12)
nop
nop
sub $34653, %rdi
lea addresses_WC_ht+0xef1d, %r8
nop
nop
nop
nop
add $50269, %rdx
mov (%r8), %r9d
xor $44514, %r14
lea addresses_A_ht+0x6de3, %r9
cmp $19008, %r8
movups (%r9), %xmm0
vpextrq $0, %xmm0, %rdi
nop
nop
nop
nop
nop
sub $39462, %r14
lea addresses_WC_ht+0x22dd, %r14
xor $46493, %rdi
movups (%r14), %xmm3
vpextrq $0, %xmm3, %r8
nop
cmp $36692, %rdx
pop %rdx
pop %rdi
pop %r9
pop %r8
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
// Load
lea addresses_US+0x104fd, %r11
clflush (%r11)
nop
nop
cmp $64172, %rdx
vmovups (%r11), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %rdi
nop
nop
nop
nop
nop
xor %r11, %r11
// Store
lea addresses_WT+0x38fd, %r8
nop
nop
sub $38853, %rsi
movw $0x5152, (%r8)
nop
nop
nop
dec %rdi
// Store
lea addresses_WT+0x7355, %rcx
nop
nop
sub %r13, %r13
movw $0x5152, (%rcx)
nop
nop
nop
cmp %rdi, %rdi
// Faulty Load
lea addresses_WC+0xcfd, %r13
nop
nop
sub $51637, %r11
movb (%r13), %dl
lea oracles, %rcx
and $0xff, %rdx
shlq $12, %rdx
mov (%rcx,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 2}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'00': 13}
00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 19.338346 | 125 | 0.636858 |
e154b44a5b548dbb5f59135be3ec97d87fa6fc9f | 7,300 | asm | Assembly | src/sound/song364restored.asm | MusicTheorist/Mother2GbaTranslation | 70de3975a3284c4002a33e8ef8c20e4c2b039037 | [
"MIT"
] | 1 | 2021-04-18T04:26:52.000Z | 2021-04-18T04:26:52.000Z | src/sound/song364restored.asm | MusicTheorist/Mother2GbaTranslation | 70de3975a3284c4002a33e8ef8c20e4c2b039037 | [
"MIT"
] | null | null | null | src/sound/song364restored.asm | MusicTheorist/Mother2GbaTranslation | 70de3975a3284c4002a33e8ef8c20e4c2b039037 | [
"MIT"
] | null | null | null | song364restored_pri equ 100
song364restored_rev equ 0
song364restored_mvl equ 127
song364restored_key equ 0
song364restored_tbs equ 1
song364restored_exg equ 0
song364restored_cmp equ 1
.align 4
;**************** Track 1 (Midi-Chn.7) ****************;
@song364restored_1:
.byte KEYSH , song364restored_key+0
; 000 ----------------------------------------
.byte VOICE , 13
.byte PAN , c_v+45
.byte VOL , 94*song364restored_mvl/mxv
.byte PAN , c_v+45
.byte VOL , 94*song364restored_mvl/mxv
.byte 94*song364restored_mvl/mxv
.byte PAN , c_v+45
.byte c_v+45
.byte VOL , 94*song364restored_mvl/mxv
.byte 94*song364restored_mvl/mxv
.byte PAN , c_v+45
.byte c_v+45
.byte VOL , 94*song364restored_mvl/mxv
.byte BEND , c_v-1
.byte W14
.byte c_v-1
.byte N01 , As4 , v100
.byte W02
.byte BEND , c_v-1
.byte N01 , An4
.byte W03
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W02
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W02
.byte VOL , 82*song364restored_mvl/mxv
.byte PAN , c_v+52
.byte W01
.byte BEND , c_v-1
.byte N01 , Fn4
.byte W02
.byte En4
.byte W02
.byte Dn4
.byte W03
.byte Cs4
.byte W02
.byte Bn3
.byte W02
.byte VOL , 100*song364restored_mvl/mxv
.byte PAN , c_v+49
.byte W01
.byte BEND , c_v-1
.byte N01 , Cn5
.byte W02
.byte Bn4
.byte W02
.byte An4
.byte W03
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W02
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W02
.byte VOL , 63*song364restored_mvl/mxv
.byte PAN , c_v+63
.byte W01
.byte N01 , Gs4
.byte W02
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W02
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W03
.byte BEND , c_v-1
.byte N01 , En4
.byte W01
.byte VOL , 85*song364restored_mvl/mxv
.byte PAN , c_v+51
.byte W01
.byte N01 , Ds4
.byte W03
.byte Dn4
.byte W02
.byte Cs4
.byte W02
.byte Bn3
.byte W03
.byte BEND , c_v-1
.byte N01 , An3
.byte W02
.byte BEND , c_v-1
.byte N01 , As4
.byte W03
.byte BEND , c_v-1
.byte N01 , An4
.byte W02
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W02
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W02
.byte VOL , 82*song364restored_mvl/mxv
.byte PAN , c_v+52
.byte W01
.byte BEND , c_v-1
.byte N01 , Fn4
.byte W02
.byte En4
.byte W03
.byte Dn4
.byte W02
.byte Cs4
.byte W02
.byte Bn3
.byte W02
.byte VOL , 100*song364restored_mvl/mxv
.byte PAN , c_v+49
.byte W01
.byte BEND , c_v-1
.byte N01 , Cn5
.byte W02
.byte Bn4
.byte W03
; 001 ----------------------------------------
.byte An4
.byte W02
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W02
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W02
.byte VOL , 63*song364restored_mvl/mxv
.byte PAN , c_v+63
.byte W01
.byte N01 , Gs4
.byte W02
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W03
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W02
.byte BEND , c_v-1
.byte N01 , En4
.byte W02
.byte VOL , 85*song364restored_mvl/mxv
.byte PAN , c_v+51
.byte N01 , Ds4
.byte W03
.byte Dn4
.byte W02
.byte Cs4
.byte W03
.byte Bn3
.byte W02
.byte BEND , c_v-1
.byte N01 , An3
.byte W02
.byte VOL , 92*song364restored_mvl/mxv
.byte PAN , c_v+46
.byte W66
.byte W01
.byte VOL , 94*song364restored_mvl/mxv
.byte PAN , c_v+45
.byte W01
; 002 ----------------------------------------
.byte VOICE , 13
.byte PAN , c_v+46
.byte VOL , 92*song364restored_mvl/mxv
.byte PAN , c_v+46
.byte VOL , 92*song364restored_mvl/mxv
.byte BEND , c_v-1
.byte FINE
;**************** Track 2 (Midi-Chn.8) ****************;
@song364restored_2:
.byte KEYSH , song364restored_key+0
; 000 ----------------------------------------
.byte VOICE , 13
.byte PAN , c_v-20
.byte VOL , 95*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte VOL , 95*song364restored_mvl/mxv
.byte 95*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte c_v-20
.byte VOL , 95*song364restored_mvl/mxv
.byte 95*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte c_v-20
.byte VOL , 95*song364restored_mvl/mxv
.byte BEND , c_v+0
.byte N01 , An4 , v100
.byte W02
.byte Gs4
.byte W02
.byte Fs4
.byte W03
.byte Fn4
.byte W01
.byte VOL , 85*song364restored_mvl/mxv
.byte PAN , c_v-25
.byte W01
.byte N01 , En4
.byte W03
.byte Ds4
.byte W02
.byte Cs4
.byte W02
.byte Cn4
.byte W03
.byte As3
.byte W01
.byte VOL , 104*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte W01
.byte N01 , Bn4
.byte W03
.byte As4
.byte W02
.byte Gs4
.byte W02
.byte Fs4
.byte W03
.byte Fn4
.byte W01
.byte VOL , 73*song364restored_mvl/mxv
.byte PAN , c_v-21
.byte W01
.byte N01 , Gn4
.byte W03
.byte Fs4
.byte W02
.byte Fn4
.byte W02
.byte Ds4
.byte W02
.byte VOL , 90*song364restored_mvl/mxv
.byte W01
.byte N01 , Dn4
.byte W02
.byte Cs4
.byte W03
.byte Cn4
.byte W02
.byte As3
.byte W02
.byte Gs3
.byte W03
.byte An4
.byte W02
.byte Gs4
.byte W03
.byte Fs4
.byte W02
.byte Fn4
.byte W02
.byte VOL , 85*song364restored_mvl/mxv
.byte PAN , c_v-25
.byte N01 , En4
.byte W03
.byte Ds4
.byte W02
.byte Cs4
.byte W03
.byte Cn4
.byte W02
.byte As3
.byte W02
.byte VOL , 104*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte N01 , Bn4
.byte W03
.byte As4
.byte W02
.byte Gs4
.byte W03
.byte Fs4
.byte W02
.byte Fn4
.byte W02
.byte VOL , 73*song364restored_mvl/mxv
.byte PAN , c_v-21
.byte N01 , Gn4
.byte W03
.byte Fs4
.byte W02
.byte Fn4
.byte W03
; 001 ----------------------------------------
.byte Ds4
.byte W01
.byte VOL , 90*song364restored_mvl/mxv
.byte W01
.byte N01 , Dn4
.byte W02
.byte Cs4
.byte W03
.byte Cn4
.byte W02
.byte As3
.byte W03
.byte Gs3
.byte W01
.byte VOL , 92*song364restored_mvl/mxv
.byte PAN , c_v-44
.byte W80
.byte W02
.byte VOL , 95*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte BEND , c_v+0
.byte W01
; 002 ----------------------------------------
.byte VOICE , 13
.byte PAN , c_v-44
.byte VOL , 92*song364restored_mvl/mxv
.byte PAN , c_v-44
.byte VOL , 92*song364restored_mvl/mxv
.byte BEND , c_v+0
.byte FINE
;******************************************************;
.align 4
song364restored:
.byte 2 ; NumTrks
.byte 0 ; NumBlks
.byte song364restored_pri ; Priority
.byte song364restored_rev ; Reverb.
//emit_clean_voicegroup_offset_for_song 364
.word 0x81071B4 //Voice Table
.word @song364restored_1
.word @song364restored_2
| 20.679887 | 56 | 0.543425 |
8db61aee20490dc6a038f40087653d97abb9a31e | 334 | asm | Assembly | programs/oeis/339/A339824.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/339/A339824.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/339/A339824.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A339824: Even bisection of the infinite Fibonacci word A003849.
; 0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,0,0
mul $0,2
add $0,2
seq $0,189661 ; Fixed point of the morphism 0->010, 1->10 starting with 0.
| 47.714286 | 173 | 0.60479 |
1719a903c40ffb6df431cbb5149e0fb84ff79faa | 436 | asm | Assembly | programs/oeis/036/A036406.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/036/A036406.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/036/A036406.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A036406: a(n) = ceiling(n^2/8).
; 0,1,1,2,2,4,5,7,8,11,13,16,18,22,25,29,32,37,41,46,50,56,61,67,72,79,85,92,98,106,113,121,128,137,145,154,162,172,181,191,200,211,221,232,242,254,265,277,288,301,313,326,338,352,365,379,392,407,421,436,450,466,481,497,512,529,545,562,578,596,613,631,648,667,685,704,722,742,761,781,800,821,841,862,882,904,925,947,968,991,1013,1036,1058,1082,1105,1129,1152,1177,1201,1226
pow $0,2
add $0,7
div $0,8
| 62.285714 | 373 | 0.701835 |
c9bd5ab530e32c713e4f8106cd003fd0ce3231e1 | 446 | asm | Assembly | Program 1-1/AddTwo.asm | smitc29/Assembly_Projects | e28fcac0f9343368d9be8b95e79c2881beedd158 | [
"MIT"
] | null | null | null | Program 1-1/AddTwo.asm | smitc29/Assembly_Projects | e28fcac0f9343368d9be8b95e79c2881beedd158 | [
"MIT"
] | null | null | null | Program 1-1/AddTwo.asm | smitc29/Assembly_Projects | e28fcac0f9343368d9be8b95e79c2881beedd158 | [
"MIT"
] | null | null | null | ; Christopher Smith Project 1-1
; CSCI 231 Professor J Ryder
; Sept 28, 2016
; Subtract 3 integers
TITLE MASM Template
INCLUDE Irvine32.inc
; AddTwo.asm - adds two 32-bit integers.
; Chapter 3 example
.data
varA WORD 10
varB WORD 04
varC WORD 02
varD WORD 01
.code
main proc
mov ax, varA
sub ax, varB
sub ax, varC
sub ax, varD
call DumpRegs
exit
;invoke ExitProcess,0
main endp
end main | 13.9375 | 41 | 0.659193 |
c5e42ab9577b3e0fc82e2d8af964ace4cb0fe3d6 | 87 | asm | Assembly | gfx/pokemon/arbok/anim_idle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | gfx/pokemon/arbok/anim_idle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | gfx/pokemon/arbok/anim_idle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | frame 0, 08
frame 4, 06
frame 5, 04
frame 6, 04
frame 5, 04
frame 4, 06
endanim
| 10.875 | 12 | 0.632184 |
72b057c1f1267fd40e92ea1cd9b94343baec0545 | 566 | asm | Assembly | oeis/300/A300071.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/300/A300071.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/300/A300071.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A300071: Decimal expansion of the member z of a triple (x, y, z) solving a certain historical system of three equations with positive y.
; Submitted by Jamie Morken(s3)
; 4,1,5,9,4,1,3,0,5,4,9,6,2,3,5,7,8,1,0,6,7,5,1,4,1,2,4,2,6,1,3,3,9,5,9,4,0,9,8,5,9,3,5,6,0,9,8,4,0,1,9,8,1,2,2,3,5,2,7,3,3,2,6,3,0,2,0,3,9,2,0,7,5,9,8,2,9,5,7,6,7,9,9,7,6,4,7,1,5,7,5,1,5,4,4,1,5,0,0,9
add $0,1
mov $3,$0
mul $3,3
lpb $3
add $6,$2
add $1,$6
add $1,32
add $2,$1
sub $3,1
add $5,$2
add $6,$5
lpe
mov $2,$6
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
| 23.583333 | 201 | 0.575972 |
479906fb8e56e56f8d34abc328249bd25c1256be | 6,347 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_63.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_63.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_63.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r14
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x35ea, %r9
clflush (%r9)
nop
nop
dec %r14
movb (%r9), %r12b
nop
and $14724, %rbp
lea addresses_D_ht+0xb9f9, %rsi
lea addresses_normal_ht+0x3dba, %rdi
nop
nop
nop
cmp %r10, %r10
mov $105, %rcx
rep movsw
nop
add $41673, %r10
lea addresses_D_ht+0x2a22, %rsi
lea addresses_normal_ht+0x109ea, %rdi
nop
xor $50134, %r10
mov $76, %rcx
rep movsq
nop
nop
nop
nop
add %r14, %r14
lea addresses_UC_ht+0x49ea, %r12
and $48604, %r9
mov $0x6162636465666768, %rsi
movq %rsi, %xmm0
and $0xffffffffffffffc0, %r12
vmovntdq %ymm0, (%r12)
nop
nop
nop
nop
cmp $44819, %r12
lea addresses_WT_ht+0x12556, %r12
nop
nop
nop
nop
and $15018, %rbp
mov (%r12), %rdi
nop
add $46669, %rdi
lea addresses_WT_ht+0x17228, %rbp
inc %rdi
mov $0x6162636465666768, %r9
movq %r9, %xmm6
movups %xmm6, (%rbp)
nop
nop
nop
add %r10, %r10
lea addresses_normal_ht+0x1042a, %rsi
lea addresses_normal_ht+0x3b6a, %rdi
nop
add $42248, %r9
mov $118, %rcx
rep movsl
nop
and $61969, %rdi
lea addresses_D_ht+0x17076, %rsi
lea addresses_UC_ht+0x1abf6, %rdi
nop
nop
cmp $8621, %rbp
mov $92, %rcx
rep movsb
nop
nop
nop
and $13199, %r14
lea addresses_WT_ht+0xbfb4, %rsi
lea addresses_normal_ht+0x21ea, %rdi
nop
nop
add %r12, %r12
mov $68, %rcx
rep movsl
nop
and %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %rax
push %rcx
push %rdi
push %rsi
// Faulty Load
lea addresses_WC+0x1c1ea, %rdi
nop
nop
nop
and $51916, %r12
mov (%rdi), %rax
lea oracles, %rcx
and $0xff, %rax
shlq $12, %rax
mov (%rcx,%rax,1), %rax
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': True, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': True, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 6}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 10}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 41.214286 | 2,999 | 0.663621 |
e83e64269a68f9f7119d21a3f9f0ba8f030b96a8 | 580 | asm | Assembly | book-01/Assembly/asm/avx/scalar/avx_s_compare_vcmpsd_double.asm | gfurtadoalmeida/study-assembly-x64 | 4acdefb015d44706c60bd7ea5d94f726c4dbcbb4 | [
"MIT"
] | 2 | 2021-02-27T04:50:26.000Z | 2022-03-15T23:27:12.000Z | book-01/Assembly/asm/avx/scalar/avx_s_compare_vcmpsd_double.asm | gfurtadoalmeida/study-assembly-x64 | 4acdefb015d44706c60bd7ea5d94f726c4dbcbb4 | [
"MIT"
] | null | null | null | book-01/Assembly/asm/avx/scalar/avx_s_compare_vcmpsd_double.asm | gfurtadoalmeida/study-assembly-x64 | 4acdefb015d44706c60bd7ea5d94f726c4dbcbb4 | [
"MIT"
] | null | null | null | include comparison_predicates.inc
.code
; int AVX_Scalar_Compare_VCMPSD_Double_(double a, double b)
AVX_Scalar_Compare_VCMPSD_Double_ proc
xor r8, r8
vcmpsd xmm2, xmm0, xmm1, CMP_LT_OS
vmovq rax, xmm2
and al, 1 ; Remove unecessary bits and set RFLAGS. If comparison fails ZF will be zero.
jnz Smaller
vcmpsd xmm2, xmm0, xmm1, CMP_EQ_OQ
vmovq rax, xmm2
and al, 1
jnz Done
vcmpsd xmm2, xmm0, xmm1, CMP_GT_OS
vmovq rax, xmm2
and al, 1
jnz Bigger
Smaller:
dec r8 ; r8 = -1
jmp Done
Bigger:
inc r8 ; r8 = 1
Done:
mov eax, r8d
ret
AVX_Scalar_Compare_VCMPSD_Double_ endp
end | 15.263158 | 89 | 0.763793 |
ab65855191880c51620ddffc20851a3b259958bd | 228 | asm | Assembly | programs/oeis/010/A010723.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/010/A010723.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/010/A010723.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A010723: Period 2: repeat (6,7).
; 6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6,7,6
mov $1,$0
mod $1,2
add $1,6
| 32.571429 | 163 | 0.517544 |
01a748665e244ade2dda7fbf46a65140fc3ea6d6 | 482 | asm | Assembly | oeis/349/A349594.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/349/A349594.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/349/A349594.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A349594: Number of 2 X n mazes that can be navigated from the top left corner to the bottom right corner.
; Submitted by Christian Krause
; 1,7,40,216,1144,6016,31552,165312,865792,4533760,23739904,124305408,650874880,3408031744,17844699136,93436084224,489237741568,2561682178048,13413142233088,70232124948480,367740181282816,1925512588951552,10082114810675200,52790638512439296
mov $3,1
lpb $0
sub $0,1
sub $3,$1
add $1,$3
sub $2,$1
mul $3,8
add $3,$2
lpe
mov $0,$3
| 32.133333 | 240 | 0.76971 |
20c7a30c9df129669a26a901874e5a820153e1f5 | 20 | asm | Assembly | songs/song_42.asm | jorgicor/altair | a83f4a5b177c366000f69cb261befb499602aa69 | [
"MIT"
] | null | null | null | songs/song_42.asm | jorgicor/altair | a83f4a5b177c366000f69cb261befb499602aa69 | [
"MIT"
] | null | null | null | songs/song_42.asm | jorgicor/altair | a83f4a5b177c366000f69cb261befb499602aa69 | [
"MIT"
] | null | null | null | .db E3, F8, E4, F9
| 10 | 19 | 0.5 |
1cb981e0ee8756718fb2d64c7d3b7138b347ad7c | 2,237 | asm | Assembly | programs/oeis/050/A050534.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/050/A050534.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/050/A050534.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A050534: Tritriangular numbers: a(n) = binomial(binomial(n,2),2) = n(n + 1)(n - 1)(n - 2)/8.
; 0,0,0,3,15,45,105,210,378,630,990,1485,2145,3003,4095,5460,7140,9180,11628,14535,17955,21945,26565,31878,37950,44850,52650,61425,71253,82215,94395,107880,122760,139128,157080,176715,198135,221445,246753,274170,303810,335790,370230,407253,446985,489555,535095,583740,635628,690900,749700,812175,878475,948753,1023165,1101870,1185030,1272810,1365378,1462905,1565565,1673535,1786995,1906128,2031120,2162160,2299440,2443155,2593503,2750685,2914905,3086370,3265290,3451878,3646350,3848925,4059825,4279275,4507503,4744740,4991220,5247180,5512860,5788503,6074355,6370665,6677685,6995670,7324878,7665570,8018010,8382465,8759205,9148503,9550635,9965880,10394520,10836840,11293128,11763675,12248775,12748725,13263825,13794378,14340690,14903070,15481830,16077285,16689753,17319555,17967015,18632460,19316220,20018628,20740020,21480735,22241115,23021505,23822253,24643710,25486230,26350170,27235890,28143753,29074125,30027375,31003875,32004000,33028128,34076640,35149920,36248355,37372335,38522253,39698505,40901490,42131610,43389270,44674878,45988845,47331585,48703515,50105055,51536628,52998660,54491580,56015820,57571815,59160003,60780825,62434725,64122150,65843550,67599378,69390090,71216145,73078005,74976135,76911003,78883080,80892840,82940760,85027320,87153003,89318295,91523685,93769665,96056730,98385378,100756110,103169430,105625845,108125865,110670003,113258775,115892700,118572300,121298100,124070628,126890415,129757995,132673905,135638685,138652878,141717030,144831690,147997410,151214745,154484253,157806495,161182035,164611440,168095280,171634128,175228560,178879155,182586495,186351165,190173753,194054850,197995050,201994950,206055150,210176253,214358865,218603595,222911055,227281860,231716628,236215980,240780540,245410935,250107795,254871753,259703445,264603510,269572590,274611330,279720378,284900385,290152005,295475895,300872715,306343128,311887800,317507400,323202600,328974075,334822503,340748565,346752945,352836330,358999410,365242878,371567430,377973765,384462585,391034595,397690503,404431020,411256860,418168740,425167380,432253503,439427835,446691105,454044045,461487390,469021878,476648250
mov $1,$0
bin $1,2
bin $1,2
| 319.571429 | 2,112 | 0.863657 |
8e916b54ca42f31b89a20086489fced6ed02b4aa | 326 | asm | Assembly | programs/oeis/070/A070419.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/070/A070419.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/070/A070419.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A070419: a(n) = 7^n mod 36.
; 1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19,25,31,1,7,13,19
mod $0,6
mul $0,6
add $0,1
| 46.571429 | 267 | 0.604294 |
486a43624f1ae73a666a2915cca2289cfc05bfc3 | 427 | asm | Assembly | programs/oeis/108/A108214.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/108/A108214.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/108/A108214.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A108214: Denominator of the O(x^2) term in the Maclaurin series of the square of the Jacobi polynomial P^{a,b}_n(z) about z=1-x for real positive x.
; 8,48,576,11520,345600,14515200,812851200,58525286400,5267275776000,579400335360000,76480844267520000,11931011705733120000,2171444130443427840000,456003267393119846400000
add $0,1
mov $2,1
lpb $0
sub $0,1
add $3,2
add $4,$3
mul $2,$4
lpe
mov $0,$2
div $0,2
mul $0,8
| 28.466667 | 171 | 0.749415 |
64ce587064f172c833cfa5b4bda61685f75b5135 | 45,654 | asm | Assembly | user/primes.asm | frank-liang-lbm/xv6-labs-2020 | 624e17b2adb0be3a6ca0e11f8677ef51442b1a0e | [
"MIT-0"
] | null | null | null | user/primes.asm | frank-liang-lbm/xv6-labs-2020 | 624e17b2adb0be3a6ca0e11f8677ef51442b1a0e | [
"MIT-0"
] | null | null | null | user/primes.asm | frank-liang-lbm/xv6-labs-2020 | 624e17b2adb0be3a6ca0e11f8677ef51442b1a0e | [
"MIT-0"
] | null | null | null |
user/_primes: file format elf64-littleriscv
Disassembly of section .text:
0000000000000000 <read_left_first>:
@param lpipe:左边的管道符
@param *lfirst:指向读取左边的第一个数据
@return:有数据返回0,无数据返回1
*/
int read_left_first(int lpipe[], int *lfirst)
{
0: 1101 addi sp,sp,-32
2: ec06 sd ra,24(sp)
4: e822 sd s0,16(sp)
6: e426 sd s1,8(sp)
8: 1000 addi s0,sp,32
a: 84ae mv s1,a1
if (read(lpipe[RD], lfirst, INT_LEN) > 0)
c: 4611 li a2,4
e: 4108 lw a0,0(a0)
10: 00000097 auipc ra,0x0
14: 43c080e7 jalr 1084(ra) # 44c <read>
18: 00a04863 bgtz a0,28 <read_left_first+0x28>
{
printf("prime %d\n", *lfirst);
return 0;
}
return 1;
1c: 4505 li a0,1
}
1e: 60e2 ld ra,24(sp)
20: 6442 ld s0,16(sp)
22: 64a2 ld s1,8(sp)
24: 6105 addi sp,sp,32
26: 8082 ret
printf("prime %d\n", *lfirst);
28: 408c lw a1,0(s1)
2a: 00001517 auipc a0,0x1
2e: 92650513 addi a0,a0,-1754 # 950 <malloc+0xe6>
32: 00000097 auipc ra,0x0
36: 77a080e7 jalr 1914(ra) # 7ac <printf>
return 0;
3a: 4501 li a0,0
3c: b7cd j 1e <read_left_first+0x1e>
000000000000003e <transmit>:
@param lpipe:左边的管道符
@param rpipe:右边的管道符
@param first:左边的第一个数据
*/
void transmit(int lpipe[], int rpipe[], int first)
{
3e: 7139 addi sp,sp,-64
40: fc06 sd ra,56(sp)
42: f822 sd s0,48(sp)
44: f426 sd s1,40(sp)
46: f04a sd s2,32(sp)
48: ec4e sd s3,24(sp)
4a: 0080 addi s0,sp,64
4c: 84aa mv s1,a0
4e: 89ae mv s3,a1
50: 8932 mv s2,a2
int tmp = 0;
52: fc042623 sw zero,-52(s0)
while (read(lpipe[RD], &tmp, INT_LEN) > 0)
56: 4611 li a2,4
58: fcc40593 addi a1,s0,-52
5c: 4088 lw a0,0(s1)
5e: 00000097 auipc ra,0x0
62: 3ee080e7 jalr 1006(ra) # 44c <read>
66: 02a05163 blez a0,88 <transmit+0x4a>
{
if (tmp % first != 0)
6a: fcc42783 lw a5,-52(s0)
6e: 0327e7bb remw a5,a5,s2
72: d3f5 beqz a5,56 <transmit+0x18>
{
write(rpipe[WR], &tmp, INT_LEN);
74: 4611 li a2,4
76: fcc40593 addi a1,s0,-52
7a: 0049a503 lw a0,4(s3)
7e: 00000097 auipc ra,0x0
82: 3d6080e7 jalr 982(ra) # 454 <write>
86: bfc1 j 56 <transmit+0x18>
}
}
close(rpipe[WR]);
88: 0049a503 lw a0,4(s3)
8c: 00000097 auipc ra,0x0
90: 3d0080e7 jalr 976(ra) # 45c <close>
close(lpipe[RD]);
94: 4088 lw a0,0(s1)
96: 00000097 auipc ra,0x0
9a: 3c6080e7 jalr 966(ra) # 45c <close>
}
9e: 70e2 ld ra,56(sp)
a0: 7442 ld s0,48(sp)
a2: 74a2 ld s1,40(sp)
a4: 7902 ld s2,32(sp)
a6: 69e2 ld s3,24(sp)
a8: 6121 addi sp,sp,64
aa: 8082 ret
00000000000000ac <primes>:
/*
@funciton:寻找素数
@param:左边的管道符
*/
void primes(int lpipe[])
{
ac: 7179 addi sp,sp,-48
ae: f406 sd ra,40(sp)
b0: f022 sd s0,32(sp)
b2: ec26 sd s1,24(sp)
b4: 1800 addi s0,sp,48
b6: 84aa mv s1,a0
close(lpipe[WR]);
b8: 4148 lw a0,4(a0)
ba: 00000097 auipc ra,0x0
be: 3a2080e7 jalr 930(ra) # 45c <close>
int p[2];
pipe(p);
c2: fd840513 addi a0,s0,-40
c6: 00000097 auipc ra,0x0
ca: 37e080e7 jalr 894(ra) # 444 <pipe>
int first_of_left;
if (read_left_first(lpipe, &first_of_left) == 0) //左边有数据
ce: fd440593 addi a1,s0,-44
d2: 8526 mv a0,s1
d4: 00000097 auipc ra,0x0
d8: f2c080e7 jalr -212(ra) # 0 <read_left_first>
dc: ed1d bnez a0,11a <primes+0x6e>
{
if (fork() == 0)
de: 00000097 auipc ra,0x0
e2: 34e080e7 jalr 846(ra) # 42c <fork>
e6: c505 beqz a0,10e <primes+0x62>
{
primes(p);
}
transmit(lpipe, p, first_of_left); //将左边的数据传入右边
e8: fd442603 lw a2,-44(s0)
ec: fd840593 addi a1,s0,-40
f0: 8526 mv a0,s1
f2: 00000097 auipc ra,0x0
f6: f4c080e7 jalr -180(ra) # 3e <transmit>
wait(0);
fa: 4501 li a0,0
fc: 00000097 auipc ra,0x0
100: 340080e7 jalr 832(ra) # 43c <wait>
exit(0);
104: 4501 li a0,0
106: 00000097 auipc ra,0x0
10a: 32e080e7 jalr 814(ra) # 434 <exit>
primes(p);
10e: fd840513 addi a0,s0,-40
112: 00000097 auipc ra,0x0
116: f9a080e7 jalr -102(ra) # ac <primes>
}
else
{
close(lpipe[RD]);
11a: 4088 lw a0,0(s1)
11c: 00000097 auipc ra,0x0
120: 340080e7 jalr 832(ra) # 45c <close>
close(p[WR]);
124: fdc42503 lw a0,-36(s0)
128: 00000097 auipc ra,0x0
12c: 334080e7 jalr 820(ra) # 45c <close>
exit(0);
130: 4501 li a0,0
132: 00000097 auipc ra,0x0
136: 302080e7 jalr 770(ra) # 434 <exit>
000000000000013a <main>:
}
}
int main(int agrc, char *agrv[])
{
13a: 7179 addi sp,sp,-48
13c: f406 sd ra,40(sp)
13e: f022 sd s0,32(sp)
140: ec26 sd s1,24(sp)
142: 1800 addi s0,sp,48
int p[2];
pipe(p);
144: fd840513 addi a0,s0,-40
148: 00000097 auipc ra,0x0
14c: 2fc080e7 jalr 764(ra) # 444 <pipe>
for (int i = 2; i <= 35; i++)
150: 4789 li a5,2
152: fcf42a23 sw a5,-44(s0)
156: 02300493 li s1,35
{
write(p[WR], &i, INT_LEN);
15a: 4611 li a2,4
15c: fd440593 addi a1,s0,-44
160: fdc42503 lw a0,-36(s0)
164: 00000097 auipc ra,0x0
168: 2f0080e7 jalr 752(ra) # 454 <write>
for (int i = 2; i <= 35; i++)
16c: fd442783 lw a5,-44(s0)
170: 2785 addiw a5,a5,1
172: 0007871b sext.w a4,a5
176: fcf42a23 sw a5,-44(s0)
17a: fee4d0e3 bge s1,a4,15a <main+0x20>
}
if (fork() == 0)
17e: 00000097 auipc ra,0x0
182: 2ae080e7 jalr 686(ra) # 42c <fork>
186: e519 bnez a0,194 <main+0x5a>
{
primes(p);
188: fd840513 addi a0,s0,-40
18c: 00000097 auipc ra,0x0
190: f20080e7 jalr -224(ra) # ac <primes>
}
close(p[WR]);
194: fdc42503 lw a0,-36(s0)
198: 00000097 auipc ra,0x0
19c: 2c4080e7 jalr 708(ra) # 45c <close>
close(RD);
1a0: 4501 li a0,0
1a2: 00000097 auipc ra,0x0
1a6: 2ba080e7 jalr 698(ra) # 45c <close>
wait(0);
1aa: 4501 li a0,0
1ac: 00000097 auipc ra,0x0
1b0: 290080e7 jalr 656(ra) # 43c <wait>
exit(0);
1b4: 4501 li a0,0
1b6: 00000097 auipc ra,0x0
1ba: 27e080e7 jalr 638(ra) # 434 <exit>
00000000000001be <strcpy>:
#include "kernel/fcntl.h"
#include "user/user.h"
char*
strcpy(char *s, const char *t)
{
1be: 1141 addi sp,sp,-16
1c0: e422 sd s0,8(sp)
1c2: 0800 addi s0,sp,16
char *os;
os = s;
while((*s++ = *t++) != 0)
1c4: 87aa mv a5,a0
1c6: 0585 addi a1,a1,1
1c8: 0785 addi a5,a5,1
1ca: fff5c703 lbu a4,-1(a1)
1ce: fee78fa3 sb a4,-1(a5)
1d2: fb75 bnez a4,1c6 <strcpy+0x8>
;
return os;
}
1d4: 6422 ld s0,8(sp)
1d6: 0141 addi sp,sp,16
1d8: 8082 ret
00000000000001da <strcmp>:
int
strcmp(const char *p, const char *q)
{
1da: 1141 addi sp,sp,-16
1dc: e422 sd s0,8(sp)
1de: 0800 addi s0,sp,16
while(*p && *p == *q)
1e0: 00054783 lbu a5,0(a0)
1e4: cb91 beqz a5,1f8 <strcmp+0x1e>
1e6: 0005c703 lbu a4,0(a1)
1ea: 00f71763 bne a4,a5,1f8 <strcmp+0x1e>
p++, q++;
1ee: 0505 addi a0,a0,1
1f0: 0585 addi a1,a1,1
while(*p && *p == *q)
1f2: 00054783 lbu a5,0(a0)
1f6: fbe5 bnez a5,1e6 <strcmp+0xc>
return (uchar)*p - (uchar)*q;
1f8: 0005c503 lbu a0,0(a1)
}
1fc: 40a7853b subw a0,a5,a0
200: 6422 ld s0,8(sp)
202: 0141 addi sp,sp,16
204: 8082 ret
0000000000000206 <strlen>:
uint
strlen(const char *s)
{
206: 1141 addi sp,sp,-16
208: e422 sd s0,8(sp)
20a: 0800 addi s0,sp,16
int n;
for(n = 0; s[n]; n++)
20c: 00054783 lbu a5,0(a0)
210: cf91 beqz a5,22c <strlen+0x26>
212: 0505 addi a0,a0,1
214: 87aa mv a5,a0
216: 4685 li a3,1
218: 9e89 subw a3,a3,a0
21a: 00f6853b addw a0,a3,a5
21e: 0785 addi a5,a5,1
220: fff7c703 lbu a4,-1(a5)
224: fb7d bnez a4,21a <strlen+0x14>
;
return n;
}
226: 6422 ld s0,8(sp)
228: 0141 addi sp,sp,16
22a: 8082 ret
for(n = 0; s[n]; n++)
22c: 4501 li a0,0
22e: bfe5 j 226 <strlen+0x20>
0000000000000230 <memset>:
void*
memset(void *dst, int c, uint n)
{
230: 1141 addi sp,sp,-16
232: e422 sd s0,8(sp)
234: 0800 addi s0,sp,16
char *cdst = (char *) dst;
int i;
for(i = 0; i < n; i++){
236: ce09 beqz a2,250 <memset+0x20>
238: 87aa mv a5,a0
23a: fff6071b addiw a4,a2,-1
23e: 1702 slli a4,a4,0x20
240: 9301 srli a4,a4,0x20
242: 0705 addi a4,a4,1
244: 972a add a4,a4,a0
cdst[i] = c;
246: 00b78023 sb a1,0(a5)
for(i = 0; i < n; i++){
24a: 0785 addi a5,a5,1
24c: fee79de3 bne a5,a4,246 <memset+0x16>
}
return dst;
}
250: 6422 ld s0,8(sp)
252: 0141 addi sp,sp,16
254: 8082 ret
0000000000000256 <strchr>:
char*
strchr(const char *s, char c)
{
256: 1141 addi sp,sp,-16
258: e422 sd s0,8(sp)
25a: 0800 addi s0,sp,16
for(; *s; s++)
25c: 00054783 lbu a5,0(a0)
260: cb99 beqz a5,276 <strchr+0x20>
if(*s == c)
262: 00f58763 beq a1,a5,270 <strchr+0x1a>
for(; *s; s++)
266: 0505 addi a0,a0,1
268: 00054783 lbu a5,0(a0)
26c: fbfd bnez a5,262 <strchr+0xc>
return (char*)s;
return 0;
26e: 4501 li a0,0
}
270: 6422 ld s0,8(sp)
272: 0141 addi sp,sp,16
274: 8082 ret
return 0;
276: 4501 li a0,0
278: bfe5 j 270 <strchr+0x1a>
000000000000027a <gets>:
char*
gets(char *buf, int max)
{
27a: 711d addi sp,sp,-96
27c: ec86 sd ra,88(sp)
27e: e8a2 sd s0,80(sp)
280: e4a6 sd s1,72(sp)
282: e0ca sd s2,64(sp)
284: fc4e sd s3,56(sp)
286: f852 sd s4,48(sp)
288: f456 sd s5,40(sp)
28a: f05a sd s6,32(sp)
28c: ec5e sd s7,24(sp)
28e: 1080 addi s0,sp,96
290: 8baa mv s7,a0
292: 8a2e mv s4,a1
int i, cc;
char c;
for(i=0; i+1 < max; ){
294: 892a mv s2,a0
296: 4481 li s1,0
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
298: 4aa9 li s5,10
29a: 4b35 li s6,13
for(i=0; i+1 < max; ){
29c: 89a6 mv s3,s1
29e: 2485 addiw s1,s1,1
2a0: 0344d863 bge s1,s4,2d0 <gets+0x56>
cc = read(0, &c, 1);
2a4: 4605 li a2,1
2a6: faf40593 addi a1,s0,-81
2aa: 4501 li a0,0
2ac: 00000097 auipc ra,0x0
2b0: 1a0080e7 jalr 416(ra) # 44c <read>
if(cc < 1)
2b4: 00a05e63 blez a0,2d0 <gets+0x56>
buf[i++] = c;
2b8: faf44783 lbu a5,-81(s0)
2bc: 00f90023 sb a5,0(s2)
if(c == '\n' || c == '\r')
2c0: 01578763 beq a5,s5,2ce <gets+0x54>
2c4: 0905 addi s2,s2,1
2c6: fd679be3 bne a5,s6,29c <gets+0x22>
for(i=0; i+1 < max; ){
2ca: 89a6 mv s3,s1
2cc: a011 j 2d0 <gets+0x56>
2ce: 89a6 mv s3,s1
break;
}
buf[i] = '\0';
2d0: 99de add s3,s3,s7
2d2: 00098023 sb zero,0(s3)
return buf;
}
2d6: 855e mv a0,s7
2d8: 60e6 ld ra,88(sp)
2da: 6446 ld s0,80(sp)
2dc: 64a6 ld s1,72(sp)
2de: 6906 ld s2,64(sp)
2e0: 79e2 ld s3,56(sp)
2e2: 7a42 ld s4,48(sp)
2e4: 7aa2 ld s5,40(sp)
2e6: 7b02 ld s6,32(sp)
2e8: 6be2 ld s7,24(sp)
2ea: 6125 addi sp,sp,96
2ec: 8082 ret
00000000000002ee <stat>:
int
stat(const char *n, struct stat *st)
{
2ee: 1101 addi sp,sp,-32
2f0: ec06 sd ra,24(sp)
2f2: e822 sd s0,16(sp)
2f4: e426 sd s1,8(sp)
2f6: e04a sd s2,0(sp)
2f8: 1000 addi s0,sp,32
2fa: 892e mv s2,a1
int fd;
int r;
fd = open(n, O_RDONLY);
2fc: 4581 li a1,0
2fe: 00000097 auipc ra,0x0
302: 176080e7 jalr 374(ra) # 474 <open>
if(fd < 0)
306: 02054563 bltz a0,330 <stat+0x42>
30a: 84aa mv s1,a0
return -1;
r = fstat(fd, st);
30c: 85ca mv a1,s2
30e: 00000097 auipc ra,0x0
312: 17e080e7 jalr 382(ra) # 48c <fstat>
316: 892a mv s2,a0
close(fd);
318: 8526 mv a0,s1
31a: 00000097 auipc ra,0x0
31e: 142080e7 jalr 322(ra) # 45c <close>
return r;
}
322: 854a mv a0,s2
324: 60e2 ld ra,24(sp)
326: 6442 ld s0,16(sp)
328: 64a2 ld s1,8(sp)
32a: 6902 ld s2,0(sp)
32c: 6105 addi sp,sp,32
32e: 8082 ret
return -1;
330: 597d li s2,-1
332: bfc5 j 322 <stat+0x34>
0000000000000334 <atoi>:
int
atoi(const char *s)
{
334: 1141 addi sp,sp,-16
336: e422 sd s0,8(sp)
338: 0800 addi s0,sp,16
int n;
n = 0;
while('0' <= *s && *s <= '9')
33a: 00054603 lbu a2,0(a0)
33e: fd06079b addiw a5,a2,-48
342: 0ff7f793 andi a5,a5,255
346: 4725 li a4,9
348: 02f76963 bltu a4,a5,37a <atoi+0x46>
34c: 86aa mv a3,a0
n = 0;
34e: 4501 li a0,0
while('0' <= *s && *s <= '9')
350: 45a5 li a1,9
n = n*10 + *s++ - '0';
352: 0685 addi a3,a3,1
354: 0025179b slliw a5,a0,0x2
358: 9fa9 addw a5,a5,a0
35a: 0017979b slliw a5,a5,0x1
35e: 9fb1 addw a5,a5,a2
360: fd07851b addiw a0,a5,-48
while('0' <= *s && *s <= '9')
364: 0006c603 lbu a2,0(a3)
368: fd06071b addiw a4,a2,-48
36c: 0ff77713 andi a4,a4,255
370: fee5f1e3 bgeu a1,a4,352 <atoi+0x1e>
return n;
}
374: 6422 ld s0,8(sp)
376: 0141 addi sp,sp,16
378: 8082 ret
n = 0;
37a: 4501 li a0,0
37c: bfe5 j 374 <atoi+0x40>
000000000000037e <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
37e: 1141 addi sp,sp,-16
380: e422 sd s0,8(sp)
382: 0800 addi s0,sp,16
char *dst;
const char *src;
dst = vdst;
src = vsrc;
if (src > dst) {
384: 02b57663 bgeu a0,a1,3b0 <memmove+0x32>
while(n-- > 0)
388: 02c05163 blez a2,3aa <memmove+0x2c>
38c: fff6079b addiw a5,a2,-1
390: 1782 slli a5,a5,0x20
392: 9381 srli a5,a5,0x20
394: 0785 addi a5,a5,1
396: 97aa add a5,a5,a0
dst = vdst;
398: 872a mv a4,a0
*dst++ = *src++;
39a: 0585 addi a1,a1,1
39c: 0705 addi a4,a4,1
39e: fff5c683 lbu a3,-1(a1)
3a2: fed70fa3 sb a3,-1(a4)
while(n-- > 0)
3a6: fee79ae3 bne a5,a4,39a <memmove+0x1c>
src += n;
while(n-- > 0)
*--dst = *--src;
}
return vdst;
}
3aa: 6422 ld s0,8(sp)
3ac: 0141 addi sp,sp,16
3ae: 8082 ret
dst += n;
3b0: 00c50733 add a4,a0,a2
src += n;
3b4: 95b2 add a1,a1,a2
while(n-- > 0)
3b6: fec05ae3 blez a2,3aa <memmove+0x2c>
3ba: fff6079b addiw a5,a2,-1
3be: 1782 slli a5,a5,0x20
3c0: 9381 srli a5,a5,0x20
3c2: fff7c793 not a5,a5
3c6: 97ba add a5,a5,a4
*--dst = *--src;
3c8: 15fd addi a1,a1,-1
3ca: 177d addi a4,a4,-1
3cc: 0005c683 lbu a3,0(a1)
3d0: 00d70023 sb a3,0(a4)
while(n-- > 0)
3d4: fee79ae3 bne a5,a4,3c8 <memmove+0x4a>
3d8: bfc9 j 3aa <memmove+0x2c>
00000000000003da <memcmp>:
int
memcmp(const void *s1, const void *s2, uint n)
{
3da: 1141 addi sp,sp,-16
3dc: e422 sd s0,8(sp)
3de: 0800 addi s0,sp,16
const char *p1 = s1, *p2 = s2;
while (n-- > 0) {
3e0: ca05 beqz a2,410 <memcmp+0x36>
3e2: fff6069b addiw a3,a2,-1
3e6: 1682 slli a3,a3,0x20
3e8: 9281 srli a3,a3,0x20
3ea: 0685 addi a3,a3,1
3ec: 96aa add a3,a3,a0
if (*p1 != *p2) {
3ee: 00054783 lbu a5,0(a0)
3f2: 0005c703 lbu a4,0(a1)
3f6: 00e79863 bne a5,a4,406 <memcmp+0x2c>
return *p1 - *p2;
}
p1++;
3fa: 0505 addi a0,a0,1
p2++;
3fc: 0585 addi a1,a1,1
while (n-- > 0) {
3fe: fed518e3 bne a0,a3,3ee <memcmp+0x14>
}
return 0;
402: 4501 li a0,0
404: a019 j 40a <memcmp+0x30>
return *p1 - *p2;
406: 40e7853b subw a0,a5,a4
}
40a: 6422 ld s0,8(sp)
40c: 0141 addi sp,sp,16
40e: 8082 ret
return 0;
410: 4501 li a0,0
412: bfe5 j 40a <memcmp+0x30>
0000000000000414 <memcpy>:
void *
memcpy(void *dst, const void *src, uint n)
{
414: 1141 addi sp,sp,-16
416: e406 sd ra,8(sp)
418: e022 sd s0,0(sp)
41a: 0800 addi s0,sp,16
return memmove(dst, src, n);
41c: 00000097 auipc ra,0x0
420: f62080e7 jalr -158(ra) # 37e <memmove>
}
424: 60a2 ld ra,8(sp)
426: 6402 ld s0,0(sp)
428: 0141 addi sp,sp,16
42a: 8082 ret
000000000000042c <fork>:
# generated by usys.pl - do not edit
#include "kernel/syscall.h"
.global fork
fork:
li a7, SYS_fork
42c: 4885 li a7,1
ecall
42e: 00000073 ecall
ret
432: 8082 ret
0000000000000434 <exit>:
.global exit
exit:
li a7, SYS_exit
434: 4889 li a7,2
ecall
436: 00000073 ecall
ret
43a: 8082 ret
000000000000043c <wait>:
.global wait
wait:
li a7, SYS_wait
43c: 488d li a7,3
ecall
43e: 00000073 ecall
ret
442: 8082 ret
0000000000000444 <pipe>:
.global pipe
pipe:
li a7, SYS_pipe
444: 4891 li a7,4
ecall
446: 00000073 ecall
ret
44a: 8082 ret
000000000000044c <read>:
.global read
read:
li a7, SYS_read
44c: 4895 li a7,5
ecall
44e: 00000073 ecall
ret
452: 8082 ret
0000000000000454 <write>:
.global write
write:
li a7, SYS_write
454: 48c1 li a7,16
ecall
456: 00000073 ecall
ret
45a: 8082 ret
000000000000045c <close>:
.global close
close:
li a7, SYS_close
45c: 48d5 li a7,21
ecall
45e: 00000073 ecall
ret
462: 8082 ret
0000000000000464 <kill>:
.global kill
kill:
li a7, SYS_kill
464: 4899 li a7,6
ecall
466: 00000073 ecall
ret
46a: 8082 ret
000000000000046c <exec>:
.global exec
exec:
li a7, SYS_exec
46c: 489d li a7,7
ecall
46e: 00000073 ecall
ret
472: 8082 ret
0000000000000474 <open>:
.global open
open:
li a7, SYS_open
474: 48bd li a7,15
ecall
476: 00000073 ecall
ret
47a: 8082 ret
000000000000047c <mknod>:
.global mknod
mknod:
li a7, SYS_mknod
47c: 48c5 li a7,17
ecall
47e: 00000073 ecall
ret
482: 8082 ret
0000000000000484 <unlink>:
.global unlink
unlink:
li a7, SYS_unlink
484: 48c9 li a7,18
ecall
486: 00000073 ecall
ret
48a: 8082 ret
000000000000048c <fstat>:
.global fstat
fstat:
li a7, SYS_fstat
48c: 48a1 li a7,8
ecall
48e: 00000073 ecall
ret
492: 8082 ret
0000000000000494 <link>:
.global link
link:
li a7, SYS_link
494: 48cd li a7,19
ecall
496: 00000073 ecall
ret
49a: 8082 ret
000000000000049c <mkdir>:
.global mkdir
mkdir:
li a7, SYS_mkdir
49c: 48d1 li a7,20
ecall
49e: 00000073 ecall
ret
4a2: 8082 ret
00000000000004a4 <chdir>:
.global chdir
chdir:
li a7, SYS_chdir
4a4: 48a5 li a7,9
ecall
4a6: 00000073 ecall
ret
4aa: 8082 ret
00000000000004ac <dup>:
.global dup
dup:
li a7, SYS_dup
4ac: 48a9 li a7,10
ecall
4ae: 00000073 ecall
ret
4b2: 8082 ret
00000000000004b4 <getpid>:
.global getpid
getpid:
li a7, SYS_getpid
4b4: 48ad li a7,11
ecall
4b6: 00000073 ecall
ret
4ba: 8082 ret
00000000000004bc <sbrk>:
.global sbrk
sbrk:
li a7, SYS_sbrk
4bc: 48b1 li a7,12
ecall
4be: 00000073 ecall
ret
4c2: 8082 ret
00000000000004c4 <sleep>:
.global sleep
sleep:
li a7, SYS_sleep
4c4: 48b5 li a7,13
ecall
4c6: 00000073 ecall
ret
4ca: 8082 ret
00000000000004cc <uptime>:
.global uptime
uptime:
li a7, SYS_uptime
4cc: 48b9 li a7,14
ecall
4ce: 00000073 ecall
ret
4d2: 8082 ret
00000000000004d4 <putc>:
static char digits[] = "0123456789ABCDEF";
static void
putc(int fd, char c)
{
4d4: 1101 addi sp,sp,-32
4d6: ec06 sd ra,24(sp)
4d8: e822 sd s0,16(sp)
4da: 1000 addi s0,sp,32
4dc: feb407a3 sb a1,-17(s0)
write(fd, &c, 1);
4e0: 4605 li a2,1
4e2: fef40593 addi a1,s0,-17
4e6: 00000097 auipc ra,0x0
4ea: f6e080e7 jalr -146(ra) # 454 <write>
}
4ee: 60e2 ld ra,24(sp)
4f0: 6442 ld s0,16(sp)
4f2: 6105 addi sp,sp,32
4f4: 8082 ret
00000000000004f6 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
4f6: 7139 addi sp,sp,-64
4f8: fc06 sd ra,56(sp)
4fa: f822 sd s0,48(sp)
4fc: f426 sd s1,40(sp)
4fe: f04a sd s2,32(sp)
500: ec4e sd s3,24(sp)
502: 0080 addi s0,sp,64
504: 84aa mv s1,a0
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
506: c299 beqz a3,50c <printint+0x16>
508: 0805c863 bltz a1,598 <printint+0xa2>
neg = 1;
x = -xx;
} else {
x = xx;
50c: 2581 sext.w a1,a1
neg = 0;
50e: 4881 li a7,0
510: fc040693 addi a3,s0,-64
}
i = 0;
514: 4701 li a4,0
do{
buf[i++] = digits[x % base];
516: 2601 sext.w a2,a2
518: 00000517 auipc a0,0x0
51c: 45050513 addi a0,a0,1104 # 968 <digits>
520: 883a mv a6,a4
522: 2705 addiw a4,a4,1
524: 02c5f7bb remuw a5,a1,a2
528: 1782 slli a5,a5,0x20
52a: 9381 srli a5,a5,0x20
52c: 97aa add a5,a5,a0
52e: 0007c783 lbu a5,0(a5)
532: 00f68023 sb a5,0(a3)
}while((x /= base) != 0);
536: 0005879b sext.w a5,a1
53a: 02c5d5bb divuw a1,a1,a2
53e: 0685 addi a3,a3,1
540: fec7f0e3 bgeu a5,a2,520 <printint+0x2a>
if(neg)
544: 00088b63 beqz a7,55a <printint+0x64>
buf[i++] = '-';
548: fd040793 addi a5,s0,-48
54c: 973e add a4,a4,a5
54e: 02d00793 li a5,45
552: fef70823 sb a5,-16(a4)
556: 0028071b addiw a4,a6,2
while(--i >= 0)
55a: 02e05863 blez a4,58a <printint+0x94>
55e: fc040793 addi a5,s0,-64
562: 00e78933 add s2,a5,a4
566: fff78993 addi s3,a5,-1
56a: 99ba add s3,s3,a4
56c: 377d addiw a4,a4,-1
56e: 1702 slli a4,a4,0x20
570: 9301 srli a4,a4,0x20
572: 40e989b3 sub s3,s3,a4
putc(fd, buf[i]);
576: fff94583 lbu a1,-1(s2)
57a: 8526 mv a0,s1
57c: 00000097 auipc ra,0x0
580: f58080e7 jalr -168(ra) # 4d4 <putc>
while(--i >= 0)
584: 197d addi s2,s2,-1
586: ff3918e3 bne s2,s3,576 <printint+0x80>
}
58a: 70e2 ld ra,56(sp)
58c: 7442 ld s0,48(sp)
58e: 74a2 ld s1,40(sp)
590: 7902 ld s2,32(sp)
592: 69e2 ld s3,24(sp)
594: 6121 addi sp,sp,64
596: 8082 ret
x = -xx;
598: 40b005bb negw a1,a1
neg = 1;
59c: 4885 li a7,1
x = -xx;
59e: bf8d j 510 <printint+0x1a>
00000000000005a0 <vprintf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
vprintf(int fd, const char *fmt, va_list ap)
{
5a0: 7119 addi sp,sp,-128
5a2: fc86 sd ra,120(sp)
5a4: f8a2 sd s0,112(sp)
5a6: f4a6 sd s1,104(sp)
5a8: f0ca sd s2,96(sp)
5aa: ecce sd s3,88(sp)
5ac: e8d2 sd s4,80(sp)
5ae: e4d6 sd s5,72(sp)
5b0: e0da sd s6,64(sp)
5b2: fc5e sd s7,56(sp)
5b4: f862 sd s8,48(sp)
5b6: f466 sd s9,40(sp)
5b8: f06a sd s10,32(sp)
5ba: ec6e sd s11,24(sp)
5bc: 0100 addi s0,sp,128
char *s;
int c, i, state;
state = 0;
for(i = 0; fmt[i]; i++){
5be: 0005c903 lbu s2,0(a1)
5c2: 18090f63 beqz s2,760 <vprintf+0x1c0>
5c6: 8aaa mv s5,a0
5c8: 8b32 mv s6,a2
5ca: 00158493 addi s1,a1,1
state = 0;
5ce: 4981 li s3,0
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
5d0: 02500a13 li s4,37
if(c == 'd'){
5d4: 06400c13 li s8,100
printint(fd, va_arg(ap, int), 10, 1);
} else if(c == 'l') {
5d8: 06c00c93 li s9,108
printint(fd, va_arg(ap, uint64), 10, 0);
} else if(c == 'x') {
5dc: 07800d13 li s10,120
printint(fd, va_arg(ap, int), 16, 0);
} else if(c == 'p') {
5e0: 07000d93 li s11,112
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
5e4: 00000b97 auipc s7,0x0
5e8: 384b8b93 addi s7,s7,900 # 968 <digits>
5ec: a839 j 60a <vprintf+0x6a>
putc(fd, c);
5ee: 85ca mv a1,s2
5f0: 8556 mv a0,s5
5f2: 00000097 auipc ra,0x0
5f6: ee2080e7 jalr -286(ra) # 4d4 <putc>
5fa: a019 j 600 <vprintf+0x60>
} else if(state == '%'){
5fc: 01498f63 beq s3,s4,61a <vprintf+0x7a>
for(i = 0; fmt[i]; i++){
600: 0485 addi s1,s1,1
602: fff4c903 lbu s2,-1(s1)
606: 14090d63 beqz s2,760 <vprintf+0x1c0>
c = fmt[i] & 0xff;
60a: 0009079b sext.w a5,s2
if(state == 0){
60e: fe0997e3 bnez s3,5fc <vprintf+0x5c>
if(c == '%'){
612: fd479ee3 bne a5,s4,5ee <vprintf+0x4e>
state = '%';
616: 89be mv s3,a5
618: b7e5 j 600 <vprintf+0x60>
if(c == 'd'){
61a: 05878063 beq a5,s8,65a <vprintf+0xba>
} else if(c == 'l') {
61e: 05978c63 beq a5,s9,676 <vprintf+0xd6>
} else if(c == 'x') {
622: 07a78863 beq a5,s10,692 <vprintf+0xf2>
} else if(c == 'p') {
626: 09b78463 beq a5,s11,6ae <vprintf+0x10e>
printptr(fd, va_arg(ap, uint64));
} else if(c == 's'){
62a: 07300713 li a4,115
62e: 0ce78663 beq a5,a4,6fa <vprintf+0x15a>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
632: 06300713 li a4,99
636: 0ee78e63 beq a5,a4,732 <vprintf+0x192>
putc(fd, va_arg(ap, uint));
} else if(c == '%'){
63a: 11478863 beq a5,s4,74a <vprintf+0x1aa>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
63e: 85d2 mv a1,s4
640: 8556 mv a0,s5
642: 00000097 auipc ra,0x0
646: e92080e7 jalr -366(ra) # 4d4 <putc>
putc(fd, c);
64a: 85ca mv a1,s2
64c: 8556 mv a0,s5
64e: 00000097 auipc ra,0x0
652: e86080e7 jalr -378(ra) # 4d4 <putc>
}
state = 0;
656: 4981 li s3,0
658: b765 j 600 <vprintf+0x60>
printint(fd, va_arg(ap, int), 10, 1);
65a: 008b0913 addi s2,s6,8
65e: 4685 li a3,1
660: 4629 li a2,10
662: 000b2583 lw a1,0(s6)
666: 8556 mv a0,s5
668: 00000097 auipc ra,0x0
66c: e8e080e7 jalr -370(ra) # 4f6 <printint>
670: 8b4a mv s6,s2
state = 0;
672: 4981 li s3,0
674: b771 j 600 <vprintf+0x60>
printint(fd, va_arg(ap, uint64), 10, 0);
676: 008b0913 addi s2,s6,8
67a: 4681 li a3,0
67c: 4629 li a2,10
67e: 000b2583 lw a1,0(s6)
682: 8556 mv a0,s5
684: 00000097 auipc ra,0x0
688: e72080e7 jalr -398(ra) # 4f6 <printint>
68c: 8b4a mv s6,s2
state = 0;
68e: 4981 li s3,0
690: bf85 j 600 <vprintf+0x60>
printint(fd, va_arg(ap, int), 16, 0);
692: 008b0913 addi s2,s6,8
696: 4681 li a3,0
698: 4641 li a2,16
69a: 000b2583 lw a1,0(s6)
69e: 8556 mv a0,s5
6a0: 00000097 auipc ra,0x0
6a4: e56080e7 jalr -426(ra) # 4f6 <printint>
6a8: 8b4a mv s6,s2
state = 0;
6aa: 4981 li s3,0
6ac: bf91 j 600 <vprintf+0x60>
printptr(fd, va_arg(ap, uint64));
6ae: 008b0793 addi a5,s6,8
6b2: f8f43423 sd a5,-120(s0)
6b6: 000b3983 ld s3,0(s6)
putc(fd, '0');
6ba: 03000593 li a1,48
6be: 8556 mv a0,s5
6c0: 00000097 auipc ra,0x0
6c4: e14080e7 jalr -492(ra) # 4d4 <putc>
putc(fd, 'x');
6c8: 85ea mv a1,s10
6ca: 8556 mv a0,s5
6cc: 00000097 auipc ra,0x0
6d0: e08080e7 jalr -504(ra) # 4d4 <putc>
6d4: 4941 li s2,16
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
6d6: 03c9d793 srli a5,s3,0x3c
6da: 97de add a5,a5,s7
6dc: 0007c583 lbu a1,0(a5)
6e0: 8556 mv a0,s5
6e2: 00000097 auipc ra,0x0
6e6: df2080e7 jalr -526(ra) # 4d4 <putc>
for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4)
6ea: 0992 slli s3,s3,0x4
6ec: 397d addiw s2,s2,-1
6ee: fe0914e3 bnez s2,6d6 <vprintf+0x136>
printptr(fd, va_arg(ap, uint64));
6f2: f8843b03 ld s6,-120(s0)
state = 0;
6f6: 4981 li s3,0
6f8: b721 j 600 <vprintf+0x60>
s = va_arg(ap, char*);
6fa: 008b0993 addi s3,s6,8
6fe: 000b3903 ld s2,0(s6)
if(s == 0)
702: 02090163 beqz s2,724 <vprintf+0x184>
while(*s != 0){
706: 00094583 lbu a1,0(s2)
70a: c9a1 beqz a1,75a <vprintf+0x1ba>
putc(fd, *s);
70c: 8556 mv a0,s5
70e: 00000097 auipc ra,0x0
712: dc6080e7 jalr -570(ra) # 4d4 <putc>
s++;
716: 0905 addi s2,s2,1
while(*s != 0){
718: 00094583 lbu a1,0(s2)
71c: f9e5 bnez a1,70c <vprintf+0x16c>
s = va_arg(ap, char*);
71e: 8b4e mv s6,s3
state = 0;
720: 4981 li s3,0
722: bdf9 j 600 <vprintf+0x60>
s = "(null)";
724: 00000917 auipc s2,0x0
728: 23c90913 addi s2,s2,572 # 960 <malloc+0xf6>
while(*s != 0){
72c: 02800593 li a1,40
730: bff1 j 70c <vprintf+0x16c>
putc(fd, va_arg(ap, uint));
732: 008b0913 addi s2,s6,8
736: 000b4583 lbu a1,0(s6)
73a: 8556 mv a0,s5
73c: 00000097 auipc ra,0x0
740: d98080e7 jalr -616(ra) # 4d4 <putc>
744: 8b4a mv s6,s2
state = 0;
746: 4981 li s3,0
748: bd65 j 600 <vprintf+0x60>
putc(fd, c);
74a: 85d2 mv a1,s4
74c: 8556 mv a0,s5
74e: 00000097 auipc ra,0x0
752: d86080e7 jalr -634(ra) # 4d4 <putc>
state = 0;
756: 4981 li s3,0
758: b565 j 600 <vprintf+0x60>
s = va_arg(ap, char*);
75a: 8b4e mv s6,s3
state = 0;
75c: 4981 li s3,0
75e: b54d j 600 <vprintf+0x60>
}
}
}
760: 70e6 ld ra,120(sp)
762: 7446 ld s0,112(sp)
764: 74a6 ld s1,104(sp)
766: 7906 ld s2,96(sp)
768: 69e6 ld s3,88(sp)
76a: 6a46 ld s4,80(sp)
76c: 6aa6 ld s5,72(sp)
76e: 6b06 ld s6,64(sp)
770: 7be2 ld s7,56(sp)
772: 7c42 ld s8,48(sp)
774: 7ca2 ld s9,40(sp)
776: 7d02 ld s10,32(sp)
778: 6de2 ld s11,24(sp)
77a: 6109 addi sp,sp,128
77c: 8082 ret
000000000000077e <fprintf>:
void
fprintf(int fd, const char *fmt, ...)
{
77e: 715d addi sp,sp,-80
780: ec06 sd ra,24(sp)
782: e822 sd s0,16(sp)
784: 1000 addi s0,sp,32
786: e010 sd a2,0(s0)
788: e414 sd a3,8(s0)
78a: e818 sd a4,16(s0)
78c: ec1c sd a5,24(s0)
78e: 03043023 sd a6,32(s0)
792: 03143423 sd a7,40(s0)
va_list ap;
va_start(ap, fmt);
796: fe843423 sd s0,-24(s0)
vprintf(fd, fmt, ap);
79a: 8622 mv a2,s0
79c: 00000097 auipc ra,0x0
7a0: e04080e7 jalr -508(ra) # 5a0 <vprintf>
}
7a4: 60e2 ld ra,24(sp)
7a6: 6442 ld s0,16(sp)
7a8: 6161 addi sp,sp,80
7aa: 8082 ret
00000000000007ac <printf>:
void
printf(const char *fmt, ...)
{
7ac: 711d addi sp,sp,-96
7ae: ec06 sd ra,24(sp)
7b0: e822 sd s0,16(sp)
7b2: 1000 addi s0,sp,32
7b4: e40c sd a1,8(s0)
7b6: e810 sd a2,16(s0)
7b8: ec14 sd a3,24(s0)
7ba: f018 sd a4,32(s0)
7bc: f41c sd a5,40(s0)
7be: 03043823 sd a6,48(s0)
7c2: 03143c23 sd a7,56(s0)
va_list ap;
va_start(ap, fmt);
7c6: 00840613 addi a2,s0,8
7ca: fec43423 sd a2,-24(s0)
vprintf(1, fmt, ap);
7ce: 85aa mv a1,a0
7d0: 4505 li a0,1
7d2: 00000097 auipc ra,0x0
7d6: dce080e7 jalr -562(ra) # 5a0 <vprintf>
}
7da: 60e2 ld ra,24(sp)
7dc: 6442 ld s0,16(sp)
7de: 6125 addi sp,sp,96
7e0: 8082 ret
00000000000007e2 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
7e2: 1141 addi sp,sp,-16
7e4: e422 sd s0,8(sp)
7e6: 0800 addi s0,sp,16
Header *bp, *p;
bp = (Header*)ap - 1;
7e8: ff050693 addi a3,a0,-16
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
7ec: 00000797 auipc a5,0x0
7f0: 1947b783 ld a5,404(a5) # 980 <freep>
7f4: a805 j 824 <free+0x42>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
7f6: 4618 lw a4,8(a2)
7f8: 9db9 addw a1,a1,a4
7fa: feb52c23 sw a1,-8(a0)
bp->s.ptr = p->s.ptr->s.ptr;
7fe: 6398 ld a4,0(a5)
800: 6318 ld a4,0(a4)
802: fee53823 sd a4,-16(a0)
806: a091 j 84a <free+0x68>
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
808: ff852703 lw a4,-8(a0)
80c: 9e39 addw a2,a2,a4
80e: c790 sw a2,8(a5)
p->s.ptr = bp->s.ptr;
810: ff053703 ld a4,-16(a0)
814: e398 sd a4,0(a5)
816: a099 j 85c <free+0x7a>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
818: 6398 ld a4,0(a5)
81a: 00e7e463 bltu a5,a4,822 <free+0x40>
81e: 00e6ea63 bltu a3,a4,832 <free+0x50>
{
822: 87ba mv a5,a4
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
824: fed7fae3 bgeu a5,a3,818 <free+0x36>
828: 6398 ld a4,0(a5)
82a: 00e6e463 bltu a3,a4,832 <free+0x50>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
82e: fee7eae3 bltu a5,a4,822 <free+0x40>
if(bp + bp->s.size == p->s.ptr){
832: ff852583 lw a1,-8(a0)
836: 6390 ld a2,0(a5)
838: 02059713 slli a4,a1,0x20
83c: 9301 srli a4,a4,0x20
83e: 0712 slli a4,a4,0x4
840: 9736 add a4,a4,a3
842: fae60ae3 beq a2,a4,7f6 <free+0x14>
bp->s.ptr = p->s.ptr;
846: fec53823 sd a2,-16(a0)
if(p + p->s.size == bp){
84a: 4790 lw a2,8(a5)
84c: 02061713 slli a4,a2,0x20
850: 9301 srli a4,a4,0x20
852: 0712 slli a4,a4,0x4
854: 973e add a4,a4,a5
856: fae689e3 beq a3,a4,808 <free+0x26>
} else
p->s.ptr = bp;
85a: e394 sd a3,0(a5)
freep = p;
85c: 00000717 auipc a4,0x0
860: 12f73223 sd a5,292(a4) # 980 <freep>
}
864: 6422 ld s0,8(sp)
866: 0141 addi sp,sp,16
868: 8082 ret
000000000000086a <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
86a: 7139 addi sp,sp,-64
86c: fc06 sd ra,56(sp)
86e: f822 sd s0,48(sp)
870: f426 sd s1,40(sp)
872: f04a sd s2,32(sp)
874: ec4e sd s3,24(sp)
876: e852 sd s4,16(sp)
878: e456 sd s5,8(sp)
87a: e05a sd s6,0(sp)
87c: 0080 addi s0,sp,64
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
87e: 02051493 slli s1,a0,0x20
882: 9081 srli s1,s1,0x20
884: 04bd addi s1,s1,15
886: 8091 srli s1,s1,0x4
888: 0014899b addiw s3,s1,1
88c: 0485 addi s1,s1,1
if((prevp = freep) == 0){
88e: 00000517 auipc a0,0x0
892: 0f253503 ld a0,242(a0) # 980 <freep>
896: c515 beqz a0,8c2 <malloc+0x58>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
898: 611c ld a5,0(a0)
if(p->s.size >= nunits){
89a: 4798 lw a4,8(a5)
89c: 02977f63 bgeu a4,s1,8da <malloc+0x70>
8a0: 8a4e mv s4,s3
8a2: 0009871b sext.w a4,s3
8a6: 6685 lui a3,0x1
8a8: 00d77363 bgeu a4,a3,8ae <malloc+0x44>
8ac: 6a05 lui s4,0x1
8ae: 000a0b1b sext.w s6,s4
p = sbrk(nu * sizeof(Header));
8b2: 004a1a1b slliw s4,s4,0x4
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
8b6: 00000917 auipc s2,0x0
8ba: 0ca90913 addi s2,s2,202 # 980 <freep>
if(p == (char*)-1)
8be: 5afd li s5,-1
8c0: a88d j 932 <malloc+0xc8>
base.s.ptr = freep = prevp = &base;
8c2: 00000797 auipc a5,0x0
8c6: 0c678793 addi a5,a5,198 # 988 <base>
8ca: 00000717 auipc a4,0x0
8ce: 0af73b23 sd a5,182(a4) # 980 <freep>
8d2: e39c sd a5,0(a5)
base.s.size = 0;
8d4: 0007a423 sw zero,8(a5)
if(p->s.size >= nunits){
8d8: b7e1 j 8a0 <malloc+0x36>
if(p->s.size == nunits)
8da: 02e48b63 beq s1,a4,910 <malloc+0xa6>
p->s.size -= nunits;
8de: 4137073b subw a4,a4,s3
8e2: c798 sw a4,8(a5)
p += p->s.size;
8e4: 1702 slli a4,a4,0x20
8e6: 9301 srli a4,a4,0x20
8e8: 0712 slli a4,a4,0x4
8ea: 97ba add a5,a5,a4
p->s.size = nunits;
8ec: 0137a423 sw s3,8(a5)
freep = prevp;
8f0: 00000717 auipc a4,0x0
8f4: 08a73823 sd a0,144(a4) # 980 <freep>
return (void*)(p + 1);
8f8: 01078513 addi a0,a5,16
if((p = morecore(nunits)) == 0)
return 0;
}
}
8fc: 70e2 ld ra,56(sp)
8fe: 7442 ld s0,48(sp)
900: 74a2 ld s1,40(sp)
902: 7902 ld s2,32(sp)
904: 69e2 ld s3,24(sp)
906: 6a42 ld s4,16(sp)
908: 6aa2 ld s5,8(sp)
90a: 6b02 ld s6,0(sp)
90c: 6121 addi sp,sp,64
90e: 8082 ret
prevp->s.ptr = p->s.ptr;
910: 6398 ld a4,0(a5)
912: e118 sd a4,0(a0)
914: bff1 j 8f0 <malloc+0x86>
hp->s.size = nu;
916: 01652423 sw s6,8(a0)
free((void*)(hp + 1));
91a: 0541 addi a0,a0,16
91c: 00000097 auipc ra,0x0
920: ec6080e7 jalr -314(ra) # 7e2 <free>
return freep;
924: 00093503 ld a0,0(s2)
if((p = morecore(nunits)) == 0)
928: d971 beqz a0,8fc <malloc+0x92>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
92a: 611c ld a5,0(a0)
if(p->s.size >= nunits){
92c: 4798 lw a4,8(a5)
92e: fa9776e3 bgeu a4,s1,8da <malloc+0x70>
if(p == freep)
932: 00093703 ld a4,0(s2)
936: 853e mv a0,a5
938: fef719e3 bne a4,a5,92a <malloc+0xc0>
p = sbrk(nu * sizeof(Header));
93c: 8552 mv a0,s4
93e: 00000097 auipc ra,0x0
942: b7e080e7 jalr -1154(ra) # 4bc <sbrk>
if(p == (char*)-1)
946: fd5518e3 bne a0,s5,916 <malloc+0xac>
return 0;
94a: 4501 li a0,0
94c: bf45 j 8fc <malloc+0x92>
| 29.976362 | 61 | 0.461011 |
fec9b2d5440ed216e773dcb9557bfdd0bc23249a | 5,602 | asm | Assembly | MSDOS/Virus.MSDOS.Unknown.cint.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | MSDOS/Virus.MSDOS.Unknown.cint.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | MSDOS/Virus.MSDOS.Unknown.cint.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z | TITLE LC Interrupt trap routine
NAME LCINT
INCLUDE DOS.MAC ; BE SURE TO INCLUDE THE CORRECT
; DOS.MAC!!
;****************************************************************************
;
; This is the heart of a C driven interrupt handler. This file was used to
; write a critical error handler that remained resident. (It replaced the
; "Abort, Retry, Ignore" prompt with a window.) This file can be adapted to
; any interrupt and any C routine with a little work. THIS HAS BEEN USED ONLY
; IN THE S MODEL.
;
;****************************************************************************
DOS_INT EQU 24H ; int to be replaced
WRITE_INT EQU 25H ; DOS write int vector
READ_INT EQU 35H ; DOS read int vector
XREG STRUC
REG_AX DW ? ; general purpose registers
REG_BX DW ?
REG_CX DW ?
REG_DX DW ?
REG_SI DW ?
REG_DI DW ?
XREG ENDS
SREGS STRUC
REG_ES DW ? ; segment registers
REG_CS DW ?
REG_SS DW ?
REG_DS DW ?
SREGS ENDS
DSEG
INT_REGS XREG <> ; saved regs. at int time
INT_SEGREGS SREGS <> ; saved seg. regs.
EXTRN _TOP:WORD ; declared by C.ASM -- points
; to top of stack
ENDDS
EXTRN INTTIME:NEAR ; your int routine goes here!
PSEG
;;
; interrupt time data storage
;;
C_ENVIRONMENT_DS DW ? ; filled by int init, used...
C_ENVIRONMENT_ES DW ? ; ...to recreate C environment
C_ENVIRONMENT_SS DW ?
C_ENVIRONMENT_SP DW ?
INT_TIME_ES DW ?
INT_TIME_DS DW ? ; temp save of DS at int time
INT_TIME_SI DW ? ; temp save of SI at int time
INT_TIME_BP DW ? ; added to account for no BP or SP...
INT_TIME_SP DW ? ; ...in above structures
RETURN_VALUE DW ? ; return value from C service routine
DOS_SERVICE DD ? ; address of DOS Service routine
INT_TWOONE DD ? ; old INT 21 vector
INT_IN_PROGRESS DB ? ; interrupt in progress flag -- not
; used here 'cause int 24H cannot be
; recursive!
;;**************************************************************************
; name LC_SERVICE_INT
;
; description Entered at (software) interrupt time, this routine
; restores the C enviroment and processes the interrupt
; trapping all references to the quad file
;;
IF LPROG
LC_SERVICE_INT PROC FAR
ELSE
LC_SERVICE_INT PROC NEAR
ENDIF
MOV CS:INT_IN_PROGRESS,1 ; clear int in progress flag
MOV CS:INT_TIME_ES,ES ; save ES so it can be overwritten
MOV CS:INT_TIME_DS,DS ; save DS so it can be overwritten
MOV CS:INT_TIME_SI,SI ; save SI so it can be overwritten
MOV CS:INT_TIME_BP,BP ; save BP as structs do not have it
MOV CS:INT_TIME_SP,SP ; save SP as structs do not have it
MOV DS,CS:C_ENVIRONMENT_DS ; set up C enviroment
MOV SI,OFFSET INT_REGS ; point to input regs struct
MOV DS:[SI].REG_AX,AX ; save general purpose regs
MOV DS:[SI].REG_BX,BX
MOV DS:[SI].REG_CX,CX
MOV DS:[SI].REG_DX,DX
MOV DS:[SI].REG_DI,DI
MOV AX,CS:INT_TIME_SI ; SI has been overwritten
MOV DS:[SI].REG_SI,AX
MOV SI,OFFSET INT_SEGREGS ; point to input segment regs struct
MOV AX,CS:INT_TIME_ES ; ES has been overwritten
MOV DS:[SI].REG_ES,AX
MOV DS:[SI].REG_SS,SS
MOV AX,CS:INT_TIME_DS ; DS has been overwritten
MOV DS:[SI].REG_DS,AX
MOV ES,CS:C_ENVIRONMENT_ES ; complete C environment
MOV SS,CS:C_ENVIRONMENT_SS
MOV SP,CS:C_ENVIRONMENT_SP
CALL INTTIME ; call the C routine
MOV CS:RETURN_VALUE,AX ; save return value
XOR AX,AX
MOV SI,OFFSET INT_REGS ; point to input regs struct
MOV AX,DS:[SI].REG_SI ; SI needs to be saved while used
MOV CS:INT_TIME_SI,AX
MOV AX,DS:[SI].REG_AX ; restore general purpose regs
MOV BX,DS:[SI].REG_BX
MOV CX,DS:[SI].REG_CX
MOV DX,DS:[SI].REG_DX
MOV DI,DS:[SI].REG_DI
MOV SI,OFFSET INT_SEGREGS ; point to input segment regs struct
MOV ES,DS:[SI].REG_DS ; DS needs to be saved while used
MOV CS:INT_TIME_DS,ES
MOV ES,DS:[SI].REG_ES
MOV SS,DS:[SI].REG_SS
MOV SI,CS:INT_TIME_SI ; restore pointing registers
MOV DS,CS:INT_TIME_DS
MOV BP,CS:INT_TIME_BP ; special BP restore
MOV SP,CS:INT_TIME_SP ; special SP restore
MOV CS:INT_IN_PROGRESS,0 ; clear int in progress flag
MOV AX,CS:RETURN_VALUE ; move the return value
IRET ; return from interrupt
LC_SERVICE_INT ENDP
;****************************************************************************
; description set up the LC interrupt routines
;
; INT_INIT -- Hooks into the specified int.
; INT_TERM -- Unhooks (restores) the specified int.
;
; NOTE: INT_INIT must be called be int processing can begin...it saves the
; current C environment for use at interrupt time.
;;
PUBLIC INT_INIT
IF LPROG
INT_INIT PROC FAR
ELSE
INT_INIT PROC NEAR
ENDIF
PUSH DS ; save changed seg regs
PUSH ES
MOV CS:C_ENVIRONMENT_DS,DS ; save C environment for int time
MOV CS:C_ENVIRONMENT_ES,ES
MOV CS:C_ENVIRONMENT_SS,SS
MOV AX,_TOP ; determine int time SP
SUB AX,400H ; gives 1024 byte stack
MOV CS:C_ENVIRONMENT_SP,AX
MOV AH,READ_INT ; read int vector function
MOV AL,DOS_INT ; specify DOS service vector
INT 21H
MOV WORD PTR CS:DOS_SERVICE+2,ES ; save current vector
MOV WORD PTR CS:DOS_SERVICE,BX
LEA DX,LC_SERVICE_INT ; Use DOS to set new int address
PUSH CS
POP DS
MOV AH,WRITE_INT
MOV AL,DOS_INT
INT 21H
POP ES ; restore changed seg regs
POP DS
RET
INT_INIT ENDP
;********************* INT_TERM -- kill ints. *******************************
PUBLIC INT_TERM
IF LPROG
INT_TERM PROC FAR
ELSE
INT_TERM PROC NEAR
ENDIF
PUSH DS ; DS gets changed
MOV DS,WORD PTR CS:DOS_SERVICE+2 ; Restore previous DOS service vector
MOV DX,WORD PTR CS:DOS_SERVICE
MOV AH,WRITE_INT
MOV AL,DOS_INT
INT 21H
POP DS ; restore DS
RET
INT_TERM ENDP
ENDPS
END
| 24.787611 | 77 | 0.678686 |
d7d3bc6d452e8c9def7a1e170850e382331cb405 | 2,687 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_5_811.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_5_811.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_5_811.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r9
push %rbx
push %rcx
push %rsi
lea addresses_WC_ht+0x124ad, %r10
sub $30217, %r9
mov (%r10), %r12
nop
sub $65024, %r12
lea addresses_A_ht+0x1e8ad, %rbx
nop
nop
nop
nop
nop
sub $702, %rcx
movw $0x6162, (%rbx)
nop
nop
add $44747, %r10
pop %rsi
pop %rcx
pop %rbx
pop %r9
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r15
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_WT+0x1ecad, %rsi
lea addresses_WT+0x1ecad, %rdi
nop
nop
nop
nop
nop
inc %r11
mov $65, %rcx
rep movsw
nop
nop
nop
cmp $50036, %rcx
// Store
lea addresses_WT+0x1ecad, %rsi
nop
nop
nop
sub $28914, %r10
movl $0x51525354, (%rsi)
nop
nop
nop
nop
nop
cmp %rcx, %rcx
// Store
lea addresses_A+0x1412d, %rdi
nop
nop
nop
nop
nop
cmp %r10, %r10
mov $0x5152535455565758, %r12
movq %r12, (%rdi)
nop
nop
nop
nop
xor $3049, %rcx
// Load
lea addresses_US+0xf7d, %r11
nop
nop
nop
sub %rsi, %rsi
movb (%r11), %cl
nop
nop
and $46638, %r15
// Store
lea addresses_UC+0x1722d, %r15
nop
nop
xor $7125, %r11
mov $0x5152535455565758, %r10
movq %r10, %xmm0
vmovups %ymm0, (%r15)
nop
nop
cmp $53844, %rdi
// Faulty Load
lea addresses_WT+0x1ecad, %r15
nop
nop
nop
nop
xor $1218, %r10
vmovups (%r15), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %rdi
lea oracles, %rsi
and $0xff, %rdi
shlq $12, %rdi
mov (%rsi,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rcx
pop %r15
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT', 'congruent': 0, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT', 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_WT', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_A', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_US', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC', 'size': 32, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 7, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}}
{'39': 5}
39 39 39 39 39
*/
| 17.677632 | 140 | 0.643469 |
0985df290b694796de9de5940138ea15504827f7 | 665,949 | asm | Assembly | kernel.asm | phung001/xv6_lab2_mark | 3ba15e5880a3facdb709c3708d8366ade948cba2 | [
"MIT-0"
] | null | null | null | kernel.asm | phung001/xv6_lab2_mark | 3ba15e5880a3facdb709c3708d8366ade948cba2 | [
"MIT-0"
] | null | null | null | kernel.asm | phung001/xv6_lab2_mark | 3ba15e5880a3facdb709c3708d8366ade948cba2 | [
"MIT-0"
] | null | null | null |
kernel: file format elf32-i386
Disassembly of section .text:
80100000 <multiboot_header>:
80100000: 02 b0 ad 1b 00 00 add 0x1bad(%eax),%dh
80100006: 00 00 add %al,(%eax)
80100008: fe 4f 52 decb 0x52(%edi)
8010000b: e4 0f in $0xf,%al
8010000c <entry>:
# Entering xv6 on boot processor, with paging off.
.globl entry
entry:
# Turn on page size extension for 4Mbyte pages
movl %cr4, %eax
8010000c: 0f 20 e0 mov %cr4,%eax
orl $(CR4_PSE), %eax
8010000f: 83 c8 10 or $0x10,%eax
movl %eax, %cr4
80100012: 0f 22 e0 mov %eax,%cr4
# Set page directory
movl $(V2P_WO(entrypgdir)), %eax
80100015: b8 00 a0 10 00 mov $0x10a000,%eax
movl %eax, %cr3
8010001a: 0f 22 d8 mov %eax,%cr3
# Turn on paging.
movl %cr0, %eax
8010001d: 0f 20 c0 mov %cr0,%eax
orl $(CR0_PG|CR0_WP), %eax
80100020: 0d 00 00 01 80 or $0x80010000,%eax
movl %eax, %cr0
80100025: 0f 22 c0 mov %eax,%cr0
# Set up the stack pointer.
movl $(stack + KSTACKSIZE), %esp
80100028: bc 70 c6 10 80 mov $0x8010c670,%esp
# Jump to main(), and switch to executing at
# high addresses. The indirect call is needed because
# the assembler produces a PC-relative instruction
# for a direct jump.
mov $main, %eax
8010002d: b8 f0 33 10 80 mov $0x801033f0,%eax
jmp *%eax
80100032: ff e0 jmp *%eax
80100034 <binit>:
struct buf head;
} bcache;
void
binit(void)
{
80100034: 55 push %ebp
80100035: 89 e5 mov %esp,%ebp
80100037: 83 ec 28 sub $0x28,%esp
struct buf *b;
initlock(&bcache.lock, "bcache");
8010003a: c7 44 24 04 10 86 10 movl $0x80108610,0x4(%esp)
80100041: 80
80100042: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
80100049: e8 fc 4e 00 00 call 80104f4a <initlock>
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
8010004e: c7 05 b0 db 10 80 a4 movl $0x8010dba4,0x8010dbb0
80100055: db 10 80
bcache.head.next = &bcache.head;
80100058: c7 05 b4 db 10 80 a4 movl $0x8010dba4,0x8010dbb4
8010005f: db 10 80
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80100062: c7 45 f4 b4 c6 10 80 movl $0x8010c6b4,-0xc(%ebp)
80100069: eb 3a jmp 801000a5 <binit+0x71>
b->next = bcache.head.next;
8010006b: 8b 15 b4 db 10 80 mov 0x8010dbb4,%edx
80100071: 8b 45 f4 mov -0xc(%ebp),%eax
80100074: 89 50 10 mov %edx,0x10(%eax)
b->prev = &bcache.head;
80100077: 8b 45 f4 mov -0xc(%ebp),%eax
8010007a: c7 40 0c a4 db 10 80 movl $0x8010dba4,0xc(%eax)
b->dev = -1;
80100081: 8b 45 f4 mov -0xc(%ebp),%eax
80100084: c7 40 04 ff ff ff ff movl $0xffffffff,0x4(%eax)
bcache.head.next->prev = b;
8010008b: a1 b4 db 10 80 mov 0x8010dbb4,%eax
80100090: 8b 55 f4 mov -0xc(%ebp),%edx
80100093: 89 50 0c mov %edx,0xc(%eax)
bcache.head.next = b;
80100096: 8b 45 f4 mov -0xc(%ebp),%eax
80100099: a3 b4 db 10 80 mov %eax,0x8010dbb4
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
bcache.head.next = &bcache.head;
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
8010009e: 81 45 f4 18 02 00 00 addl $0x218,-0xc(%ebp)
801000a5: b8 a4 db 10 80 mov $0x8010dba4,%eax
801000aa: 39 45 f4 cmp %eax,-0xc(%ebp)
801000ad: 72 bc jb 8010006b <binit+0x37>
b->prev = &bcache.head;
b->dev = -1;
bcache.head.next->prev = b;
bcache.head.next = b;
}
}
801000af: c9 leave
801000b0: c3 ret
801000b1 <bget>:
// Look through buffer cache for sector on device dev.
// If not found, allocate fresh block.
// In either case, return B_BUSY buffer.
static struct buf*
bget(uint dev, uint sector)
{
801000b1: 55 push %ebp
801000b2: 89 e5 mov %esp,%ebp
801000b4: 83 ec 28 sub $0x28,%esp
struct buf *b;
acquire(&bcache.lock);
801000b7: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
801000be: e8 a8 4e 00 00 call 80104f6b <acquire>
loop:
// Is the sector already cached?
for(b = bcache.head.next; b != &bcache.head; b = b->next){
801000c3: a1 b4 db 10 80 mov 0x8010dbb4,%eax
801000c8: 89 45 f4 mov %eax,-0xc(%ebp)
801000cb: eb 63 jmp 80100130 <bget+0x7f>
if(b->dev == dev && b->sector == sector){
801000cd: 8b 45 f4 mov -0xc(%ebp),%eax
801000d0: 8b 40 04 mov 0x4(%eax),%eax
801000d3: 3b 45 08 cmp 0x8(%ebp),%eax
801000d6: 75 4f jne 80100127 <bget+0x76>
801000d8: 8b 45 f4 mov -0xc(%ebp),%eax
801000db: 8b 40 08 mov 0x8(%eax),%eax
801000de: 3b 45 0c cmp 0xc(%ebp),%eax
801000e1: 75 44 jne 80100127 <bget+0x76>
if(!(b->flags & B_BUSY)){
801000e3: 8b 45 f4 mov -0xc(%ebp),%eax
801000e6: 8b 00 mov (%eax),%eax
801000e8: 83 e0 01 and $0x1,%eax
801000eb: 85 c0 test %eax,%eax
801000ed: 75 23 jne 80100112 <bget+0x61>
b->flags |= B_BUSY;
801000ef: 8b 45 f4 mov -0xc(%ebp),%eax
801000f2: 8b 00 mov (%eax),%eax
801000f4: 89 c2 mov %eax,%edx
801000f6: 83 ca 01 or $0x1,%edx
801000f9: 8b 45 f4 mov -0xc(%ebp),%eax
801000fc: 89 10 mov %edx,(%eax)
release(&bcache.lock);
801000fe: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
80100105: e8 c2 4e 00 00 call 80104fcc <release>
return b;
8010010a: 8b 45 f4 mov -0xc(%ebp),%eax
8010010d: e9 93 00 00 00 jmp 801001a5 <bget+0xf4>
}
sleep(b, &bcache.lock);
80100112: c7 44 24 04 80 c6 10 movl $0x8010c680,0x4(%esp)
80100119: 80
8010011a: 8b 45 f4 mov -0xc(%ebp),%eax
8010011d: 89 04 24 mov %eax,(%esp)
80100120: e8 ce 4a 00 00 call 80104bf3 <sleep>
goto loop;
80100125: eb 9c jmp 801000c3 <bget+0x12>
acquire(&bcache.lock);
loop:
// Is the sector already cached?
for(b = bcache.head.next; b != &bcache.head; b = b->next){
80100127: 8b 45 f4 mov -0xc(%ebp),%eax
8010012a: 8b 40 10 mov 0x10(%eax),%eax
8010012d: 89 45 f4 mov %eax,-0xc(%ebp)
80100130: 81 7d f4 a4 db 10 80 cmpl $0x8010dba4,-0xc(%ebp)
80100137: 75 94 jne 801000cd <bget+0x1c>
goto loop;
}
}
// Not cached; recycle some non-busy and clean buffer.
for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
80100139: a1 b0 db 10 80 mov 0x8010dbb0,%eax
8010013e: 89 45 f4 mov %eax,-0xc(%ebp)
80100141: eb 4d jmp 80100190 <bget+0xdf>
if((b->flags & B_BUSY) == 0 && (b->flags & B_DIRTY) == 0){
80100143: 8b 45 f4 mov -0xc(%ebp),%eax
80100146: 8b 00 mov (%eax),%eax
80100148: 83 e0 01 and $0x1,%eax
8010014b: 85 c0 test %eax,%eax
8010014d: 75 38 jne 80100187 <bget+0xd6>
8010014f: 8b 45 f4 mov -0xc(%ebp),%eax
80100152: 8b 00 mov (%eax),%eax
80100154: 83 e0 04 and $0x4,%eax
80100157: 85 c0 test %eax,%eax
80100159: 75 2c jne 80100187 <bget+0xd6>
b->dev = dev;
8010015b: 8b 45 f4 mov -0xc(%ebp),%eax
8010015e: 8b 55 08 mov 0x8(%ebp),%edx
80100161: 89 50 04 mov %edx,0x4(%eax)
b->sector = sector;
80100164: 8b 45 f4 mov -0xc(%ebp),%eax
80100167: 8b 55 0c mov 0xc(%ebp),%edx
8010016a: 89 50 08 mov %edx,0x8(%eax)
b->flags = B_BUSY;
8010016d: 8b 45 f4 mov -0xc(%ebp),%eax
80100170: c7 00 01 00 00 00 movl $0x1,(%eax)
release(&bcache.lock);
80100176: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
8010017d: e8 4a 4e 00 00 call 80104fcc <release>
return b;
80100182: 8b 45 f4 mov -0xc(%ebp),%eax
80100185: eb 1e jmp 801001a5 <bget+0xf4>
goto loop;
}
}
// Not cached; recycle some non-busy and clean buffer.
for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
80100187: 8b 45 f4 mov -0xc(%ebp),%eax
8010018a: 8b 40 0c mov 0xc(%eax),%eax
8010018d: 89 45 f4 mov %eax,-0xc(%ebp)
80100190: 81 7d f4 a4 db 10 80 cmpl $0x8010dba4,-0xc(%ebp)
80100197: 75 aa jne 80100143 <bget+0x92>
b->flags = B_BUSY;
release(&bcache.lock);
return b;
}
}
panic("bget: no buffers");
80100199: c7 04 24 17 86 10 80 movl $0x80108617,(%esp)
801001a0: e8 95 03 00 00 call 8010053a <panic>
}
801001a5: c9 leave
801001a6: c3 ret
801001a7 <bread>:
// Return a B_BUSY buf with the contents of the indicated disk sector.
struct buf*
bread(uint dev, uint sector)
{
801001a7: 55 push %ebp
801001a8: 89 e5 mov %esp,%ebp
801001aa: 83 ec 28 sub $0x28,%esp
struct buf *b;
b = bget(dev, sector);
801001ad: 8b 45 0c mov 0xc(%ebp),%eax
801001b0: 89 44 24 04 mov %eax,0x4(%esp)
801001b4: 8b 45 08 mov 0x8(%ebp),%eax
801001b7: 89 04 24 mov %eax,(%esp)
801001ba: e8 f2 fe ff ff call 801000b1 <bget>
801001bf: 89 45 f4 mov %eax,-0xc(%ebp)
if(!(b->flags & B_VALID))
801001c2: 8b 45 f4 mov -0xc(%ebp),%eax
801001c5: 8b 00 mov (%eax),%eax
801001c7: 83 e0 02 and $0x2,%eax
801001ca: 85 c0 test %eax,%eax
801001cc: 75 0b jne 801001d9 <bread+0x32>
iderw(b);
801001ce: 8b 45 f4 mov -0xc(%ebp),%eax
801001d1: 89 04 24 mov %eax,(%esp)
801001d4: e8 e5 25 00 00 call 801027be <iderw>
return b;
801001d9: 8b 45 f4 mov -0xc(%ebp),%eax
}
801001dc: c9 leave
801001dd: c3 ret
801001de <bwrite>:
// Write b's contents to disk. Must be B_BUSY.
void
bwrite(struct buf *b)
{
801001de: 55 push %ebp
801001df: 89 e5 mov %esp,%ebp
801001e1: 83 ec 18 sub $0x18,%esp
if((b->flags & B_BUSY) == 0)
801001e4: 8b 45 08 mov 0x8(%ebp),%eax
801001e7: 8b 00 mov (%eax),%eax
801001e9: 83 e0 01 and $0x1,%eax
801001ec: 85 c0 test %eax,%eax
801001ee: 75 0c jne 801001fc <bwrite+0x1e>
panic("bwrite");
801001f0: c7 04 24 28 86 10 80 movl $0x80108628,(%esp)
801001f7: e8 3e 03 00 00 call 8010053a <panic>
b->flags |= B_DIRTY;
801001fc: 8b 45 08 mov 0x8(%ebp),%eax
801001ff: 8b 00 mov (%eax),%eax
80100201: 89 c2 mov %eax,%edx
80100203: 83 ca 04 or $0x4,%edx
80100206: 8b 45 08 mov 0x8(%ebp),%eax
80100209: 89 10 mov %edx,(%eax)
iderw(b);
8010020b: 8b 45 08 mov 0x8(%ebp),%eax
8010020e: 89 04 24 mov %eax,(%esp)
80100211: e8 a8 25 00 00 call 801027be <iderw>
}
80100216: c9 leave
80100217: c3 ret
80100218 <brelse>:
// Release a B_BUSY buffer.
// Move to the head of the MRU list.
void
brelse(struct buf *b)
{
80100218: 55 push %ebp
80100219: 89 e5 mov %esp,%ebp
8010021b: 83 ec 18 sub $0x18,%esp
if((b->flags & B_BUSY) == 0)
8010021e: 8b 45 08 mov 0x8(%ebp),%eax
80100221: 8b 00 mov (%eax),%eax
80100223: 83 e0 01 and $0x1,%eax
80100226: 85 c0 test %eax,%eax
80100228: 75 0c jne 80100236 <brelse+0x1e>
panic("brelse");
8010022a: c7 04 24 2f 86 10 80 movl $0x8010862f,(%esp)
80100231: e8 04 03 00 00 call 8010053a <panic>
acquire(&bcache.lock);
80100236: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
8010023d: e8 29 4d 00 00 call 80104f6b <acquire>
b->next->prev = b->prev;
80100242: 8b 45 08 mov 0x8(%ebp),%eax
80100245: 8b 40 10 mov 0x10(%eax),%eax
80100248: 8b 55 08 mov 0x8(%ebp),%edx
8010024b: 8b 52 0c mov 0xc(%edx),%edx
8010024e: 89 50 0c mov %edx,0xc(%eax)
b->prev->next = b->next;
80100251: 8b 45 08 mov 0x8(%ebp),%eax
80100254: 8b 40 0c mov 0xc(%eax),%eax
80100257: 8b 55 08 mov 0x8(%ebp),%edx
8010025a: 8b 52 10 mov 0x10(%edx),%edx
8010025d: 89 50 10 mov %edx,0x10(%eax)
b->next = bcache.head.next;
80100260: 8b 15 b4 db 10 80 mov 0x8010dbb4,%edx
80100266: 8b 45 08 mov 0x8(%ebp),%eax
80100269: 89 50 10 mov %edx,0x10(%eax)
b->prev = &bcache.head;
8010026c: 8b 45 08 mov 0x8(%ebp),%eax
8010026f: c7 40 0c a4 db 10 80 movl $0x8010dba4,0xc(%eax)
bcache.head.next->prev = b;
80100276: a1 b4 db 10 80 mov 0x8010dbb4,%eax
8010027b: 8b 55 08 mov 0x8(%ebp),%edx
8010027e: 89 50 0c mov %edx,0xc(%eax)
bcache.head.next = b;
80100281: 8b 45 08 mov 0x8(%ebp),%eax
80100284: a3 b4 db 10 80 mov %eax,0x8010dbb4
b->flags &= ~B_BUSY;
80100289: 8b 45 08 mov 0x8(%ebp),%eax
8010028c: 8b 00 mov (%eax),%eax
8010028e: 89 c2 mov %eax,%edx
80100290: 83 e2 fe and $0xfffffffe,%edx
80100293: 8b 45 08 mov 0x8(%ebp),%eax
80100296: 89 10 mov %edx,(%eax)
wakeup(b);
80100298: 8b 45 08 mov 0x8(%ebp),%eax
8010029b: 89 04 24 mov %eax,(%esp)
8010029e: e8 96 4a 00 00 call 80104d39 <wakeup>
release(&bcache.lock);
801002a3: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
801002aa: e8 1d 4d 00 00 call 80104fcc <release>
}
801002af: c9 leave
801002b0: c3 ret
801002b1: 00 00 add %al,(%eax)
...
801002b4 <inb>:
// Routines to let C code use special x86 instructions.
static inline uchar
inb(ushort port)
{
801002b4: 55 push %ebp
801002b5: 89 e5 mov %esp,%ebp
801002b7: 83 ec 14 sub $0x14,%esp
801002ba: 8b 45 08 mov 0x8(%ebp),%eax
801002bd: 66 89 45 ec mov %ax,-0x14(%ebp)
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801002c1: 0f b7 45 ec movzwl -0x14(%ebp),%eax
801002c5: 89 c2 mov %eax,%edx
801002c7: ec in (%dx),%al
801002c8: 88 45 ff mov %al,-0x1(%ebp)
return data;
801002cb: 0f b6 45 ff movzbl -0x1(%ebp),%eax
}
801002cf: c9 leave
801002d0: c3 ret
801002d1 <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
801002d1: 55 push %ebp
801002d2: 89 e5 mov %esp,%ebp
801002d4: 83 ec 08 sub $0x8,%esp
801002d7: 8b 55 08 mov 0x8(%ebp),%edx
801002da: 8b 45 0c mov 0xc(%ebp),%eax
801002dd: 66 89 55 fc mov %dx,-0x4(%ebp)
801002e1: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801002e4: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
801002e8: 0f b7 55 fc movzwl -0x4(%ebp),%edx
801002ec: ee out %al,(%dx)
}
801002ed: c9 leave
801002ee: c3 ret
801002ef <cli>:
asm volatile("movw %0, %%gs" : : "r" (v));
}
static inline void
cli(void)
{
801002ef: 55 push %ebp
801002f0: 89 e5 mov %esp,%ebp
asm volatile("cli");
801002f2: fa cli
}
801002f3: 5d pop %ebp
801002f4: c3 ret
801002f5 <printint>:
int locking;
} cons;
static void
printint(int xx, int base, int sign)
{
801002f5: 55 push %ebp
801002f6: 89 e5 mov %esp,%ebp
801002f8: 53 push %ebx
801002f9: 83 ec 44 sub $0x44,%esp
static char digits[] = "0123456789abcdef";
char buf[16];
int i;
uint x;
if(sign && (sign = xx < 0))
801002fc: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80100300: 74 19 je 8010031b <printint+0x26>
80100302: 8b 45 08 mov 0x8(%ebp),%eax
80100305: c1 e8 1f shr $0x1f,%eax
80100308: 89 45 10 mov %eax,0x10(%ebp)
8010030b: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010030f: 74 0a je 8010031b <printint+0x26>
x = -xx;
80100311: 8b 45 08 mov 0x8(%ebp),%eax
80100314: f7 d8 neg %eax
80100316: 89 45 f4 mov %eax,-0xc(%ebp)
static char digits[] = "0123456789abcdef";
char buf[16];
int i;
uint x;
if(sign && (sign = xx < 0))
80100319: eb 06 jmp 80100321 <printint+0x2c>
x = -xx;
else
x = xx;
8010031b: 8b 45 08 mov 0x8(%ebp),%eax
8010031e: 89 45 f4 mov %eax,-0xc(%ebp)
i = 0;
80100321: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
do{
buf[i++] = digits[x % base];
80100328: 8b 4d f0 mov -0x10(%ebp),%ecx
8010032b: 8b 5d 0c mov 0xc(%ebp),%ebx
8010032e: 8b 45 f4 mov -0xc(%ebp),%eax
80100331: ba 00 00 00 00 mov $0x0,%edx
80100336: f7 f3 div %ebx
80100338: 89 d0 mov %edx,%eax
8010033a: 0f b6 80 04 90 10 80 movzbl -0x7fef6ffc(%eax),%eax
80100341: 88 44 0d e0 mov %al,-0x20(%ebp,%ecx,1)
80100345: 83 45 f0 01 addl $0x1,-0x10(%ebp)
}while((x /= base) != 0);
80100349: 8b 45 0c mov 0xc(%ebp),%eax
8010034c: 89 45 d4 mov %eax,-0x2c(%ebp)
8010034f: 8b 45 f4 mov -0xc(%ebp),%eax
80100352: ba 00 00 00 00 mov $0x0,%edx
80100357: f7 75 d4 divl -0x2c(%ebp)
8010035a: 89 45 f4 mov %eax,-0xc(%ebp)
8010035d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80100361: 75 c5 jne 80100328 <printint+0x33>
if(sign)
80100363: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80100367: 74 21 je 8010038a <printint+0x95>
buf[i++] = '-';
80100369: 8b 45 f0 mov -0x10(%ebp),%eax
8010036c: c6 44 05 e0 2d movb $0x2d,-0x20(%ebp,%eax,1)
80100371: 83 45 f0 01 addl $0x1,-0x10(%ebp)
while(--i >= 0)
80100375: eb 13 jmp 8010038a <printint+0x95>
consputc(buf[i]);
80100377: 8b 45 f0 mov -0x10(%ebp),%eax
8010037a: 0f b6 44 05 e0 movzbl -0x20(%ebp,%eax,1),%eax
8010037f: 0f be c0 movsbl %al,%eax
80100382: 89 04 24 mov %eax,(%esp)
80100385: e8 c4 03 00 00 call 8010074e <consputc>
}while((x /= base) != 0);
if(sign)
buf[i++] = '-';
while(--i >= 0)
8010038a: 83 6d f0 01 subl $0x1,-0x10(%ebp)
8010038e: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80100392: 79 e3 jns 80100377 <printint+0x82>
consputc(buf[i]);
}
80100394: 83 c4 44 add $0x44,%esp
80100397: 5b pop %ebx
80100398: 5d pop %ebp
80100399: c3 ret
8010039a <cprintf>:
//PAGEBREAK: 50
// Print to the console. only understands %d, %x, %p, %s.
void
cprintf(char *fmt, ...)
{
8010039a: 55 push %ebp
8010039b: 89 e5 mov %esp,%ebp
8010039d: 83 ec 38 sub $0x38,%esp
int i, c, locking;
uint *argp;
char *s;
locking = cons.locking;
801003a0: a1 14 b6 10 80 mov 0x8010b614,%eax
801003a5: 89 45 ec mov %eax,-0x14(%ebp)
if(locking)
801003a8: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
801003ac: 74 0c je 801003ba <cprintf+0x20>
acquire(&cons.lock);
801003ae: c7 04 24 e0 b5 10 80 movl $0x8010b5e0,(%esp)
801003b5: e8 b1 4b 00 00 call 80104f6b <acquire>
if (fmt == 0)
801003ba: 8b 45 08 mov 0x8(%ebp),%eax
801003bd: 85 c0 test %eax,%eax
801003bf: 75 0c jne 801003cd <cprintf+0x33>
panic("null fmt");
801003c1: c7 04 24 36 86 10 80 movl $0x80108636,(%esp)
801003c8: e8 6d 01 00 00 call 8010053a <panic>
argp = (uint*)(void*)(&fmt + 1);
801003cd: 8d 45 08 lea 0x8(%ebp),%eax
801003d0: 83 c0 04 add $0x4,%eax
801003d3: 89 45 f0 mov %eax,-0x10(%ebp)
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801003d6: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
801003dd: e9 20 01 00 00 jmp 80100502 <cprintf+0x168>
if(c != '%'){
801003e2: 83 7d e8 25 cmpl $0x25,-0x18(%ebp)
801003e6: 74 10 je 801003f8 <cprintf+0x5e>
consputc(c);
801003e8: 8b 45 e8 mov -0x18(%ebp),%eax
801003eb: 89 04 24 mov %eax,(%esp)
801003ee: e8 5b 03 00 00 call 8010074e <consputc>
continue;
801003f3: e9 06 01 00 00 jmp 801004fe <cprintf+0x164>
}
c = fmt[++i] & 0xff;
801003f8: 8b 55 08 mov 0x8(%ebp),%edx
801003fb: 83 45 e4 01 addl $0x1,-0x1c(%ebp)
801003ff: 8b 45 e4 mov -0x1c(%ebp),%eax
80100402: 8d 04 02 lea (%edx,%eax,1),%eax
80100405: 0f b6 00 movzbl (%eax),%eax
80100408: 0f be c0 movsbl %al,%eax
8010040b: 25 ff 00 00 00 and $0xff,%eax
80100410: 89 45 e8 mov %eax,-0x18(%ebp)
if(c == 0)
80100413: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
80100417: 0f 84 08 01 00 00 je 80100525 <cprintf+0x18b>
break;
switch(c){
8010041d: 8b 45 e8 mov -0x18(%ebp),%eax
80100420: 83 f8 70 cmp $0x70,%eax
80100423: 74 4d je 80100472 <cprintf+0xd8>
80100425: 83 f8 70 cmp $0x70,%eax
80100428: 7f 13 jg 8010043d <cprintf+0xa3>
8010042a: 83 f8 25 cmp $0x25,%eax
8010042d: 0f 84 a6 00 00 00 je 801004d9 <cprintf+0x13f>
80100433: 83 f8 64 cmp $0x64,%eax
80100436: 74 14 je 8010044c <cprintf+0xb2>
80100438: e9 aa 00 00 00 jmp 801004e7 <cprintf+0x14d>
8010043d: 83 f8 73 cmp $0x73,%eax
80100440: 74 53 je 80100495 <cprintf+0xfb>
80100442: 83 f8 78 cmp $0x78,%eax
80100445: 74 2b je 80100472 <cprintf+0xd8>
80100447: e9 9b 00 00 00 jmp 801004e7 <cprintf+0x14d>
case 'd':
printint(*argp++, 10, 1);
8010044c: 8b 45 f0 mov -0x10(%ebp),%eax
8010044f: 8b 00 mov (%eax),%eax
80100451: 83 45 f0 04 addl $0x4,-0x10(%ebp)
80100455: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
8010045c: 00
8010045d: c7 44 24 04 0a 00 00 movl $0xa,0x4(%esp)
80100464: 00
80100465: 89 04 24 mov %eax,(%esp)
80100468: e8 88 fe ff ff call 801002f5 <printint>
break;
8010046d: e9 8c 00 00 00 jmp 801004fe <cprintf+0x164>
case 'x':
case 'p':
printint(*argp++, 16, 0);
80100472: 8b 45 f0 mov -0x10(%ebp),%eax
80100475: 8b 00 mov (%eax),%eax
80100477: 83 45 f0 04 addl $0x4,-0x10(%ebp)
8010047b: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80100482: 00
80100483: c7 44 24 04 10 00 00 movl $0x10,0x4(%esp)
8010048a: 00
8010048b: 89 04 24 mov %eax,(%esp)
8010048e: e8 62 fe ff ff call 801002f5 <printint>
break;
80100493: eb 69 jmp 801004fe <cprintf+0x164>
case 's':
if((s = (char*)*argp++) == 0)
80100495: 8b 45 f0 mov -0x10(%ebp),%eax
80100498: 8b 00 mov (%eax),%eax
8010049a: 89 45 f4 mov %eax,-0xc(%ebp)
8010049d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801004a1: 0f 94 c0 sete %al
801004a4: 83 45 f0 04 addl $0x4,-0x10(%ebp)
801004a8: 84 c0 test %al,%al
801004aa: 74 20 je 801004cc <cprintf+0x132>
s = "(null)";
801004ac: c7 45 f4 3f 86 10 80 movl $0x8010863f,-0xc(%ebp)
for(; *s; s++)
801004b3: eb 18 jmp 801004cd <cprintf+0x133>
consputc(*s);
801004b5: 8b 45 f4 mov -0xc(%ebp),%eax
801004b8: 0f b6 00 movzbl (%eax),%eax
801004bb: 0f be c0 movsbl %al,%eax
801004be: 89 04 24 mov %eax,(%esp)
801004c1: e8 88 02 00 00 call 8010074e <consputc>
printint(*argp++, 16, 0);
break;
case 's':
if((s = (char*)*argp++) == 0)
s = "(null)";
for(; *s; s++)
801004c6: 83 45 f4 01 addl $0x1,-0xc(%ebp)
801004ca: eb 01 jmp 801004cd <cprintf+0x133>
801004cc: 90 nop
801004cd: 8b 45 f4 mov -0xc(%ebp),%eax
801004d0: 0f b6 00 movzbl (%eax),%eax
801004d3: 84 c0 test %al,%al
801004d5: 75 de jne 801004b5 <cprintf+0x11b>
consputc(*s);
break;
801004d7: eb 25 jmp 801004fe <cprintf+0x164>
case '%':
consputc('%');
801004d9: c7 04 24 25 00 00 00 movl $0x25,(%esp)
801004e0: e8 69 02 00 00 call 8010074e <consputc>
break;
801004e5: eb 17 jmp 801004fe <cprintf+0x164>
default:
// Print unknown % sequence to draw attention.
consputc('%');
801004e7: c7 04 24 25 00 00 00 movl $0x25,(%esp)
801004ee: e8 5b 02 00 00 call 8010074e <consputc>
consputc(c);
801004f3: 8b 45 e8 mov -0x18(%ebp),%eax
801004f6: 89 04 24 mov %eax,(%esp)
801004f9: e8 50 02 00 00 call 8010074e <consputc>
if (fmt == 0)
panic("null fmt");
argp = (uint*)(void*)(&fmt + 1);
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801004fe: 83 45 e4 01 addl $0x1,-0x1c(%ebp)
80100502: 8b 55 08 mov 0x8(%ebp),%edx
80100505: 8b 45 e4 mov -0x1c(%ebp),%eax
80100508: 8d 04 02 lea (%edx,%eax,1),%eax
8010050b: 0f b6 00 movzbl (%eax),%eax
8010050e: 0f be c0 movsbl %al,%eax
80100511: 25 ff 00 00 00 and $0xff,%eax
80100516: 89 45 e8 mov %eax,-0x18(%ebp)
80100519: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
8010051d: 0f 85 bf fe ff ff jne 801003e2 <cprintf+0x48>
80100523: eb 01 jmp 80100526 <cprintf+0x18c>
consputc(c);
continue;
}
c = fmt[++i] & 0xff;
if(c == 0)
break;
80100525: 90 nop
consputc(c);
break;
}
}
if(locking)
80100526: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
8010052a: 74 0c je 80100538 <cprintf+0x19e>
release(&cons.lock);
8010052c: c7 04 24 e0 b5 10 80 movl $0x8010b5e0,(%esp)
80100533: e8 94 4a 00 00 call 80104fcc <release>
}
80100538: c9 leave
80100539: c3 ret
8010053a <panic>:
void
panic(char *s)
{
8010053a: 55 push %ebp
8010053b: 89 e5 mov %esp,%ebp
8010053d: 83 ec 48 sub $0x48,%esp
int i;
uint pcs[10];
cli();
80100540: e8 aa fd ff ff call 801002ef <cli>
cons.locking = 0;
80100545: c7 05 14 b6 10 80 00 movl $0x0,0x8010b614
8010054c: 00 00 00
cprintf("cpu%d: panic: ", cpu->id);
8010054f: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80100555: 0f b6 00 movzbl (%eax),%eax
80100558: 0f b6 c0 movzbl %al,%eax
8010055b: 89 44 24 04 mov %eax,0x4(%esp)
8010055f: c7 04 24 46 86 10 80 movl $0x80108646,(%esp)
80100566: e8 2f fe ff ff call 8010039a <cprintf>
cprintf(s);
8010056b: 8b 45 08 mov 0x8(%ebp),%eax
8010056e: 89 04 24 mov %eax,(%esp)
80100571: e8 24 fe ff ff call 8010039a <cprintf>
cprintf("\n");
80100576: c7 04 24 55 86 10 80 movl $0x80108655,(%esp)
8010057d: e8 18 fe ff ff call 8010039a <cprintf>
getcallerpcs(&s, pcs);
80100582: 8d 45 cc lea -0x34(%ebp),%eax
80100585: 89 44 24 04 mov %eax,0x4(%esp)
80100589: 8d 45 08 lea 0x8(%ebp),%eax
8010058c: 89 04 24 mov %eax,(%esp)
8010058f: e8 87 4a 00 00 call 8010501b <getcallerpcs>
for(i=0; i<10; i++)
80100594: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
8010059b: eb 1b jmp 801005b8 <panic+0x7e>
cprintf(" %p", pcs[i]);
8010059d: 8b 45 f4 mov -0xc(%ebp),%eax
801005a0: 8b 44 85 cc mov -0x34(%ebp,%eax,4),%eax
801005a4: 89 44 24 04 mov %eax,0x4(%esp)
801005a8: c7 04 24 57 86 10 80 movl $0x80108657,(%esp)
801005af: e8 e6 fd ff ff call 8010039a <cprintf>
cons.locking = 0;
cprintf("cpu%d: panic: ", cpu->id);
cprintf(s);
cprintf("\n");
getcallerpcs(&s, pcs);
for(i=0; i<10; i++)
801005b4: 83 45 f4 01 addl $0x1,-0xc(%ebp)
801005b8: 83 7d f4 09 cmpl $0x9,-0xc(%ebp)
801005bc: 7e df jle 8010059d <panic+0x63>
cprintf(" %p", pcs[i]);
panicked = 1; // freeze other CPU
801005be: c7 05 c0 b5 10 80 01 movl $0x1,0x8010b5c0
801005c5: 00 00 00
for(;;)
;
801005c8: eb fe jmp 801005c8 <panic+0x8e>
801005ca <cgaputc>:
#define CRTPORT 0x3d4
static ushort *crt = (ushort*)P2V(0xb8000); // CGA memory
static void
cgaputc(int c)
{
801005ca: 55 push %ebp
801005cb: 89 e5 mov %esp,%ebp
801005cd: 83 ec 28 sub $0x28,%esp
int pos;
// Cursor position: col + 80*row.
outb(CRTPORT, 14);
801005d0: c7 44 24 04 0e 00 00 movl $0xe,0x4(%esp)
801005d7: 00
801005d8: c7 04 24 d4 03 00 00 movl $0x3d4,(%esp)
801005df: e8 ed fc ff ff call 801002d1 <outb>
pos = inb(CRTPORT+1) << 8;
801005e4: c7 04 24 d5 03 00 00 movl $0x3d5,(%esp)
801005eb: e8 c4 fc ff ff call 801002b4 <inb>
801005f0: 0f b6 c0 movzbl %al,%eax
801005f3: c1 e0 08 shl $0x8,%eax
801005f6: 89 45 f4 mov %eax,-0xc(%ebp)
outb(CRTPORT, 15);
801005f9: c7 44 24 04 0f 00 00 movl $0xf,0x4(%esp)
80100600: 00
80100601: c7 04 24 d4 03 00 00 movl $0x3d4,(%esp)
80100608: e8 c4 fc ff ff call 801002d1 <outb>
pos |= inb(CRTPORT+1);
8010060d: c7 04 24 d5 03 00 00 movl $0x3d5,(%esp)
80100614: e8 9b fc ff ff call 801002b4 <inb>
80100619: 0f b6 c0 movzbl %al,%eax
8010061c: 09 45 f4 or %eax,-0xc(%ebp)
if(c == '\n')
8010061f: 83 7d 08 0a cmpl $0xa,0x8(%ebp)
80100623: 75 30 jne 80100655 <cgaputc+0x8b>
pos += 80 - pos%80;
80100625: 8b 4d f4 mov -0xc(%ebp),%ecx
80100628: ba 67 66 66 66 mov $0x66666667,%edx
8010062d: 89 c8 mov %ecx,%eax
8010062f: f7 ea imul %edx
80100631: c1 fa 05 sar $0x5,%edx
80100634: 89 c8 mov %ecx,%eax
80100636: c1 f8 1f sar $0x1f,%eax
80100639: 29 c2 sub %eax,%edx
8010063b: 89 d0 mov %edx,%eax
8010063d: c1 e0 02 shl $0x2,%eax
80100640: 01 d0 add %edx,%eax
80100642: c1 e0 04 shl $0x4,%eax
80100645: 89 ca mov %ecx,%edx
80100647: 29 c2 sub %eax,%edx
80100649: b8 50 00 00 00 mov $0x50,%eax
8010064e: 29 d0 sub %edx,%eax
80100650: 01 45 f4 add %eax,-0xc(%ebp)
80100653: eb 33 jmp 80100688 <cgaputc+0xbe>
else if(c == BACKSPACE){
80100655: 81 7d 08 00 01 00 00 cmpl $0x100,0x8(%ebp)
8010065c: 75 0c jne 8010066a <cgaputc+0xa0>
if(pos > 0) --pos;
8010065e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80100662: 7e 24 jle 80100688 <cgaputc+0xbe>
80100664: 83 6d f4 01 subl $0x1,-0xc(%ebp)
80100668: eb 1e jmp 80100688 <cgaputc+0xbe>
} else
crt[pos++] = (c&0xff) | 0x0700; // black on white
8010066a: a1 00 90 10 80 mov 0x80109000,%eax
8010066f: 8b 55 f4 mov -0xc(%ebp),%edx
80100672: 01 d2 add %edx,%edx
80100674: 8d 14 10 lea (%eax,%edx,1),%edx
80100677: 8b 45 08 mov 0x8(%ebp),%eax
8010067a: 66 25 ff 00 and $0xff,%ax
8010067e: 80 cc 07 or $0x7,%ah
80100681: 66 89 02 mov %ax,(%edx)
80100684: 83 45 f4 01 addl $0x1,-0xc(%ebp)
if((pos/80) >= 24){ // Scroll up.
80100688: 81 7d f4 7f 07 00 00 cmpl $0x77f,-0xc(%ebp)
8010068f: 7e 53 jle 801006e4 <cgaputc+0x11a>
memmove(crt, crt+80, sizeof(crt[0])*23*80);
80100691: a1 00 90 10 80 mov 0x80109000,%eax
80100696: 8d 90 a0 00 00 00 lea 0xa0(%eax),%edx
8010069c: a1 00 90 10 80 mov 0x80109000,%eax
801006a1: c7 44 24 08 60 0e 00 movl $0xe60,0x8(%esp)
801006a8: 00
801006a9: 89 54 24 04 mov %edx,0x4(%esp)
801006ad: 89 04 24 mov %eax,(%esp)
801006b0: e8 d8 4b 00 00 call 8010528d <memmove>
pos -= 80;
801006b5: 83 6d f4 50 subl $0x50,-0xc(%ebp)
memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
801006b9: b8 80 07 00 00 mov $0x780,%eax
801006be: 2b 45 f4 sub -0xc(%ebp),%eax
801006c1: 8d 14 00 lea (%eax,%eax,1),%edx
801006c4: a1 00 90 10 80 mov 0x80109000,%eax
801006c9: 8b 4d f4 mov -0xc(%ebp),%ecx
801006cc: 01 c9 add %ecx,%ecx
801006ce: 01 c8 add %ecx,%eax
801006d0: 89 54 24 08 mov %edx,0x8(%esp)
801006d4: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801006db: 00
801006dc: 89 04 24 mov %eax,(%esp)
801006df: e8 d6 4a 00 00 call 801051ba <memset>
}
outb(CRTPORT, 14);
801006e4: c7 44 24 04 0e 00 00 movl $0xe,0x4(%esp)
801006eb: 00
801006ec: c7 04 24 d4 03 00 00 movl $0x3d4,(%esp)
801006f3: e8 d9 fb ff ff call 801002d1 <outb>
outb(CRTPORT+1, pos>>8);
801006f8: 8b 45 f4 mov -0xc(%ebp),%eax
801006fb: c1 f8 08 sar $0x8,%eax
801006fe: 0f b6 c0 movzbl %al,%eax
80100701: 89 44 24 04 mov %eax,0x4(%esp)
80100705: c7 04 24 d5 03 00 00 movl $0x3d5,(%esp)
8010070c: e8 c0 fb ff ff call 801002d1 <outb>
outb(CRTPORT, 15);
80100711: c7 44 24 04 0f 00 00 movl $0xf,0x4(%esp)
80100718: 00
80100719: c7 04 24 d4 03 00 00 movl $0x3d4,(%esp)
80100720: e8 ac fb ff ff call 801002d1 <outb>
outb(CRTPORT+1, pos);
80100725: 8b 45 f4 mov -0xc(%ebp),%eax
80100728: 0f b6 c0 movzbl %al,%eax
8010072b: 89 44 24 04 mov %eax,0x4(%esp)
8010072f: c7 04 24 d5 03 00 00 movl $0x3d5,(%esp)
80100736: e8 96 fb ff ff call 801002d1 <outb>
crt[pos] = ' ' | 0x0700;
8010073b: a1 00 90 10 80 mov 0x80109000,%eax
80100740: 8b 55 f4 mov -0xc(%ebp),%edx
80100743: 01 d2 add %edx,%edx
80100745: 01 d0 add %edx,%eax
80100747: 66 c7 00 20 07 movw $0x720,(%eax)
}
8010074c: c9 leave
8010074d: c3 ret
8010074e <consputc>:
void
consputc(int c)
{
8010074e: 55 push %ebp
8010074f: 89 e5 mov %esp,%ebp
80100751: 83 ec 18 sub $0x18,%esp
if(panicked){
80100754: a1 c0 b5 10 80 mov 0x8010b5c0,%eax
80100759: 85 c0 test %eax,%eax
8010075b: 74 07 je 80100764 <consputc+0x16>
cli();
8010075d: e8 8d fb ff ff call 801002ef <cli>
for(;;)
;
80100762: eb fe jmp 80100762 <consputc+0x14>
}
if(c == BACKSPACE){
80100764: 81 7d 08 00 01 00 00 cmpl $0x100,0x8(%ebp)
8010076b: 75 26 jne 80100793 <consputc+0x45>
uartputc('\b'); uartputc(' '); uartputc('\b');
8010076d: c7 04 24 08 00 00 00 movl $0x8,(%esp)
80100774: e8 e7 64 00 00 call 80106c60 <uartputc>
80100779: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80100780: e8 db 64 00 00 call 80106c60 <uartputc>
80100785: c7 04 24 08 00 00 00 movl $0x8,(%esp)
8010078c: e8 cf 64 00 00 call 80106c60 <uartputc>
80100791: eb 0b jmp 8010079e <consputc+0x50>
} else
uartputc(c);
80100793: 8b 45 08 mov 0x8(%ebp),%eax
80100796: 89 04 24 mov %eax,(%esp)
80100799: e8 c2 64 00 00 call 80106c60 <uartputc>
cgaputc(c);
8010079e: 8b 45 08 mov 0x8(%ebp),%eax
801007a1: 89 04 24 mov %eax,(%esp)
801007a4: e8 21 fe ff ff call 801005ca <cgaputc>
}
801007a9: c9 leave
801007aa: c3 ret
801007ab <consoleintr>:
#define C(x) ((x)-'@') // Control-x
void
consoleintr(int (*getc)(void))
{
801007ab: 55 push %ebp
801007ac: 89 e5 mov %esp,%ebp
801007ae: 83 ec 28 sub $0x28,%esp
int c;
acquire(&input.lock);
801007b1: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
801007b8: e8 ae 47 00 00 call 80104f6b <acquire>
while((c = getc()) >= 0){
801007bd: e9 3e 01 00 00 jmp 80100900 <consoleintr+0x155>
switch(c){
801007c2: 8b 45 f4 mov -0xc(%ebp),%eax
801007c5: 83 f8 10 cmp $0x10,%eax
801007c8: 74 1e je 801007e8 <consoleintr+0x3d>
801007ca: 83 f8 10 cmp $0x10,%eax
801007cd: 7f 0a jg 801007d9 <consoleintr+0x2e>
801007cf: 83 f8 08 cmp $0x8,%eax
801007d2: 74 68 je 8010083c <consoleintr+0x91>
801007d4: e9 94 00 00 00 jmp 8010086d <consoleintr+0xc2>
801007d9: 83 f8 15 cmp $0x15,%eax
801007dc: 74 2f je 8010080d <consoleintr+0x62>
801007de: 83 f8 7f cmp $0x7f,%eax
801007e1: 74 59 je 8010083c <consoleintr+0x91>
801007e3: e9 85 00 00 00 jmp 8010086d <consoleintr+0xc2>
case C('P'): // Process listing.
procdump();
801007e8: e8 f3 45 00 00 call 80104de0 <procdump>
break;
801007ed: e9 0e 01 00 00 jmp 80100900 <consoleintr+0x155>
case C('U'): // Kill line.
while(input.e != input.w &&
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
input.e--;
801007f2: a1 7c de 10 80 mov 0x8010de7c,%eax
801007f7: 83 e8 01 sub $0x1,%eax
801007fa: a3 7c de 10 80 mov %eax,0x8010de7c
consputc(BACKSPACE);
801007ff: c7 04 24 00 01 00 00 movl $0x100,(%esp)
80100806: e8 43 ff ff ff call 8010074e <consputc>
8010080b: eb 01 jmp 8010080e <consoleintr+0x63>
switch(c){
case C('P'): // Process listing.
procdump();
break;
case C('U'): // Kill line.
while(input.e != input.w &&
8010080d: 90 nop
8010080e: 8b 15 7c de 10 80 mov 0x8010de7c,%edx
80100814: a1 78 de 10 80 mov 0x8010de78,%eax
80100819: 39 c2 cmp %eax,%edx
8010081b: 0f 84 db 00 00 00 je 801008fc <consoleintr+0x151>
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
80100821: a1 7c de 10 80 mov 0x8010de7c,%eax
80100826: 83 e8 01 sub $0x1,%eax
80100829: 83 e0 7f and $0x7f,%eax
8010082c: 0f b6 80 f4 dd 10 80 movzbl -0x7fef220c(%eax),%eax
switch(c){
case C('P'): // Process listing.
procdump();
break;
case C('U'): // Kill line.
while(input.e != input.w &&
80100833: 3c 0a cmp $0xa,%al
80100835: 75 bb jne 801007f2 <consoleintr+0x47>
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
input.e--;
consputc(BACKSPACE);
}
break;
80100837: e9 c4 00 00 00 jmp 80100900 <consoleintr+0x155>
case C('H'): case '\x7f': // Backspace
if(input.e != input.w){
8010083c: 8b 15 7c de 10 80 mov 0x8010de7c,%edx
80100842: a1 78 de 10 80 mov 0x8010de78,%eax
80100847: 39 c2 cmp %eax,%edx
80100849: 0f 84 b0 00 00 00 je 801008ff <consoleintr+0x154>
input.e--;
8010084f: a1 7c de 10 80 mov 0x8010de7c,%eax
80100854: 83 e8 01 sub $0x1,%eax
80100857: a3 7c de 10 80 mov %eax,0x8010de7c
consputc(BACKSPACE);
8010085c: c7 04 24 00 01 00 00 movl $0x100,(%esp)
80100863: e8 e6 fe ff ff call 8010074e <consputc>
}
break;
80100868: e9 93 00 00 00 jmp 80100900 <consoleintr+0x155>
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
8010086d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80100871: 0f 84 89 00 00 00 je 80100900 <consoleintr+0x155>
80100877: 8b 15 7c de 10 80 mov 0x8010de7c,%edx
8010087d: a1 74 de 10 80 mov 0x8010de74,%eax
80100882: 89 d1 mov %edx,%ecx
80100884: 29 c1 sub %eax,%ecx
80100886: 89 c8 mov %ecx,%eax
80100888: 83 f8 7f cmp $0x7f,%eax
8010088b: 77 73 ja 80100900 <consoleintr+0x155>
c = (c == '\r') ? '\n' : c;
8010088d: 83 7d f4 0d cmpl $0xd,-0xc(%ebp)
80100891: 74 05 je 80100898 <consoleintr+0xed>
80100893: 8b 45 f4 mov -0xc(%ebp),%eax
80100896: eb 05 jmp 8010089d <consoleintr+0xf2>
80100898: b8 0a 00 00 00 mov $0xa,%eax
8010089d: 89 45 f4 mov %eax,-0xc(%ebp)
input.buf[input.e++ % INPUT_BUF] = c;
801008a0: a1 7c de 10 80 mov 0x8010de7c,%eax
801008a5: 89 c1 mov %eax,%ecx
801008a7: 83 e1 7f and $0x7f,%ecx
801008aa: 8b 55 f4 mov -0xc(%ebp),%edx
801008ad: 88 91 f4 dd 10 80 mov %dl,-0x7fef220c(%ecx)
801008b3: 83 c0 01 add $0x1,%eax
801008b6: a3 7c de 10 80 mov %eax,0x8010de7c
consputc(c);
801008bb: 8b 45 f4 mov -0xc(%ebp),%eax
801008be: 89 04 24 mov %eax,(%esp)
801008c1: e8 88 fe ff ff call 8010074e <consputc>
if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
801008c6: 83 7d f4 0a cmpl $0xa,-0xc(%ebp)
801008ca: 74 18 je 801008e4 <consoleintr+0x139>
801008cc: 83 7d f4 04 cmpl $0x4,-0xc(%ebp)
801008d0: 74 12 je 801008e4 <consoleintr+0x139>
801008d2: a1 7c de 10 80 mov 0x8010de7c,%eax
801008d7: 8b 15 74 de 10 80 mov 0x8010de74,%edx
801008dd: 83 ea 80 sub $0xffffff80,%edx
801008e0: 39 d0 cmp %edx,%eax
801008e2: 75 1c jne 80100900 <consoleintr+0x155>
input.w = input.e;
801008e4: a1 7c de 10 80 mov 0x8010de7c,%eax
801008e9: a3 78 de 10 80 mov %eax,0x8010de78
wakeup(&input.r);
801008ee: c7 04 24 74 de 10 80 movl $0x8010de74,(%esp)
801008f5: e8 3f 44 00 00 call 80104d39 <wakeup>
801008fa: eb 04 jmp 80100900 <consoleintr+0x155>
while(input.e != input.w &&
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
input.e--;
consputc(BACKSPACE);
}
break;
801008fc: 90 nop
801008fd: eb 01 jmp 80100900 <consoleintr+0x155>
case C('H'): case '\x7f': // Backspace
if(input.e != input.w){
input.e--;
consputc(BACKSPACE);
}
break;
801008ff: 90 nop
consoleintr(int (*getc)(void))
{
int c;
acquire(&input.lock);
while((c = getc()) >= 0){
80100900: 8b 45 08 mov 0x8(%ebp),%eax
80100903: ff d0 call *%eax
80100905: 89 45 f4 mov %eax,-0xc(%ebp)
80100908: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8010090c: 0f 89 b0 fe ff ff jns 801007c2 <consoleintr+0x17>
}
}
break;
}
}
release(&input.lock);
80100912: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
80100919: e8 ae 46 00 00 call 80104fcc <release>
}
8010091e: c9 leave
8010091f: c3 ret
80100920 <consoleread>:
int
consoleread(struct inode *ip, char *dst, int n)
{
80100920: 55 push %ebp
80100921: 89 e5 mov %esp,%ebp
80100923: 83 ec 28 sub $0x28,%esp
uint target;
int c;
iunlock(ip);
80100926: 8b 45 08 mov 0x8(%ebp),%eax
80100929: 89 04 24 mov %eax,(%esp)
8010092c: e8 9b 10 00 00 call 801019cc <iunlock>
target = n;
80100931: 8b 45 10 mov 0x10(%ebp),%eax
80100934: 89 45 f0 mov %eax,-0x10(%ebp)
acquire(&input.lock);
80100937: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
8010093e: e8 28 46 00 00 call 80104f6b <acquire>
while(n > 0){
80100943: e9 a8 00 00 00 jmp 801009f0 <consoleread+0xd0>
while(input.r == input.w){
if(proc->killed){
80100948: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010094e: 8b 40 24 mov 0x24(%eax),%eax
80100951: 85 c0 test %eax,%eax
80100953: 74 21 je 80100976 <consoleread+0x56>
release(&input.lock);
80100955: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
8010095c: e8 6b 46 00 00 call 80104fcc <release>
ilock(ip);
80100961: 8b 45 08 mov 0x8(%ebp),%eax
80100964: 89 04 24 mov %eax,(%esp)
80100967: e8 0f 0f 00 00 call 8010187b <ilock>
return -1;
8010096c: b8 ff ff ff ff mov $0xffffffff,%eax
80100971: e9 a9 00 00 00 jmp 80100a1f <consoleread+0xff>
}
sleep(&input.r, &input.lock);
80100976: c7 44 24 04 c0 dd 10 movl $0x8010ddc0,0x4(%esp)
8010097d: 80
8010097e: c7 04 24 74 de 10 80 movl $0x8010de74,(%esp)
80100985: e8 69 42 00 00 call 80104bf3 <sleep>
8010098a: eb 01 jmp 8010098d <consoleread+0x6d>
iunlock(ip);
target = n;
acquire(&input.lock);
while(n > 0){
while(input.r == input.w){
8010098c: 90 nop
8010098d: 8b 15 74 de 10 80 mov 0x8010de74,%edx
80100993: a1 78 de 10 80 mov 0x8010de78,%eax
80100998: 39 c2 cmp %eax,%edx
8010099a: 74 ac je 80100948 <consoleread+0x28>
ilock(ip);
return -1;
}
sleep(&input.r, &input.lock);
}
c = input.buf[input.r++ % INPUT_BUF];
8010099c: a1 74 de 10 80 mov 0x8010de74,%eax
801009a1: 89 c2 mov %eax,%edx
801009a3: 83 e2 7f and $0x7f,%edx
801009a6: 0f b6 92 f4 dd 10 80 movzbl -0x7fef220c(%edx),%edx
801009ad: 0f be d2 movsbl %dl,%edx
801009b0: 89 55 f4 mov %edx,-0xc(%ebp)
801009b3: 83 c0 01 add $0x1,%eax
801009b6: a3 74 de 10 80 mov %eax,0x8010de74
if(c == C('D')){ // EOF
801009bb: 83 7d f4 04 cmpl $0x4,-0xc(%ebp)
801009bf: 75 17 jne 801009d8 <consoleread+0xb8>
if(n < target){
801009c1: 8b 45 10 mov 0x10(%ebp),%eax
801009c4: 3b 45 f0 cmp -0x10(%ebp),%eax
801009c7: 73 2f jae 801009f8 <consoleread+0xd8>
// Save ^D for next time, to make sure
// caller gets a 0-byte result.
input.r--;
801009c9: a1 74 de 10 80 mov 0x8010de74,%eax
801009ce: 83 e8 01 sub $0x1,%eax
801009d1: a3 74 de 10 80 mov %eax,0x8010de74
}
break;
801009d6: eb 24 jmp 801009fc <consoleread+0xdc>
}
*dst++ = c;
801009d8: 8b 45 f4 mov -0xc(%ebp),%eax
801009db: 89 c2 mov %eax,%edx
801009dd: 8b 45 0c mov 0xc(%ebp),%eax
801009e0: 88 10 mov %dl,(%eax)
801009e2: 83 45 0c 01 addl $0x1,0xc(%ebp)
--n;
801009e6: 83 6d 10 01 subl $0x1,0x10(%ebp)
if(c == '\n')
801009ea: 83 7d f4 0a cmpl $0xa,-0xc(%ebp)
801009ee: 74 0b je 801009fb <consoleread+0xdb>
int c;
iunlock(ip);
target = n;
acquire(&input.lock);
while(n > 0){
801009f0: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801009f4: 7f 96 jg 8010098c <consoleread+0x6c>
801009f6: eb 04 jmp 801009fc <consoleread+0xdc>
if(n < target){
// Save ^D for next time, to make sure
// caller gets a 0-byte result.
input.r--;
}
break;
801009f8: 90 nop
801009f9: eb 01 jmp 801009fc <consoleread+0xdc>
}
*dst++ = c;
--n;
if(c == '\n')
break;
801009fb: 90 nop
}
release(&input.lock);
801009fc: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
80100a03: e8 c4 45 00 00 call 80104fcc <release>
ilock(ip);
80100a08: 8b 45 08 mov 0x8(%ebp),%eax
80100a0b: 89 04 24 mov %eax,(%esp)
80100a0e: e8 68 0e 00 00 call 8010187b <ilock>
return target - n;
80100a13: 8b 45 10 mov 0x10(%ebp),%eax
80100a16: 8b 55 f0 mov -0x10(%ebp),%edx
80100a19: 89 d1 mov %edx,%ecx
80100a1b: 29 c1 sub %eax,%ecx
80100a1d: 89 c8 mov %ecx,%eax
}
80100a1f: c9 leave
80100a20: c3 ret
80100a21 <consolewrite>:
int
consolewrite(struct inode *ip, char *buf, int n)
{
80100a21: 55 push %ebp
80100a22: 89 e5 mov %esp,%ebp
80100a24: 83 ec 28 sub $0x28,%esp
int i;
iunlock(ip);
80100a27: 8b 45 08 mov 0x8(%ebp),%eax
80100a2a: 89 04 24 mov %eax,(%esp)
80100a2d: e8 9a 0f 00 00 call 801019cc <iunlock>
acquire(&cons.lock);
80100a32: c7 04 24 e0 b5 10 80 movl $0x8010b5e0,(%esp)
80100a39: e8 2d 45 00 00 call 80104f6b <acquire>
for(i = 0; i < n; i++)
80100a3e: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80100a45: eb 1d jmp 80100a64 <consolewrite+0x43>
consputc(buf[i] & 0xff);
80100a47: 8b 45 f4 mov -0xc(%ebp),%eax
80100a4a: 03 45 0c add 0xc(%ebp),%eax
80100a4d: 0f b6 00 movzbl (%eax),%eax
80100a50: 0f be c0 movsbl %al,%eax
80100a53: 25 ff 00 00 00 and $0xff,%eax
80100a58: 89 04 24 mov %eax,(%esp)
80100a5b: e8 ee fc ff ff call 8010074e <consputc>
{
int i;
iunlock(ip);
acquire(&cons.lock);
for(i = 0; i < n; i++)
80100a60: 83 45 f4 01 addl $0x1,-0xc(%ebp)
80100a64: 8b 45 f4 mov -0xc(%ebp),%eax
80100a67: 3b 45 10 cmp 0x10(%ebp),%eax
80100a6a: 7c db jl 80100a47 <consolewrite+0x26>
consputc(buf[i] & 0xff);
release(&cons.lock);
80100a6c: c7 04 24 e0 b5 10 80 movl $0x8010b5e0,(%esp)
80100a73: e8 54 45 00 00 call 80104fcc <release>
ilock(ip);
80100a78: 8b 45 08 mov 0x8(%ebp),%eax
80100a7b: 89 04 24 mov %eax,(%esp)
80100a7e: e8 f8 0d 00 00 call 8010187b <ilock>
return n;
80100a83: 8b 45 10 mov 0x10(%ebp),%eax
}
80100a86: c9 leave
80100a87: c3 ret
80100a88 <consoleinit>:
void
consoleinit(void)
{
80100a88: 55 push %ebp
80100a89: 89 e5 mov %esp,%ebp
80100a8b: 83 ec 18 sub $0x18,%esp
initlock(&cons.lock, "console");
80100a8e: c7 44 24 04 5b 86 10 movl $0x8010865b,0x4(%esp)
80100a95: 80
80100a96: c7 04 24 e0 b5 10 80 movl $0x8010b5e0,(%esp)
80100a9d: e8 a8 44 00 00 call 80104f4a <initlock>
initlock(&input.lock, "input");
80100aa2: c7 44 24 04 63 86 10 movl $0x80108663,0x4(%esp)
80100aa9: 80
80100aaa: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
80100ab1: e8 94 44 00 00 call 80104f4a <initlock>
devsw[CONSOLE].write = consolewrite;
80100ab6: c7 05 2c e8 10 80 21 movl $0x80100a21,0x8010e82c
80100abd: 0a 10 80
devsw[CONSOLE].read = consoleread;
80100ac0: c7 05 28 e8 10 80 20 movl $0x80100920,0x8010e828
80100ac7: 09 10 80
cons.locking = 1;
80100aca: c7 05 14 b6 10 80 01 movl $0x1,0x8010b614
80100ad1: 00 00 00
picenable(IRQ_KBD);
80100ad4: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80100adb: e8 ad 2f 00 00 call 80103a8d <picenable>
ioapicenable(IRQ_KBD, 0);
80100ae0: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80100ae7: 00
80100ae8: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80100aef: e8 8a 1e 00 00 call 8010297e <ioapicenable>
}
80100af4: c9 leave
80100af5: c3 ret
...
80100af8 <exec>:
#include "x86.h"
#include "elf.h"
int
exec(char *path, char **argv)
{
80100af8: 55 push %ebp
80100af9: 89 e5 mov %esp,%ebp
80100afb: 81 ec 38 01 00 00 sub $0x138,%esp
struct elfhdr elf;
struct inode *ip;
struct proghdr ph;
pde_t *pgdir, *oldpgdir;
if((ip = namei(path)) == 0)
80100b01: 8b 45 08 mov 0x8(%ebp),%eax
80100b04: 89 04 24 mov %eax,(%esp)
80100b07: e8 17 19 00 00 call 80102423 <namei>
80100b0c: 89 45 ec mov %eax,-0x14(%ebp)
80100b0f: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80100b13: 75 0a jne 80100b1f <exec+0x27>
return -1;
80100b15: b8 ff ff ff ff mov $0xffffffff,%eax
80100b1a: e9 e4 03 00 00 jmp 80100f03 <exec+0x40b>
ilock(ip);
80100b1f: 8b 45 ec mov -0x14(%ebp),%eax
80100b22: 89 04 24 mov %eax,(%esp)
80100b25: e8 51 0d 00 00 call 8010187b <ilock>
pgdir = 0;
80100b2a: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
// Check ELF header
if(readi(ip, (char*)&elf, 0, sizeof(elf)) < sizeof(elf))
80100b31: 8d 85 0c ff ff ff lea -0xf4(%ebp),%eax
80100b37: c7 44 24 0c 34 00 00 movl $0x34,0xc(%esp)
80100b3e: 00
80100b3f: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80100b46: 00
80100b47: 89 44 24 04 mov %eax,0x4(%esp)
80100b4b: 8b 45 ec mov -0x14(%ebp),%eax
80100b4e: 89 04 24 mov %eax,(%esp)
80100b51: e8 1e 12 00 00 call 80101d74 <readi>
80100b56: 83 f8 33 cmp $0x33,%eax
80100b59: 0f 86 5e 03 00 00 jbe 80100ebd <exec+0x3c5>
goto bad;
if(elf.magic != ELF_MAGIC)
80100b5f: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax
80100b65: 3d 7f 45 4c 46 cmp $0x464c457f,%eax
80100b6a: 0f 85 50 03 00 00 jne 80100ec0 <exec+0x3c8>
goto bad;
if((pgdir = setupkvm()) == 0)
80100b70: e8 30 72 00 00 call 80107da5 <setupkvm>
80100b75: 89 45 f0 mov %eax,-0x10(%ebp)
80100b78: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80100b7c: 0f 84 41 03 00 00 je 80100ec3 <exec+0x3cb>
goto bad;
// Load program into memory.
sz = 0;
80100b82: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100b89: c7 45 d8 00 00 00 00 movl $0x0,-0x28(%ebp)
80100b90: 8b 85 28 ff ff ff mov -0xd8(%ebp),%eax
80100b96: 89 45 dc mov %eax,-0x24(%ebp)
80100b99: e9 ca 00 00 00 jmp 80100c68 <exec+0x170>
if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
80100b9e: 8b 55 dc mov -0x24(%ebp),%edx
80100ba1: 8d 85 ec fe ff ff lea -0x114(%ebp),%eax
80100ba7: c7 44 24 0c 20 00 00 movl $0x20,0xc(%esp)
80100bae: 00
80100baf: 89 54 24 08 mov %edx,0x8(%esp)
80100bb3: 89 44 24 04 mov %eax,0x4(%esp)
80100bb7: 8b 45 ec mov -0x14(%ebp),%eax
80100bba: 89 04 24 mov %eax,(%esp)
80100bbd: e8 b2 11 00 00 call 80101d74 <readi>
80100bc2: 83 f8 20 cmp $0x20,%eax
80100bc5: 0f 85 fb 02 00 00 jne 80100ec6 <exec+0x3ce>
goto bad;
if(ph.type != ELF_PROG_LOAD)
80100bcb: 8b 85 ec fe ff ff mov -0x114(%ebp),%eax
80100bd1: 83 f8 01 cmp $0x1,%eax
80100bd4: 0f 85 80 00 00 00 jne 80100c5a <exec+0x162>
continue;
if(ph.memsz < ph.filesz)
80100bda: 8b 95 00 ff ff ff mov -0x100(%ebp),%edx
80100be0: 8b 85 fc fe ff ff mov -0x104(%ebp),%eax
80100be6: 39 c2 cmp %eax,%edx
80100be8: 0f 82 db 02 00 00 jb 80100ec9 <exec+0x3d1>
goto bad;
if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
80100bee: 8b 95 f4 fe ff ff mov -0x10c(%ebp),%edx
80100bf4: 8b 85 00 ff ff ff mov -0x100(%ebp),%eax
80100bfa: 8d 04 02 lea (%edx,%eax,1),%eax
80100bfd: 89 44 24 08 mov %eax,0x8(%esp)
80100c01: 8b 45 e4 mov -0x1c(%ebp),%eax
80100c04: 89 44 24 04 mov %eax,0x4(%esp)
80100c08: 8b 45 f0 mov -0x10(%ebp),%eax
80100c0b: 89 04 24 mov %eax,(%esp)
80100c0e: e8 66 75 00 00 call 80108179 <allocuvm>
80100c13: 89 45 e4 mov %eax,-0x1c(%ebp)
80100c16: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
80100c1a: 0f 84 ac 02 00 00 je 80100ecc <exec+0x3d4>
goto bad;
if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
80100c20: 8b 8d fc fe ff ff mov -0x104(%ebp),%ecx
80100c26: 8b 95 f0 fe ff ff mov -0x110(%ebp),%edx
80100c2c: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80100c32: 89 4c 24 10 mov %ecx,0x10(%esp)
80100c36: 89 54 24 0c mov %edx,0xc(%esp)
80100c3a: 8b 55 ec mov -0x14(%ebp),%edx
80100c3d: 89 54 24 08 mov %edx,0x8(%esp)
80100c41: 89 44 24 04 mov %eax,0x4(%esp)
80100c45: 8b 45 f0 mov -0x10(%ebp),%eax
80100c48: 89 04 24 mov %eax,(%esp)
80100c4b: e8 39 74 00 00 call 80108089 <loaduvm>
80100c50: 85 c0 test %eax,%eax
80100c52: 0f 88 77 02 00 00 js 80100ecf <exec+0x3d7>
80100c58: eb 01 jmp 80100c5b <exec+0x163>
sz = 0;
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
goto bad;
if(ph.type != ELF_PROG_LOAD)
continue;
80100c5a: 90 nop
if((pgdir = setupkvm()) == 0)
goto bad;
// Load program into memory.
sz = 0;
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100c5b: 83 45 d8 01 addl $0x1,-0x28(%ebp)
80100c5f: 8b 45 dc mov -0x24(%ebp),%eax
80100c62: 83 c0 20 add $0x20,%eax
80100c65: 89 45 dc mov %eax,-0x24(%ebp)
80100c68: 0f b7 85 38 ff ff ff movzwl -0xc8(%ebp),%eax
80100c6f: 0f b7 c0 movzwl %ax,%eax
80100c72: 3b 45 d8 cmp -0x28(%ebp),%eax
80100c75: 0f 8f 23 ff ff ff jg 80100b9e <exec+0xa6>
if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
goto bad;
if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
goto bad;
}
iunlockput(ip);
80100c7b: 8b 45 ec mov -0x14(%ebp),%eax
80100c7e: 89 04 24 mov %eax,(%esp)
80100c81: e8 7c 0e 00 00 call 80101b02 <iunlockput>
ip = 0;
80100c86: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
// Allocate two pages at the next page boundary.
// Make the first inaccessible. Use the second as the user stack.
sz = PGROUNDUP(sz);
80100c8d: 8b 45 e4 mov -0x1c(%ebp),%eax
80100c90: 05 ff 0f 00 00 add $0xfff,%eax
80100c95: 25 00 f0 ff ff and $0xfffff000,%eax
80100c9a: 89 45 e4 mov %eax,-0x1c(%ebp)
if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
80100c9d: 8b 45 e4 mov -0x1c(%ebp),%eax
80100ca0: 05 00 20 00 00 add $0x2000,%eax
80100ca5: 89 44 24 08 mov %eax,0x8(%esp)
80100ca9: 8b 45 e4 mov -0x1c(%ebp),%eax
80100cac: 89 44 24 04 mov %eax,0x4(%esp)
80100cb0: 8b 45 f0 mov -0x10(%ebp),%eax
80100cb3: 89 04 24 mov %eax,(%esp)
80100cb6: e8 be 74 00 00 call 80108179 <allocuvm>
80100cbb: 89 45 e4 mov %eax,-0x1c(%ebp)
80100cbe: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
80100cc2: 0f 84 0a 02 00 00 je 80100ed2 <exec+0x3da>
goto bad;
proc->pstack = (uint *)sz;
80100cc8: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100cce: 8b 55 e4 mov -0x1c(%ebp),%edx
80100cd1: 89 50 7c mov %edx,0x7c(%eax)
clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
80100cd4: 8b 45 e4 mov -0x1c(%ebp),%eax
80100cd7: 2d 00 20 00 00 sub $0x2000,%eax
80100cdc: 89 44 24 04 mov %eax,0x4(%esp)
80100ce0: 8b 45 f0 mov -0x10(%ebp),%eax
80100ce3: 89 04 24 mov %eax,(%esp)
80100ce6: e8 b2 76 00 00 call 8010839d <clearpteu>
sp = sz;
80100ceb: 8b 45 e4 mov -0x1c(%ebp),%eax
80100cee: 89 45 e8 mov %eax,-0x18(%ebp)
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
80100cf1: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp)
80100cf8: e9 81 00 00 00 jmp 80100d7e <exec+0x286>
if(argc >= MAXARG)
80100cfd: 83 7d e0 1f cmpl $0x1f,-0x20(%ebp)
80100d01: 0f 87 ce 01 00 00 ja 80100ed5 <exec+0x3dd>
goto bad;
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100d07: 8b 45 e0 mov -0x20(%ebp),%eax
80100d0a: c1 e0 02 shl $0x2,%eax
80100d0d: 03 45 0c add 0xc(%ebp),%eax
80100d10: 8b 00 mov (%eax),%eax
80100d12: 89 04 24 mov %eax,(%esp)
80100d15: e8 21 47 00 00 call 8010543b <strlen>
80100d1a: f7 d0 not %eax
80100d1c: 03 45 e8 add -0x18(%ebp),%eax
80100d1f: 83 e0 fc and $0xfffffffc,%eax
80100d22: 89 45 e8 mov %eax,-0x18(%ebp)
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100d25: 8b 45 e0 mov -0x20(%ebp),%eax
80100d28: c1 e0 02 shl $0x2,%eax
80100d2b: 03 45 0c add 0xc(%ebp),%eax
80100d2e: 8b 00 mov (%eax),%eax
80100d30: 89 04 24 mov %eax,(%esp)
80100d33: e8 03 47 00 00 call 8010543b <strlen>
80100d38: 83 c0 01 add $0x1,%eax
80100d3b: 89 c2 mov %eax,%edx
80100d3d: 8b 45 e0 mov -0x20(%ebp),%eax
80100d40: c1 e0 02 shl $0x2,%eax
80100d43: 03 45 0c add 0xc(%ebp),%eax
80100d46: 8b 00 mov (%eax),%eax
80100d48: 89 54 24 0c mov %edx,0xc(%esp)
80100d4c: 89 44 24 08 mov %eax,0x8(%esp)
80100d50: 8b 45 e8 mov -0x18(%ebp),%eax
80100d53: 89 44 24 04 mov %eax,0x4(%esp)
80100d57: 8b 45 f0 mov -0x10(%ebp),%eax
80100d5a: 89 04 24 mov %eax,(%esp)
80100d5d: e8 00 78 00 00 call 80108562 <copyout>
80100d62: 85 c0 test %eax,%eax
80100d64: 0f 88 6e 01 00 00 js 80100ed8 <exec+0x3e0>
goto bad;
ustack[3+argc] = sp;
80100d6a: 8b 45 e0 mov -0x20(%ebp),%eax
80100d6d: 8d 50 03 lea 0x3(%eax),%edx
80100d70: 8b 45 e8 mov -0x18(%ebp),%eax
80100d73: 89 84 95 40 ff ff ff mov %eax,-0xc0(%ebp,%edx,4)
clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
80100d7a: 83 45 e0 01 addl $0x1,-0x20(%ebp)
80100d7e: 8b 45 e0 mov -0x20(%ebp),%eax
80100d81: c1 e0 02 shl $0x2,%eax
80100d84: 03 45 0c add 0xc(%ebp),%eax
80100d87: 8b 00 mov (%eax),%eax
80100d89: 85 c0 test %eax,%eax
80100d8b: 0f 85 6c ff ff ff jne 80100cfd <exec+0x205>
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
goto bad;
ustack[3+argc] = sp;
}
ustack[3+argc] = 0;
80100d91: 8b 45 e0 mov -0x20(%ebp),%eax
80100d94: 83 c0 03 add $0x3,%eax
80100d97: c7 84 85 40 ff ff ff movl $0x0,-0xc0(%ebp,%eax,4)
80100d9e: 00 00 00 00
ustack[0] = 0xffffffff; // fake return PC
80100da2: c7 85 40 ff ff ff ff movl $0xffffffff,-0xc0(%ebp)
80100da9: ff ff ff
ustack[1] = argc;
80100dac: 8b 45 e0 mov -0x20(%ebp),%eax
80100daf: 89 85 44 ff ff ff mov %eax,-0xbc(%ebp)
ustack[2] = sp - (argc+1)*4; // argv pointer
80100db5: 8b 45 e0 mov -0x20(%ebp),%eax
80100db8: 83 c0 01 add $0x1,%eax
80100dbb: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
80100dc2: 8b 45 e8 mov -0x18(%ebp),%eax
80100dc5: 29 d0 sub %edx,%eax
80100dc7: 89 85 48 ff ff ff mov %eax,-0xb8(%ebp)
sp -= (3+argc+1) * 4;
80100dcd: 8b 45 e0 mov -0x20(%ebp),%eax
80100dd0: 83 c0 04 add $0x4,%eax
80100dd3: c1 e0 02 shl $0x2,%eax
80100dd6: 29 45 e8 sub %eax,-0x18(%ebp)
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100dd9: 8b 45 e0 mov -0x20(%ebp),%eax
80100ddc: 83 c0 04 add $0x4,%eax
80100ddf: c1 e0 02 shl $0x2,%eax
80100de2: 89 44 24 0c mov %eax,0xc(%esp)
80100de6: 8d 85 40 ff ff ff lea -0xc0(%ebp),%eax
80100dec: 89 44 24 08 mov %eax,0x8(%esp)
80100df0: 8b 45 e8 mov -0x18(%ebp),%eax
80100df3: 89 44 24 04 mov %eax,0x4(%esp)
80100df7: 8b 45 f0 mov -0x10(%ebp),%eax
80100dfa: 89 04 24 mov %eax,(%esp)
80100dfd: e8 60 77 00 00 call 80108562 <copyout>
80100e02: 85 c0 test %eax,%eax
80100e04: 0f 88 d1 00 00 00 js 80100edb <exec+0x3e3>
goto bad;
// Save program name for debugging.
for(last=s=path; *s; s++)
80100e0a: 8b 45 08 mov 0x8(%ebp),%eax
80100e0d: 89 45 d0 mov %eax,-0x30(%ebp)
80100e10: 8b 45 d0 mov -0x30(%ebp),%eax
80100e13: 89 45 d4 mov %eax,-0x2c(%ebp)
80100e16: eb 17 jmp 80100e2f <exec+0x337>
if(*s == '/')
80100e18: 8b 45 d0 mov -0x30(%ebp),%eax
80100e1b: 0f b6 00 movzbl (%eax),%eax
80100e1e: 3c 2f cmp $0x2f,%al
80100e20: 75 09 jne 80100e2b <exec+0x333>
last = s+1;
80100e22: 8b 45 d0 mov -0x30(%ebp),%eax
80100e25: 83 c0 01 add $0x1,%eax
80100e28: 89 45 d4 mov %eax,-0x2c(%ebp)
sp -= (3+argc+1) * 4;
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
goto bad;
// Save program name for debugging.
for(last=s=path; *s; s++)
80100e2b: 83 45 d0 01 addl $0x1,-0x30(%ebp)
80100e2f: 8b 45 d0 mov -0x30(%ebp),%eax
80100e32: 0f b6 00 movzbl (%eax),%eax
80100e35: 84 c0 test %al,%al
80100e37: 75 df jne 80100e18 <exec+0x320>
if(*s == '/')
last = s+1;
safestrcpy(proc->name, last, sizeof(proc->name));
80100e39: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e3f: 8d 50 6c lea 0x6c(%eax),%edx
80100e42: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80100e49: 00
80100e4a: 8b 45 d4 mov -0x2c(%ebp),%eax
80100e4d: 89 44 24 04 mov %eax,0x4(%esp)
80100e51: 89 14 24 mov %edx,(%esp)
80100e54: e8 94 45 00 00 call 801053ed <safestrcpy>
// Commit to the user image.
oldpgdir = proc->pgdir;
80100e59: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e5f: 8b 40 04 mov 0x4(%eax),%eax
80100e62: 89 45 f4 mov %eax,-0xc(%ebp)
proc->pgdir = pgdir;
80100e65: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e6b: 8b 55 f0 mov -0x10(%ebp),%edx
80100e6e: 89 50 04 mov %edx,0x4(%eax)
proc->sz = sz;
80100e71: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e77: 8b 55 e4 mov -0x1c(%ebp),%edx
80100e7a: 89 10 mov %edx,(%eax)
proc->tf->eip = elf.entry; // main
80100e7c: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e82: 8b 40 18 mov 0x18(%eax),%eax
80100e85: 8b 95 24 ff ff ff mov -0xdc(%ebp),%edx
80100e8b: 89 50 38 mov %edx,0x38(%eax)
proc->tf->esp = sp;
80100e8e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e94: 8b 40 18 mov 0x18(%eax),%eax
80100e97: 8b 55 e8 mov -0x18(%ebp),%edx
80100e9a: 89 50 44 mov %edx,0x44(%eax)
switchuvm(proc);
80100e9d: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100ea3: 89 04 24 mov %eax,(%esp)
80100ea6: e8 ec 6f 00 00 call 80107e97 <switchuvm>
freevm(oldpgdir);
80100eab: 8b 45 f4 mov -0xc(%ebp),%eax
80100eae: 89 04 24 mov %eax,(%esp)
80100eb1: e8 59 74 00 00 call 8010830f <freevm>
return 0;
80100eb6: b8 00 00 00 00 mov $0x0,%eax
80100ebb: eb 46 jmp 80100f03 <exec+0x40b>
ilock(ip);
pgdir = 0;
// Check ELF header
if(readi(ip, (char*)&elf, 0, sizeof(elf)) < sizeof(elf))
goto bad;
80100ebd: 90 nop
80100ebe: eb 1c jmp 80100edc <exec+0x3e4>
if(elf.magic != ELF_MAGIC)
goto bad;
80100ec0: 90 nop
80100ec1: eb 19 jmp 80100edc <exec+0x3e4>
if((pgdir = setupkvm()) == 0)
goto bad;
80100ec3: 90 nop
80100ec4: eb 16 jmp 80100edc <exec+0x3e4>
// Load program into memory.
sz = 0;
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
goto bad;
80100ec6: 90 nop
80100ec7: eb 13 jmp 80100edc <exec+0x3e4>
if(ph.type != ELF_PROG_LOAD)
continue;
if(ph.memsz < ph.filesz)
goto bad;
80100ec9: 90 nop
80100eca: eb 10 jmp 80100edc <exec+0x3e4>
if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
goto bad;
80100ecc: 90 nop
80100ecd: eb 0d jmp 80100edc <exec+0x3e4>
if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
goto bad;
80100ecf: 90 nop
80100ed0: eb 0a jmp 80100edc <exec+0x3e4>
// Allocate two pages at the next page boundary.
// Make the first inaccessible. Use the second as the user stack.
sz = PGROUNDUP(sz);
if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
goto bad;
80100ed2: 90 nop
80100ed3: eb 07 jmp 80100edc <exec+0x3e4>
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
if(argc >= MAXARG)
goto bad;
80100ed5: 90 nop
80100ed6: eb 04 jmp 80100edc <exec+0x3e4>
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
goto bad;
80100ed8: 90 nop
80100ed9: eb 01 jmp 80100edc <exec+0x3e4>
ustack[1] = argc;
ustack[2] = sp - (argc+1)*4; // argv pointer
sp -= (3+argc+1) * 4;
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
goto bad;
80100edb: 90 nop
switchuvm(proc);
freevm(oldpgdir);
return 0;
bad:
if(pgdir)
80100edc: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80100ee0: 74 0b je 80100eed <exec+0x3f5>
freevm(pgdir);
80100ee2: 8b 45 f0 mov -0x10(%ebp),%eax
80100ee5: 89 04 24 mov %eax,(%esp)
80100ee8: e8 22 74 00 00 call 8010830f <freevm>
if(ip)
80100eed: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80100ef1: 74 0b je 80100efe <exec+0x406>
iunlockput(ip);
80100ef3: 8b 45 ec mov -0x14(%ebp),%eax
80100ef6: 89 04 24 mov %eax,(%esp)
80100ef9: e8 04 0c 00 00 call 80101b02 <iunlockput>
return -1;
80100efe: b8 ff ff ff ff mov $0xffffffff,%eax
}
80100f03: c9 leave
80100f04: c3 ret
80100f05: 00 00 add %al,(%eax)
...
80100f08 <fileinit>:
struct file file[NFILE];
} ftable;
void
fileinit(void)
{
80100f08: 55 push %ebp
80100f09: 89 e5 mov %esp,%ebp
80100f0b: 83 ec 18 sub $0x18,%esp
initlock(&ftable.lock, "ftable");
80100f0e: c7 44 24 04 69 86 10 movl $0x80108669,0x4(%esp)
80100f15: 80
80100f16: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100f1d: e8 28 40 00 00 call 80104f4a <initlock>
}
80100f22: c9 leave
80100f23: c3 ret
80100f24 <filealloc>:
// Allocate a file structure.
struct file*
filealloc(void)
{
80100f24: 55 push %ebp
80100f25: 89 e5 mov %esp,%ebp
80100f27: 83 ec 28 sub $0x28,%esp
struct file *f;
acquire(&ftable.lock);
80100f2a: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100f31: e8 35 40 00 00 call 80104f6b <acquire>
for(f = ftable.file; f < ftable.file + NFILE; f++){
80100f36: c7 45 f4 b4 de 10 80 movl $0x8010deb4,-0xc(%ebp)
80100f3d: eb 29 jmp 80100f68 <filealloc+0x44>
if(f->ref == 0){
80100f3f: 8b 45 f4 mov -0xc(%ebp),%eax
80100f42: 8b 40 04 mov 0x4(%eax),%eax
80100f45: 85 c0 test %eax,%eax
80100f47: 75 1b jne 80100f64 <filealloc+0x40>
f->ref = 1;
80100f49: 8b 45 f4 mov -0xc(%ebp),%eax
80100f4c: c7 40 04 01 00 00 00 movl $0x1,0x4(%eax)
release(&ftable.lock);
80100f53: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100f5a: e8 6d 40 00 00 call 80104fcc <release>
return f;
80100f5f: 8b 45 f4 mov -0xc(%ebp),%eax
80100f62: eb 1f jmp 80100f83 <filealloc+0x5f>
filealloc(void)
{
struct file *f;
acquire(&ftable.lock);
for(f = ftable.file; f < ftable.file + NFILE; f++){
80100f64: 83 45 f4 18 addl $0x18,-0xc(%ebp)
80100f68: b8 14 e8 10 80 mov $0x8010e814,%eax
80100f6d: 39 45 f4 cmp %eax,-0xc(%ebp)
80100f70: 72 cd jb 80100f3f <filealloc+0x1b>
f->ref = 1;
release(&ftable.lock);
return f;
}
}
release(&ftable.lock);
80100f72: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100f79: e8 4e 40 00 00 call 80104fcc <release>
return 0;
80100f7e: b8 00 00 00 00 mov $0x0,%eax
}
80100f83: c9 leave
80100f84: c3 ret
80100f85 <filedup>:
// Increment ref count for file f.
struct file*
filedup(struct file *f)
{
80100f85: 55 push %ebp
80100f86: 89 e5 mov %esp,%ebp
80100f88: 83 ec 18 sub $0x18,%esp
acquire(&ftable.lock);
80100f8b: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100f92: e8 d4 3f 00 00 call 80104f6b <acquire>
if(f->ref < 1)
80100f97: 8b 45 08 mov 0x8(%ebp),%eax
80100f9a: 8b 40 04 mov 0x4(%eax),%eax
80100f9d: 85 c0 test %eax,%eax
80100f9f: 7f 0c jg 80100fad <filedup+0x28>
panic("filedup");
80100fa1: c7 04 24 70 86 10 80 movl $0x80108670,(%esp)
80100fa8: e8 8d f5 ff ff call 8010053a <panic>
f->ref++;
80100fad: 8b 45 08 mov 0x8(%ebp),%eax
80100fb0: 8b 40 04 mov 0x4(%eax),%eax
80100fb3: 8d 50 01 lea 0x1(%eax),%edx
80100fb6: 8b 45 08 mov 0x8(%ebp),%eax
80100fb9: 89 50 04 mov %edx,0x4(%eax)
release(&ftable.lock);
80100fbc: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100fc3: e8 04 40 00 00 call 80104fcc <release>
return f;
80100fc8: 8b 45 08 mov 0x8(%ebp),%eax
}
80100fcb: c9 leave
80100fcc: c3 ret
80100fcd <fileclose>:
// Close file f. (Decrement ref count, close when reaches 0.)
void
fileclose(struct file *f)
{
80100fcd: 55 push %ebp
80100fce: 89 e5 mov %esp,%ebp
80100fd0: 83 ec 38 sub $0x38,%esp
struct file ff;
acquire(&ftable.lock);
80100fd3: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100fda: e8 8c 3f 00 00 call 80104f6b <acquire>
if(f->ref < 1)
80100fdf: 8b 45 08 mov 0x8(%ebp),%eax
80100fe2: 8b 40 04 mov 0x4(%eax),%eax
80100fe5: 85 c0 test %eax,%eax
80100fe7: 7f 0c jg 80100ff5 <fileclose+0x28>
panic("fileclose");
80100fe9: c7 04 24 78 86 10 80 movl $0x80108678,(%esp)
80100ff0: e8 45 f5 ff ff call 8010053a <panic>
if(--f->ref > 0){
80100ff5: 8b 45 08 mov 0x8(%ebp),%eax
80100ff8: 8b 40 04 mov 0x4(%eax),%eax
80100ffb: 8d 50 ff lea -0x1(%eax),%edx
80100ffe: 8b 45 08 mov 0x8(%ebp),%eax
80101001: 89 50 04 mov %edx,0x4(%eax)
80101004: 8b 45 08 mov 0x8(%ebp),%eax
80101007: 8b 40 04 mov 0x4(%eax),%eax
8010100a: 85 c0 test %eax,%eax
8010100c: 7e 11 jle 8010101f <fileclose+0x52>
release(&ftable.lock);
8010100e: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80101015: e8 b2 3f 00 00 call 80104fcc <release>
return;
8010101a: e9 82 00 00 00 jmp 801010a1 <fileclose+0xd4>
}
ff = *f;
8010101f: 8b 45 08 mov 0x8(%ebp),%eax
80101022: 8b 10 mov (%eax),%edx
80101024: 89 55 e0 mov %edx,-0x20(%ebp)
80101027: 8b 50 04 mov 0x4(%eax),%edx
8010102a: 89 55 e4 mov %edx,-0x1c(%ebp)
8010102d: 8b 50 08 mov 0x8(%eax),%edx
80101030: 89 55 e8 mov %edx,-0x18(%ebp)
80101033: 8b 50 0c mov 0xc(%eax),%edx
80101036: 89 55 ec mov %edx,-0x14(%ebp)
80101039: 8b 50 10 mov 0x10(%eax),%edx
8010103c: 89 55 f0 mov %edx,-0x10(%ebp)
8010103f: 8b 40 14 mov 0x14(%eax),%eax
80101042: 89 45 f4 mov %eax,-0xc(%ebp)
f->ref = 0;
80101045: 8b 45 08 mov 0x8(%ebp),%eax
80101048: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
f->type = FD_NONE;
8010104f: 8b 45 08 mov 0x8(%ebp),%eax
80101052: c7 00 00 00 00 00 movl $0x0,(%eax)
release(&ftable.lock);
80101058: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
8010105f: e8 68 3f 00 00 call 80104fcc <release>
if(ff.type == FD_PIPE)
80101064: 8b 45 e0 mov -0x20(%ebp),%eax
80101067: 83 f8 01 cmp $0x1,%eax
8010106a: 75 18 jne 80101084 <fileclose+0xb7>
pipeclose(ff.pipe, ff.writable);
8010106c: 0f b6 45 e9 movzbl -0x17(%ebp),%eax
80101070: 0f be d0 movsbl %al,%edx
80101073: 8b 45 ec mov -0x14(%ebp),%eax
80101076: 89 54 24 04 mov %edx,0x4(%esp)
8010107a: 89 04 24 mov %eax,(%esp)
8010107d: e8 c5 2c 00 00 call 80103d47 <pipeclose>
80101082: eb 1d jmp 801010a1 <fileclose+0xd4>
else if(ff.type == FD_INODE){
80101084: 8b 45 e0 mov -0x20(%ebp),%eax
80101087: 83 f8 02 cmp $0x2,%eax
8010108a: 75 15 jne 801010a1 <fileclose+0xd4>
begin_trans();
8010108c: e8 81 21 00 00 call 80103212 <begin_trans>
iput(ff.ip);
80101091: 8b 45 f0 mov -0x10(%ebp),%eax
80101094: 89 04 24 mov %eax,(%esp)
80101097: e8 95 09 00 00 call 80101a31 <iput>
commit_trans();
8010109c: e8 ba 21 00 00 call 8010325b <commit_trans>
}
}
801010a1: c9 leave
801010a2: c3 ret
801010a3 <filestat>:
// Get metadata about file f.
int
filestat(struct file *f, struct stat *st)
{
801010a3: 55 push %ebp
801010a4: 89 e5 mov %esp,%ebp
801010a6: 83 ec 18 sub $0x18,%esp
if(f->type == FD_INODE){
801010a9: 8b 45 08 mov 0x8(%ebp),%eax
801010ac: 8b 00 mov (%eax),%eax
801010ae: 83 f8 02 cmp $0x2,%eax
801010b1: 75 38 jne 801010eb <filestat+0x48>
ilock(f->ip);
801010b3: 8b 45 08 mov 0x8(%ebp),%eax
801010b6: 8b 40 10 mov 0x10(%eax),%eax
801010b9: 89 04 24 mov %eax,(%esp)
801010bc: e8 ba 07 00 00 call 8010187b <ilock>
stati(f->ip, st);
801010c1: 8b 45 08 mov 0x8(%ebp),%eax
801010c4: 8b 40 10 mov 0x10(%eax),%eax
801010c7: 8b 55 0c mov 0xc(%ebp),%edx
801010ca: 89 54 24 04 mov %edx,0x4(%esp)
801010ce: 89 04 24 mov %eax,(%esp)
801010d1: e8 59 0c 00 00 call 80101d2f <stati>
iunlock(f->ip);
801010d6: 8b 45 08 mov 0x8(%ebp),%eax
801010d9: 8b 40 10 mov 0x10(%eax),%eax
801010dc: 89 04 24 mov %eax,(%esp)
801010df: e8 e8 08 00 00 call 801019cc <iunlock>
return 0;
801010e4: b8 00 00 00 00 mov $0x0,%eax
801010e9: eb 05 jmp 801010f0 <filestat+0x4d>
}
return -1;
801010eb: b8 ff ff ff ff mov $0xffffffff,%eax
}
801010f0: c9 leave
801010f1: c3 ret
801010f2 <fileread>:
// Read from file f.
int
fileread(struct file *f, char *addr, int n)
{
801010f2: 55 push %ebp
801010f3: 89 e5 mov %esp,%ebp
801010f5: 83 ec 28 sub $0x28,%esp
int r;
if(f->readable == 0)
801010f8: 8b 45 08 mov 0x8(%ebp),%eax
801010fb: 0f b6 40 08 movzbl 0x8(%eax),%eax
801010ff: 84 c0 test %al,%al
80101101: 75 0a jne 8010110d <fileread+0x1b>
return -1;
80101103: b8 ff ff ff ff mov $0xffffffff,%eax
80101108: e9 9f 00 00 00 jmp 801011ac <fileread+0xba>
if(f->type == FD_PIPE)
8010110d: 8b 45 08 mov 0x8(%ebp),%eax
80101110: 8b 00 mov (%eax),%eax
80101112: 83 f8 01 cmp $0x1,%eax
80101115: 75 1e jne 80101135 <fileread+0x43>
return piperead(f->pipe, addr, n);
80101117: 8b 45 08 mov 0x8(%ebp),%eax
8010111a: 8b 40 0c mov 0xc(%eax),%eax
8010111d: 8b 55 10 mov 0x10(%ebp),%edx
80101120: 89 54 24 08 mov %edx,0x8(%esp)
80101124: 8b 55 0c mov 0xc(%ebp),%edx
80101127: 89 54 24 04 mov %edx,0x4(%esp)
8010112b: 89 04 24 mov %eax,(%esp)
8010112e: e8 96 2d 00 00 call 80103ec9 <piperead>
80101133: eb 77 jmp 801011ac <fileread+0xba>
if(f->type == FD_INODE){
80101135: 8b 45 08 mov 0x8(%ebp),%eax
80101138: 8b 00 mov (%eax),%eax
8010113a: 83 f8 02 cmp $0x2,%eax
8010113d: 75 61 jne 801011a0 <fileread+0xae>
ilock(f->ip);
8010113f: 8b 45 08 mov 0x8(%ebp),%eax
80101142: 8b 40 10 mov 0x10(%eax),%eax
80101145: 89 04 24 mov %eax,(%esp)
80101148: e8 2e 07 00 00 call 8010187b <ilock>
if((r = readi(f->ip, addr, f->off, n)) > 0)
8010114d: 8b 4d 10 mov 0x10(%ebp),%ecx
80101150: 8b 45 08 mov 0x8(%ebp),%eax
80101153: 8b 50 14 mov 0x14(%eax),%edx
80101156: 8b 45 08 mov 0x8(%ebp),%eax
80101159: 8b 40 10 mov 0x10(%eax),%eax
8010115c: 89 4c 24 0c mov %ecx,0xc(%esp)
80101160: 89 54 24 08 mov %edx,0x8(%esp)
80101164: 8b 55 0c mov 0xc(%ebp),%edx
80101167: 89 54 24 04 mov %edx,0x4(%esp)
8010116b: 89 04 24 mov %eax,(%esp)
8010116e: e8 01 0c 00 00 call 80101d74 <readi>
80101173: 89 45 f4 mov %eax,-0xc(%ebp)
80101176: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8010117a: 7e 11 jle 8010118d <fileread+0x9b>
f->off += r;
8010117c: 8b 45 08 mov 0x8(%ebp),%eax
8010117f: 8b 50 14 mov 0x14(%eax),%edx
80101182: 8b 45 f4 mov -0xc(%ebp),%eax
80101185: 01 c2 add %eax,%edx
80101187: 8b 45 08 mov 0x8(%ebp),%eax
8010118a: 89 50 14 mov %edx,0x14(%eax)
iunlock(f->ip);
8010118d: 8b 45 08 mov 0x8(%ebp),%eax
80101190: 8b 40 10 mov 0x10(%eax),%eax
80101193: 89 04 24 mov %eax,(%esp)
80101196: e8 31 08 00 00 call 801019cc <iunlock>
return r;
8010119b: 8b 45 f4 mov -0xc(%ebp),%eax
8010119e: eb 0c jmp 801011ac <fileread+0xba>
}
panic("fileread");
801011a0: c7 04 24 82 86 10 80 movl $0x80108682,(%esp)
801011a7: e8 8e f3 ff ff call 8010053a <panic>
}
801011ac: c9 leave
801011ad: c3 ret
801011ae <filewrite>:
//PAGEBREAK!
// Write to file f.
int
filewrite(struct file *f, char *addr, int n)
{
801011ae: 55 push %ebp
801011af: 89 e5 mov %esp,%ebp
801011b1: 53 push %ebx
801011b2: 83 ec 24 sub $0x24,%esp
int r;
if(f->writable == 0)
801011b5: 8b 45 08 mov 0x8(%ebp),%eax
801011b8: 0f b6 40 09 movzbl 0x9(%eax),%eax
801011bc: 84 c0 test %al,%al
801011be: 75 0a jne 801011ca <filewrite+0x1c>
return -1;
801011c0: b8 ff ff ff ff mov $0xffffffff,%eax
801011c5: e9 23 01 00 00 jmp 801012ed <filewrite+0x13f>
if(f->type == FD_PIPE)
801011ca: 8b 45 08 mov 0x8(%ebp),%eax
801011cd: 8b 00 mov (%eax),%eax
801011cf: 83 f8 01 cmp $0x1,%eax
801011d2: 75 21 jne 801011f5 <filewrite+0x47>
return pipewrite(f->pipe, addr, n);
801011d4: 8b 45 08 mov 0x8(%ebp),%eax
801011d7: 8b 40 0c mov 0xc(%eax),%eax
801011da: 8b 55 10 mov 0x10(%ebp),%edx
801011dd: 89 54 24 08 mov %edx,0x8(%esp)
801011e1: 8b 55 0c mov 0xc(%ebp),%edx
801011e4: 89 54 24 04 mov %edx,0x4(%esp)
801011e8: 89 04 24 mov %eax,(%esp)
801011eb: e8 e9 2b 00 00 call 80103dd9 <pipewrite>
801011f0: e9 f8 00 00 00 jmp 801012ed <filewrite+0x13f>
if(f->type == FD_INODE){
801011f5: 8b 45 08 mov 0x8(%ebp),%eax
801011f8: 8b 00 mov (%eax),%eax
801011fa: 83 f8 02 cmp $0x2,%eax
801011fd: 0f 85 de 00 00 00 jne 801012e1 <filewrite+0x133>
// the maximum log transaction size, including
// i-node, indirect block, allocation blocks,
// and 2 blocks of slop for non-aligned writes.
// this really belongs lower down, since writei()
// might be writing a device like the console.
int max = ((LOGSIZE-1-1-2) / 2) * 512;
80101203: c7 45 ec 00 06 00 00 movl $0x600,-0x14(%ebp)
int i = 0;
8010120a: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
while(i < n){
80101211: e9 a8 00 00 00 jmp 801012be <filewrite+0x110>
int n1 = n - i;
80101216: 8b 45 f0 mov -0x10(%ebp),%eax
80101219: 8b 55 10 mov 0x10(%ebp),%edx
8010121c: 89 d1 mov %edx,%ecx
8010121e: 29 c1 sub %eax,%ecx
80101220: 89 c8 mov %ecx,%eax
80101222: 89 45 f4 mov %eax,-0xc(%ebp)
if(n1 > max)
80101225: 8b 45 f4 mov -0xc(%ebp),%eax
80101228: 3b 45 ec cmp -0x14(%ebp),%eax
8010122b: 7e 06 jle 80101233 <filewrite+0x85>
n1 = max;
8010122d: 8b 45 ec mov -0x14(%ebp),%eax
80101230: 89 45 f4 mov %eax,-0xc(%ebp)
begin_trans();
80101233: e8 da 1f 00 00 call 80103212 <begin_trans>
ilock(f->ip);
80101238: 8b 45 08 mov 0x8(%ebp),%eax
8010123b: 8b 40 10 mov 0x10(%eax),%eax
8010123e: 89 04 24 mov %eax,(%esp)
80101241: e8 35 06 00 00 call 8010187b <ilock>
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
80101246: 8b 5d f4 mov -0xc(%ebp),%ebx
80101249: 8b 45 08 mov 0x8(%ebp),%eax
8010124c: 8b 48 14 mov 0x14(%eax),%ecx
8010124f: 8b 45 f0 mov -0x10(%ebp),%eax
80101252: 89 c2 mov %eax,%edx
80101254: 03 55 0c add 0xc(%ebp),%edx
80101257: 8b 45 08 mov 0x8(%ebp),%eax
8010125a: 8b 40 10 mov 0x10(%eax),%eax
8010125d: 89 5c 24 0c mov %ebx,0xc(%esp)
80101261: 89 4c 24 08 mov %ecx,0x8(%esp)
80101265: 89 54 24 04 mov %edx,0x4(%esp)
80101269: 89 04 24 mov %eax,(%esp)
8010126c: e8 6f 0c 00 00 call 80101ee0 <writei>
80101271: 89 45 e8 mov %eax,-0x18(%ebp)
80101274: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
80101278: 7e 11 jle 8010128b <filewrite+0xdd>
f->off += r;
8010127a: 8b 45 08 mov 0x8(%ebp),%eax
8010127d: 8b 50 14 mov 0x14(%eax),%edx
80101280: 8b 45 e8 mov -0x18(%ebp),%eax
80101283: 01 c2 add %eax,%edx
80101285: 8b 45 08 mov 0x8(%ebp),%eax
80101288: 89 50 14 mov %edx,0x14(%eax)
iunlock(f->ip);
8010128b: 8b 45 08 mov 0x8(%ebp),%eax
8010128e: 8b 40 10 mov 0x10(%eax),%eax
80101291: 89 04 24 mov %eax,(%esp)
80101294: e8 33 07 00 00 call 801019cc <iunlock>
commit_trans();
80101299: e8 bd 1f 00 00 call 8010325b <commit_trans>
if(r < 0)
8010129e: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
801012a2: 78 28 js 801012cc <filewrite+0x11e>
break;
if(r != n1)
801012a4: 8b 45 e8 mov -0x18(%ebp),%eax
801012a7: 3b 45 f4 cmp -0xc(%ebp),%eax
801012aa: 74 0c je 801012b8 <filewrite+0x10a>
panic("short filewrite");
801012ac: c7 04 24 8b 86 10 80 movl $0x8010868b,(%esp)
801012b3: e8 82 f2 ff ff call 8010053a <panic>
i += r;
801012b8: 8b 45 e8 mov -0x18(%ebp),%eax
801012bb: 01 45 f0 add %eax,-0x10(%ebp)
// and 2 blocks of slop for non-aligned writes.
// this really belongs lower down, since writei()
// might be writing a device like the console.
int max = ((LOGSIZE-1-1-2) / 2) * 512;
int i = 0;
while(i < n){
801012be: 8b 45 f0 mov -0x10(%ebp),%eax
801012c1: 3b 45 10 cmp 0x10(%ebp),%eax
801012c4: 0f 8c 4c ff ff ff jl 80101216 <filewrite+0x68>
801012ca: eb 01 jmp 801012cd <filewrite+0x11f>
f->off += r;
iunlock(f->ip);
commit_trans();
if(r < 0)
break;
801012cc: 90 nop
if(r != n1)
panic("short filewrite");
i += r;
}
return i == n ? n : -1;
801012cd: 8b 45 f0 mov -0x10(%ebp),%eax
801012d0: 3b 45 10 cmp 0x10(%ebp),%eax
801012d3: 75 05 jne 801012da <filewrite+0x12c>
801012d5: 8b 45 10 mov 0x10(%ebp),%eax
801012d8: eb 05 jmp 801012df <filewrite+0x131>
801012da: b8 ff ff ff ff mov $0xffffffff,%eax
801012df: eb 0c jmp 801012ed <filewrite+0x13f>
}
panic("filewrite");
801012e1: c7 04 24 9b 86 10 80 movl $0x8010869b,(%esp)
801012e8: e8 4d f2 ff ff call 8010053a <panic>
}
801012ed: 83 c4 24 add $0x24,%esp
801012f0: 5b pop %ebx
801012f1: 5d pop %ebp
801012f2: c3 ret
...
801012f4 <readsb>:
static void itrunc(struct inode*);
// Read the super block.
void
readsb(int dev, struct superblock *sb)
{
801012f4: 55 push %ebp
801012f5: 89 e5 mov %esp,%ebp
801012f7: 83 ec 28 sub $0x28,%esp
struct buf *bp;
bp = bread(dev, 1);
801012fa: 8b 45 08 mov 0x8(%ebp),%eax
801012fd: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80101304: 00
80101305: 89 04 24 mov %eax,(%esp)
80101308: e8 9a ee ff ff call 801001a7 <bread>
8010130d: 89 45 f4 mov %eax,-0xc(%ebp)
memmove(sb, bp->data, sizeof(*sb));
80101310: 8b 45 f4 mov -0xc(%ebp),%eax
80101313: 83 c0 18 add $0x18,%eax
80101316: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
8010131d: 00
8010131e: 89 44 24 04 mov %eax,0x4(%esp)
80101322: 8b 45 0c mov 0xc(%ebp),%eax
80101325: 89 04 24 mov %eax,(%esp)
80101328: e8 60 3f 00 00 call 8010528d <memmove>
brelse(bp);
8010132d: 8b 45 f4 mov -0xc(%ebp),%eax
80101330: 89 04 24 mov %eax,(%esp)
80101333: e8 e0 ee ff ff call 80100218 <brelse>
}
80101338: c9 leave
80101339: c3 ret
8010133a <bzero>:
// Zero a block.
static void
bzero(int dev, int bno)
{
8010133a: 55 push %ebp
8010133b: 89 e5 mov %esp,%ebp
8010133d: 83 ec 28 sub $0x28,%esp
struct buf *bp;
bp = bread(dev, bno);
80101340: 8b 55 0c mov 0xc(%ebp),%edx
80101343: 8b 45 08 mov 0x8(%ebp),%eax
80101346: 89 54 24 04 mov %edx,0x4(%esp)
8010134a: 89 04 24 mov %eax,(%esp)
8010134d: e8 55 ee ff ff call 801001a7 <bread>
80101352: 89 45 f4 mov %eax,-0xc(%ebp)
memset(bp->data, 0, BSIZE);
80101355: 8b 45 f4 mov -0xc(%ebp),%eax
80101358: 83 c0 18 add $0x18,%eax
8010135b: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
80101362: 00
80101363: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
8010136a: 00
8010136b: 89 04 24 mov %eax,(%esp)
8010136e: e8 47 3e 00 00 call 801051ba <memset>
log_write(bp);
80101373: 8b 45 f4 mov -0xc(%ebp),%eax
80101376: 89 04 24 mov %eax,(%esp)
80101379: e8 35 1f 00 00 call 801032b3 <log_write>
brelse(bp);
8010137e: 8b 45 f4 mov -0xc(%ebp),%eax
80101381: 89 04 24 mov %eax,(%esp)
80101384: e8 8f ee ff ff call 80100218 <brelse>
}
80101389: c9 leave
8010138a: c3 ret
8010138b <balloc>:
// Blocks.
// Allocate a zeroed disk block.
static uint
balloc(uint dev)
{
8010138b: 55 push %ebp
8010138c: 89 e5 mov %esp,%ebp
8010138e: 53 push %ebx
8010138f: 83 ec 34 sub $0x34,%esp
int b, bi, m;
struct buf *bp;
struct superblock sb;
bp = 0;
80101392: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
readsb(dev, &sb);
80101399: 8b 45 08 mov 0x8(%ebp),%eax
8010139c: 8d 55 d8 lea -0x28(%ebp),%edx
8010139f: 89 54 24 04 mov %edx,0x4(%esp)
801013a3: 89 04 24 mov %eax,(%esp)
801013a6: e8 49 ff ff ff call 801012f4 <readsb>
for(b = 0; b < sb.size; b += BPB){
801013ab: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp)
801013b2: e9 15 01 00 00 jmp 801014cc <balloc+0x141>
bp = bread(dev, BBLOCK(b, sb.ninodes));
801013b7: 8b 45 e8 mov -0x18(%ebp),%eax
801013ba: 8d 90 ff 0f 00 00 lea 0xfff(%eax),%edx
801013c0: 85 c0 test %eax,%eax
801013c2: 0f 48 c2 cmovs %edx,%eax
801013c5: c1 f8 0c sar $0xc,%eax
801013c8: 8b 55 e0 mov -0x20(%ebp),%edx
801013cb: c1 ea 03 shr $0x3,%edx
801013ce: 01 d0 add %edx,%eax
801013d0: 83 c0 03 add $0x3,%eax
801013d3: 89 44 24 04 mov %eax,0x4(%esp)
801013d7: 8b 45 08 mov 0x8(%ebp),%eax
801013da: 89 04 24 mov %eax,(%esp)
801013dd: e8 c5 ed ff ff call 801001a7 <bread>
801013e2: 89 45 f4 mov %eax,-0xc(%ebp)
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
801013e5: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
801013ec: e9 aa 00 00 00 jmp 8010149b <balloc+0x110>
m = 1 << (bi % 8);
801013f1: 8b 45 ec mov -0x14(%ebp),%eax
801013f4: 89 c2 mov %eax,%edx
801013f6: c1 fa 1f sar $0x1f,%edx
801013f9: c1 ea 1d shr $0x1d,%edx
801013fc: 01 d0 add %edx,%eax
801013fe: 83 e0 07 and $0x7,%eax
80101401: 29 d0 sub %edx,%eax
80101403: ba 01 00 00 00 mov $0x1,%edx
80101408: 89 d3 mov %edx,%ebx
8010140a: 89 c1 mov %eax,%ecx
8010140c: d3 e3 shl %cl,%ebx
8010140e: 89 d8 mov %ebx,%eax
80101410: 89 45 f0 mov %eax,-0x10(%ebp)
if((bp->data[bi/8] & m) == 0){ // Is block free?
80101413: 8b 45 ec mov -0x14(%ebp),%eax
80101416: 8d 50 07 lea 0x7(%eax),%edx
80101419: 85 c0 test %eax,%eax
8010141b: 0f 48 c2 cmovs %edx,%eax
8010141e: c1 f8 03 sar $0x3,%eax
80101421: 8b 55 f4 mov -0xc(%ebp),%edx
80101424: 0f b6 44 02 18 movzbl 0x18(%edx,%eax,1),%eax
80101429: 0f b6 c0 movzbl %al,%eax
8010142c: 23 45 f0 and -0x10(%ebp),%eax
8010142f: 85 c0 test %eax,%eax
80101431: 75 64 jne 80101497 <balloc+0x10c>
bp->data[bi/8] |= m; // Mark block in use.
80101433: 8b 45 ec mov -0x14(%ebp),%eax
80101436: 8d 50 07 lea 0x7(%eax),%edx
80101439: 85 c0 test %eax,%eax
8010143b: 0f 48 c2 cmovs %edx,%eax
8010143e: c1 f8 03 sar $0x3,%eax
80101441: 89 c2 mov %eax,%edx
80101443: 8b 4d f4 mov -0xc(%ebp),%ecx
80101446: 0f b6 44 01 18 movzbl 0x18(%ecx,%eax,1),%eax
8010144b: 89 c1 mov %eax,%ecx
8010144d: 8b 45 f0 mov -0x10(%ebp),%eax
80101450: 09 c8 or %ecx,%eax
80101452: 89 c1 mov %eax,%ecx
80101454: 8b 45 f4 mov -0xc(%ebp),%eax
80101457: 88 4c 10 18 mov %cl,0x18(%eax,%edx,1)
log_write(bp);
8010145b: 8b 45 f4 mov -0xc(%ebp),%eax
8010145e: 89 04 24 mov %eax,(%esp)
80101461: e8 4d 1e 00 00 call 801032b3 <log_write>
brelse(bp);
80101466: 8b 45 f4 mov -0xc(%ebp),%eax
80101469: 89 04 24 mov %eax,(%esp)
8010146c: e8 a7 ed ff ff call 80100218 <brelse>
bzero(dev, b + bi);
80101471: 8b 45 ec mov -0x14(%ebp),%eax
80101474: 8b 55 e8 mov -0x18(%ebp),%edx
80101477: 01 c2 add %eax,%edx
80101479: 8b 45 08 mov 0x8(%ebp),%eax
8010147c: 89 54 24 04 mov %edx,0x4(%esp)
80101480: 89 04 24 mov %eax,(%esp)
80101483: e8 b2 fe ff ff call 8010133a <bzero>
return b + bi;
80101488: 8b 45 ec mov -0x14(%ebp),%eax
8010148b: 8b 55 e8 mov -0x18(%ebp),%edx
8010148e: 8d 04 02 lea (%edx,%eax,1),%eax
}
}
brelse(bp);
}
panic("balloc: out of blocks");
}
80101491: 83 c4 34 add $0x34,%esp
80101494: 5b pop %ebx
80101495: 5d pop %ebp
80101496: c3 ret
bp = 0;
readsb(dev, &sb);
for(b = 0; b < sb.size; b += BPB){
bp = bread(dev, BBLOCK(b, sb.ninodes));
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
80101497: 83 45 ec 01 addl $0x1,-0x14(%ebp)
8010149b: 81 7d ec ff 0f 00 00 cmpl $0xfff,-0x14(%ebp)
801014a2: 7f 16 jg 801014ba <balloc+0x12f>
801014a4: 8b 45 ec mov -0x14(%ebp),%eax
801014a7: 8b 55 e8 mov -0x18(%ebp),%edx
801014aa: 8d 04 02 lea (%edx,%eax,1),%eax
801014ad: 89 c2 mov %eax,%edx
801014af: 8b 45 d8 mov -0x28(%ebp),%eax
801014b2: 39 c2 cmp %eax,%edx
801014b4: 0f 82 37 ff ff ff jb 801013f1 <balloc+0x66>
brelse(bp);
bzero(dev, b + bi);
return b + bi;
}
}
brelse(bp);
801014ba: 8b 45 f4 mov -0xc(%ebp),%eax
801014bd: 89 04 24 mov %eax,(%esp)
801014c0: e8 53 ed ff ff call 80100218 <brelse>
struct buf *bp;
struct superblock sb;
bp = 0;
readsb(dev, &sb);
for(b = 0; b < sb.size; b += BPB){
801014c5: 81 45 e8 00 10 00 00 addl $0x1000,-0x18(%ebp)
801014cc: 8b 55 e8 mov -0x18(%ebp),%edx
801014cf: 8b 45 d8 mov -0x28(%ebp),%eax
801014d2: 39 c2 cmp %eax,%edx
801014d4: 0f 82 dd fe ff ff jb 801013b7 <balloc+0x2c>
return b + bi;
}
}
brelse(bp);
}
panic("balloc: out of blocks");
801014da: c7 04 24 a5 86 10 80 movl $0x801086a5,(%esp)
801014e1: e8 54 f0 ff ff call 8010053a <panic>
801014e6 <bfree>:
}
// Free a disk block.
static void
bfree(int dev, uint b)
{
801014e6: 55 push %ebp
801014e7: 89 e5 mov %esp,%ebp
801014e9: 53 push %ebx
801014ea: 83 ec 34 sub $0x34,%esp
struct buf *bp;
struct superblock sb;
int bi, m;
readsb(dev, &sb);
801014ed: 8d 45 dc lea -0x24(%ebp),%eax
801014f0: 89 44 24 04 mov %eax,0x4(%esp)
801014f4: 8b 45 08 mov 0x8(%ebp),%eax
801014f7: 89 04 24 mov %eax,(%esp)
801014fa: e8 f5 fd ff ff call 801012f4 <readsb>
bp = bread(dev, BBLOCK(b, sb.ninodes));
801014ff: 8b 45 0c mov 0xc(%ebp),%eax
80101502: 89 c2 mov %eax,%edx
80101504: c1 ea 0c shr $0xc,%edx
80101507: 8b 45 e4 mov -0x1c(%ebp),%eax
8010150a: c1 e8 03 shr $0x3,%eax
8010150d: 8d 04 02 lea (%edx,%eax,1),%eax
80101510: 8d 50 03 lea 0x3(%eax),%edx
80101513: 8b 45 08 mov 0x8(%ebp),%eax
80101516: 89 54 24 04 mov %edx,0x4(%esp)
8010151a: 89 04 24 mov %eax,(%esp)
8010151d: e8 85 ec ff ff call 801001a7 <bread>
80101522: 89 45 ec mov %eax,-0x14(%ebp)
bi = b % BPB;
80101525: 8b 45 0c mov 0xc(%ebp),%eax
80101528: 25 ff 0f 00 00 and $0xfff,%eax
8010152d: 89 45 f0 mov %eax,-0x10(%ebp)
m = 1 << (bi % 8);
80101530: 8b 45 f0 mov -0x10(%ebp),%eax
80101533: 89 c2 mov %eax,%edx
80101535: c1 fa 1f sar $0x1f,%edx
80101538: c1 ea 1d shr $0x1d,%edx
8010153b: 01 d0 add %edx,%eax
8010153d: 83 e0 07 and $0x7,%eax
80101540: 29 d0 sub %edx,%eax
80101542: ba 01 00 00 00 mov $0x1,%edx
80101547: 89 d3 mov %edx,%ebx
80101549: 89 c1 mov %eax,%ecx
8010154b: d3 e3 shl %cl,%ebx
8010154d: 89 d8 mov %ebx,%eax
8010154f: 89 45 f4 mov %eax,-0xc(%ebp)
if((bp->data[bi/8] & m) == 0)
80101552: 8b 45 f0 mov -0x10(%ebp),%eax
80101555: 8d 50 07 lea 0x7(%eax),%edx
80101558: 85 c0 test %eax,%eax
8010155a: 0f 48 c2 cmovs %edx,%eax
8010155d: c1 f8 03 sar $0x3,%eax
80101560: 8b 55 ec mov -0x14(%ebp),%edx
80101563: 0f b6 44 02 18 movzbl 0x18(%edx,%eax,1),%eax
80101568: 0f b6 c0 movzbl %al,%eax
8010156b: 23 45 f4 and -0xc(%ebp),%eax
8010156e: 85 c0 test %eax,%eax
80101570: 75 0c jne 8010157e <bfree+0x98>
panic("freeing free block");
80101572: c7 04 24 bb 86 10 80 movl $0x801086bb,(%esp)
80101579: e8 bc ef ff ff call 8010053a <panic>
bp->data[bi/8] &= ~m;
8010157e: 8b 45 f0 mov -0x10(%ebp),%eax
80101581: 8d 50 07 lea 0x7(%eax),%edx
80101584: 85 c0 test %eax,%eax
80101586: 0f 48 c2 cmovs %edx,%eax
80101589: c1 f8 03 sar $0x3,%eax
8010158c: 89 c2 mov %eax,%edx
8010158e: 8b 4d ec mov -0x14(%ebp),%ecx
80101591: 0f b6 44 01 18 movzbl 0x18(%ecx,%eax,1),%eax
80101596: 8b 4d f4 mov -0xc(%ebp),%ecx
80101599: f7 d1 not %ecx
8010159b: 21 c8 and %ecx,%eax
8010159d: 89 c1 mov %eax,%ecx
8010159f: 8b 45 ec mov -0x14(%ebp),%eax
801015a2: 88 4c 10 18 mov %cl,0x18(%eax,%edx,1)
log_write(bp);
801015a6: 8b 45 ec mov -0x14(%ebp),%eax
801015a9: 89 04 24 mov %eax,(%esp)
801015ac: e8 02 1d 00 00 call 801032b3 <log_write>
brelse(bp);
801015b1: 8b 45 ec mov -0x14(%ebp),%eax
801015b4: 89 04 24 mov %eax,(%esp)
801015b7: e8 5c ec ff ff call 80100218 <brelse>
}
801015bc: 83 c4 34 add $0x34,%esp
801015bf: 5b pop %ebx
801015c0: 5d pop %ebp
801015c1: c3 ret
801015c2 <iinit>:
struct inode inode[NINODE];
} icache;
void
iinit(void)
{
801015c2: 55 push %ebp
801015c3: 89 e5 mov %esp,%ebp
801015c5: 83 ec 18 sub $0x18,%esp
initlock(&icache.lock, "icache");
801015c8: c7 44 24 04 ce 86 10 movl $0x801086ce,0x4(%esp)
801015cf: 80
801015d0: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
801015d7: e8 6e 39 00 00 call 80104f4a <initlock>
}
801015dc: c9 leave
801015dd: c3 ret
801015de <ialloc>:
//PAGEBREAK!
// Allocate a new inode with the given type on device dev.
// A free inode has a type of zero.
struct inode*
ialloc(uint dev, short type)
{
801015de: 55 push %ebp
801015df: 89 e5 mov %esp,%ebp
801015e1: 83 ec 48 sub $0x48,%esp
801015e4: 8b 45 0c mov 0xc(%ebp),%eax
801015e7: 66 89 45 d4 mov %ax,-0x2c(%ebp)
int inum;
struct buf *bp;
struct dinode *dip;
struct superblock sb;
readsb(dev, &sb);
801015eb: 8b 45 08 mov 0x8(%ebp),%eax
801015ee: 8d 55 dc lea -0x24(%ebp),%edx
801015f1: 89 54 24 04 mov %edx,0x4(%esp)
801015f5: 89 04 24 mov %eax,(%esp)
801015f8: e8 f7 fc ff ff call 801012f4 <readsb>
for(inum = 1; inum < sb.ninodes; inum++){
801015fd: c7 45 ec 01 00 00 00 movl $0x1,-0x14(%ebp)
80101604: e9 98 00 00 00 jmp 801016a1 <ialloc+0xc3>
bp = bread(dev, IBLOCK(inum));
80101609: 8b 45 ec mov -0x14(%ebp),%eax
8010160c: c1 e8 03 shr $0x3,%eax
8010160f: 83 c0 02 add $0x2,%eax
80101612: 89 44 24 04 mov %eax,0x4(%esp)
80101616: 8b 45 08 mov 0x8(%ebp),%eax
80101619: 89 04 24 mov %eax,(%esp)
8010161c: e8 86 eb ff ff call 801001a7 <bread>
80101621: 89 45 f0 mov %eax,-0x10(%ebp)
dip = (struct dinode*)bp->data + inum%IPB;
80101624: 8b 45 f0 mov -0x10(%ebp),%eax
80101627: 83 c0 18 add $0x18,%eax
8010162a: 8b 55 ec mov -0x14(%ebp),%edx
8010162d: 83 e2 07 and $0x7,%edx
80101630: c1 e2 06 shl $0x6,%edx
80101633: 01 d0 add %edx,%eax
80101635: 89 45 f4 mov %eax,-0xc(%ebp)
if(dip->type == 0){ // a free inode
80101638: 8b 45 f4 mov -0xc(%ebp),%eax
8010163b: 0f b7 00 movzwl (%eax),%eax
8010163e: 66 85 c0 test %ax,%ax
80101641: 75 4f jne 80101692 <ialloc+0xb4>
memset(dip, 0, sizeof(*dip));
80101643: c7 44 24 08 40 00 00 movl $0x40,0x8(%esp)
8010164a: 00
8010164b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80101652: 00
80101653: 8b 45 f4 mov -0xc(%ebp),%eax
80101656: 89 04 24 mov %eax,(%esp)
80101659: e8 5c 3b 00 00 call 801051ba <memset>
dip->type = type;
8010165e: 8b 45 f4 mov -0xc(%ebp),%eax
80101661: 0f b7 55 d4 movzwl -0x2c(%ebp),%edx
80101665: 66 89 10 mov %dx,(%eax)
log_write(bp); // mark it allocated on the disk
80101668: 8b 45 f0 mov -0x10(%ebp),%eax
8010166b: 89 04 24 mov %eax,(%esp)
8010166e: e8 40 1c 00 00 call 801032b3 <log_write>
brelse(bp);
80101673: 8b 45 f0 mov -0x10(%ebp),%eax
80101676: 89 04 24 mov %eax,(%esp)
80101679: e8 9a eb ff ff call 80100218 <brelse>
return iget(dev, inum);
8010167e: 8b 45 ec mov -0x14(%ebp),%eax
80101681: 89 44 24 04 mov %eax,0x4(%esp)
80101685: 8b 45 08 mov 0x8(%ebp),%eax
80101688: 89 04 24 mov %eax,(%esp)
8010168b: e8 e6 00 00 00 call 80101776 <iget>
}
brelse(bp);
}
panic("ialloc: no inodes");
}
80101690: c9 leave
80101691: c3 ret
dip->type = type;
log_write(bp); // mark it allocated on the disk
brelse(bp);
return iget(dev, inum);
}
brelse(bp);
80101692: 8b 45 f0 mov -0x10(%ebp),%eax
80101695: 89 04 24 mov %eax,(%esp)
80101698: e8 7b eb ff ff call 80100218 <brelse>
struct dinode *dip;
struct superblock sb;
readsb(dev, &sb);
for(inum = 1; inum < sb.ninodes; inum++){
8010169d: 83 45 ec 01 addl $0x1,-0x14(%ebp)
801016a1: 8b 55 ec mov -0x14(%ebp),%edx
801016a4: 8b 45 e4 mov -0x1c(%ebp),%eax
801016a7: 39 c2 cmp %eax,%edx
801016a9: 0f 82 5a ff ff ff jb 80101609 <ialloc+0x2b>
brelse(bp);
return iget(dev, inum);
}
brelse(bp);
}
panic("ialloc: no inodes");
801016af: c7 04 24 d5 86 10 80 movl $0x801086d5,(%esp)
801016b6: e8 7f ee ff ff call 8010053a <panic>
801016bb <iupdate>:
}
// Copy a modified in-memory inode to disk.
void
iupdate(struct inode *ip)
{
801016bb: 55 push %ebp
801016bc: 89 e5 mov %esp,%ebp
801016be: 83 ec 28 sub $0x28,%esp
struct buf *bp;
struct dinode *dip;
bp = bread(ip->dev, IBLOCK(ip->inum));
801016c1: 8b 45 08 mov 0x8(%ebp),%eax
801016c4: 8b 40 04 mov 0x4(%eax),%eax
801016c7: c1 e8 03 shr $0x3,%eax
801016ca: 8d 50 02 lea 0x2(%eax),%edx
801016cd: 8b 45 08 mov 0x8(%ebp),%eax
801016d0: 8b 00 mov (%eax),%eax
801016d2: 89 54 24 04 mov %edx,0x4(%esp)
801016d6: 89 04 24 mov %eax,(%esp)
801016d9: e8 c9 ea ff ff call 801001a7 <bread>
801016de: 89 45 f0 mov %eax,-0x10(%ebp)
dip = (struct dinode*)bp->data + ip->inum%IPB;
801016e1: 8b 45 f0 mov -0x10(%ebp),%eax
801016e4: 83 c0 18 add $0x18,%eax
801016e7: 89 c2 mov %eax,%edx
801016e9: 8b 45 08 mov 0x8(%ebp),%eax
801016ec: 8b 40 04 mov 0x4(%eax),%eax
801016ef: 83 e0 07 and $0x7,%eax
801016f2: c1 e0 06 shl $0x6,%eax
801016f5: 8d 04 02 lea (%edx,%eax,1),%eax
801016f8: 89 45 f4 mov %eax,-0xc(%ebp)
dip->type = ip->type;
801016fb: 8b 45 08 mov 0x8(%ebp),%eax
801016fe: 0f b7 50 10 movzwl 0x10(%eax),%edx
80101702: 8b 45 f4 mov -0xc(%ebp),%eax
80101705: 66 89 10 mov %dx,(%eax)
dip->major = ip->major;
80101708: 8b 45 08 mov 0x8(%ebp),%eax
8010170b: 0f b7 50 12 movzwl 0x12(%eax),%edx
8010170f: 8b 45 f4 mov -0xc(%ebp),%eax
80101712: 66 89 50 02 mov %dx,0x2(%eax)
dip->minor = ip->minor;
80101716: 8b 45 08 mov 0x8(%ebp),%eax
80101719: 0f b7 50 14 movzwl 0x14(%eax),%edx
8010171d: 8b 45 f4 mov -0xc(%ebp),%eax
80101720: 66 89 50 04 mov %dx,0x4(%eax)
dip->nlink = ip->nlink;
80101724: 8b 45 08 mov 0x8(%ebp),%eax
80101727: 0f b7 50 16 movzwl 0x16(%eax),%edx
8010172b: 8b 45 f4 mov -0xc(%ebp),%eax
8010172e: 66 89 50 06 mov %dx,0x6(%eax)
dip->size = ip->size;
80101732: 8b 45 08 mov 0x8(%ebp),%eax
80101735: 8b 50 18 mov 0x18(%eax),%edx
80101738: 8b 45 f4 mov -0xc(%ebp),%eax
8010173b: 89 50 08 mov %edx,0x8(%eax)
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010173e: 8b 45 08 mov 0x8(%ebp),%eax
80101741: 8d 50 1c lea 0x1c(%eax),%edx
80101744: 8b 45 f4 mov -0xc(%ebp),%eax
80101747: 83 c0 0c add $0xc,%eax
8010174a: c7 44 24 08 34 00 00 movl $0x34,0x8(%esp)
80101751: 00
80101752: 89 54 24 04 mov %edx,0x4(%esp)
80101756: 89 04 24 mov %eax,(%esp)
80101759: e8 2f 3b 00 00 call 8010528d <memmove>
log_write(bp);
8010175e: 8b 45 f0 mov -0x10(%ebp),%eax
80101761: 89 04 24 mov %eax,(%esp)
80101764: e8 4a 1b 00 00 call 801032b3 <log_write>
brelse(bp);
80101769: 8b 45 f0 mov -0x10(%ebp),%eax
8010176c: 89 04 24 mov %eax,(%esp)
8010176f: e8 a4 ea ff ff call 80100218 <brelse>
}
80101774: c9 leave
80101775: c3 ret
80101776 <iget>:
// Find the inode with number inum on device dev
// and return the in-memory copy. Does not lock
// the inode and does not read it from disk.
static struct inode*
iget(uint dev, uint inum)
{
80101776: 55 push %ebp
80101777: 89 e5 mov %esp,%ebp
80101779: 83 ec 28 sub $0x28,%esp
struct inode *ip, *empty;
acquire(&icache.lock);
8010177c: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101783: e8 e3 37 00 00 call 80104f6b <acquire>
// Is the inode already cached?
empty = 0;
80101788: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
8010178f: c7 45 f0 b4 e8 10 80 movl $0x8010e8b4,-0x10(%ebp)
80101796: eb 59 jmp 801017f1 <iget+0x7b>
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
80101798: 8b 45 f0 mov -0x10(%ebp),%eax
8010179b: 8b 40 08 mov 0x8(%eax),%eax
8010179e: 85 c0 test %eax,%eax
801017a0: 7e 35 jle 801017d7 <iget+0x61>
801017a2: 8b 45 f0 mov -0x10(%ebp),%eax
801017a5: 8b 00 mov (%eax),%eax
801017a7: 3b 45 08 cmp 0x8(%ebp),%eax
801017aa: 75 2b jne 801017d7 <iget+0x61>
801017ac: 8b 45 f0 mov -0x10(%ebp),%eax
801017af: 8b 40 04 mov 0x4(%eax),%eax
801017b2: 3b 45 0c cmp 0xc(%ebp),%eax
801017b5: 75 20 jne 801017d7 <iget+0x61>
ip->ref++;
801017b7: 8b 45 f0 mov -0x10(%ebp),%eax
801017ba: 8b 40 08 mov 0x8(%eax),%eax
801017bd: 8d 50 01 lea 0x1(%eax),%edx
801017c0: 8b 45 f0 mov -0x10(%ebp),%eax
801017c3: 89 50 08 mov %edx,0x8(%eax)
release(&icache.lock);
801017c6: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
801017cd: e8 fa 37 00 00 call 80104fcc <release>
return ip;
801017d2: 8b 45 f0 mov -0x10(%ebp),%eax
801017d5: eb 70 jmp 80101847 <iget+0xd1>
}
if(empty == 0 && ip->ref == 0) // Remember empty slot.
801017d7: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801017db: 75 10 jne 801017ed <iget+0x77>
801017dd: 8b 45 f0 mov -0x10(%ebp),%eax
801017e0: 8b 40 08 mov 0x8(%eax),%eax
801017e3: 85 c0 test %eax,%eax
801017e5: 75 06 jne 801017ed <iget+0x77>
empty = ip;
801017e7: 8b 45 f0 mov -0x10(%ebp),%eax
801017ea: 89 45 f4 mov %eax,-0xc(%ebp)
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
801017ed: 83 45 f0 50 addl $0x50,-0x10(%ebp)
801017f1: b8 54 f8 10 80 mov $0x8010f854,%eax
801017f6: 39 45 f0 cmp %eax,-0x10(%ebp)
801017f9: 72 9d jb 80101798 <iget+0x22>
if(empty == 0 && ip->ref == 0) // Remember empty slot.
empty = ip;
}
// Recycle an inode cache entry.
if(empty == 0)
801017fb: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801017ff: 75 0c jne 8010180d <iget+0x97>
panic("iget: no inodes");
80101801: c7 04 24 e7 86 10 80 movl $0x801086e7,(%esp)
80101808: e8 2d ed ff ff call 8010053a <panic>
ip = empty;
8010180d: 8b 45 f4 mov -0xc(%ebp),%eax
80101810: 89 45 f0 mov %eax,-0x10(%ebp)
ip->dev = dev;
80101813: 8b 45 f0 mov -0x10(%ebp),%eax
80101816: 8b 55 08 mov 0x8(%ebp),%edx
80101819: 89 10 mov %edx,(%eax)
ip->inum = inum;
8010181b: 8b 45 f0 mov -0x10(%ebp),%eax
8010181e: 8b 55 0c mov 0xc(%ebp),%edx
80101821: 89 50 04 mov %edx,0x4(%eax)
ip->ref = 1;
80101824: 8b 45 f0 mov -0x10(%ebp),%eax
80101827: c7 40 08 01 00 00 00 movl $0x1,0x8(%eax)
ip->flags = 0;
8010182e: 8b 45 f0 mov -0x10(%ebp),%eax
80101831: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
release(&icache.lock);
80101838: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
8010183f: e8 88 37 00 00 call 80104fcc <release>
return ip;
80101844: 8b 45 f0 mov -0x10(%ebp),%eax
}
80101847: c9 leave
80101848: c3 ret
80101849 <idup>:
// Increment reference count for ip.
// Returns ip to enable ip = idup(ip1) idiom.
struct inode*
idup(struct inode *ip)
{
80101849: 55 push %ebp
8010184a: 89 e5 mov %esp,%ebp
8010184c: 83 ec 18 sub $0x18,%esp
acquire(&icache.lock);
8010184f: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101856: e8 10 37 00 00 call 80104f6b <acquire>
ip->ref++;
8010185b: 8b 45 08 mov 0x8(%ebp),%eax
8010185e: 8b 40 08 mov 0x8(%eax),%eax
80101861: 8d 50 01 lea 0x1(%eax),%edx
80101864: 8b 45 08 mov 0x8(%ebp),%eax
80101867: 89 50 08 mov %edx,0x8(%eax)
release(&icache.lock);
8010186a: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101871: e8 56 37 00 00 call 80104fcc <release>
return ip;
80101876: 8b 45 08 mov 0x8(%ebp),%eax
}
80101879: c9 leave
8010187a: c3 ret
8010187b <ilock>:
// Lock the given inode.
// Reads the inode from disk if necessary.
void
ilock(struct inode *ip)
{
8010187b: 55 push %ebp
8010187c: 89 e5 mov %esp,%ebp
8010187e: 83 ec 28 sub $0x28,%esp
struct buf *bp;
struct dinode *dip;
if(ip == 0 || ip->ref < 1)
80101881: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
80101885: 74 0a je 80101891 <ilock+0x16>
80101887: 8b 45 08 mov 0x8(%ebp),%eax
8010188a: 8b 40 08 mov 0x8(%eax),%eax
8010188d: 85 c0 test %eax,%eax
8010188f: 7f 0c jg 8010189d <ilock+0x22>
panic("ilock");
80101891: c7 04 24 f7 86 10 80 movl $0x801086f7,(%esp)
80101898: e8 9d ec ff ff call 8010053a <panic>
acquire(&icache.lock);
8010189d: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
801018a4: e8 c2 36 00 00 call 80104f6b <acquire>
while(ip->flags & I_BUSY)
801018a9: eb 13 jmp 801018be <ilock+0x43>
sleep(ip, &icache.lock);
801018ab: c7 44 24 04 80 e8 10 movl $0x8010e880,0x4(%esp)
801018b2: 80
801018b3: 8b 45 08 mov 0x8(%ebp),%eax
801018b6: 89 04 24 mov %eax,(%esp)
801018b9: e8 35 33 00 00 call 80104bf3 <sleep>
if(ip == 0 || ip->ref < 1)
panic("ilock");
acquire(&icache.lock);
while(ip->flags & I_BUSY)
801018be: 8b 45 08 mov 0x8(%ebp),%eax
801018c1: 8b 40 0c mov 0xc(%eax),%eax
801018c4: 83 e0 01 and $0x1,%eax
801018c7: 84 c0 test %al,%al
801018c9: 75 e0 jne 801018ab <ilock+0x30>
sleep(ip, &icache.lock);
ip->flags |= I_BUSY;
801018cb: 8b 45 08 mov 0x8(%ebp),%eax
801018ce: 8b 40 0c mov 0xc(%eax),%eax
801018d1: 89 c2 mov %eax,%edx
801018d3: 83 ca 01 or $0x1,%edx
801018d6: 8b 45 08 mov 0x8(%ebp),%eax
801018d9: 89 50 0c mov %edx,0xc(%eax)
release(&icache.lock);
801018dc: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
801018e3: e8 e4 36 00 00 call 80104fcc <release>
if(!(ip->flags & I_VALID)){
801018e8: 8b 45 08 mov 0x8(%ebp),%eax
801018eb: 8b 40 0c mov 0xc(%eax),%eax
801018ee: 83 e0 02 and $0x2,%eax
801018f1: 85 c0 test %eax,%eax
801018f3: 0f 85 d1 00 00 00 jne 801019ca <ilock+0x14f>
bp = bread(ip->dev, IBLOCK(ip->inum));
801018f9: 8b 45 08 mov 0x8(%ebp),%eax
801018fc: 8b 40 04 mov 0x4(%eax),%eax
801018ff: c1 e8 03 shr $0x3,%eax
80101902: 8d 50 02 lea 0x2(%eax),%edx
80101905: 8b 45 08 mov 0x8(%ebp),%eax
80101908: 8b 00 mov (%eax),%eax
8010190a: 89 54 24 04 mov %edx,0x4(%esp)
8010190e: 89 04 24 mov %eax,(%esp)
80101911: e8 91 e8 ff ff call 801001a7 <bread>
80101916: 89 45 f0 mov %eax,-0x10(%ebp)
dip = (struct dinode*)bp->data + ip->inum%IPB;
80101919: 8b 45 f0 mov -0x10(%ebp),%eax
8010191c: 83 c0 18 add $0x18,%eax
8010191f: 89 c2 mov %eax,%edx
80101921: 8b 45 08 mov 0x8(%ebp),%eax
80101924: 8b 40 04 mov 0x4(%eax),%eax
80101927: 83 e0 07 and $0x7,%eax
8010192a: c1 e0 06 shl $0x6,%eax
8010192d: 8d 04 02 lea (%edx,%eax,1),%eax
80101930: 89 45 f4 mov %eax,-0xc(%ebp)
ip->type = dip->type;
80101933: 8b 45 f4 mov -0xc(%ebp),%eax
80101936: 0f b7 10 movzwl (%eax),%edx
80101939: 8b 45 08 mov 0x8(%ebp),%eax
8010193c: 66 89 50 10 mov %dx,0x10(%eax)
ip->major = dip->major;
80101940: 8b 45 f4 mov -0xc(%ebp),%eax
80101943: 0f b7 50 02 movzwl 0x2(%eax),%edx
80101947: 8b 45 08 mov 0x8(%ebp),%eax
8010194a: 66 89 50 12 mov %dx,0x12(%eax)
ip->minor = dip->minor;
8010194e: 8b 45 f4 mov -0xc(%ebp),%eax
80101951: 0f b7 50 04 movzwl 0x4(%eax),%edx
80101955: 8b 45 08 mov 0x8(%ebp),%eax
80101958: 66 89 50 14 mov %dx,0x14(%eax)
ip->nlink = dip->nlink;
8010195c: 8b 45 f4 mov -0xc(%ebp),%eax
8010195f: 0f b7 50 06 movzwl 0x6(%eax),%edx
80101963: 8b 45 08 mov 0x8(%ebp),%eax
80101966: 66 89 50 16 mov %dx,0x16(%eax)
ip->size = dip->size;
8010196a: 8b 45 f4 mov -0xc(%ebp),%eax
8010196d: 8b 50 08 mov 0x8(%eax),%edx
80101970: 8b 45 08 mov 0x8(%ebp),%eax
80101973: 89 50 18 mov %edx,0x18(%eax)
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
80101976: 8b 45 f4 mov -0xc(%ebp),%eax
80101979: 8d 50 0c lea 0xc(%eax),%edx
8010197c: 8b 45 08 mov 0x8(%ebp),%eax
8010197f: 83 c0 1c add $0x1c,%eax
80101982: c7 44 24 08 34 00 00 movl $0x34,0x8(%esp)
80101989: 00
8010198a: 89 54 24 04 mov %edx,0x4(%esp)
8010198e: 89 04 24 mov %eax,(%esp)
80101991: e8 f7 38 00 00 call 8010528d <memmove>
brelse(bp);
80101996: 8b 45 f0 mov -0x10(%ebp),%eax
80101999: 89 04 24 mov %eax,(%esp)
8010199c: e8 77 e8 ff ff call 80100218 <brelse>
ip->flags |= I_VALID;
801019a1: 8b 45 08 mov 0x8(%ebp),%eax
801019a4: 8b 40 0c mov 0xc(%eax),%eax
801019a7: 89 c2 mov %eax,%edx
801019a9: 83 ca 02 or $0x2,%edx
801019ac: 8b 45 08 mov 0x8(%ebp),%eax
801019af: 89 50 0c mov %edx,0xc(%eax)
if(ip->type == 0)
801019b2: 8b 45 08 mov 0x8(%ebp),%eax
801019b5: 0f b7 40 10 movzwl 0x10(%eax),%eax
801019b9: 66 85 c0 test %ax,%ax
801019bc: 75 0c jne 801019ca <ilock+0x14f>
panic("ilock: no type");
801019be: c7 04 24 fd 86 10 80 movl $0x801086fd,(%esp)
801019c5: e8 70 eb ff ff call 8010053a <panic>
}
}
801019ca: c9 leave
801019cb: c3 ret
801019cc <iunlock>:
// Unlock the given inode.
void
iunlock(struct inode *ip)
{
801019cc: 55 push %ebp
801019cd: 89 e5 mov %esp,%ebp
801019cf: 83 ec 18 sub $0x18,%esp
if(ip == 0 || !(ip->flags & I_BUSY) || ip->ref < 1)
801019d2: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
801019d6: 74 17 je 801019ef <iunlock+0x23>
801019d8: 8b 45 08 mov 0x8(%ebp),%eax
801019db: 8b 40 0c mov 0xc(%eax),%eax
801019de: 83 e0 01 and $0x1,%eax
801019e1: 85 c0 test %eax,%eax
801019e3: 74 0a je 801019ef <iunlock+0x23>
801019e5: 8b 45 08 mov 0x8(%ebp),%eax
801019e8: 8b 40 08 mov 0x8(%eax),%eax
801019eb: 85 c0 test %eax,%eax
801019ed: 7f 0c jg 801019fb <iunlock+0x2f>
panic("iunlock");
801019ef: c7 04 24 0c 87 10 80 movl $0x8010870c,(%esp)
801019f6: e8 3f eb ff ff call 8010053a <panic>
acquire(&icache.lock);
801019fb: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101a02: e8 64 35 00 00 call 80104f6b <acquire>
ip->flags &= ~I_BUSY;
80101a07: 8b 45 08 mov 0x8(%ebp),%eax
80101a0a: 8b 40 0c mov 0xc(%eax),%eax
80101a0d: 89 c2 mov %eax,%edx
80101a0f: 83 e2 fe and $0xfffffffe,%edx
80101a12: 8b 45 08 mov 0x8(%ebp),%eax
80101a15: 89 50 0c mov %edx,0xc(%eax)
wakeup(ip);
80101a18: 8b 45 08 mov 0x8(%ebp),%eax
80101a1b: 89 04 24 mov %eax,(%esp)
80101a1e: e8 16 33 00 00 call 80104d39 <wakeup>
release(&icache.lock);
80101a23: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101a2a: e8 9d 35 00 00 call 80104fcc <release>
}
80101a2f: c9 leave
80101a30: c3 ret
80101a31 <iput>:
// be recycled.
// If that was the last reference and the inode has no links
// to it, free the inode (and its content) on disk.
void
iput(struct inode *ip)
{
80101a31: 55 push %ebp
80101a32: 89 e5 mov %esp,%ebp
80101a34: 83 ec 18 sub $0x18,%esp
acquire(&icache.lock);
80101a37: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101a3e: e8 28 35 00 00 call 80104f6b <acquire>
if(ip->ref == 1 && (ip->flags & I_VALID) && ip->nlink == 0){
80101a43: 8b 45 08 mov 0x8(%ebp),%eax
80101a46: 8b 40 08 mov 0x8(%eax),%eax
80101a49: 83 f8 01 cmp $0x1,%eax
80101a4c: 0f 85 93 00 00 00 jne 80101ae5 <iput+0xb4>
80101a52: 8b 45 08 mov 0x8(%ebp),%eax
80101a55: 8b 40 0c mov 0xc(%eax),%eax
80101a58: 83 e0 02 and $0x2,%eax
80101a5b: 85 c0 test %eax,%eax
80101a5d: 0f 84 82 00 00 00 je 80101ae5 <iput+0xb4>
80101a63: 8b 45 08 mov 0x8(%ebp),%eax
80101a66: 0f b7 40 16 movzwl 0x16(%eax),%eax
80101a6a: 66 85 c0 test %ax,%ax
80101a6d: 75 76 jne 80101ae5 <iput+0xb4>
// inode has no links: truncate and free inode.
if(ip->flags & I_BUSY)
80101a6f: 8b 45 08 mov 0x8(%ebp),%eax
80101a72: 8b 40 0c mov 0xc(%eax),%eax
80101a75: 83 e0 01 and $0x1,%eax
80101a78: 84 c0 test %al,%al
80101a7a: 74 0c je 80101a88 <iput+0x57>
panic("iput busy");
80101a7c: c7 04 24 14 87 10 80 movl $0x80108714,(%esp)
80101a83: e8 b2 ea ff ff call 8010053a <panic>
ip->flags |= I_BUSY;
80101a88: 8b 45 08 mov 0x8(%ebp),%eax
80101a8b: 8b 40 0c mov 0xc(%eax),%eax
80101a8e: 89 c2 mov %eax,%edx
80101a90: 83 ca 01 or $0x1,%edx
80101a93: 8b 45 08 mov 0x8(%ebp),%eax
80101a96: 89 50 0c mov %edx,0xc(%eax)
release(&icache.lock);
80101a99: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101aa0: e8 27 35 00 00 call 80104fcc <release>
itrunc(ip);
80101aa5: 8b 45 08 mov 0x8(%ebp),%eax
80101aa8: 89 04 24 mov %eax,(%esp)
80101aab: e8 72 01 00 00 call 80101c22 <itrunc>
ip->type = 0;
80101ab0: 8b 45 08 mov 0x8(%ebp),%eax
80101ab3: 66 c7 40 10 00 00 movw $0x0,0x10(%eax)
iupdate(ip);
80101ab9: 8b 45 08 mov 0x8(%ebp),%eax
80101abc: 89 04 24 mov %eax,(%esp)
80101abf: e8 f7 fb ff ff call 801016bb <iupdate>
acquire(&icache.lock);
80101ac4: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101acb: e8 9b 34 00 00 call 80104f6b <acquire>
ip->flags = 0;
80101ad0: 8b 45 08 mov 0x8(%ebp),%eax
80101ad3: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
wakeup(ip);
80101ada: 8b 45 08 mov 0x8(%ebp),%eax
80101add: 89 04 24 mov %eax,(%esp)
80101ae0: e8 54 32 00 00 call 80104d39 <wakeup>
}
ip->ref--;
80101ae5: 8b 45 08 mov 0x8(%ebp),%eax
80101ae8: 8b 40 08 mov 0x8(%eax),%eax
80101aeb: 8d 50 ff lea -0x1(%eax),%edx
80101aee: 8b 45 08 mov 0x8(%ebp),%eax
80101af1: 89 50 08 mov %edx,0x8(%eax)
release(&icache.lock);
80101af4: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101afb: e8 cc 34 00 00 call 80104fcc <release>
}
80101b00: c9 leave
80101b01: c3 ret
80101b02 <iunlockput>:
// Common idiom: unlock, then put.
void
iunlockput(struct inode *ip)
{
80101b02: 55 push %ebp
80101b03: 89 e5 mov %esp,%ebp
80101b05: 83 ec 18 sub $0x18,%esp
iunlock(ip);
80101b08: 8b 45 08 mov 0x8(%ebp),%eax
80101b0b: 89 04 24 mov %eax,(%esp)
80101b0e: e8 b9 fe ff ff call 801019cc <iunlock>
iput(ip);
80101b13: 8b 45 08 mov 0x8(%ebp),%eax
80101b16: 89 04 24 mov %eax,(%esp)
80101b19: e8 13 ff ff ff call 80101a31 <iput>
}
80101b1e: c9 leave
80101b1f: c3 ret
80101b20 <bmap>:
// Return the disk block address of the nth block in inode ip.
// If there is no such block, bmap allocates one.
static uint
bmap(struct inode *ip, uint bn)
{
80101b20: 55 push %ebp
80101b21: 89 e5 mov %esp,%ebp
80101b23: 53 push %ebx
80101b24: 83 ec 24 sub $0x24,%esp
uint addr, *a;
struct buf *bp;
if(bn < NDIRECT){
80101b27: 83 7d 0c 0b cmpl $0xb,0xc(%ebp)
80101b2b: 77 3e ja 80101b6b <bmap+0x4b>
if((addr = ip->addrs[bn]) == 0)
80101b2d: 8b 55 0c mov 0xc(%ebp),%edx
80101b30: 8b 45 08 mov 0x8(%ebp),%eax
80101b33: 83 c2 04 add $0x4,%edx
80101b36: 8b 44 90 0c mov 0xc(%eax,%edx,4),%eax
80101b3a: 89 45 ec mov %eax,-0x14(%ebp)
80101b3d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80101b41: 75 20 jne 80101b63 <bmap+0x43>
ip->addrs[bn] = addr = balloc(ip->dev);
80101b43: 8b 5d 0c mov 0xc(%ebp),%ebx
80101b46: 8b 45 08 mov 0x8(%ebp),%eax
80101b49: 8b 00 mov (%eax),%eax
80101b4b: 89 04 24 mov %eax,(%esp)
80101b4e: e8 38 f8 ff ff call 8010138b <balloc>
80101b53: 89 45 ec mov %eax,-0x14(%ebp)
80101b56: 8b 45 08 mov 0x8(%ebp),%eax
80101b59: 8d 4b 04 lea 0x4(%ebx),%ecx
80101b5c: 8b 55 ec mov -0x14(%ebp),%edx
80101b5f: 89 54 88 0c mov %edx,0xc(%eax,%ecx,4)
return addr;
80101b63: 8b 45 ec mov -0x14(%ebp),%eax
80101b66: e9 b1 00 00 00 jmp 80101c1c <bmap+0xfc>
}
bn -= NDIRECT;
80101b6b: 83 6d 0c 0c subl $0xc,0xc(%ebp)
if(bn < NINDIRECT){
80101b6f: 83 7d 0c 7f cmpl $0x7f,0xc(%ebp)
80101b73: 0f 87 97 00 00 00 ja 80101c10 <bmap+0xf0>
// Load indirect block, allocating if necessary.
if((addr = ip->addrs[NDIRECT]) == 0)
80101b79: 8b 45 08 mov 0x8(%ebp),%eax
80101b7c: 8b 40 4c mov 0x4c(%eax),%eax
80101b7f: 89 45 ec mov %eax,-0x14(%ebp)
80101b82: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80101b86: 75 19 jne 80101ba1 <bmap+0x81>
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
80101b88: 8b 45 08 mov 0x8(%ebp),%eax
80101b8b: 8b 00 mov (%eax),%eax
80101b8d: 89 04 24 mov %eax,(%esp)
80101b90: e8 f6 f7 ff ff call 8010138b <balloc>
80101b95: 89 45 ec mov %eax,-0x14(%ebp)
80101b98: 8b 45 08 mov 0x8(%ebp),%eax
80101b9b: 8b 55 ec mov -0x14(%ebp),%edx
80101b9e: 89 50 4c mov %edx,0x4c(%eax)
bp = bread(ip->dev, addr);
80101ba1: 8b 45 08 mov 0x8(%ebp),%eax
80101ba4: 8b 00 mov (%eax),%eax
80101ba6: 8b 55 ec mov -0x14(%ebp),%edx
80101ba9: 89 54 24 04 mov %edx,0x4(%esp)
80101bad: 89 04 24 mov %eax,(%esp)
80101bb0: e8 f2 e5 ff ff call 801001a7 <bread>
80101bb5: 89 45 f4 mov %eax,-0xc(%ebp)
a = (uint*)bp->data;
80101bb8: 8b 45 f4 mov -0xc(%ebp),%eax
80101bbb: 83 c0 18 add $0x18,%eax
80101bbe: 89 45 f0 mov %eax,-0x10(%ebp)
if((addr = a[bn]) == 0){
80101bc1: 8b 45 0c mov 0xc(%ebp),%eax
80101bc4: c1 e0 02 shl $0x2,%eax
80101bc7: 03 45 f0 add -0x10(%ebp),%eax
80101bca: 8b 00 mov (%eax),%eax
80101bcc: 89 45 ec mov %eax,-0x14(%ebp)
80101bcf: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80101bd3: 75 2b jne 80101c00 <bmap+0xe0>
a[bn] = addr = balloc(ip->dev);
80101bd5: 8b 45 0c mov 0xc(%ebp),%eax
80101bd8: c1 e0 02 shl $0x2,%eax
80101bdb: 89 c3 mov %eax,%ebx
80101bdd: 03 5d f0 add -0x10(%ebp),%ebx
80101be0: 8b 45 08 mov 0x8(%ebp),%eax
80101be3: 8b 00 mov (%eax),%eax
80101be5: 89 04 24 mov %eax,(%esp)
80101be8: e8 9e f7 ff ff call 8010138b <balloc>
80101bed: 89 45 ec mov %eax,-0x14(%ebp)
80101bf0: 8b 45 ec mov -0x14(%ebp),%eax
80101bf3: 89 03 mov %eax,(%ebx)
log_write(bp);
80101bf5: 8b 45 f4 mov -0xc(%ebp),%eax
80101bf8: 89 04 24 mov %eax,(%esp)
80101bfb: e8 b3 16 00 00 call 801032b3 <log_write>
}
brelse(bp);
80101c00: 8b 45 f4 mov -0xc(%ebp),%eax
80101c03: 89 04 24 mov %eax,(%esp)
80101c06: e8 0d e6 ff ff call 80100218 <brelse>
return addr;
80101c0b: 8b 45 ec mov -0x14(%ebp),%eax
80101c0e: eb 0c jmp 80101c1c <bmap+0xfc>
}
panic("bmap: out of range");
80101c10: c7 04 24 1e 87 10 80 movl $0x8010871e,(%esp)
80101c17: e8 1e e9 ff ff call 8010053a <panic>
}
80101c1c: 83 c4 24 add $0x24,%esp
80101c1f: 5b pop %ebx
80101c20: 5d pop %ebp
80101c21: c3 ret
80101c22 <itrunc>:
// to it (no directory entries referring to it)
// and has no in-memory reference to it (is
// not an open file or current directory).
static void
itrunc(struct inode *ip)
{
80101c22: 55 push %ebp
80101c23: 89 e5 mov %esp,%ebp
80101c25: 83 ec 28 sub $0x28,%esp
int i, j;
struct buf *bp;
uint *a;
for(i = 0; i < NDIRECT; i++){
80101c28: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp)
80101c2f: eb 44 jmp 80101c75 <itrunc+0x53>
if(ip->addrs[i]){
80101c31: 8b 55 e8 mov -0x18(%ebp),%edx
80101c34: 8b 45 08 mov 0x8(%ebp),%eax
80101c37: 83 c2 04 add $0x4,%edx
80101c3a: 8b 44 90 0c mov 0xc(%eax,%edx,4),%eax
80101c3e: 85 c0 test %eax,%eax
80101c40: 74 2f je 80101c71 <itrunc+0x4f>
bfree(ip->dev, ip->addrs[i]);
80101c42: 8b 55 e8 mov -0x18(%ebp),%edx
80101c45: 8b 45 08 mov 0x8(%ebp),%eax
80101c48: 83 c2 04 add $0x4,%edx
80101c4b: 8b 54 90 0c mov 0xc(%eax,%edx,4),%edx
80101c4f: 8b 45 08 mov 0x8(%ebp),%eax
80101c52: 8b 00 mov (%eax),%eax
80101c54: 89 54 24 04 mov %edx,0x4(%esp)
80101c58: 89 04 24 mov %eax,(%esp)
80101c5b: e8 86 f8 ff ff call 801014e6 <bfree>
ip->addrs[i] = 0;
80101c60: 8b 55 e8 mov -0x18(%ebp),%edx
80101c63: 8b 45 08 mov 0x8(%ebp),%eax
80101c66: 83 c2 04 add $0x4,%edx
80101c69: c7 44 90 0c 00 00 00 movl $0x0,0xc(%eax,%edx,4)
80101c70: 00
{
int i, j;
struct buf *bp;
uint *a;
for(i = 0; i < NDIRECT; i++){
80101c71: 83 45 e8 01 addl $0x1,-0x18(%ebp)
80101c75: 83 7d e8 0b cmpl $0xb,-0x18(%ebp)
80101c79: 7e b6 jle 80101c31 <itrunc+0xf>
bfree(ip->dev, ip->addrs[i]);
ip->addrs[i] = 0;
}
}
if(ip->addrs[NDIRECT]){
80101c7b: 8b 45 08 mov 0x8(%ebp),%eax
80101c7e: 8b 40 4c mov 0x4c(%eax),%eax
80101c81: 85 c0 test %eax,%eax
80101c83: 0f 84 8f 00 00 00 je 80101d18 <itrunc+0xf6>
bp = bread(ip->dev, ip->addrs[NDIRECT]);
80101c89: 8b 45 08 mov 0x8(%ebp),%eax
80101c8c: 8b 50 4c mov 0x4c(%eax),%edx
80101c8f: 8b 45 08 mov 0x8(%ebp),%eax
80101c92: 8b 00 mov (%eax),%eax
80101c94: 89 54 24 04 mov %edx,0x4(%esp)
80101c98: 89 04 24 mov %eax,(%esp)
80101c9b: e8 07 e5 ff ff call 801001a7 <bread>
80101ca0: 89 45 f0 mov %eax,-0x10(%ebp)
a = (uint*)bp->data;
80101ca3: 8b 45 f0 mov -0x10(%ebp),%eax
80101ca6: 83 c0 18 add $0x18,%eax
80101ca9: 89 45 f4 mov %eax,-0xc(%ebp)
for(j = 0; j < NINDIRECT; j++){
80101cac: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80101cb3: eb 2f jmp 80101ce4 <itrunc+0xc2>
if(a[j])
80101cb5: 8b 45 ec mov -0x14(%ebp),%eax
80101cb8: c1 e0 02 shl $0x2,%eax
80101cbb: 03 45 f4 add -0xc(%ebp),%eax
80101cbe: 8b 00 mov (%eax),%eax
80101cc0: 85 c0 test %eax,%eax
80101cc2: 74 1c je 80101ce0 <itrunc+0xbe>
bfree(ip->dev, a[j]);
80101cc4: 8b 45 ec mov -0x14(%ebp),%eax
80101cc7: c1 e0 02 shl $0x2,%eax
80101cca: 03 45 f4 add -0xc(%ebp),%eax
80101ccd: 8b 10 mov (%eax),%edx
80101ccf: 8b 45 08 mov 0x8(%ebp),%eax
80101cd2: 8b 00 mov (%eax),%eax
80101cd4: 89 54 24 04 mov %edx,0x4(%esp)
80101cd8: 89 04 24 mov %eax,(%esp)
80101cdb: e8 06 f8 ff ff call 801014e6 <bfree>
}
if(ip->addrs[NDIRECT]){
bp = bread(ip->dev, ip->addrs[NDIRECT]);
a = (uint*)bp->data;
for(j = 0; j < NINDIRECT; j++){
80101ce0: 83 45 ec 01 addl $0x1,-0x14(%ebp)
80101ce4: 8b 45 ec mov -0x14(%ebp),%eax
80101ce7: 83 f8 7f cmp $0x7f,%eax
80101cea: 76 c9 jbe 80101cb5 <itrunc+0x93>
if(a[j])
bfree(ip->dev, a[j]);
}
brelse(bp);
80101cec: 8b 45 f0 mov -0x10(%ebp),%eax
80101cef: 89 04 24 mov %eax,(%esp)
80101cf2: e8 21 e5 ff ff call 80100218 <brelse>
bfree(ip->dev, ip->addrs[NDIRECT]);
80101cf7: 8b 45 08 mov 0x8(%ebp),%eax
80101cfa: 8b 50 4c mov 0x4c(%eax),%edx
80101cfd: 8b 45 08 mov 0x8(%ebp),%eax
80101d00: 8b 00 mov (%eax),%eax
80101d02: 89 54 24 04 mov %edx,0x4(%esp)
80101d06: 89 04 24 mov %eax,(%esp)
80101d09: e8 d8 f7 ff ff call 801014e6 <bfree>
ip->addrs[NDIRECT] = 0;
80101d0e: 8b 45 08 mov 0x8(%ebp),%eax
80101d11: c7 40 4c 00 00 00 00 movl $0x0,0x4c(%eax)
}
ip->size = 0;
80101d18: 8b 45 08 mov 0x8(%ebp),%eax
80101d1b: c7 40 18 00 00 00 00 movl $0x0,0x18(%eax)
iupdate(ip);
80101d22: 8b 45 08 mov 0x8(%ebp),%eax
80101d25: 89 04 24 mov %eax,(%esp)
80101d28: e8 8e f9 ff ff call 801016bb <iupdate>
}
80101d2d: c9 leave
80101d2e: c3 ret
80101d2f <stati>:
// Copy stat information from inode.
void
stati(struct inode *ip, struct stat *st)
{
80101d2f: 55 push %ebp
80101d30: 89 e5 mov %esp,%ebp
st->dev = ip->dev;
80101d32: 8b 45 08 mov 0x8(%ebp),%eax
80101d35: 8b 00 mov (%eax),%eax
80101d37: 89 c2 mov %eax,%edx
80101d39: 8b 45 0c mov 0xc(%ebp),%eax
80101d3c: 89 50 04 mov %edx,0x4(%eax)
st->ino = ip->inum;
80101d3f: 8b 45 08 mov 0x8(%ebp),%eax
80101d42: 8b 50 04 mov 0x4(%eax),%edx
80101d45: 8b 45 0c mov 0xc(%ebp),%eax
80101d48: 89 50 08 mov %edx,0x8(%eax)
st->type = ip->type;
80101d4b: 8b 45 08 mov 0x8(%ebp),%eax
80101d4e: 0f b7 50 10 movzwl 0x10(%eax),%edx
80101d52: 8b 45 0c mov 0xc(%ebp),%eax
80101d55: 66 89 10 mov %dx,(%eax)
st->nlink = ip->nlink;
80101d58: 8b 45 08 mov 0x8(%ebp),%eax
80101d5b: 0f b7 50 16 movzwl 0x16(%eax),%edx
80101d5f: 8b 45 0c mov 0xc(%ebp),%eax
80101d62: 66 89 50 0c mov %dx,0xc(%eax)
st->size = ip->size;
80101d66: 8b 45 08 mov 0x8(%ebp),%eax
80101d69: 8b 50 18 mov 0x18(%eax),%edx
80101d6c: 8b 45 0c mov 0xc(%ebp),%eax
80101d6f: 89 50 10 mov %edx,0x10(%eax)
}
80101d72: 5d pop %ebp
80101d73: c3 ret
80101d74 <readi>:
//PAGEBREAK!
// Read data from inode.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
80101d74: 55 push %ebp
80101d75: 89 e5 mov %esp,%ebp
80101d77: 53 push %ebx
80101d78: 83 ec 24 sub $0x24,%esp
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101d7b: 8b 45 08 mov 0x8(%ebp),%eax
80101d7e: 0f b7 40 10 movzwl 0x10(%eax),%eax
80101d82: 66 83 f8 03 cmp $0x3,%ax
80101d86: 75 60 jne 80101de8 <readi+0x74>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
80101d88: 8b 45 08 mov 0x8(%ebp),%eax
80101d8b: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101d8f: 66 85 c0 test %ax,%ax
80101d92: 78 20 js 80101db4 <readi+0x40>
80101d94: 8b 45 08 mov 0x8(%ebp),%eax
80101d97: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101d9b: 66 83 f8 09 cmp $0x9,%ax
80101d9f: 7f 13 jg 80101db4 <readi+0x40>
80101da1: 8b 45 08 mov 0x8(%ebp),%eax
80101da4: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101da8: 98 cwtl
80101da9: 8b 04 c5 20 e8 10 80 mov -0x7fef17e0(,%eax,8),%eax
80101db0: 85 c0 test %eax,%eax
80101db2: 75 0a jne 80101dbe <readi+0x4a>
return -1;
80101db4: b8 ff ff ff ff mov $0xffffffff,%eax
80101db9: e9 1c 01 00 00 jmp 80101eda <readi+0x166>
return devsw[ip->major].read(ip, dst, n);
80101dbe: 8b 45 08 mov 0x8(%ebp),%eax
80101dc1: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101dc5: 98 cwtl
80101dc6: 8b 14 c5 20 e8 10 80 mov -0x7fef17e0(,%eax,8),%edx
80101dcd: 8b 45 14 mov 0x14(%ebp),%eax
80101dd0: 89 44 24 08 mov %eax,0x8(%esp)
80101dd4: 8b 45 0c mov 0xc(%ebp),%eax
80101dd7: 89 44 24 04 mov %eax,0x4(%esp)
80101ddb: 8b 45 08 mov 0x8(%ebp),%eax
80101dde: 89 04 24 mov %eax,(%esp)
80101de1: ff d2 call *%edx
80101de3: e9 f2 00 00 00 jmp 80101eda <readi+0x166>
}
if(off > ip->size || off + n < off)
80101de8: 8b 45 08 mov 0x8(%ebp),%eax
80101deb: 8b 40 18 mov 0x18(%eax),%eax
80101dee: 3b 45 10 cmp 0x10(%ebp),%eax
80101df1: 72 0e jb 80101e01 <readi+0x8d>
80101df3: 8b 45 14 mov 0x14(%ebp),%eax
80101df6: 8b 55 10 mov 0x10(%ebp),%edx
80101df9: 8d 04 02 lea (%edx,%eax,1),%eax
80101dfc: 3b 45 10 cmp 0x10(%ebp),%eax
80101dff: 73 0a jae 80101e0b <readi+0x97>
return -1;
80101e01: b8 ff ff ff ff mov $0xffffffff,%eax
80101e06: e9 cf 00 00 00 jmp 80101eda <readi+0x166>
if(off + n > ip->size)
80101e0b: 8b 45 14 mov 0x14(%ebp),%eax
80101e0e: 8b 55 10 mov 0x10(%ebp),%edx
80101e11: 01 c2 add %eax,%edx
80101e13: 8b 45 08 mov 0x8(%ebp),%eax
80101e16: 8b 40 18 mov 0x18(%eax),%eax
80101e19: 39 c2 cmp %eax,%edx
80101e1b: 76 0c jbe 80101e29 <readi+0xb5>
n = ip->size - off;
80101e1d: 8b 45 08 mov 0x8(%ebp),%eax
80101e20: 8b 40 18 mov 0x18(%eax),%eax
80101e23: 2b 45 10 sub 0x10(%ebp),%eax
80101e26: 89 45 14 mov %eax,0x14(%ebp)
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101e29: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80101e30: e9 96 00 00 00 jmp 80101ecb <readi+0x157>
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101e35: 8b 45 10 mov 0x10(%ebp),%eax
80101e38: c1 e8 09 shr $0x9,%eax
80101e3b: 89 44 24 04 mov %eax,0x4(%esp)
80101e3f: 8b 45 08 mov 0x8(%ebp),%eax
80101e42: 89 04 24 mov %eax,(%esp)
80101e45: e8 d6 fc ff ff call 80101b20 <bmap>
80101e4a: 8b 55 08 mov 0x8(%ebp),%edx
80101e4d: 8b 12 mov (%edx),%edx
80101e4f: 89 44 24 04 mov %eax,0x4(%esp)
80101e53: 89 14 24 mov %edx,(%esp)
80101e56: e8 4c e3 ff ff call 801001a7 <bread>
80101e5b: 89 45 f4 mov %eax,-0xc(%ebp)
m = min(n - tot, BSIZE - off%BSIZE);
80101e5e: 8b 45 10 mov 0x10(%ebp),%eax
80101e61: 89 c2 mov %eax,%edx
80101e63: 81 e2 ff 01 00 00 and $0x1ff,%edx
80101e69: b8 00 02 00 00 mov $0x200,%eax
80101e6e: 89 c1 mov %eax,%ecx
80101e70: 29 d1 sub %edx,%ecx
80101e72: 89 ca mov %ecx,%edx
80101e74: 8b 45 ec mov -0x14(%ebp),%eax
80101e77: 8b 4d 14 mov 0x14(%ebp),%ecx
80101e7a: 89 cb mov %ecx,%ebx
80101e7c: 29 c3 sub %eax,%ebx
80101e7e: 89 d8 mov %ebx,%eax
80101e80: 39 c2 cmp %eax,%edx
80101e82: 0f 46 c2 cmovbe %edx,%eax
80101e85: 89 45 f0 mov %eax,-0x10(%ebp)
memmove(dst, bp->data + off%BSIZE, m);
80101e88: 8b 45 f4 mov -0xc(%ebp),%eax
80101e8b: 8d 50 18 lea 0x18(%eax),%edx
80101e8e: 8b 45 10 mov 0x10(%ebp),%eax
80101e91: 25 ff 01 00 00 and $0x1ff,%eax
80101e96: 01 c2 add %eax,%edx
80101e98: 8b 45 f0 mov -0x10(%ebp),%eax
80101e9b: 89 44 24 08 mov %eax,0x8(%esp)
80101e9f: 89 54 24 04 mov %edx,0x4(%esp)
80101ea3: 8b 45 0c mov 0xc(%ebp),%eax
80101ea6: 89 04 24 mov %eax,(%esp)
80101ea9: e8 df 33 00 00 call 8010528d <memmove>
brelse(bp);
80101eae: 8b 45 f4 mov -0xc(%ebp),%eax
80101eb1: 89 04 24 mov %eax,(%esp)
80101eb4: e8 5f e3 ff ff call 80100218 <brelse>
if(off > ip->size || off + n < off)
return -1;
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101eb9: 8b 45 f0 mov -0x10(%ebp),%eax
80101ebc: 01 45 ec add %eax,-0x14(%ebp)
80101ebf: 8b 45 f0 mov -0x10(%ebp),%eax
80101ec2: 01 45 10 add %eax,0x10(%ebp)
80101ec5: 8b 45 f0 mov -0x10(%ebp),%eax
80101ec8: 01 45 0c add %eax,0xc(%ebp)
80101ecb: 8b 45 ec mov -0x14(%ebp),%eax
80101ece: 3b 45 14 cmp 0x14(%ebp),%eax
80101ed1: 0f 82 5e ff ff ff jb 80101e35 <readi+0xc1>
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
memmove(dst, bp->data + off%BSIZE, m);
brelse(bp);
}
return n;
80101ed7: 8b 45 14 mov 0x14(%ebp),%eax
}
80101eda: 83 c4 24 add $0x24,%esp
80101edd: 5b pop %ebx
80101ede: 5d pop %ebp
80101edf: c3 ret
80101ee0 <writei>:
// PAGEBREAK!
// Write data to inode.
int
writei(struct inode *ip, char *src, uint off, uint n)
{
80101ee0: 55 push %ebp
80101ee1: 89 e5 mov %esp,%ebp
80101ee3: 53 push %ebx
80101ee4: 83 ec 24 sub $0x24,%esp
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101ee7: 8b 45 08 mov 0x8(%ebp),%eax
80101eea: 0f b7 40 10 movzwl 0x10(%eax),%eax
80101eee: 66 83 f8 03 cmp $0x3,%ax
80101ef2: 75 60 jne 80101f54 <writei+0x74>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
80101ef4: 8b 45 08 mov 0x8(%ebp),%eax
80101ef7: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101efb: 66 85 c0 test %ax,%ax
80101efe: 78 20 js 80101f20 <writei+0x40>
80101f00: 8b 45 08 mov 0x8(%ebp),%eax
80101f03: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101f07: 66 83 f8 09 cmp $0x9,%ax
80101f0b: 7f 13 jg 80101f20 <writei+0x40>
80101f0d: 8b 45 08 mov 0x8(%ebp),%eax
80101f10: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101f14: 98 cwtl
80101f15: 8b 04 c5 24 e8 10 80 mov -0x7fef17dc(,%eax,8),%eax
80101f1c: 85 c0 test %eax,%eax
80101f1e: 75 0a jne 80101f2a <writei+0x4a>
return -1;
80101f20: b8 ff ff ff ff mov $0xffffffff,%eax
80101f25: e9 48 01 00 00 jmp 80102072 <writei+0x192>
return devsw[ip->major].write(ip, src, n);
80101f2a: 8b 45 08 mov 0x8(%ebp),%eax
80101f2d: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101f31: 98 cwtl
80101f32: 8b 14 c5 24 e8 10 80 mov -0x7fef17dc(,%eax,8),%edx
80101f39: 8b 45 14 mov 0x14(%ebp),%eax
80101f3c: 89 44 24 08 mov %eax,0x8(%esp)
80101f40: 8b 45 0c mov 0xc(%ebp),%eax
80101f43: 89 44 24 04 mov %eax,0x4(%esp)
80101f47: 8b 45 08 mov 0x8(%ebp),%eax
80101f4a: 89 04 24 mov %eax,(%esp)
80101f4d: ff d2 call *%edx
80101f4f: e9 1e 01 00 00 jmp 80102072 <writei+0x192>
}
if(off > ip->size || off + n < off)
80101f54: 8b 45 08 mov 0x8(%ebp),%eax
80101f57: 8b 40 18 mov 0x18(%eax),%eax
80101f5a: 3b 45 10 cmp 0x10(%ebp),%eax
80101f5d: 72 0e jb 80101f6d <writei+0x8d>
80101f5f: 8b 45 14 mov 0x14(%ebp),%eax
80101f62: 8b 55 10 mov 0x10(%ebp),%edx
80101f65: 8d 04 02 lea (%edx,%eax,1),%eax
80101f68: 3b 45 10 cmp 0x10(%ebp),%eax
80101f6b: 73 0a jae 80101f77 <writei+0x97>
return -1;
80101f6d: b8 ff ff ff ff mov $0xffffffff,%eax
80101f72: e9 fb 00 00 00 jmp 80102072 <writei+0x192>
if(off + n > MAXFILE*BSIZE)
80101f77: 8b 45 14 mov 0x14(%ebp),%eax
80101f7a: 8b 55 10 mov 0x10(%ebp),%edx
80101f7d: 8d 04 02 lea (%edx,%eax,1),%eax
80101f80: 3d 00 18 01 00 cmp $0x11800,%eax
80101f85: 76 0a jbe 80101f91 <writei+0xb1>
return -1;
80101f87: b8 ff ff ff ff mov $0xffffffff,%eax
80101f8c: e9 e1 00 00 00 jmp 80102072 <writei+0x192>
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101f91: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80101f98: e9 a1 00 00 00 jmp 8010203e <writei+0x15e>
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101f9d: 8b 45 10 mov 0x10(%ebp),%eax
80101fa0: c1 e8 09 shr $0x9,%eax
80101fa3: 89 44 24 04 mov %eax,0x4(%esp)
80101fa7: 8b 45 08 mov 0x8(%ebp),%eax
80101faa: 89 04 24 mov %eax,(%esp)
80101fad: e8 6e fb ff ff call 80101b20 <bmap>
80101fb2: 8b 55 08 mov 0x8(%ebp),%edx
80101fb5: 8b 12 mov (%edx),%edx
80101fb7: 89 44 24 04 mov %eax,0x4(%esp)
80101fbb: 89 14 24 mov %edx,(%esp)
80101fbe: e8 e4 e1 ff ff call 801001a7 <bread>
80101fc3: 89 45 f4 mov %eax,-0xc(%ebp)
m = min(n - tot, BSIZE - off%BSIZE);
80101fc6: 8b 45 10 mov 0x10(%ebp),%eax
80101fc9: 89 c2 mov %eax,%edx
80101fcb: 81 e2 ff 01 00 00 and $0x1ff,%edx
80101fd1: b8 00 02 00 00 mov $0x200,%eax
80101fd6: 89 c1 mov %eax,%ecx
80101fd8: 29 d1 sub %edx,%ecx
80101fda: 89 ca mov %ecx,%edx
80101fdc: 8b 45 ec mov -0x14(%ebp),%eax
80101fdf: 8b 4d 14 mov 0x14(%ebp),%ecx
80101fe2: 89 cb mov %ecx,%ebx
80101fe4: 29 c3 sub %eax,%ebx
80101fe6: 89 d8 mov %ebx,%eax
80101fe8: 39 c2 cmp %eax,%edx
80101fea: 0f 46 c2 cmovbe %edx,%eax
80101fed: 89 45 f0 mov %eax,-0x10(%ebp)
memmove(bp->data + off%BSIZE, src, m);
80101ff0: 8b 45 f4 mov -0xc(%ebp),%eax
80101ff3: 8d 50 18 lea 0x18(%eax),%edx
80101ff6: 8b 45 10 mov 0x10(%ebp),%eax
80101ff9: 25 ff 01 00 00 and $0x1ff,%eax
80101ffe: 01 c2 add %eax,%edx
80102000: 8b 45 f0 mov -0x10(%ebp),%eax
80102003: 89 44 24 08 mov %eax,0x8(%esp)
80102007: 8b 45 0c mov 0xc(%ebp),%eax
8010200a: 89 44 24 04 mov %eax,0x4(%esp)
8010200e: 89 14 24 mov %edx,(%esp)
80102011: e8 77 32 00 00 call 8010528d <memmove>
log_write(bp);
80102016: 8b 45 f4 mov -0xc(%ebp),%eax
80102019: 89 04 24 mov %eax,(%esp)
8010201c: e8 92 12 00 00 call 801032b3 <log_write>
brelse(bp);
80102021: 8b 45 f4 mov -0xc(%ebp),%eax
80102024: 89 04 24 mov %eax,(%esp)
80102027: e8 ec e1 ff ff call 80100218 <brelse>
if(off > ip->size || off + n < off)
return -1;
if(off + n > MAXFILE*BSIZE)
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
8010202c: 8b 45 f0 mov -0x10(%ebp),%eax
8010202f: 01 45 ec add %eax,-0x14(%ebp)
80102032: 8b 45 f0 mov -0x10(%ebp),%eax
80102035: 01 45 10 add %eax,0x10(%ebp)
80102038: 8b 45 f0 mov -0x10(%ebp),%eax
8010203b: 01 45 0c add %eax,0xc(%ebp)
8010203e: 8b 45 ec mov -0x14(%ebp),%eax
80102041: 3b 45 14 cmp 0x14(%ebp),%eax
80102044: 0f 82 53 ff ff ff jb 80101f9d <writei+0xbd>
memmove(bp->data + off%BSIZE, src, m);
log_write(bp);
brelse(bp);
}
if(n > 0 && off > ip->size){
8010204a: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
8010204e: 74 1f je 8010206f <writei+0x18f>
80102050: 8b 45 08 mov 0x8(%ebp),%eax
80102053: 8b 40 18 mov 0x18(%eax),%eax
80102056: 3b 45 10 cmp 0x10(%ebp),%eax
80102059: 73 14 jae 8010206f <writei+0x18f>
ip->size = off;
8010205b: 8b 45 08 mov 0x8(%ebp),%eax
8010205e: 8b 55 10 mov 0x10(%ebp),%edx
80102061: 89 50 18 mov %edx,0x18(%eax)
iupdate(ip);
80102064: 8b 45 08 mov 0x8(%ebp),%eax
80102067: 89 04 24 mov %eax,(%esp)
8010206a: e8 4c f6 ff ff call 801016bb <iupdate>
}
return n;
8010206f: 8b 45 14 mov 0x14(%ebp),%eax
}
80102072: 83 c4 24 add $0x24,%esp
80102075: 5b pop %ebx
80102076: 5d pop %ebp
80102077: c3 ret
80102078 <namecmp>:
//PAGEBREAK!
// Directories
int
namecmp(const char *s, const char *t)
{
80102078: 55 push %ebp
80102079: 89 e5 mov %esp,%ebp
8010207b: 83 ec 18 sub $0x18,%esp
return strncmp(s, t, DIRSIZ);
8010207e: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80102085: 00
80102086: 8b 45 0c mov 0xc(%ebp),%eax
80102089: 89 44 24 04 mov %eax,0x4(%esp)
8010208d: 8b 45 08 mov 0x8(%ebp),%eax
80102090: 89 04 24 mov %eax,(%esp)
80102093: e8 9d 32 00 00 call 80105335 <strncmp>
}
80102098: c9 leave
80102099: c3 ret
8010209a <dirlookup>:
// Look for a directory entry in a directory.
// If found, set *poff to byte offset of entry.
struct inode*
dirlookup(struct inode *dp, char *name, uint *poff)
{
8010209a: 55 push %ebp
8010209b: 89 e5 mov %esp,%ebp
8010209d: 83 ec 38 sub $0x38,%esp
uint off, inum;
struct dirent de;
if(dp->type != T_DIR)
801020a0: 8b 45 08 mov 0x8(%ebp),%eax
801020a3: 0f b7 40 10 movzwl 0x10(%eax),%eax
801020a7: 66 83 f8 01 cmp $0x1,%ax
801020ab: 74 0c je 801020b9 <dirlookup+0x1f>
panic("dirlookup not DIR");
801020ad: c7 04 24 31 87 10 80 movl $0x80108731,(%esp)
801020b4: e8 81 e4 ff ff call 8010053a <panic>
for(off = 0; off < dp->size; off += sizeof(de)){
801020b9: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
801020c0: e9 87 00 00 00 jmp 8010214c <dirlookup+0xb2>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
801020c5: 8d 45 e0 lea -0x20(%ebp),%eax
801020c8: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
801020cf: 00
801020d0: 8b 55 f0 mov -0x10(%ebp),%edx
801020d3: 89 54 24 08 mov %edx,0x8(%esp)
801020d7: 89 44 24 04 mov %eax,0x4(%esp)
801020db: 8b 45 08 mov 0x8(%ebp),%eax
801020de: 89 04 24 mov %eax,(%esp)
801020e1: e8 8e fc ff ff call 80101d74 <readi>
801020e6: 83 f8 10 cmp $0x10,%eax
801020e9: 74 0c je 801020f7 <dirlookup+0x5d>
panic("dirlink read");
801020eb: c7 04 24 43 87 10 80 movl $0x80108743,(%esp)
801020f2: e8 43 e4 ff ff call 8010053a <panic>
if(de.inum == 0)
801020f7: 0f b7 45 e0 movzwl -0x20(%ebp),%eax
801020fb: 66 85 c0 test %ax,%ax
801020fe: 74 47 je 80102147 <dirlookup+0xad>
continue;
if(namecmp(name, de.name) == 0){
80102100: 8d 45 e0 lea -0x20(%ebp),%eax
80102103: 83 c0 02 add $0x2,%eax
80102106: 89 44 24 04 mov %eax,0x4(%esp)
8010210a: 8b 45 0c mov 0xc(%ebp),%eax
8010210d: 89 04 24 mov %eax,(%esp)
80102110: e8 63 ff ff ff call 80102078 <namecmp>
80102115: 85 c0 test %eax,%eax
80102117: 75 2f jne 80102148 <dirlookup+0xae>
// entry matches path element
if(poff)
80102119: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010211d: 74 08 je 80102127 <dirlookup+0x8d>
*poff = off;
8010211f: 8b 45 10 mov 0x10(%ebp),%eax
80102122: 8b 55 f0 mov -0x10(%ebp),%edx
80102125: 89 10 mov %edx,(%eax)
inum = de.inum;
80102127: 0f b7 45 e0 movzwl -0x20(%ebp),%eax
8010212b: 0f b7 c0 movzwl %ax,%eax
8010212e: 89 45 f4 mov %eax,-0xc(%ebp)
return iget(dp->dev, inum);
80102131: 8b 45 08 mov 0x8(%ebp),%eax
80102134: 8b 00 mov (%eax),%eax
80102136: 8b 55 f4 mov -0xc(%ebp),%edx
80102139: 89 54 24 04 mov %edx,0x4(%esp)
8010213d: 89 04 24 mov %eax,(%esp)
80102140: e8 31 f6 ff ff call 80101776 <iget>
80102145: eb 19 jmp 80102160 <dirlookup+0xc6>
for(off = 0; off < dp->size; off += sizeof(de)){
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlink read");
if(de.inum == 0)
continue;
80102147: 90 nop
struct dirent de;
if(dp->type != T_DIR)
panic("dirlookup not DIR");
for(off = 0; off < dp->size; off += sizeof(de)){
80102148: 83 45 f0 10 addl $0x10,-0x10(%ebp)
8010214c: 8b 45 08 mov 0x8(%ebp),%eax
8010214f: 8b 40 18 mov 0x18(%eax),%eax
80102152: 3b 45 f0 cmp -0x10(%ebp),%eax
80102155: 0f 87 6a ff ff ff ja 801020c5 <dirlookup+0x2b>
inum = de.inum;
return iget(dp->dev, inum);
}
}
return 0;
8010215b: b8 00 00 00 00 mov $0x0,%eax
}
80102160: c9 leave
80102161: c3 ret
80102162 <dirlink>:
// Write a new directory entry (name, inum) into the directory dp.
int
dirlink(struct inode *dp, char *name, uint inum)
{
80102162: 55 push %ebp
80102163: 89 e5 mov %esp,%ebp
80102165: 83 ec 38 sub $0x38,%esp
int off;
struct dirent de;
struct inode *ip;
// Check that name is not present.
if((ip = dirlookup(dp, name, 0)) != 0){
80102168: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
8010216f: 00
80102170: 8b 45 0c mov 0xc(%ebp),%eax
80102173: 89 44 24 04 mov %eax,0x4(%esp)
80102177: 8b 45 08 mov 0x8(%ebp),%eax
8010217a: 89 04 24 mov %eax,(%esp)
8010217d: e8 18 ff ff ff call 8010209a <dirlookup>
80102182: 89 45 f4 mov %eax,-0xc(%ebp)
80102185: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80102189: 74 15 je 801021a0 <dirlink+0x3e>
iput(ip);
8010218b: 8b 45 f4 mov -0xc(%ebp),%eax
8010218e: 89 04 24 mov %eax,(%esp)
80102191: e8 9b f8 ff ff call 80101a31 <iput>
return -1;
80102196: b8 ff ff ff ff mov $0xffffffff,%eax
8010219b: e9 b8 00 00 00 jmp 80102258 <dirlink+0xf6>
}
// Look for an empty dirent.
for(off = 0; off < dp->size; off += sizeof(de)){
801021a0: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
801021a7: eb 44 jmp 801021ed <dirlink+0x8b>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
801021a9: 8b 55 f0 mov -0x10(%ebp),%edx
801021ac: 8d 45 e0 lea -0x20(%ebp),%eax
801021af: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
801021b6: 00
801021b7: 89 54 24 08 mov %edx,0x8(%esp)
801021bb: 89 44 24 04 mov %eax,0x4(%esp)
801021bf: 8b 45 08 mov 0x8(%ebp),%eax
801021c2: 89 04 24 mov %eax,(%esp)
801021c5: e8 aa fb ff ff call 80101d74 <readi>
801021ca: 83 f8 10 cmp $0x10,%eax
801021cd: 74 0c je 801021db <dirlink+0x79>
panic("dirlink read");
801021cf: c7 04 24 43 87 10 80 movl $0x80108743,(%esp)
801021d6: e8 5f e3 ff ff call 8010053a <panic>
if(de.inum == 0)
801021db: 0f b7 45 e0 movzwl -0x20(%ebp),%eax
801021df: 66 85 c0 test %ax,%ax
801021e2: 74 18 je 801021fc <dirlink+0x9a>
iput(ip);
return -1;
}
// Look for an empty dirent.
for(off = 0; off < dp->size; off += sizeof(de)){
801021e4: 8b 45 f0 mov -0x10(%ebp),%eax
801021e7: 83 c0 10 add $0x10,%eax
801021ea: 89 45 f0 mov %eax,-0x10(%ebp)
801021ed: 8b 55 f0 mov -0x10(%ebp),%edx
801021f0: 8b 45 08 mov 0x8(%ebp),%eax
801021f3: 8b 40 18 mov 0x18(%eax),%eax
801021f6: 39 c2 cmp %eax,%edx
801021f8: 72 af jb 801021a9 <dirlink+0x47>
801021fa: eb 01 jmp 801021fd <dirlink+0x9b>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlink read");
if(de.inum == 0)
break;
801021fc: 90 nop
}
strncpy(de.name, name, DIRSIZ);
801021fd: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80102204: 00
80102205: 8b 45 0c mov 0xc(%ebp),%eax
80102208: 89 44 24 04 mov %eax,0x4(%esp)
8010220c: 8d 45 e0 lea -0x20(%ebp),%eax
8010220f: 83 c0 02 add $0x2,%eax
80102212: 89 04 24 mov %eax,(%esp)
80102215: e8 73 31 00 00 call 8010538d <strncpy>
de.inum = inum;
8010221a: 8b 45 10 mov 0x10(%ebp),%eax
8010221d: 66 89 45 e0 mov %ax,-0x20(%ebp)
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80102221: 8b 55 f0 mov -0x10(%ebp),%edx
80102224: 8d 45 e0 lea -0x20(%ebp),%eax
80102227: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
8010222e: 00
8010222f: 89 54 24 08 mov %edx,0x8(%esp)
80102233: 89 44 24 04 mov %eax,0x4(%esp)
80102237: 8b 45 08 mov 0x8(%ebp),%eax
8010223a: 89 04 24 mov %eax,(%esp)
8010223d: e8 9e fc ff ff call 80101ee0 <writei>
80102242: 83 f8 10 cmp $0x10,%eax
80102245: 74 0c je 80102253 <dirlink+0xf1>
panic("dirlink");
80102247: c7 04 24 50 87 10 80 movl $0x80108750,(%esp)
8010224e: e8 e7 e2 ff ff call 8010053a <panic>
return 0;
80102253: b8 00 00 00 00 mov $0x0,%eax
}
80102258: c9 leave
80102259: c3 ret
8010225a <skipelem>:
// skipelem("a", name) = "", setting name = "a"
// skipelem("", name) = skipelem("////", name) = 0
//
static char*
skipelem(char *path, char *name)
{
8010225a: 55 push %ebp
8010225b: 89 e5 mov %esp,%ebp
8010225d: 83 ec 28 sub $0x28,%esp
char *s;
int len;
while(*path == '/')
80102260: eb 04 jmp 80102266 <skipelem+0xc>
path++;
80102262: 83 45 08 01 addl $0x1,0x8(%ebp)
skipelem(char *path, char *name)
{
char *s;
int len;
while(*path == '/')
80102266: 8b 45 08 mov 0x8(%ebp),%eax
80102269: 0f b6 00 movzbl (%eax),%eax
8010226c: 3c 2f cmp $0x2f,%al
8010226e: 74 f2 je 80102262 <skipelem+0x8>
path++;
if(*path == 0)
80102270: 8b 45 08 mov 0x8(%ebp),%eax
80102273: 0f b6 00 movzbl (%eax),%eax
80102276: 84 c0 test %al,%al
80102278: 75 0a jne 80102284 <skipelem+0x2a>
return 0;
8010227a: b8 00 00 00 00 mov $0x0,%eax
8010227f: e9 86 00 00 00 jmp 8010230a <skipelem+0xb0>
s = path;
80102284: 8b 45 08 mov 0x8(%ebp),%eax
80102287: 89 45 f0 mov %eax,-0x10(%ebp)
while(*path != '/' && *path != 0)
8010228a: eb 04 jmp 80102290 <skipelem+0x36>
path++;
8010228c: 83 45 08 01 addl $0x1,0x8(%ebp)
while(*path == '/')
path++;
if(*path == 0)
return 0;
s = path;
while(*path != '/' && *path != 0)
80102290: 8b 45 08 mov 0x8(%ebp),%eax
80102293: 0f b6 00 movzbl (%eax),%eax
80102296: 3c 2f cmp $0x2f,%al
80102298: 74 0a je 801022a4 <skipelem+0x4a>
8010229a: 8b 45 08 mov 0x8(%ebp),%eax
8010229d: 0f b6 00 movzbl (%eax),%eax
801022a0: 84 c0 test %al,%al
801022a2: 75 e8 jne 8010228c <skipelem+0x32>
path++;
len = path - s;
801022a4: 8b 55 08 mov 0x8(%ebp),%edx
801022a7: 8b 45 f0 mov -0x10(%ebp),%eax
801022aa: 89 d1 mov %edx,%ecx
801022ac: 29 c1 sub %eax,%ecx
801022ae: 89 c8 mov %ecx,%eax
801022b0: 89 45 f4 mov %eax,-0xc(%ebp)
if(len >= DIRSIZ)
801022b3: 83 7d f4 0d cmpl $0xd,-0xc(%ebp)
801022b7: 7e 1c jle 801022d5 <skipelem+0x7b>
memmove(name, s, DIRSIZ);
801022b9: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
801022c0: 00
801022c1: 8b 45 f0 mov -0x10(%ebp),%eax
801022c4: 89 44 24 04 mov %eax,0x4(%esp)
801022c8: 8b 45 0c mov 0xc(%ebp),%eax
801022cb: 89 04 24 mov %eax,(%esp)
801022ce: e8 ba 2f 00 00 call 8010528d <memmove>
else {
memmove(name, s, len);
name[len] = 0;
}
while(*path == '/')
801022d3: eb 28 jmp 801022fd <skipelem+0xa3>
path++;
len = path - s;
if(len >= DIRSIZ)
memmove(name, s, DIRSIZ);
else {
memmove(name, s, len);
801022d5: 8b 45 f4 mov -0xc(%ebp),%eax
801022d8: 89 44 24 08 mov %eax,0x8(%esp)
801022dc: 8b 45 f0 mov -0x10(%ebp),%eax
801022df: 89 44 24 04 mov %eax,0x4(%esp)
801022e3: 8b 45 0c mov 0xc(%ebp),%eax
801022e6: 89 04 24 mov %eax,(%esp)
801022e9: e8 9f 2f 00 00 call 8010528d <memmove>
name[len] = 0;
801022ee: 8b 45 f4 mov -0xc(%ebp),%eax
801022f1: 03 45 0c add 0xc(%ebp),%eax
801022f4: c6 00 00 movb $0x0,(%eax)
}
while(*path == '/')
801022f7: eb 04 jmp 801022fd <skipelem+0xa3>
path++;
801022f9: 83 45 08 01 addl $0x1,0x8(%ebp)
memmove(name, s, DIRSIZ);
else {
memmove(name, s, len);
name[len] = 0;
}
while(*path == '/')
801022fd: 8b 45 08 mov 0x8(%ebp),%eax
80102300: 0f b6 00 movzbl (%eax),%eax
80102303: 3c 2f cmp $0x2f,%al
80102305: 74 f2 je 801022f9 <skipelem+0x9f>
path++;
return path;
80102307: 8b 45 08 mov 0x8(%ebp),%eax
}
8010230a: c9 leave
8010230b: c3 ret
8010230c <namex>:
// Look up and return the inode for a path name.
// If parent != 0, return the inode for the parent and copy the final
// path element into name, which must have room for DIRSIZ bytes.
static struct inode*
namex(char *path, int nameiparent, char *name)
{
8010230c: 55 push %ebp
8010230d: 89 e5 mov %esp,%ebp
8010230f: 83 ec 28 sub $0x28,%esp
struct inode *ip, *next;
if(*path == '/')
80102312: 8b 45 08 mov 0x8(%ebp),%eax
80102315: 0f b6 00 movzbl (%eax),%eax
80102318: 3c 2f cmp $0x2f,%al
8010231a: 75 1c jne 80102338 <namex+0x2c>
ip = iget(ROOTDEV, ROOTINO);
8010231c: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80102323: 00
80102324: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010232b: e8 46 f4 ff ff call 80101776 <iget>
80102330: 89 45 f0 mov %eax,-0x10(%ebp)
else
ip = idup(proc->cwd);
while((path = skipelem(path, name)) != 0){
80102333: e9 af 00 00 00 jmp 801023e7 <namex+0xdb>
struct inode *ip, *next;
if(*path == '/')
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(proc->cwd);
80102338: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010233e: 8b 40 68 mov 0x68(%eax),%eax
80102341: 89 04 24 mov %eax,(%esp)
80102344: e8 00 f5 ff ff call 80101849 <idup>
80102349: 89 45 f0 mov %eax,-0x10(%ebp)
while((path = skipelem(path, name)) != 0){
8010234c: e9 96 00 00 00 jmp 801023e7 <namex+0xdb>
ilock(ip);
80102351: 8b 45 f0 mov -0x10(%ebp),%eax
80102354: 89 04 24 mov %eax,(%esp)
80102357: e8 1f f5 ff ff call 8010187b <ilock>
if(ip->type != T_DIR){
8010235c: 8b 45 f0 mov -0x10(%ebp),%eax
8010235f: 0f b7 40 10 movzwl 0x10(%eax),%eax
80102363: 66 83 f8 01 cmp $0x1,%ax
80102367: 74 15 je 8010237e <namex+0x72>
iunlockput(ip);
80102369: 8b 45 f0 mov -0x10(%ebp),%eax
8010236c: 89 04 24 mov %eax,(%esp)
8010236f: e8 8e f7 ff ff call 80101b02 <iunlockput>
return 0;
80102374: b8 00 00 00 00 mov $0x0,%eax
80102379: e9 a3 00 00 00 jmp 80102421 <namex+0x115>
}
if(nameiparent && *path == '\0'){
8010237e: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
80102382: 74 1d je 801023a1 <namex+0x95>
80102384: 8b 45 08 mov 0x8(%ebp),%eax
80102387: 0f b6 00 movzbl (%eax),%eax
8010238a: 84 c0 test %al,%al
8010238c: 75 13 jne 801023a1 <namex+0x95>
// Stop one level early.
iunlock(ip);
8010238e: 8b 45 f0 mov -0x10(%ebp),%eax
80102391: 89 04 24 mov %eax,(%esp)
80102394: e8 33 f6 ff ff call 801019cc <iunlock>
return ip;
80102399: 8b 45 f0 mov -0x10(%ebp),%eax
8010239c: e9 80 00 00 00 jmp 80102421 <namex+0x115>
}
if((next = dirlookup(ip, name, 0)) == 0){
801023a1: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
801023a8: 00
801023a9: 8b 45 10 mov 0x10(%ebp),%eax
801023ac: 89 44 24 04 mov %eax,0x4(%esp)
801023b0: 8b 45 f0 mov -0x10(%ebp),%eax
801023b3: 89 04 24 mov %eax,(%esp)
801023b6: e8 df fc ff ff call 8010209a <dirlookup>
801023bb: 89 45 f4 mov %eax,-0xc(%ebp)
801023be: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801023c2: 75 12 jne 801023d6 <namex+0xca>
iunlockput(ip);
801023c4: 8b 45 f0 mov -0x10(%ebp),%eax
801023c7: 89 04 24 mov %eax,(%esp)
801023ca: e8 33 f7 ff ff call 80101b02 <iunlockput>
return 0;
801023cf: b8 00 00 00 00 mov $0x0,%eax
801023d4: eb 4b jmp 80102421 <namex+0x115>
}
iunlockput(ip);
801023d6: 8b 45 f0 mov -0x10(%ebp),%eax
801023d9: 89 04 24 mov %eax,(%esp)
801023dc: e8 21 f7 ff ff call 80101b02 <iunlockput>
ip = next;
801023e1: 8b 45 f4 mov -0xc(%ebp),%eax
801023e4: 89 45 f0 mov %eax,-0x10(%ebp)
if(*path == '/')
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(proc->cwd);
while((path = skipelem(path, name)) != 0){
801023e7: 8b 45 10 mov 0x10(%ebp),%eax
801023ea: 89 44 24 04 mov %eax,0x4(%esp)
801023ee: 8b 45 08 mov 0x8(%ebp),%eax
801023f1: 89 04 24 mov %eax,(%esp)
801023f4: e8 61 fe ff ff call 8010225a <skipelem>
801023f9: 89 45 08 mov %eax,0x8(%ebp)
801023fc: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
80102400: 0f 85 4b ff ff ff jne 80102351 <namex+0x45>
return 0;
}
iunlockput(ip);
ip = next;
}
if(nameiparent){
80102406: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
8010240a: 74 12 je 8010241e <namex+0x112>
iput(ip);
8010240c: 8b 45 f0 mov -0x10(%ebp),%eax
8010240f: 89 04 24 mov %eax,(%esp)
80102412: e8 1a f6 ff ff call 80101a31 <iput>
return 0;
80102417: b8 00 00 00 00 mov $0x0,%eax
8010241c: eb 03 jmp 80102421 <namex+0x115>
}
return ip;
8010241e: 8b 45 f0 mov -0x10(%ebp),%eax
}
80102421: c9 leave
80102422: c3 ret
80102423 <namei>:
struct inode*
namei(char *path)
{
80102423: 55 push %ebp
80102424: 89 e5 mov %esp,%ebp
80102426: 83 ec 28 sub $0x28,%esp
char name[DIRSIZ];
return namex(path, 0, name);
80102429: 8d 45 ea lea -0x16(%ebp),%eax
8010242c: 89 44 24 08 mov %eax,0x8(%esp)
80102430: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102437: 00
80102438: 8b 45 08 mov 0x8(%ebp),%eax
8010243b: 89 04 24 mov %eax,(%esp)
8010243e: e8 c9 fe ff ff call 8010230c <namex>
}
80102443: c9 leave
80102444: c3 ret
80102445 <nameiparent>:
struct inode*
nameiparent(char *path, char *name)
{
80102445: 55 push %ebp
80102446: 89 e5 mov %esp,%ebp
80102448: 83 ec 18 sub $0x18,%esp
return namex(path, 1, name);
8010244b: 8b 45 0c mov 0xc(%ebp),%eax
8010244e: 89 44 24 08 mov %eax,0x8(%esp)
80102452: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80102459: 00
8010245a: 8b 45 08 mov 0x8(%ebp),%eax
8010245d: 89 04 24 mov %eax,(%esp)
80102460: e8 a7 fe ff ff call 8010230c <namex>
}
80102465: c9 leave
80102466: c3 ret
...
80102468 <inb>:
// Routines to let C code use special x86 instructions.
static inline uchar
inb(ushort port)
{
80102468: 55 push %ebp
80102469: 89 e5 mov %esp,%ebp
8010246b: 83 ec 14 sub $0x14,%esp
8010246e: 8b 45 08 mov 0x8(%ebp),%eax
80102471: 66 89 45 ec mov %ax,-0x14(%ebp)
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102475: 0f b7 45 ec movzwl -0x14(%ebp),%eax
80102479: 89 c2 mov %eax,%edx
8010247b: ec in (%dx),%al
8010247c: 88 45 ff mov %al,-0x1(%ebp)
return data;
8010247f: 0f b6 45 ff movzbl -0x1(%ebp),%eax
}
80102483: c9 leave
80102484: c3 ret
80102485 <insl>:
static inline void
insl(int port, void *addr, int cnt)
{
80102485: 55 push %ebp
80102486: 89 e5 mov %esp,%ebp
80102488: 57 push %edi
80102489: 53 push %ebx
asm volatile("cld; rep insl" :
8010248a: 8b 55 08 mov 0x8(%ebp),%edx
8010248d: 8b 4d 0c mov 0xc(%ebp),%ecx
80102490: 8b 45 10 mov 0x10(%ebp),%eax
80102493: 89 cb mov %ecx,%ebx
80102495: 89 df mov %ebx,%edi
80102497: 89 c1 mov %eax,%ecx
80102499: fc cld
8010249a: f3 6d rep insl (%dx),%es:(%edi)
8010249c: 89 c8 mov %ecx,%eax
8010249e: 89 fb mov %edi,%ebx
801024a0: 89 5d 0c mov %ebx,0xc(%ebp)
801024a3: 89 45 10 mov %eax,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"d" (port), "0" (addr), "1" (cnt) :
"memory", "cc");
}
801024a6: 5b pop %ebx
801024a7: 5f pop %edi
801024a8: 5d pop %ebp
801024a9: c3 ret
801024aa <outb>:
static inline void
outb(ushort port, uchar data)
{
801024aa: 55 push %ebp
801024ab: 89 e5 mov %esp,%ebp
801024ad: 83 ec 08 sub $0x8,%esp
801024b0: 8b 55 08 mov 0x8(%ebp),%edx
801024b3: 8b 45 0c mov 0xc(%ebp),%eax
801024b6: 66 89 55 fc mov %dx,-0x4(%ebp)
801024ba: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801024bd: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
801024c1: 0f b7 55 fc movzwl -0x4(%ebp),%edx
801024c5: ee out %al,(%dx)
}
801024c6: c9 leave
801024c7: c3 ret
801024c8 <outsl>:
asm volatile("out %0,%1" : : "a" (data), "d" (port));
}
static inline void
outsl(int port, const void *addr, int cnt)
{
801024c8: 55 push %ebp
801024c9: 89 e5 mov %esp,%ebp
801024cb: 56 push %esi
801024cc: 53 push %ebx
asm volatile("cld; rep outsl" :
801024cd: 8b 55 08 mov 0x8(%ebp),%edx
801024d0: 8b 4d 0c mov 0xc(%ebp),%ecx
801024d3: 8b 45 10 mov 0x10(%ebp),%eax
801024d6: 89 cb mov %ecx,%ebx
801024d8: 89 de mov %ebx,%esi
801024da: 89 c1 mov %eax,%ecx
801024dc: fc cld
801024dd: f3 6f rep outsl %ds:(%esi),(%dx)
801024df: 89 c8 mov %ecx,%eax
801024e1: 89 f3 mov %esi,%ebx
801024e3: 89 5d 0c mov %ebx,0xc(%ebp)
801024e6: 89 45 10 mov %eax,0x10(%ebp)
"=S" (addr), "=c" (cnt) :
"d" (port), "0" (addr), "1" (cnt) :
"cc");
}
801024e9: 5b pop %ebx
801024ea: 5e pop %esi
801024eb: 5d pop %ebp
801024ec: c3 ret
801024ed <idewait>:
static void idestart(struct buf*);
// Wait for IDE disk to become ready.
static int
idewait(int checkerr)
{
801024ed: 55 push %ebp
801024ee: 89 e5 mov %esp,%ebp
801024f0: 83 ec 14 sub $0x14,%esp
int r;
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
801024f3: c7 04 24 f7 01 00 00 movl $0x1f7,(%esp)
801024fa: e8 69 ff ff ff call 80102468 <inb>
801024ff: 0f b6 c0 movzbl %al,%eax
80102502: 89 45 fc mov %eax,-0x4(%ebp)
80102505: 8b 45 fc mov -0x4(%ebp),%eax
80102508: 25 c0 00 00 00 and $0xc0,%eax
8010250d: 83 f8 40 cmp $0x40,%eax
80102510: 75 e1 jne 801024f3 <idewait+0x6>
;
if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0)
80102512: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
80102516: 74 11 je 80102529 <idewait+0x3c>
80102518: 8b 45 fc mov -0x4(%ebp),%eax
8010251b: 83 e0 21 and $0x21,%eax
8010251e: 85 c0 test %eax,%eax
80102520: 74 07 je 80102529 <idewait+0x3c>
return -1;
80102522: b8 ff ff ff ff mov $0xffffffff,%eax
80102527: eb 05 jmp 8010252e <idewait+0x41>
return 0;
80102529: b8 00 00 00 00 mov $0x0,%eax
}
8010252e: c9 leave
8010252f: c3 ret
80102530 <ideinit>:
void
ideinit(void)
{
80102530: 55 push %ebp
80102531: 89 e5 mov %esp,%ebp
80102533: 83 ec 28 sub $0x28,%esp
int i;
initlock(&idelock, "ide");
80102536: c7 44 24 04 58 87 10 movl $0x80108758,0x4(%esp)
8010253d: 80
8010253e: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
80102545: e8 00 2a 00 00 call 80104f4a <initlock>
picenable(IRQ_IDE);
8010254a: c7 04 24 0e 00 00 00 movl $0xe,(%esp)
80102551: e8 37 15 00 00 call 80103a8d <picenable>
ioapicenable(IRQ_IDE, ncpu - 1);
80102556: a1 20 ff 10 80 mov 0x8010ff20,%eax
8010255b: 83 e8 01 sub $0x1,%eax
8010255e: 89 44 24 04 mov %eax,0x4(%esp)
80102562: c7 04 24 0e 00 00 00 movl $0xe,(%esp)
80102569: e8 10 04 00 00 call 8010297e <ioapicenable>
idewait(0);
8010256e: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80102575: e8 73 ff ff ff call 801024ed <idewait>
// Check if disk 1 is present
outb(0x1f6, 0xe0 | (1<<4));
8010257a: c7 44 24 04 f0 00 00 movl $0xf0,0x4(%esp)
80102581: 00
80102582: c7 04 24 f6 01 00 00 movl $0x1f6,(%esp)
80102589: e8 1c ff ff ff call 801024aa <outb>
for(i=0; i<1000; i++){
8010258e: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80102595: eb 20 jmp 801025b7 <ideinit+0x87>
if(inb(0x1f7) != 0){
80102597: c7 04 24 f7 01 00 00 movl $0x1f7,(%esp)
8010259e: e8 c5 fe ff ff call 80102468 <inb>
801025a3: 84 c0 test %al,%al
801025a5: 74 0c je 801025b3 <ideinit+0x83>
havedisk1 = 1;
801025a7: c7 05 58 b6 10 80 01 movl $0x1,0x8010b658
801025ae: 00 00 00
break;
801025b1: eb 0d jmp 801025c0 <ideinit+0x90>
ioapicenable(IRQ_IDE, ncpu - 1);
idewait(0);
// Check if disk 1 is present
outb(0x1f6, 0xe0 | (1<<4));
for(i=0; i<1000; i++){
801025b3: 83 45 f4 01 addl $0x1,-0xc(%ebp)
801025b7: 81 7d f4 e7 03 00 00 cmpl $0x3e7,-0xc(%ebp)
801025be: 7e d7 jle 80102597 <ideinit+0x67>
break;
}
}
// Switch back to disk 0.
outb(0x1f6, 0xe0 | (0<<4));
801025c0: c7 44 24 04 e0 00 00 movl $0xe0,0x4(%esp)
801025c7: 00
801025c8: c7 04 24 f6 01 00 00 movl $0x1f6,(%esp)
801025cf: e8 d6 fe ff ff call 801024aa <outb>
}
801025d4: c9 leave
801025d5: c3 ret
801025d6 <idestart>:
// Start the request for b. Caller must hold idelock.
static void
idestart(struct buf *b)
{
801025d6: 55 push %ebp
801025d7: 89 e5 mov %esp,%ebp
801025d9: 83 ec 18 sub $0x18,%esp
if(b == 0)
801025dc: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
801025e0: 75 0c jne 801025ee <idestart+0x18>
panic("idestart");
801025e2: c7 04 24 5c 87 10 80 movl $0x8010875c,(%esp)
801025e9: e8 4c df ff ff call 8010053a <panic>
idewait(0);
801025ee: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801025f5: e8 f3 fe ff ff call 801024ed <idewait>
outb(0x3f6, 0); // generate interrupt
801025fa: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102601: 00
80102602: c7 04 24 f6 03 00 00 movl $0x3f6,(%esp)
80102609: e8 9c fe ff ff call 801024aa <outb>
outb(0x1f2, 1); // number of sectors
8010260e: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80102615: 00
80102616: c7 04 24 f2 01 00 00 movl $0x1f2,(%esp)
8010261d: e8 88 fe ff ff call 801024aa <outb>
outb(0x1f3, b->sector & 0xff);
80102622: 8b 45 08 mov 0x8(%ebp),%eax
80102625: 8b 40 08 mov 0x8(%eax),%eax
80102628: 0f b6 c0 movzbl %al,%eax
8010262b: 89 44 24 04 mov %eax,0x4(%esp)
8010262f: c7 04 24 f3 01 00 00 movl $0x1f3,(%esp)
80102636: e8 6f fe ff ff call 801024aa <outb>
outb(0x1f4, (b->sector >> 8) & 0xff);
8010263b: 8b 45 08 mov 0x8(%ebp),%eax
8010263e: 8b 40 08 mov 0x8(%eax),%eax
80102641: c1 e8 08 shr $0x8,%eax
80102644: 0f b6 c0 movzbl %al,%eax
80102647: 89 44 24 04 mov %eax,0x4(%esp)
8010264b: c7 04 24 f4 01 00 00 movl $0x1f4,(%esp)
80102652: e8 53 fe ff ff call 801024aa <outb>
outb(0x1f5, (b->sector >> 16) & 0xff);
80102657: 8b 45 08 mov 0x8(%ebp),%eax
8010265a: 8b 40 08 mov 0x8(%eax),%eax
8010265d: c1 e8 10 shr $0x10,%eax
80102660: 0f b6 c0 movzbl %al,%eax
80102663: 89 44 24 04 mov %eax,0x4(%esp)
80102667: c7 04 24 f5 01 00 00 movl $0x1f5,(%esp)
8010266e: e8 37 fe ff ff call 801024aa <outb>
outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((b->sector>>24)&0x0f));
80102673: 8b 45 08 mov 0x8(%ebp),%eax
80102676: 8b 40 04 mov 0x4(%eax),%eax
80102679: 83 e0 01 and $0x1,%eax
8010267c: 89 c2 mov %eax,%edx
8010267e: c1 e2 04 shl $0x4,%edx
80102681: 8b 45 08 mov 0x8(%ebp),%eax
80102684: 8b 40 08 mov 0x8(%eax),%eax
80102687: c1 e8 18 shr $0x18,%eax
8010268a: 83 e0 0f and $0xf,%eax
8010268d: 09 d0 or %edx,%eax
8010268f: 83 c8 e0 or $0xffffffe0,%eax
80102692: 0f b6 c0 movzbl %al,%eax
80102695: 89 44 24 04 mov %eax,0x4(%esp)
80102699: c7 04 24 f6 01 00 00 movl $0x1f6,(%esp)
801026a0: e8 05 fe ff ff call 801024aa <outb>
if(b->flags & B_DIRTY){
801026a5: 8b 45 08 mov 0x8(%ebp),%eax
801026a8: 8b 00 mov (%eax),%eax
801026aa: 83 e0 04 and $0x4,%eax
801026ad: 85 c0 test %eax,%eax
801026af: 74 34 je 801026e5 <idestart+0x10f>
outb(0x1f7, IDE_CMD_WRITE);
801026b1: c7 44 24 04 30 00 00 movl $0x30,0x4(%esp)
801026b8: 00
801026b9: c7 04 24 f7 01 00 00 movl $0x1f7,(%esp)
801026c0: e8 e5 fd ff ff call 801024aa <outb>
outsl(0x1f0, b->data, 512/4);
801026c5: 8b 45 08 mov 0x8(%ebp),%eax
801026c8: 83 c0 18 add $0x18,%eax
801026cb: c7 44 24 08 80 00 00 movl $0x80,0x8(%esp)
801026d2: 00
801026d3: 89 44 24 04 mov %eax,0x4(%esp)
801026d7: c7 04 24 f0 01 00 00 movl $0x1f0,(%esp)
801026de: e8 e5 fd ff ff call 801024c8 <outsl>
801026e3: eb 14 jmp 801026f9 <idestart+0x123>
} else {
outb(0x1f7, IDE_CMD_READ);
801026e5: c7 44 24 04 20 00 00 movl $0x20,0x4(%esp)
801026ec: 00
801026ed: c7 04 24 f7 01 00 00 movl $0x1f7,(%esp)
801026f4: e8 b1 fd ff ff call 801024aa <outb>
}
}
801026f9: c9 leave
801026fa: c3 ret
801026fb <ideintr>:
// Interrupt handler.
void
ideintr(void)
{
801026fb: 55 push %ebp
801026fc: 89 e5 mov %esp,%ebp
801026fe: 83 ec 28 sub $0x28,%esp
struct buf *b;
// First queued buffer is the active request.
acquire(&idelock);
80102701: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
80102708: e8 5e 28 00 00 call 80104f6b <acquire>
if((b = idequeue) == 0){
8010270d: a1 54 b6 10 80 mov 0x8010b654,%eax
80102712: 89 45 f4 mov %eax,-0xc(%ebp)
80102715: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80102719: 75 11 jne 8010272c <ideintr+0x31>
release(&idelock);
8010271b: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
80102722: e8 a5 28 00 00 call 80104fcc <release>
// cprintf("spurious IDE interrupt\n");
return;
80102727: e9 90 00 00 00 jmp 801027bc <ideintr+0xc1>
}
idequeue = b->qnext;
8010272c: 8b 45 f4 mov -0xc(%ebp),%eax
8010272f: 8b 40 14 mov 0x14(%eax),%eax
80102732: a3 54 b6 10 80 mov %eax,0x8010b654
// Read data if needed.
if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
80102737: 8b 45 f4 mov -0xc(%ebp),%eax
8010273a: 8b 00 mov (%eax),%eax
8010273c: 83 e0 04 and $0x4,%eax
8010273f: 85 c0 test %eax,%eax
80102741: 75 2e jne 80102771 <ideintr+0x76>
80102743: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010274a: e8 9e fd ff ff call 801024ed <idewait>
8010274f: 85 c0 test %eax,%eax
80102751: 78 1e js 80102771 <ideintr+0x76>
insl(0x1f0, b->data, 512/4);
80102753: 8b 45 f4 mov -0xc(%ebp),%eax
80102756: 83 c0 18 add $0x18,%eax
80102759: c7 44 24 08 80 00 00 movl $0x80,0x8(%esp)
80102760: 00
80102761: 89 44 24 04 mov %eax,0x4(%esp)
80102765: c7 04 24 f0 01 00 00 movl $0x1f0,(%esp)
8010276c: e8 14 fd ff ff call 80102485 <insl>
// Wake process waiting for this buf.
b->flags |= B_VALID;
80102771: 8b 45 f4 mov -0xc(%ebp),%eax
80102774: 8b 00 mov (%eax),%eax
80102776: 89 c2 mov %eax,%edx
80102778: 83 ca 02 or $0x2,%edx
8010277b: 8b 45 f4 mov -0xc(%ebp),%eax
8010277e: 89 10 mov %edx,(%eax)
b->flags &= ~B_DIRTY;
80102780: 8b 45 f4 mov -0xc(%ebp),%eax
80102783: 8b 00 mov (%eax),%eax
80102785: 89 c2 mov %eax,%edx
80102787: 83 e2 fb and $0xfffffffb,%edx
8010278a: 8b 45 f4 mov -0xc(%ebp),%eax
8010278d: 89 10 mov %edx,(%eax)
wakeup(b);
8010278f: 8b 45 f4 mov -0xc(%ebp),%eax
80102792: 89 04 24 mov %eax,(%esp)
80102795: e8 9f 25 00 00 call 80104d39 <wakeup>
// Start disk on next buf in queue.
if(idequeue != 0)
8010279a: a1 54 b6 10 80 mov 0x8010b654,%eax
8010279f: 85 c0 test %eax,%eax
801027a1: 74 0d je 801027b0 <ideintr+0xb5>
idestart(idequeue);
801027a3: a1 54 b6 10 80 mov 0x8010b654,%eax
801027a8: 89 04 24 mov %eax,(%esp)
801027ab: e8 26 fe ff ff call 801025d6 <idestart>
release(&idelock);
801027b0: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
801027b7: e8 10 28 00 00 call 80104fcc <release>
}
801027bc: c9 leave
801027bd: c3 ret
801027be <iderw>:
// Sync buf with disk.
// If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID.
// Else if B_VALID is not set, read buf from disk, set B_VALID.
void
iderw(struct buf *b)
{
801027be: 55 push %ebp
801027bf: 89 e5 mov %esp,%ebp
801027c1: 83 ec 28 sub $0x28,%esp
struct buf **pp;
if(!(b->flags & B_BUSY))
801027c4: 8b 45 08 mov 0x8(%ebp),%eax
801027c7: 8b 00 mov (%eax),%eax
801027c9: 83 e0 01 and $0x1,%eax
801027cc: 85 c0 test %eax,%eax
801027ce: 75 0c jne 801027dc <iderw+0x1e>
panic("iderw: buf not busy");
801027d0: c7 04 24 65 87 10 80 movl $0x80108765,(%esp)
801027d7: e8 5e dd ff ff call 8010053a <panic>
if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
801027dc: 8b 45 08 mov 0x8(%ebp),%eax
801027df: 8b 00 mov (%eax),%eax
801027e1: 83 e0 06 and $0x6,%eax
801027e4: 83 f8 02 cmp $0x2,%eax
801027e7: 75 0c jne 801027f5 <iderw+0x37>
panic("iderw: nothing to do");
801027e9: c7 04 24 79 87 10 80 movl $0x80108779,(%esp)
801027f0: e8 45 dd ff ff call 8010053a <panic>
if(b->dev != 0 && !havedisk1)
801027f5: 8b 45 08 mov 0x8(%ebp),%eax
801027f8: 8b 40 04 mov 0x4(%eax),%eax
801027fb: 85 c0 test %eax,%eax
801027fd: 74 15 je 80102814 <iderw+0x56>
801027ff: a1 58 b6 10 80 mov 0x8010b658,%eax
80102804: 85 c0 test %eax,%eax
80102806: 75 0c jne 80102814 <iderw+0x56>
panic("iderw: ide disk 1 not present");
80102808: c7 04 24 8e 87 10 80 movl $0x8010878e,(%esp)
8010280f: e8 26 dd ff ff call 8010053a <panic>
acquire(&idelock); //DOC:acquire-lock
80102814: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
8010281b: e8 4b 27 00 00 call 80104f6b <acquire>
// Append b to idequeue.
b->qnext = 0;
80102820: 8b 45 08 mov 0x8(%ebp),%eax
80102823: c7 40 14 00 00 00 00 movl $0x0,0x14(%eax)
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
8010282a: c7 45 f4 54 b6 10 80 movl $0x8010b654,-0xc(%ebp)
80102831: eb 0b jmp 8010283e <iderw+0x80>
80102833: 8b 45 f4 mov -0xc(%ebp),%eax
80102836: 8b 00 mov (%eax),%eax
80102838: 83 c0 14 add $0x14,%eax
8010283b: 89 45 f4 mov %eax,-0xc(%ebp)
8010283e: 8b 45 f4 mov -0xc(%ebp),%eax
80102841: 8b 00 mov (%eax),%eax
80102843: 85 c0 test %eax,%eax
80102845: 75 ec jne 80102833 <iderw+0x75>
;
*pp = b;
80102847: 8b 45 f4 mov -0xc(%ebp),%eax
8010284a: 8b 55 08 mov 0x8(%ebp),%edx
8010284d: 89 10 mov %edx,(%eax)
// Start disk if necessary.
if(idequeue == b)
8010284f: a1 54 b6 10 80 mov 0x8010b654,%eax
80102854: 3b 45 08 cmp 0x8(%ebp),%eax
80102857: 75 22 jne 8010287b <iderw+0xbd>
idestart(b);
80102859: 8b 45 08 mov 0x8(%ebp),%eax
8010285c: 89 04 24 mov %eax,(%esp)
8010285f: e8 72 fd ff ff call 801025d6 <idestart>
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
80102864: eb 16 jmp 8010287c <iderw+0xbe>
sleep(b, &idelock);
80102866: c7 44 24 04 20 b6 10 movl $0x8010b620,0x4(%esp)
8010286d: 80
8010286e: 8b 45 08 mov 0x8(%ebp),%eax
80102871: 89 04 24 mov %eax,(%esp)
80102874: e8 7a 23 00 00 call 80104bf3 <sleep>
80102879: eb 01 jmp 8010287c <iderw+0xbe>
// Start disk if necessary.
if(idequeue == b)
idestart(b);
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
8010287b: 90 nop
8010287c: 8b 45 08 mov 0x8(%ebp),%eax
8010287f: 8b 00 mov (%eax),%eax
80102881: 83 e0 06 and $0x6,%eax
80102884: 83 f8 02 cmp $0x2,%eax
80102887: 75 dd jne 80102866 <iderw+0xa8>
sleep(b, &idelock);
}
release(&idelock);
80102889: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
80102890: e8 37 27 00 00 call 80104fcc <release>
}
80102895: c9 leave
80102896: c3 ret
...
80102898 <ioapicread>:
uint data;
};
static uint
ioapicread(int reg)
{
80102898: 55 push %ebp
80102899: 89 e5 mov %esp,%ebp
ioapic->reg = reg;
8010289b: a1 54 f8 10 80 mov 0x8010f854,%eax
801028a0: 8b 55 08 mov 0x8(%ebp),%edx
801028a3: 89 10 mov %edx,(%eax)
return ioapic->data;
801028a5: a1 54 f8 10 80 mov 0x8010f854,%eax
801028aa: 8b 40 10 mov 0x10(%eax),%eax
}
801028ad: 5d pop %ebp
801028ae: c3 ret
801028af <ioapicwrite>:
static void
ioapicwrite(int reg, uint data)
{
801028af: 55 push %ebp
801028b0: 89 e5 mov %esp,%ebp
ioapic->reg = reg;
801028b2: a1 54 f8 10 80 mov 0x8010f854,%eax
801028b7: 8b 55 08 mov 0x8(%ebp),%edx
801028ba: 89 10 mov %edx,(%eax)
ioapic->data = data;
801028bc: a1 54 f8 10 80 mov 0x8010f854,%eax
801028c1: 8b 55 0c mov 0xc(%ebp),%edx
801028c4: 89 50 10 mov %edx,0x10(%eax)
}
801028c7: 5d pop %ebp
801028c8: c3 ret
801028c9 <ioapicinit>:
void
ioapicinit(void)
{
801028c9: 55 push %ebp
801028ca: 89 e5 mov %esp,%ebp
801028cc: 83 ec 28 sub $0x28,%esp
int i, id, maxintr;
if(!ismp)
801028cf: a1 24 f9 10 80 mov 0x8010f924,%eax
801028d4: 85 c0 test %eax,%eax
801028d6: 0f 84 9f 00 00 00 je 8010297b <ioapicinit+0xb2>
return;
ioapic = (volatile struct ioapic*)IOAPIC;
801028dc: c7 05 54 f8 10 80 00 movl $0xfec00000,0x8010f854
801028e3: 00 c0 fe
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
801028e6: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801028ed: e8 a6 ff ff ff call 80102898 <ioapicread>
801028f2: c1 e8 10 shr $0x10,%eax
801028f5: 25 ff 00 00 00 and $0xff,%eax
801028fa: 89 45 f4 mov %eax,-0xc(%ebp)
id = ioapicread(REG_ID) >> 24;
801028fd: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80102904: e8 8f ff ff ff call 80102898 <ioapicread>
80102909: c1 e8 18 shr $0x18,%eax
8010290c: 89 45 f0 mov %eax,-0x10(%ebp)
if(id != ioapicid)
8010290f: 0f b6 05 20 f9 10 80 movzbl 0x8010f920,%eax
80102916: 0f b6 c0 movzbl %al,%eax
80102919: 3b 45 f0 cmp -0x10(%ebp),%eax
8010291c: 74 0c je 8010292a <ioapicinit+0x61>
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
8010291e: c7 04 24 ac 87 10 80 movl $0x801087ac,(%esp)
80102925: e8 70 da ff ff call 8010039a <cprintf>
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
8010292a: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80102931: eb 3e jmp 80102971 <ioapicinit+0xa8>
ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
80102933: 8b 45 ec mov -0x14(%ebp),%eax
80102936: 83 c0 20 add $0x20,%eax
80102939: 0d 00 00 01 00 or $0x10000,%eax
8010293e: 8b 55 ec mov -0x14(%ebp),%edx
80102941: 83 c2 08 add $0x8,%edx
80102944: 01 d2 add %edx,%edx
80102946: 89 44 24 04 mov %eax,0x4(%esp)
8010294a: 89 14 24 mov %edx,(%esp)
8010294d: e8 5d ff ff ff call 801028af <ioapicwrite>
ioapicwrite(REG_TABLE+2*i+1, 0);
80102952: 8b 45 ec mov -0x14(%ebp),%eax
80102955: 83 c0 08 add $0x8,%eax
80102958: 01 c0 add %eax,%eax
8010295a: 83 c0 01 add $0x1,%eax
8010295d: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102964: 00
80102965: 89 04 24 mov %eax,(%esp)
80102968: e8 42 ff ff ff call 801028af <ioapicwrite>
if(id != ioapicid)
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
8010296d: 83 45 ec 01 addl $0x1,-0x14(%ebp)
80102971: 8b 45 ec mov -0x14(%ebp),%eax
80102974: 3b 45 f4 cmp -0xc(%ebp),%eax
80102977: 7e ba jle 80102933 <ioapicinit+0x6a>
80102979: eb 01 jmp 8010297c <ioapicinit+0xb3>
ioapicinit(void)
{
int i, id, maxintr;
if(!ismp)
return;
8010297b: 90 nop
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
ioapicwrite(REG_TABLE+2*i+1, 0);
}
}
8010297c: c9 leave
8010297d: c3 ret
8010297e <ioapicenable>:
void
ioapicenable(int irq, int cpunum)
{
8010297e: 55 push %ebp
8010297f: 89 e5 mov %esp,%ebp
80102981: 83 ec 08 sub $0x8,%esp
if(!ismp)
80102984: a1 24 f9 10 80 mov 0x8010f924,%eax
80102989: 85 c0 test %eax,%eax
8010298b: 74 39 je 801029c6 <ioapicenable+0x48>
return;
// Mark interrupt edge-triggered, active high,
// enabled, and routed to the given cpunum,
// which happens to be that cpu's APIC ID.
ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
8010298d: 8b 45 08 mov 0x8(%ebp),%eax
80102990: 83 c0 20 add $0x20,%eax
80102993: 8b 55 08 mov 0x8(%ebp),%edx
80102996: 83 c2 08 add $0x8,%edx
80102999: 01 d2 add %edx,%edx
8010299b: 89 44 24 04 mov %eax,0x4(%esp)
8010299f: 89 14 24 mov %edx,(%esp)
801029a2: e8 08 ff ff ff call 801028af <ioapicwrite>
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801029a7: 8b 45 0c mov 0xc(%ebp),%eax
801029aa: c1 e0 18 shl $0x18,%eax
801029ad: 8b 55 08 mov 0x8(%ebp),%edx
801029b0: 83 c2 08 add $0x8,%edx
801029b3: 01 d2 add %edx,%edx
801029b5: 83 c2 01 add $0x1,%edx
801029b8: 89 44 24 04 mov %eax,0x4(%esp)
801029bc: 89 14 24 mov %edx,(%esp)
801029bf: e8 eb fe ff ff call 801028af <ioapicwrite>
801029c4: eb 01 jmp 801029c7 <ioapicenable+0x49>
void
ioapicenable(int irq, int cpunum)
{
if(!ismp)
return;
801029c6: 90 nop
// Mark interrupt edge-triggered, active high,
// enabled, and routed to the given cpunum,
// which happens to be that cpu's APIC ID.
ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
}
801029c7: c9 leave
801029c8: c3 ret
801029c9: 00 00 add %al,(%eax)
...
801029cc <v2p>:
#define KERNBASE 0x80000000 // First kernel virtual address
#define KERNLINK (KERNBASE+EXTMEM) // Address where kernel is linked
#ifndef __ASSEMBLER__
static inline uint v2p(void *a) { return ((uint) (a)) - KERNBASE; }
801029cc: 55 push %ebp
801029cd: 89 e5 mov %esp,%ebp
801029cf: 8b 45 08 mov 0x8(%ebp),%eax
801029d2: 2d 00 00 00 80 sub $0x80000000,%eax
801029d7: 5d pop %ebp
801029d8: c3 ret
801029d9 <kinit1>:
// the pages mapped by entrypgdir on free list.
// 2. main() calls kinit2() with the rest of the physical pages
// after installing a full page table that maps them on all cores.
void
kinit1(void *vstart, void *vend)
{
801029d9: 55 push %ebp
801029da: 89 e5 mov %esp,%ebp
801029dc: 83 ec 18 sub $0x18,%esp
initlock(&kmem.lock, "kmem");
801029df: c7 44 24 04 de 87 10 movl $0x801087de,0x4(%esp)
801029e6: 80
801029e7: c7 04 24 60 f8 10 80 movl $0x8010f860,(%esp)
801029ee: e8 57 25 00 00 call 80104f4a <initlock>
kmem.use_lock = 0;
801029f3: c7 05 94 f8 10 80 00 movl $0x0,0x8010f894
801029fa: 00 00 00
freerange(vstart, vend);
801029fd: 8b 45 0c mov 0xc(%ebp),%eax
80102a00: 89 44 24 04 mov %eax,0x4(%esp)
80102a04: 8b 45 08 mov 0x8(%ebp),%eax
80102a07: 89 04 24 mov %eax,(%esp)
80102a0a: e8 26 00 00 00 call 80102a35 <freerange>
}
80102a0f: c9 leave
80102a10: c3 ret
80102a11 <kinit2>:
void
kinit2(void *vstart, void *vend)
{
80102a11: 55 push %ebp
80102a12: 89 e5 mov %esp,%ebp
80102a14: 83 ec 18 sub $0x18,%esp
freerange(vstart, vend);
80102a17: 8b 45 0c mov 0xc(%ebp),%eax
80102a1a: 89 44 24 04 mov %eax,0x4(%esp)
80102a1e: 8b 45 08 mov 0x8(%ebp),%eax
80102a21: 89 04 24 mov %eax,(%esp)
80102a24: e8 0c 00 00 00 call 80102a35 <freerange>
kmem.use_lock = 1;
80102a29: c7 05 94 f8 10 80 01 movl $0x1,0x8010f894
80102a30: 00 00 00
}
80102a33: c9 leave
80102a34: c3 ret
80102a35 <freerange>:
void
freerange(void *vstart, void *vend)
{
80102a35: 55 push %ebp
80102a36: 89 e5 mov %esp,%ebp
80102a38: 83 ec 28 sub $0x28,%esp
char *p;
p = (char*)PGROUNDUP((uint)vstart);
80102a3b: 8b 45 08 mov 0x8(%ebp),%eax
80102a3e: 05 ff 0f 00 00 add $0xfff,%eax
80102a43: 25 00 f0 ff ff and $0xfffff000,%eax
80102a48: 89 45 f4 mov %eax,-0xc(%ebp)
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102a4b: eb 12 jmp 80102a5f <freerange+0x2a>
kfree(p);
80102a4d: 8b 45 f4 mov -0xc(%ebp),%eax
80102a50: 89 04 24 mov %eax,(%esp)
80102a53: e8 19 00 00 00 call 80102a71 <kfree>
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102a58: 81 45 f4 00 10 00 00 addl $0x1000,-0xc(%ebp)
80102a5f: 8b 45 f4 mov -0xc(%ebp),%eax
80102a62: 8d 90 00 10 00 00 lea 0x1000(%eax),%edx
80102a68: 8b 45 0c mov 0xc(%ebp),%eax
80102a6b: 39 c2 cmp %eax,%edx
80102a6d: 76 de jbe 80102a4d <freerange+0x18>
kfree(p);
}
80102a6f: c9 leave
80102a70: c3 ret
80102a71 <kfree>:
// which normally should have been returned by a
// call to kalloc(). (The exception is when
// initializing the allocator; see kinit above.)
void
kfree(char *v)
{
80102a71: 55 push %ebp
80102a72: 89 e5 mov %esp,%ebp
80102a74: 83 ec 28 sub $0x28,%esp
struct run *r;
if((uint)v % PGSIZE || v < end || v2p(v) >= PHYSTOP)
80102a77: 8b 45 08 mov 0x8(%ebp),%eax
80102a7a: 25 ff 0f 00 00 and $0xfff,%eax
80102a7f: 85 c0 test %eax,%eax
80102a81: 75 1b jne 80102a9e <kfree+0x2d>
80102a83: 81 7d 08 1c 29 11 80 cmpl $0x8011291c,0x8(%ebp)
80102a8a: 72 12 jb 80102a9e <kfree+0x2d>
80102a8c: 8b 45 08 mov 0x8(%ebp),%eax
80102a8f: 89 04 24 mov %eax,(%esp)
80102a92: e8 35 ff ff ff call 801029cc <v2p>
80102a97: 3d ff ff ff 0d cmp $0xdffffff,%eax
80102a9c: 76 0c jbe 80102aaa <kfree+0x39>
panic("kfree");
80102a9e: c7 04 24 e3 87 10 80 movl $0x801087e3,(%esp)
80102aa5: e8 90 da ff ff call 8010053a <panic>
// Fill with junk to catch dangling refs.
memset(v, 1, PGSIZE);
80102aaa: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80102ab1: 00
80102ab2: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80102ab9: 00
80102aba: 8b 45 08 mov 0x8(%ebp),%eax
80102abd: 89 04 24 mov %eax,(%esp)
80102ac0: e8 f5 26 00 00 call 801051ba <memset>
if(kmem.use_lock)
80102ac5: a1 94 f8 10 80 mov 0x8010f894,%eax
80102aca: 85 c0 test %eax,%eax
80102acc: 74 0c je 80102ada <kfree+0x69>
acquire(&kmem.lock);
80102ace: c7 04 24 60 f8 10 80 movl $0x8010f860,(%esp)
80102ad5: e8 91 24 00 00 call 80104f6b <acquire>
r = (struct run*)v;
80102ada: 8b 45 08 mov 0x8(%ebp),%eax
80102add: 89 45 f4 mov %eax,-0xc(%ebp)
r->next = kmem.freelist;
80102ae0: 8b 15 98 f8 10 80 mov 0x8010f898,%edx
80102ae6: 8b 45 f4 mov -0xc(%ebp),%eax
80102ae9: 89 10 mov %edx,(%eax)
kmem.freelist = r;
80102aeb: 8b 45 f4 mov -0xc(%ebp),%eax
80102aee: a3 98 f8 10 80 mov %eax,0x8010f898
if(kmem.use_lock)
80102af3: a1 94 f8 10 80 mov 0x8010f894,%eax
80102af8: 85 c0 test %eax,%eax
80102afa: 74 0c je 80102b08 <kfree+0x97>
release(&kmem.lock);
80102afc: c7 04 24 60 f8 10 80 movl $0x8010f860,(%esp)
80102b03: e8 c4 24 00 00 call 80104fcc <release>
}
80102b08: c9 leave
80102b09: c3 ret
80102b0a <kalloc>:
// Allocate one 4096-byte page of physical memory.
// Returns a pointer that the kernel can use.
// Returns 0 if the memory cannot be allocated.
char*
kalloc(void)
{
80102b0a: 55 push %ebp
80102b0b: 89 e5 mov %esp,%ebp
80102b0d: 83 ec 28 sub $0x28,%esp
struct run *r;
if(kmem.use_lock)
80102b10: a1 94 f8 10 80 mov 0x8010f894,%eax
80102b15: 85 c0 test %eax,%eax
80102b17: 74 0c je 80102b25 <kalloc+0x1b>
acquire(&kmem.lock);
80102b19: c7 04 24 60 f8 10 80 movl $0x8010f860,(%esp)
80102b20: e8 46 24 00 00 call 80104f6b <acquire>
r = kmem.freelist;
80102b25: a1 98 f8 10 80 mov 0x8010f898,%eax
80102b2a: 89 45 f4 mov %eax,-0xc(%ebp)
if(r)
80102b2d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80102b31: 74 0a je 80102b3d <kalloc+0x33>
kmem.freelist = r->next;
80102b33: 8b 45 f4 mov -0xc(%ebp),%eax
80102b36: 8b 00 mov (%eax),%eax
80102b38: a3 98 f8 10 80 mov %eax,0x8010f898
if(kmem.use_lock)
80102b3d: a1 94 f8 10 80 mov 0x8010f894,%eax
80102b42: 85 c0 test %eax,%eax
80102b44: 74 0c je 80102b52 <kalloc+0x48>
release(&kmem.lock);
80102b46: c7 04 24 60 f8 10 80 movl $0x8010f860,(%esp)
80102b4d: e8 7a 24 00 00 call 80104fcc <release>
return (char*)r;
80102b52: 8b 45 f4 mov -0xc(%ebp),%eax
}
80102b55: c9 leave
80102b56: c3 ret
...
80102b58 <inb>:
// Routines to let C code use special x86 instructions.
static inline uchar
inb(ushort port)
{
80102b58: 55 push %ebp
80102b59: 89 e5 mov %esp,%ebp
80102b5b: 83 ec 14 sub $0x14,%esp
80102b5e: 8b 45 08 mov 0x8(%ebp),%eax
80102b61: 66 89 45 ec mov %ax,-0x14(%ebp)
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b65: 0f b7 45 ec movzwl -0x14(%ebp),%eax
80102b69: 89 c2 mov %eax,%edx
80102b6b: ec in (%dx),%al
80102b6c: 88 45 ff mov %al,-0x1(%ebp)
return data;
80102b6f: 0f b6 45 ff movzbl -0x1(%ebp),%eax
}
80102b73: c9 leave
80102b74: c3 ret
80102b75 <kbdgetc>:
#include "defs.h"
#include "kbd.h"
int
kbdgetc(void)
{
80102b75: 55 push %ebp
80102b76: 89 e5 mov %esp,%ebp
80102b78: 83 ec 14 sub $0x14,%esp
static uchar *charcode[4] = {
normalmap, shiftmap, ctlmap, ctlmap
};
uint st, data, c;
st = inb(KBSTATP);
80102b7b: c7 04 24 64 00 00 00 movl $0x64,(%esp)
80102b82: e8 d1 ff ff ff call 80102b58 <inb>
80102b87: 0f b6 c0 movzbl %al,%eax
80102b8a: 89 45 f4 mov %eax,-0xc(%ebp)
if((st & KBS_DIB) == 0)
80102b8d: 8b 45 f4 mov -0xc(%ebp),%eax
80102b90: 83 e0 01 and $0x1,%eax
80102b93: 85 c0 test %eax,%eax
80102b95: 75 0a jne 80102ba1 <kbdgetc+0x2c>
return -1;
80102b97: b8 ff ff ff ff mov $0xffffffff,%eax
80102b9c: e9 20 01 00 00 jmp 80102cc1 <kbdgetc+0x14c>
data = inb(KBDATAP);
80102ba1: c7 04 24 60 00 00 00 movl $0x60,(%esp)
80102ba8: e8 ab ff ff ff call 80102b58 <inb>
80102bad: 0f b6 c0 movzbl %al,%eax
80102bb0: 89 45 f8 mov %eax,-0x8(%ebp)
if(data == 0xE0){
80102bb3: 81 7d f8 e0 00 00 00 cmpl $0xe0,-0x8(%ebp)
80102bba: 75 17 jne 80102bd3 <kbdgetc+0x5e>
shift |= E0ESC;
80102bbc: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102bc1: 83 c8 40 or $0x40,%eax
80102bc4: a3 5c b6 10 80 mov %eax,0x8010b65c
return 0;
80102bc9: b8 00 00 00 00 mov $0x0,%eax
80102bce: e9 ee 00 00 00 jmp 80102cc1 <kbdgetc+0x14c>
} else if(data & 0x80){
80102bd3: 8b 45 f8 mov -0x8(%ebp),%eax
80102bd6: 25 80 00 00 00 and $0x80,%eax
80102bdb: 85 c0 test %eax,%eax
80102bdd: 74 44 je 80102c23 <kbdgetc+0xae>
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
80102bdf: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102be4: 83 e0 40 and $0x40,%eax
80102be7: 85 c0 test %eax,%eax
80102be9: 75 08 jne 80102bf3 <kbdgetc+0x7e>
80102beb: 8b 45 f8 mov -0x8(%ebp),%eax
80102bee: 83 e0 7f and $0x7f,%eax
80102bf1: eb 03 jmp 80102bf6 <kbdgetc+0x81>
80102bf3: 8b 45 f8 mov -0x8(%ebp),%eax
80102bf6: 89 45 f8 mov %eax,-0x8(%ebp)
shift &= ~(shiftcode[data] | E0ESC);
80102bf9: 8b 45 f8 mov -0x8(%ebp),%eax
80102bfc: 0f b6 80 20 90 10 80 movzbl -0x7fef6fe0(%eax),%eax
80102c03: 83 c8 40 or $0x40,%eax
80102c06: 0f b6 c0 movzbl %al,%eax
80102c09: f7 d0 not %eax
80102c0b: 89 c2 mov %eax,%edx
80102c0d: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c12: 21 d0 and %edx,%eax
80102c14: a3 5c b6 10 80 mov %eax,0x8010b65c
return 0;
80102c19: b8 00 00 00 00 mov $0x0,%eax
80102c1e: e9 9e 00 00 00 jmp 80102cc1 <kbdgetc+0x14c>
} else if(shift & E0ESC){
80102c23: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c28: 83 e0 40 and $0x40,%eax
80102c2b: 85 c0 test %eax,%eax
80102c2d: 74 14 je 80102c43 <kbdgetc+0xce>
// Last character was an E0 escape; or with 0x80
data |= 0x80;
80102c2f: 81 4d f8 80 00 00 00 orl $0x80,-0x8(%ebp)
shift &= ~E0ESC;
80102c36: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c3b: 83 e0 bf and $0xffffffbf,%eax
80102c3e: a3 5c b6 10 80 mov %eax,0x8010b65c
}
shift |= shiftcode[data];
80102c43: 8b 45 f8 mov -0x8(%ebp),%eax
80102c46: 0f b6 80 20 90 10 80 movzbl -0x7fef6fe0(%eax),%eax
80102c4d: 0f b6 d0 movzbl %al,%edx
80102c50: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c55: 09 d0 or %edx,%eax
80102c57: a3 5c b6 10 80 mov %eax,0x8010b65c
shift ^= togglecode[data];
80102c5c: 8b 45 f8 mov -0x8(%ebp),%eax
80102c5f: 0f b6 80 20 91 10 80 movzbl -0x7fef6ee0(%eax),%eax
80102c66: 0f b6 d0 movzbl %al,%edx
80102c69: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c6e: 31 d0 xor %edx,%eax
80102c70: a3 5c b6 10 80 mov %eax,0x8010b65c
c = charcode[shift & (CTL | SHIFT)][data];
80102c75: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c7a: 83 e0 03 and $0x3,%eax
80102c7d: 8b 04 85 20 95 10 80 mov -0x7fef6ae0(,%eax,4),%eax
80102c84: 03 45 f8 add -0x8(%ebp),%eax
80102c87: 0f b6 00 movzbl (%eax),%eax
80102c8a: 0f b6 c0 movzbl %al,%eax
80102c8d: 89 45 fc mov %eax,-0x4(%ebp)
if(shift & CAPSLOCK){
80102c90: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c95: 83 e0 08 and $0x8,%eax
80102c98: 85 c0 test %eax,%eax
80102c9a: 74 22 je 80102cbe <kbdgetc+0x149>
if('a' <= c && c <= 'z')
80102c9c: 83 7d fc 60 cmpl $0x60,-0x4(%ebp)
80102ca0: 76 0c jbe 80102cae <kbdgetc+0x139>
80102ca2: 83 7d fc 7a cmpl $0x7a,-0x4(%ebp)
80102ca6: 77 06 ja 80102cae <kbdgetc+0x139>
c += 'A' - 'a';
80102ca8: 83 6d fc 20 subl $0x20,-0x4(%ebp)
shift |= shiftcode[data];
shift ^= togglecode[data];
c = charcode[shift & (CTL | SHIFT)][data];
if(shift & CAPSLOCK){
if('a' <= c && c <= 'z')
80102cac: eb 10 jmp 80102cbe <kbdgetc+0x149>
c += 'A' - 'a';
else if('A' <= c && c <= 'Z')
80102cae: 83 7d fc 40 cmpl $0x40,-0x4(%ebp)
80102cb2: 76 0a jbe 80102cbe <kbdgetc+0x149>
80102cb4: 83 7d fc 5a cmpl $0x5a,-0x4(%ebp)
80102cb8: 77 04 ja 80102cbe <kbdgetc+0x149>
c += 'a' - 'A';
80102cba: 83 45 fc 20 addl $0x20,-0x4(%ebp)
}
return c;
80102cbe: 8b 45 fc mov -0x4(%ebp),%eax
}
80102cc1: c9 leave
80102cc2: c3 ret
80102cc3 <kbdintr>:
void
kbdintr(void)
{
80102cc3: 55 push %ebp
80102cc4: 89 e5 mov %esp,%ebp
80102cc6: 83 ec 18 sub $0x18,%esp
consoleintr(kbdgetc);
80102cc9: c7 04 24 75 2b 10 80 movl $0x80102b75,(%esp)
80102cd0: e8 d6 da ff ff call 801007ab <consoleintr>
}
80102cd5: c9 leave
80102cd6: c3 ret
...
80102cd8 <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
80102cd8: 55 push %ebp
80102cd9: 89 e5 mov %esp,%ebp
80102cdb: 83 ec 08 sub $0x8,%esp
80102cde: 8b 55 08 mov 0x8(%ebp),%edx
80102ce1: 8b 45 0c mov 0xc(%ebp),%eax
80102ce4: 66 89 55 fc mov %dx,-0x4(%ebp)
80102ce8: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102ceb: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
80102cef: 0f b7 55 fc movzwl -0x4(%ebp),%edx
80102cf3: ee out %al,(%dx)
}
80102cf4: c9 leave
80102cf5: c3 ret
80102cf6 <readeflags>:
asm volatile("ltr %0" : : "r" (sel));
}
static inline uint
readeflags(void)
{
80102cf6: 55 push %ebp
80102cf7: 89 e5 mov %esp,%ebp
80102cf9: 83 ec 10 sub $0x10,%esp
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80102cfc: 9c pushf
80102cfd: 58 pop %eax
80102cfe: 89 45 fc mov %eax,-0x4(%ebp)
return eflags;
80102d01: 8b 45 fc mov -0x4(%ebp),%eax
}
80102d04: c9 leave
80102d05: c3 ret
80102d06 <lapicw>:
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
80102d06: 55 push %ebp
80102d07: 89 e5 mov %esp,%ebp
lapic[index] = value;
80102d09: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102d0e: 8b 55 08 mov 0x8(%ebp),%edx
80102d11: c1 e2 02 shl $0x2,%edx
80102d14: 8d 14 10 lea (%eax,%edx,1),%edx
80102d17: 8b 45 0c mov 0xc(%ebp),%eax
80102d1a: 89 02 mov %eax,(%edx)
lapic[ID]; // wait for write to finish, by reading
80102d1c: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102d21: 83 c0 20 add $0x20,%eax
80102d24: 8b 00 mov (%eax),%eax
}
80102d26: 5d pop %ebp
80102d27: c3 ret
80102d28 <lapicinit>:
//PAGEBREAK!
void
lapicinit(void)
{
80102d28: 55 push %ebp
80102d29: 89 e5 mov %esp,%ebp
80102d2b: 83 ec 08 sub $0x8,%esp
if(!lapic)
80102d2e: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102d33: 85 c0 test %eax,%eax
80102d35: 0f 84 46 01 00 00 je 80102e81 <lapicinit+0x159>
return;
// Enable local APIC; set spurious interrupt vector.
lapicw(SVR, ENABLE | (T_IRQ0 + IRQ_SPURIOUS));
80102d3b: c7 44 24 04 3f 01 00 movl $0x13f,0x4(%esp)
80102d42: 00
80102d43: c7 04 24 3c 00 00 00 movl $0x3c,(%esp)
80102d4a: e8 b7 ff ff ff call 80102d06 <lapicw>
// The timer repeatedly counts down at bus frequency
// from lapic[TICR] and then issues an interrupt.
// If xv6 cared more about precise timekeeping,
// TICR would be calibrated using an external time source.
lapicw(TDCR, X1);
80102d4f: c7 44 24 04 0b 00 00 movl $0xb,0x4(%esp)
80102d56: 00
80102d57: c7 04 24 f8 00 00 00 movl $0xf8,(%esp)
80102d5e: e8 a3 ff ff ff call 80102d06 <lapicw>
lapicw(TIMER, PERIODIC | (T_IRQ0 + IRQ_TIMER));
80102d63: c7 44 24 04 20 00 02 movl $0x20020,0x4(%esp)
80102d6a: 00
80102d6b: c7 04 24 c8 00 00 00 movl $0xc8,(%esp)
80102d72: e8 8f ff ff ff call 80102d06 <lapicw>
lapicw(TICR, 10000000);
80102d77: c7 44 24 04 80 96 98 movl $0x989680,0x4(%esp)
80102d7e: 00
80102d7f: c7 04 24 e0 00 00 00 movl $0xe0,(%esp)
80102d86: e8 7b ff ff ff call 80102d06 <lapicw>
// Disable logical interrupt lines.
lapicw(LINT0, MASKED);
80102d8b: c7 44 24 04 00 00 01 movl $0x10000,0x4(%esp)
80102d92: 00
80102d93: c7 04 24 d4 00 00 00 movl $0xd4,(%esp)
80102d9a: e8 67 ff ff ff call 80102d06 <lapicw>
lapicw(LINT1, MASKED);
80102d9f: c7 44 24 04 00 00 01 movl $0x10000,0x4(%esp)
80102da6: 00
80102da7: c7 04 24 d8 00 00 00 movl $0xd8,(%esp)
80102dae: e8 53 ff ff ff call 80102d06 <lapicw>
// Disable performance counter overflow interrupts
// on machines that provide that interrupt entry.
if(((lapic[VER]>>16) & 0xFF) >= 4)
80102db3: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102db8: 83 c0 30 add $0x30,%eax
80102dbb: 8b 00 mov (%eax),%eax
80102dbd: c1 e8 10 shr $0x10,%eax
80102dc0: 25 ff 00 00 00 and $0xff,%eax
80102dc5: 83 f8 03 cmp $0x3,%eax
80102dc8: 76 14 jbe 80102dde <lapicinit+0xb6>
lapicw(PCINT, MASKED);
80102dca: c7 44 24 04 00 00 01 movl $0x10000,0x4(%esp)
80102dd1: 00
80102dd2: c7 04 24 d0 00 00 00 movl $0xd0,(%esp)
80102dd9: e8 28 ff ff ff call 80102d06 <lapicw>
// Map error interrupt to IRQ_ERROR.
lapicw(ERROR, T_IRQ0 + IRQ_ERROR);
80102dde: c7 44 24 04 33 00 00 movl $0x33,0x4(%esp)
80102de5: 00
80102de6: c7 04 24 dc 00 00 00 movl $0xdc,(%esp)
80102ded: e8 14 ff ff ff call 80102d06 <lapicw>
// Clear error status register (requires back-to-back writes).
lapicw(ESR, 0);
80102df2: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102df9: 00
80102dfa: c7 04 24 a0 00 00 00 movl $0xa0,(%esp)
80102e01: e8 00 ff ff ff call 80102d06 <lapicw>
lapicw(ESR, 0);
80102e06: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102e0d: 00
80102e0e: c7 04 24 a0 00 00 00 movl $0xa0,(%esp)
80102e15: e8 ec fe ff ff call 80102d06 <lapicw>
// Ack any outstanding interrupts.
lapicw(EOI, 0);
80102e1a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102e21: 00
80102e22: c7 04 24 2c 00 00 00 movl $0x2c,(%esp)
80102e29: e8 d8 fe ff ff call 80102d06 <lapicw>
// Send an Init Level De-Assert to synchronise arbitration ID's.
lapicw(ICRHI, 0);
80102e2e: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102e35: 00
80102e36: c7 04 24 c4 00 00 00 movl $0xc4,(%esp)
80102e3d: e8 c4 fe ff ff call 80102d06 <lapicw>
lapicw(ICRLO, BCAST | INIT | LEVEL);
80102e42: c7 44 24 04 00 85 08 movl $0x88500,0x4(%esp)
80102e49: 00
80102e4a: c7 04 24 c0 00 00 00 movl $0xc0,(%esp)
80102e51: e8 b0 fe ff ff call 80102d06 <lapicw>
while(lapic[ICRLO] & DELIVS)
80102e56: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102e5b: 05 00 03 00 00 add $0x300,%eax
80102e60: 8b 00 mov (%eax),%eax
80102e62: 25 00 10 00 00 and $0x1000,%eax
80102e67: 85 c0 test %eax,%eax
80102e69: 75 eb jne 80102e56 <lapicinit+0x12e>
;
// Enable interrupts on the APIC (but not on the processor).
lapicw(TPR, 0);
80102e6b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102e72: 00
80102e73: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80102e7a: e8 87 fe ff ff call 80102d06 <lapicw>
80102e7f: eb 01 jmp 80102e82 <lapicinit+0x15a>
void
lapicinit(void)
{
if(!lapic)
return;
80102e81: 90 nop
while(lapic[ICRLO] & DELIVS)
;
// Enable interrupts on the APIC (but not on the processor).
lapicw(TPR, 0);
}
80102e82: c9 leave
80102e83: c3 ret
80102e84 <cpunum>:
int
cpunum(void)
{
80102e84: 55 push %ebp
80102e85: 89 e5 mov %esp,%ebp
80102e87: 83 ec 18 sub $0x18,%esp
// Cannot call cpu when interrupts are enabled:
// result not guaranteed to last long enough to be used!
// Would prefer to panic but even printing is chancy here:
// almost everything, including cprintf and panic, calls cpu,
// often indirectly through acquire and release.
if(readeflags()&FL_IF){
80102e8a: e8 67 fe ff ff call 80102cf6 <readeflags>
80102e8f: 25 00 02 00 00 and $0x200,%eax
80102e94: 85 c0 test %eax,%eax
80102e96: 74 29 je 80102ec1 <cpunum+0x3d>
static int n;
if(n++ == 0)
80102e98: a1 60 b6 10 80 mov 0x8010b660,%eax
80102e9d: 85 c0 test %eax,%eax
80102e9f: 0f 94 c2 sete %dl
80102ea2: 83 c0 01 add $0x1,%eax
80102ea5: a3 60 b6 10 80 mov %eax,0x8010b660
80102eaa: 84 d2 test %dl,%dl
80102eac: 74 13 je 80102ec1 <cpunum+0x3d>
cprintf("cpu called from %x with interrupts enabled\n",
80102eae: 8b 45 04 mov 0x4(%ebp),%eax
80102eb1: 89 44 24 04 mov %eax,0x4(%esp)
80102eb5: c7 04 24 ec 87 10 80 movl $0x801087ec,(%esp)
80102ebc: e8 d9 d4 ff ff call 8010039a <cprintf>
__builtin_return_address(0));
}
if(lapic)
80102ec1: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102ec6: 85 c0 test %eax,%eax
80102ec8: 74 0f je 80102ed9 <cpunum+0x55>
return lapic[ID]>>24;
80102eca: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102ecf: 83 c0 20 add $0x20,%eax
80102ed2: 8b 00 mov (%eax),%eax
80102ed4: c1 e8 18 shr $0x18,%eax
80102ed7: eb 05 jmp 80102ede <cpunum+0x5a>
return 0;
80102ed9: b8 00 00 00 00 mov $0x0,%eax
}
80102ede: c9 leave
80102edf: c3 ret
80102ee0 <lapiceoi>:
// Acknowledge interrupt.
void
lapiceoi(void)
{
80102ee0: 55 push %ebp
80102ee1: 89 e5 mov %esp,%ebp
80102ee3: 83 ec 08 sub $0x8,%esp
if(lapic)
80102ee6: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102eeb: 85 c0 test %eax,%eax
80102eed: 74 14 je 80102f03 <lapiceoi+0x23>
lapicw(EOI, 0);
80102eef: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102ef6: 00
80102ef7: c7 04 24 2c 00 00 00 movl $0x2c,(%esp)
80102efe: e8 03 fe ff ff call 80102d06 <lapicw>
}
80102f03: c9 leave
80102f04: c3 ret
80102f05 <microdelay>:
// Spin for a given number of microseconds.
// On real hardware would want to tune this dynamically.
void
microdelay(int us)
{
80102f05: 55 push %ebp
80102f06: 89 e5 mov %esp,%ebp
}
80102f08: 5d pop %ebp
80102f09: c3 ret
80102f0a <lapicstartap>:
// Start additional processor running entry code at addr.
// See Appendix B of MultiProcessor Specification.
void
lapicstartap(uchar apicid, uint addr)
{
80102f0a: 55 push %ebp
80102f0b: 89 e5 mov %esp,%ebp
80102f0d: 83 ec 1c sub $0x1c,%esp
80102f10: 8b 45 08 mov 0x8(%ebp),%eax
80102f13: 88 45 ec mov %al,-0x14(%ebp)
ushort *wrv;
// "The BSP must initialize CMOS shutdown code to 0AH
// and the warm reset vector (DWORD based at 40:67) to point at
// the AP startup code prior to the [universal startup algorithm]."
outb(IO_RTC, 0xF); // offset 0xF is shutdown code
80102f16: c7 44 24 04 0f 00 00 movl $0xf,0x4(%esp)
80102f1d: 00
80102f1e: c7 04 24 70 00 00 00 movl $0x70,(%esp)
80102f25: e8 ae fd ff ff call 80102cd8 <outb>
outb(IO_RTC+1, 0x0A);
80102f2a: c7 44 24 04 0a 00 00 movl $0xa,0x4(%esp)
80102f31: 00
80102f32: c7 04 24 71 00 00 00 movl $0x71,(%esp)
80102f39: e8 9a fd ff ff call 80102cd8 <outb>
wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector
80102f3e: c7 45 fc 67 04 00 80 movl $0x80000467,-0x4(%ebp)
wrv[0] = 0;
80102f45: 8b 45 fc mov -0x4(%ebp),%eax
80102f48: 66 c7 00 00 00 movw $0x0,(%eax)
wrv[1] = addr >> 4;
80102f4d: 8b 45 fc mov -0x4(%ebp),%eax
80102f50: 8d 50 02 lea 0x2(%eax),%edx
80102f53: 8b 45 0c mov 0xc(%ebp),%eax
80102f56: c1 e8 04 shr $0x4,%eax
80102f59: 66 89 02 mov %ax,(%edx)
// "Universal startup algorithm."
// Send INIT (level-triggered) interrupt to reset other CPU.
lapicw(ICRHI, apicid<<24);
80102f5c: 0f b6 45 ec movzbl -0x14(%ebp),%eax
80102f60: c1 e0 18 shl $0x18,%eax
80102f63: 89 44 24 04 mov %eax,0x4(%esp)
80102f67: c7 04 24 c4 00 00 00 movl $0xc4,(%esp)
80102f6e: e8 93 fd ff ff call 80102d06 <lapicw>
lapicw(ICRLO, INIT | LEVEL | ASSERT);
80102f73: c7 44 24 04 00 c5 00 movl $0xc500,0x4(%esp)
80102f7a: 00
80102f7b: c7 04 24 c0 00 00 00 movl $0xc0,(%esp)
80102f82: e8 7f fd ff ff call 80102d06 <lapicw>
microdelay(200);
80102f87: c7 04 24 c8 00 00 00 movl $0xc8,(%esp)
80102f8e: e8 72 ff ff ff call 80102f05 <microdelay>
lapicw(ICRLO, INIT | LEVEL);
80102f93: c7 44 24 04 00 85 00 movl $0x8500,0x4(%esp)
80102f9a: 00
80102f9b: c7 04 24 c0 00 00 00 movl $0xc0,(%esp)
80102fa2: e8 5f fd ff ff call 80102d06 <lapicw>
microdelay(100); // should be 10ms, but too slow in Bochs!
80102fa7: c7 04 24 64 00 00 00 movl $0x64,(%esp)
80102fae: e8 52 ff ff ff call 80102f05 <microdelay>
// Send startup IPI (twice!) to enter code.
// Regular hardware is supposed to only accept a STARTUP
// when it is in the halted state due to an INIT. So the second
// should be ignored, but it is part of the official Intel algorithm.
// Bochs complains about the second one. Too bad for Bochs.
for(i = 0; i < 2; i++){
80102fb3: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%ebp)
80102fba: eb 40 jmp 80102ffc <lapicstartap+0xf2>
lapicw(ICRHI, apicid<<24);
80102fbc: 0f b6 45 ec movzbl -0x14(%ebp),%eax
80102fc0: c1 e0 18 shl $0x18,%eax
80102fc3: 89 44 24 04 mov %eax,0x4(%esp)
80102fc7: c7 04 24 c4 00 00 00 movl $0xc4,(%esp)
80102fce: e8 33 fd ff ff call 80102d06 <lapicw>
lapicw(ICRLO, STARTUP | (addr>>12));
80102fd3: 8b 45 0c mov 0xc(%ebp),%eax
80102fd6: c1 e8 0c shr $0xc,%eax
80102fd9: 80 cc 06 or $0x6,%ah
80102fdc: 89 44 24 04 mov %eax,0x4(%esp)
80102fe0: c7 04 24 c0 00 00 00 movl $0xc0,(%esp)
80102fe7: e8 1a fd ff ff call 80102d06 <lapicw>
microdelay(200);
80102fec: c7 04 24 c8 00 00 00 movl $0xc8,(%esp)
80102ff3: e8 0d ff ff ff call 80102f05 <microdelay>
// Send startup IPI (twice!) to enter code.
// Regular hardware is supposed to only accept a STARTUP
// when it is in the halted state due to an INIT. So the second
// should be ignored, but it is part of the official Intel algorithm.
// Bochs complains about the second one. Too bad for Bochs.
for(i = 0; i < 2; i++){
80102ff8: 83 45 f8 01 addl $0x1,-0x8(%ebp)
80102ffc: 83 7d f8 01 cmpl $0x1,-0x8(%ebp)
80103000: 7e ba jle 80102fbc <lapicstartap+0xb2>
lapicw(ICRHI, apicid<<24);
lapicw(ICRLO, STARTUP | (addr>>12));
microdelay(200);
}
}
80103002: c9 leave
80103003: c3 ret
80103004 <initlog>:
static void recover_from_log(void);
void
initlog(void)
{
80103004: 55 push %ebp
80103005: 89 e5 mov %esp,%ebp
80103007: 83 ec 28 sub $0x28,%esp
if (sizeof(struct logheader) >= BSIZE)
8010300a: 90 nop
panic("initlog: too big logheader");
struct superblock sb;
initlock(&log.lock, "log");
8010300b: c7 44 24 04 18 88 10 movl $0x80108818,0x4(%esp)
80103012: 80
80103013: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
8010301a: e8 2b 1f 00 00 call 80104f4a <initlock>
readsb(ROOTDEV, &sb);
8010301f: 8d 45 e8 lea -0x18(%ebp),%eax
80103022: 89 44 24 04 mov %eax,0x4(%esp)
80103026: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010302d: e8 c2 e2 ff ff call 801012f4 <readsb>
log.start = sb.size - sb.nlog;
80103032: 8b 55 e8 mov -0x18(%ebp),%edx
80103035: 8b 45 f4 mov -0xc(%ebp),%eax
80103038: 89 d1 mov %edx,%ecx
8010303a: 29 c1 sub %eax,%ecx
8010303c: 89 c8 mov %ecx,%eax
8010303e: a3 d4 f8 10 80 mov %eax,0x8010f8d4
log.size = sb.nlog;
80103043: 8b 45 f4 mov -0xc(%ebp),%eax
80103046: a3 d8 f8 10 80 mov %eax,0x8010f8d8
log.dev = ROOTDEV;
8010304b: c7 05 e0 f8 10 80 01 movl $0x1,0x8010f8e0
80103052: 00 00 00
recover_from_log();
80103055: e8 97 01 00 00 call 801031f1 <recover_from_log>
}
8010305a: c9 leave
8010305b: c3 ret
8010305c <install_trans>:
// Copy committed blocks from log to their home location
static void
install_trans(void)
{
8010305c: 55 push %ebp
8010305d: 89 e5 mov %esp,%ebp
8010305f: 83 ec 28 sub $0x28,%esp
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80103062: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80103069: e9 89 00 00 00 jmp 801030f7 <install_trans+0x9b>
struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
8010306e: a1 d4 f8 10 80 mov 0x8010f8d4,%eax
80103073: 03 45 ec add -0x14(%ebp),%eax
80103076: 83 c0 01 add $0x1,%eax
80103079: 89 c2 mov %eax,%edx
8010307b: a1 e0 f8 10 80 mov 0x8010f8e0,%eax
80103080: 89 54 24 04 mov %edx,0x4(%esp)
80103084: 89 04 24 mov %eax,(%esp)
80103087: e8 1b d1 ff ff call 801001a7 <bread>
8010308c: 89 45 f0 mov %eax,-0x10(%ebp)
struct buf *dbuf = bread(log.dev, log.lh.sector[tail]); // read dst
8010308f: 8b 45 ec mov -0x14(%ebp),%eax
80103092: 83 c0 10 add $0x10,%eax
80103095: 8b 04 85 a8 f8 10 80 mov -0x7fef0758(,%eax,4),%eax
8010309c: 89 c2 mov %eax,%edx
8010309e: a1 e0 f8 10 80 mov 0x8010f8e0,%eax
801030a3: 89 54 24 04 mov %edx,0x4(%esp)
801030a7: 89 04 24 mov %eax,(%esp)
801030aa: e8 f8 d0 ff ff call 801001a7 <bread>
801030af: 89 45 f4 mov %eax,-0xc(%ebp)
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
801030b2: 8b 45 f0 mov -0x10(%ebp),%eax
801030b5: 8d 50 18 lea 0x18(%eax),%edx
801030b8: 8b 45 f4 mov -0xc(%ebp),%eax
801030bb: 83 c0 18 add $0x18,%eax
801030be: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
801030c5: 00
801030c6: 89 54 24 04 mov %edx,0x4(%esp)
801030ca: 89 04 24 mov %eax,(%esp)
801030cd: e8 bb 21 00 00 call 8010528d <memmove>
bwrite(dbuf); // write dst to disk
801030d2: 8b 45 f4 mov -0xc(%ebp),%eax
801030d5: 89 04 24 mov %eax,(%esp)
801030d8: e8 01 d1 ff ff call 801001de <bwrite>
brelse(lbuf);
801030dd: 8b 45 f0 mov -0x10(%ebp),%eax
801030e0: 89 04 24 mov %eax,(%esp)
801030e3: e8 30 d1 ff ff call 80100218 <brelse>
brelse(dbuf);
801030e8: 8b 45 f4 mov -0xc(%ebp),%eax
801030eb: 89 04 24 mov %eax,(%esp)
801030ee: e8 25 d1 ff ff call 80100218 <brelse>
static void
install_trans(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
801030f3: 83 45 ec 01 addl $0x1,-0x14(%ebp)
801030f7: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
801030fc: 3b 45 ec cmp -0x14(%ebp),%eax
801030ff: 0f 8f 69 ff ff ff jg 8010306e <install_trans+0x12>
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
bwrite(dbuf); // write dst to disk
brelse(lbuf);
brelse(dbuf);
}
}
80103105: c9 leave
80103106: c3 ret
80103107 <read_head>:
// Read the log header from disk into the in-memory log header
static void
read_head(void)
{
80103107: 55 push %ebp
80103108: 89 e5 mov %esp,%ebp
8010310a: 83 ec 28 sub $0x28,%esp
struct buf *buf = bread(log.dev, log.start);
8010310d: a1 d4 f8 10 80 mov 0x8010f8d4,%eax
80103112: 89 c2 mov %eax,%edx
80103114: a1 e0 f8 10 80 mov 0x8010f8e0,%eax
80103119: 89 54 24 04 mov %edx,0x4(%esp)
8010311d: 89 04 24 mov %eax,(%esp)
80103120: e8 82 d0 ff ff call 801001a7 <bread>
80103125: 89 45 ec mov %eax,-0x14(%ebp)
struct logheader *lh = (struct logheader *) (buf->data);
80103128: 8b 45 ec mov -0x14(%ebp),%eax
8010312b: 83 c0 18 add $0x18,%eax
8010312e: 89 45 f0 mov %eax,-0x10(%ebp)
int i;
log.lh.n = lh->n;
80103131: 8b 45 f0 mov -0x10(%ebp),%eax
80103134: 8b 00 mov (%eax),%eax
80103136: a3 e4 f8 10 80 mov %eax,0x8010f8e4
for (i = 0; i < log.lh.n; i++) {
8010313b: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80103142: eb 1b jmp 8010315f <read_head+0x58>
log.lh.sector[i] = lh->sector[i];
80103144: 8b 4d f4 mov -0xc(%ebp),%ecx
80103147: 8b 55 f4 mov -0xc(%ebp),%edx
8010314a: 8b 45 f0 mov -0x10(%ebp),%eax
8010314d: 8b 44 90 04 mov 0x4(%eax,%edx,4),%eax
80103151: 8d 51 10 lea 0x10(%ecx),%edx
80103154: 89 04 95 a8 f8 10 80 mov %eax,-0x7fef0758(,%edx,4)
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *lh = (struct logheader *) (buf->data);
int i;
log.lh.n = lh->n;
for (i = 0; i < log.lh.n; i++) {
8010315b: 83 45 f4 01 addl $0x1,-0xc(%ebp)
8010315f: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
80103164: 3b 45 f4 cmp -0xc(%ebp),%eax
80103167: 7f db jg 80103144 <read_head+0x3d>
log.lh.sector[i] = lh->sector[i];
}
brelse(buf);
80103169: 8b 45 ec mov -0x14(%ebp),%eax
8010316c: 89 04 24 mov %eax,(%esp)
8010316f: e8 a4 d0 ff ff call 80100218 <brelse>
}
80103174: c9 leave
80103175: c3 ret
80103176 <write_head>:
// Write in-memory log header to disk.
// This is the true point at which the
// current transaction commits.
static void
write_head(void)
{
80103176: 55 push %ebp
80103177: 89 e5 mov %esp,%ebp
80103179: 83 ec 28 sub $0x28,%esp
struct buf *buf = bread(log.dev, log.start);
8010317c: a1 d4 f8 10 80 mov 0x8010f8d4,%eax
80103181: 89 c2 mov %eax,%edx
80103183: a1 e0 f8 10 80 mov 0x8010f8e0,%eax
80103188: 89 54 24 04 mov %edx,0x4(%esp)
8010318c: 89 04 24 mov %eax,(%esp)
8010318f: e8 13 d0 ff ff call 801001a7 <bread>
80103194: 89 45 ec mov %eax,-0x14(%ebp)
struct logheader *hb = (struct logheader *) (buf->data);
80103197: 8b 45 ec mov -0x14(%ebp),%eax
8010319a: 83 c0 18 add $0x18,%eax
8010319d: 89 45 f0 mov %eax,-0x10(%ebp)
int i;
hb->n = log.lh.n;
801031a0: 8b 15 e4 f8 10 80 mov 0x8010f8e4,%edx
801031a6: 8b 45 f0 mov -0x10(%ebp),%eax
801031a9: 89 10 mov %edx,(%eax)
for (i = 0; i < log.lh.n; i++) {
801031ab: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
801031b2: eb 1b jmp 801031cf <write_head+0x59>
hb->sector[i] = log.lh.sector[i];
801031b4: 8b 55 f4 mov -0xc(%ebp),%edx
801031b7: 8b 45 f4 mov -0xc(%ebp),%eax
801031ba: 83 c0 10 add $0x10,%eax
801031bd: 8b 0c 85 a8 f8 10 80 mov -0x7fef0758(,%eax,4),%ecx
801031c4: 8b 45 f0 mov -0x10(%ebp),%eax
801031c7: 89 4c 90 04 mov %ecx,0x4(%eax,%edx,4)
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
for (i = 0; i < log.lh.n; i++) {
801031cb: 83 45 f4 01 addl $0x1,-0xc(%ebp)
801031cf: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
801031d4: 3b 45 f4 cmp -0xc(%ebp),%eax
801031d7: 7f db jg 801031b4 <write_head+0x3e>
hb->sector[i] = log.lh.sector[i];
}
bwrite(buf);
801031d9: 8b 45 ec mov -0x14(%ebp),%eax
801031dc: 89 04 24 mov %eax,(%esp)
801031df: e8 fa cf ff ff call 801001de <bwrite>
brelse(buf);
801031e4: 8b 45 ec mov -0x14(%ebp),%eax
801031e7: 89 04 24 mov %eax,(%esp)
801031ea: e8 29 d0 ff ff call 80100218 <brelse>
}
801031ef: c9 leave
801031f0: c3 ret
801031f1 <recover_from_log>:
static void
recover_from_log(void)
{
801031f1: 55 push %ebp
801031f2: 89 e5 mov %esp,%ebp
801031f4: 83 ec 08 sub $0x8,%esp
read_head();
801031f7: e8 0b ff ff ff call 80103107 <read_head>
install_trans(); // if committed, copy from log to disk
801031fc: e8 5b fe ff ff call 8010305c <install_trans>
log.lh.n = 0;
80103201: c7 05 e4 f8 10 80 00 movl $0x0,0x8010f8e4
80103208: 00 00 00
write_head(); // clear the log
8010320b: e8 66 ff ff ff call 80103176 <write_head>
}
80103210: c9 leave
80103211: c3 ret
80103212 <begin_trans>:
void
begin_trans(void)
{
80103212: 55 push %ebp
80103213: 89 e5 mov %esp,%ebp
80103215: 83 ec 18 sub $0x18,%esp
acquire(&log.lock);
80103218: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
8010321f: e8 47 1d 00 00 call 80104f6b <acquire>
while (log.busy) {
80103224: eb 14 jmp 8010323a <begin_trans+0x28>
sleep(&log, &log.lock);
80103226: c7 44 24 04 a0 f8 10 movl $0x8010f8a0,0x4(%esp)
8010322d: 80
8010322e: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
80103235: e8 b9 19 00 00 call 80104bf3 <sleep>
void
begin_trans(void)
{
acquire(&log.lock);
while (log.busy) {
8010323a: a1 dc f8 10 80 mov 0x8010f8dc,%eax
8010323f: 85 c0 test %eax,%eax
80103241: 75 e3 jne 80103226 <begin_trans+0x14>
sleep(&log, &log.lock);
}
log.busy = 1;
80103243: c7 05 dc f8 10 80 01 movl $0x1,0x8010f8dc
8010324a: 00 00 00
release(&log.lock);
8010324d: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
80103254: e8 73 1d 00 00 call 80104fcc <release>
}
80103259: c9 leave
8010325a: c3 ret
8010325b <commit_trans>:
void
commit_trans(void)
{
8010325b: 55 push %ebp
8010325c: 89 e5 mov %esp,%ebp
8010325e: 83 ec 18 sub $0x18,%esp
if (log.lh.n > 0) {
80103261: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
80103266: 85 c0 test %eax,%eax
80103268: 7e 19 jle 80103283 <commit_trans+0x28>
write_head(); // Write header to disk -- the real commit
8010326a: e8 07 ff ff ff call 80103176 <write_head>
install_trans(); // Now install writes to home locations
8010326f: e8 e8 fd ff ff call 8010305c <install_trans>
log.lh.n = 0;
80103274: c7 05 e4 f8 10 80 00 movl $0x0,0x8010f8e4
8010327b: 00 00 00
write_head(); // Erase the transaction from the log
8010327e: e8 f3 fe ff ff call 80103176 <write_head>
}
acquire(&log.lock);
80103283: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
8010328a: e8 dc 1c 00 00 call 80104f6b <acquire>
log.busy = 0;
8010328f: c7 05 dc f8 10 80 00 movl $0x0,0x8010f8dc
80103296: 00 00 00
wakeup(&log);
80103299: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
801032a0: e8 94 1a 00 00 call 80104d39 <wakeup>
release(&log.lock);
801032a5: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
801032ac: e8 1b 1d 00 00 call 80104fcc <release>
}
801032b1: c9 leave
801032b2: c3 ret
801032b3 <log_write>:
// modify bp->data[]
// log_write(bp)
// brelse(bp)
void
log_write(struct buf *b)
{
801032b3: 55 push %ebp
801032b4: 89 e5 mov %esp,%ebp
801032b6: 83 ec 28 sub $0x28,%esp
int i;
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
801032b9: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
801032be: 83 f8 09 cmp $0x9,%eax
801032c1: 7f 12 jg 801032d5 <log_write+0x22>
801032c3: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
801032c8: 8b 15 d8 f8 10 80 mov 0x8010f8d8,%edx
801032ce: 83 ea 01 sub $0x1,%edx
801032d1: 39 d0 cmp %edx,%eax
801032d3: 7c 0c jl 801032e1 <log_write+0x2e>
panic("too big a transaction");
801032d5: c7 04 24 1c 88 10 80 movl $0x8010881c,(%esp)
801032dc: e8 59 d2 ff ff call 8010053a <panic>
if (!log.busy)
801032e1: a1 dc f8 10 80 mov 0x8010f8dc,%eax
801032e6: 85 c0 test %eax,%eax
801032e8: 75 0c jne 801032f6 <log_write+0x43>
panic("write outside of trans");
801032ea: c7 04 24 32 88 10 80 movl $0x80108832,(%esp)
801032f1: e8 44 d2 ff ff call 8010053a <panic>
for (i = 0; i < log.lh.n; i++) {
801032f6: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
801032fd: eb 1d jmp 8010331c <log_write+0x69>
if (log.lh.sector[i] == b->sector) // log absorbtion?
801032ff: 8b 45 f0 mov -0x10(%ebp),%eax
80103302: 83 c0 10 add $0x10,%eax
80103305: 8b 04 85 a8 f8 10 80 mov -0x7fef0758(,%eax,4),%eax
8010330c: 89 c2 mov %eax,%edx
8010330e: 8b 45 08 mov 0x8(%ebp),%eax
80103311: 8b 40 08 mov 0x8(%eax),%eax
80103314: 39 c2 cmp %eax,%edx
80103316: 74 10 je 80103328 <log_write+0x75>
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
panic("too big a transaction");
if (!log.busy)
panic("write outside of trans");
for (i = 0; i < log.lh.n; i++) {
80103318: 83 45 f0 01 addl $0x1,-0x10(%ebp)
8010331c: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
80103321: 3b 45 f0 cmp -0x10(%ebp),%eax
80103324: 7f d9 jg 801032ff <log_write+0x4c>
80103326: eb 01 jmp 80103329 <log_write+0x76>
if (log.lh.sector[i] == b->sector) // log absorbtion?
break;
80103328: 90 nop
}
log.lh.sector[i] = b->sector;
80103329: 8b 55 f0 mov -0x10(%ebp),%edx
8010332c: 8b 45 08 mov 0x8(%ebp),%eax
8010332f: 8b 40 08 mov 0x8(%eax),%eax
80103332: 83 c2 10 add $0x10,%edx
80103335: 89 04 95 a8 f8 10 80 mov %eax,-0x7fef0758(,%edx,4)
struct buf *lbuf = bread(b->dev, log.start+i+1);
8010333c: a1 d4 f8 10 80 mov 0x8010f8d4,%eax
80103341: 03 45 f0 add -0x10(%ebp),%eax
80103344: 83 c0 01 add $0x1,%eax
80103347: 89 c2 mov %eax,%edx
80103349: 8b 45 08 mov 0x8(%ebp),%eax
8010334c: 8b 40 04 mov 0x4(%eax),%eax
8010334f: 89 54 24 04 mov %edx,0x4(%esp)
80103353: 89 04 24 mov %eax,(%esp)
80103356: e8 4c ce ff ff call 801001a7 <bread>
8010335b: 89 45 f4 mov %eax,-0xc(%ebp)
memmove(lbuf->data, b->data, BSIZE);
8010335e: 8b 45 08 mov 0x8(%ebp),%eax
80103361: 8d 50 18 lea 0x18(%eax),%edx
80103364: 8b 45 f4 mov -0xc(%ebp),%eax
80103367: 83 c0 18 add $0x18,%eax
8010336a: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
80103371: 00
80103372: 89 54 24 04 mov %edx,0x4(%esp)
80103376: 89 04 24 mov %eax,(%esp)
80103379: e8 0f 1f 00 00 call 8010528d <memmove>
bwrite(lbuf);
8010337e: 8b 45 f4 mov -0xc(%ebp),%eax
80103381: 89 04 24 mov %eax,(%esp)
80103384: e8 55 ce ff ff call 801001de <bwrite>
brelse(lbuf);
80103389: 8b 45 f4 mov -0xc(%ebp),%eax
8010338c: 89 04 24 mov %eax,(%esp)
8010338f: e8 84 ce ff ff call 80100218 <brelse>
if (i == log.lh.n)
80103394: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
80103399: 3b 45 f0 cmp -0x10(%ebp),%eax
8010339c: 75 0d jne 801033ab <log_write+0xf8>
log.lh.n++;
8010339e: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
801033a3: 83 c0 01 add $0x1,%eax
801033a6: a3 e4 f8 10 80 mov %eax,0x8010f8e4
b->flags |= B_DIRTY; // XXX prevent eviction
801033ab: 8b 45 08 mov 0x8(%ebp),%eax
801033ae: 8b 00 mov (%eax),%eax
801033b0: 89 c2 mov %eax,%edx
801033b2: 83 ca 04 or $0x4,%edx
801033b5: 8b 45 08 mov 0x8(%ebp),%eax
801033b8: 89 10 mov %edx,(%eax)
}
801033ba: c9 leave
801033bb: c3 ret
801033bc <v2p>:
801033bc: 55 push %ebp
801033bd: 89 e5 mov %esp,%ebp
801033bf: 8b 45 08 mov 0x8(%ebp),%eax
801033c2: 2d 00 00 00 80 sub $0x80000000,%eax
801033c7: 5d pop %ebp
801033c8: c3 ret
801033c9 <p2v>:
static inline void *p2v(uint a) { return (void *) ((a) + KERNBASE); }
801033c9: 55 push %ebp
801033ca: 89 e5 mov %esp,%ebp
801033cc: 8b 45 08 mov 0x8(%ebp),%eax
801033cf: 2d 00 00 00 80 sub $0x80000000,%eax
801033d4: 5d pop %ebp
801033d5: c3 ret
801033d6 <xchg>:
asm volatile("sti");
}
static inline uint
xchg(volatile uint *addr, uint newval)
{
801033d6: 55 push %ebp
801033d7: 89 e5 mov %esp,%ebp
801033d9: 83 ec 10 sub $0x10,%esp
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
801033dc: 8b 55 08 mov 0x8(%ebp),%edx
801033df: 8b 45 0c mov 0xc(%ebp),%eax
801033e2: 8b 4d 08 mov 0x8(%ebp),%ecx
801033e5: f0 87 02 lock xchg %eax,(%edx)
801033e8: 89 45 fc mov %eax,-0x4(%ebp)
"+m" (*addr), "=a" (result) :
"1" (newval) :
"cc");
return result;
801033eb: 8b 45 fc mov -0x4(%ebp),%eax
}
801033ee: c9 leave
801033ef: c3 ret
801033f0 <main>:
// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
int
main(void)
{
801033f0: 55 push %ebp
801033f1: 89 e5 mov %esp,%ebp
801033f3: 83 e4 f0 and $0xfffffff0,%esp
801033f6: 83 ec 10 sub $0x10,%esp
kinit1(end, P2V(4*1024*1024)); // phys page allocator
801033f9: c7 44 24 04 00 00 40 movl $0x80400000,0x4(%esp)
80103400: 80
80103401: c7 04 24 1c 29 11 80 movl $0x8011291c,(%esp)
80103408: e8 cc f5 ff ff call 801029d9 <kinit1>
kvmalloc(); // kernel page table
8010340d: e8 51 4a 00 00 call 80107e63 <kvmalloc>
mpinit(); // collect info about this machine
80103412: e8 45 04 00 00 call 8010385c <mpinit>
lapicinit();
80103417: e8 0c f9 ff ff call 80102d28 <lapicinit>
seginit(); // set up segments
8010341c: e8 e4 43 00 00 call 80107805 <seginit>
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
80103421: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80103427: 0f b6 00 movzbl (%eax),%eax
8010342a: 0f b6 c0 movzbl %al,%eax
8010342d: 89 44 24 04 mov %eax,0x4(%esp)
80103431: c7 04 24 49 88 10 80 movl $0x80108849,(%esp)
80103438: e8 5d cf ff ff call 8010039a <cprintf>
picinit(); // interrupt controller
8010343d: e8 80 06 00 00 call 80103ac2 <picinit>
ioapicinit(); // another interrupt controller
80103442: e8 82 f4 ff ff call 801028c9 <ioapicinit>
consoleinit(); // I/O devices & their interrupts
80103447: e8 3c d6 ff ff call 80100a88 <consoleinit>
uartinit(); // serial port
8010344c: e8 fe 36 00 00 call 80106b4f <uartinit>
pinit(); // process table
80103451: e8 03 0c 00 00 call 80104059 <pinit>
tvinit(); // trap vectors
80103456: e8 a7 32 00 00 call 80106702 <tvinit>
binit(); // buffer cache
8010345b: e8 d4 cb ff ff call 80100034 <binit>
fileinit(); // file table
80103460: e8 a3 da ff ff call 80100f08 <fileinit>
iinit(); // inode cache
80103465: e8 58 e1 ff ff call 801015c2 <iinit>
ideinit(); // disk
8010346a: e8 c1 f0 ff ff call 80102530 <ideinit>
if(!ismp)
8010346f: a1 24 f9 10 80 mov 0x8010f924,%eax
80103474: 85 c0 test %eax,%eax
80103476: 75 05 jne 8010347d <main+0x8d>
timerinit(); // uniprocessor timer
80103478: e8 cd 31 00 00 call 8010664a <timerinit>
startothers(); // start other processors
8010347d: e8 7f 00 00 00 call 80103501 <startothers>
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
80103482: c7 44 24 04 00 00 00 movl $0x8e000000,0x4(%esp)
80103489: 8e
8010348a: c7 04 24 00 00 40 80 movl $0x80400000,(%esp)
80103491: e8 7b f5 ff ff call 80102a11 <kinit2>
userinit(); // first user process
80103496: e8 dd 0c 00 00 call 80104178 <userinit>
// Finish setting up this processor in mpmain.
mpmain();
8010349b: e8 1a 00 00 00 call 801034ba <mpmain>
801034a0 <mpenter>:
}
// Other CPUs jump here from entryother.S.
static void
mpenter(void)
{
801034a0: 55 push %ebp
801034a1: 89 e5 mov %esp,%ebp
801034a3: 83 ec 08 sub $0x8,%esp
switchkvm();
801034a6: e8 cf 49 00 00 call 80107e7a <switchkvm>
seginit();
801034ab: e8 55 43 00 00 call 80107805 <seginit>
lapicinit();
801034b0: e8 73 f8 ff ff call 80102d28 <lapicinit>
mpmain();
801034b5: e8 00 00 00 00 call 801034ba <mpmain>
801034ba <mpmain>:
}
// Common CPU setup code.
static void
mpmain(void)
{
801034ba: 55 push %ebp
801034bb: 89 e5 mov %esp,%ebp
801034bd: 83 ec 18 sub $0x18,%esp
cprintf("cpu%d: starting\n", cpu->id);
801034c0: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801034c6: 0f b6 00 movzbl (%eax),%eax
801034c9: 0f b6 c0 movzbl %al,%eax
801034cc: 89 44 24 04 mov %eax,0x4(%esp)
801034d0: c7 04 24 60 88 10 80 movl $0x80108860,(%esp)
801034d7: e8 be ce ff ff call 8010039a <cprintf>
idtinit(); // load idt register
801034dc: e8 91 33 00 00 call 80106872 <idtinit>
xchg(&cpu->started, 1); // tell startothers() we're up
801034e1: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801034e7: 05 a8 00 00 00 add $0xa8,%eax
801034ec: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
801034f3: 00
801034f4: 89 04 24 mov %eax,(%esp)
801034f7: e8 da fe ff ff call 801033d6 <xchg>
scheduler(); // start running processes
801034fc: e8 da 14 00 00 call 801049db <scheduler>
80103501 <startothers>:
pde_t entrypgdir[]; // For entry.S
// Start the non-boot (AP) processors.
static void
startothers(void)
{
80103501: 55 push %ebp
80103502: 89 e5 mov %esp,%ebp
80103504: 53 push %ebx
80103505: 83 ec 24 sub $0x24,%esp
char *stack;
// Write entry code to unused memory at 0x7000.
// The linker has placed the image of entryother.S in
// _binary_entryother_start.
code = p2v(0x7000);
80103508: c7 04 24 00 70 00 00 movl $0x7000,(%esp)
8010350f: e8 b5 fe ff ff call 801033c9 <p2v>
80103514: 89 45 ec mov %eax,-0x14(%ebp)
memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
80103517: b8 8a 00 00 00 mov $0x8a,%eax
8010351c: 89 44 24 08 mov %eax,0x8(%esp)
80103520: c7 44 24 04 2c b5 10 movl $0x8010b52c,0x4(%esp)
80103527: 80
80103528: 8b 45 ec mov -0x14(%ebp),%eax
8010352b: 89 04 24 mov %eax,(%esp)
8010352e: e8 5a 1d 00 00 call 8010528d <memmove>
for(c = cpus; c < cpus+ncpu; c++){
80103533: c7 45 f0 40 f9 10 80 movl $0x8010f940,-0x10(%ebp)
8010353a: e9 85 00 00 00 jmp 801035c4 <startothers+0xc3>
if(c == cpus+cpunum()) // We've started already.
8010353f: e8 40 f9 ff ff call 80102e84 <cpunum>
80103544: 69 c0 bc 00 00 00 imul $0xbc,%eax,%eax
8010354a: 05 40 f9 10 80 add $0x8010f940,%eax
8010354f: 3b 45 f0 cmp -0x10(%ebp),%eax
80103552: 74 68 je 801035bc <startothers+0xbb>
continue;
// Tell entryother.S what stack to use, where to enter, and what
// pgdir to use. We cannot use kpgdir yet, because the AP processor
// is running in low memory, so we use entrypgdir for the APs too.
stack = kalloc();
80103554: e8 b1 f5 ff ff call 80102b0a <kalloc>
80103559: 89 45 f4 mov %eax,-0xc(%ebp)
*(void**)(code-4) = stack + KSTACKSIZE;
8010355c: 8b 45 ec mov -0x14(%ebp),%eax
8010355f: 83 e8 04 sub $0x4,%eax
80103562: 8b 55 f4 mov -0xc(%ebp),%edx
80103565: 81 c2 00 10 00 00 add $0x1000,%edx
8010356b: 89 10 mov %edx,(%eax)
*(void**)(code-8) = mpenter;
8010356d: 8b 45 ec mov -0x14(%ebp),%eax
80103570: 83 e8 08 sub $0x8,%eax
80103573: c7 00 a0 34 10 80 movl $0x801034a0,(%eax)
*(int**)(code-12) = (void *) v2p(entrypgdir);
80103579: 8b 45 ec mov -0x14(%ebp),%eax
8010357c: 8d 58 f4 lea -0xc(%eax),%ebx
8010357f: c7 04 24 00 a0 10 80 movl $0x8010a000,(%esp)
80103586: e8 31 fe ff ff call 801033bc <v2p>
8010358b: 89 03 mov %eax,(%ebx)
lapicstartap(c->id, v2p(code));
8010358d: 8b 45 ec mov -0x14(%ebp),%eax
80103590: 89 04 24 mov %eax,(%esp)
80103593: e8 24 fe ff ff call 801033bc <v2p>
80103598: 8b 55 f0 mov -0x10(%ebp),%edx
8010359b: 0f b6 12 movzbl (%edx),%edx
8010359e: 0f b6 d2 movzbl %dl,%edx
801035a1: 89 44 24 04 mov %eax,0x4(%esp)
801035a5: 89 14 24 mov %edx,(%esp)
801035a8: e8 5d f9 ff ff call 80102f0a <lapicstartap>
// wait for cpu to finish mpmain()
while(c->started == 0)
801035ad: 8b 45 f0 mov -0x10(%ebp),%eax
801035b0: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax
801035b6: 85 c0 test %eax,%eax
801035b8: 74 f3 je 801035ad <startothers+0xac>
801035ba: eb 01 jmp 801035bd <startothers+0xbc>
code = p2v(0x7000);
memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
for(c = cpus; c < cpus+ncpu; c++){
if(c == cpus+cpunum()) // We've started already.
continue;
801035bc: 90 nop
// The linker has placed the image of entryother.S in
// _binary_entryother_start.
code = p2v(0x7000);
memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
for(c = cpus; c < cpus+ncpu; c++){
801035bd: 81 45 f0 bc 00 00 00 addl $0xbc,-0x10(%ebp)
801035c4: a1 20 ff 10 80 mov 0x8010ff20,%eax
801035c9: 69 c0 bc 00 00 00 imul $0xbc,%eax,%eax
801035cf: 05 40 f9 10 80 add $0x8010f940,%eax
801035d4: 3b 45 f0 cmp -0x10(%ebp),%eax
801035d7: 0f 87 62 ff ff ff ja 8010353f <startothers+0x3e>
// wait for cpu to finish mpmain()
while(c->started == 0)
;
}
}
801035dd: 83 c4 24 add $0x24,%esp
801035e0: 5b pop %ebx
801035e1: 5d pop %ebp
801035e2: c3 ret
...
801035e4 <p2v>:
801035e4: 55 push %ebp
801035e5: 89 e5 mov %esp,%ebp
801035e7: 8b 45 08 mov 0x8(%ebp),%eax
801035ea: 2d 00 00 00 80 sub $0x80000000,%eax
801035ef: 5d pop %ebp
801035f0: c3 ret
801035f1 <inb>:
// Routines to let C code use special x86 instructions.
static inline uchar
inb(ushort port)
{
801035f1: 55 push %ebp
801035f2: 89 e5 mov %esp,%ebp
801035f4: 83 ec 14 sub $0x14,%esp
801035f7: 8b 45 08 mov 0x8(%ebp),%eax
801035fa: 66 89 45 ec mov %ax,-0x14(%ebp)
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801035fe: 0f b7 45 ec movzwl -0x14(%ebp),%eax
80103602: 89 c2 mov %eax,%edx
80103604: ec in (%dx),%al
80103605: 88 45 ff mov %al,-0x1(%ebp)
return data;
80103608: 0f b6 45 ff movzbl -0x1(%ebp),%eax
}
8010360c: c9 leave
8010360d: c3 ret
8010360e <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
8010360e: 55 push %ebp
8010360f: 89 e5 mov %esp,%ebp
80103611: 83 ec 08 sub $0x8,%esp
80103614: 8b 55 08 mov 0x8(%ebp),%edx
80103617: 8b 45 0c mov 0xc(%ebp),%eax
8010361a: 66 89 55 fc mov %dx,-0x4(%ebp)
8010361e: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80103621: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
80103625: 0f b7 55 fc movzwl -0x4(%ebp),%edx
80103629: ee out %al,(%dx)
}
8010362a: c9 leave
8010362b: c3 ret
8010362c <mpbcpu>:
int ncpu;
uchar ioapicid;
int
mpbcpu(void)
{
8010362c: 55 push %ebp
8010362d: 89 e5 mov %esp,%ebp
return bcpu-cpus;
8010362f: a1 64 b6 10 80 mov 0x8010b664,%eax
80103634: 89 c2 mov %eax,%edx
80103636: b8 40 f9 10 80 mov $0x8010f940,%eax
8010363b: 89 d1 mov %edx,%ecx
8010363d: 29 c1 sub %eax,%ecx
8010363f: 89 c8 mov %ecx,%eax
80103641: c1 f8 02 sar $0x2,%eax
80103644: 69 c0 cf 46 7d 67 imul $0x677d46cf,%eax,%eax
}
8010364a: 5d pop %ebp
8010364b: c3 ret
8010364c <sum>:
static uchar
sum(uchar *addr, int len)
{
8010364c: 55 push %ebp
8010364d: 89 e5 mov %esp,%ebp
8010364f: 83 ec 10 sub $0x10,%esp
int i, sum;
sum = 0;
80103652: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
for(i=0; i<len; i++)
80103659: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%ebp)
80103660: eb 13 jmp 80103675 <sum+0x29>
sum += addr[i];
80103662: 8b 45 f8 mov -0x8(%ebp),%eax
80103665: 03 45 08 add 0x8(%ebp),%eax
80103668: 0f b6 00 movzbl (%eax),%eax
8010366b: 0f b6 c0 movzbl %al,%eax
8010366e: 01 45 fc add %eax,-0x4(%ebp)
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
80103671: 83 45 f8 01 addl $0x1,-0x8(%ebp)
80103675: 8b 45 f8 mov -0x8(%ebp),%eax
80103678: 3b 45 0c cmp 0xc(%ebp),%eax
8010367b: 7c e5 jl 80103662 <sum+0x16>
sum += addr[i];
return sum;
8010367d: 8b 45 fc mov -0x4(%ebp),%eax
}
80103680: c9 leave
80103681: c3 ret
80103682 <mpsearch1>:
// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
80103682: 55 push %ebp
80103683: 89 e5 mov %esp,%ebp
80103685: 83 ec 28 sub $0x28,%esp
uchar *e, *p, *addr;
addr = p2v(a);
80103688: 8b 45 08 mov 0x8(%ebp),%eax
8010368b: 89 04 24 mov %eax,(%esp)
8010368e: e8 51 ff ff ff call 801035e4 <p2v>
80103693: 89 45 f4 mov %eax,-0xc(%ebp)
e = addr+len;
80103696: 8b 45 0c mov 0xc(%ebp),%eax
80103699: 03 45 f4 add -0xc(%ebp),%eax
8010369c: 89 45 ec mov %eax,-0x14(%ebp)
for(p = addr; p < e; p += sizeof(struct mp))
8010369f: 8b 45 f4 mov -0xc(%ebp),%eax
801036a2: 89 45 f0 mov %eax,-0x10(%ebp)
801036a5: eb 3f jmp 801036e6 <mpsearch1+0x64>
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
801036a7: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp)
801036ae: 00
801036af: c7 44 24 04 74 88 10 movl $0x80108874,0x4(%esp)
801036b6: 80
801036b7: 8b 45 f0 mov -0x10(%ebp),%eax
801036ba: 89 04 24 mov %eax,(%esp)
801036bd: e8 6f 1b 00 00 call 80105231 <memcmp>
801036c2: 85 c0 test %eax,%eax
801036c4: 75 1c jne 801036e2 <mpsearch1+0x60>
801036c6: c7 44 24 04 10 00 00 movl $0x10,0x4(%esp)
801036cd: 00
801036ce: 8b 45 f0 mov -0x10(%ebp),%eax
801036d1: 89 04 24 mov %eax,(%esp)
801036d4: e8 73 ff ff ff call 8010364c <sum>
801036d9: 84 c0 test %al,%al
801036db: 75 05 jne 801036e2 <mpsearch1+0x60>
return (struct mp*)p;
801036dd: 8b 45 f0 mov -0x10(%ebp),%eax
801036e0: eb 11 jmp 801036f3 <mpsearch1+0x71>
{
uchar *e, *p, *addr;
addr = p2v(a);
e = addr+len;
for(p = addr; p < e; p += sizeof(struct mp))
801036e2: 83 45 f0 10 addl $0x10,-0x10(%ebp)
801036e6: 8b 45 f0 mov -0x10(%ebp),%eax
801036e9: 3b 45 ec cmp -0x14(%ebp),%eax
801036ec: 72 b9 jb 801036a7 <mpsearch1+0x25>
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
return (struct mp*)p;
return 0;
801036ee: b8 00 00 00 00 mov $0x0,%eax
}
801036f3: c9 leave
801036f4: c3 ret
801036f5 <mpsearch>:
// 1) in the first KB of the EBDA;
// 2) in the last KB of system base memory;
// 3) in the BIOS ROM between 0xE0000 and 0xFFFFF.
static struct mp*
mpsearch(void)
{
801036f5: 55 push %ebp
801036f6: 89 e5 mov %esp,%ebp
801036f8: 83 ec 28 sub $0x28,%esp
uchar *bda;
uint p;
struct mp *mp;
bda = (uchar *) P2V(0x400);
801036fb: c7 45 ec 00 04 00 80 movl $0x80000400,-0x14(%ebp)
if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
80103702: 8b 45 ec mov -0x14(%ebp),%eax
80103705: 83 c0 0f add $0xf,%eax
80103708: 0f b6 00 movzbl (%eax),%eax
8010370b: 0f b6 c0 movzbl %al,%eax
8010370e: 89 c2 mov %eax,%edx
80103710: c1 e2 08 shl $0x8,%edx
80103713: 8b 45 ec mov -0x14(%ebp),%eax
80103716: 83 c0 0e add $0xe,%eax
80103719: 0f b6 00 movzbl (%eax),%eax
8010371c: 0f b6 c0 movzbl %al,%eax
8010371f: 09 d0 or %edx,%eax
80103721: c1 e0 04 shl $0x4,%eax
80103724: 89 45 f0 mov %eax,-0x10(%ebp)
80103727: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
8010372b: 74 21 je 8010374e <mpsearch+0x59>
if((mp = mpsearch1(p, 1024)))
8010372d: c7 44 24 04 00 04 00 movl $0x400,0x4(%esp)
80103734: 00
80103735: 8b 45 f0 mov -0x10(%ebp),%eax
80103738: 89 04 24 mov %eax,(%esp)
8010373b: e8 42 ff ff ff call 80103682 <mpsearch1>
80103740: 89 45 f4 mov %eax,-0xc(%ebp)
80103743: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80103747: 74 50 je 80103799 <mpsearch+0xa4>
return mp;
80103749: 8b 45 f4 mov -0xc(%ebp),%eax
8010374c: eb 5f jmp 801037ad <mpsearch+0xb8>
} else {
p = ((bda[0x14]<<8)|bda[0x13])*1024;
8010374e: 8b 45 ec mov -0x14(%ebp),%eax
80103751: 83 c0 14 add $0x14,%eax
80103754: 0f b6 00 movzbl (%eax),%eax
80103757: 0f b6 c0 movzbl %al,%eax
8010375a: 89 c2 mov %eax,%edx
8010375c: c1 e2 08 shl $0x8,%edx
8010375f: 8b 45 ec mov -0x14(%ebp),%eax
80103762: 83 c0 13 add $0x13,%eax
80103765: 0f b6 00 movzbl (%eax),%eax
80103768: 0f b6 c0 movzbl %al,%eax
8010376b: 09 d0 or %edx,%eax
8010376d: c1 e0 0a shl $0xa,%eax
80103770: 89 45 f0 mov %eax,-0x10(%ebp)
if((mp = mpsearch1(p-1024, 1024)))
80103773: 8b 45 f0 mov -0x10(%ebp),%eax
80103776: 2d 00 04 00 00 sub $0x400,%eax
8010377b: c7 44 24 04 00 04 00 movl $0x400,0x4(%esp)
80103782: 00
80103783: 89 04 24 mov %eax,(%esp)
80103786: e8 f7 fe ff ff call 80103682 <mpsearch1>
8010378b: 89 45 f4 mov %eax,-0xc(%ebp)
8010378e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80103792: 74 05 je 80103799 <mpsearch+0xa4>
return mp;
80103794: 8b 45 f4 mov -0xc(%ebp),%eax
80103797: eb 14 jmp 801037ad <mpsearch+0xb8>
}
return mpsearch1(0xF0000, 0x10000);
80103799: c7 44 24 04 00 00 01 movl $0x10000,0x4(%esp)
801037a0: 00
801037a1: c7 04 24 00 00 0f 00 movl $0xf0000,(%esp)
801037a8: e8 d5 fe ff ff call 80103682 <mpsearch1>
}
801037ad: c9 leave
801037ae: c3 ret
801037af <mpconfig>:
// Check for correct signature, calculate the checksum and,
// if correct, check the version.
// To do: check extended table checksum.
static struct mpconf*
mpconfig(struct mp **pmp)
{
801037af: 55 push %ebp
801037b0: 89 e5 mov %esp,%ebp
801037b2: 83 ec 28 sub $0x28,%esp
struct mpconf *conf;
struct mp *mp;
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801037b5: e8 3b ff ff ff call 801036f5 <mpsearch>
801037ba: 89 45 f4 mov %eax,-0xc(%ebp)
801037bd: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801037c1: 74 0a je 801037cd <mpconfig+0x1e>
801037c3: 8b 45 f4 mov -0xc(%ebp),%eax
801037c6: 8b 40 04 mov 0x4(%eax),%eax
801037c9: 85 c0 test %eax,%eax
801037cb: 75 0a jne 801037d7 <mpconfig+0x28>
return 0;
801037cd: b8 00 00 00 00 mov $0x0,%eax
801037d2: e9 83 00 00 00 jmp 8010385a <mpconfig+0xab>
conf = (struct mpconf*) p2v((uint) mp->physaddr);
801037d7: 8b 45 f4 mov -0xc(%ebp),%eax
801037da: 8b 40 04 mov 0x4(%eax),%eax
801037dd: 89 04 24 mov %eax,(%esp)
801037e0: e8 ff fd ff ff call 801035e4 <p2v>
801037e5: 89 45 f0 mov %eax,-0x10(%ebp)
if(memcmp(conf, "PCMP", 4) != 0)
801037e8: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp)
801037ef: 00
801037f0: c7 44 24 04 79 88 10 movl $0x80108879,0x4(%esp)
801037f7: 80
801037f8: 8b 45 f0 mov -0x10(%ebp),%eax
801037fb: 89 04 24 mov %eax,(%esp)
801037fe: e8 2e 1a 00 00 call 80105231 <memcmp>
80103803: 85 c0 test %eax,%eax
80103805: 74 07 je 8010380e <mpconfig+0x5f>
return 0;
80103807: b8 00 00 00 00 mov $0x0,%eax
8010380c: eb 4c jmp 8010385a <mpconfig+0xab>
if(conf->version != 1 && conf->version != 4)
8010380e: 8b 45 f0 mov -0x10(%ebp),%eax
80103811: 0f b6 40 06 movzbl 0x6(%eax),%eax
80103815: 3c 01 cmp $0x1,%al
80103817: 74 12 je 8010382b <mpconfig+0x7c>
80103819: 8b 45 f0 mov -0x10(%ebp),%eax
8010381c: 0f b6 40 06 movzbl 0x6(%eax),%eax
80103820: 3c 04 cmp $0x4,%al
80103822: 74 07 je 8010382b <mpconfig+0x7c>
return 0;
80103824: b8 00 00 00 00 mov $0x0,%eax
80103829: eb 2f jmp 8010385a <mpconfig+0xab>
if(sum((uchar*)conf, conf->length) != 0)
8010382b: 8b 45 f0 mov -0x10(%ebp),%eax
8010382e: 0f b7 40 04 movzwl 0x4(%eax),%eax
80103832: 0f b7 d0 movzwl %ax,%edx
80103835: 8b 45 f0 mov -0x10(%ebp),%eax
80103838: 89 54 24 04 mov %edx,0x4(%esp)
8010383c: 89 04 24 mov %eax,(%esp)
8010383f: e8 08 fe ff ff call 8010364c <sum>
80103844: 84 c0 test %al,%al
80103846: 74 07 je 8010384f <mpconfig+0xa0>
return 0;
80103848: b8 00 00 00 00 mov $0x0,%eax
8010384d: eb 0b jmp 8010385a <mpconfig+0xab>
*pmp = mp;
8010384f: 8b 45 08 mov 0x8(%ebp),%eax
80103852: 8b 55 f4 mov -0xc(%ebp),%edx
80103855: 89 10 mov %edx,(%eax)
return conf;
80103857: 8b 45 f0 mov -0x10(%ebp),%eax
}
8010385a: c9 leave
8010385b: c3 ret
8010385c <mpinit>:
void
mpinit(void)
{
8010385c: 55 push %ebp
8010385d: 89 e5 mov %esp,%ebp
8010385f: 83 ec 38 sub $0x38,%esp
struct mp *mp;
struct mpconf *conf;
struct mpproc *proc;
struct mpioapic *ioapic;
bcpu = &cpus[0];
80103862: c7 05 64 b6 10 80 40 movl $0x8010f940,0x8010b664
80103869: f9 10 80
if((conf = mpconfig(&mp)) == 0)
8010386c: 8d 45 e0 lea -0x20(%ebp),%eax
8010386f: 89 04 24 mov %eax,(%esp)
80103872: e8 38 ff ff ff call 801037af <mpconfig>
80103877: 89 45 ec mov %eax,-0x14(%ebp)
8010387a: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
8010387e: 0f 84 9d 01 00 00 je 80103a21 <mpinit+0x1c5>
return;
ismp = 1;
80103884: c7 05 24 f9 10 80 01 movl $0x1,0x8010f924
8010388b: 00 00 00
lapic = (uint*)conf->lapicaddr;
8010388e: 8b 45 ec mov -0x14(%ebp),%eax
80103891: 8b 40 24 mov 0x24(%eax),%eax
80103894: a3 9c f8 10 80 mov %eax,0x8010f89c
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
80103899: 8b 45 ec mov -0x14(%ebp),%eax
8010389c: 83 c0 2c add $0x2c,%eax
8010389f: 89 45 e4 mov %eax,-0x1c(%ebp)
801038a2: 8b 55 ec mov -0x14(%ebp),%edx
801038a5: 8b 45 ec mov -0x14(%ebp),%eax
801038a8: 0f b7 40 04 movzwl 0x4(%eax),%eax
801038ac: 0f b7 c0 movzwl %ax,%eax
801038af: 8d 04 02 lea (%edx,%eax,1),%eax
801038b2: 89 45 e8 mov %eax,-0x18(%ebp)
801038b5: e9 f2 00 00 00 jmp 801039ac <mpinit+0x150>
switch(*p){
801038ba: 8b 45 e4 mov -0x1c(%ebp),%eax
801038bd: 0f b6 00 movzbl (%eax),%eax
801038c0: 0f b6 c0 movzbl %al,%eax
801038c3: 83 f8 04 cmp $0x4,%eax
801038c6: 0f 87 bd 00 00 00 ja 80103989 <mpinit+0x12d>
801038cc: 8b 04 85 bc 88 10 80 mov -0x7fef7744(,%eax,4),%eax
801038d3: ff e0 jmp *%eax
case MPPROC:
proc = (struct mpproc*)p;
801038d5: 8b 45 e4 mov -0x1c(%ebp),%eax
801038d8: 89 45 f0 mov %eax,-0x10(%ebp)
if(ncpu != proc->apicid){
801038db: 8b 45 f0 mov -0x10(%ebp),%eax
801038de: 0f b6 40 01 movzbl 0x1(%eax),%eax
801038e2: 0f b6 d0 movzbl %al,%edx
801038e5: a1 20 ff 10 80 mov 0x8010ff20,%eax
801038ea: 39 c2 cmp %eax,%edx
801038ec: 74 2d je 8010391b <mpinit+0xbf>
cprintf("mpinit: ncpu=%d apicid=%d\n", ncpu, proc->apicid);
801038ee: 8b 45 f0 mov -0x10(%ebp),%eax
801038f1: 0f b6 40 01 movzbl 0x1(%eax),%eax
801038f5: 0f b6 d0 movzbl %al,%edx
801038f8: a1 20 ff 10 80 mov 0x8010ff20,%eax
801038fd: 89 54 24 08 mov %edx,0x8(%esp)
80103901: 89 44 24 04 mov %eax,0x4(%esp)
80103905: c7 04 24 7e 88 10 80 movl $0x8010887e,(%esp)
8010390c: e8 89 ca ff ff call 8010039a <cprintf>
ismp = 0;
80103911: c7 05 24 f9 10 80 00 movl $0x0,0x8010f924
80103918: 00 00 00
}
if(proc->flags & MPBOOT)
8010391b: 8b 45 f0 mov -0x10(%ebp),%eax
8010391e: 0f b6 40 03 movzbl 0x3(%eax),%eax
80103922: 0f b6 c0 movzbl %al,%eax
80103925: 83 e0 02 and $0x2,%eax
80103928: 85 c0 test %eax,%eax
8010392a: 74 15 je 80103941 <mpinit+0xe5>
bcpu = &cpus[ncpu];
8010392c: a1 20 ff 10 80 mov 0x8010ff20,%eax
80103931: 69 c0 bc 00 00 00 imul $0xbc,%eax,%eax
80103937: 05 40 f9 10 80 add $0x8010f940,%eax
8010393c: a3 64 b6 10 80 mov %eax,0x8010b664
cpus[ncpu].id = ncpu;
80103941: a1 20 ff 10 80 mov 0x8010ff20,%eax
80103946: 8b 15 20 ff 10 80 mov 0x8010ff20,%edx
8010394c: 69 c0 bc 00 00 00 imul $0xbc,%eax,%eax
80103952: 88 90 40 f9 10 80 mov %dl,-0x7fef06c0(%eax)
ncpu++;
80103958: a1 20 ff 10 80 mov 0x8010ff20,%eax
8010395d: 83 c0 01 add $0x1,%eax
80103960: a3 20 ff 10 80 mov %eax,0x8010ff20
p += sizeof(struct mpproc);
80103965: 83 45 e4 14 addl $0x14,-0x1c(%ebp)
continue;
80103969: eb 41 jmp 801039ac <mpinit+0x150>
case MPIOAPIC:
ioapic = (struct mpioapic*)p;
8010396b: 8b 45 e4 mov -0x1c(%ebp),%eax
8010396e: 89 45 f4 mov %eax,-0xc(%ebp)
ioapicid = ioapic->apicno;
80103971: 8b 45 f4 mov -0xc(%ebp),%eax
80103974: 0f b6 40 01 movzbl 0x1(%eax),%eax
80103978: a2 20 f9 10 80 mov %al,0x8010f920
p += sizeof(struct mpioapic);
8010397d: 83 45 e4 08 addl $0x8,-0x1c(%ebp)
continue;
80103981: eb 29 jmp 801039ac <mpinit+0x150>
case MPBUS:
case MPIOINTR:
case MPLINTR:
p += 8;
80103983: 83 45 e4 08 addl $0x8,-0x1c(%ebp)
continue;
80103987: eb 23 jmp 801039ac <mpinit+0x150>
default:
cprintf("mpinit: unknown config type %x\n", *p);
80103989: 8b 45 e4 mov -0x1c(%ebp),%eax
8010398c: 0f b6 00 movzbl (%eax),%eax
8010398f: 0f b6 c0 movzbl %al,%eax
80103992: 89 44 24 04 mov %eax,0x4(%esp)
80103996: c7 04 24 9c 88 10 80 movl $0x8010889c,(%esp)
8010399d: e8 f8 c9 ff ff call 8010039a <cprintf>
ismp = 0;
801039a2: c7 05 24 f9 10 80 00 movl $0x0,0x8010f924
801039a9: 00 00 00
bcpu = &cpus[0];
if((conf = mpconfig(&mp)) == 0)
return;
ismp = 1;
lapic = (uint*)conf->lapicaddr;
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
801039ac: 8b 45 e4 mov -0x1c(%ebp),%eax
801039af: 3b 45 e8 cmp -0x18(%ebp),%eax
801039b2: 0f 82 02 ff ff ff jb 801038ba <mpinit+0x5e>
default:
cprintf("mpinit: unknown config type %x\n", *p);
ismp = 0;
}
}
if(!ismp){
801039b8: a1 24 f9 10 80 mov 0x8010f924,%eax
801039bd: 85 c0 test %eax,%eax
801039bf: 75 1d jne 801039de <mpinit+0x182>
// Didn't like what we found; fall back to no MP.
ncpu = 1;
801039c1: c7 05 20 ff 10 80 01 movl $0x1,0x8010ff20
801039c8: 00 00 00
lapic = 0;
801039cb: c7 05 9c f8 10 80 00 movl $0x0,0x8010f89c
801039d2: 00 00 00
ioapicid = 0;
801039d5: c6 05 20 f9 10 80 00 movb $0x0,0x8010f920
return;
801039dc: eb 44 jmp 80103a22 <mpinit+0x1c6>
}
if(mp->imcrp){
801039de: 8b 45 e0 mov -0x20(%ebp),%eax
801039e1: 0f b6 40 0c movzbl 0xc(%eax),%eax
801039e5: 84 c0 test %al,%al
801039e7: 74 39 je 80103a22 <mpinit+0x1c6>
// Bochs doesn't support IMCR, so this doesn't run on Bochs.
// But it would on real hardware.
outb(0x22, 0x70); // Select IMCR
801039e9: c7 44 24 04 70 00 00 movl $0x70,0x4(%esp)
801039f0: 00
801039f1: c7 04 24 22 00 00 00 movl $0x22,(%esp)
801039f8: e8 11 fc ff ff call 8010360e <outb>
outb(0x23, inb(0x23) | 1); // Mask external interrupts.
801039fd: c7 04 24 23 00 00 00 movl $0x23,(%esp)
80103a04: e8 e8 fb ff ff call 801035f1 <inb>
80103a09: 83 c8 01 or $0x1,%eax
80103a0c: 0f b6 c0 movzbl %al,%eax
80103a0f: 89 44 24 04 mov %eax,0x4(%esp)
80103a13: c7 04 24 23 00 00 00 movl $0x23,(%esp)
80103a1a: e8 ef fb ff ff call 8010360e <outb>
80103a1f: eb 01 jmp 80103a22 <mpinit+0x1c6>
struct mpproc *proc;
struct mpioapic *ioapic;
bcpu = &cpus[0];
if((conf = mpconfig(&mp)) == 0)
return;
80103a21: 90 nop
// Bochs doesn't support IMCR, so this doesn't run on Bochs.
// But it would on real hardware.
outb(0x22, 0x70); // Select IMCR
outb(0x23, inb(0x23) | 1); // Mask external interrupts.
}
}
80103a22: c9 leave
80103a23: c3 ret
80103a24 <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
80103a24: 55 push %ebp
80103a25: 89 e5 mov %esp,%ebp
80103a27: 83 ec 08 sub $0x8,%esp
80103a2a: 8b 55 08 mov 0x8(%ebp),%edx
80103a2d: 8b 45 0c mov 0xc(%ebp),%eax
80103a30: 66 89 55 fc mov %dx,-0x4(%ebp)
80103a34: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80103a37: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
80103a3b: 0f b7 55 fc movzwl -0x4(%ebp),%edx
80103a3f: ee out %al,(%dx)
}
80103a40: c9 leave
80103a41: c3 ret
80103a42 <picsetmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static ushort irqmask = 0xFFFF & ~(1<<IRQ_SLAVE);
static void
picsetmask(ushort mask)
{
80103a42: 55 push %ebp
80103a43: 89 e5 mov %esp,%ebp
80103a45: 83 ec 0c sub $0xc,%esp
80103a48: 8b 45 08 mov 0x8(%ebp),%eax
80103a4b: 66 89 45 fc mov %ax,-0x4(%ebp)
irqmask = mask;
80103a4f: 0f b7 45 fc movzwl -0x4(%ebp),%eax
80103a53: 66 a3 00 b0 10 80 mov %ax,0x8010b000
outb(IO_PIC1+1, mask);
80103a59: 0f b7 45 fc movzwl -0x4(%ebp),%eax
80103a5d: 0f b6 c0 movzbl %al,%eax
80103a60: 89 44 24 04 mov %eax,0x4(%esp)
80103a64: c7 04 24 21 00 00 00 movl $0x21,(%esp)
80103a6b: e8 b4 ff ff ff call 80103a24 <outb>
outb(IO_PIC2+1, mask >> 8);
80103a70: 0f b7 45 fc movzwl -0x4(%ebp),%eax
80103a74: 66 c1 e8 08 shr $0x8,%ax
80103a78: 0f b6 c0 movzbl %al,%eax
80103a7b: 89 44 24 04 mov %eax,0x4(%esp)
80103a7f: c7 04 24 a1 00 00 00 movl $0xa1,(%esp)
80103a86: e8 99 ff ff ff call 80103a24 <outb>
}
80103a8b: c9 leave
80103a8c: c3 ret
80103a8d <picenable>:
void
picenable(int irq)
{
80103a8d: 55 push %ebp
80103a8e: 89 e5 mov %esp,%ebp
80103a90: 53 push %ebx
80103a91: 83 ec 04 sub $0x4,%esp
picsetmask(irqmask & ~(1<<irq));
80103a94: 8b 45 08 mov 0x8(%ebp),%eax
80103a97: ba 01 00 00 00 mov $0x1,%edx
80103a9c: 89 d3 mov %edx,%ebx
80103a9e: 89 c1 mov %eax,%ecx
80103aa0: d3 e3 shl %cl,%ebx
80103aa2: 89 d8 mov %ebx,%eax
80103aa4: 89 c2 mov %eax,%edx
80103aa6: f7 d2 not %edx
80103aa8: 0f b7 05 00 b0 10 80 movzwl 0x8010b000,%eax
80103aaf: 21 d0 and %edx,%eax
80103ab1: 0f b7 c0 movzwl %ax,%eax
80103ab4: 89 04 24 mov %eax,(%esp)
80103ab7: e8 86 ff ff ff call 80103a42 <picsetmask>
}
80103abc: 83 c4 04 add $0x4,%esp
80103abf: 5b pop %ebx
80103ac0: 5d pop %ebp
80103ac1: c3 ret
80103ac2 <picinit>:
// Initialize the 8259A interrupt controllers.
void
picinit(void)
{
80103ac2: 55 push %ebp
80103ac3: 89 e5 mov %esp,%ebp
80103ac5: 83 ec 08 sub $0x8,%esp
// mask all interrupts
outb(IO_PIC1+1, 0xFF);
80103ac8: c7 44 24 04 ff 00 00 movl $0xff,0x4(%esp)
80103acf: 00
80103ad0: c7 04 24 21 00 00 00 movl $0x21,(%esp)
80103ad7: e8 48 ff ff ff call 80103a24 <outb>
outb(IO_PIC2+1, 0xFF);
80103adc: c7 44 24 04 ff 00 00 movl $0xff,0x4(%esp)
80103ae3: 00
80103ae4: c7 04 24 a1 00 00 00 movl $0xa1,(%esp)
80103aeb: e8 34 ff ff ff call 80103a24 <outb>
// ICW1: 0001g0hi
// g: 0 = edge triggering, 1 = level triggering
// h: 0 = cascaded PICs, 1 = master only
// i: 0 = no ICW4, 1 = ICW4 required
outb(IO_PIC1, 0x11);
80103af0: c7 44 24 04 11 00 00 movl $0x11,0x4(%esp)
80103af7: 00
80103af8: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80103aff: e8 20 ff ff ff call 80103a24 <outb>
// ICW2: Vector offset
outb(IO_PIC1+1, T_IRQ0);
80103b04: c7 44 24 04 20 00 00 movl $0x20,0x4(%esp)
80103b0b: 00
80103b0c: c7 04 24 21 00 00 00 movl $0x21,(%esp)
80103b13: e8 0c ff ff ff call 80103a24 <outb>
// ICW3: (master PIC) bit mask of IR lines connected to slaves
// (slave PIC) 3-bit # of slave's connection to master
outb(IO_PIC1+1, 1<<IRQ_SLAVE);
80103b18: c7 44 24 04 04 00 00 movl $0x4,0x4(%esp)
80103b1f: 00
80103b20: c7 04 24 21 00 00 00 movl $0x21,(%esp)
80103b27: e8 f8 fe ff ff call 80103a24 <outb>
// m: 0 = slave PIC, 1 = master PIC
// (ignored when b is 0, as the master/slave role
// can be hardwired).
// a: 1 = Automatic EOI mode
// p: 0 = MCS-80/85 mode, 1 = intel x86 mode
outb(IO_PIC1+1, 0x3);
80103b2c: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
80103b33: 00
80103b34: c7 04 24 21 00 00 00 movl $0x21,(%esp)
80103b3b: e8 e4 fe ff ff call 80103a24 <outb>
// Set up slave (8259A-2)
outb(IO_PIC2, 0x11); // ICW1
80103b40: c7 44 24 04 11 00 00 movl $0x11,0x4(%esp)
80103b47: 00
80103b48: c7 04 24 a0 00 00 00 movl $0xa0,(%esp)
80103b4f: e8 d0 fe ff ff call 80103a24 <outb>
outb(IO_PIC2+1, T_IRQ0 + 8); // ICW2
80103b54: c7 44 24 04 28 00 00 movl $0x28,0x4(%esp)
80103b5b: 00
80103b5c: c7 04 24 a1 00 00 00 movl $0xa1,(%esp)
80103b63: e8 bc fe ff ff call 80103a24 <outb>
outb(IO_PIC2+1, IRQ_SLAVE); // ICW3
80103b68: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp)
80103b6f: 00
80103b70: c7 04 24 a1 00 00 00 movl $0xa1,(%esp)
80103b77: e8 a8 fe ff ff call 80103a24 <outb>
// NB Automatic EOI mode doesn't tend to work on the slave.
// Linux source code says it's "to be investigated".
outb(IO_PIC2+1, 0x3); // ICW4
80103b7c: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
80103b83: 00
80103b84: c7 04 24 a1 00 00 00 movl $0xa1,(%esp)
80103b8b: e8 94 fe ff ff call 80103a24 <outb>
// OCW3: 0ef01prs
// ef: 0x = NOP, 10 = clear specific mask, 11 = set specific mask
// p: 0 = no polling, 1 = polling mode
// rs: 0x = NOP, 10 = read IRR, 11 = read ISR
outb(IO_PIC1, 0x68); // clear specific mask
80103b90: c7 44 24 04 68 00 00 movl $0x68,0x4(%esp)
80103b97: 00
80103b98: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80103b9f: e8 80 fe ff ff call 80103a24 <outb>
outb(IO_PIC1, 0x0a); // read IRR by default
80103ba4: c7 44 24 04 0a 00 00 movl $0xa,0x4(%esp)
80103bab: 00
80103bac: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80103bb3: e8 6c fe ff ff call 80103a24 <outb>
outb(IO_PIC2, 0x68); // OCW3
80103bb8: c7 44 24 04 68 00 00 movl $0x68,0x4(%esp)
80103bbf: 00
80103bc0: c7 04 24 a0 00 00 00 movl $0xa0,(%esp)
80103bc7: e8 58 fe ff ff call 80103a24 <outb>
outb(IO_PIC2, 0x0a); // OCW3
80103bcc: c7 44 24 04 0a 00 00 movl $0xa,0x4(%esp)
80103bd3: 00
80103bd4: c7 04 24 a0 00 00 00 movl $0xa0,(%esp)
80103bdb: e8 44 fe ff ff call 80103a24 <outb>
if(irqmask != 0xFFFF)
80103be0: 0f b7 05 00 b0 10 80 movzwl 0x8010b000,%eax
80103be7: 66 83 f8 ff cmp $0xffffffff,%ax
80103beb: 74 12 je 80103bff <picinit+0x13d>
picsetmask(irqmask);
80103bed: 0f b7 05 00 b0 10 80 movzwl 0x8010b000,%eax
80103bf4: 0f b7 c0 movzwl %ax,%eax
80103bf7: 89 04 24 mov %eax,(%esp)
80103bfa: e8 43 fe ff ff call 80103a42 <picsetmask>
}
80103bff: c9 leave
80103c00: c3 ret
80103c01: 00 00 add %al,(%eax)
...
80103c04 <pipealloc>:
int writeopen; // write fd is still open
};
int
pipealloc(struct file **f0, struct file **f1)
{
80103c04: 55 push %ebp
80103c05: 89 e5 mov %esp,%ebp
80103c07: 83 ec 28 sub $0x28,%esp
struct pipe *p;
p = 0;
80103c0a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
*f0 = *f1 = 0;
80103c11: 8b 45 0c mov 0xc(%ebp),%eax
80103c14: c7 00 00 00 00 00 movl $0x0,(%eax)
80103c1a: 8b 45 0c mov 0xc(%ebp),%eax
80103c1d: 8b 10 mov (%eax),%edx
80103c1f: 8b 45 08 mov 0x8(%ebp),%eax
80103c22: 89 10 mov %edx,(%eax)
if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
80103c24: e8 fb d2 ff ff call 80100f24 <filealloc>
80103c29: 8b 55 08 mov 0x8(%ebp),%edx
80103c2c: 89 02 mov %eax,(%edx)
80103c2e: 8b 45 08 mov 0x8(%ebp),%eax
80103c31: 8b 00 mov (%eax),%eax
80103c33: 85 c0 test %eax,%eax
80103c35: 0f 84 c8 00 00 00 je 80103d03 <pipealloc+0xff>
80103c3b: e8 e4 d2 ff ff call 80100f24 <filealloc>
80103c40: 8b 55 0c mov 0xc(%ebp),%edx
80103c43: 89 02 mov %eax,(%edx)
80103c45: 8b 45 0c mov 0xc(%ebp),%eax
80103c48: 8b 00 mov (%eax),%eax
80103c4a: 85 c0 test %eax,%eax
80103c4c: 0f 84 b1 00 00 00 je 80103d03 <pipealloc+0xff>
goto bad;
if((p = (struct pipe*)kalloc()) == 0)
80103c52: e8 b3 ee ff ff call 80102b0a <kalloc>
80103c57: 89 45 f4 mov %eax,-0xc(%ebp)
80103c5a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80103c5e: 0f 84 9e 00 00 00 je 80103d02 <pipealloc+0xfe>
goto bad;
p->readopen = 1;
80103c64: 8b 45 f4 mov -0xc(%ebp),%eax
80103c67: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax)
80103c6e: 00 00 00
p->writeopen = 1;
80103c71: 8b 45 f4 mov -0xc(%ebp),%eax
80103c74: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax)
80103c7b: 00 00 00
p->nwrite = 0;
80103c7e: 8b 45 f4 mov -0xc(%ebp),%eax
80103c81: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax)
80103c88: 00 00 00
p->nread = 0;
80103c8b: 8b 45 f4 mov -0xc(%ebp),%eax
80103c8e: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax)
80103c95: 00 00 00
initlock(&p->lock, "pipe");
80103c98: 8b 45 f4 mov -0xc(%ebp),%eax
80103c9b: c7 44 24 04 d0 88 10 movl $0x801088d0,0x4(%esp)
80103ca2: 80
80103ca3: 89 04 24 mov %eax,(%esp)
80103ca6: e8 9f 12 00 00 call 80104f4a <initlock>
(*f0)->type = FD_PIPE;
80103cab: 8b 45 08 mov 0x8(%ebp),%eax
80103cae: 8b 00 mov (%eax),%eax
80103cb0: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f0)->readable = 1;
80103cb6: 8b 45 08 mov 0x8(%ebp),%eax
80103cb9: 8b 00 mov (%eax),%eax
80103cbb: c6 40 08 01 movb $0x1,0x8(%eax)
(*f0)->writable = 0;
80103cbf: 8b 45 08 mov 0x8(%ebp),%eax
80103cc2: 8b 00 mov (%eax),%eax
80103cc4: c6 40 09 00 movb $0x0,0x9(%eax)
(*f0)->pipe = p;
80103cc8: 8b 45 08 mov 0x8(%ebp),%eax
80103ccb: 8b 00 mov (%eax),%eax
80103ccd: 8b 55 f4 mov -0xc(%ebp),%edx
80103cd0: 89 50 0c mov %edx,0xc(%eax)
(*f1)->type = FD_PIPE;
80103cd3: 8b 45 0c mov 0xc(%ebp),%eax
80103cd6: 8b 00 mov (%eax),%eax
80103cd8: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f1)->readable = 0;
80103cde: 8b 45 0c mov 0xc(%ebp),%eax
80103ce1: 8b 00 mov (%eax),%eax
80103ce3: c6 40 08 00 movb $0x0,0x8(%eax)
(*f1)->writable = 1;
80103ce7: 8b 45 0c mov 0xc(%ebp),%eax
80103cea: 8b 00 mov (%eax),%eax
80103cec: c6 40 09 01 movb $0x1,0x9(%eax)
(*f1)->pipe = p;
80103cf0: 8b 45 0c mov 0xc(%ebp),%eax
80103cf3: 8b 00 mov (%eax),%eax
80103cf5: 8b 55 f4 mov -0xc(%ebp),%edx
80103cf8: 89 50 0c mov %edx,0xc(%eax)
return 0;
80103cfb: b8 00 00 00 00 mov $0x0,%eax
80103d00: eb 43 jmp 80103d45 <pipealloc+0x141>
p = 0;
*f0 = *f1 = 0;
if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
goto bad;
if((p = (struct pipe*)kalloc()) == 0)
goto bad;
80103d02: 90 nop
(*f1)->pipe = p;
return 0;
//PAGEBREAK: 20
bad:
if(p)
80103d03: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80103d07: 74 0b je 80103d14 <pipealloc+0x110>
kfree((char*)p);
80103d09: 8b 45 f4 mov -0xc(%ebp),%eax
80103d0c: 89 04 24 mov %eax,(%esp)
80103d0f: e8 5d ed ff ff call 80102a71 <kfree>
if(*f0)
80103d14: 8b 45 08 mov 0x8(%ebp),%eax
80103d17: 8b 00 mov (%eax),%eax
80103d19: 85 c0 test %eax,%eax
80103d1b: 74 0d je 80103d2a <pipealloc+0x126>
fileclose(*f0);
80103d1d: 8b 45 08 mov 0x8(%ebp),%eax
80103d20: 8b 00 mov (%eax),%eax
80103d22: 89 04 24 mov %eax,(%esp)
80103d25: e8 a3 d2 ff ff call 80100fcd <fileclose>
if(*f1)
80103d2a: 8b 45 0c mov 0xc(%ebp),%eax
80103d2d: 8b 00 mov (%eax),%eax
80103d2f: 85 c0 test %eax,%eax
80103d31: 74 0d je 80103d40 <pipealloc+0x13c>
fileclose(*f1);
80103d33: 8b 45 0c mov 0xc(%ebp),%eax
80103d36: 8b 00 mov (%eax),%eax
80103d38: 89 04 24 mov %eax,(%esp)
80103d3b: e8 8d d2 ff ff call 80100fcd <fileclose>
return -1;
80103d40: b8 ff ff ff ff mov $0xffffffff,%eax
}
80103d45: c9 leave
80103d46: c3 ret
80103d47 <pipeclose>:
void
pipeclose(struct pipe *p, int writable)
{
80103d47: 55 push %ebp
80103d48: 89 e5 mov %esp,%ebp
80103d4a: 83 ec 18 sub $0x18,%esp
acquire(&p->lock);
80103d4d: 8b 45 08 mov 0x8(%ebp),%eax
80103d50: 89 04 24 mov %eax,(%esp)
80103d53: e8 13 12 00 00 call 80104f6b <acquire>
if(writable){
80103d58: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
80103d5c: 74 1f je 80103d7d <pipeclose+0x36>
p->writeopen = 0;
80103d5e: 8b 45 08 mov 0x8(%ebp),%eax
80103d61: c7 80 40 02 00 00 00 movl $0x0,0x240(%eax)
80103d68: 00 00 00
wakeup(&p->nread);
80103d6b: 8b 45 08 mov 0x8(%ebp),%eax
80103d6e: 05 34 02 00 00 add $0x234,%eax
80103d73: 89 04 24 mov %eax,(%esp)
80103d76: e8 be 0f 00 00 call 80104d39 <wakeup>
80103d7b: eb 1d jmp 80103d9a <pipeclose+0x53>
} else {
p->readopen = 0;
80103d7d: 8b 45 08 mov 0x8(%ebp),%eax
80103d80: c7 80 3c 02 00 00 00 movl $0x0,0x23c(%eax)
80103d87: 00 00 00
wakeup(&p->nwrite);
80103d8a: 8b 45 08 mov 0x8(%ebp),%eax
80103d8d: 05 38 02 00 00 add $0x238,%eax
80103d92: 89 04 24 mov %eax,(%esp)
80103d95: e8 9f 0f 00 00 call 80104d39 <wakeup>
}
if(p->readopen == 0 && p->writeopen == 0){
80103d9a: 8b 45 08 mov 0x8(%ebp),%eax
80103d9d: 8b 80 3c 02 00 00 mov 0x23c(%eax),%eax
80103da3: 85 c0 test %eax,%eax
80103da5: 75 25 jne 80103dcc <pipeclose+0x85>
80103da7: 8b 45 08 mov 0x8(%ebp),%eax
80103daa: 8b 80 40 02 00 00 mov 0x240(%eax),%eax
80103db0: 85 c0 test %eax,%eax
80103db2: 75 18 jne 80103dcc <pipeclose+0x85>
release(&p->lock);
80103db4: 8b 45 08 mov 0x8(%ebp),%eax
80103db7: 89 04 24 mov %eax,(%esp)
80103dba: e8 0d 12 00 00 call 80104fcc <release>
kfree((char*)p);
80103dbf: 8b 45 08 mov 0x8(%ebp),%eax
80103dc2: 89 04 24 mov %eax,(%esp)
80103dc5: e8 a7 ec ff ff call 80102a71 <kfree>
wakeup(&p->nread);
} else {
p->readopen = 0;
wakeup(&p->nwrite);
}
if(p->readopen == 0 && p->writeopen == 0){
80103dca: eb 0b jmp 80103dd7 <pipeclose+0x90>
release(&p->lock);
kfree((char*)p);
} else
release(&p->lock);
80103dcc: 8b 45 08 mov 0x8(%ebp),%eax
80103dcf: 89 04 24 mov %eax,(%esp)
80103dd2: e8 f5 11 00 00 call 80104fcc <release>
}
80103dd7: c9 leave
80103dd8: c3 ret
80103dd9 <pipewrite>:
//PAGEBREAK: 40
int
pipewrite(struct pipe *p, char *addr, int n)
{
80103dd9: 55 push %ebp
80103dda: 89 e5 mov %esp,%ebp
80103ddc: 53 push %ebx
80103ddd: 83 ec 24 sub $0x24,%esp
int i;
acquire(&p->lock);
80103de0: 8b 45 08 mov 0x8(%ebp),%eax
80103de3: 89 04 24 mov %eax,(%esp)
80103de6: e8 80 11 00 00 call 80104f6b <acquire>
for(i = 0; i < n; i++){
80103deb: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80103df2: e9 a6 00 00 00 jmp 80103e9d <pipewrite+0xc4>
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
if(p->readopen == 0 || proc->killed){
80103df7: 8b 45 08 mov 0x8(%ebp),%eax
80103dfa: 8b 80 3c 02 00 00 mov 0x23c(%eax),%eax
80103e00: 85 c0 test %eax,%eax
80103e02: 74 0d je 80103e11 <pipewrite+0x38>
80103e04: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80103e0a: 8b 40 24 mov 0x24(%eax),%eax
80103e0d: 85 c0 test %eax,%eax
80103e0f: 74 15 je 80103e26 <pipewrite+0x4d>
release(&p->lock);
80103e11: 8b 45 08 mov 0x8(%ebp),%eax
80103e14: 89 04 24 mov %eax,(%esp)
80103e17: e8 b0 11 00 00 call 80104fcc <release>
return -1;
80103e1c: b8 ff ff ff ff mov $0xffffffff,%eax
80103e21: e9 9d 00 00 00 jmp 80103ec3 <pipewrite+0xea>
}
wakeup(&p->nread);
80103e26: 8b 45 08 mov 0x8(%ebp),%eax
80103e29: 05 34 02 00 00 add $0x234,%eax
80103e2e: 89 04 24 mov %eax,(%esp)
80103e31: e8 03 0f 00 00 call 80104d39 <wakeup>
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
80103e36: 8b 45 08 mov 0x8(%ebp),%eax
80103e39: 8b 55 08 mov 0x8(%ebp),%edx
80103e3c: 81 c2 38 02 00 00 add $0x238,%edx
80103e42: 89 44 24 04 mov %eax,0x4(%esp)
80103e46: 89 14 24 mov %edx,(%esp)
80103e49: e8 a5 0d 00 00 call 80104bf3 <sleep>
80103e4e: eb 01 jmp 80103e51 <pipewrite+0x78>
{
int i;
acquire(&p->lock);
for(i = 0; i < n; i++){
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
80103e50: 90 nop
80103e51: 8b 45 08 mov 0x8(%ebp),%eax
80103e54: 8b 90 38 02 00 00 mov 0x238(%eax),%edx
80103e5a: 8b 45 08 mov 0x8(%ebp),%eax
80103e5d: 8b 80 34 02 00 00 mov 0x234(%eax),%eax
80103e63: 05 00 02 00 00 add $0x200,%eax
80103e68: 39 c2 cmp %eax,%edx
80103e6a: 74 8b je 80103df7 <pipewrite+0x1e>
return -1;
}
wakeup(&p->nread);
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
}
p->data[p->nwrite++ % PIPESIZE] = addr[i];
80103e6c: 8b 45 08 mov 0x8(%ebp),%eax
80103e6f: 8b 80 38 02 00 00 mov 0x238(%eax),%eax
80103e75: 89 c3 mov %eax,%ebx
80103e77: 81 e3 ff 01 00 00 and $0x1ff,%ebx
80103e7d: 8b 55 f4 mov -0xc(%ebp),%edx
80103e80: 03 55 0c add 0xc(%ebp),%edx
80103e83: 0f b6 0a movzbl (%edx),%ecx
80103e86: 8b 55 08 mov 0x8(%ebp),%edx
80103e89: 88 4c 1a 34 mov %cl,0x34(%edx,%ebx,1)
80103e8d: 8d 50 01 lea 0x1(%eax),%edx
80103e90: 8b 45 08 mov 0x8(%ebp),%eax
80103e93: 89 90 38 02 00 00 mov %edx,0x238(%eax)
pipewrite(struct pipe *p, char *addr, int n)
{
int i;
acquire(&p->lock);
for(i = 0; i < n; i++){
80103e99: 83 45 f4 01 addl $0x1,-0xc(%ebp)
80103e9d: 8b 45 f4 mov -0xc(%ebp),%eax
80103ea0: 3b 45 10 cmp 0x10(%ebp),%eax
80103ea3: 7c ab jl 80103e50 <pipewrite+0x77>
wakeup(&p->nread);
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
}
p->data[p->nwrite++ % PIPESIZE] = addr[i];
}
wakeup(&p->nread); //DOC: pipewrite-wakeup1
80103ea5: 8b 45 08 mov 0x8(%ebp),%eax
80103ea8: 05 34 02 00 00 add $0x234,%eax
80103ead: 89 04 24 mov %eax,(%esp)
80103eb0: e8 84 0e 00 00 call 80104d39 <wakeup>
release(&p->lock);
80103eb5: 8b 45 08 mov 0x8(%ebp),%eax
80103eb8: 89 04 24 mov %eax,(%esp)
80103ebb: e8 0c 11 00 00 call 80104fcc <release>
return n;
80103ec0: 8b 45 10 mov 0x10(%ebp),%eax
}
80103ec3: 83 c4 24 add $0x24,%esp
80103ec6: 5b pop %ebx
80103ec7: 5d pop %ebp
80103ec8: c3 ret
80103ec9 <piperead>:
int
piperead(struct pipe *p, char *addr, int n)
{
80103ec9: 55 push %ebp
80103eca: 89 e5 mov %esp,%ebp
80103ecc: 53 push %ebx
80103ecd: 83 ec 24 sub $0x24,%esp
int i;
acquire(&p->lock);
80103ed0: 8b 45 08 mov 0x8(%ebp),%eax
80103ed3: 89 04 24 mov %eax,(%esp)
80103ed6: e8 90 10 00 00 call 80104f6b <acquire>
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
80103edb: eb 3a jmp 80103f17 <piperead+0x4e>
if(proc->killed){
80103edd: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80103ee3: 8b 40 24 mov 0x24(%eax),%eax
80103ee6: 85 c0 test %eax,%eax
80103ee8: 74 15 je 80103eff <piperead+0x36>
release(&p->lock);
80103eea: 8b 45 08 mov 0x8(%ebp),%eax
80103eed: 89 04 24 mov %eax,(%esp)
80103ef0: e8 d7 10 00 00 call 80104fcc <release>
return -1;
80103ef5: b8 ff ff ff ff mov $0xffffffff,%eax
80103efa: e9 b6 00 00 00 jmp 80103fb5 <piperead+0xec>
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
80103eff: 8b 45 08 mov 0x8(%ebp),%eax
80103f02: 8b 55 08 mov 0x8(%ebp),%edx
80103f05: 81 c2 34 02 00 00 add $0x234,%edx
80103f0b: 89 44 24 04 mov %eax,0x4(%esp)
80103f0f: 89 14 24 mov %edx,(%esp)
80103f12: e8 dc 0c 00 00 call 80104bf3 <sleep>
piperead(struct pipe *p, char *addr, int n)
{
int i;
acquire(&p->lock);
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
80103f17: 8b 45 08 mov 0x8(%ebp),%eax
80103f1a: 8b 90 34 02 00 00 mov 0x234(%eax),%edx
80103f20: 8b 45 08 mov 0x8(%ebp),%eax
80103f23: 8b 80 38 02 00 00 mov 0x238(%eax),%eax
80103f29: 39 c2 cmp %eax,%edx
80103f2b: 75 0d jne 80103f3a <piperead+0x71>
80103f2d: 8b 45 08 mov 0x8(%ebp),%eax
80103f30: 8b 80 40 02 00 00 mov 0x240(%eax),%eax
80103f36: 85 c0 test %eax,%eax
80103f38: 75 a3 jne 80103edd <piperead+0x14>
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
}
for(i = 0; i < n; i++){ //DOC: piperead-copy
80103f3a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80103f41: eb 49 jmp 80103f8c <piperead+0xc3>
if(p->nread == p->nwrite)
80103f43: 8b 45 08 mov 0x8(%ebp),%eax
80103f46: 8b 90 34 02 00 00 mov 0x234(%eax),%edx
80103f4c: 8b 45 08 mov 0x8(%ebp),%eax
80103f4f: 8b 80 38 02 00 00 mov 0x238(%eax),%eax
80103f55: 39 c2 cmp %eax,%edx
80103f57: 74 3d je 80103f96 <piperead+0xcd>
break;
addr[i] = p->data[p->nread++ % PIPESIZE];
80103f59: 8b 45 f4 mov -0xc(%ebp),%eax
80103f5c: 89 c2 mov %eax,%edx
80103f5e: 03 55 0c add 0xc(%ebp),%edx
80103f61: 8b 45 08 mov 0x8(%ebp),%eax
80103f64: 8b 80 34 02 00 00 mov 0x234(%eax),%eax
80103f6a: 89 c3 mov %eax,%ebx
80103f6c: 81 e3 ff 01 00 00 and $0x1ff,%ebx
80103f72: 8b 4d 08 mov 0x8(%ebp),%ecx
80103f75: 0f b6 4c 19 34 movzbl 0x34(%ecx,%ebx,1),%ecx
80103f7a: 88 0a mov %cl,(%edx)
80103f7c: 8d 50 01 lea 0x1(%eax),%edx
80103f7f: 8b 45 08 mov 0x8(%ebp),%eax
80103f82: 89 90 34 02 00 00 mov %edx,0x234(%eax)
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
}
for(i = 0; i < n; i++){ //DOC: piperead-copy
80103f88: 83 45 f4 01 addl $0x1,-0xc(%ebp)
80103f8c: 8b 45 f4 mov -0xc(%ebp),%eax
80103f8f: 3b 45 10 cmp 0x10(%ebp),%eax
80103f92: 7c af jl 80103f43 <piperead+0x7a>
80103f94: eb 01 jmp 80103f97 <piperead+0xce>
if(p->nread == p->nwrite)
break;
80103f96: 90 nop
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
80103f97: 8b 45 08 mov 0x8(%ebp),%eax
80103f9a: 05 38 02 00 00 add $0x238,%eax
80103f9f: 89 04 24 mov %eax,(%esp)
80103fa2: e8 92 0d 00 00 call 80104d39 <wakeup>
release(&p->lock);
80103fa7: 8b 45 08 mov 0x8(%ebp),%eax
80103faa: 89 04 24 mov %eax,(%esp)
80103fad: e8 1a 10 00 00 call 80104fcc <release>
return i;
80103fb2: 8b 45 f4 mov -0xc(%ebp),%eax
}
80103fb5: 83 c4 24 add $0x24,%esp
80103fb8: 5b pop %ebx
80103fb9: 5d pop %ebp
80103fba: c3 ret
...
80103fbc <readeflags>:
asm volatile("ltr %0" : : "r" (sel));
}
static inline uint
readeflags(void)
{
80103fbc: 55 push %ebp
80103fbd: 89 e5 mov %esp,%ebp
80103fbf: 83 ec 10 sub $0x10,%esp
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80103fc2: 9c pushf
80103fc3: 58 pop %eax
80103fc4: 89 45 fc mov %eax,-0x4(%ebp)
return eflags;
80103fc7: 8b 45 fc mov -0x4(%ebp),%eax
}
80103fca: c9 leave
80103fcb: c3 ret
80103fcc <sti>:
asm volatile("cli");
}
static inline void
sti(void)
{
80103fcc: 55 push %ebp
80103fcd: 89 e5 mov %esp,%ebp
asm volatile("sti");
80103fcf: fb sti
}
80103fd0: 5d pop %ebp
80103fd1: c3 ret
80103fd2 <memcop>:
static void wakeup1(void *chan);
void*
memcop(void *dst, void *src, uint n)
{
80103fd2: 55 push %ebp
80103fd3: 89 e5 mov %esp,%ebp
80103fd5: 83 ec 10 sub $0x10,%esp
const char *s;
char *d;
s = src;
80103fd8: 8b 45 0c mov 0xc(%ebp),%eax
80103fdb: 89 45 f8 mov %eax,-0x8(%ebp)
d = dst;
80103fde: 8b 45 08 mov 0x8(%ebp),%eax
80103fe1: 89 45 fc mov %eax,-0x4(%ebp)
if(s < d && s + n > d){
80103fe4: 8b 45 f8 mov -0x8(%ebp),%eax
80103fe7: 3b 45 fc cmp -0x4(%ebp),%eax
80103fea: 73 55 jae 80104041 <memcop+0x6f>
80103fec: 8b 45 10 mov 0x10(%ebp),%eax
80103fef: 8b 55 f8 mov -0x8(%ebp),%edx
80103ff2: 8d 04 02 lea (%edx,%eax,1),%eax
80103ff5: 3b 45 fc cmp -0x4(%ebp),%eax
80103ff8: 76 4a jbe 80104044 <memcop+0x72>
s += n;
80103ffa: 8b 45 10 mov 0x10(%ebp),%eax
80103ffd: 01 45 f8 add %eax,-0x8(%ebp)
d += n;
80104000: 8b 45 10 mov 0x10(%ebp),%eax
80104003: 01 45 fc add %eax,-0x4(%ebp)
while(n-- > 0)
80104006: eb 13 jmp 8010401b <memcop+0x49>
*--d = *--s;
80104008: 83 6d fc 01 subl $0x1,-0x4(%ebp)
8010400c: 83 6d f8 01 subl $0x1,-0x8(%ebp)
80104010: 8b 45 f8 mov -0x8(%ebp),%eax
80104013: 0f b6 10 movzbl (%eax),%edx
80104016: 8b 45 fc mov -0x4(%ebp),%eax
80104019: 88 10 mov %dl,(%eax)
s = src;
d = dst;
if(s < d && s + n > d){
s += n;
d += n;
while(n-- > 0)
8010401b: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010401f: 0f 95 c0 setne %al
80104022: 83 6d 10 01 subl $0x1,0x10(%ebp)
80104026: 84 c0 test %al,%al
80104028: 75 de jne 80104008 <memcop+0x36>
const char *s;
char *d;
s = src;
d = dst;
if(s < d && s + n > d){
8010402a: eb 28 jmp 80104054 <memcop+0x82>
d += n;
while(n-- > 0)
*--d = *--s;
} else
while(n-- > 0)
*d++ = *s++;
8010402c: 8b 45 f8 mov -0x8(%ebp),%eax
8010402f: 0f b6 10 movzbl (%eax),%edx
80104032: 8b 45 fc mov -0x4(%ebp),%eax
80104035: 88 10 mov %dl,(%eax)
80104037: 83 45 fc 01 addl $0x1,-0x4(%ebp)
8010403b: 83 45 f8 01 addl $0x1,-0x8(%ebp)
8010403f: eb 04 jmp 80104045 <memcop+0x73>
s += n;
d += n;
while(n-- > 0)
*--d = *--s;
} else
while(n-- > 0)
80104041: 90 nop
80104042: eb 01 jmp 80104045 <memcop+0x73>
80104044: 90 nop
80104045: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80104049: 0f 95 c0 setne %al
8010404c: 83 6d 10 01 subl $0x1,0x10(%ebp)
80104050: 84 c0 test %al,%al
80104052: 75 d8 jne 8010402c <memcop+0x5a>
*d++ = *s++;
return dst;
80104054: 8b 45 08 mov 0x8(%ebp),%eax
}
80104057: c9 leave
80104058: c3 ret
80104059 <pinit>:
void
pinit(void)
{
80104059: 55 push %ebp
8010405a: 89 e5 mov %esp,%ebp
8010405c: 83 ec 18 sub $0x18,%esp
initlock(&ptable.lock, "ptable");
8010405f: c7 44 24 04 d8 88 10 movl $0x801088d8,0x4(%esp)
80104066: 80
80104067: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
8010406e: e8 d7 0e 00 00 call 80104f4a <initlock>
}
80104073: c9 leave
80104074: c3 ret
80104075 <allocproc>:
// If found, change state to EMBRYO and initialize
// state required to run in the kernel.
// Otherwise return 0.
static struct proc*
allocproc(void)
{
80104075: 55 push %ebp
80104076: 89 e5 mov %esp,%ebp
80104078: 83 ec 28 sub $0x28,%esp
struct proc *p;
char *sp;
acquire(&ptable.lock);
8010407b: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104082: e8 e4 0e 00 00 call 80104f6b <acquire>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80104087: c7 45 f0 74 ff 10 80 movl $0x8010ff74,-0x10(%ebp)
8010408e: eb 11 jmp 801040a1 <allocproc+0x2c>
if(p->state == UNUSED)
80104090: 8b 45 f0 mov -0x10(%ebp),%eax
80104093: 8b 40 0c mov 0xc(%eax),%eax
80104096: 85 c0 test %eax,%eax
80104098: 74 27 je 801040c1 <allocproc+0x4c>
{
struct proc *p;
char *sp;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
8010409a: 81 45 f0 84 00 00 00 addl $0x84,-0x10(%ebp)
801040a1: b8 74 20 11 80 mov $0x80112074,%eax
801040a6: 39 45 f0 cmp %eax,-0x10(%ebp)
801040a9: 72 e5 jb 80104090 <allocproc+0x1b>
if(p->state == UNUSED)
goto found;
release(&ptable.lock);
801040ab: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
801040b2: e8 15 0f 00 00 call 80104fcc <release>
return 0;
801040b7: b8 00 00 00 00 mov $0x0,%eax
801040bc: e9 b5 00 00 00 jmp 80104176 <allocproc+0x101>
char *sp;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
if(p->state == UNUSED)
goto found;
801040c1: 90 nop
release(&ptable.lock);
return 0;
found:
p->state = EMBRYO;
801040c2: 8b 45 f0 mov -0x10(%ebp),%eax
801040c5: c7 40 0c 01 00 00 00 movl $0x1,0xc(%eax)
p->pid = nextpid++;
801040cc: a1 04 b0 10 80 mov 0x8010b004,%eax
801040d1: 8b 55 f0 mov -0x10(%ebp),%edx
801040d4: 89 42 10 mov %eax,0x10(%edx)
801040d7: 83 c0 01 add $0x1,%eax
801040da: a3 04 b0 10 80 mov %eax,0x8010b004
release(&ptable.lock);
801040df: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
801040e6: e8 e1 0e 00 00 call 80104fcc <release>
// Allocate kernel stack.
if((p->kstack = kalloc()) == 0){
801040eb: e8 1a ea ff ff call 80102b0a <kalloc>
801040f0: 8b 55 f0 mov -0x10(%ebp),%edx
801040f3: 89 42 08 mov %eax,0x8(%edx)
801040f6: 8b 45 f0 mov -0x10(%ebp),%eax
801040f9: 8b 40 08 mov 0x8(%eax),%eax
801040fc: 85 c0 test %eax,%eax
801040fe: 75 11 jne 80104111 <allocproc+0x9c>
p->state = UNUSED;
80104100: 8b 45 f0 mov -0x10(%ebp),%eax
80104103: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
return 0;
8010410a: b8 00 00 00 00 mov $0x0,%eax
8010410f: eb 65 jmp 80104176 <allocproc+0x101>
}
sp = p->kstack + KSTACKSIZE;
80104111: 8b 45 f0 mov -0x10(%ebp),%eax
80104114: 8b 40 08 mov 0x8(%eax),%eax
80104117: 05 00 10 00 00 add $0x1000,%eax
8010411c: 89 45 f4 mov %eax,-0xc(%ebp)
// Leave room for trap frame.
sp -= sizeof *p->tf;
8010411f: 83 6d f4 4c subl $0x4c,-0xc(%ebp)
p->tf = (struct trapframe*)sp;
80104123: 8b 55 f4 mov -0xc(%ebp),%edx
80104126: 8b 45 f0 mov -0x10(%ebp),%eax
80104129: 89 50 18 mov %edx,0x18(%eax)
// Set up new context to start executing at forkret,
// which returns to trapret.
sp -= 4;
8010412c: 83 6d f4 04 subl $0x4,-0xc(%ebp)
*(uint*)sp = (uint)trapret;
80104130: 8b 45 f4 mov -0xc(%ebp),%eax
80104133: ba bc 66 10 80 mov $0x801066bc,%edx
80104138: 89 10 mov %edx,(%eax)
sp -= sizeof *p->context;
8010413a: 83 6d f4 14 subl $0x14,-0xc(%ebp)
p->context = (struct context*)sp;
8010413e: 8b 55 f4 mov -0xc(%ebp),%edx
80104141: 8b 45 f0 mov -0x10(%ebp),%eax
80104144: 89 50 1c mov %edx,0x1c(%eax)
memset(p->context, 0, sizeof *p->context);
80104147: 8b 45 f0 mov -0x10(%ebp),%eax
8010414a: 8b 40 1c mov 0x1c(%eax),%eax
8010414d: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp)
80104154: 00
80104155: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
8010415c: 00
8010415d: 89 04 24 mov %eax,(%esp)
80104160: e8 55 10 00 00 call 801051ba <memset>
p->context->eip = (uint)forkret;
80104165: 8b 45 f0 mov -0x10(%ebp),%eax
80104168: 8b 40 1c mov 0x1c(%eax),%eax
8010416b: ba c7 4b 10 80 mov $0x80104bc7,%edx
80104170: 89 50 10 mov %edx,0x10(%eax)
return p;
80104173: 8b 45 f0 mov -0x10(%ebp),%eax
}
80104176: c9 leave
80104177: c3 ret
80104178 <userinit>:
//PAGEBREAK: 32
// Set up first user process.
void
userinit(void)
{
80104178: 55 push %ebp
80104179: 89 e5 mov %esp,%ebp
8010417b: 83 ec 28 sub $0x28,%esp
struct proc *p;
extern char _binary_initcode_start[], _binary_initcode_size[];
p = allocproc();
8010417e: e8 f2 fe ff ff call 80104075 <allocproc>
80104183: 89 45 f4 mov %eax,-0xc(%ebp)
initproc = p;
80104186: 8b 45 f4 mov -0xc(%ebp),%eax
80104189: a3 68 b6 10 80 mov %eax,0x8010b668
if((p->pgdir = setupkvm()) == 0)
8010418e: e8 12 3c 00 00 call 80107da5 <setupkvm>
80104193: 8b 55 f4 mov -0xc(%ebp),%edx
80104196: 89 42 04 mov %eax,0x4(%edx)
80104199: 8b 45 f4 mov -0xc(%ebp),%eax
8010419c: 8b 40 04 mov 0x4(%eax),%eax
8010419f: 85 c0 test %eax,%eax
801041a1: 75 0c jne 801041af <userinit+0x37>
panic("userinit: out of memory?");
801041a3: c7 04 24 df 88 10 80 movl $0x801088df,(%esp)
801041aa: e8 8b c3 ff ff call 8010053a <panic>
inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
801041af: ba 2c 00 00 00 mov $0x2c,%edx
801041b4: 8b 45 f4 mov -0xc(%ebp),%eax
801041b7: 8b 40 04 mov 0x4(%eax),%eax
801041ba: 89 54 24 08 mov %edx,0x8(%esp)
801041be: c7 44 24 04 00 b5 10 movl $0x8010b500,0x4(%esp)
801041c5: 80
801041c6: 89 04 24 mov %eax,(%esp)
801041c9: e8 30 3e 00 00 call 80107ffe <inituvm>
p->sz = PGSIZE;
801041ce: 8b 45 f4 mov -0xc(%ebp),%eax
801041d1: c7 00 00 10 00 00 movl $0x1000,(%eax)
memset(p->tf, 0, sizeof(*p->tf));
801041d7: 8b 45 f4 mov -0xc(%ebp),%eax
801041da: 8b 40 18 mov 0x18(%eax),%eax
801041dd: c7 44 24 08 4c 00 00 movl $0x4c,0x8(%esp)
801041e4: 00
801041e5: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801041ec: 00
801041ed: 89 04 24 mov %eax,(%esp)
801041f0: e8 c5 0f 00 00 call 801051ba <memset>
p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
801041f5: 8b 45 f4 mov -0xc(%ebp),%eax
801041f8: 8b 40 18 mov 0x18(%eax),%eax
801041fb: 66 c7 40 3c 23 00 movw $0x23,0x3c(%eax)
p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
80104201: 8b 45 f4 mov -0xc(%ebp),%eax
80104204: 8b 40 18 mov 0x18(%eax),%eax
80104207: 66 c7 40 2c 2b 00 movw $0x2b,0x2c(%eax)
p->tf->es = p->tf->ds;
8010420d: 8b 45 f4 mov -0xc(%ebp),%eax
80104210: 8b 40 18 mov 0x18(%eax),%eax
80104213: 8b 55 f4 mov -0xc(%ebp),%edx
80104216: 8b 52 18 mov 0x18(%edx),%edx
80104219: 0f b7 52 2c movzwl 0x2c(%edx),%edx
8010421d: 66 89 50 28 mov %dx,0x28(%eax)
p->tf->ss = p->tf->ds;
80104221: 8b 45 f4 mov -0xc(%ebp),%eax
80104224: 8b 40 18 mov 0x18(%eax),%eax
80104227: 8b 55 f4 mov -0xc(%ebp),%edx
8010422a: 8b 52 18 mov 0x18(%edx),%edx
8010422d: 0f b7 52 2c movzwl 0x2c(%edx),%edx
80104231: 66 89 50 48 mov %dx,0x48(%eax)
p->tf->eflags = FL_IF;
80104235: 8b 45 f4 mov -0xc(%ebp),%eax
80104238: 8b 40 18 mov 0x18(%eax),%eax
8010423b: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax)
p->tf->esp = PGSIZE;
80104242: 8b 45 f4 mov -0xc(%ebp),%eax
80104245: 8b 40 18 mov 0x18(%eax),%eax
80104248: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax)
p->tf->eip = 0; // beginning of initcode.S
8010424f: 8b 45 f4 mov -0xc(%ebp),%eax
80104252: 8b 40 18 mov 0x18(%eax),%eax
80104255: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax)
safestrcpy(p->name, "initcode", sizeof(p->name));
8010425c: 8b 45 f4 mov -0xc(%ebp),%eax
8010425f: 83 c0 6c add $0x6c,%eax
80104262: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80104269: 00
8010426a: c7 44 24 04 f8 88 10 movl $0x801088f8,0x4(%esp)
80104271: 80
80104272: 89 04 24 mov %eax,(%esp)
80104275: e8 73 11 00 00 call 801053ed <safestrcpy>
p->cwd = namei("/");
8010427a: c7 04 24 01 89 10 80 movl $0x80108901,(%esp)
80104281: e8 9d e1 ff ff call 80102423 <namei>
80104286: 8b 55 f4 mov -0xc(%ebp),%edx
80104289: 89 42 68 mov %eax,0x68(%edx)
p->state = RUNNABLE;
8010428c: 8b 45 f4 mov -0xc(%ebp),%eax
8010428f: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
}
80104296: c9 leave
80104297: c3 ret
80104298 <growproc>:
// Grow current process's memory by n bytes.
// Return 0 on success, -1 on failure.
int
growproc(int n)
{
80104298: 55 push %ebp
80104299: 89 e5 mov %esp,%ebp
8010429b: 83 ec 28 sub $0x28,%esp
uint sz;
sz = proc->sz;
8010429e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801042a4: 8b 00 mov (%eax),%eax
801042a6: 89 45 f4 mov %eax,-0xc(%ebp)
if(n > 0){
801042a9: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
801042ad: 7e 34 jle 801042e3 <growproc+0x4b>
if((sz = allocuvm(proc->pgdir, sz, sz + n)) == 0)
801042af: 8b 45 08 mov 0x8(%ebp),%eax
801042b2: 89 c2 mov %eax,%edx
801042b4: 03 55 f4 add -0xc(%ebp),%edx
801042b7: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801042bd: 8b 40 04 mov 0x4(%eax),%eax
801042c0: 89 54 24 08 mov %edx,0x8(%esp)
801042c4: 8b 55 f4 mov -0xc(%ebp),%edx
801042c7: 89 54 24 04 mov %edx,0x4(%esp)
801042cb: 89 04 24 mov %eax,(%esp)
801042ce: e8 a6 3e 00 00 call 80108179 <allocuvm>
801042d3: 89 45 f4 mov %eax,-0xc(%ebp)
801042d6: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801042da: 75 41 jne 8010431d <growproc+0x85>
return -1;
801042dc: b8 ff ff ff ff mov $0xffffffff,%eax
801042e1: eb 58 jmp 8010433b <growproc+0xa3>
} else if(n < 0){
801042e3: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
801042e7: 79 34 jns 8010431d <growproc+0x85>
if((sz = deallocuvm(proc->pgdir, sz, sz + n)) == 0)
801042e9: 8b 45 08 mov 0x8(%ebp),%eax
801042ec: 89 c2 mov %eax,%edx
801042ee: 03 55 f4 add -0xc(%ebp),%edx
801042f1: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801042f7: 8b 40 04 mov 0x4(%eax),%eax
801042fa: 89 54 24 08 mov %edx,0x8(%esp)
801042fe: 8b 55 f4 mov -0xc(%ebp),%edx
80104301: 89 54 24 04 mov %edx,0x4(%esp)
80104305: 89 04 24 mov %eax,(%esp)
80104308: e8 46 3f 00 00 call 80108253 <deallocuvm>
8010430d: 89 45 f4 mov %eax,-0xc(%ebp)
80104310: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80104314: 75 07 jne 8010431d <growproc+0x85>
return -1;
80104316: b8 ff ff ff ff mov $0xffffffff,%eax
8010431b: eb 1e jmp 8010433b <growproc+0xa3>
}
proc->sz = sz;
8010431d: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104323: 8b 55 f4 mov -0xc(%ebp),%edx
80104326: 89 10 mov %edx,(%eax)
switchuvm(proc);
80104328: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010432e: 89 04 24 mov %eax,(%esp)
80104331: e8 61 3b 00 00 call 80107e97 <switchuvm>
return 0;
80104336: b8 00 00 00 00 mov $0x0,%eax
}
8010433b: c9 leave
8010433c: c3 ret
8010433d <fork>:
// Create a new process copying p as the parent.
// Sets up stack to return as if from system call.
// Caller must set state of returned proc to RUNNABLE.
int
fork(void)
{
8010433d: 55 push %ebp
8010433e: 89 e5 mov %esp,%ebp
80104340: 57 push %edi
80104341: 56 push %esi
80104342: 53 push %ebx
80104343: 83 ec 2c sub $0x2c,%esp
int i, pid;
struct proc *np;
// Allocate process.
if((np = allocproc()) == 0)
80104346: e8 2a fd ff ff call 80104075 <allocproc>
8010434b: 89 45 e4 mov %eax,-0x1c(%ebp)
8010434e: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
80104352: 75 0a jne 8010435e <fork+0x21>
return -1;
80104354: b8 ff ff ff ff mov $0xffffffff,%eax
80104359: e9 47 01 00 00 jmp 801044a5 <fork+0x168>
// Copy process state from p.
if((np->pgdir = copyuvm(proc->pgdir, proc->sz)) == 0){
8010435e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104364: 8b 10 mov (%eax),%edx
80104366: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010436c: 8b 40 04 mov 0x4(%eax),%eax
8010436f: 89 54 24 04 mov %edx,0x4(%esp)
80104373: 89 04 24 mov %eax,(%esp)
80104376: e8 68 40 00 00 call 801083e3 <copyuvm>
8010437b: 8b 55 e4 mov -0x1c(%ebp),%edx
8010437e: 89 42 04 mov %eax,0x4(%edx)
80104381: 8b 45 e4 mov -0x1c(%ebp),%eax
80104384: 8b 40 04 mov 0x4(%eax),%eax
80104387: 85 c0 test %eax,%eax
80104389: 75 2c jne 801043b7 <fork+0x7a>
kfree(np->kstack);
8010438b: 8b 45 e4 mov -0x1c(%ebp),%eax
8010438e: 8b 40 08 mov 0x8(%eax),%eax
80104391: 89 04 24 mov %eax,(%esp)
80104394: e8 d8 e6 ff ff call 80102a71 <kfree>
np->kstack = 0;
80104399: 8b 45 e4 mov -0x1c(%ebp),%eax
8010439c: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
np->state = UNUSED;
801043a3: 8b 45 e4 mov -0x1c(%ebp),%eax
801043a6: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
return -1;
801043ad: b8 ff ff ff ff mov $0xffffffff,%eax
801043b2: e9 ee 00 00 00 jmp 801044a5 <fork+0x168>
}
np->sz = proc->sz;
801043b7: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801043bd: 8b 10 mov (%eax),%edx
801043bf: 8b 45 e4 mov -0x1c(%ebp),%eax
801043c2: 89 10 mov %edx,(%eax)
np->parent = proc;
801043c4: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
801043cb: 8b 45 e4 mov -0x1c(%ebp),%eax
801043ce: 89 50 14 mov %edx,0x14(%eax)
*np->tf = *proc->tf;
801043d1: 8b 45 e4 mov -0x1c(%ebp),%eax
801043d4: 8b 50 18 mov 0x18(%eax),%edx
801043d7: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801043dd: 8b 40 18 mov 0x18(%eax),%eax
801043e0: 89 c3 mov %eax,%ebx
801043e2: b8 13 00 00 00 mov $0x13,%eax
801043e7: 89 d7 mov %edx,%edi
801043e9: 89 de mov %ebx,%esi
801043eb: 89 c1 mov %eax,%ecx
801043ed: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
np->isthread = 0;
801043ef: 8b 45 e4 mov -0x1c(%ebp),%eax
801043f2: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax)
801043f9: 00 00 00
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
801043fc: 8b 45 e4 mov -0x1c(%ebp),%eax
801043ff: 8b 40 18 mov 0x18(%eax),%eax
80104402: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
for(i = 0; i < NOFILE; i++)
80104409: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp)
80104410: eb 3d jmp 8010444f <fork+0x112>
if(proc->ofile[i])
80104412: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104418: 8b 55 dc mov -0x24(%ebp),%edx
8010441b: 83 c2 08 add $0x8,%edx
8010441e: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
80104422: 85 c0 test %eax,%eax
80104424: 74 25 je 8010444b <fork+0x10e>
np->ofile[i] = filedup(proc->ofile[i]);
80104426: 8b 5d dc mov -0x24(%ebp),%ebx
80104429: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010442f: 8b 55 dc mov -0x24(%ebp),%edx
80104432: 83 c2 08 add $0x8,%edx
80104435: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
80104439: 89 04 24 mov %eax,(%esp)
8010443c: e8 44 cb ff ff call 80100f85 <filedup>
80104441: 8b 55 e4 mov -0x1c(%ebp),%edx
80104444: 8d 4b 08 lea 0x8(%ebx),%ecx
80104447: 89 44 8a 08 mov %eax,0x8(%edx,%ecx,4)
np->isthread = 0;
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
for(i = 0; i < NOFILE; i++)
8010444b: 83 45 dc 01 addl $0x1,-0x24(%ebp)
8010444f: 83 7d dc 0f cmpl $0xf,-0x24(%ebp)
80104453: 7e bd jle 80104412 <fork+0xd5>
if(proc->ofile[i])
np->ofile[i] = filedup(proc->ofile[i]);
np->cwd = idup(proc->cwd);
80104455: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010445b: 8b 40 68 mov 0x68(%eax),%eax
8010445e: 89 04 24 mov %eax,(%esp)
80104461: e8 e3 d3 ff ff call 80101849 <idup>
80104466: 8b 55 e4 mov -0x1c(%ebp),%edx
80104469: 89 42 68 mov %eax,0x68(%edx)
pid = np->pid;
8010446c: 8b 45 e4 mov -0x1c(%ebp),%eax
8010446f: 8b 40 10 mov 0x10(%eax),%eax
80104472: 89 45 e0 mov %eax,-0x20(%ebp)
np->state = RUNNABLE;
80104475: 8b 45 e4 mov -0x1c(%ebp),%eax
80104478: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
safestrcpy(np->name, proc->name, sizeof(proc->name));
8010447f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104485: 8d 50 6c lea 0x6c(%eax),%edx
80104488: 8b 45 e4 mov -0x1c(%ebp),%eax
8010448b: 83 c0 6c add $0x6c,%eax
8010448e: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80104495: 00
80104496: 89 54 24 04 mov %edx,0x4(%esp)
8010449a: 89 04 24 mov %eax,(%esp)
8010449d: e8 4b 0f 00 00 call 801053ed <safestrcpy>
return pid;
801044a2: 8b 45 e0 mov -0x20(%ebp),%eax
}
801044a5: 83 c4 2c add $0x2c,%esp
801044a8: 5b pop %ebx
801044a9: 5e pop %esi
801044aa: 5f pop %edi
801044ab: 5d pop %ebp
801044ac: c3 ret
801044ad <clone>:
//creat a new process but used parent pgdir.
int clone(int stack, int size, int routine, int arg){
801044ad: 55 push %ebp
801044ae: 89 e5 mov %esp,%ebp
801044b0: 57 push %edi
801044b1: 56 push %esi
801044b2: 53 push %ebx
801044b3: 81 ec bc 00 00 00 sub $0xbc,%esp
int i, pid;
struct proc *np;
//cprintf("in clone\n");
// Allocate process.
if((np = allocproc()) == 0)
801044b9: e8 b7 fb ff ff call 80104075 <allocproc>
801044be: 89 45 dc mov %eax,-0x24(%ebp)
801044c1: 83 7d dc 00 cmpl $0x0,-0x24(%ebp)
801044c5: 75 0a jne 801044d1 <clone+0x24>
return -1;
801044c7: b8 ff ff ff ff mov $0xffffffff,%eax
801044cc: e9 f4 01 00 00 jmp 801046c5 <clone+0x218>
if((stack % PGSIZE) != 0 || stack == 0 || routine == 0)
801044d1: 8b 45 08 mov 0x8(%ebp),%eax
801044d4: 25 ff 0f 00 00 and $0xfff,%eax
801044d9: 85 c0 test %eax,%eax
801044db: 75 0c jne 801044e9 <clone+0x3c>
801044dd: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
801044e1: 74 06 je 801044e9 <clone+0x3c>
801044e3: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801044e7: 75 0a jne 801044f3 <clone+0x46>
return -1;
801044e9: b8 ff ff ff ff mov $0xffffffff,%eax
801044ee: e9 d2 01 00 00 jmp 801046c5 <clone+0x218>
np->pgdir = proc->pgdir;
801044f3: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801044f9: 8b 50 04 mov 0x4(%eax),%edx
801044fc: 8b 45 dc mov -0x24(%ebp),%eax
801044ff: 89 50 04 mov %edx,0x4(%eax)
np->sz = proc->sz;
80104502: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104508: 8b 10 mov (%eax),%edx
8010450a: 8b 45 dc mov -0x24(%ebp),%eax
8010450d: 89 10 mov %edx,(%eax)
np->parent = proc;
8010450f: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
80104516: 8b 45 dc mov -0x24(%ebp),%eax
80104519: 89 50 14 mov %edx,0x14(%eax)
*np->tf = *proc->tf;
8010451c: 8b 45 dc mov -0x24(%ebp),%eax
8010451f: 8b 50 18 mov 0x18(%eax),%edx
80104522: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104528: 8b 40 18 mov 0x18(%eax),%eax
8010452b: 89 c3 mov %eax,%ebx
8010452d: b8 13 00 00 00 mov $0x13,%eax
80104532: 89 d7 mov %edx,%edi
80104534: 89 de mov %ebx,%esi
80104536: 89 c1 mov %eax,%ecx
80104538: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
np->isthread = 1;
8010453a: 8b 45 dc mov -0x24(%ebp),%eax
8010453d: c7 80 80 00 00 00 01 movl $0x1,0x80(%eax)
80104544: 00 00 00
pid = np->pid;
80104547: 8b 45 dc mov -0x24(%ebp),%eax
8010454a: 8b 40 10 mov 0x10(%eax),%eax
8010454d: 89 45 d8 mov %eax,-0x28(%ebp)
struct proc *pp;
pp = proc;
80104550: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104556: 89 45 e0 mov %eax,-0x20(%ebp)
while(pp->isthread == 1){
80104559: eb 09 jmp 80104564 <clone+0xb7>
pp = pp->parent;
8010455b: 8b 45 e0 mov -0x20(%ebp),%eax
8010455e: 8b 40 14 mov 0x14(%eax),%eax
80104561: 89 45 e0 mov %eax,-0x20(%ebp)
np->isthread = 1;
pid = np->pid;
struct proc *pp;
pp = proc;
while(pp->isthread == 1){
80104564: 8b 45 e0 mov -0x20(%ebp),%eax
80104567: 8b 80 80 00 00 00 mov 0x80(%eax),%eax
8010456d: 83 f8 01 cmp $0x1,%eax
80104570: 74 e9 je 8010455b <clone+0xae>
pp = pp->parent;
}
np->parent = pp;
80104572: 8b 45 dc mov -0x24(%ebp),%eax
80104575: 8b 55 e0 mov -0x20(%ebp),%edx
80104578: 89 50 14 mov %edx,0x14(%eax)
//need to be modified as point to the same address
//*np->ofile = *proc->ofile;
for(i = 0; i < NOFILE; i++)
8010457b: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp)
80104582: eb 3d jmp 801045c1 <clone+0x114>
if(proc->ofile[i])
80104584: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010458a: 8b 55 d4 mov -0x2c(%ebp),%edx
8010458d: 83 c2 08 add $0x8,%edx
80104590: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
80104594: 85 c0 test %eax,%eax
80104596: 74 25 je 801045bd <clone+0x110>
np->ofile[i] = filedup(proc->ofile[i]);
80104598: 8b 5d d4 mov -0x2c(%ebp),%ebx
8010459b: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801045a1: 8b 55 d4 mov -0x2c(%ebp),%edx
801045a4: 83 c2 08 add $0x8,%edx
801045a7: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
801045ab: 89 04 24 mov %eax,(%esp)
801045ae: e8 d2 c9 ff ff call 80100f85 <filedup>
801045b3: 8b 55 dc mov -0x24(%ebp),%edx
801045b6: 8d 4b 08 lea 0x8(%ebx),%ecx
801045b9: 89 44 8a 08 mov %eax,0x8(%edx,%ecx,4)
pp = pp->parent;
}
np->parent = pp;
//need to be modified as point to the same address
//*np->ofile = *proc->ofile;
for(i = 0; i < NOFILE; i++)
801045bd: 83 45 d4 01 addl $0x1,-0x2c(%ebp)
801045c1: 83 7d d4 0f cmpl $0xf,-0x2c(%ebp)
801045c5: 7e bd jle 80104584 <clone+0xd7>
if(proc->ofile[i])
np->ofile[i] = filedup(proc->ofile[i]);
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
801045c7: 8b 45 dc mov -0x24(%ebp),%eax
801045ca: 8b 40 18 mov 0x18(%eax),%eax
801045cd: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
uint ustack[MAXARG];
uint sp = stack + PGSIZE;
801045d4: 8b 45 08 mov 0x8(%ebp),%eax
801045d7: 05 00 10 00 00 add $0x1000,%eax
801045dc: 89 45 e4 mov %eax,-0x1c(%ebp)
//
//modify here <<<<<
np->tf->ebp = sp;
801045df: 8b 45 dc mov -0x24(%ebp),%eax
801045e2: 8b 40 18 mov 0x18(%eax),%eax
801045e5: 8b 55 e4 mov -0x1c(%ebp),%edx
801045e8: 89 50 08 mov %edx,0x8(%eax)
ustack[0] = 0xffffffff;
801045eb: c7 85 54 ff ff ff ff movl $0xffffffff,-0xac(%ebp)
801045f2: ff ff ff
ustack[1] = arg;
801045f5: 8b 45 14 mov 0x14(%ebp),%eax
801045f8: 89 85 58 ff ff ff mov %eax,-0xa8(%ebp)
sp -= 8;
801045fe: 83 6d e4 08 subl $0x8,-0x1c(%ebp)
if(copyout(np->pgdir,sp,ustack,8)<0){
80104602: 8b 45 dc mov -0x24(%ebp),%eax
80104605: 8b 40 04 mov 0x4(%eax),%eax
80104608: c7 44 24 0c 08 00 00 movl $0x8,0xc(%esp)
8010460f: 00
80104610: 8d 95 54 ff ff ff lea -0xac(%ebp),%edx
80104616: 89 54 24 08 mov %edx,0x8(%esp)
8010461a: 8b 55 e4 mov -0x1c(%ebp),%edx
8010461d: 89 54 24 04 mov %edx,0x4(%esp)
80104621: 89 04 24 mov %eax,(%esp)
80104624: e8 39 3f 00 00 call 80108562 <copyout>
80104629: 85 c0 test %eax,%eax
8010462b: 79 16 jns 80104643 <clone+0x196>
cprintf("push arg fails\n");
8010462d: c7 04 24 03 89 10 80 movl $0x80108903,(%esp)
80104634: e8 61 bd ff ff call 8010039a <cprintf>
return -1;
80104639: b8 ff ff ff ff mov $0xffffffff,%eax
8010463e: e9 82 00 00 00 jmp 801046c5 <clone+0x218>
}
np->tf->eip = routine;
80104643: 8b 45 dc mov -0x24(%ebp),%eax
80104646: 8b 40 18 mov 0x18(%eax),%eax
80104649: 8b 55 10 mov 0x10(%ebp),%edx
8010464c: 89 50 38 mov %edx,0x38(%eax)
np->tf->esp = sp;
8010464f: 8b 45 dc mov -0x24(%ebp),%eax
80104652: 8b 40 18 mov 0x18(%eax),%eax
80104655: 8b 55 e4 mov -0x1c(%ebp),%edx
80104658: 89 50 44 mov %edx,0x44(%eax)
np->cwd = idup(proc->cwd);
8010465b: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104661: 8b 40 68 mov 0x68(%eax),%eax
80104664: 89 04 24 mov %eax,(%esp)
80104667: e8 dd d1 ff ff call 80101849 <idup>
8010466c: 8b 55 dc mov -0x24(%ebp),%edx
8010466f: 89 42 68 mov %eax,0x68(%edx)
switchuvm(np);
80104672: 8b 45 dc mov -0x24(%ebp),%eax
80104675: 89 04 24 mov %eax,(%esp)
80104678: e8 1a 38 00 00 call 80107e97 <switchuvm>
acquire(&ptable.lock);
8010467d: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104684: e8 e2 08 00 00 call 80104f6b <acquire>
np->state = RUNNABLE;
80104689: 8b 45 dc mov -0x24(%ebp),%eax
8010468c: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
release(&ptable.lock);
80104693: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
8010469a: e8 2d 09 00 00 call 80104fcc <release>
safestrcpy(np->name, proc->name, sizeof(proc->name));
8010469f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801046a5: 8d 50 6c lea 0x6c(%eax),%edx
801046a8: 8b 45 dc mov -0x24(%ebp),%eax
801046ab: 83 c0 6c add $0x6c,%eax
801046ae: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
801046b5: 00
801046b6: 89 54 24 04 mov %edx,0x4(%esp)
801046ba: 89 04 24 mov %eax,(%esp)
801046bd: e8 2b 0d 00 00 call 801053ed <safestrcpy>
return pid;
801046c2: 8b 45 d8 mov -0x28(%ebp),%eax
}
801046c5: 81 c4 bc 00 00 00 add $0xbc,%esp
801046cb: 5b pop %ebx
801046cc: 5e pop %esi
801046cd: 5f pop %edi
801046ce: 5d pop %ebp
801046cf: c3 ret
801046d0 <exit>:
// Exit the current process. Does not return.
// An exited process remains in the zombie state
// until its parent calls wait() to find out it exited.
void
exit(void)
{
801046d0: 55 push %ebp
801046d1: 89 e5 mov %esp,%ebp
801046d3: 83 ec 28 sub $0x28,%esp
struct proc *p;
int fd;
if(proc == initproc)
801046d6: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
801046dd: a1 68 b6 10 80 mov 0x8010b668,%eax
801046e2: 39 c2 cmp %eax,%edx
801046e4: 75 0c jne 801046f2 <exit+0x22>
panic("init exiting");
801046e6: c7 04 24 13 89 10 80 movl $0x80108913,(%esp)
801046ed: e8 48 be ff ff call 8010053a <panic>
// Close all open files.
for(fd = 0; fd < NOFILE; fd++){
801046f2: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
801046f9: eb 44 jmp 8010473f <exit+0x6f>
if(proc->ofile[fd]){
801046fb: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104701: 8b 55 f4 mov -0xc(%ebp),%edx
80104704: 83 c2 08 add $0x8,%edx
80104707: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
8010470b: 85 c0 test %eax,%eax
8010470d: 74 2c je 8010473b <exit+0x6b>
fileclose(proc->ofile[fd]);
8010470f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104715: 8b 55 f4 mov -0xc(%ebp),%edx
80104718: 83 c2 08 add $0x8,%edx
8010471b: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
8010471f: 89 04 24 mov %eax,(%esp)
80104722: e8 a6 c8 ff ff call 80100fcd <fileclose>
proc->ofile[fd] = 0;
80104727: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010472d: 8b 55 f4 mov -0xc(%ebp),%edx
80104730: 83 c2 08 add $0x8,%edx
80104733: c7 44 90 08 00 00 00 movl $0x0,0x8(%eax,%edx,4)
8010473a: 00
if(proc == initproc)
panic("init exiting");
// Close all open files.
for(fd = 0; fd < NOFILE; fd++){
8010473b: 83 45 f4 01 addl $0x1,-0xc(%ebp)
8010473f: 83 7d f4 0f cmpl $0xf,-0xc(%ebp)
80104743: 7e b6 jle 801046fb <exit+0x2b>
fileclose(proc->ofile[fd]);
proc->ofile[fd] = 0;
}
}
iput(proc->cwd);
80104745: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010474b: 8b 40 68 mov 0x68(%eax),%eax
8010474e: 89 04 24 mov %eax,(%esp)
80104751: e8 db d2 ff ff call 80101a31 <iput>
proc->cwd = 0;
80104756: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010475c: c7 40 68 00 00 00 00 movl $0x0,0x68(%eax)
acquire(&ptable.lock);
80104763: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
8010476a: e8 fc 07 00 00 call 80104f6b <acquire>
// Parent might be sleeping in wait().
wakeup1(proc->parent);
8010476f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104775: 8b 40 14 mov 0x14(%eax),%eax
80104778: 89 04 24 mov %eax,(%esp)
8010477b: e8 0e 05 00 00 call 80104c8e <wakeup1>
// Pass abandoned children to init.
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104780: c7 45 f0 74 ff 10 80 movl $0x8010ff74,-0x10(%ebp)
80104787: eb 3b jmp 801047c4 <exit+0xf4>
if(p->parent == proc){
80104789: 8b 45 f0 mov -0x10(%ebp),%eax
8010478c: 8b 50 14 mov 0x14(%eax),%edx
8010478f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104795: 39 c2 cmp %eax,%edx
80104797: 75 24 jne 801047bd <exit+0xed>
p->parent = initproc;
80104799: 8b 15 68 b6 10 80 mov 0x8010b668,%edx
8010479f: 8b 45 f0 mov -0x10(%ebp),%eax
801047a2: 89 50 14 mov %edx,0x14(%eax)
if(p->state == ZOMBIE)
801047a5: 8b 45 f0 mov -0x10(%ebp),%eax
801047a8: 8b 40 0c mov 0xc(%eax),%eax
801047ab: 83 f8 05 cmp $0x5,%eax
801047ae: 75 0d jne 801047bd <exit+0xed>
wakeup1(initproc);
801047b0: a1 68 b6 10 80 mov 0x8010b668,%eax
801047b5: 89 04 24 mov %eax,(%esp)
801047b8: e8 d1 04 00 00 call 80104c8e <wakeup1>
// Parent might be sleeping in wait().
wakeup1(proc->parent);
// Pass abandoned children to init.
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801047bd: 81 45 f0 84 00 00 00 addl $0x84,-0x10(%ebp)
801047c4: b8 74 20 11 80 mov $0x80112074,%eax
801047c9: 39 45 f0 cmp %eax,-0x10(%ebp)
801047cc: 72 bb jb 80104789 <exit+0xb9>
wakeup1(initproc);
}
}
// Jump into the scheduler, never to return.
proc->state = ZOMBIE;
801047ce: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801047d4: c7 40 0c 05 00 00 00 movl $0x5,0xc(%eax)
sched();
801047db: e8 98 02 00 00 call 80104a78 <sched>
panic("zombie exit");
801047e0: c7 04 24 20 89 10 80 movl $0x80108920,(%esp)
801047e7: e8 4e bd ff ff call 8010053a <panic>
801047ec <texit>:
}
void
texit(void)
{
801047ec: 55 push %ebp
801047ed: 89 e5 mov %esp,%ebp
801047ef: 83 ec 28 sub $0x28,%esp
// struct proc *p;
int fd;
if(proc == initproc)
801047f2: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
801047f9: a1 68 b6 10 80 mov 0x8010b668,%eax
801047fe: 39 c2 cmp %eax,%edx
80104800: 75 0c jne 8010480e <texit+0x22>
panic("init exiting");
80104802: c7 04 24 13 89 10 80 movl $0x80108913,(%esp)
80104809: e8 2c bd ff ff call 8010053a <panic>
// Close all open files.
for(fd = 0; fd < NOFILE; fd++){
8010480e: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80104815: eb 44 jmp 8010485b <texit+0x6f>
if(proc->ofile[fd]){
80104817: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010481d: 8b 55 f4 mov -0xc(%ebp),%edx
80104820: 83 c2 08 add $0x8,%edx
80104823: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
80104827: 85 c0 test %eax,%eax
80104829: 74 2c je 80104857 <texit+0x6b>
fileclose(proc->ofile[fd]);
8010482b: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104831: 8b 55 f4 mov -0xc(%ebp),%edx
80104834: 83 c2 08 add $0x8,%edx
80104837: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
8010483b: 89 04 24 mov %eax,(%esp)
8010483e: e8 8a c7 ff ff call 80100fcd <fileclose>
proc->ofile[fd] = 0;
80104843: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104849: 8b 55 f4 mov -0xc(%ebp),%edx
8010484c: 83 c2 08 add $0x8,%edx
8010484f: c7 44 90 08 00 00 00 movl $0x0,0x8(%eax,%edx,4)
80104856: 00
if(proc == initproc)
panic("init exiting");
// Close all open files.
for(fd = 0; fd < NOFILE; fd++){
80104857: 83 45 f4 01 addl $0x1,-0xc(%ebp)
8010485b: 83 7d f4 0f cmpl $0xf,-0xc(%ebp)
8010485f: 7e b6 jle 80104817 <texit+0x2b>
if(proc->ofile[fd]){
fileclose(proc->ofile[fd]);
proc->ofile[fd] = 0;
}
}
iput(proc->cwd);
80104861: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104867: 8b 40 68 mov 0x68(%eax),%eax
8010486a: 89 04 24 mov %eax,(%esp)
8010486d: e8 bf d1 ff ff call 80101a31 <iput>
proc->cwd = 0;
80104872: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104878: c7 40 68 00 00 00 00 movl $0x0,0x68(%eax)
acquire(&ptable.lock);
8010487f: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104886: e8 e0 06 00 00 call 80104f6b <acquire>
// Parent might be sleeping in wait().
wakeup1(proc->parent);
8010488b: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104891: 8b 40 14 mov 0x14(%eax),%eax
80104894: 89 04 24 mov %eax,(%esp)
80104897: e8 f2 03 00 00 call 80104c8e <wakeup1>
// if(p->state == ZOMBIE)
// wakeup1(initproc);
// }
// }
// Jump into the scheduler, never to return.
proc->state = ZOMBIE;
8010489c: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801048a2: c7 40 0c 05 00 00 00 movl $0x5,0xc(%eax)
sched();
801048a9: e8 ca 01 00 00 call 80104a78 <sched>
panic("zombie exit");
801048ae: c7 04 24 20 89 10 80 movl $0x80108920,(%esp)
801048b5: e8 80 bc ff ff call 8010053a <panic>
801048ba <wait>:
}
// Wait for a child process to exit and return its pid.
// Return -1 if this process has no children.
int
wait(void)
{
801048ba: 55 push %ebp
801048bb: 89 e5 mov %esp,%ebp
801048bd: 83 ec 28 sub $0x28,%esp
struct proc *p;
int havekids, pid;
acquire(&ptable.lock);
801048c0: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
801048c7: e8 9f 06 00 00 call 80104f6b <acquire>
for(;;){
// Scan through table looking for zombie children.
havekids = 0;
801048cc: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801048d3: c7 45 ec 74 ff 10 80 movl $0x8010ff74,-0x14(%ebp)
801048da: e9 ab 00 00 00 jmp 8010498a <wait+0xd0>
// if(p->parent != proc && p->isthread ==1)
if(p->parent != proc)
801048df: 8b 45 ec mov -0x14(%ebp),%eax
801048e2: 8b 50 14 mov 0x14(%eax),%edx
801048e5: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801048eb: 39 c2 cmp %eax,%edx
801048ed: 0f 85 8f 00 00 00 jne 80104982 <wait+0xc8>
continue;
havekids = 1;
801048f3: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
if(p->state == ZOMBIE){
801048fa: 8b 45 ec mov -0x14(%ebp),%eax
801048fd: 8b 40 0c mov 0xc(%eax),%eax
80104900: 83 f8 05 cmp $0x5,%eax
80104903: 75 7e jne 80104983 <wait+0xc9>
// Found one.
pid = p->pid;
80104905: 8b 45 ec mov -0x14(%ebp),%eax
80104908: 8b 40 10 mov 0x10(%eax),%eax
8010490b: 89 45 f4 mov %eax,-0xc(%ebp)
kfree(p->kstack);
8010490e: 8b 45 ec mov -0x14(%ebp),%eax
80104911: 8b 40 08 mov 0x8(%eax),%eax
80104914: 89 04 24 mov %eax,(%esp)
80104917: e8 55 e1 ff ff call 80102a71 <kfree>
p->kstack = 0;
8010491c: 8b 45 ec mov -0x14(%ebp),%eax
8010491f: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
if(p->isthread != 1){
80104926: 8b 45 ec mov -0x14(%ebp),%eax
80104929: 8b 80 80 00 00 00 mov 0x80(%eax),%eax
8010492f: 83 f8 01 cmp $0x1,%eax
80104932: 74 0e je 80104942 <wait+0x88>
freevm(p->pgdir);
80104934: 8b 45 ec mov -0x14(%ebp),%eax
80104937: 8b 40 04 mov 0x4(%eax),%eax
8010493a: 89 04 24 mov %eax,(%esp)
8010493d: e8 cd 39 00 00 call 8010830f <freevm>
}
p->state = UNUSED;
80104942: 8b 45 ec mov -0x14(%ebp),%eax
80104945: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
p->pid = 0;
8010494c: 8b 45 ec mov -0x14(%ebp),%eax
8010494f: c7 40 10 00 00 00 00 movl $0x0,0x10(%eax)
p->parent = 0;
80104956: 8b 45 ec mov -0x14(%ebp),%eax
80104959: c7 40 14 00 00 00 00 movl $0x0,0x14(%eax)
p->name[0] = 0;
80104960: 8b 45 ec mov -0x14(%ebp),%eax
80104963: c6 40 6c 00 movb $0x0,0x6c(%eax)
p->killed = 0;
80104967: 8b 45 ec mov -0x14(%ebp),%eax
8010496a: c7 40 24 00 00 00 00 movl $0x0,0x24(%eax)
release(&ptable.lock);
80104971: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104978: e8 4f 06 00 00 call 80104fcc <release>
return pid;
8010497d: 8b 45 f4 mov -0xc(%ebp),%eax
80104980: eb 57 jmp 801049d9 <wait+0x11f>
// Scan through table looking for zombie children.
havekids = 0;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
// if(p->parent != proc && p->isthread ==1)
if(p->parent != proc)
continue;
80104982: 90 nop
acquire(&ptable.lock);
for(;;){
// Scan through table looking for zombie children.
havekids = 0;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104983: 81 45 ec 84 00 00 00 addl $0x84,-0x14(%ebp)
8010498a: b8 74 20 11 80 mov $0x80112074,%eax
8010498f: 39 45 ec cmp %eax,-0x14(%ebp)
80104992: 0f 82 47 ff ff ff jb 801048df <wait+0x25>
return pid;
}
}
// No point waiting if we don't have any children.
if(!havekids || proc->killed){
80104998: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
8010499c: 74 0d je 801049ab <wait+0xf1>
8010499e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801049a4: 8b 40 24 mov 0x24(%eax),%eax
801049a7: 85 c0 test %eax,%eax
801049a9: 74 13 je 801049be <wait+0x104>
release(&ptable.lock);
801049ab: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
801049b2: e8 15 06 00 00 call 80104fcc <release>
return -1;
801049b7: b8 ff ff ff ff mov $0xffffffff,%eax
801049bc: eb 1b jmp 801049d9 <wait+0x11f>
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(proc, &ptable.lock); //DOC: wait-sleep
801049be: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801049c4: c7 44 24 04 40 ff 10 movl $0x8010ff40,0x4(%esp)
801049cb: 80
801049cc: 89 04 24 mov %eax,(%esp)
801049cf: e8 1f 02 00 00 call 80104bf3 <sleep>
}
801049d4: e9 f3 fe ff ff jmp 801048cc <wait+0x12>
}
801049d9: c9 leave
801049da: c3 ret
801049db <scheduler>:
// - swtch to start running that process
// - eventually that process transfers control
// via swtch back to the scheduler.
void
scheduler(void)
{
801049db: 55 push %ebp
801049dc: 89 e5 mov %esp,%ebp
801049de: 83 ec 28 sub $0x28,%esp
struct proc *p;
for(;;){
// Enable interrupts on this processor.
sti();
801049e1: e8 e6 f5 ff ff call 80103fcc <sti>
// Loop over process table looking for process to run.
acquire(&ptable.lock);
801049e6: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
801049ed: e8 79 05 00 00 call 80104f6b <acquire>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801049f2: c7 45 f4 74 ff 10 80 movl $0x8010ff74,-0xc(%ebp)
801049f9: eb 62 jmp 80104a5d <scheduler+0x82>
if(p->state != RUNNABLE)
801049fb: 8b 45 f4 mov -0xc(%ebp),%eax
801049fe: 8b 40 0c mov 0xc(%eax),%eax
80104a01: 83 f8 03 cmp $0x3,%eax
80104a04: 75 4f jne 80104a55 <scheduler+0x7a>
continue;
// Switch to chosen process. It is the process's job
// to release ptable.lock and then reacquire it
// before jumping back to us.
proc = p;
80104a06: 8b 45 f4 mov -0xc(%ebp),%eax
80104a09: 65 a3 04 00 00 00 mov %eax,%gs:0x4
switchuvm(p);
80104a0f: 8b 45 f4 mov -0xc(%ebp),%eax
80104a12: 89 04 24 mov %eax,(%esp)
80104a15: e8 7d 34 00 00 call 80107e97 <switchuvm>
p->state = RUNNING;
80104a1a: 8b 45 f4 mov -0xc(%ebp),%eax
80104a1d: c7 40 0c 04 00 00 00 movl $0x4,0xc(%eax)
swtch(&cpu->scheduler, proc->context);
80104a24: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104a2a: 8b 40 1c mov 0x1c(%eax),%eax
80104a2d: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
80104a34: 83 c2 04 add $0x4,%edx
80104a37: 89 44 24 04 mov %eax,0x4(%esp)
80104a3b: 89 14 24 mov %edx,(%esp)
80104a3e: e8 1d 0a 00 00 call 80105460 <swtch>
switchkvm();
80104a43: e8 32 34 00 00 call 80107e7a <switchkvm>
// Process is done running for now.
// It should have changed its p->state before coming back.
proc = 0;
80104a48: 65 c7 05 04 00 00 00 movl $0x0,%gs:0x4
80104a4f: 00 00 00 00
80104a53: eb 01 jmp 80104a56 <scheduler+0x7b>
// Loop over process table looking for process to run.
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->state != RUNNABLE)
continue;
80104a55: 90 nop
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104a56: 81 45 f4 84 00 00 00 addl $0x84,-0xc(%ebp)
80104a5d: b8 74 20 11 80 mov $0x80112074,%eax
80104a62: 39 45 f4 cmp %eax,-0xc(%ebp)
80104a65: 72 94 jb 801049fb <scheduler+0x20>
// Process is done running for now.
// It should have changed its p->state before coming back.
proc = 0;
}
release(&ptable.lock);
80104a67: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104a6e: e8 59 05 00 00 call 80104fcc <release>
}
80104a73: e9 69 ff ff ff jmp 801049e1 <scheduler+0x6>
80104a78 <sched>:
// Enter scheduler. Must hold only ptable.lock
// and have changed proc->state.
void
sched(void)
{
80104a78: 55 push %ebp
80104a79: 89 e5 mov %esp,%ebp
80104a7b: 83 ec 28 sub $0x28,%esp
int intena;
if(!holding(&ptable.lock))
80104a7e: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104a85: e8 00 06 00 00 call 8010508a <holding>
80104a8a: 85 c0 test %eax,%eax
80104a8c: 75 0c jne 80104a9a <sched+0x22>
panic("sched ptable.lock");
80104a8e: c7 04 24 2c 89 10 80 movl $0x8010892c,(%esp)
80104a95: e8 a0 ba ff ff call 8010053a <panic>
if(cpu->ncli != 1){
80104a9a: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80104aa0: 8b 80 ac 00 00 00 mov 0xac(%eax),%eax
80104aa6: 83 f8 01 cmp $0x1,%eax
80104aa9: 74 35 je 80104ae0 <sched+0x68>
cprintf("current proc %d\n cpu->ncli %d\n",proc->pid,cpu->ncli);
80104aab: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80104ab1: 8b 90 ac 00 00 00 mov 0xac(%eax),%edx
80104ab7: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104abd: 8b 40 10 mov 0x10(%eax),%eax
80104ac0: 89 54 24 08 mov %edx,0x8(%esp)
80104ac4: 89 44 24 04 mov %eax,0x4(%esp)
80104ac8: c7 04 24 40 89 10 80 movl $0x80108940,(%esp)
80104acf: e8 c6 b8 ff ff call 8010039a <cprintf>
panic("sched locks");
80104ad4: c7 04 24 5f 89 10 80 movl $0x8010895f,(%esp)
80104adb: e8 5a ba ff ff call 8010053a <panic>
}
if(proc->state == RUNNING)
80104ae0: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104ae6: 8b 40 0c mov 0xc(%eax),%eax
80104ae9: 83 f8 04 cmp $0x4,%eax
80104aec: 75 0c jne 80104afa <sched+0x82>
panic("sched running");
80104aee: c7 04 24 6b 89 10 80 movl $0x8010896b,(%esp)
80104af5: e8 40 ba ff ff call 8010053a <panic>
if(readeflags()&FL_IF)
80104afa: e8 bd f4 ff ff call 80103fbc <readeflags>
80104aff: 25 00 02 00 00 and $0x200,%eax
80104b04: 85 c0 test %eax,%eax
80104b06: 74 0c je 80104b14 <sched+0x9c>
panic("sched interruptible");
80104b08: c7 04 24 79 89 10 80 movl $0x80108979,(%esp)
80104b0f: e8 26 ba ff ff call 8010053a <panic>
intena = cpu->intena;
80104b14: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80104b1a: 8b 80 b0 00 00 00 mov 0xb0(%eax),%eax
80104b20: 89 45 f4 mov %eax,-0xc(%ebp)
swtch(&proc->context, cpu->scheduler);
80104b23: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80104b29: 8b 40 04 mov 0x4(%eax),%eax
80104b2c: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
80104b33: 83 c2 1c add $0x1c,%edx
80104b36: 89 44 24 04 mov %eax,0x4(%esp)
80104b3a: 89 14 24 mov %edx,(%esp)
80104b3d: e8 1e 09 00 00 call 80105460 <swtch>
cpu->intena = intena;
80104b42: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80104b48: 8b 55 f4 mov -0xc(%ebp),%edx
80104b4b: 89 90 b0 00 00 00 mov %edx,0xb0(%eax)
}
80104b51: c9 leave
80104b52: c3 ret
80104b53 <yield>:
// Give up the CPU for one scheduling round.
void
yield(void)
{
80104b53: 55 push %ebp
80104b54: 89 e5 mov %esp,%ebp
80104b56: 83 ec 18 sub $0x18,%esp
acquire(&ptable.lock); //DOC: yieldlock
80104b59: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104b60: e8 06 04 00 00 call 80104f6b <acquire>
proc->state = RUNNABLE;
80104b65: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104b6b: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
sched();
80104b72: e8 01 ff ff ff call 80104a78 <sched>
release(&ptable.lock);
80104b77: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104b7e: e8 49 04 00 00 call 80104fcc <release>
}
80104b83: c9 leave
80104b84: c3 ret
80104b85 <thread_yield>:
//lab 2
void thread_yield(void) {
80104b85: 55 push %ebp
80104b86: 89 e5 mov %esp,%ebp
80104b88: 83 ec 18 sub $0x18,%esp
//cprintf("----------------------------THREAD YIELDING\n");
acquire(&ptable.lock); //DOC: yieldlock
80104b8b: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104b92: e8 d4 03 00 00 call 80104f6b <acquire>
if (proc->isthread)
80104b97: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104b9d: 8b 80 80 00 00 00 mov 0x80(%eax),%eax
80104ba3: 85 c0 test %eax,%eax
80104ba5: 74 12 je 80104bb9 <thread_yield+0x34>
{
proc->state = RUNNABLE;
80104ba7: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104bad: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
sched();
80104bb4: e8 bf fe ff ff call 80104a78 <sched>
}
release(&ptable.lock);
80104bb9: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104bc0: e8 07 04 00 00 call 80104fcc <release>
}
80104bc5: c9 leave
80104bc6: c3 ret
80104bc7 <forkret>:
// A fork child's very first scheduling by scheduler()
// will swtch here. "Return" to user space.
void
forkret(void)
{
80104bc7: 55 push %ebp
80104bc8: 89 e5 mov %esp,%ebp
80104bca: 83 ec 18 sub $0x18,%esp
static int first = 1;
// Still holding ptable.lock from scheduler.
release(&ptable.lock);
80104bcd: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104bd4: e8 f3 03 00 00 call 80104fcc <release>
if (first) {
80104bd9: a1 20 b0 10 80 mov 0x8010b020,%eax
80104bde: 85 c0 test %eax,%eax
80104be0: 74 0f je 80104bf1 <forkret+0x2a>
// Some initialization functions must be run in the context
// of a regular process (e.g., they call sleep), and thus cannot
// be run from main().
first = 0;
80104be2: c7 05 20 b0 10 80 00 movl $0x0,0x8010b020
80104be9: 00 00 00
initlog();
80104bec: e8 13 e4 ff ff call 80103004 <initlog>
}
// Return to "caller", actually trapret (see allocproc).
}
80104bf1: c9 leave
80104bf2: c3 ret
80104bf3 <sleep>:
// Atomically release lock and sleep on chan.
// Reacquires lock when awakened.
void
sleep(void *chan, struct spinlock *lk)
{
80104bf3: 55 push %ebp
80104bf4: 89 e5 mov %esp,%ebp
80104bf6: 83 ec 18 sub $0x18,%esp
if(proc == 0)
80104bf9: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104bff: 85 c0 test %eax,%eax
80104c01: 75 0c jne 80104c0f <sleep+0x1c>
panic("sleep");
80104c03: c7 04 24 8d 89 10 80 movl $0x8010898d,(%esp)
80104c0a: e8 2b b9 ff ff call 8010053a <panic>
if(lk == 0)
80104c0f: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
80104c13: 75 0c jne 80104c21 <sleep+0x2e>
panic("sleep without lk");
80104c15: c7 04 24 93 89 10 80 movl $0x80108993,(%esp)
80104c1c: e8 19 b9 ff ff call 8010053a <panic>
// change p->state and then call sched.
// Once we hold ptable.lock, we can be
// guaranteed that we won't miss any wakeup
// (wakeup runs with ptable.lock locked),
// so it's okay to release lk.
if(lk != &ptable.lock){ //DOC: sleeplock0
80104c21: 81 7d 0c 40 ff 10 80 cmpl $0x8010ff40,0xc(%ebp)
80104c28: 74 17 je 80104c41 <sleep+0x4e>
acquire(&ptable.lock); //DOC: sleeplock1
80104c2a: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104c31: e8 35 03 00 00 call 80104f6b <acquire>
release(lk);
80104c36: 8b 45 0c mov 0xc(%ebp),%eax
80104c39: 89 04 24 mov %eax,(%esp)
80104c3c: e8 8b 03 00 00 call 80104fcc <release>
}
// Go to sleep.
proc->chan = chan;
80104c41: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104c47: 8b 55 08 mov 0x8(%ebp),%edx
80104c4a: 89 50 20 mov %edx,0x20(%eax)
proc->state = SLEEPING;
80104c4d: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104c53: c7 40 0c 02 00 00 00 movl $0x2,0xc(%eax)
sched();
80104c5a: e8 19 fe ff ff call 80104a78 <sched>
// Tidy up.
proc->chan = 0;
80104c5f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104c65: c7 40 20 00 00 00 00 movl $0x0,0x20(%eax)
// Reacquire original lock.
if(lk != &ptable.lock){ //DOC: sleeplock2
80104c6c: 81 7d 0c 40 ff 10 80 cmpl $0x8010ff40,0xc(%ebp)
80104c73: 74 17 je 80104c8c <sleep+0x99>
release(&ptable.lock);
80104c75: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104c7c: e8 4b 03 00 00 call 80104fcc <release>
acquire(lk);
80104c81: 8b 45 0c mov 0xc(%ebp),%eax
80104c84: 89 04 24 mov %eax,(%esp)
80104c87: e8 df 02 00 00 call 80104f6b <acquire>
}
}
80104c8c: c9 leave
80104c8d: c3 ret
80104c8e <wakeup1>:
//PAGEBREAK!
// Wake up all processes sleeping on chan.
// The ptable lock must be held.
static void
wakeup1(void *chan)
{
80104c8e: 55 push %ebp
80104c8f: 89 e5 mov %esp,%ebp
80104c91: 83 ec 10 sub $0x10,%esp
struct proc *p;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80104c94: c7 45 fc 74 ff 10 80 movl $0x8010ff74,-0x4(%ebp)
80104c9b: eb 27 jmp 80104cc4 <wakeup1+0x36>
if(p->state == SLEEPING && p->chan == chan)
80104c9d: 8b 45 fc mov -0x4(%ebp),%eax
80104ca0: 8b 40 0c mov 0xc(%eax),%eax
80104ca3: 83 f8 02 cmp $0x2,%eax
80104ca6: 75 15 jne 80104cbd <wakeup1+0x2f>
80104ca8: 8b 45 fc mov -0x4(%ebp),%eax
80104cab: 8b 40 20 mov 0x20(%eax),%eax
80104cae: 3b 45 08 cmp 0x8(%ebp),%eax
80104cb1: 75 0a jne 80104cbd <wakeup1+0x2f>
p->state = RUNNABLE;
80104cb3: 8b 45 fc mov -0x4(%ebp),%eax
80104cb6: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
static void
wakeup1(void *chan)
{
struct proc *p;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80104cbd: 81 45 fc 84 00 00 00 addl $0x84,-0x4(%ebp)
80104cc4: b8 74 20 11 80 mov $0x80112074,%eax
80104cc9: 39 45 fc cmp %eax,-0x4(%ebp)
80104ccc: 72 cf jb 80104c9d <wakeup1+0xf>
if(p->state == SLEEPING && p->chan == chan)
p->state = RUNNABLE;
}
80104cce: c9 leave
80104ccf: c3 ret
80104cd0 <twakeup>:
void
twakeup(int tid){
80104cd0: 55 push %ebp
80104cd1: 89 e5 mov %esp,%ebp
80104cd3: 83 ec 28 sub $0x28,%esp
struct proc *p;
acquire(&ptable.lock);
80104cd6: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104cdd: e8 89 02 00 00 call 80104f6b <acquire>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104ce2: c7 45 f4 74 ff 10 80 movl $0x8010ff74,-0xc(%ebp)
80104ce9: eb 36 jmp 80104d21 <twakeup+0x51>
if(p->state == SLEEPING && p->pid == tid && p->isthread == 1){
80104ceb: 8b 45 f4 mov -0xc(%ebp),%eax
80104cee: 8b 40 0c mov 0xc(%eax),%eax
80104cf1: 83 f8 02 cmp $0x2,%eax
80104cf4: 75 24 jne 80104d1a <twakeup+0x4a>
80104cf6: 8b 45 f4 mov -0xc(%ebp),%eax
80104cf9: 8b 40 10 mov 0x10(%eax),%eax
80104cfc: 3b 45 08 cmp 0x8(%ebp),%eax
80104cff: 75 19 jne 80104d1a <twakeup+0x4a>
80104d01: 8b 45 f4 mov -0xc(%ebp),%eax
80104d04: 8b 80 80 00 00 00 mov 0x80(%eax),%eax
80104d0a: 83 f8 01 cmp $0x1,%eax
80104d0d: 75 0b jne 80104d1a <twakeup+0x4a>
wakeup1(p);
80104d0f: 8b 45 f4 mov -0xc(%ebp),%eax
80104d12: 89 04 24 mov %eax,(%esp)
80104d15: e8 74 ff ff ff call 80104c8e <wakeup1>
void
twakeup(int tid){
struct proc *p;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104d1a: 81 45 f4 84 00 00 00 addl $0x84,-0xc(%ebp)
80104d21: b8 74 20 11 80 mov $0x80112074,%eax
80104d26: 39 45 f4 cmp %eax,-0xc(%ebp)
80104d29: 72 c0 jb 80104ceb <twakeup+0x1b>
if(p->state == SLEEPING && p->pid == tid && p->isthread == 1){
wakeup1(p);
}
}
release(&ptable.lock);
80104d2b: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104d32: e8 95 02 00 00 call 80104fcc <release>
}
80104d37: c9 leave
80104d38: c3 ret
80104d39 <wakeup>:
// Wake up all processes sleeping on chan.
void
wakeup(void *chan)
{
80104d39: 55 push %ebp
80104d3a: 89 e5 mov %esp,%ebp
80104d3c: 83 ec 18 sub $0x18,%esp
acquire(&ptable.lock);
80104d3f: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104d46: e8 20 02 00 00 call 80104f6b <acquire>
wakeup1(chan);
80104d4b: 8b 45 08 mov 0x8(%ebp),%eax
80104d4e: 89 04 24 mov %eax,(%esp)
80104d51: e8 38 ff ff ff call 80104c8e <wakeup1>
release(&ptable.lock);
80104d56: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104d5d: e8 6a 02 00 00 call 80104fcc <release>
}
80104d62: c9 leave
80104d63: c3 ret
80104d64 <kill>:
// Kill the process with the given pid.
// Process won't exit until it returns
// to user space (see trap in trap.c).
int
kill(int pid)
{
80104d64: 55 push %ebp
80104d65: 89 e5 mov %esp,%ebp
80104d67: 83 ec 28 sub $0x28,%esp
struct proc *p;
acquire(&ptable.lock);
80104d6a: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104d71: e8 f5 01 00 00 call 80104f6b <acquire>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104d76: c7 45 f4 74 ff 10 80 movl $0x8010ff74,-0xc(%ebp)
80104d7d: eb 44 jmp 80104dc3 <kill+0x5f>
if(p->pid == pid){
80104d7f: 8b 45 f4 mov -0xc(%ebp),%eax
80104d82: 8b 40 10 mov 0x10(%eax),%eax
80104d85: 3b 45 08 cmp 0x8(%ebp),%eax
80104d88: 75 32 jne 80104dbc <kill+0x58>
p->killed = 1;
80104d8a: 8b 45 f4 mov -0xc(%ebp),%eax
80104d8d: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax)
// Wake process from sleep if necessary.
if(p->state == SLEEPING)
80104d94: 8b 45 f4 mov -0xc(%ebp),%eax
80104d97: 8b 40 0c mov 0xc(%eax),%eax
80104d9a: 83 f8 02 cmp $0x2,%eax
80104d9d: 75 0a jne 80104da9 <kill+0x45>
p->state = RUNNABLE;
80104d9f: 8b 45 f4 mov -0xc(%ebp),%eax
80104da2: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
release(&ptable.lock);
80104da9: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104db0: e8 17 02 00 00 call 80104fcc <release>
return 0;
80104db5: b8 00 00 00 00 mov $0x0,%eax
80104dba: eb 22 jmp 80104dde <kill+0x7a>
kill(int pid)
{
struct proc *p;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104dbc: 81 45 f4 84 00 00 00 addl $0x84,-0xc(%ebp)
80104dc3: b8 74 20 11 80 mov $0x80112074,%eax
80104dc8: 39 45 f4 cmp %eax,-0xc(%ebp)
80104dcb: 72 b2 jb 80104d7f <kill+0x1b>
p->state = RUNNABLE;
release(&ptable.lock);
return 0;
}
}
release(&ptable.lock);
80104dcd: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104dd4: e8 f3 01 00 00 call 80104fcc <release>
return -1;
80104dd9: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104dde: c9 leave
80104ddf: c3 ret
80104de0 <procdump>:
// Print a process listing to console. For debugging.
// Runs when user types ^P on console.
// No lock to avoid wedging a stuck machine further.
void
procdump(void)
{
80104de0: 55 push %ebp
80104de1: 89 e5 mov %esp,%ebp
80104de3: 83 ec 58 sub $0x58,%esp
int i;
struct proc *p;
char *state;
uint pc[10];
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104de6: c7 45 f0 74 ff 10 80 movl $0x8010ff74,-0x10(%ebp)
80104ded: e9 db 00 00 00 jmp 80104ecd <procdump+0xed>
if(p->state == UNUSED)
80104df2: 8b 45 f0 mov -0x10(%ebp),%eax
80104df5: 8b 40 0c mov 0xc(%eax),%eax
80104df8: 85 c0 test %eax,%eax
80104dfa: 0f 84 c5 00 00 00 je 80104ec5 <procdump+0xe5>
continue;
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
80104e00: 8b 45 f0 mov -0x10(%ebp),%eax
80104e03: 8b 40 0c mov 0xc(%eax),%eax
80104e06: 83 f8 05 cmp $0x5,%eax
80104e09: 77 23 ja 80104e2e <procdump+0x4e>
80104e0b: 8b 45 f0 mov -0x10(%ebp),%eax
80104e0e: 8b 40 0c mov 0xc(%eax),%eax
80104e11: 8b 04 85 08 b0 10 80 mov -0x7fef4ff8(,%eax,4),%eax
80104e18: 85 c0 test %eax,%eax
80104e1a: 74 12 je 80104e2e <procdump+0x4e>
state = states[p->state];
80104e1c: 8b 45 f0 mov -0x10(%ebp),%eax
80104e1f: 8b 40 0c mov 0xc(%eax),%eax
80104e22: 8b 04 85 08 b0 10 80 mov -0x7fef4ff8(,%eax,4),%eax
80104e29: 89 45 f4 mov %eax,-0xc(%ebp)
uint pc[10];
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->state == UNUSED)
continue;
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
80104e2c: eb 07 jmp 80104e35 <procdump+0x55>
state = states[p->state];
else
state = "???";
80104e2e: c7 45 f4 a4 89 10 80 movl $0x801089a4,-0xc(%ebp)
cprintf("%d %s %s", p->pid, state, p->name);
80104e35: 8b 45 f0 mov -0x10(%ebp),%eax
80104e38: 8d 50 6c lea 0x6c(%eax),%edx
80104e3b: 8b 45 f0 mov -0x10(%ebp),%eax
80104e3e: 8b 40 10 mov 0x10(%eax),%eax
80104e41: 89 54 24 0c mov %edx,0xc(%esp)
80104e45: 8b 55 f4 mov -0xc(%ebp),%edx
80104e48: 89 54 24 08 mov %edx,0x8(%esp)
80104e4c: 89 44 24 04 mov %eax,0x4(%esp)
80104e50: c7 04 24 a8 89 10 80 movl $0x801089a8,(%esp)
80104e57: e8 3e b5 ff ff call 8010039a <cprintf>
if(p->state == SLEEPING){
80104e5c: 8b 45 f0 mov -0x10(%ebp),%eax
80104e5f: 8b 40 0c mov 0xc(%eax),%eax
80104e62: 83 f8 02 cmp $0x2,%eax
80104e65: 75 50 jne 80104eb7 <procdump+0xd7>
getcallerpcs((uint*)p->context->ebp+2, pc);
80104e67: 8b 45 f0 mov -0x10(%ebp),%eax
80104e6a: 8b 40 1c mov 0x1c(%eax),%eax
80104e6d: 8b 40 0c mov 0xc(%eax),%eax
80104e70: 83 c0 08 add $0x8,%eax
80104e73: 8d 55 c4 lea -0x3c(%ebp),%edx
80104e76: 89 54 24 04 mov %edx,0x4(%esp)
80104e7a: 89 04 24 mov %eax,(%esp)
80104e7d: e8 99 01 00 00 call 8010501b <getcallerpcs>
for(i=0; i<10 && pc[i] != 0; i++)
80104e82: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80104e89: eb 1b jmp 80104ea6 <procdump+0xc6>
cprintf(" %p", pc[i]);
80104e8b: 8b 45 ec mov -0x14(%ebp),%eax
80104e8e: 8b 44 85 c4 mov -0x3c(%ebp,%eax,4),%eax
80104e92: 89 44 24 04 mov %eax,0x4(%esp)
80104e96: c7 04 24 b1 89 10 80 movl $0x801089b1,(%esp)
80104e9d: e8 f8 b4 ff ff call 8010039a <cprintf>
else
state = "???";
cprintf("%d %s %s", p->pid, state, p->name);
if(p->state == SLEEPING){
getcallerpcs((uint*)p->context->ebp+2, pc);
for(i=0; i<10 && pc[i] != 0; i++)
80104ea2: 83 45 ec 01 addl $0x1,-0x14(%ebp)
80104ea6: 83 7d ec 09 cmpl $0x9,-0x14(%ebp)
80104eaa: 7f 0b jg 80104eb7 <procdump+0xd7>
80104eac: 8b 45 ec mov -0x14(%ebp),%eax
80104eaf: 8b 44 85 c4 mov -0x3c(%ebp,%eax,4),%eax
80104eb3: 85 c0 test %eax,%eax
80104eb5: 75 d4 jne 80104e8b <procdump+0xab>
cprintf(" %p", pc[i]);
}
cprintf("\n");
80104eb7: c7 04 24 b5 89 10 80 movl $0x801089b5,(%esp)
80104ebe: e8 d7 b4 ff ff call 8010039a <cprintf>
80104ec3: eb 01 jmp 80104ec6 <procdump+0xe6>
char *state;
uint pc[10];
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->state == UNUSED)
continue;
80104ec5: 90 nop
int i;
struct proc *p;
char *state;
uint pc[10];
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104ec6: 81 45 f0 84 00 00 00 addl $0x84,-0x10(%ebp)
80104ecd: b8 74 20 11 80 mov $0x80112074,%eax
80104ed2: 39 45 f0 cmp %eax,-0x10(%ebp)
80104ed5: 0f 82 17 ff ff ff jb 80104df2 <procdump+0x12>
for(i=0; i<10 && pc[i] != 0; i++)
cprintf(" %p", pc[i]);
}
cprintf("\n");
}
}
80104edb: c9 leave
80104edc: c3 ret
80104edd <tsleep>:
void tsleep(void){
80104edd: 55 push %ebp
80104ede: 89 e5 mov %esp,%ebp
80104ee0: 83 ec 18 sub $0x18,%esp
acquire(&ptable.lock);
80104ee3: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104eea: e8 7c 00 00 00 call 80104f6b <acquire>
sleep(proc, &ptable.lock);
80104eef: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104ef5: c7 44 24 04 40 ff 10 movl $0x8010ff40,0x4(%esp)
80104efc: 80
80104efd: 89 04 24 mov %eax,(%esp)
80104f00: e8 ee fc ff ff call 80104bf3 <sleep>
release(&ptable.lock);
80104f05: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104f0c: e8 bb 00 00 00 call 80104fcc <release>
}
80104f11: c9 leave
80104f12: c3 ret
...
80104f14 <readeflags>:
asm volatile("ltr %0" : : "r" (sel));
}
static inline uint
readeflags(void)
{
80104f14: 55 push %ebp
80104f15: 89 e5 mov %esp,%ebp
80104f17: 83 ec 10 sub $0x10,%esp
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80104f1a: 9c pushf
80104f1b: 58 pop %eax
80104f1c: 89 45 fc mov %eax,-0x4(%ebp)
return eflags;
80104f1f: 8b 45 fc mov -0x4(%ebp),%eax
}
80104f22: c9 leave
80104f23: c3 ret
80104f24 <cli>:
asm volatile("movw %0, %%gs" : : "r" (v));
}
static inline void
cli(void)
{
80104f24: 55 push %ebp
80104f25: 89 e5 mov %esp,%ebp
asm volatile("cli");
80104f27: fa cli
}
80104f28: 5d pop %ebp
80104f29: c3 ret
80104f2a <sti>:
static inline void
sti(void)
{
80104f2a: 55 push %ebp
80104f2b: 89 e5 mov %esp,%ebp
asm volatile("sti");
80104f2d: fb sti
}
80104f2e: 5d pop %ebp
80104f2f: c3 ret
80104f30 <xchg>:
static inline uint
xchg(volatile uint *addr, uint newval)
{
80104f30: 55 push %ebp
80104f31: 89 e5 mov %esp,%ebp
80104f33: 83 ec 10 sub $0x10,%esp
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
80104f36: 8b 55 08 mov 0x8(%ebp),%edx
80104f39: 8b 45 0c mov 0xc(%ebp),%eax
80104f3c: 8b 4d 08 mov 0x8(%ebp),%ecx
80104f3f: f0 87 02 lock xchg %eax,(%edx)
80104f42: 89 45 fc mov %eax,-0x4(%ebp)
"+m" (*addr), "=a" (result) :
"1" (newval) :
"cc");
return result;
80104f45: 8b 45 fc mov -0x4(%ebp),%eax
}
80104f48: c9 leave
80104f49: c3 ret
80104f4a <initlock>:
#include "proc.h"
#include "spinlock.h"
void
initlock(struct spinlock *lk, char *name)
{
80104f4a: 55 push %ebp
80104f4b: 89 e5 mov %esp,%ebp
lk->name = name;
80104f4d: 8b 45 08 mov 0x8(%ebp),%eax
80104f50: 8b 55 0c mov 0xc(%ebp),%edx
80104f53: 89 50 04 mov %edx,0x4(%eax)
lk->locked = 0;
80104f56: 8b 45 08 mov 0x8(%ebp),%eax
80104f59: c7 00 00 00 00 00 movl $0x0,(%eax)
lk->cpu = 0;
80104f5f: 8b 45 08 mov 0x8(%ebp),%eax
80104f62: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
80104f69: 5d pop %ebp
80104f6a: c3 ret
80104f6b <acquire>:
// Loops (spins) until the lock is acquired.
// Holding a lock for a long time may cause
// other CPUs to waste time spinning to acquire it.
void
acquire(struct spinlock *lk)
{
80104f6b: 55 push %ebp
80104f6c: 89 e5 mov %esp,%ebp
80104f6e: 83 ec 18 sub $0x18,%esp
pushcli(); // disable interrupts to avoid deadlock.
80104f71: e8 3e 01 00 00 call 801050b4 <pushcli>
if(holding(lk))
80104f76: 8b 45 08 mov 0x8(%ebp),%eax
80104f79: 89 04 24 mov %eax,(%esp)
80104f7c: e8 09 01 00 00 call 8010508a <holding>
80104f81: 85 c0 test %eax,%eax
80104f83: 74 0c je 80104f91 <acquire+0x26>
panic("acquire");
80104f85: c7 04 24 e1 89 10 80 movl $0x801089e1,(%esp)
80104f8c: e8 a9 b5 ff ff call 8010053a <panic>
// The xchg is atomic.
// It also serializes, so that reads after acquire are not
// reordered before it.
while(xchg(&lk->locked, 1) != 0)
80104f91: 8b 45 08 mov 0x8(%ebp),%eax
80104f94: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80104f9b: 00
80104f9c: 89 04 24 mov %eax,(%esp)
80104f9f: e8 8c ff ff ff call 80104f30 <xchg>
80104fa4: 85 c0 test %eax,%eax
80104fa6: 75 e9 jne 80104f91 <acquire+0x26>
;
// Record info about lock acquisition for debugging.
lk->cpu = cpu;
80104fa8: 8b 45 08 mov 0x8(%ebp),%eax
80104fab: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
80104fb2: 89 50 08 mov %edx,0x8(%eax)
getcallerpcs(&lk, lk->pcs);
80104fb5: 8b 45 08 mov 0x8(%ebp),%eax
80104fb8: 83 c0 0c add $0xc,%eax
80104fbb: 89 44 24 04 mov %eax,0x4(%esp)
80104fbf: 8d 45 08 lea 0x8(%ebp),%eax
80104fc2: 89 04 24 mov %eax,(%esp)
80104fc5: e8 51 00 00 00 call 8010501b <getcallerpcs>
}
80104fca: c9 leave
80104fcb: c3 ret
80104fcc <release>:
// Release the lock.
void
release(struct spinlock *lk)
{
80104fcc: 55 push %ebp
80104fcd: 89 e5 mov %esp,%ebp
80104fcf: 83 ec 18 sub $0x18,%esp
if(!holding(lk))
80104fd2: 8b 45 08 mov 0x8(%ebp),%eax
80104fd5: 89 04 24 mov %eax,(%esp)
80104fd8: e8 ad 00 00 00 call 8010508a <holding>
80104fdd: 85 c0 test %eax,%eax
80104fdf: 75 0c jne 80104fed <release+0x21>
panic("release");
80104fe1: c7 04 24 e9 89 10 80 movl $0x801089e9,(%esp)
80104fe8: e8 4d b5 ff ff call 8010053a <panic>
lk->pcs[0] = 0;
80104fed: 8b 45 08 mov 0x8(%ebp),%eax
80104ff0: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
lk->cpu = 0;
80104ff7: 8b 45 08 mov 0x8(%ebp),%eax
80104ffa: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
// But the 2007 Intel 64 Architecture Memory Ordering White
// Paper says that Intel 64 and IA-32 will not move a load
// after a store. So lock->locked = 0 would work here.
// The xchg being asm volatile ensures gcc emits it after
// the above assignments (and after the critical section).
xchg(&lk->locked, 0);
80105001: 8b 45 08 mov 0x8(%ebp),%eax
80105004: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
8010500b: 00
8010500c: 89 04 24 mov %eax,(%esp)
8010500f: e8 1c ff ff ff call 80104f30 <xchg>
popcli();
80105014: e8 e3 00 00 00 call 801050fc <popcli>
}
80105019: c9 leave
8010501a: c3 ret
8010501b <getcallerpcs>:
// Record the current call stack in pcs[] by following the %ebp chain.
void
getcallerpcs(void *v, uint pcs[])
{
8010501b: 55 push %ebp
8010501c: 89 e5 mov %esp,%ebp
8010501e: 83 ec 10 sub $0x10,%esp
uint *ebp;
int i;
ebp = (uint*)v - 2;
80105021: 8b 45 08 mov 0x8(%ebp),%eax
80105024: 83 e8 08 sub $0x8,%eax
80105027: 89 45 f8 mov %eax,-0x8(%ebp)
for(i = 0; i < 10; i++){
8010502a: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
80105031: eb 34 jmp 80105067 <getcallerpcs+0x4c>
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
80105033: 83 7d f8 00 cmpl $0x0,-0x8(%ebp)
80105037: 74 49 je 80105082 <getcallerpcs+0x67>
80105039: 81 7d f8 ff ff ff 7f cmpl $0x7fffffff,-0x8(%ebp)
80105040: 76 40 jbe 80105082 <getcallerpcs+0x67>
80105042: 83 7d f8 ff cmpl $0xffffffff,-0x8(%ebp)
80105046: 74 3a je 80105082 <getcallerpcs+0x67>
break;
pcs[i] = ebp[1]; // saved %eip
80105048: 8b 45 fc mov -0x4(%ebp),%eax
8010504b: c1 e0 02 shl $0x2,%eax
8010504e: 03 45 0c add 0xc(%ebp),%eax
80105051: 8b 55 f8 mov -0x8(%ebp),%edx
80105054: 83 c2 04 add $0x4,%edx
80105057: 8b 12 mov (%edx),%edx
80105059: 89 10 mov %edx,(%eax)
ebp = (uint*)ebp[0]; // saved %ebp
8010505b: 8b 45 f8 mov -0x8(%ebp),%eax
8010505e: 8b 00 mov (%eax),%eax
80105060: 89 45 f8 mov %eax,-0x8(%ebp)
{
uint *ebp;
int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
80105063: 83 45 fc 01 addl $0x1,-0x4(%ebp)
80105067: 83 7d fc 09 cmpl $0x9,-0x4(%ebp)
8010506b: 7e c6 jle 80105033 <getcallerpcs+0x18>
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
8010506d: eb 13 jmp 80105082 <getcallerpcs+0x67>
pcs[i] = 0;
8010506f: 8b 45 fc mov -0x4(%ebp),%eax
80105072: c1 e0 02 shl $0x2,%eax
80105075: 03 45 0c add 0xc(%ebp),%eax
80105078: c7 00 00 00 00 00 movl $0x0,(%eax)
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
8010507e: 83 45 fc 01 addl $0x1,-0x4(%ebp)
80105082: 83 7d fc 09 cmpl $0x9,-0x4(%ebp)
80105086: 7e e7 jle 8010506f <getcallerpcs+0x54>
pcs[i] = 0;
}
80105088: c9 leave
80105089: c3 ret
8010508a <holding>:
// Check whether this cpu is holding the lock.
int
holding(struct spinlock *lock)
{
8010508a: 55 push %ebp
8010508b: 89 e5 mov %esp,%ebp
return lock->locked && lock->cpu == cpu;
8010508d: 8b 45 08 mov 0x8(%ebp),%eax
80105090: 8b 00 mov (%eax),%eax
80105092: 85 c0 test %eax,%eax
80105094: 74 17 je 801050ad <holding+0x23>
80105096: 8b 45 08 mov 0x8(%ebp),%eax
80105099: 8b 50 08 mov 0x8(%eax),%edx
8010509c: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801050a2: 39 c2 cmp %eax,%edx
801050a4: 75 07 jne 801050ad <holding+0x23>
801050a6: b8 01 00 00 00 mov $0x1,%eax
801050ab: eb 05 jmp 801050b2 <holding+0x28>
801050ad: b8 00 00 00 00 mov $0x0,%eax
}
801050b2: 5d pop %ebp
801050b3: c3 ret
801050b4 <pushcli>:
// it takes two popcli to undo two pushcli. Also, if interrupts
// are off, then pushcli, popcli leaves them off.
void
pushcli(void)
{
801050b4: 55 push %ebp
801050b5: 89 e5 mov %esp,%ebp
801050b7: 83 ec 10 sub $0x10,%esp
int eflags;
eflags = readeflags();
801050ba: e8 55 fe ff ff call 80104f14 <readeflags>
801050bf: 89 45 fc mov %eax,-0x4(%ebp)
cli();
801050c2: e8 5d fe ff ff call 80104f24 <cli>
if(cpu->ncli++ == 0)
801050c7: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801050cd: 8b 90 ac 00 00 00 mov 0xac(%eax),%edx
801050d3: 85 d2 test %edx,%edx
801050d5: 0f 94 c1 sete %cl
801050d8: 83 c2 01 add $0x1,%edx
801050db: 89 90 ac 00 00 00 mov %edx,0xac(%eax)
801050e1: 84 c9 test %cl,%cl
801050e3: 74 15 je 801050fa <pushcli+0x46>
cpu->intena = eflags & FL_IF;
801050e5: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801050eb: 8b 55 fc mov -0x4(%ebp),%edx
801050ee: 81 e2 00 02 00 00 and $0x200,%edx
801050f4: 89 90 b0 00 00 00 mov %edx,0xb0(%eax)
}
801050fa: c9 leave
801050fb: c3 ret
801050fc <popcli>:
void
popcli(void)
{
801050fc: 55 push %ebp
801050fd: 89 e5 mov %esp,%ebp
801050ff: 83 ec 18 sub $0x18,%esp
if(readeflags()&FL_IF)
80105102: e8 0d fe ff ff call 80104f14 <readeflags>
80105107: 25 00 02 00 00 and $0x200,%eax
8010510c: 85 c0 test %eax,%eax
8010510e: 74 0c je 8010511c <popcli+0x20>
panic("popcli - interruptible");
80105110: c7 04 24 f1 89 10 80 movl $0x801089f1,(%esp)
80105117: e8 1e b4 ff ff call 8010053a <panic>
if(--cpu->ncli < 0)
8010511c: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80105122: 8b 90 ac 00 00 00 mov 0xac(%eax),%edx
80105128: 83 ea 01 sub $0x1,%edx
8010512b: 89 90 ac 00 00 00 mov %edx,0xac(%eax)
80105131: 8b 80 ac 00 00 00 mov 0xac(%eax),%eax
80105137: 85 c0 test %eax,%eax
80105139: 79 0c jns 80105147 <popcli+0x4b>
panic("popcli");
8010513b: c7 04 24 08 8a 10 80 movl $0x80108a08,(%esp)
80105142: e8 f3 b3 ff ff call 8010053a <panic>
if(cpu->ncli == 0 && cpu->intena)
80105147: 65 a1 00 00 00 00 mov %gs:0x0,%eax
8010514d: 8b 80 ac 00 00 00 mov 0xac(%eax),%eax
80105153: 85 c0 test %eax,%eax
80105155: 75 15 jne 8010516c <popcli+0x70>
80105157: 65 a1 00 00 00 00 mov %gs:0x0,%eax
8010515d: 8b 80 b0 00 00 00 mov 0xb0(%eax),%eax
80105163: 85 c0 test %eax,%eax
80105165: 74 05 je 8010516c <popcli+0x70>
sti();
80105167: e8 be fd ff ff call 80104f2a <sti>
}
8010516c: c9 leave
8010516d: c3 ret
...
80105170 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
80105170: 55 push %ebp
80105171: 89 e5 mov %esp,%ebp
80105173: 57 push %edi
80105174: 53 push %ebx
asm volatile("cld; rep stosb" :
80105175: 8b 4d 08 mov 0x8(%ebp),%ecx
80105178: 8b 55 10 mov 0x10(%ebp),%edx
8010517b: 8b 45 0c mov 0xc(%ebp),%eax
8010517e: 89 cb mov %ecx,%ebx
80105180: 89 df mov %ebx,%edi
80105182: 89 d1 mov %edx,%ecx
80105184: fc cld
80105185: f3 aa rep stos %al,%es:(%edi)
80105187: 89 ca mov %ecx,%edx
80105189: 89 fb mov %edi,%ebx
8010518b: 89 5d 08 mov %ebx,0x8(%ebp)
8010518e: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
80105191: 5b pop %ebx
80105192: 5f pop %edi
80105193: 5d pop %ebp
80105194: c3 ret
80105195 <stosl>:
static inline void
stosl(void *addr, int data, int cnt)
{
80105195: 55 push %ebp
80105196: 89 e5 mov %esp,%ebp
80105198: 57 push %edi
80105199: 53 push %ebx
asm volatile("cld; rep stosl" :
8010519a: 8b 4d 08 mov 0x8(%ebp),%ecx
8010519d: 8b 55 10 mov 0x10(%ebp),%edx
801051a0: 8b 45 0c mov 0xc(%ebp),%eax
801051a3: 89 cb mov %ecx,%ebx
801051a5: 89 df mov %ebx,%edi
801051a7: 89 d1 mov %edx,%ecx
801051a9: fc cld
801051aa: f3 ab rep stos %eax,%es:(%edi)
801051ac: 89 ca mov %ecx,%edx
801051ae: 89 fb mov %edi,%ebx
801051b0: 89 5d 08 mov %ebx,0x8(%ebp)
801051b3: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
801051b6: 5b pop %ebx
801051b7: 5f pop %edi
801051b8: 5d pop %ebp
801051b9: c3 ret
801051ba <memset>:
#include "types.h"
#include "x86.h"
void*
memset(void *dst, int c, uint n)
{
801051ba: 55 push %ebp
801051bb: 89 e5 mov %esp,%ebp
801051bd: 83 ec 0c sub $0xc,%esp
if ((int)dst%4 == 0 && n%4 == 0){
801051c0: 8b 45 08 mov 0x8(%ebp),%eax
801051c3: 83 e0 03 and $0x3,%eax
801051c6: 85 c0 test %eax,%eax
801051c8: 75 49 jne 80105213 <memset+0x59>
801051ca: 8b 45 10 mov 0x10(%ebp),%eax
801051cd: 83 e0 03 and $0x3,%eax
801051d0: 85 c0 test %eax,%eax
801051d2: 75 3f jne 80105213 <memset+0x59>
c &= 0xFF;
801051d4: 81 65 0c ff 00 00 00 andl $0xff,0xc(%ebp)
stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
801051db: 8b 45 10 mov 0x10(%ebp),%eax
801051de: c1 e8 02 shr $0x2,%eax
801051e1: 89 c2 mov %eax,%edx
801051e3: 8b 45 0c mov 0xc(%ebp),%eax
801051e6: 89 c1 mov %eax,%ecx
801051e8: c1 e1 18 shl $0x18,%ecx
801051eb: 8b 45 0c mov 0xc(%ebp),%eax
801051ee: c1 e0 10 shl $0x10,%eax
801051f1: 09 c1 or %eax,%ecx
801051f3: 8b 45 0c mov 0xc(%ebp),%eax
801051f6: c1 e0 08 shl $0x8,%eax
801051f9: 09 c8 or %ecx,%eax
801051fb: 0b 45 0c or 0xc(%ebp),%eax
801051fe: 89 54 24 08 mov %edx,0x8(%esp)
80105202: 89 44 24 04 mov %eax,0x4(%esp)
80105206: 8b 45 08 mov 0x8(%ebp),%eax
80105209: 89 04 24 mov %eax,(%esp)
8010520c: e8 84 ff ff ff call 80105195 <stosl>
#include "x86.h"
void*
memset(void *dst, int c, uint n)
{
if ((int)dst%4 == 0 && n%4 == 0){
80105211: eb 19 jmp 8010522c <memset+0x72>
c &= 0xFF;
stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
} else
stosb(dst, c, n);
80105213: 8b 45 10 mov 0x10(%ebp),%eax
80105216: 89 44 24 08 mov %eax,0x8(%esp)
8010521a: 8b 45 0c mov 0xc(%ebp),%eax
8010521d: 89 44 24 04 mov %eax,0x4(%esp)
80105221: 8b 45 08 mov 0x8(%ebp),%eax
80105224: 89 04 24 mov %eax,(%esp)
80105227: e8 44 ff ff ff call 80105170 <stosb>
return dst;
8010522c: 8b 45 08 mov 0x8(%ebp),%eax
}
8010522f: c9 leave
80105230: c3 ret
80105231 <memcmp>:
int
memcmp(const void *v1, const void *v2, uint n)
{
80105231: 55 push %ebp
80105232: 89 e5 mov %esp,%ebp
80105234: 83 ec 10 sub $0x10,%esp
const uchar *s1, *s2;
s1 = v1;
80105237: 8b 45 08 mov 0x8(%ebp),%eax
8010523a: 89 45 f8 mov %eax,-0x8(%ebp)
s2 = v2;
8010523d: 8b 45 0c mov 0xc(%ebp),%eax
80105240: 89 45 fc mov %eax,-0x4(%ebp)
while(n-- > 0){
80105243: eb 32 jmp 80105277 <memcmp+0x46>
if(*s1 != *s2)
80105245: 8b 45 f8 mov -0x8(%ebp),%eax
80105248: 0f b6 10 movzbl (%eax),%edx
8010524b: 8b 45 fc mov -0x4(%ebp),%eax
8010524e: 0f b6 00 movzbl (%eax),%eax
80105251: 38 c2 cmp %al,%dl
80105253: 74 1a je 8010526f <memcmp+0x3e>
return *s1 - *s2;
80105255: 8b 45 f8 mov -0x8(%ebp),%eax
80105258: 0f b6 00 movzbl (%eax),%eax
8010525b: 0f b6 d0 movzbl %al,%edx
8010525e: 8b 45 fc mov -0x4(%ebp),%eax
80105261: 0f b6 00 movzbl (%eax),%eax
80105264: 0f b6 c0 movzbl %al,%eax
80105267: 89 d1 mov %edx,%ecx
80105269: 29 c1 sub %eax,%ecx
8010526b: 89 c8 mov %ecx,%eax
8010526d: eb 1c jmp 8010528b <memcmp+0x5a>
s1++, s2++;
8010526f: 83 45 f8 01 addl $0x1,-0x8(%ebp)
80105273: 83 45 fc 01 addl $0x1,-0x4(%ebp)
{
const uchar *s1, *s2;
s1 = v1;
s2 = v2;
while(n-- > 0){
80105277: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010527b: 0f 95 c0 setne %al
8010527e: 83 6d 10 01 subl $0x1,0x10(%ebp)
80105282: 84 c0 test %al,%al
80105284: 75 bf jne 80105245 <memcmp+0x14>
if(*s1 != *s2)
return *s1 - *s2;
s1++, s2++;
}
return 0;
80105286: b8 00 00 00 00 mov $0x0,%eax
}
8010528b: c9 leave
8010528c: c3 ret
8010528d <memmove>:
void*
memmove(void *dst, const void *src, uint n)
{
8010528d: 55 push %ebp
8010528e: 89 e5 mov %esp,%ebp
80105290: 83 ec 10 sub $0x10,%esp
const char *s;
char *d;
s = src;
80105293: 8b 45 0c mov 0xc(%ebp),%eax
80105296: 89 45 f8 mov %eax,-0x8(%ebp)
d = dst;
80105299: 8b 45 08 mov 0x8(%ebp),%eax
8010529c: 89 45 fc mov %eax,-0x4(%ebp)
if(s < d && s + n > d){
8010529f: 8b 45 f8 mov -0x8(%ebp),%eax
801052a2: 3b 45 fc cmp -0x4(%ebp),%eax
801052a5: 73 55 jae 801052fc <memmove+0x6f>
801052a7: 8b 45 10 mov 0x10(%ebp),%eax
801052aa: 8b 55 f8 mov -0x8(%ebp),%edx
801052ad: 8d 04 02 lea (%edx,%eax,1),%eax
801052b0: 3b 45 fc cmp -0x4(%ebp),%eax
801052b3: 76 4a jbe 801052ff <memmove+0x72>
s += n;
801052b5: 8b 45 10 mov 0x10(%ebp),%eax
801052b8: 01 45 f8 add %eax,-0x8(%ebp)
d += n;
801052bb: 8b 45 10 mov 0x10(%ebp),%eax
801052be: 01 45 fc add %eax,-0x4(%ebp)
while(n-- > 0)
801052c1: eb 13 jmp 801052d6 <memmove+0x49>
*--d = *--s;
801052c3: 83 6d fc 01 subl $0x1,-0x4(%ebp)
801052c7: 83 6d f8 01 subl $0x1,-0x8(%ebp)
801052cb: 8b 45 f8 mov -0x8(%ebp),%eax
801052ce: 0f b6 10 movzbl (%eax),%edx
801052d1: 8b 45 fc mov -0x4(%ebp),%eax
801052d4: 88 10 mov %dl,(%eax)
s = src;
d = dst;
if(s < d && s + n > d){
s += n;
d += n;
while(n-- > 0)
801052d6: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801052da: 0f 95 c0 setne %al
801052dd: 83 6d 10 01 subl $0x1,0x10(%ebp)
801052e1: 84 c0 test %al,%al
801052e3: 75 de jne 801052c3 <memmove+0x36>
const char *s;
char *d;
s = src;
d = dst;
if(s < d && s + n > d){
801052e5: eb 28 jmp 8010530f <memmove+0x82>
d += n;
while(n-- > 0)
*--d = *--s;
} else
while(n-- > 0)
*d++ = *s++;
801052e7: 8b 45 f8 mov -0x8(%ebp),%eax
801052ea: 0f b6 10 movzbl (%eax),%edx
801052ed: 8b 45 fc mov -0x4(%ebp),%eax
801052f0: 88 10 mov %dl,(%eax)
801052f2: 83 45 fc 01 addl $0x1,-0x4(%ebp)
801052f6: 83 45 f8 01 addl $0x1,-0x8(%ebp)
801052fa: eb 04 jmp 80105300 <memmove+0x73>
s += n;
d += n;
while(n-- > 0)
*--d = *--s;
} else
while(n-- > 0)
801052fc: 90 nop
801052fd: eb 01 jmp 80105300 <memmove+0x73>
801052ff: 90 nop
80105300: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80105304: 0f 95 c0 setne %al
80105307: 83 6d 10 01 subl $0x1,0x10(%ebp)
8010530b: 84 c0 test %al,%al
8010530d: 75 d8 jne 801052e7 <memmove+0x5a>
*d++ = *s++;
return dst;
8010530f: 8b 45 08 mov 0x8(%ebp),%eax
}
80105312: c9 leave
80105313: c3 ret
80105314 <memcpy>:
// memcpy exists to placate GCC. Use memmove.
void*
memcpy(void *dst, const void *src, uint n)
{
80105314: 55 push %ebp
80105315: 89 e5 mov %esp,%ebp
80105317: 83 ec 0c sub $0xc,%esp
return memmove(dst, src, n);
8010531a: 8b 45 10 mov 0x10(%ebp),%eax
8010531d: 89 44 24 08 mov %eax,0x8(%esp)
80105321: 8b 45 0c mov 0xc(%ebp),%eax
80105324: 89 44 24 04 mov %eax,0x4(%esp)
80105328: 8b 45 08 mov 0x8(%ebp),%eax
8010532b: 89 04 24 mov %eax,(%esp)
8010532e: e8 5a ff ff ff call 8010528d <memmove>
}
80105333: c9 leave
80105334: c3 ret
80105335 <strncmp>:
int
strncmp(const char *p, const char *q, uint n)
{
80105335: 55 push %ebp
80105336: 89 e5 mov %esp,%ebp
while(n > 0 && *p && *p == *q)
80105338: eb 0c jmp 80105346 <strncmp+0x11>
n--, p++, q++;
8010533a: 83 6d 10 01 subl $0x1,0x10(%ebp)
8010533e: 83 45 08 01 addl $0x1,0x8(%ebp)
80105342: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strncmp(const char *p, const char *q, uint n)
{
while(n > 0 && *p && *p == *q)
80105346: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010534a: 74 1a je 80105366 <strncmp+0x31>
8010534c: 8b 45 08 mov 0x8(%ebp),%eax
8010534f: 0f b6 00 movzbl (%eax),%eax
80105352: 84 c0 test %al,%al
80105354: 74 10 je 80105366 <strncmp+0x31>
80105356: 8b 45 08 mov 0x8(%ebp),%eax
80105359: 0f b6 10 movzbl (%eax),%edx
8010535c: 8b 45 0c mov 0xc(%ebp),%eax
8010535f: 0f b6 00 movzbl (%eax),%eax
80105362: 38 c2 cmp %al,%dl
80105364: 74 d4 je 8010533a <strncmp+0x5>
n--, p++, q++;
if(n == 0)
80105366: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010536a: 75 07 jne 80105373 <strncmp+0x3e>
return 0;
8010536c: b8 00 00 00 00 mov $0x0,%eax
80105371: eb 18 jmp 8010538b <strncmp+0x56>
return (uchar)*p - (uchar)*q;
80105373: 8b 45 08 mov 0x8(%ebp),%eax
80105376: 0f b6 00 movzbl (%eax),%eax
80105379: 0f b6 d0 movzbl %al,%edx
8010537c: 8b 45 0c mov 0xc(%ebp),%eax
8010537f: 0f b6 00 movzbl (%eax),%eax
80105382: 0f b6 c0 movzbl %al,%eax
80105385: 89 d1 mov %edx,%ecx
80105387: 29 c1 sub %eax,%ecx
80105389: 89 c8 mov %ecx,%eax
}
8010538b: 5d pop %ebp
8010538c: c3 ret
8010538d <strncpy>:
char*
strncpy(char *s, const char *t, int n)
{
8010538d: 55 push %ebp
8010538e: 89 e5 mov %esp,%ebp
80105390: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
80105393: 8b 45 08 mov 0x8(%ebp),%eax
80105396: 89 45 fc mov %eax,-0x4(%ebp)
while(n-- > 0 && (*s++ = *t++) != 0)
80105399: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010539d: 0f 9f c0 setg %al
801053a0: 83 6d 10 01 subl $0x1,0x10(%ebp)
801053a4: 84 c0 test %al,%al
801053a6: 74 30 je 801053d8 <strncpy+0x4b>
801053a8: 8b 45 0c mov 0xc(%ebp),%eax
801053ab: 0f b6 10 movzbl (%eax),%edx
801053ae: 8b 45 08 mov 0x8(%ebp),%eax
801053b1: 88 10 mov %dl,(%eax)
801053b3: 8b 45 08 mov 0x8(%ebp),%eax
801053b6: 0f b6 00 movzbl (%eax),%eax
801053b9: 84 c0 test %al,%al
801053bb: 0f 95 c0 setne %al
801053be: 83 45 08 01 addl $0x1,0x8(%ebp)
801053c2: 83 45 0c 01 addl $0x1,0xc(%ebp)
801053c6: 84 c0 test %al,%al
801053c8: 75 cf jne 80105399 <strncpy+0xc>
;
while(n-- > 0)
801053ca: eb 0d jmp 801053d9 <strncpy+0x4c>
*s++ = 0;
801053cc: 8b 45 08 mov 0x8(%ebp),%eax
801053cf: c6 00 00 movb $0x0,(%eax)
801053d2: 83 45 08 01 addl $0x1,0x8(%ebp)
801053d6: eb 01 jmp 801053d9 <strncpy+0x4c>
char *os;
os = s;
while(n-- > 0 && (*s++ = *t++) != 0)
;
while(n-- > 0)
801053d8: 90 nop
801053d9: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801053dd: 0f 9f c0 setg %al
801053e0: 83 6d 10 01 subl $0x1,0x10(%ebp)
801053e4: 84 c0 test %al,%al
801053e6: 75 e4 jne 801053cc <strncpy+0x3f>
*s++ = 0;
return os;
801053e8: 8b 45 fc mov -0x4(%ebp),%eax
}
801053eb: c9 leave
801053ec: c3 ret
801053ed <safestrcpy>:
// Like strncpy but guaranteed to NUL-terminate.
char*
safestrcpy(char *s, const char *t, int n)
{
801053ed: 55 push %ebp
801053ee: 89 e5 mov %esp,%ebp
801053f0: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
801053f3: 8b 45 08 mov 0x8(%ebp),%eax
801053f6: 89 45 fc mov %eax,-0x4(%ebp)
if(n <= 0)
801053f9: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801053fd: 7f 05 jg 80105404 <safestrcpy+0x17>
return os;
801053ff: 8b 45 fc mov -0x4(%ebp),%eax
80105402: eb 35 jmp 80105439 <safestrcpy+0x4c>
while(--n > 0 && (*s++ = *t++) != 0)
80105404: 83 6d 10 01 subl $0x1,0x10(%ebp)
80105408: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010540c: 7e 22 jle 80105430 <safestrcpy+0x43>
8010540e: 8b 45 0c mov 0xc(%ebp),%eax
80105411: 0f b6 10 movzbl (%eax),%edx
80105414: 8b 45 08 mov 0x8(%ebp),%eax
80105417: 88 10 mov %dl,(%eax)
80105419: 8b 45 08 mov 0x8(%ebp),%eax
8010541c: 0f b6 00 movzbl (%eax),%eax
8010541f: 84 c0 test %al,%al
80105421: 0f 95 c0 setne %al
80105424: 83 45 08 01 addl $0x1,0x8(%ebp)
80105428: 83 45 0c 01 addl $0x1,0xc(%ebp)
8010542c: 84 c0 test %al,%al
8010542e: 75 d4 jne 80105404 <safestrcpy+0x17>
;
*s = 0;
80105430: 8b 45 08 mov 0x8(%ebp),%eax
80105433: c6 00 00 movb $0x0,(%eax)
return os;
80105436: 8b 45 fc mov -0x4(%ebp),%eax
}
80105439: c9 leave
8010543a: c3 ret
8010543b <strlen>:
int
strlen(const char *s)
{
8010543b: 55 push %ebp
8010543c: 89 e5 mov %esp,%ebp
8010543e: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
80105441: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
80105448: eb 04 jmp 8010544e <strlen+0x13>
8010544a: 83 45 fc 01 addl $0x1,-0x4(%ebp)
8010544e: 8b 45 fc mov -0x4(%ebp),%eax
80105451: 03 45 08 add 0x8(%ebp),%eax
80105454: 0f b6 00 movzbl (%eax),%eax
80105457: 84 c0 test %al,%al
80105459: 75 ef jne 8010544a <strlen+0xf>
;
return n;
8010545b: 8b 45 fc mov -0x4(%ebp),%eax
}
8010545e: c9 leave
8010545f: c3 ret
80105460 <swtch>:
# Save current register context in old
# and then load register context from new.
.globl swtch
swtch:
movl 4(%esp), %eax
80105460: 8b 44 24 04 mov 0x4(%esp),%eax
movl 8(%esp), %edx
80105464: 8b 54 24 08 mov 0x8(%esp),%edx
# Save old callee-save registers
pushl %ebp
80105468: 55 push %ebp
pushl %ebx
80105469: 53 push %ebx
pushl %esi
8010546a: 56 push %esi
pushl %edi
8010546b: 57 push %edi
# Switch stacks
movl %esp, (%eax)
8010546c: 89 20 mov %esp,(%eax)
movl %edx, %esp
8010546e: 89 d4 mov %edx,%esp
# Load new callee-save registers
popl %edi
80105470: 5f pop %edi
popl %esi
80105471: 5e pop %esi
popl %ebx
80105472: 5b pop %ebx
popl %ebp
80105473: 5d pop %ebp
ret
80105474: c3 ret
80105475: 00 00 add %al,(%eax)
...
80105478 <fetchint>:
// to a saved program counter, and then the first argument.
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
80105478: 55 push %ebp
80105479: 89 e5 mov %esp,%ebp
if(addr >= proc->sz || addr+4 > proc->sz)
8010547b: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105481: 8b 00 mov (%eax),%eax
80105483: 3b 45 08 cmp 0x8(%ebp),%eax
80105486: 76 12 jbe 8010549a <fetchint+0x22>
80105488: 8b 45 08 mov 0x8(%ebp),%eax
8010548b: 8d 50 04 lea 0x4(%eax),%edx
8010548e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105494: 8b 00 mov (%eax),%eax
80105496: 39 c2 cmp %eax,%edx
80105498: 76 07 jbe 801054a1 <fetchint+0x29>
return -1;
8010549a: b8 ff ff ff ff mov $0xffffffff,%eax
8010549f: eb 0f jmp 801054b0 <fetchint+0x38>
*ip = *(int*)(addr);
801054a1: 8b 45 08 mov 0x8(%ebp),%eax
801054a4: 8b 10 mov (%eax),%edx
801054a6: 8b 45 0c mov 0xc(%ebp),%eax
801054a9: 89 10 mov %edx,(%eax)
return 0;
801054ab: b8 00 00 00 00 mov $0x0,%eax
}
801054b0: 5d pop %ebp
801054b1: c3 ret
801054b2 <fetchstr>:
// Fetch the nul-terminated string at addr from the current process.
// Doesn't actually copy the string - just sets *pp to point at it.
// Returns length of string, not including nul.
int
fetchstr(uint addr, char **pp)
{
801054b2: 55 push %ebp
801054b3: 89 e5 mov %esp,%ebp
801054b5: 83 ec 10 sub $0x10,%esp
char *s, *ep;
if(addr >= proc->sz)
801054b8: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801054be: 8b 00 mov (%eax),%eax
801054c0: 3b 45 08 cmp 0x8(%ebp),%eax
801054c3: 77 07 ja 801054cc <fetchstr+0x1a>
return -1;
801054c5: b8 ff ff ff ff mov $0xffffffff,%eax
801054ca: eb 48 jmp 80105514 <fetchstr+0x62>
*pp = (char*)addr;
801054cc: 8b 55 08 mov 0x8(%ebp),%edx
801054cf: 8b 45 0c mov 0xc(%ebp),%eax
801054d2: 89 10 mov %edx,(%eax)
ep = (char*)proc->sz;
801054d4: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801054da: 8b 00 mov (%eax),%eax
801054dc: 89 45 fc mov %eax,-0x4(%ebp)
for(s = *pp; s < ep; s++)
801054df: 8b 45 0c mov 0xc(%ebp),%eax
801054e2: 8b 00 mov (%eax),%eax
801054e4: 89 45 f8 mov %eax,-0x8(%ebp)
801054e7: eb 1e jmp 80105507 <fetchstr+0x55>
if(*s == 0)
801054e9: 8b 45 f8 mov -0x8(%ebp),%eax
801054ec: 0f b6 00 movzbl (%eax),%eax
801054ef: 84 c0 test %al,%al
801054f1: 75 10 jne 80105503 <fetchstr+0x51>
return s - *pp;
801054f3: 8b 55 f8 mov -0x8(%ebp),%edx
801054f6: 8b 45 0c mov 0xc(%ebp),%eax
801054f9: 8b 00 mov (%eax),%eax
801054fb: 89 d1 mov %edx,%ecx
801054fd: 29 c1 sub %eax,%ecx
801054ff: 89 c8 mov %ecx,%eax
80105501: eb 11 jmp 80105514 <fetchstr+0x62>
if(addr >= proc->sz)
return -1;
*pp = (char*)addr;
ep = (char*)proc->sz;
for(s = *pp; s < ep; s++)
80105503: 83 45 f8 01 addl $0x1,-0x8(%ebp)
80105507: 8b 45 f8 mov -0x8(%ebp),%eax
8010550a: 3b 45 fc cmp -0x4(%ebp),%eax
8010550d: 72 da jb 801054e9 <fetchstr+0x37>
if(*s == 0)
return s - *pp;
return -1;
8010550f: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105514: c9 leave
80105515: c3 ret
80105516 <argint>:
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
80105516: 55 push %ebp
80105517: 89 e5 mov %esp,%ebp
80105519: 83 ec 08 sub $0x8,%esp
return fetchint(proc->tf->esp + 4 + 4*n, ip);
8010551c: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105522: 8b 40 18 mov 0x18(%eax),%eax
80105525: 8b 50 44 mov 0x44(%eax),%edx
80105528: 8b 45 08 mov 0x8(%ebp),%eax
8010552b: c1 e0 02 shl $0x2,%eax
8010552e: 8d 04 02 lea (%edx,%eax,1),%eax
80105531: 8d 50 04 lea 0x4(%eax),%edx
80105534: 8b 45 0c mov 0xc(%ebp),%eax
80105537: 89 44 24 04 mov %eax,0x4(%esp)
8010553b: 89 14 24 mov %edx,(%esp)
8010553e: e8 35 ff ff ff call 80105478 <fetchint>
}
80105543: c9 leave
80105544: c3 ret
80105545 <argptr>:
// Fetch the nth word-sized system call argument as a pointer
// to a block of memory of size n bytes. Check that the pointer
// lies within the process address space.
int
argptr(int n, char **pp, int size)
{
80105545: 55 push %ebp
80105546: 89 e5 mov %esp,%ebp
80105548: 83 ec 18 sub $0x18,%esp
int i;
if(argint(n, &i) < 0)
8010554b: 8d 45 fc lea -0x4(%ebp),%eax
8010554e: 89 44 24 04 mov %eax,0x4(%esp)
80105552: 8b 45 08 mov 0x8(%ebp),%eax
80105555: 89 04 24 mov %eax,(%esp)
80105558: e8 b9 ff ff ff call 80105516 <argint>
8010555d: 85 c0 test %eax,%eax
8010555f: 79 07 jns 80105568 <argptr+0x23>
return -1;
80105561: b8 ff ff ff ff mov $0xffffffff,%eax
80105566: eb 3d jmp 801055a5 <argptr+0x60>
if((uint)i >= proc->sz || (uint)i+size > proc->sz)
80105568: 8b 45 fc mov -0x4(%ebp),%eax
8010556b: 89 c2 mov %eax,%edx
8010556d: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105573: 8b 00 mov (%eax),%eax
80105575: 39 c2 cmp %eax,%edx
80105577: 73 16 jae 8010558f <argptr+0x4a>
80105579: 8b 45 fc mov -0x4(%ebp),%eax
8010557c: 89 c2 mov %eax,%edx
8010557e: 8b 45 10 mov 0x10(%ebp),%eax
80105581: 01 c2 add %eax,%edx
80105583: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105589: 8b 00 mov (%eax),%eax
8010558b: 39 c2 cmp %eax,%edx
8010558d: 76 07 jbe 80105596 <argptr+0x51>
return -1;
8010558f: b8 ff ff ff ff mov $0xffffffff,%eax
80105594: eb 0f jmp 801055a5 <argptr+0x60>
*pp = (char*)i;
80105596: 8b 45 fc mov -0x4(%ebp),%eax
80105599: 89 c2 mov %eax,%edx
8010559b: 8b 45 0c mov 0xc(%ebp),%eax
8010559e: 89 10 mov %edx,(%eax)
return 0;
801055a0: b8 00 00 00 00 mov $0x0,%eax
}
801055a5: c9 leave
801055a6: c3 ret
801055a7 <argstr>:
// Check that the pointer is valid and the string is nul-terminated.
// (There is no shared writable memory, so the string can't change
// between this check and being used by the kernel.)
int
argstr(int n, char **pp)
{
801055a7: 55 push %ebp
801055a8: 89 e5 mov %esp,%ebp
801055aa: 83 ec 18 sub $0x18,%esp
int addr;
if(argint(n, &addr) < 0)
801055ad: 8d 45 fc lea -0x4(%ebp),%eax
801055b0: 89 44 24 04 mov %eax,0x4(%esp)
801055b4: 8b 45 08 mov 0x8(%ebp),%eax
801055b7: 89 04 24 mov %eax,(%esp)
801055ba: e8 57 ff ff ff call 80105516 <argint>
801055bf: 85 c0 test %eax,%eax
801055c1: 79 07 jns 801055ca <argstr+0x23>
return -1;
801055c3: b8 ff ff ff ff mov $0xffffffff,%eax
801055c8: eb 12 jmp 801055dc <argstr+0x35>
return fetchstr(addr, pp);
801055ca: 8b 45 fc mov -0x4(%ebp),%eax
801055cd: 8b 55 0c mov 0xc(%ebp),%edx
801055d0: 89 54 24 04 mov %edx,0x4(%esp)
801055d4: 89 04 24 mov %eax,(%esp)
801055d7: e8 d6 fe ff ff call 801054b2 <fetchstr>
}
801055dc: c9 leave
801055dd: c3 ret
801055de <syscall>:
[SYS_thread_yield] sys_thread_yield,
};
void
syscall(void)
{
801055de: 55 push %ebp
801055df: 89 e5 mov %esp,%ebp
801055e1: 53 push %ebx
801055e2: 83 ec 24 sub $0x24,%esp
int num;
num = proc->tf->eax;
801055e5: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801055eb: 8b 40 18 mov 0x18(%eax),%eax
801055ee: 8b 40 1c mov 0x1c(%eax),%eax
801055f1: 89 45 f4 mov %eax,-0xc(%ebp)
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
801055f4: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801055f8: 7e 30 jle 8010562a <syscall+0x4c>
801055fa: 8b 45 f4 mov -0xc(%ebp),%eax
801055fd: 83 f8 1a cmp $0x1a,%eax
80105600: 77 28 ja 8010562a <syscall+0x4c>
80105602: 8b 45 f4 mov -0xc(%ebp),%eax
80105605: 8b 04 85 40 b0 10 80 mov -0x7fef4fc0(,%eax,4),%eax
8010560c: 85 c0 test %eax,%eax
8010560e: 74 1a je 8010562a <syscall+0x4c>
proc->tf->eax = syscalls[num]();
80105610: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105616: 8b 58 18 mov 0x18(%eax),%ebx
80105619: 8b 45 f4 mov -0xc(%ebp),%eax
8010561c: 8b 04 85 40 b0 10 80 mov -0x7fef4fc0(,%eax,4),%eax
80105623: ff d0 call *%eax
80105625: 89 43 1c mov %eax,0x1c(%ebx)
syscall(void)
{
int num;
num = proc->tf->eax;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
80105628: eb 3d jmp 80105667 <syscall+0x89>
proc->tf->eax = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
proc->pid, proc->name, num);
8010562a: 65 a1 04 00 00 00 mov %gs:0x4,%eax
num = proc->tf->eax;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
proc->tf->eax = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
80105630: 8d 48 6c lea 0x6c(%eax),%ecx
proc->pid, proc->name, num);
80105633: 65 a1 04 00 00 00 mov %gs:0x4,%eax
num = proc->tf->eax;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
proc->tf->eax = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
80105639: 8b 40 10 mov 0x10(%eax),%eax
8010563c: 8b 55 f4 mov -0xc(%ebp),%edx
8010563f: 89 54 24 0c mov %edx,0xc(%esp)
80105643: 89 4c 24 08 mov %ecx,0x8(%esp)
80105647: 89 44 24 04 mov %eax,0x4(%esp)
8010564b: c7 04 24 0f 8a 10 80 movl $0x80108a0f,(%esp)
80105652: e8 43 ad ff ff call 8010039a <cprintf>
proc->pid, proc->name, num);
proc->tf->eax = -1;
80105657: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010565d: 8b 40 18 mov 0x18(%eax),%eax
80105660: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax)
}
}
80105667: 83 c4 24 add $0x24,%esp
8010566a: 5b pop %ebx
8010566b: 5d pop %ebp
8010566c: c3 ret
8010566d: 00 00 add %al,(%eax)
...
80105670 <argfd>:
// Fetch the nth word-sized system call argument as a file descriptor
// and return both the descriptor and the corresponding struct file.
static int
argfd(int n, int *pfd, struct file **pf)
{
80105670: 55 push %ebp
80105671: 89 e5 mov %esp,%ebp
80105673: 83 ec 28 sub $0x28,%esp
int fd;
struct file *f;
if(argint(n, &fd) < 0)
80105676: 8d 45 f0 lea -0x10(%ebp),%eax
80105679: 89 44 24 04 mov %eax,0x4(%esp)
8010567d: 8b 45 08 mov 0x8(%ebp),%eax
80105680: 89 04 24 mov %eax,(%esp)
80105683: e8 8e fe ff ff call 80105516 <argint>
80105688: 85 c0 test %eax,%eax
8010568a: 79 07 jns 80105693 <argfd+0x23>
return -1;
8010568c: b8 ff ff ff ff mov $0xffffffff,%eax
80105691: eb 50 jmp 801056e3 <argfd+0x73>
if(fd < 0 || fd >= NOFILE || (f=proc->ofile[fd]) == 0)
80105693: 8b 45 f0 mov -0x10(%ebp),%eax
80105696: 85 c0 test %eax,%eax
80105698: 78 21 js 801056bb <argfd+0x4b>
8010569a: 8b 45 f0 mov -0x10(%ebp),%eax
8010569d: 83 f8 0f cmp $0xf,%eax
801056a0: 7f 19 jg 801056bb <argfd+0x4b>
801056a2: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801056a8: 8b 55 f0 mov -0x10(%ebp),%edx
801056ab: 83 c2 08 add $0x8,%edx
801056ae: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
801056b2: 89 45 f4 mov %eax,-0xc(%ebp)
801056b5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801056b9: 75 07 jne 801056c2 <argfd+0x52>
return -1;
801056bb: b8 ff ff ff ff mov $0xffffffff,%eax
801056c0: eb 21 jmp 801056e3 <argfd+0x73>
if(pfd)
801056c2: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
801056c6: 74 08 je 801056d0 <argfd+0x60>
*pfd = fd;
801056c8: 8b 55 f0 mov -0x10(%ebp),%edx
801056cb: 8b 45 0c mov 0xc(%ebp),%eax
801056ce: 89 10 mov %edx,(%eax)
if(pf)
801056d0: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801056d4: 74 08 je 801056de <argfd+0x6e>
*pf = f;
801056d6: 8b 45 10 mov 0x10(%ebp),%eax
801056d9: 8b 55 f4 mov -0xc(%ebp),%edx
801056dc: 89 10 mov %edx,(%eax)
return 0;
801056de: b8 00 00 00 00 mov $0x0,%eax
}
801056e3: c9 leave
801056e4: c3 ret
801056e5 <fdalloc>:
// Allocate a file descriptor for the given file.
// Takes over file reference from caller on success.
static int
fdalloc(struct file *f)
{
801056e5: 55 push %ebp
801056e6: 89 e5 mov %esp,%ebp
801056e8: 83 ec 10 sub $0x10,%esp
int fd;
for(fd = 0; fd < NOFILE; fd++){
801056eb: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
801056f2: eb 30 jmp 80105724 <fdalloc+0x3f>
if(proc->ofile[fd] == 0){
801056f4: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801056fa: 8b 55 fc mov -0x4(%ebp),%edx
801056fd: 83 c2 08 add $0x8,%edx
80105700: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
80105704: 85 c0 test %eax,%eax
80105706: 75 18 jne 80105720 <fdalloc+0x3b>
proc->ofile[fd] = f;
80105708: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010570e: 8b 55 fc mov -0x4(%ebp),%edx
80105711: 8d 4a 08 lea 0x8(%edx),%ecx
80105714: 8b 55 08 mov 0x8(%ebp),%edx
80105717: 89 54 88 08 mov %edx,0x8(%eax,%ecx,4)
return fd;
8010571b: 8b 45 fc mov -0x4(%ebp),%eax
8010571e: eb 0f jmp 8010572f <fdalloc+0x4a>
static int
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
80105720: 83 45 fc 01 addl $0x1,-0x4(%ebp)
80105724: 83 7d fc 0f cmpl $0xf,-0x4(%ebp)
80105728: 7e ca jle 801056f4 <fdalloc+0xf>
if(proc->ofile[fd] == 0){
proc->ofile[fd] = f;
return fd;
}
}
return -1;
8010572a: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010572f: c9 leave
80105730: c3 ret
80105731 <sys_dup>:
int
sys_dup(void)
{
80105731: 55 push %ebp
80105732: 89 e5 mov %esp,%ebp
80105734: 83 ec 28 sub $0x28,%esp
struct file *f;
int fd;
if(argfd(0, 0, &f) < 0)
80105737: 8d 45 f0 lea -0x10(%ebp),%eax
8010573a: 89 44 24 08 mov %eax,0x8(%esp)
8010573e: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80105745: 00
80105746: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010574d: e8 1e ff ff ff call 80105670 <argfd>
80105752: 85 c0 test %eax,%eax
80105754: 79 07 jns 8010575d <sys_dup+0x2c>
return -1;
80105756: b8 ff ff ff ff mov $0xffffffff,%eax
8010575b: eb 29 jmp 80105786 <sys_dup+0x55>
if((fd=fdalloc(f)) < 0)
8010575d: 8b 45 f0 mov -0x10(%ebp),%eax
80105760: 89 04 24 mov %eax,(%esp)
80105763: e8 7d ff ff ff call 801056e5 <fdalloc>
80105768: 89 45 f4 mov %eax,-0xc(%ebp)
8010576b: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8010576f: 79 07 jns 80105778 <sys_dup+0x47>
return -1;
80105771: b8 ff ff ff ff mov $0xffffffff,%eax
80105776: eb 0e jmp 80105786 <sys_dup+0x55>
filedup(f);
80105778: 8b 45 f0 mov -0x10(%ebp),%eax
8010577b: 89 04 24 mov %eax,(%esp)
8010577e: e8 02 b8 ff ff call 80100f85 <filedup>
return fd;
80105783: 8b 45 f4 mov -0xc(%ebp),%eax
}
80105786: c9 leave
80105787: c3 ret
80105788 <sys_read>:
int
sys_read(void)
{
80105788: 55 push %ebp
80105789: 89 e5 mov %esp,%ebp
8010578b: 83 ec 28 sub $0x28,%esp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
8010578e: 8d 45 f4 lea -0xc(%ebp),%eax
80105791: 89 44 24 08 mov %eax,0x8(%esp)
80105795: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
8010579c: 00
8010579d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801057a4: e8 c7 fe ff ff call 80105670 <argfd>
801057a9: 85 c0 test %eax,%eax
801057ab: 78 35 js 801057e2 <sys_read+0x5a>
801057ad: 8d 45 f0 lea -0x10(%ebp),%eax
801057b0: 89 44 24 04 mov %eax,0x4(%esp)
801057b4: c7 04 24 02 00 00 00 movl $0x2,(%esp)
801057bb: e8 56 fd ff ff call 80105516 <argint>
801057c0: 85 c0 test %eax,%eax
801057c2: 78 1e js 801057e2 <sys_read+0x5a>
801057c4: 8b 45 f0 mov -0x10(%ebp),%eax
801057c7: 89 44 24 08 mov %eax,0x8(%esp)
801057cb: 8d 45 ec lea -0x14(%ebp),%eax
801057ce: 89 44 24 04 mov %eax,0x4(%esp)
801057d2: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801057d9: e8 67 fd ff ff call 80105545 <argptr>
801057de: 85 c0 test %eax,%eax
801057e0: 79 07 jns 801057e9 <sys_read+0x61>
return -1;
801057e2: b8 ff ff ff ff mov $0xffffffff,%eax
801057e7: eb 19 jmp 80105802 <sys_read+0x7a>
return fileread(f, p, n);
801057e9: 8b 4d f0 mov -0x10(%ebp),%ecx
801057ec: 8b 55 ec mov -0x14(%ebp),%edx
801057ef: 8b 45 f4 mov -0xc(%ebp),%eax
801057f2: 89 4c 24 08 mov %ecx,0x8(%esp)
801057f6: 89 54 24 04 mov %edx,0x4(%esp)
801057fa: 89 04 24 mov %eax,(%esp)
801057fd: e8 f0 b8 ff ff call 801010f2 <fileread>
}
80105802: c9 leave
80105803: c3 ret
80105804 <sys_write>:
int
sys_write(void)
{
80105804: 55 push %ebp
80105805: 89 e5 mov %esp,%ebp
80105807: 83 ec 28 sub $0x28,%esp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
8010580a: 8d 45 f4 lea -0xc(%ebp),%eax
8010580d: 89 44 24 08 mov %eax,0x8(%esp)
80105811: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80105818: 00
80105819: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105820: e8 4b fe ff ff call 80105670 <argfd>
80105825: 85 c0 test %eax,%eax
80105827: 78 35 js 8010585e <sys_write+0x5a>
80105829: 8d 45 f0 lea -0x10(%ebp),%eax
8010582c: 89 44 24 04 mov %eax,0x4(%esp)
80105830: c7 04 24 02 00 00 00 movl $0x2,(%esp)
80105837: e8 da fc ff ff call 80105516 <argint>
8010583c: 85 c0 test %eax,%eax
8010583e: 78 1e js 8010585e <sys_write+0x5a>
80105840: 8b 45 f0 mov -0x10(%ebp),%eax
80105843: 89 44 24 08 mov %eax,0x8(%esp)
80105847: 8d 45 ec lea -0x14(%ebp),%eax
8010584a: 89 44 24 04 mov %eax,0x4(%esp)
8010584e: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80105855: e8 eb fc ff ff call 80105545 <argptr>
8010585a: 85 c0 test %eax,%eax
8010585c: 79 07 jns 80105865 <sys_write+0x61>
return -1;
8010585e: b8 ff ff ff ff mov $0xffffffff,%eax
80105863: eb 19 jmp 8010587e <sys_write+0x7a>
return filewrite(f, p, n);
80105865: 8b 4d f0 mov -0x10(%ebp),%ecx
80105868: 8b 55 ec mov -0x14(%ebp),%edx
8010586b: 8b 45 f4 mov -0xc(%ebp),%eax
8010586e: 89 4c 24 08 mov %ecx,0x8(%esp)
80105872: 89 54 24 04 mov %edx,0x4(%esp)
80105876: 89 04 24 mov %eax,(%esp)
80105879: e8 30 b9 ff ff call 801011ae <filewrite>
}
8010587e: c9 leave
8010587f: c3 ret
80105880 <sys_close>:
int
sys_close(void)
{
80105880: 55 push %ebp
80105881: 89 e5 mov %esp,%ebp
80105883: 83 ec 28 sub $0x28,%esp
int fd;
struct file *f;
if(argfd(0, &fd, &f) < 0)
80105886: 8d 45 f0 lea -0x10(%ebp),%eax
80105889: 89 44 24 08 mov %eax,0x8(%esp)
8010588d: 8d 45 f4 lea -0xc(%ebp),%eax
80105890: 89 44 24 04 mov %eax,0x4(%esp)
80105894: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010589b: e8 d0 fd ff ff call 80105670 <argfd>
801058a0: 85 c0 test %eax,%eax
801058a2: 79 07 jns 801058ab <sys_close+0x2b>
return -1;
801058a4: b8 ff ff ff ff mov $0xffffffff,%eax
801058a9: eb 24 jmp 801058cf <sys_close+0x4f>
proc->ofile[fd] = 0;
801058ab: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801058b1: 8b 55 f4 mov -0xc(%ebp),%edx
801058b4: 83 c2 08 add $0x8,%edx
801058b7: c7 44 90 08 00 00 00 movl $0x0,0x8(%eax,%edx,4)
801058be: 00
fileclose(f);
801058bf: 8b 45 f0 mov -0x10(%ebp),%eax
801058c2: 89 04 24 mov %eax,(%esp)
801058c5: e8 03 b7 ff ff call 80100fcd <fileclose>
return 0;
801058ca: b8 00 00 00 00 mov $0x0,%eax
}
801058cf: c9 leave
801058d0: c3 ret
801058d1 <sys_fstat>:
int
sys_fstat(void)
{
801058d1: 55 push %ebp
801058d2: 89 e5 mov %esp,%ebp
801058d4: 83 ec 28 sub $0x28,%esp
struct file *f;
struct stat *st;
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
801058d7: 8d 45 f4 lea -0xc(%ebp),%eax
801058da: 89 44 24 08 mov %eax,0x8(%esp)
801058de: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801058e5: 00
801058e6: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801058ed: e8 7e fd ff ff call 80105670 <argfd>
801058f2: 85 c0 test %eax,%eax
801058f4: 78 1f js 80105915 <sys_fstat+0x44>
801058f6: 8d 45 f0 lea -0x10(%ebp),%eax
801058f9: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp)
80105900: 00
80105901: 89 44 24 04 mov %eax,0x4(%esp)
80105905: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010590c: e8 34 fc ff ff call 80105545 <argptr>
80105911: 85 c0 test %eax,%eax
80105913: 79 07 jns 8010591c <sys_fstat+0x4b>
return -1;
80105915: b8 ff ff ff ff mov $0xffffffff,%eax
8010591a: eb 12 jmp 8010592e <sys_fstat+0x5d>
return filestat(f, st);
8010591c: 8b 55 f0 mov -0x10(%ebp),%edx
8010591f: 8b 45 f4 mov -0xc(%ebp),%eax
80105922: 89 54 24 04 mov %edx,0x4(%esp)
80105926: 89 04 24 mov %eax,(%esp)
80105929: e8 75 b7 ff ff call 801010a3 <filestat>
}
8010592e: c9 leave
8010592f: c3 ret
80105930 <sys_link>:
// Create the path new as a link to the same inode as old.
int
sys_link(void)
{
80105930: 55 push %ebp
80105931: 89 e5 mov %esp,%ebp
80105933: 83 ec 38 sub $0x38,%esp
char name[DIRSIZ], *new, *old;
struct inode *dp, *ip;
if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
80105936: 8d 45 d8 lea -0x28(%ebp),%eax
80105939: 89 44 24 04 mov %eax,0x4(%esp)
8010593d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105944: e8 5e fc ff ff call 801055a7 <argstr>
80105949: 85 c0 test %eax,%eax
8010594b: 78 17 js 80105964 <sys_link+0x34>
8010594d: 8d 45 dc lea -0x24(%ebp),%eax
80105950: 89 44 24 04 mov %eax,0x4(%esp)
80105954: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010595b: e8 47 fc ff ff call 801055a7 <argstr>
80105960: 85 c0 test %eax,%eax
80105962: 79 0a jns 8010596e <sys_link+0x3e>
return -1;
80105964: b8 ff ff ff ff mov $0xffffffff,%eax
80105969: e9 3c 01 00 00 jmp 80105aaa <sys_link+0x17a>
if((ip = namei(old)) == 0)
8010596e: 8b 45 d8 mov -0x28(%ebp),%eax
80105971: 89 04 24 mov %eax,(%esp)
80105974: e8 aa ca ff ff call 80102423 <namei>
80105979: 89 45 f4 mov %eax,-0xc(%ebp)
8010597c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80105980: 75 0a jne 8010598c <sys_link+0x5c>
return -1;
80105982: b8 ff ff ff ff mov $0xffffffff,%eax
80105987: e9 1e 01 00 00 jmp 80105aaa <sys_link+0x17a>
begin_trans();
8010598c: e8 81 d8 ff ff call 80103212 <begin_trans>
ilock(ip);
80105991: 8b 45 f4 mov -0xc(%ebp),%eax
80105994: 89 04 24 mov %eax,(%esp)
80105997: e8 df be ff ff call 8010187b <ilock>
if(ip->type == T_DIR){
8010599c: 8b 45 f4 mov -0xc(%ebp),%eax
8010599f: 0f b7 40 10 movzwl 0x10(%eax),%eax
801059a3: 66 83 f8 01 cmp $0x1,%ax
801059a7: 75 1a jne 801059c3 <sys_link+0x93>
iunlockput(ip);
801059a9: 8b 45 f4 mov -0xc(%ebp),%eax
801059ac: 89 04 24 mov %eax,(%esp)
801059af: e8 4e c1 ff ff call 80101b02 <iunlockput>
commit_trans();
801059b4: e8 a2 d8 ff ff call 8010325b <commit_trans>
return -1;
801059b9: b8 ff ff ff ff mov $0xffffffff,%eax
801059be: e9 e7 00 00 00 jmp 80105aaa <sys_link+0x17a>
}
ip->nlink++;
801059c3: 8b 45 f4 mov -0xc(%ebp),%eax
801059c6: 0f b7 40 16 movzwl 0x16(%eax),%eax
801059ca: 8d 50 01 lea 0x1(%eax),%edx
801059cd: 8b 45 f4 mov -0xc(%ebp),%eax
801059d0: 66 89 50 16 mov %dx,0x16(%eax)
iupdate(ip);
801059d4: 8b 45 f4 mov -0xc(%ebp),%eax
801059d7: 89 04 24 mov %eax,(%esp)
801059da: e8 dc bc ff ff call 801016bb <iupdate>
iunlock(ip);
801059df: 8b 45 f4 mov -0xc(%ebp),%eax
801059e2: 89 04 24 mov %eax,(%esp)
801059e5: e8 e2 bf ff ff call 801019cc <iunlock>
if((dp = nameiparent(new, name)) == 0)
801059ea: 8b 45 dc mov -0x24(%ebp),%eax
801059ed: 8d 55 e2 lea -0x1e(%ebp),%edx
801059f0: 89 54 24 04 mov %edx,0x4(%esp)
801059f4: 89 04 24 mov %eax,(%esp)
801059f7: e8 49 ca ff ff call 80102445 <nameiparent>
801059fc: 89 45 f0 mov %eax,-0x10(%ebp)
801059ff: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80105a03: 74 68 je 80105a6d <sys_link+0x13d>
goto bad;
ilock(dp);
80105a05: 8b 45 f0 mov -0x10(%ebp),%eax
80105a08: 89 04 24 mov %eax,(%esp)
80105a0b: e8 6b be ff ff call 8010187b <ilock>
if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
80105a10: 8b 45 f0 mov -0x10(%ebp),%eax
80105a13: 8b 10 mov (%eax),%edx
80105a15: 8b 45 f4 mov -0xc(%ebp),%eax
80105a18: 8b 00 mov (%eax),%eax
80105a1a: 39 c2 cmp %eax,%edx
80105a1c: 75 20 jne 80105a3e <sys_link+0x10e>
80105a1e: 8b 45 f4 mov -0xc(%ebp),%eax
80105a21: 8b 40 04 mov 0x4(%eax),%eax
80105a24: 89 44 24 08 mov %eax,0x8(%esp)
80105a28: 8d 45 e2 lea -0x1e(%ebp),%eax
80105a2b: 89 44 24 04 mov %eax,0x4(%esp)
80105a2f: 8b 45 f0 mov -0x10(%ebp),%eax
80105a32: 89 04 24 mov %eax,(%esp)
80105a35: e8 28 c7 ff ff call 80102162 <dirlink>
80105a3a: 85 c0 test %eax,%eax
80105a3c: 79 0d jns 80105a4b <sys_link+0x11b>
iunlockput(dp);
80105a3e: 8b 45 f0 mov -0x10(%ebp),%eax
80105a41: 89 04 24 mov %eax,(%esp)
80105a44: e8 b9 c0 ff ff call 80101b02 <iunlockput>
goto bad;
80105a49: eb 23 jmp 80105a6e <sys_link+0x13e>
}
iunlockput(dp);
80105a4b: 8b 45 f0 mov -0x10(%ebp),%eax
80105a4e: 89 04 24 mov %eax,(%esp)
80105a51: e8 ac c0 ff ff call 80101b02 <iunlockput>
iput(ip);
80105a56: 8b 45 f4 mov -0xc(%ebp),%eax
80105a59: 89 04 24 mov %eax,(%esp)
80105a5c: e8 d0 bf ff ff call 80101a31 <iput>
commit_trans();
80105a61: e8 f5 d7 ff ff call 8010325b <commit_trans>
return 0;
80105a66: b8 00 00 00 00 mov $0x0,%eax
80105a6b: eb 3d jmp 80105aaa <sys_link+0x17a>
ip->nlink++;
iupdate(ip);
iunlock(ip);
if((dp = nameiparent(new, name)) == 0)
goto bad;
80105a6d: 90 nop
commit_trans();
return 0;
bad:
ilock(ip);
80105a6e: 8b 45 f4 mov -0xc(%ebp),%eax
80105a71: 89 04 24 mov %eax,(%esp)
80105a74: e8 02 be ff ff call 8010187b <ilock>
ip->nlink--;
80105a79: 8b 45 f4 mov -0xc(%ebp),%eax
80105a7c: 0f b7 40 16 movzwl 0x16(%eax),%eax
80105a80: 8d 50 ff lea -0x1(%eax),%edx
80105a83: 8b 45 f4 mov -0xc(%ebp),%eax
80105a86: 66 89 50 16 mov %dx,0x16(%eax)
iupdate(ip);
80105a8a: 8b 45 f4 mov -0xc(%ebp),%eax
80105a8d: 89 04 24 mov %eax,(%esp)
80105a90: e8 26 bc ff ff call 801016bb <iupdate>
iunlockput(ip);
80105a95: 8b 45 f4 mov -0xc(%ebp),%eax
80105a98: 89 04 24 mov %eax,(%esp)
80105a9b: e8 62 c0 ff ff call 80101b02 <iunlockput>
commit_trans();
80105aa0: e8 b6 d7 ff ff call 8010325b <commit_trans>
return -1;
80105aa5: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105aaa: c9 leave
80105aab: c3 ret
80105aac <isdirempty>:
// Is the directory dp empty except for "." and ".." ?
static int
isdirempty(struct inode *dp)
{
80105aac: 55 push %ebp
80105aad: 89 e5 mov %esp,%ebp
80105aaf: 83 ec 38 sub $0x38,%esp
int off;
struct dirent de;
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
80105ab2: c7 45 f4 20 00 00 00 movl $0x20,-0xc(%ebp)
80105ab9: eb 4b jmp 80105b06 <isdirempty+0x5a>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80105abb: 8b 55 f4 mov -0xc(%ebp),%edx
80105abe: 8d 45 e4 lea -0x1c(%ebp),%eax
80105ac1: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80105ac8: 00
80105ac9: 89 54 24 08 mov %edx,0x8(%esp)
80105acd: 89 44 24 04 mov %eax,0x4(%esp)
80105ad1: 8b 45 08 mov 0x8(%ebp),%eax
80105ad4: 89 04 24 mov %eax,(%esp)
80105ad7: e8 98 c2 ff ff call 80101d74 <readi>
80105adc: 83 f8 10 cmp $0x10,%eax
80105adf: 74 0c je 80105aed <isdirempty+0x41>
panic("isdirempty: readi");
80105ae1: c7 04 24 2b 8a 10 80 movl $0x80108a2b,(%esp)
80105ae8: e8 4d aa ff ff call 8010053a <panic>
if(de.inum != 0)
80105aed: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax
80105af1: 66 85 c0 test %ax,%ax
80105af4: 74 07 je 80105afd <isdirempty+0x51>
return 0;
80105af6: b8 00 00 00 00 mov $0x0,%eax
80105afb: eb 1b jmp 80105b18 <isdirempty+0x6c>
isdirempty(struct inode *dp)
{
int off;
struct dirent de;
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
80105afd: 8b 45 f4 mov -0xc(%ebp),%eax
80105b00: 83 c0 10 add $0x10,%eax
80105b03: 89 45 f4 mov %eax,-0xc(%ebp)
80105b06: 8b 55 f4 mov -0xc(%ebp),%edx
80105b09: 8b 45 08 mov 0x8(%ebp),%eax
80105b0c: 8b 40 18 mov 0x18(%eax),%eax
80105b0f: 39 c2 cmp %eax,%edx
80105b11: 72 a8 jb 80105abb <isdirempty+0xf>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("isdirempty: readi");
if(de.inum != 0)
return 0;
}
return 1;
80105b13: b8 01 00 00 00 mov $0x1,%eax
}
80105b18: c9 leave
80105b19: c3 ret
80105b1a <sys_unlink>:
//PAGEBREAK!
int
sys_unlink(void)
{
80105b1a: 55 push %ebp
80105b1b: 89 e5 mov %esp,%ebp
80105b1d: 83 ec 48 sub $0x48,%esp
struct inode *ip, *dp;
struct dirent de;
char name[DIRSIZ], *path;
uint off;
if(argstr(0, &path) < 0)
80105b20: 8d 45 cc lea -0x34(%ebp),%eax
80105b23: 89 44 24 04 mov %eax,0x4(%esp)
80105b27: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105b2e: e8 74 fa ff ff call 801055a7 <argstr>
80105b33: 85 c0 test %eax,%eax
80105b35: 79 0a jns 80105b41 <sys_unlink+0x27>
return -1;
80105b37: b8 ff ff ff ff mov $0xffffffff,%eax
80105b3c: e9 aa 01 00 00 jmp 80105ceb <sys_unlink+0x1d1>
if((dp = nameiparent(path, name)) == 0)
80105b41: 8b 45 cc mov -0x34(%ebp),%eax
80105b44: 8d 55 d2 lea -0x2e(%ebp),%edx
80105b47: 89 54 24 04 mov %edx,0x4(%esp)
80105b4b: 89 04 24 mov %eax,(%esp)
80105b4e: e8 f2 c8 ff ff call 80102445 <nameiparent>
80105b53: 89 45 f4 mov %eax,-0xc(%ebp)
80105b56: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80105b5a: 75 0a jne 80105b66 <sys_unlink+0x4c>
return -1;
80105b5c: b8 ff ff ff ff mov $0xffffffff,%eax
80105b61: e9 85 01 00 00 jmp 80105ceb <sys_unlink+0x1d1>
begin_trans();
80105b66: e8 a7 d6 ff ff call 80103212 <begin_trans>
ilock(dp);
80105b6b: 8b 45 f4 mov -0xc(%ebp),%eax
80105b6e: 89 04 24 mov %eax,(%esp)
80105b71: e8 05 bd ff ff call 8010187b <ilock>
// Cannot unlink "." or "..".
if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0)
80105b76: c7 44 24 04 3d 8a 10 movl $0x80108a3d,0x4(%esp)
80105b7d: 80
80105b7e: 8d 45 d2 lea -0x2e(%ebp),%eax
80105b81: 89 04 24 mov %eax,(%esp)
80105b84: e8 ef c4 ff ff call 80102078 <namecmp>
80105b89: 85 c0 test %eax,%eax
80105b8b: 0f 84 45 01 00 00 je 80105cd6 <sys_unlink+0x1bc>
80105b91: c7 44 24 04 3f 8a 10 movl $0x80108a3f,0x4(%esp)
80105b98: 80
80105b99: 8d 45 d2 lea -0x2e(%ebp),%eax
80105b9c: 89 04 24 mov %eax,(%esp)
80105b9f: e8 d4 c4 ff ff call 80102078 <namecmp>
80105ba4: 85 c0 test %eax,%eax
80105ba6: 0f 84 2a 01 00 00 je 80105cd6 <sys_unlink+0x1bc>
goto bad;
if((ip = dirlookup(dp, name, &off)) == 0)
80105bac: 8d 45 c8 lea -0x38(%ebp),%eax
80105baf: 89 44 24 08 mov %eax,0x8(%esp)
80105bb3: 8d 45 d2 lea -0x2e(%ebp),%eax
80105bb6: 89 44 24 04 mov %eax,0x4(%esp)
80105bba: 8b 45 f4 mov -0xc(%ebp),%eax
80105bbd: 89 04 24 mov %eax,(%esp)
80105bc0: e8 d5 c4 ff ff call 8010209a <dirlookup>
80105bc5: 89 45 f0 mov %eax,-0x10(%ebp)
80105bc8: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80105bcc: 0f 84 03 01 00 00 je 80105cd5 <sys_unlink+0x1bb>
goto bad;
ilock(ip);
80105bd2: 8b 45 f0 mov -0x10(%ebp),%eax
80105bd5: 89 04 24 mov %eax,(%esp)
80105bd8: e8 9e bc ff ff call 8010187b <ilock>
if(ip->nlink < 1)
80105bdd: 8b 45 f0 mov -0x10(%ebp),%eax
80105be0: 0f b7 40 16 movzwl 0x16(%eax),%eax
80105be4: 66 85 c0 test %ax,%ax
80105be7: 7f 0c jg 80105bf5 <sys_unlink+0xdb>
panic("unlink: nlink < 1");
80105be9: c7 04 24 42 8a 10 80 movl $0x80108a42,(%esp)
80105bf0: e8 45 a9 ff ff call 8010053a <panic>
if(ip->type == T_DIR && !isdirempty(ip)){
80105bf5: 8b 45 f0 mov -0x10(%ebp),%eax
80105bf8: 0f b7 40 10 movzwl 0x10(%eax),%eax
80105bfc: 66 83 f8 01 cmp $0x1,%ax
80105c00: 75 1f jne 80105c21 <sys_unlink+0x107>
80105c02: 8b 45 f0 mov -0x10(%ebp),%eax
80105c05: 89 04 24 mov %eax,(%esp)
80105c08: e8 9f fe ff ff call 80105aac <isdirempty>
80105c0d: 85 c0 test %eax,%eax
80105c0f: 75 10 jne 80105c21 <sys_unlink+0x107>
iunlockput(ip);
80105c11: 8b 45 f0 mov -0x10(%ebp),%eax
80105c14: 89 04 24 mov %eax,(%esp)
80105c17: e8 e6 be ff ff call 80101b02 <iunlockput>
goto bad;
80105c1c: e9 b5 00 00 00 jmp 80105cd6 <sys_unlink+0x1bc>
}
memset(&de, 0, sizeof(de));
80105c21: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80105c28: 00
80105c29: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80105c30: 00
80105c31: 8d 45 e0 lea -0x20(%ebp),%eax
80105c34: 89 04 24 mov %eax,(%esp)
80105c37: e8 7e f5 ff ff call 801051ba <memset>
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80105c3c: 8b 55 c8 mov -0x38(%ebp),%edx
80105c3f: 8d 45 e0 lea -0x20(%ebp),%eax
80105c42: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80105c49: 00
80105c4a: 89 54 24 08 mov %edx,0x8(%esp)
80105c4e: 89 44 24 04 mov %eax,0x4(%esp)
80105c52: 8b 45 f4 mov -0xc(%ebp),%eax
80105c55: 89 04 24 mov %eax,(%esp)
80105c58: e8 83 c2 ff ff call 80101ee0 <writei>
80105c5d: 83 f8 10 cmp $0x10,%eax
80105c60: 74 0c je 80105c6e <sys_unlink+0x154>
panic("unlink: writei");
80105c62: c7 04 24 54 8a 10 80 movl $0x80108a54,(%esp)
80105c69: e8 cc a8 ff ff call 8010053a <panic>
if(ip->type == T_DIR){
80105c6e: 8b 45 f0 mov -0x10(%ebp),%eax
80105c71: 0f b7 40 10 movzwl 0x10(%eax),%eax
80105c75: 66 83 f8 01 cmp $0x1,%ax
80105c79: 75 1c jne 80105c97 <sys_unlink+0x17d>
dp->nlink--;
80105c7b: 8b 45 f4 mov -0xc(%ebp),%eax
80105c7e: 0f b7 40 16 movzwl 0x16(%eax),%eax
80105c82: 8d 50 ff lea -0x1(%eax),%edx
80105c85: 8b 45 f4 mov -0xc(%ebp),%eax
80105c88: 66 89 50 16 mov %dx,0x16(%eax)
iupdate(dp);
80105c8c: 8b 45 f4 mov -0xc(%ebp),%eax
80105c8f: 89 04 24 mov %eax,(%esp)
80105c92: e8 24 ba ff ff call 801016bb <iupdate>
}
iunlockput(dp);
80105c97: 8b 45 f4 mov -0xc(%ebp),%eax
80105c9a: 89 04 24 mov %eax,(%esp)
80105c9d: e8 60 be ff ff call 80101b02 <iunlockput>
ip->nlink--;
80105ca2: 8b 45 f0 mov -0x10(%ebp),%eax
80105ca5: 0f b7 40 16 movzwl 0x16(%eax),%eax
80105ca9: 8d 50 ff lea -0x1(%eax),%edx
80105cac: 8b 45 f0 mov -0x10(%ebp),%eax
80105caf: 66 89 50 16 mov %dx,0x16(%eax)
iupdate(ip);
80105cb3: 8b 45 f0 mov -0x10(%ebp),%eax
80105cb6: 89 04 24 mov %eax,(%esp)
80105cb9: e8 fd b9 ff ff call 801016bb <iupdate>
iunlockput(ip);
80105cbe: 8b 45 f0 mov -0x10(%ebp),%eax
80105cc1: 89 04 24 mov %eax,(%esp)
80105cc4: e8 39 be ff ff call 80101b02 <iunlockput>
commit_trans();
80105cc9: e8 8d d5 ff ff call 8010325b <commit_trans>
return 0;
80105cce: b8 00 00 00 00 mov $0x0,%eax
80105cd3: eb 16 jmp 80105ceb <sys_unlink+0x1d1>
// Cannot unlink "." or "..".
if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0)
goto bad;
if((ip = dirlookup(dp, name, &off)) == 0)
goto bad;
80105cd5: 90 nop
commit_trans();
return 0;
bad:
iunlockput(dp);
80105cd6: 8b 45 f4 mov -0xc(%ebp),%eax
80105cd9: 89 04 24 mov %eax,(%esp)
80105cdc: e8 21 be ff ff call 80101b02 <iunlockput>
commit_trans();
80105ce1: e8 75 d5 ff ff call 8010325b <commit_trans>
return -1;
80105ce6: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105ceb: c9 leave
80105cec: c3 ret
80105ced <create>:
static struct inode*
create(char *path, short type, short major, short minor)
{
80105ced: 55 push %ebp
80105cee: 89 e5 mov %esp,%ebp
80105cf0: 83 ec 48 sub $0x48,%esp
80105cf3: 8b 4d 0c mov 0xc(%ebp),%ecx
80105cf6: 8b 55 10 mov 0x10(%ebp),%edx
80105cf9: 8b 45 14 mov 0x14(%ebp),%eax
80105cfc: 66 89 4d d4 mov %cx,-0x2c(%ebp)
80105d00: 66 89 55 d0 mov %dx,-0x30(%ebp)
80105d04: 66 89 45 cc mov %ax,-0x34(%ebp)
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
80105d08: 8d 45 de lea -0x22(%ebp),%eax
80105d0b: 89 44 24 04 mov %eax,0x4(%esp)
80105d0f: 8b 45 08 mov 0x8(%ebp),%eax
80105d12: 89 04 24 mov %eax,(%esp)
80105d15: e8 2b c7 ff ff call 80102445 <nameiparent>
80105d1a: 89 45 f4 mov %eax,-0xc(%ebp)
80105d1d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80105d21: 75 0a jne 80105d2d <create+0x40>
return 0;
80105d23: b8 00 00 00 00 mov $0x0,%eax
80105d28: e9 7e 01 00 00 jmp 80105eab <create+0x1be>
ilock(dp);
80105d2d: 8b 45 f4 mov -0xc(%ebp),%eax
80105d30: 89 04 24 mov %eax,(%esp)
80105d33: e8 43 bb ff ff call 8010187b <ilock>
if((ip = dirlookup(dp, name, &off)) != 0){
80105d38: 8d 45 ec lea -0x14(%ebp),%eax
80105d3b: 89 44 24 08 mov %eax,0x8(%esp)
80105d3f: 8d 45 de lea -0x22(%ebp),%eax
80105d42: 89 44 24 04 mov %eax,0x4(%esp)
80105d46: 8b 45 f4 mov -0xc(%ebp),%eax
80105d49: 89 04 24 mov %eax,(%esp)
80105d4c: e8 49 c3 ff ff call 8010209a <dirlookup>
80105d51: 89 45 f0 mov %eax,-0x10(%ebp)
80105d54: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80105d58: 74 47 je 80105da1 <create+0xb4>
iunlockput(dp);
80105d5a: 8b 45 f4 mov -0xc(%ebp),%eax
80105d5d: 89 04 24 mov %eax,(%esp)
80105d60: e8 9d bd ff ff call 80101b02 <iunlockput>
ilock(ip);
80105d65: 8b 45 f0 mov -0x10(%ebp),%eax
80105d68: 89 04 24 mov %eax,(%esp)
80105d6b: e8 0b bb ff ff call 8010187b <ilock>
if(type == T_FILE && ip->type == T_FILE)
80105d70: 66 83 7d d4 02 cmpw $0x2,-0x2c(%ebp)
80105d75: 75 15 jne 80105d8c <create+0x9f>
80105d77: 8b 45 f0 mov -0x10(%ebp),%eax
80105d7a: 0f b7 40 10 movzwl 0x10(%eax),%eax
80105d7e: 66 83 f8 02 cmp $0x2,%ax
80105d82: 75 08 jne 80105d8c <create+0x9f>
return ip;
80105d84: 8b 45 f0 mov -0x10(%ebp),%eax
80105d87: e9 1f 01 00 00 jmp 80105eab <create+0x1be>
iunlockput(ip);
80105d8c: 8b 45 f0 mov -0x10(%ebp),%eax
80105d8f: 89 04 24 mov %eax,(%esp)
80105d92: e8 6b bd ff ff call 80101b02 <iunlockput>
return 0;
80105d97: b8 00 00 00 00 mov $0x0,%eax
80105d9c: e9 0a 01 00 00 jmp 80105eab <create+0x1be>
}
if((ip = ialloc(dp->dev, type)) == 0)
80105da1: 0f bf 55 d4 movswl -0x2c(%ebp),%edx
80105da5: 8b 45 f4 mov -0xc(%ebp),%eax
80105da8: 8b 00 mov (%eax),%eax
80105daa: 89 54 24 04 mov %edx,0x4(%esp)
80105dae: 89 04 24 mov %eax,(%esp)
80105db1: e8 28 b8 ff ff call 801015de <ialloc>
80105db6: 89 45 f0 mov %eax,-0x10(%ebp)
80105db9: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80105dbd: 75 0c jne 80105dcb <create+0xde>
panic("create: ialloc");
80105dbf: c7 04 24 63 8a 10 80 movl $0x80108a63,(%esp)
80105dc6: e8 6f a7 ff ff call 8010053a <panic>
ilock(ip);
80105dcb: 8b 45 f0 mov -0x10(%ebp),%eax
80105dce: 89 04 24 mov %eax,(%esp)
80105dd1: e8 a5 ba ff ff call 8010187b <ilock>
ip->major = major;
80105dd6: 8b 45 f0 mov -0x10(%ebp),%eax
80105dd9: 0f b7 55 d0 movzwl -0x30(%ebp),%edx
80105ddd: 66 89 50 12 mov %dx,0x12(%eax)
ip->minor = minor;
80105de1: 8b 45 f0 mov -0x10(%ebp),%eax
80105de4: 0f b7 55 cc movzwl -0x34(%ebp),%edx
80105de8: 66 89 50 14 mov %dx,0x14(%eax)
ip->nlink = 1;
80105dec: 8b 45 f0 mov -0x10(%ebp),%eax
80105def: 66 c7 40 16 01 00 movw $0x1,0x16(%eax)
iupdate(ip);
80105df5: 8b 45 f0 mov -0x10(%ebp),%eax
80105df8: 89 04 24 mov %eax,(%esp)
80105dfb: e8 bb b8 ff ff call 801016bb <iupdate>
if(type == T_DIR){ // Create . and .. entries.
80105e00: 66 83 7d d4 01 cmpw $0x1,-0x2c(%ebp)
80105e05: 75 6a jne 80105e71 <create+0x184>
dp->nlink++; // for ".."
80105e07: 8b 45 f4 mov -0xc(%ebp),%eax
80105e0a: 0f b7 40 16 movzwl 0x16(%eax),%eax
80105e0e: 8d 50 01 lea 0x1(%eax),%edx
80105e11: 8b 45 f4 mov -0xc(%ebp),%eax
80105e14: 66 89 50 16 mov %dx,0x16(%eax)
iupdate(dp);
80105e18: 8b 45 f4 mov -0xc(%ebp),%eax
80105e1b: 89 04 24 mov %eax,(%esp)
80105e1e: e8 98 b8 ff ff call 801016bb <iupdate>
// No ip->nlink++ for ".": avoid cyclic ref count.
if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
80105e23: 8b 45 f0 mov -0x10(%ebp),%eax
80105e26: 8b 40 04 mov 0x4(%eax),%eax
80105e29: 89 44 24 08 mov %eax,0x8(%esp)
80105e2d: c7 44 24 04 3d 8a 10 movl $0x80108a3d,0x4(%esp)
80105e34: 80
80105e35: 8b 45 f0 mov -0x10(%ebp),%eax
80105e38: 89 04 24 mov %eax,(%esp)
80105e3b: e8 22 c3 ff ff call 80102162 <dirlink>
80105e40: 85 c0 test %eax,%eax
80105e42: 78 21 js 80105e65 <create+0x178>
80105e44: 8b 45 f4 mov -0xc(%ebp),%eax
80105e47: 8b 40 04 mov 0x4(%eax),%eax
80105e4a: 89 44 24 08 mov %eax,0x8(%esp)
80105e4e: c7 44 24 04 3f 8a 10 movl $0x80108a3f,0x4(%esp)
80105e55: 80
80105e56: 8b 45 f0 mov -0x10(%ebp),%eax
80105e59: 89 04 24 mov %eax,(%esp)
80105e5c: e8 01 c3 ff ff call 80102162 <dirlink>
80105e61: 85 c0 test %eax,%eax
80105e63: 79 0c jns 80105e71 <create+0x184>
panic("create dots");
80105e65: c7 04 24 72 8a 10 80 movl $0x80108a72,(%esp)
80105e6c: e8 c9 a6 ff ff call 8010053a <panic>
}
if(dirlink(dp, name, ip->inum) < 0)
80105e71: 8b 45 f0 mov -0x10(%ebp),%eax
80105e74: 8b 40 04 mov 0x4(%eax),%eax
80105e77: 89 44 24 08 mov %eax,0x8(%esp)
80105e7b: 8d 45 de lea -0x22(%ebp),%eax
80105e7e: 89 44 24 04 mov %eax,0x4(%esp)
80105e82: 8b 45 f4 mov -0xc(%ebp),%eax
80105e85: 89 04 24 mov %eax,(%esp)
80105e88: e8 d5 c2 ff ff call 80102162 <dirlink>
80105e8d: 85 c0 test %eax,%eax
80105e8f: 79 0c jns 80105e9d <create+0x1b0>
panic("create: dirlink");
80105e91: c7 04 24 7e 8a 10 80 movl $0x80108a7e,(%esp)
80105e98: e8 9d a6 ff ff call 8010053a <panic>
iunlockput(dp);
80105e9d: 8b 45 f4 mov -0xc(%ebp),%eax
80105ea0: 89 04 24 mov %eax,(%esp)
80105ea3: e8 5a bc ff ff call 80101b02 <iunlockput>
return ip;
80105ea8: 8b 45 f0 mov -0x10(%ebp),%eax
}
80105eab: c9 leave
80105eac: c3 ret
80105ead <sys_open>:
int
sys_open(void)
{
80105ead: 55 push %ebp
80105eae: 89 e5 mov %esp,%ebp
80105eb0: 83 ec 38 sub $0x38,%esp
char *path;
int fd, omode;
struct file *f;
struct inode *ip;
if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
80105eb3: 8d 45 e8 lea -0x18(%ebp),%eax
80105eb6: 89 44 24 04 mov %eax,0x4(%esp)
80105eba: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105ec1: e8 e1 f6 ff ff call 801055a7 <argstr>
80105ec6: 85 c0 test %eax,%eax
80105ec8: 78 17 js 80105ee1 <sys_open+0x34>
80105eca: 8d 45 e4 lea -0x1c(%ebp),%eax
80105ecd: 89 44 24 04 mov %eax,0x4(%esp)
80105ed1: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80105ed8: e8 39 f6 ff ff call 80105516 <argint>
80105edd: 85 c0 test %eax,%eax
80105edf: 79 0a jns 80105eeb <sys_open+0x3e>
return -1;
80105ee1: b8 ff ff ff ff mov $0xffffffff,%eax
80105ee6: e9 46 01 00 00 jmp 80106031 <sys_open+0x184>
if(omode & O_CREATE){
80105eeb: 8b 45 e4 mov -0x1c(%ebp),%eax
80105eee: 25 00 02 00 00 and $0x200,%eax
80105ef3: 85 c0 test %eax,%eax
80105ef5: 74 40 je 80105f37 <sys_open+0x8a>
begin_trans();
80105ef7: e8 16 d3 ff ff call 80103212 <begin_trans>
ip = create(path, T_FILE, 0, 0);
80105efc: 8b 45 e8 mov -0x18(%ebp),%eax
80105eff: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
80105f06: 00
80105f07: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80105f0e: 00
80105f0f: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp)
80105f16: 00
80105f17: 89 04 24 mov %eax,(%esp)
80105f1a: e8 ce fd ff ff call 80105ced <create>
80105f1f: 89 45 f4 mov %eax,-0xc(%ebp)
commit_trans();
80105f22: e8 34 d3 ff ff call 8010325b <commit_trans>
if(ip == 0)
80105f27: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80105f2b: 75 5c jne 80105f89 <sys_open+0xdc>
return -1;
80105f2d: b8 ff ff ff ff mov $0xffffffff,%eax
80105f32: e9 fa 00 00 00 jmp 80106031 <sys_open+0x184>
} else {
if((ip = namei(path)) == 0)
80105f37: 8b 45 e8 mov -0x18(%ebp),%eax
80105f3a: 89 04 24 mov %eax,(%esp)
80105f3d: e8 e1 c4 ff ff call 80102423 <namei>
80105f42: 89 45 f4 mov %eax,-0xc(%ebp)
80105f45: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80105f49: 75 0a jne 80105f55 <sys_open+0xa8>
return -1;
80105f4b: b8 ff ff ff ff mov $0xffffffff,%eax
80105f50: e9 dc 00 00 00 jmp 80106031 <sys_open+0x184>
ilock(ip);
80105f55: 8b 45 f4 mov -0xc(%ebp),%eax
80105f58: 89 04 24 mov %eax,(%esp)
80105f5b: e8 1b b9 ff ff call 8010187b <ilock>
if(ip->type == T_DIR && omode != O_RDONLY){
80105f60: 8b 45 f4 mov -0xc(%ebp),%eax
80105f63: 0f b7 40 10 movzwl 0x10(%eax),%eax
80105f67: 66 83 f8 01 cmp $0x1,%ax
80105f6b: 75 1c jne 80105f89 <sys_open+0xdc>
80105f6d: 8b 45 e4 mov -0x1c(%ebp),%eax
80105f70: 85 c0 test %eax,%eax
80105f72: 74 15 je 80105f89 <sys_open+0xdc>
iunlockput(ip);
80105f74: 8b 45 f4 mov -0xc(%ebp),%eax
80105f77: 89 04 24 mov %eax,(%esp)
80105f7a: e8 83 bb ff ff call 80101b02 <iunlockput>
return -1;
80105f7f: b8 ff ff ff ff mov $0xffffffff,%eax
80105f84: e9 a8 00 00 00 jmp 80106031 <sys_open+0x184>
}
}
if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
80105f89: e8 96 af ff ff call 80100f24 <filealloc>
80105f8e: 89 45 f0 mov %eax,-0x10(%ebp)
80105f91: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80105f95: 74 14 je 80105fab <sys_open+0xfe>
80105f97: 8b 45 f0 mov -0x10(%ebp),%eax
80105f9a: 89 04 24 mov %eax,(%esp)
80105f9d: e8 43 f7 ff ff call 801056e5 <fdalloc>
80105fa2: 89 45 ec mov %eax,-0x14(%ebp)
80105fa5: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80105fa9: 79 23 jns 80105fce <sys_open+0x121>
if(f)
80105fab: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80105faf: 74 0b je 80105fbc <sys_open+0x10f>
fileclose(f);
80105fb1: 8b 45 f0 mov -0x10(%ebp),%eax
80105fb4: 89 04 24 mov %eax,(%esp)
80105fb7: e8 11 b0 ff ff call 80100fcd <fileclose>
iunlockput(ip);
80105fbc: 8b 45 f4 mov -0xc(%ebp),%eax
80105fbf: 89 04 24 mov %eax,(%esp)
80105fc2: e8 3b bb ff ff call 80101b02 <iunlockput>
return -1;
80105fc7: b8 ff ff ff ff mov $0xffffffff,%eax
80105fcc: eb 63 jmp 80106031 <sys_open+0x184>
}
iunlock(ip);
80105fce: 8b 45 f4 mov -0xc(%ebp),%eax
80105fd1: 89 04 24 mov %eax,(%esp)
80105fd4: e8 f3 b9 ff ff call 801019cc <iunlock>
f->type = FD_INODE;
80105fd9: 8b 45 f0 mov -0x10(%ebp),%eax
80105fdc: c7 00 02 00 00 00 movl $0x2,(%eax)
f->ip = ip;
80105fe2: 8b 45 f0 mov -0x10(%ebp),%eax
80105fe5: 8b 55 f4 mov -0xc(%ebp),%edx
80105fe8: 89 50 10 mov %edx,0x10(%eax)
f->off = 0;
80105feb: 8b 45 f0 mov -0x10(%ebp),%eax
80105fee: c7 40 14 00 00 00 00 movl $0x0,0x14(%eax)
f->readable = !(omode & O_WRONLY);
80105ff5: 8b 45 e4 mov -0x1c(%ebp),%eax
80105ff8: 83 e0 01 and $0x1,%eax
80105ffb: 85 c0 test %eax,%eax
80105ffd: 0f 94 c2 sete %dl
80106000: 8b 45 f0 mov -0x10(%ebp),%eax
80106003: 88 50 08 mov %dl,0x8(%eax)
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80106006: 8b 45 e4 mov -0x1c(%ebp),%eax
80106009: 83 e0 01 and $0x1,%eax
8010600c: 84 c0 test %al,%al
8010600e: 75 0a jne 8010601a <sys_open+0x16d>
80106010: 8b 45 e4 mov -0x1c(%ebp),%eax
80106013: 83 e0 02 and $0x2,%eax
80106016: 85 c0 test %eax,%eax
80106018: 74 07 je 80106021 <sys_open+0x174>
8010601a: b8 01 00 00 00 mov $0x1,%eax
8010601f: eb 05 jmp 80106026 <sys_open+0x179>
80106021: b8 00 00 00 00 mov $0x0,%eax
80106026: 89 c2 mov %eax,%edx
80106028: 8b 45 f0 mov -0x10(%ebp),%eax
8010602b: 88 50 09 mov %dl,0x9(%eax)
return fd;
8010602e: 8b 45 ec mov -0x14(%ebp),%eax
}
80106031: c9 leave
80106032: c3 ret
80106033 <sys_mkdir>:
int
sys_mkdir(void)
{
80106033: 55 push %ebp
80106034: 89 e5 mov %esp,%ebp
80106036: 83 ec 28 sub $0x28,%esp
char *path;
struct inode *ip;
begin_trans();
80106039: e8 d4 d1 ff ff call 80103212 <begin_trans>
if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
8010603e: 8d 45 f0 lea -0x10(%ebp),%eax
80106041: 89 44 24 04 mov %eax,0x4(%esp)
80106045: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010604c: e8 56 f5 ff ff call 801055a7 <argstr>
80106051: 85 c0 test %eax,%eax
80106053: 78 2c js 80106081 <sys_mkdir+0x4e>
80106055: 8b 45 f0 mov -0x10(%ebp),%eax
80106058: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
8010605f: 00
80106060: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80106067: 00
80106068: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
8010606f: 00
80106070: 89 04 24 mov %eax,(%esp)
80106073: e8 75 fc ff ff call 80105ced <create>
80106078: 89 45 f4 mov %eax,-0xc(%ebp)
8010607b: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8010607f: 75 0c jne 8010608d <sys_mkdir+0x5a>
commit_trans();
80106081: e8 d5 d1 ff ff call 8010325b <commit_trans>
return -1;
80106086: b8 ff ff ff ff mov $0xffffffff,%eax
8010608b: eb 15 jmp 801060a2 <sys_mkdir+0x6f>
}
iunlockput(ip);
8010608d: 8b 45 f4 mov -0xc(%ebp),%eax
80106090: 89 04 24 mov %eax,(%esp)
80106093: e8 6a ba ff ff call 80101b02 <iunlockput>
commit_trans();
80106098: e8 be d1 ff ff call 8010325b <commit_trans>
return 0;
8010609d: b8 00 00 00 00 mov $0x0,%eax
}
801060a2: c9 leave
801060a3: c3 ret
801060a4 <sys_mknod>:
int
sys_mknod(void)
{
801060a4: 55 push %ebp
801060a5: 89 e5 mov %esp,%ebp
801060a7: 83 ec 38 sub $0x38,%esp
struct inode *ip;
char *path;
int len;
int major, minor;
begin_trans();
801060aa: e8 63 d1 ff ff call 80103212 <begin_trans>
if((len=argstr(0, &path)) < 0 ||
801060af: 8d 45 ec lea -0x14(%ebp),%eax
801060b2: 89 44 24 04 mov %eax,0x4(%esp)
801060b6: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801060bd: e8 e5 f4 ff ff call 801055a7 <argstr>
801060c2: 89 45 f4 mov %eax,-0xc(%ebp)
801060c5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801060c9: 78 5e js 80106129 <sys_mknod+0x85>
argint(1, &major) < 0 ||
801060cb: 8d 45 e8 lea -0x18(%ebp),%eax
801060ce: 89 44 24 04 mov %eax,0x4(%esp)
801060d2: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801060d9: e8 38 f4 ff ff call 80105516 <argint>
char *path;
int len;
int major, minor;
begin_trans();
if((len=argstr(0, &path)) < 0 ||
801060de: 85 c0 test %eax,%eax
801060e0: 78 47 js 80106129 <sys_mknod+0x85>
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
801060e2: 8d 45 e4 lea -0x1c(%ebp),%eax
801060e5: 89 44 24 04 mov %eax,0x4(%esp)
801060e9: c7 04 24 02 00 00 00 movl $0x2,(%esp)
801060f0: e8 21 f4 ff ff call 80105516 <argint>
char *path;
int len;
int major, minor;
begin_trans();
if((len=argstr(0, &path)) < 0 ||
801060f5: 85 c0 test %eax,%eax
801060f7: 78 30 js 80106129 <sys_mknod+0x85>
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
(ip = create(path, T_DEV, major, minor)) == 0){
801060f9: 8b 45 e4 mov -0x1c(%ebp),%eax
801060fc: 0f bf c8 movswl %ax,%ecx
801060ff: 8b 45 e8 mov -0x18(%ebp),%eax
80106102: 0f bf d0 movswl %ax,%edx
80106105: 8b 45 ec mov -0x14(%ebp),%eax
80106108: 89 4c 24 0c mov %ecx,0xc(%esp)
8010610c: 89 54 24 08 mov %edx,0x8(%esp)
80106110: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
80106117: 00
80106118: 89 04 24 mov %eax,(%esp)
8010611b: e8 cd fb ff ff call 80105ced <create>
char *path;
int len;
int major, minor;
begin_trans();
if((len=argstr(0, &path)) < 0 ||
80106120: 89 45 f0 mov %eax,-0x10(%ebp)
80106123: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80106127: 75 0c jne 80106135 <sys_mknod+0x91>
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
(ip = create(path, T_DEV, major, minor)) == 0){
commit_trans();
80106129: e8 2d d1 ff ff call 8010325b <commit_trans>
return -1;
8010612e: b8 ff ff ff ff mov $0xffffffff,%eax
80106133: eb 15 jmp 8010614a <sys_mknod+0xa6>
}
iunlockput(ip);
80106135: 8b 45 f0 mov -0x10(%ebp),%eax
80106138: 89 04 24 mov %eax,(%esp)
8010613b: e8 c2 b9 ff ff call 80101b02 <iunlockput>
commit_trans();
80106140: e8 16 d1 ff ff call 8010325b <commit_trans>
return 0;
80106145: b8 00 00 00 00 mov $0x0,%eax
}
8010614a: c9 leave
8010614b: c3 ret
8010614c <sys_chdir>:
int
sys_chdir(void)
{
8010614c: 55 push %ebp
8010614d: 89 e5 mov %esp,%ebp
8010614f: 83 ec 28 sub $0x28,%esp
char *path;
struct inode *ip;
if(argstr(0, &path) < 0 || (ip = namei(path)) == 0)
80106152: 8d 45 f0 lea -0x10(%ebp),%eax
80106155: 89 44 24 04 mov %eax,0x4(%esp)
80106159: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80106160: e8 42 f4 ff ff call 801055a7 <argstr>
80106165: 85 c0 test %eax,%eax
80106167: 78 14 js 8010617d <sys_chdir+0x31>
80106169: 8b 45 f0 mov -0x10(%ebp),%eax
8010616c: 89 04 24 mov %eax,(%esp)
8010616f: e8 af c2 ff ff call 80102423 <namei>
80106174: 89 45 f4 mov %eax,-0xc(%ebp)
80106177: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8010617b: 75 07 jne 80106184 <sys_chdir+0x38>
return -1;
8010617d: b8 ff ff ff ff mov $0xffffffff,%eax
80106182: eb 57 jmp 801061db <sys_chdir+0x8f>
ilock(ip);
80106184: 8b 45 f4 mov -0xc(%ebp),%eax
80106187: 89 04 24 mov %eax,(%esp)
8010618a: e8 ec b6 ff ff call 8010187b <ilock>
if(ip->type != T_DIR){
8010618f: 8b 45 f4 mov -0xc(%ebp),%eax
80106192: 0f b7 40 10 movzwl 0x10(%eax),%eax
80106196: 66 83 f8 01 cmp $0x1,%ax
8010619a: 74 12 je 801061ae <sys_chdir+0x62>
iunlockput(ip);
8010619c: 8b 45 f4 mov -0xc(%ebp),%eax
8010619f: 89 04 24 mov %eax,(%esp)
801061a2: e8 5b b9 ff ff call 80101b02 <iunlockput>
return -1;
801061a7: b8 ff ff ff ff mov $0xffffffff,%eax
801061ac: eb 2d jmp 801061db <sys_chdir+0x8f>
}
iunlock(ip);
801061ae: 8b 45 f4 mov -0xc(%ebp),%eax
801061b1: 89 04 24 mov %eax,(%esp)
801061b4: e8 13 b8 ff ff call 801019cc <iunlock>
iput(proc->cwd);
801061b9: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801061bf: 8b 40 68 mov 0x68(%eax),%eax
801061c2: 89 04 24 mov %eax,(%esp)
801061c5: e8 67 b8 ff ff call 80101a31 <iput>
proc->cwd = ip;
801061ca: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801061d0: 8b 55 f4 mov -0xc(%ebp),%edx
801061d3: 89 50 68 mov %edx,0x68(%eax)
return 0;
801061d6: b8 00 00 00 00 mov $0x0,%eax
}
801061db: c9 leave
801061dc: c3 ret
801061dd <sys_exec>:
int
sys_exec(void)
{
801061dd: 55 push %ebp
801061de: 89 e5 mov %esp,%ebp
801061e0: 81 ec a8 00 00 00 sub $0xa8,%esp
char *path, *argv[MAXARG];
int i;
uint uargv, uarg;
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
801061e6: 8d 45 f0 lea -0x10(%ebp),%eax
801061e9: 89 44 24 04 mov %eax,0x4(%esp)
801061ed: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801061f4: e8 ae f3 ff ff call 801055a7 <argstr>
801061f9: 85 c0 test %eax,%eax
801061fb: 78 1a js 80106217 <sys_exec+0x3a>
801061fd: 8d 85 6c ff ff ff lea -0x94(%ebp),%eax
80106203: 89 44 24 04 mov %eax,0x4(%esp)
80106207: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010620e: e8 03 f3 ff ff call 80105516 <argint>
80106213: 85 c0 test %eax,%eax
80106215: 79 0a jns 80106221 <sys_exec+0x44>
return -1;
80106217: b8 ff ff ff ff mov $0xffffffff,%eax
8010621c: e9 cd 00 00 00 jmp 801062ee <sys_exec+0x111>
}
memset(argv, 0, sizeof(argv));
80106221: c7 44 24 08 80 00 00 movl $0x80,0x8(%esp)
80106228: 00
80106229: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106230: 00
80106231: 8d 85 70 ff ff ff lea -0x90(%ebp),%eax
80106237: 89 04 24 mov %eax,(%esp)
8010623a: e8 7b ef ff ff call 801051ba <memset>
for(i=0;; i++){
8010623f: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
if(i >= NELEM(argv))
80106246: 8b 45 f4 mov -0xc(%ebp),%eax
80106249: 83 f8 1f cmp $0x1f,%eax
8010624c: 76 0a jbe 80106258 <sys_exec+0x7b>
return -1;
8010624e: b8 ff ff ff ff mov $0xffffffff,%eax
80106253: e9 96 00 00 00 jmp 801062ee <sys_exec+0x111>
if(fetchint(uargv+4*i, (int*)&uarg) < 0)
80106258: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
8010625e: 8b 55 f4 mov -0xc(%ebp),%edx
80106261: c1 e2 02 shl $0x2,%edx
80106264: 89 d1 mov %edx,%ecx
80106266: 8b 95 6c ff ff ff mov -0x94(%ebp),%edx
8010626c: 8d 14 11 lea (%ecx,%edx,1),%edx
8010626f: 89 44 24 04 mov %eax,0x4(%esp)
80106273: 89 14 24 mov %edx,(%esp)
80106276: e8 fd f1 ff ff call 80105478 <fetchint>
8010627b: 85 c0 test %eax,%eax
8010627d: 79 07 jns 80106286 <sys_exec+0xa9>
return -1;
8010627f: b8 ff ff ff ff mov $0xffffffff,%eax
80106284: eb 68 jmp 801062ee <sys_exec+0x111>
if(uarg == 0){
80106286: 8b 85 68 ff ff ff mov -0x98(%ebp),%eax
8010628c: 85 c0 test %eax,%eax
8010628e: 75 26 jne 801062b6 <sys_exec+0xd9>
argv[i] = 0;
80106290: 8b 45 f4 mov -0xc(%ebp),%eax
80106293: c7 84 85 70 ff ff ff movl $0x0,-0x90(%ebp,%eax,4)
8010629a: 00 00 00 00
break;
8010629e: 90 nop
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
8010629f: 8b 45 f0 mov -0x10(%ebp),%eax
801062a2: 8d 95 70 ff ff ff lea -0x90(%ebp),%edx
801062a8: 89 54 24 04 mov %edx,0x4(%esp)
801062ac: 89 04 24 mov %eax,(%esp)
801062af: e8 44 a8 ff ff call 80100af8 <exec>
801062b4: eb 38 jmp 801062ee <sys_exec+0x111>
return -1;
if(uarg == 0){
argv[i] = 0;
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
801062b6: 8b 45 f4 mov -0xc(%ebp),%eax
801062b9: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
801062c0: 8d 85 70 ff ff ff lea -0x90(%ebp),%eax
801062c6: 01 d0 add %edx,%eax
801062c8: 8b 95 68 ff ff ff mov -0x98(%ebp),%edx
801062ce: 89 44 24 04 mov %eax,0x4(%esp)
801062d2: 89 14 24 mov %edx,(%esp)
801062d5: e8 d8 f1 ff ff call 801054b2 <fetchstr>
801062da: 85 c0 test %eax,%eax
801062dc: 79 07 jns 801062e5 <sys_exec+0x108>
return -1;
801062de: b8 ff ff ff ff mov $0xffffffff,%eax
801062e3: eb 09 jmp 801062ee <sys_exec+0x111>
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
return -1;
}
memset(argv, 0, sizeof(argv));
for(i=0;; i++){
801062e5: 83 45 f4 01 addl $0x1,-0xc(%ebp)
argv[i] = 0;
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
801062e9: e9 58 ff ff ff jmp 80106246 <sys_exec+0x69>
return exec(path, argv);
}
801062ee: c9 leave
801062ef: c3 ret
801062f0 <sys_pipe>:
int
sys_pipe(void)
{
801062f0: 55 push %ebp
801062f1: 89 e5 mov %esp,%ebp
801062f3: 83 ec 38 sub $0x38,%esp
int *fd;
struct file *rf, *wf;
int fd0, fd1;
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
801062f6: 8d 45 ec lea -0x14(%ebp),%eax
801062f9: c7 44 24 08 08 00 00 movl $0x8,0x8(%esp)
80106300: 00
80106301: 89 44 24 04 mov %eax,0x4(%esp)
80106305: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010630c: e8 34 f2 ff ff call 80105545 <argptr>
80106311: 85 c0 test %eax,%eax
80106313: 79 0a jns 8010631f <sys_pipe+0x2f>
return -1;
80106315: b8 ff ff ff ff mov $0xffffffff,%eax
8010631a: e9 9b 00 00 00 jmp 801063ba <sys_pipe+0xca>
if(pipealloc(&rf, &wf) < 0)
8010631f: 8d 45 e4 lea -0x1c(%ebp),%eax
80106322: 89 44 24 04 mov %eax,0x4(%esp)
80106326: 8d 45 e8 lea -0x18(%ebp),%eax
80106329: 89 04 24 mov %eax,(%esp)
8010632c: e8 d3 d8 ff ff call 80103c04 <pipealloc>
80106331: 85 c0 test %eax,%eax
80106333: 79 07 jns 8010633c <sys_pipe+0x4c>
return -1;
80106335: b8 ff ff ff ff mov $0xffffffff,%eax
8010633a: eb 7e jmp 801063ba <sys_pipe+0xca>
fd0 = -1;
8010633c: c7 45 f0 ff ff ff ff movl $0xffffffff,-0x10(%ebp)
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
80106343: 8b 45 e8 mov -0x18(%ebp),%eax
80106346: 89 04 24 mov %eax,(%esp)
80106349: e8 97 f3 ff ff call 801056e5 <fdalloc>
8010634e: 89 45 f0 mov %eax,-0x10(%ebp)
80106351: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80106355: 78 14 js 8010636b <sys_pipe+0x7b>
80106357: 8b 45 e4 mov -0x1c(%ebp),%eax
8010635a: 89 04 24 mov %eax,(%esp)
8010635d: e8 83 f3 ff ff call 801056e5 <fdalloc>
80106362: 89 45 f4 mov %eax,-0xc(%ebp)
80106365: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80106369: 79 37 jns 801063a2 <sys_pipe+0xb2>
if(fd0 >= 0)
8010636b: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
8010636f: 78 14 js 80106385 <sys_pipe+0x95>
proc->ofile[fd0] = 0;
80106371: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106377: 8b 55 f0 mov -0x10(%ebp),%edx
8010637a: 83 c2 08 add $0x8,%edx
8010637d: c7 44 90 08 00 00 00 movl $0x0,0x8(%eax,%edx,4)
80106384: 00
fileclose(rf);
80106385: 8b 45 e8 mov -0x18(%ebp),%eax
80106388: 89 04 24 mov %eax,(%esp)
8010638b: e8 3d ac ff ff call 80100fcd <fileclose>
fileclose(wf);
80106390: 8b 45 e4 mov -0x1c(%ebp),%eax
80106393: 89 04 24 mov %eax,(%esp)
80106396: e8 32 ac ff ff call 80100fcd <fileclose>
return -1;
8010639b: b8 ff ff ff ff mov $0xffffffff,%eax
801063a0: eb 18 jmp 801063ba <sys_pipe+0xca>
}
fd[0] = fd0;
801063a2: 8b 45 ec mov -0x14(%ebp),%eax
801063a5: 8b 55 f0 mov -0x10(%ebp),%edx
801063a8: 89 10 mov %edx,(%eax)
fd[1] = fd1;
801063aa: 8b 45 ec mov -0x14(%ebp),%eax
801063ad: 8d 50 04 lea 0x4(%eax),%edx
801063b0: 8b 45 f4 mov -0xc(%ebp),%eax
801063b3: 89 02 mov %eax,(%edx)
return 0;
801063b5: b8 00 00 00 00 mov $0x0,%eax
}
801063ba: c9 leave
801063bb: c3 ret
801063bc <sys_fork>:
#include "mmu.h"
#include "proc.h"
int
sys_fork(void)
{
801063bc: 55 push %ebp
801063bd: 89 e5 mov %esp,%ebp
801063bf: 83 ec 08 sub $0x8,%esp
return fork();
801063c2: e8 76 df ff ff call 8010433d <fork>
}
801063c7: c9 leave
801063c8: c3 ret
801063c9 <sys_clone>:
int
sys_clone(){
801063c9: 55 push %ebp
801063ca: 89 e5 mov %esp,%ebp
801063cc: 53 push %ebx
801063cd: 83 ec 24 sub $0x24,%esp
int stack;
int size;
int routine;
int arg;
if(argint(1,&size) < 0 || size <=0 || argint(0,&stack) <0 ||
801063d0: 8d 45 f0 lea -0x10(%ebp),%eax
801063d3: 89 44 24 04 mov %eax,0x4(%esp)
801063d7: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801063de: e8 33 f1 ff ff call 80105516 <argint>
801063e3: 85 c0 test %eax,%eax
801063e5: 78 4c js 80106433 <sys_clone+0x6a>
801063e7: 8b 45 f0 mov -0x10(%ebp),%eax
801063ea: 85 c0 test %eax,%eax
801063ec: 7e 45 jle 80106433 <sys_clone+0x6a>
801063ee: 8d 45 f4 lea -0xc(%ebp),%eax
801063f1: 89 44 24 04 mov %eax,0x4(%esp)
801063f5: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801063fc: e8 15 f1 ff ff call 80105516 <argint>
80106401: 85 c0 test %eax,%eax
80106403: 78 2e js 80106433 <sys_clone+0x6a>
argint(2,&routine) < 0 || argint(3,&arg)<0){
80106405: 8d 45 ec lea -0x14(%ebp),%eax
80106408: 89 44 24 04 mov %eax,0x4(%esp)
8010640c: c7 04 24 02 00 00 00 movl $0x2,(%esp)
80106413: e8 fe f0 ff ff call 80105516 <argint>
int stack;
int size;
int routine;
int arg;
if(argint(1,&size) < 0 || size <=0 || argint(0,&stack) <0 ||
80106418: 85 c0 test %eax,%eax
8010641a: 78 17 js 80106433 <sys_clone+0x6a>
argint(2,&routine) < 0 || argint(3,&arg)<0){
8010641c: 8d 45 e8 lea -0x18(%ebp),%eax
8010641f: 89 44 24 04 mov %eax,0x4(%esp)
80106423: c7 04 24 03 00 00 00 movl $0x3,(%esp)
8010642a: e8 e7 f0 ff ff call 80105516 <argint>
int stack;
int size;
int routine;
int arg;
if(argint(1,&size) < 0 || size <=0 || argint(0,&stack) <0 ||
8010642f: 85 c0 test %eax,%eax
80106431: 79 07 jns 8010643a <sys_clone+0x71>
argint(2,&routine) < 0 || argint(3,&arg)<0){
return -1;
80106433: b8 ff ff ff ff mov $0xffffffff,%eax
80106438: eb 20 jmp 8010645a <sys_clone+0x91>
}
return clone(stack,size,routine,arg);
8010643a: 8b 5d e8 mov -0x18(%ebp),%ebx
8010643d: 8b 4d ec mov -0x14(%ebp),%ecx
80106440: 8b 55 f0 mov -0x10(%ebp),%edx
80106443: 8b 45 f4 mov -0xc(%ebp),%eax
80106446: 89 5c 24 0c mov %ebx,0xc(%esp)
8010644a: 89 4c 24 08 mov %ecx,0x8(%esp)
8010644e: 89 54 24 04 mov %edx,0x4(%esp)
80106452: 89 04 24 mov %eax,(%esp)
80106455: e8 53 e0 ff ff call 801044ad <clone>
}
8010645a: 83 c4 24 add $0x24,%esp
8010645d: 5b pop %ebx
8010645e: 5d pop %ebp
8010645f: c3 ret
80106460 <sys_exit>:
int
sys_exit(void)
{
80106460: 55 push %ebp
80106461: 89 e5 mov %esp,%ebp
80106463: 83 ec 08 sub $0x8,%esp
exit();
80106466: e8 65 e2 ff ff call 801046d0 <exit>
return 0; // not reached
8010646b: b8 00 00 00 00 mov $0x0,%eax
}
80106470: c9 leave
80106471: c3 ret
80106472 <sys_texit>:
int
sys_texit(void)
{
80106472: 55 push %ebp
80106473: 89 e5 mov %esp,%ebp
80106475: 83 ec 08 sub $0x8,%esp
texit();
80106478: e8 6f e3 ff ff call 801047ec <texit>
return 0;
8010647d: b8 00 00 00 00 mov $0x0,%eax
}
80106482: c9 leave
80106483: c3 ret
80106484 <sys_wait>:
int
sys_wait(void)
{
80106484: 55 push %ebp
80106485: 89 e5 mov %esp,%ebp
80106487: 83 ec 08 sub $0x8,%esp
return wait();
8010648a: e8 2b e4 ff ff call 801048ba <wait>
}
8010648f: c9 leave
80106490: c3 ret
80106491 <sys_kill>:
int
sys_kill(void)
{
80106491: 55 push %ebp
80106492: 89 e5 mov %esp,%ebp
80106494: 83 ec 28 sub $0x28,%esp
int pid;
if(argint(0, &pid) < 0)
80106497: 8d 45 f4 lea -0xc(%ebp),%eax
8010649a: 89 44 24 04 mov %eax,0x4(%esp)
8010649e: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801064a5: e8 6c f0 ff ff call 80105516 <argint>
801064aa: 85 c0 test %eax,%eax
801064ac: 79 07 jns 801064b5 <sys_kill+0x24>
return -1;
801064ae: b8 ff ff ff ff mov $0xffffffff,%eax
801064b3: eb 0b jmp 801064c0 <sys_kill+0x2f>
return kill(pid);
801064b5: 8b 45 f4 mov -0xc(%ebp),%eax
801064b8: 89 04 24 mov %eax,(%esp)
801064bb: e8 a4 e8 ff ff call 80104d64 <kill>
}
801064c0: c9 leave
801064c1: c3 ret
801064c2 <sys_getpid>:
int
sys_getpid(void)
{
801064c2: 55 push %ebp
801064c3: 89 e5 mov %esp,%ebp
return proc->pid;
801064c5: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801064cb: 8b 40 10 mov 0x10(%eax),%eax
}
801064ce: 5d pop %ebp
801064cf: c3 ret
801064d0 <sys_sbrk>:
int
sys_sbrk(void)
{
801064d0: 55 push %ebp
801064d1: 89 e5 mov %esp,%ebp
801064d3: 83 ec 28 sub $0x28,%esp
int addr;
int n;
if(argint(0, &n) < 0)
801064d6: 8d 45 f0 lea -0x10(%ebp),%eax
801064d9: 89 44 24 04 mov %eax,0x4(%esp)
801064dd: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801064e4: e8 2d f0 ff ff call 80105516 <argint>
801064e9: 85 c0 test %eax,%eax
801064eb: 79 07 jns 801064f4 <sys_sbrk+0x24>
return -1;
801064ed: b8 ff ff ff ff mov $0xffffffff,%eax
801064f2: eb 24 jmp 80106518 <sys_sbrk+0x48>
addr = proc->sz;
801064f4: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801064fa: 8b 00 mov (%eax),%eax
801064fc: 89 45 f4 mov %eax,-0xc(%ebp)
if(growproc(n) < 0)
801064ff: 8b 45 f0 mov -0x10(%ebp),%eax
80106502: 89 04 24 mov %eax,(%esp)
80106505: e8 8e dd ff ff call 80104298 <growproc>
8010650a: 85 c0 test %eax,%eax
8010650c: 79 07 jns 80106515 <sys_sbrk+0x45>
return -1;
8010650e: b8 ff ff ff ff mov $0xffffffff,%eax
80106513: eb 03 jmp 80106518 <sys_sbrk+0x48>
return addr;
80106515: 8b 45 f4 mov -0xc(%ebp),%eax
}
80106518: c9 leave
80106519: c3 ret
8010651a <sys_sleep>:
int
sys_sleep(void)
{
8010651a: 55 push %ebp
8010651b: 89 e5 mov %esp,%ebp
8010651d: 83 ec 28 sub $0x28,%esp
int n;
uint ticks0;
if(argint(0, &n) < 0)
80106520: 8d 45 f0 lea -0x10(%ebp),%eax
80106523: 89 44 24 04 mov %eax,0x4(%esp)
80106527: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010652e: e8 e3 ef ff ff call 80105516 <argint>
80106533: 85 c0 test %eax,%eax
80106535: 79 07 jns 8010653e <sys_sleep+0x24>
return -1;
80106537: b8 ff ff ff ff mov $0xffffffff,%eax
8010653c: eb 6c jmp 801065aa <sys_sleep+0x90>
acquire(&tickslock);
8010653e: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
80106545: e8 21 ea ff ff call 80104f6b <acquire>
ticks0 = ticks;
8010654a: a1 c0 28 11 80 mov 0x801128c0,%eax
8010654f: 89 45 f4 mov %eax,-0xc(%ebp)
while(ticks - ticks0 < n){
80106552: eb 34 jmp 80106588 <sys_sleep+0x6e>
if(proc->killed){
80106554: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010655a: 8b 40 24 mov 0x24(%eax),%eax
8010655d: 85 c0 test %eax,%eax
8010655f: 74 13 je 80106574 <sys_sleep+0x5a>
release(&tickslock);
80106561: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
80106568: e8 5f ea ff ff call 80104fcc <release>
return -1;
8010656d: b8 ff ff ff ff mov $0xffffffff,%eax
80106572: eb 36 jmp 801065aa <sys_sleep+0x90>
}
sleep(&ticks, &tickslock);
80106574: c7 44 24 04 80 20 11 movl $0x80112080,0x4(%esp)
8010657b: 80
8010657c: c7 04 24 c0 28 11 80 movl $0x801128c0,(%esp)
80106583: e8 6b e6 ff ff call 80104bf3 <sleep>
if(argint(0, &n) < 0)
return -1;
acquire(&tickslock);
ticks0 = ticks;
while(ticks - ticks0 < n){
80106588: a1 c0 28 11 80 mov 0x801128c0,%eax
8010658d: 89 c2 mov %eax,%edx
8010658f: 2b 55 f4 sub -0xc(%ebp),%edx
80106592: 8b 45 f0 mov -0x10(%ebp),%eax
80106595: 39 c2 cmp %eax,%edx
80106597: 72 bb jb 80106554 <sys_sleep+0x3a>
release(&tickslock);
return -1;
}
sleep(&ticks, &tickslock);
}
release(&tickslock);
80106599: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
801065a0: e8 27 ea ff ff call 80104fcc <release>
return 0;
801065a5: b8 00 00 00 00 mov $0x0,%eax
}
801065aa: c9 leave
801065ab: c3 ret
801065ac <sys_uptime>:
// return how many clock tick interrupts have occurred
// since start.
int
sys_uptime(void)
{
801065ac: 55 push %ebp
801065ad: 89 e5 mov %esp,%ebp
801065af: 83 ec 28 sub $0x28,%esp
uint xticks;
acquire(&tickslock);
801065b2: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
801065b9: e8 ad e9 ff ff call 80104f6b <acquire>
xticks = ticks;
801065be: a1 c0 28 11 80 mov 0x801128c0,%eax
801065c3: 89 45 f4 mov %eax,-0xc(%ebp)
release(&tickslock);
801065c6: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
801065cd: e8 fa e9 ff ff call 80104fcc <release>
return xticks;
801065d2: 8b 45 f4 mov -0xc(%ebp),%eax
}
801065d5: c9 leave
801065d6: c3 ret
801065d7 <sys_tsleep>:
int
sys_tsleep(void)
{
801065d7: 55 push %ebp
801065d8: 89 e5 mov %esp,%ebp
801065da: 83 ec 08 sub $0x8,%esp
tsleep();
801065dd: e8 fb e8 ff ff call 80104edd <tsleep>
return 0;
801065e2: b8 00 00 00 00 mov $0x0,%eax
}
801065e7: c9 leave
801065e8: c3 ret
801065e9 <sys_twakeup>:
int
sys_twakeup(void)
{
801065e9: 55 push %ebp
801065ea: 89 e5 mov %esp,%ebp
801065ec: 83 ec 28 sub $0x28,%esp
int tid;
if(argint(0,&tid) < 0){
801065ef: 8d 45 f4 lea -0xc(%ebp),%eax
801065f2: 89 44 24 04 mov %eax,0x4(%esp)
801065f6: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801065fd: e8 14 ef ff ff call 80105516 <argint>
80106602: 85 c0 test %eax,%eax
80106604: 79 07 jns 8010660d <sys_twakeup+0x24>
return -1;
80106606: b8 ff ff ff ff mov $0xffffffff,%eax
8010660b: eb 10 jmp 8010661d <sys_twakeup+0x34>
}
twakeup(tid);
8010660d: 8b 45 f4 mov -0xc(%ebp),%eax
80106610: 89 04 24 mov %eax,(%esp)
80106613: e8 b8 e6 ff ff call 80104cd0 <twakeup>
return 0;
80106618: b8 00 00 00 00 mov $0x0,%eax
}
8010661d: c9 leave
8010661e: c3 ret
8010661f <sys_thread_yield>:
//lab 2
void
sys_thread_yield(void)
{
8010661f: 55 push %ebp
80106620: 89 e5 mov %esp,%ebp
80106622: 83 ec 08 sub $0x8,%esp
thread_yield();
80106625: e8 5b e5 ff ff call 80104b85 <thread_yield>
}
8010662a: c9 leave
8010662b: c3 ret
8010662c <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
8010662c: 55 push %ebp
8010662d: 89 e5 mov %esp,%ebp
8010662f: 83 ec 08 sub $0x8,%esp
80106632: 8b 55 08 mov 0x8(%ebp),%edx
80106635: 8b 45 0c mov 0xc(%ebp),%eax
80106638: 66 89 55 fc mov %dx,-0x4(%ebp)
8010663c: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010663f: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
80106643: 0f b7 55 fc movzwl -0x4(%ebp),%edx
80106647: ee out %al,(%dx)
}
80106648: c9 leave
80106649: c3 ret
8010664a <timerinit>:
#define TIMER_RATEGEN 0x04 // mode 2, rate generator
#define TIMER_16BIT 0x30 // r/w counter 16 bits, LSB first
void
timerinit(void)
{
8010664a: 55 push %ebp
8010664b: 89 e5 mov %esp,%ebp
8010664d: 83 ec 18 sub $0x18,%esp
// Interrupt 100 times/sec.
outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
80106650: c7 44 24 04 34 00 00 movl $0x34,0x4(%esp)
80106657: 00
80106658: c7 04 24 43 00 00 00 movl $0x43,(%esp)
8010665f: e8 c8 ff ff ff call 8010662c <outb>
outb(IO_TIMER1, TIMER_DIV(100) % 256);
80106664: c7 44 24 04 9c 00 00 movl $0x9c,0x4(%esp)
8010666b: 00
8010666c: c7 04 24 40 00 00 00 movl $0x40,(%esp)
80106673: e8 b4 ff ff ff call 8010662c <outb>
outb(IO_TIMER1, TIMER_DIV(100) / 256);
80106678: c7 44 24 04 2e 00 00 movl $0x2e,0x4(%esp)
8010667f: 00
80106680: c7 04 24 40 00 00 00 movl $0x40,(%esp)
80106687: e8 a0 ff ff ff call 8010662c <outb>
picenable(IRQ_TIMER);
8010668c: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80106693: e8 f5 d3 ff ff call 80103a8d <picenable>
}
80106698: c9 leave
80106699: c3 ret
...
8010669c <alltraps>:
# vectors.S sends all traps here.
.globl alltraps
alltraps:
# Build trap frame.
pushl %ds
8010669c: 1e push %ds
pushl %es
8010669d: 06 push %es
pushl %fs
8010669e: 0f a0 push %fs
pushl %gs
801066a0: 0f a8 push %gs
pushal
801066a2: 60 pusha
# Set up data and per-cpu segments.
movw $(SEG_KDATA<<3), %ax
801066a3: 66 b8 10 00 mov $0x10,%ax
movw %ax, %ds
801066a7: 8e d8 mov %eax,%ds
movw %ax, %es
801066a9: 8e c0 mov %eax,%es
movw $(SEG_KCPU<<3), %ax
801066ab: 66 b8 18 00 mov $0x18,%ax
movw %ax, %fs
801066af: 8e e0 mov %eax,%fs
movw %ax, %gs
801066b1: 8e e8 mov %eax,%gs
# Call trap(tf), where tf=%esp
pushl %esp
801066b3: 54 push %esp
call trap
801066b4: e8 d5 01 00 00 call 8010688e <trap>
addl $4, %esp
801066b9: 83 c4 04 add $0x4,%esp
801066bc <trapret>:
# Return falls through to trapret...
.globl trapret
trapret:
popal
801066bc: 61 popa
popl %gs
801066bd: 0f a9 pop %gs
popl %fs
801066bf: 0f a1 pop %fs
popl %es
801066c1: 07 pop %es
popl %ds
801066c2: 1f pop %ds
addl $0x8, %esp # trapno and errcode
801066c3: 83 c4 08 add $0x8,%esp
iret
801066c6: cf iret
...
801066c8 <lidt>:
struct gatedesc;
static inline void
lidt(struct gatedesc *p, int size)
{
801066c8: 55 push %ebp
801066c9: 89 e5 mov %esp,%ebp
801066cb: 83 ec 10 sub $0x10,%esp
volatile ushort pd[3];
pd[0] = size-1;
801066ce: 8b 45 0c mov 0xc(%ebp),%eax
801066d1: 83 e8 01 sub $0x1,%eax
801066d4: 66 89 45 fa mov %ax,-0x6(%ebp)
pd[1] = (uint)p;
801066d8: 8b 45 08 mov 0x8(%ebp),%eax
801066db: 66 89 45 fc mov %ax,-0x4(%ebp)
pd[2] = (uint)p >> 16;
801066df: 8b 45 08 mov 0x8(%ebp),%eax
801066e2: c1 e8 10 shr $0x10,%eax
801066e5: 66 89 45 fe mov %ax,-0x2(%ebp)
asm volatile("lidt (%0)" : : "r" (pd));
801066e9: 8d 45 fa lea -0x6(%ebp),%eax
801066ec: 0f 01 18 lidtl (%eax)
}
801066ef: c9 leave
801066f0: c3 ret
801066f1 <rcr2>:
return result;
}
static inline uint
rcr2(void)
{
801066f1: 55 push %ebp
801066f2: 89 e5 mov %esp,%ebp
801066f4: 83 ec 10 sub $0x10,%esp
uint val;
asm volatile("movl %%cr2,%0" : "=r" (val));
801066f7: 0f 20 d0 mov %cr2,%eax
801066fa: 89 45 fc mov %eax,-0x4(%ebp)
return val;
801066fd: 8b 45 fc mov -0x4(%ebp),%eax
}
80106700: c9 leave
80106701: c3 ret
80106702 <tvinit>:
struct spinlock tickslock;
uint ticks;
void
tvinit(void)
{
80106702: 55 push %ebp
80106703: 89 e5 mov %esp,%ebp
80106705: 83 ec 28 sub $0x28,%esp
int i;
for(i = 0; i < 256; i++)
80106708: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
8010670f: e9 bf 00 00 00 jmp 801067d3 <tvinit+0xd1>
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
80106714: 8b 45 f4 mov -0xc(%ebp),%eax
80106717: 8b 55 f4 mov -0xc(%ebp),%edx
8010671a: 8b 14 95 ac b0 10 80 mov -0x7fef4f54(,%edx,4),%edx
80106721: 66 89 14 c5 c0 20 11 mov %dx,-0x7feedf40(,%eax,8)
80106728: 80
80106729: 8b 45 f4 mov -0xc(%ebp),%eax
8010672c: 66 c7 04 c5 c2 20 11 movw $0x8,-0x7feedf3e(,%eax,8)
80106733: 80 08 00
80106736: 8b 45 f4 mov -0xc(%ebp),%eax
80106739: 0f b6 14 c5 c4 20 11 movzbl -0x7feedf3c(,%eax,8),%edx
80106740: 80
80106741: 83 e2 e0 and $0xffffffe0,%edx
80106744: 88 14 c5 c4 20 11 80 mov %dl,-0x7feedf3c(,%eax,8)
8010674b: 8b 45 f4 mov -0xc(%ebp),%eax
8010674e: 0f b6 14 c5 c4 20 11 movzbl -0x7feedf3c(,%eax,8),%edx
80106755: 80
80106756: 83 e2 1f and $0x1f,%edx
80106759: 88 14 c5 c4 20 11 80 mov %dl,-0x7feedf3c(,%eax,8)
80106760: 8b 45 f4 mov -0xc(%ebp),%eax
80106763: 0f b6 14 c5 c5 20 11 movzbl -0x7feedf3b(,%eax,8),%edx
8010676a: 80
8010676b: 83 e2 f0 and $0xfffffff0,%edx
8010676e: 83 ca 0e or $0xe,%edx
80106771: 88 14 c5 c5 20 11 80 mov %dl,-0x7feedf3b(,%eax,8)
80106778: 8b 45 f4 mov -0xc(%ebp),%eax
8010677b: 0f b6 14 c5 c5 20 11 movzbl -0x7feedf3b(,%eax,8),%edx
80106782: 80
80106783: 83 e2 ef and $0xffffffef,%edx
80106786: 88 14 c5 c5 20 11 80 mov %dl,-0x7feedf3b(,%eax,8)
8010678d: 8b 45 f4 mov -0xc(%ebp),%eax
80106790: 0f b6 14 c5 c5 20 11 movzbl -0x7feedf3b(,%eax,8),%edx
80106797: 80
80106798: 83 e2 9f and $0xffffff9f,%edx
8010679b: 88 14 c5 c5 20 11 80 mov %dl,-0x7feedf3b(,%eax,8)
801067a2: 8b 45 f4 mov -0xc(%ebp),%eax
801067a5: 0f b6 14 c5 c5 20 11 movzbl -0x7feedf3b(,%eax,8),%edx
801067ac: 80
801067ad: 83 ca 80 or $0xffffff80,%edx
801067b0: 88 14 c5 c5 20 11 80 mov %dl,-0x7feedf3b(,%eax,8)
801067b7: 8b 45 f4 mov -0xc(%ebp),%eax
801067ba: 8b 55 f4 mov -0xc(%ebp),%edx
801067bd: 8b 14 95 ac b0 10 80 mov -0x7fef4f54(,%edx,4),%edx
801067c4: c1 ea 10 shr $0x10,%edx
801067c7: 66 89 14 c5 c6 20 11 mov %dx,-0x7feedf3a(,%eax,8)
801067ce: 80
void
tvinit(void)
{
int i;
for(i = 0; i < 256; i++)
801067cf: 83 45 f4 01 addl $0x1,-0xc(%ebp)
801067d3: 81 7d f4 ff 00 00 00 cmpl $0xff,-0xc(%ebp)
801067da: 0f 8e 34 ff ff ff jle 80106714 <tvinit+0x12>
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
801067e0: a1 ac b1 10 80 mov 0x8010b1ac,%eax
801067e5: 66 a3 c0 22 11 80 mov %ax,0x801122c0
801067eb: 66 c7 05 c2 22 11 80 movw $0x8,0x801122c2
801067f2: 08 00
801067f4: 0f b6 05 c4 22 11 80 movzbl 0x801122c4,%eax
801067fb: 83 e0 e0 and $0xffffffe0,%eax
801067fe: a2 c4 22 11 80 mov %al,0x801122c4
80106803: 0f b6 05 c4 22 11 80 movzbl 0x801122c4,%eax
8010680a: 83 e0 1f and $0x1f,%eax
8010680d: a2 c4 22 11 80 mov %al,0x801122c4
80106812: 0f b6 05 c5 22 11 80 movzbl 0x801122c5,%eax
80106819: 83 c8 0f or $0xf,%eax
8010681c: a2 c5 22 11 80 mov %al,0x801122c5
80106821: 0f b6 05 c5 22 11 80 movzbl 0x801122c5,%eax
80106828: 83 e0 ef and $0xffffffef,%eax
8010682b: a2 c5 22 11 80 mov %al,0x801122c5
80106830: 0f b6 05 c5 22 11 80 movzbl 0x801122c5,%eax
80106837: 83 c8 60 or $0x60,%eax
8010683a: a2 c5 22 11 80 mov %al,0x801122c5
8010683f: 0f b6 05 c5 22 11 80 movzbl 0x801122c5,%eax
80106846: 83 c8 80 or $0xffffff80,%eax
80106849: a2 c5 22 11 80 mov %al,0x801122c5
8010684e: a1 ac b1 10 80 mov 0x8010b1ac,%eax
80106853: c1 e8 10 shr $0x10,%eax
80106856: 66 a3 c6 22 11 80 mov %ax,0x801122c6
initlock(&tickslock, "time");
8010685c: c7 44 24 04 90 8a 10 movl $0x80108a90,0x4(%esp)
80106863: 80
80106864: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
8010686b: e8 da e6 ff ff call 80104f4a <initlock>
}
80106870: c9 leave
80106871: c3 ret
80106872 <idtinit>:
void
idtinit(void)
{
80106872: 55 push %ebp
80106873: 89 e5 mov %esp,%ebp
80106875: 83 ec 08 sub $0x8,%esp
lidt(idt, sizeof(idt));
80106878: c7 44 24 04 00 08 00 movl $0x800,0x4(%esp)
8010687f: 00
80106880: c7 04 24 c0 20 11 80 movl $0x801120c0,(%esp)
80106887: e8 3c fe ff ff call 801066c8 <lidt>
}
8010688c: c9 leave
8010688d: c3 ret
8010688e <trap>:
//PAGEBREAK: 41
void
trap(struct trapframe *tf)
{
8010688e: 55 push %ebp
8010688f: 89 e5 mov %esp,%ebp
80106891: 57 push %edi
80106892: 56 push %esi
80106893: 53 push %ebx
80106894: 83 ec 3c sub $0x3c,%esp
if(tf->trapno == T_SYSCALL){
80106897: 8b 45 08 mov 0x8(%ebp),%eax
8010689a: 8b 40 30 mov 0x30(%eax),%eax
8010689d: 83 f8 40 cmp $0x40,%eax
801068a0: 75 3e jne 801068e0 <trap+0x52>
if(proc->killed)
801068a2: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801068a8: 8b 40 24 mov 0x24(%eax),%eax
801068ab: 85 c0 test %eax,%eax
801068ad: 74 05 je 801068b4 <trap+0x26>
exit();
801068af: e8 1c de ff ff call 801046d0 <exit>
proc->tf = tf;
801068b4: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801068ba: 8b 55 08 mov 0x8(%ebp),%edx
801068bd: 89 50 18 mov %edx,0x18(%eax)
syscall();
801068c0: e8 19 ed ff ff call 801055de <syscall>
if(proc->killed)
801068c5: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801068cb: 8b 40 24 mov 0x24(%eax),%eax
801068ce: 85 c0 test %eax,%eax
801068d0: 0f 84 34 02 00 00 je 80106b0a <trap+0x27c>
exit();
801068d6: e8 f5 dd ff ff call 801046d0 <exit>
return;
801068db: e9 2b 02 00 00 jmp 80106b0b <trap+0x27d>
}
switch(tf->trapno){
801068e0: 8b 45 08 mov 0x8(%ebp),%eax
801068e3: 8b 40 30 mov 0x30(%eax),%eax
801068e6: 83 e8 20 sub $0x20,%eax
801068e9: 83 f8 1f cmp $0x1f,%eax
801068ec: 0f 87 bc 00 00 00 ja 801069ae <trap+0x120>
801068f2: 8b 04 85 38 8b 10 80 mov -0x7fef74c8(,%eax,4),%eax
801068f9: ff e0 jmp *%eax
case T_IRQ0 + IRQ_TIMER:
if(cpu->id == 0){
801068fb: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80106901: 0f b6 00 movzbl (%eax),%eax
80106904: 84 c0 test %al,%al
80106906: 75 31 jne 80106939 <trap+0xab>
acquire(&tickslock);
80106908: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
8010690f: e8 57 e6 ff ff call 80104f6b <acquire>
ticks++;
80106914: a1 c0 28 11 80 mov 0x801128c0,%eax
80106919: 83 c0 01 add $0x1,%eax
8010691c: a3 c0 28 11 80 mov %eax,0x801128c0
wakeup(&ticks);
80106921: c7 04 24 c0 28 11 80 movl $0x801128c0,(%esp)
80106928: e8 0c e4 ff ff call 80104d39 <wakeup>
release(&tickslock);
8010692d: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
80106934: e8 93 e6 ff ff call 80104fcc <release>
}
lapiceoi();
80106939: e8 a2 c5 ff ff call 80102ee0 <lapiceoi>
break;
8010693e: e9 41 01 00 00 jmp 80106a84 <trap+0x1f6>
case T_IRQ0 + IRQ_IDE:
ideintr();
80106943: e8 b3 bd ff ff call 801026fb <ideintr>
lapiceoi();
80106948: e8 93 c5 ff ff call 80102ee0 <lapiceoi>
break;
8010694d: e9 32 01 00 00 jmp 80106a84 <trap+0x1f6>
case T_IRQ0 + IRQ_IDE+1:
// Bochs generates spurious IDE1 interrupts.
break;
case T_IRQ0 + IRQ_KBD:
kbdintr();
80106952: e8 6c c3 ff ff call 80102cc3 <kbdintr>
lapiceoi();
80106957: e8 84 c5 ff ff call 80102ee0 <lapiceoi>
break;
8010695c: e9 23 01 00 00 jmp 80106a84 <trap+0x1f6>
case T_IRQ0 + IRQ_COM1:
uartintr();
80106961: e8 9d 03 00 00 call 80106d03 <uartintr>
lapiceoi();
80106966: e8 75 c5 ff ff call 80102ee0 <lapiceoi>
break;
8010696b: e9 14 01 00 00 jmp 80106a84 <trap+0x1f6>
case T_IRQ0 + 7:
case T_IRQ0 + IRQ_SPURIOUS:
cprintf("cpu%d: spurious interrupt at %x:%x\n",
80106970: 8b 45 08 mov 0x8(%ebp),%eax
80106973: 8b 48 38 mov 0x38(%eax),%ecx
cpu->id, tf->cs, tf->eip);
80106976: 8b 45 08 mov 0x8(%ebp),%eax
80106979: 0f b7 40 3c movzwl 0x3c(%eax),%eax
uartintr();
lapiceoi();
break;
case T_IRQ0 + 7:
case T_IRQ0 + IRQ_SPURIOUS:
cprintf("cpu%d: spurious interrupt at %x:%x\n",
8010697d: 0f b7 d0 movzwl %ax,%edx
cpu->id, tf->cs, tf->eip);
80106980: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80106986: 0f b6 00 movzbl (%eax),%eax
uartintr();
lapiceoi();
break;
case T_IRQ0 + 7:
case T_IRQ0 + IRQ_SPURIOUS:
cprintf("cpu%d: spurious interrupt at %x:%x\n",
80106989: 0f b6 c0 movzbl %al,%eax
8010698c: 89 4c 24 0c mov %ecx,0xc(%esp)
80106990: 89 54 24 08 mov %edx,0x8(%esp)
80106994: 89 44 24 04 mov %eax,0x4(%esp)
80106998: c7 04 24 98 8a 10 80 movl $0x80108a98,(%esp)
8010699f: e8 f6 99 ff ff call 8010039a <cprintf>
cpu->id, tf->cs, tf->eip);
lapiceoi();
801069a4: e8 37 c5 ff ff call 80102ee0 <lapiceoi>
break;
801069a9: e9 d6 00 00 00 jmp 80106a84 <trap+0x1f6>
//PAGEBREAK: 13
default:
if(proc == 0 || (tf->cs&3) == 0){
801069ae: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801069b4: 85 c0 test %eax,%eax
801069b6: 74 11 je 801069c9 <trap+0x13b>
801069b8: 8b 45 08 mov 0x8(%ebp),%eax
801069bb: 0f b7 40 3c movzwl 0x3c(%eax),%eax
801069bf: 0f b7 c0 movzwl %ax,%eax
801069c2: 83 e0 03 and $0x3,%eax
801069c5: 85 c0 test %eax,%eax
801069c7: 75 46 jne 80106a0f <trap+0x181>
// In kernel, it must be our mistake.
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
801069c9: e8 23 fd ff ff call 801066f1 <rcr2>
801069ce: 8b 55 08 mov 0x8(%ebp),%edx
801069d1: 8b 5a 38 mov 0x38(%edx),%ebx
tf->trapno, cpu->id, tf->eip, rcr2());
801069d4: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
801069db: 0f b6 12 movzbl (%edx),%edx
//PAGEBREAK: 13
default:
if(proc == 0 || (tf->cs&3) == 0){
// In kernel, it must be our mistake.
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
801069de: 0f b6 ca movzbl %dl,%ecx
801069e1: 8b 55 08 mov 0x8(%ebp),%edx
801069e4: 8b 52 30 mov 0x30(%edx),%edx
801069e7: 89 44 24 10 mov %eax,0x10(%esp)
801069eb: 89 5c 24 0c mov %ebx,0xc(%esp)
801069ef: 89 4c 24 08 mov %ecx,0x8(%esp)
801069f3: 89 54 24 04 mov %edx,0x4(%esp)
801069f7: c7 04 24 bc 8a 10 80 movl $0x80108abc,(%esp)
801069fe: e8 97 99 ff ff call 8010039a <cprintf>
tf->trapno, cpu->id, tf->eip, rcr2());
panic("trap");
80106a03: c7 04 24 ee 8a 10 80 movl $0x80108aee,(%esp)
80106a0a: e8 2b 9b ff ff call 8010053a <panic>
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
80106a0f: e8 dd fc ff ff call 801066f1 <rcr2>
80106a14: 89 c2 mov %eax,%edx
80106a16: 8b 45 08 mov 0x8(%ebp),%eax
80106a19: 8b 78 38 mov 0x38(%eax),%edi
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
80106a1c: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80106a22: 0f b6 00 movzbl (%eax),%eax
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
tf->trapno, cpu->id, tf->eip, rcr2());
panic("trap");
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
80106a25: 0f b6 f0 movzbl %al,%esi
80106a28: 8b 45 08 mov 0x8(%ebp),%eax
80106a2b: 8b 58 34 mov 0x34(%eax),%ebx
80106a2e: 8b 45 08 mov 0x8(%ebp),%eax
80106a31: 8b 48 30 mov 0x30(%eax),%ecx
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
80106a34: 65 a1 04 00 00 00 mov %gs:0x4,%eax
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
tf->trapno, cpu->id, tf->eip, rcr2());
panic("trap");
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
80106a3a: 83 c0 6c add $0x6c,%eax
80106a3d: 89 45 e4 mov %eax,-0x1c(%ebp)
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
80106a40: 65 a1 04 00 00 00 mov %gs:0x4,%eax
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
tf->trapno, cpu->id, tf->eip, rcr2());
panic("trap");
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
80106a46: 8b 40 10 mov 0x10(%eax),%eax
80106a49: 89 54 24 1c mov %edx,0x1c(%esp)
80106a4d: 89 7c 24 18 mov %edi,0x18(%esp)
80106a51: 89 74 24 14 mov %esi,0x14(%esp)
80106a55: 89 5c 24 10 mov %ebx,0x10(%esp)
80106a59: 89 4c 24 0c mov %ecx,0xc(%esp)
80106a5d: 8b 55 e4 mov -0x1c(%ebp),%edx
80106a60: 89 54 24 08 mov %edx,0x8(%esp)
80106a64: 89 44 24 04 mov %eax,0x4(%esp)
80106a68: c7 04 24 f4 8a 10 80 movl $0x80108af4,(%esp)
80106a6f: e8 26 99 ff ff call 8010039a <cprintf>
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
rcr2());
proc->killed = 1;
80106a74: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106a7a: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax)
80106a81: eb 01 jmp 80106a84 <trap+0x1f6>
ideintr();
lapiceoi();
break;
case T_IRQ0 + IRQ_IDE+1:
// Bochs generates spurious IDE1 interrupts.
break;
80106a83: 90 nop
}
// Force process exit if it has been killed and is in user space.
// (If it is still executing in the kernel, let it keep running
// until it gets to the regular system call return.)
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
80106a84: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106a8a: 85 c0 test %eax,%eax
80106a8c: 74 24 je 80106ab2 <trap+0x224>
80106a8e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106a94: 8b 40 24 mov 0x24(%eax),%eax
80106a97: 85 c0 test %eax,%eax
80106a99: 74 17 je 80106ab2 <trap+0x224>
80106a9b: 8b 45 08 mov 0x8(%ebp),%eax
80106a9e: 0f b7 40 3c movzwl 0x3c(%eax),%eax
80106aa2: 0f b7 c0 movzwl %ax,%eax
80106aa5: 83 e0 03 and $0x3,%eax
80106aa8: 83 f8 03 cmp $0x3,%eax
80106aab: 75 05 jne 80106ab2 <trap+0x224>
exit();
80106aad: e8 1e dc ff ff call 801046d0 <exit>
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.
if(proc && proc->state == RUNNING && tf->trapno == T_IRQ0+IRQ_TIMER)
80106ab2: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106ab8: 85 c0 test %eax,%eax
80106aba: 74 1e je 80106ada <trap+0x24c>
80106abc: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106ac2: 8b 40 0c mov 0xc(%eax),%eax
80106ac5: 83 f8 04 cmp $0x4,%eax
80106ac8: 75 10 jne 80106ada <trap+0x24c>
80106aca: 8b 45 08 mov 0x8(%ebp),%eax
80106acd: 8b 40 30 mov 0x30(%eax),%eax
80106ad0: 83 f8 20 cmp $0x20,%eax
80106ad3: 75 05 jne 80106ada <trap+0x24c>
yield();
80106ad5: e8 79 e0 ff ff call 80104b53 <yield>
// Check if the process has been killed since we yielded
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
80106ada: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106ae0: 85 c0 test %eax,%eax
80106ae2: 74 27 je 80106b0b <trap+0x27d>
80106ae4: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106aea: 8b 40 24 mov 0x24(%eax),%eax
80106aed: 85 c0 test %eax,%eax
80106aef: 74 1a je 80106b0b <trap+0x27d>
80106af1: 8b 45 08 mov 0x8(%ebp),%eax
80106af4: 0f b7 40 3c movzwl 0x3c(%eax),%eax
80106af8: 0f b7 c0 movzwl %ax,%eax
80106afb: 83 e0 03 and $0x3,%eax
80106afe: 83 f8 03 cmp $0x3,%eax
80106b01: 75 08 jne 80106b0b <trap+0x27d>
exit();
80106b03: e8 c8 db ff ff call 801046d0 <exit>
80106b08: eb 01 jmp 80106b0b <trap+0x27d>
exit();
proc->tf = tf;
syscall();
if(proc->killed)
exit();
return;
80106b0a: 90 nop
yield();
// Check if the process has been killed since we yielded
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
exit();
}
80106b0b: 83 c4 3c add $0x3c,%esp
80106b0e: 5b pop %ebx
80106b0f: 5e pop %esi
80106b10: 5f pop %edi
80106b11: 5d pop %ebp
80106b12: c3 ret
...
80106b14 <inb>:
// Routines to let C code use special x86 instructions.
static inline uchar
inb(ushort port)
{
80106b14: 55 push %ebp
80106b15: 89 e5 mov %esp,%ebp
80106b17: 83 ec 14 sub $0x14,%esp
80106b1a: 8b 45 08 mov 0x8(%ebp),%eax
80106b1d: 66 89 45 ec mov %ax,-0x14(%ebp)
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80106b21: 0f b7 45 ec movzwl -0x14(%ebp),%eax
80106b25: 89 c2 mov %eax,%edx
80106b27: ec in (%dx),%al
80106b28: 88 45 ff mov %al,-0x1(%ebp)
return data;
80106b2b: 0f b6 45 ff movzbl -0x1(%ebp),%eax
}
80106b2f: c9 leave
80106b30: c3 ret
80106b31 <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
80106b31: 55 push %ebp
80106b32: 89 e5 mov %esp,%ebp
80106b34: 83 ec 08 sub $0x8,%esp
80106b37: 8b 55 08 mov 0x8(%ebp),%edx
80106b3a: 8b 45 0c mov 0xc(%ebp),%eax
80106b3d: 66 89 55 fc mov %dx,-0x4(%ebp)
80106b41: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80106b44: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
80106b48: 0f b7 55 fc movzwl -0x4(%ebp),%edx
80106b4c: ee out %al,(%dx)
}
80106b4d: c9 leave
80106b4e: c3 ret
80106b4f <uartinit>:
static int uart; // is there a uart?
void
uartinit(void)
{
80106b4f: 55 push %ebp
80106b50: 89 e5 mov %esp,%ebp
80106b52: 83 ec 28 sub $0x28,%esp
char *p;
// Turn off the FIFO
outb(COM1+2, 0);
80106b55: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106b5c: 00
80106b5d: c7 04 24 fa 03 00 00 movl $0x3fa,(%esp)
80106b64: e8 c8 ff ff ff call 80106b31 <outb>
// 9600 baud, 8 data bits, 1 stop bit, parity off.
outb(COM1+3, 0x80); // Unlock divisor
80106b69: c7 44 24 04 80 00 00 movl $0x80,0x4(%esp)
80106b70: 00
80106b71: c7 04 24 fb 03 00 00 movl $0x3fb,(%esp)
80106b78: e8 b4 ff ff ff call 80106b31 <outb>
outb(COM1+0, 115200/9600);
80106b7d: c7 44 24 04 0c 00 00 movl $0xc,0x4(%esp)
80106b84: 00
80106b85: c7 04 24 f8 03 00 00 movl $0x3f8,(%esp)
80106b8c: e8 a0 ff ff ff call 80106b31 <outb>
outb(COM1+1, 0);
80106b91: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106b98: 00
80106b99: c7 04 24 f9 03 00 00 movl $0x3f9,(%esp)
80106ba0: e8 8c ff ff ff call 80106b31 <outb>
outb(COM1+3, 0x03); // Lock divisor, 8 data bits.
80106ba5: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
80106bac: 00
80106bad: c7 04 24 fb 03 00 00 movl $0x3fb,(%esp)
80106bb4: e8 78 ff ff ff call 80106b31 <outb>
outb(COM1+4, 0);
80106bb9: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106bc0: 00
80106bc1: c7 04 24 fc 03 00 00 movl $0x3fc,(%esp)
80106bc8: e8 64 ff ff ff call 80106b31 <outb>
outb(COM1+1, 0x01); // Enable receive interrupts.
80106bcd: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80106bd4: 00
80106bd5: c7 04 24 f9 03 00 00 movl $0x3f9,(%esp)
80106bdc: e8 50 ff ff ff call 80106b31 <outb>
// If status is 0xFF, no serial port.
if(inb(COM1+5) == 0xFF)
80106be1: c7 04 24 fd 03 00 00 movl $0x3fd,(%esp)
80106be8: e8 27 ff ff ff call 80106b14 <inb>
80106bed: 3c ff cmp $0xff,%al
80106bef: 74 6c je 80106c5d <uartinit+0x10e>
return;
uart = 1;
80106bf1: c7 05 6c b6 10 80 01 movl $0x1,0x8010b66c
80106bf8: 00 00 00
// Acknowledge pre-existing interrupt conditions;
// enable interrupts.
inb(COM1+2);
80106bfb: c7 04 24 fa 03 00 00 movl $0x3fa,(%esp)
80106c02: e8 0d ff ff ff call 80106b14 <inb>
inb(COM1+0);
80106c07: c7 04 24 f8 03 00 00 movl $0x3f8,(%esp)
80106c0e: e8 01 ff ff ff call 80106b14 <inb>
picenable(IRQ_COM1);
80106c13: c7 04 24 04 00 00 00 movl $0x4,(%esp)
80106c1a: e8 6e ce ff ff call 80103a8d <picenable>
ioapicenable(IRQ_COM1, 0);
80106c1f: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106c26: 00
80106c27: c7 04 24 04 00 00 00 movl $0x4,(%esp)
80106c2e: e8 4b bd ff ff call 8010297e <ioapicenable>
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
80106c33: c7 45 f4 b8 8b 10 80 movl $0x80108bb8,-0xc(%ebp)
80106c3a: eb 15 jmp 80106c51 <uartinit+0x102>
uartputc(*p);
80106c3c: 8b 45 f4 mov -0xc(%ebp),%eax
80106c3f: 0f b6 00 movzbl (%eax),%eax
80106c42: 0f be c0 movsbl %al,%eax
80106c45: 89 04 24 mov %eax,(%esp)
80106c48: e8 13 00 00 00 call 80106c60 <uartputc>
inb(COM1+0);
picenable(IRQ_COM1);
ioapicenable(IRQ_COM1, 0);
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
80106c4d: 83 45 f4 01 addl $0x1,-0xc(%ebp)
80106c51: 8b 45 f4 mov -0xc(%ebp),%eax
80106c54: 0f b6 00 movzbl (%eax),%eax
80106c57: 84 c0 test %al,%al
80106c59: 75 e1 jne 80106c3c <uartinit+0xed>
80106c5b: eb 01 jmp 80106c5e <uartinit+0x10f>
outb(COM1+4, 0);
outb(COM1+1, 0x01); // Enable receive interrupts.
// If status is 0xFF, no serial port.
if(inb(COM1+5) == 0xFF)
return;
80106c5d: 90 nop
ioapicenable(IRQ_COM1, 0);
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
uartputc(*p);
}
80106c5e: c9 leave
80106c5f: c3 ret
80106c60 <uartputc>:
void
uartputc(int c)
{
80106c60: 55 push %ebp
80106c61: 89 e5 mov %esp,%ebp
80106c63: 83 ec 28 sub $0x28,%esp
int i;
if(!uart)
80106c66: a1 6c b6 10 80 mov 0x8010b66c,%eax
80106c6b: 85 c0 test %eax,%eax
80106c6d: 74 4d je 80106cbc <uartputc+0x5c>
return;
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
80106c6f: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80106c76: eb 10 jmp 80106c88 <uartputc+0x28>
microdelay(10);
80106c78: c7 04 24 0a 00 00 00 movl $0xa,(%esp)
80106c7f: e8 81 c2 ff ff call 80102f05 <microdelay>
{
int i;
if(!uart)
return;
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
80106c84: 83 45 f4 01 addl $0x1,-0xc(%ebp)
80106c88: 83 7d f4 7f cmpl $0x7f,-0xc(%ebp)
80106c8c: 7f 16 jg 80106ca4 <uartputc+0x44>
80106c8e: c7 04 24 fd 03 00 00 movl $0x3fd,(%esp)
80106c95: e8 7a fe ff ff call 80106b14 <inb>
80106c9a: 0f b6 c0 movzbl %al,%eax
80106c9d: 83 e0 20 and $0x20,%eax
80106ca0: 85 c0 test %eax,%eax
80106ca2: 74 d4 je 80106c78 <uartputc+0x18>
microdelay(10);
outb(COM1+0, c);
80106ca4: 8b 45 08 mov 0x8(%ebp),%eax
80106ca7: 0f b6 c0 movzbl %al,%eax
80106caa: 89 44 24 04 mov %eax,0x4(%esp)
80106cae: c7 04 24 f8 03 00 00 movl $0x3f8,(%esp)
80106cb5: e8 77 fe ff ff call 80106b31 <outb>
80106cba: eb 01 jmp 80106cbd <uartputc+0x5d>
uartputc(int c)
{
int i;
if(!uart)
return;
80106cbc: 90 nop
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
microdelay(10);
outb(COM1+0, c);
}
80106cbd: c9 leave
80106cbe: c3 ret
80106cbf <uartgetc>:
static int
uartgetc(void)
{
80106cbf: 55 push %ebp
80106cc0: 89 e5 mov %esp,%ebp
80106cc2: 83 ec 04 sub $0x4,%esp
if(!uart)
80106cc5: a1 6c b6 10 80 mov 0x8010b66c,%eax
80106cca: 85 c0 test %eax,%eax
80106ccc: 75 07 jne 80106cd5 <uartgetc+0x16>
return -1;
80106cce: b8 ff ff ff ff mov $0xffffffff,%eax
80106cd3: eb 2c jmp 80106d01 <uartgetc+0x42>
if(!(inb(COM1+5) & 0x01))
80106cd5: c7 04 24 fd 03 00 00 movl $0x3fd,(%esp)
80106cdc: e8 33 fe ff ff call 80106b14 <inb>
80106ce1: 0f b6 c0 movzbl %al,%eax
80106ce4: 83 e0 01 and $0x1,%eax
80106ce7: 85 c0 test %eax,%eax
80106ce9: 75 07 jne 80106cf2 <uartgetc+0x33>
return -1;
80106ceb: b8 ff ff ff ff mov $0xffffffff,%eax
80106cf0: eb 0f jmp 80106d01 <uartgetc+0x42>
return inb(COM1+0);
80106cf2: c7 04 24 f8 03 00 00 movl $0x3f8,(%esp)
80106cf9: e8 16 fe ff ff call 80106b14 <inb>
80106cfe: 0f b6 c0 movzbl %al,%eax
}
80106d01: c9 leave
80106d02: c3 ret
80106d03 <uartintr>:
void
uartintr(void)
{
80106d03: 55 push %ebp
80106d04: 89 e5 mov %esp,%ebp
80106d06: 83 ec 18 sub $0x18,%esp
consoleintr(uartgetc);
80106d09: c7 04 24 bf 6c 10 80 movl $0x80106cbf,(%esp)
80106d10: e8 96 9a ff ff call 801007ab <consoleintr>
}
80106d15: c9 leave
80106d16: c3 ret
...
80106d18 <vector0>:
# generated by vectors.pl - do not edit
# handlers
.globl alltraps
.globl vector0
vector0:
pushl $0
80106d18: 6a 00 push $0x0
pushl $0
80106d1a: 6a 00 push $0x0
jmp alltraps
80106d1c: e9 7b f9 ff ff jmp 8010669c <alltraps>
80106d21 <vector1>:
.globl vector1
vector1:
pushl $0
80106d21: 6a 00 push $0x0
pushl $1
80106d23: 6a 01 push $0x1
jmp alltraps
80106d25: e9 72 f9 ff ff jmp 8010669c <alltraps>
80106d2a <vector2>:
.globl vector2
vector2:
pushl $0
80106d2a: 6a 00 push $0x0
pushl $2
80106d2c: 6a 02 push $0x2
jmp alltraps
80106d2e: e9 69 f9 ff ff jmp 8010669c <alltraps>
80106d33 <vector3>:
.globl vector3
vector3:
pushl $0
80106d33: 6a 00 push $0x0
pushl $3
80106d35: 6a 03 push $0x3
jmp alltraps
80106d37: e9 60 f9 ff ff jmp 8010669c <alltraps>
80106d3c <vector4>:
.globl vector4
vector4:
pushl $0
80106d3c: 6a 00 push $0x0
pushl $4
80106d3e: 6a 04 push $0x4
jmp alltraps
80106d40: e9 57 f9 ff ff jmp 8010669c <alltraps>
80106d45 <vector5>:
.globl vector5
vector5:
pushl $0
80106d45: 6a 00 push $0x0
pushl $5
80106d47: 6a 05 push $0x5
jmp alltraps
80106d49: e9 4e f9 ff ff jmp 8010669c <alltraps>
80106d4e <vector6>:
.globl vector6
vector6:
pushl $0
80106d4e: 6a 00 push $0x0
pushl $6
80106d50: 6a 06 push $0x6
jmp alltraps
80106d52: e9 45 f9 ff ff jmp 8010669c <alltraps>
80106d57 <vector7>:
.globl vector7
vector7:
pushl $0
80106d57: 6a 00 push $0x0
pushl $7
80106d59: 6a 07 push $0x7
jmp alltraps
80106d5b: e9 3c f9 ff ff jmp 8010669c <alltraps>
80106d60 <vector8>:
.globl vector8
vector8:
pushl $8
80106d60: 6a 08 push $0x8
jmp alltraps
80106d62: e9 35 f9 ff ff jmp 8010669c <alltraps>
80106d67 <vector9>:
.globl vector9
vector9:
pushl $0
80106d67: 6a 00 push $0x0
pushl $9
80106d69: 6a 09 push $0x9
jmp alltraps
80106d6b: e9 2c f9 ff ff jmp 8010669c <alltraps>
80106d70 <vector10>:
.globl vector10
vector10:
pushl $10
80106d70: 6a 0a push $0xa
jmp alltraps
80106d72: e9 25 f9 ff ff jmp 8010669c <alltraps>
80106d77 <vector11>:
.globl vector11
vector11:
pushl $11
80106d77: 6a 0b push $0xb
jmp alltraps
80106d79: e9 1e f9 ff ff jmp 8010669c <alltraps>
80106d7e <vector12>:
.globl vector12
vector12:
pushl $12
80106d7e: 6a 0c push $0xc
jmp alltraps
80106d80: e9 17 f9 ff ff jmp 8010669c <alltraps>
80106d85 <vector13>:
.globl vector13
vector13:
pushl $13
80106d85: 6a 0d push $0xd
jmp alltraps
80106d87: e9 10 f9 ff ff jmp 8010669c <alltraps>
80106d8c <vector14>:
.globl vector14
vector14:
pushl $14
80106d8c: 6a 0e push $0xe
jmp alltraps
80106d8e: e9 09 f9 ff ff jmp 8010669c <alltraps>
80106d93 <vector15>:
.globl vector15
vector15:
pushl $0
80106d93: 6a 00 push $0x0
pushl $15
80106d95: 6a 0f push $0xf
jmp alltraps
80106d97: e9 00 f9 ff ff jmp 8010669c <alltraps>
80106d9c <vector16>:
.globl vector16
vector16:
pushl $0
80106d9c: 6a 00 push $0x0
pushl $16
80106d9e: 6a 10 push $0x10
jmp alltraps
80106da0: e9 f7 f8 ff ff jmp 8010669c <alltraps>
80106da5 <vector17>:
.globl vector17
vector17:
pushl $17
80106da5: 6a 11 push $0x11
jmp alltraps
80106da7: e9 f0 f8 ff ff jmp 8010669c <alltraps>
80106dac <vector18>:
.globl vector18
vector18:
pushl $0
80106dac: 6a 00 push $0x0
pushl $18
80106dae: 6a 12 push $0x12
jmp alltraps
80106db0: e9 e7 f8 ff ff jmp 8010669c <alltraps>
80106db5 <vector19>:
.globl vector19
vector19:
pushl $0
80106db5: 6a 00 push $0x0
pushl $19
80106db7: 6a 13 push $0x13
jmp alltraps
80106db9: e9 de f8 ff ff jmp 8010669c <alltraps>
80106dbe <vector20>:
.globl vector20
vector20:
pushl $0
80106dbe: 6a 00 push $0x0
pushl $20
80106dc0: 6a 14 push $0x14
jmp alltraps
80106dc2: e9 d5 f8 ff ff jmp 8010669c <alltraps>
80106dc7 <vector21>:
.globl vector21
vector21:
pushl $0
80106dc7: 6a 00 push $0x0
pushl $21
80106dc9: 6a 15 push $0x15
jmp alltraps
80106dcb: e9 cc f8 ff ff jmp 8010669c <alltraps>
80106dd0 <vector22>:
.globl vector22
vector22:
pushl $0
80106dd0: 6a 00 push $0x0
pushl $22
80106dd2: 6a 16 push $0x16
jmp alltraps
80106dd4: e9 c3 f8 ff ff jmp 8010669c <alltraps>
80106dd9 <vector23>:
.globl vector23
vector23:
pushl $0
80106dd9: 6a 00 push $0x0
pushl $23
80106ddb: 6a 17 push $0x17
jmp alltraps
80106ddd: e9 ba f8 ff ff jmp 8010669c <alltraps>
80106de2 <vector24>:
.globl vector24
vector24:
pushl $0
80106de2: 6a 00 push $0x0
pushl $24
80106de4: 6a 18 push $0x18
jmp alltraps
80106de6: e9 b1 f8 ff ff jmp 8010669c <alltraps>
80106deb <vector25>:
.globl vector25
vector25:
pushl $0
80106deb: 6a 00 push $0x0
pushl $25
80106ded: 6a 19 push $0x19
jmp alltraps
80106def: e9 a8 f8 ff ff jmp 8010669c <alltraps>
80106df4 <vector26>:
.globl vector26
vector26:
pushl $0
80106df4: 6a 00 push $0x0
pushl $26
80106df6: 6a 1a push $0x1a
jmp alltraps
80106df8: e9 9f f8 ff ff jmp 8010669c <alltraps>
80106dfd <vector27>:
.globl vector27
vector27:
pushl $0
80106dfd: 6a 00 push $0x0
pushl $27
80106dff: 6a 1b push $0x1b
jmp alltraps
80106e01: e9 96 f8 ff ff jmp 8010669c <alltraps>
80106e06 <vector28>:
.globl vector28
vector28:
pushl $0
80106e06: 6a 00 push $0x0
pushl $28
80106e08: 6a 1c push $0x1c
jmp alltraps
80106e0a: e9 8d f8 ff ff jmp 8010669c <alltraps>
80106e0f <vector29>:
.globl vector29
vector29:
pushl $0
80106e0f: 6a 00 push $0x0
pushl $29
80106e11: 6a 1d push $0x1d
jmp alltraps
80106e13: e9 84 f8 ff ff jmp 8010669c <alltraps>
80106e18 <vector30>:
.globl vector30
vector30:
pushl $0
80106e18: 6a 00 push $0x0
pushl $30
80106e1a: 6a 1e push $0x1e
jmp alltraps
80106e1c: e9 7b f8 ff ff jmp 8010669c <alltraps>
80106e21 <vector31>:
.globl vector31
vector31:
pushl $0
80106e21: 6a 00 push $0x0
pushl $31
80106e23: 6a 1f push $0x1f
jmp alltraps
80106e25: e9 72 f8 ff ff jmp 8010669c <alltraps>
80106e2a <vector32>:
.globl vector32
vector32:
pushl $0
80106e2a: 6a 00 push $0x0
pushl $32
80106e2c: 6a 20 push $0x20
jmp alltraps
80106e2e: e9 69 f8 ff ff jmp 8010669c <alltraps>
80106e33 <vector33>:
.globl vector33
vector33:
pushl $0
80106e33: 6a 00 push $0x0
pushl $33
80106e35: 6a 21 push $0x21
jmp alltraps
80106e37: e9 60 f8 ff ff jmp 8010669c <alltraps>
80106e3c <vector34>:
.globl vector34
vector34:
pushl $0
80106e3c: 6a 00 push $0x0
pushl $34
80106e3e: 6a 22 push $0x22
jmp alltraps
80106e40: e9 57 f8 ff ff jmp 8010669c <alltraps>
80106e45 <vector35>:
.globl vector35
vector35:
pushl $0
80106e45: 6a 00 push $0x0
pushl $35
80106e47: 6a 23 push $0x23
jmp alltraps
80106e49: e9 4e f8 ff ff jmp 8010669c <alltraps>
80106e4e <vector36>:
.globl vector36
vector36:
pushl $0
80106e4e: 6a 00 push $0x0
pushl $36
80106e50: 6a 24 push $0x24
jmp alltraps
80106e52: e9 45 f8 ff ff jmp 8010669c <alltraps>
80106e57 <vector37>:
.globl vector37
vector37:
pushl $0
80106e57: 6a 00 push $0x0
pushl $37
80106e59: 6a 25 push $0x25
jmp alltraps
80106e5b: e9 3c f8 ff ff jmp 8010669c <alltraps>
80106e60 <vector38>:
.globl vector38
vector38:
pushl $0
80106e60: 6a 00 push $0x0
pushl $38
80106e62: 6a 26 push $0x26
jmp alltraps
80106e64: e9 33 f8 ff ff jmp 8010669c <alltraps>
80106e69 <vector39>:
.globl vector39
vector39:
pushl $0
80106e69: 6a 00 push $0x0
pushl $39
80106e6b: 6a 27 push $0x27
jmp alltraps
80106e6d: e9 2a f8 ff ff jmp 8010669c <alltraps>
80106e72 <vector40>:
.globl vector40
vector40:
pushl $0
80106e72: 6a 00 push $0x0
pushl $40
80106e74: 6a 28 push $0x28
jmp alltraps
80106e76: e9 21 f8 ff ff jmp 8010669c <alltraps>
80106e7b <vector41>:
.globl vector41
vector41:
pushl $0
80106e7b: 6a 00 push $0x0
pushl $41
80106e7d: 6a 29 push $0x29
jmp alltraps
80106e7f: e9 18 f8 ff ff jmp 8010669c <alltraps>
80106e84 <vector42>:
.globl vector42
vector42:
pushl $0
80106e84: 6a 00 push $0x0
pushl $42
80106e86: 6a 2a push $0x2a
jmp alltraps
80106e88: e9 0f f8 ff ff jmp 8010669c <alltraps>
80106e8d <vector43>:
.globl vector43
vector43:
pushl $0
80106e8d: 6a 00 push $0x0
pushl $43
80106e8f: 6a 2b push $0x2b
jmp alltraps
80106e91: e9 06 f8 ff ff jmp 8010669c <alltraps>
80106e96 <vector44>:
.globl vector44
vector44:
pushl $0
80106e96: 6a 00 push $0x0
pushl $44
80106e98: 6a 2c push $0x2c
jmp alltraps
80106e9a: e9 fd f7 ff ff jmp 8010669c <alltraps>
80106e9f <vector45>:
.globl vector45
vector45:
pushl $0
80106e9f: 6a 00 push $0x0
pushl $45
80106ea1: 6a 2d push $0x2d
jmp alltraps
80106ea3: e9 f4 f7 ff ff jmp 8010669c <alltraps>
80106ea8 <vector46>:
.globl vector46
vector46:
pushl $0
80106ea8: 6a 00 push $0x0
pushl $46
80106eaa: 6a 2e push $0x2e
jmp alltraps
80106eac: e9 eb f7 ff ff jmp 8010669c <alltraps>
80106eb1 <vector47>:
.globl vector47
vector47:
pushl $0
80106eb1: 6a 00 push $0x0
pushl $47
80106eb3: 6a 2f push $0x2f
jmp alltraps
80106eb5: e9 e2 f7 ff ff jmp 8010669c <alltraps>
80106eba <vector48>:
.globl vector48
vector48:
pushl $0
80106eba: 6a 00 push $0x0
pushl $48
80106ebc: 6a 30 push $0x30
jmp alltraps
80106ebe: e9 d9 f7 ff ff jmp 8010669c <alltraps>
80106ec3 <vector49>:
.globl vector49
vector49:
pushl $0
80106ec3: 6a 00 push $0x0
pushl $49
80106ec5: 6a 31 push $0x31
jmp alltraps
80106ec7: e9 d0 f7 ff ff jmp 8010669c <alltraps>
80106ecc <vector50>:
.globl vector50
vector50:
pushl $0
80106ecc: 6a 00 push $0x0
pushl $50
80106ece: 6a 32 push $0x32
jmp alltraps
80106ed0: e9 c7 f7 ff ff jmp 8010669c <alltraps>
80106ed5 <vector51>:
.globl vector51
vector51:
pushl $0
80106ed5: 6a 00 push $0x0
pushl $51
80106ed7: 6a 33 push $0x33
jmp alltraps
80106ed9: e9 be f7 ff ff jmp 8010669c <alltraps>
80106ede <vector52>:
.globl vector52
vector52:
pushl $0
80106ede: 6a 00 push $0x0
pushl $52
80106ee0: 6a 34 push $0x34
jmp alltraps
80106ee2: e9 b5 f7 ff ff jmp 8010669c <alltraps>
80106ee7 <vector53>:
.globl vector53
vector53:
pushl $0
80106ee7: 6a 00 push $0x0
pushl $53
80106ee9: 6a 35 push $0x35
jmp alltraps
80106eeb: e9 ac f7 ff ff jmp 8010669c <alltraps>
80106ef0 <vector54>:
.globl vector54
vector54:
pushl $0
80106ef0: 6a 00 push $0x0
pushl $54
80106ef2: 6a 36 push $0x36
jmp alltraps
80106ef4: e9 a3 f7 ff ff jmp 8010669c <alltraps>
80106ef9 <vector55>:
.globl vector55
vector55:
pushl $0
80106ef9: 6a 00 push $0x0
pushl $55
80106efb: 6a 37 push $0x37
jmp alltraps
80106efd: e9 9a f7 ff ff jmp 8010669c <alltraps>
80106f02 <vector56>:
.globl vector56
vector56:
pushl $0
80106f02: 6a 00 push $0x0
pushl $56
80106f04: 6a 38 push $0x38
jmp alltraps
80106f06: e9 91 f7 ff ff jmp 8010669c <alltraps>
80106f0b <vector57>:
.globl vector57
vector57:
pushl $0
80106f0b: 6a 00 push $0x0
pushl $57
80106f0d: 6a 39 push $0x39
jmp alltraps
80106f0f: e9 88 f7 ff ff jmp 8010669c <alltraps>
80106f14 <vector58>:
.globl vector58
vector58:
pushl $0
80106f14: 6a 00 push $0x0
pushl $58
80106f16: 6a 3a push $0x3a
jmp alltraps
80106f18: e9 7f f7 ff ff jmp 8010669c <alltraps>
80106f1d <vector59>:
.globl vector59
vector59:
pushl $0
80106f1d: 6a 00 push $0x0
pushl $59
80106f1f: 6a 3b push $0x3b
jmp alltraps
80106f21: e9 76 f7 ff ff jmp 8010669c <alltraps>
80106f26 <vector60>:
.globl vector60
vector60:
pushl $0
80106f26: 6a 00 push $0x0
pushl $60
80106f28: 6a 3c push $0x3c
jmp alltraps
80106f2a: e9 6d f7 ff ff jmp 8010669c <alltraps>
80106f2f <vector61>:
.globl vector61
vector61:
pushl $0
80106f2f: 6a 00 push $0x0
pushl $61
80106f31: 6a 3d push $0x3d
jmp alltraps
80106f33: e9 64 f7 ff ff jmp 8010669c <alltraps>
80106f38 <vector62>:
.globl vector62
vector62:
pushl $0
80106f38: 6a 00 push $0x0
pushl $62
80106f3a: 6a 3e push $0x3e
jmp alltraps
80106f3c: e9 5b f7 ff ff jmp 8010669c <alltraps>
80106f41 <vector63>:
.globl vector63
vector63:
pushl $0
80106f41: 6a 00 push $0x0
pushl $63
80106f43: 6a 3f push $0x3f
jmp alltraps
80106f45: e9 52 f7 ff ff jmp 8010669c <alltraps>
80106f4a <vector64>:
.globl vector64
vector64:
pushl $0
80106f4a: 6a 00 push $0x0
pushl $64
80106f4c: 6a 40 push $0x40
jmp alltraps
80106f4e: e9 49 f7 ff ff jmp 8010669c <alltraps>
80106f53 <vector65>:
.globl vector65
vector65:
pushl $0
80106f53: 6a 00 push $0x0
pushl $65
80106f55: 6a 41 push $0x41
jmp alltraps
80106f57: e9 40 f7 ff ff jmp 8010669c <alltraps>
80106f5c <vector66>:
.globl vector66
vector66:
pushl $0
80106f5c: 6a 00 push $0x0
pushl $66
80106f5e: 6a 42 push $0x42
jmp alltraps
80106f60: e9 37 f7 ff ff jmp 8010669c <alltraps>
80106f65 <vector67>:
.globl vector67
vector67:
pushl $0
80106f65: 6a 00 push $0x0
pushl $67
80106f67: 6a 43 push $0x43
jmp alltraps
80106f69: e9 2e f7 ff ff jmp 8010669c <alltraps>
80106f6e <vector68>:
.globl vector68
vector68:
pushl $0
80106f6e: 6a 00 push $0x0
pushl $68
80106f70: 6a 44 push $0x44
jmp alltraps
80106f72: e9 25 f7 ff ff jmp 8010669c <alltraps>
80106f77 <vector69>:
.globl vector69
vector69:
pushl $0
80106f77: 6a 00 push $0x0
pushl $69
80106f79: 6a 45 push $0x45
jmp alltraps
80106f7b: e9 1c f7 ff ff jmp 8010669c <alltraps>
80106f80 <vector70>:
.globl vector70
vector70:
pushl $0
80106f80: 6a 00 push $0x0
pushl $70
80106f82: 6a 46 push $0x46
jmp alltraps
80106f84: e9 13 f7 ff ff jmp 8010669c <alltraps>
80106f89 <vector71>:
.globl vector71
vector71:
pushl $0
80106f89: 6a 00 push $0x0
pushl $71
80106f8b: 6a 47 push $0x47
jmp alltraps
80106f8d: e9 0a f7 ff ff jmp 8010669c <alltraps>
80106f92 <vector72>:
.globl vector72
vector72:
pushl $0
80106f92: 6a 00 push $0x0
pushl $72
80106f94: 6a 48 push $0x48
jmp alltraps
80106f96: e9 01 f7 ff ff jmp 8010669c <alltraps>
80106f9b <vector73>:
.globl vector73
vector73:
pushl $0
80106f9b: 6a 00 push $0x0
pushl $73
80106f9d: 6a 49 push $0x49
jmp alltraps
80106f9f: e9 f8 f6 ff ff jmp 8010669c <alltraps>
80106fa4 <vector74>:
.globl vector74
vector74:
pushl $0
80106fa4: 6a 00 push $0x0
pushl $74
80106fa6: 6a 4a push $0x4a
jmp alltraps
80106fa8: e9 ef f6 ff ff jmp 8010669c <alltraps>
80106fad <vector75>:
.globl vector75
vector75:
pushl $0
80106fad: 6a 00 push $0x0
pushl $75
80106faf: 6a 4b push $0x4b
jmp alltraps
80106fb1: e9 e6 f6 ff ff jmp 8010669c <alltraps>
80106fb6 <vector76>:
.globl vector76
vector76:
pushl $0
80106fb6: 6a 00 push $0x0
pushl $76
80106fb8: 6a 4c push $0x4c
jmp alltraps
80106fba: e9 dd f6 ff ff jmp 8010669c <alltraps>
80106fbf <vector77>:
.globl vector77
vector77:
pushl $0
80106fbf: 6a 00 push $0x0
pushl $77
80106fc1: 6a 4d push $0x4d
jmp alltraps
80106fc3: e9 d4 f6 ff ff jmp 8010669c <alltraps>
80106fc8 <vector78>:
.globl vector78
vector78:
pushl $0
80106fc8: 6a 00 push $0x0
pushl $78
80106fca: 6a 4e push $0x4e
jmp alltraps
80106fcc: e9 cb f6 ff ff jmp 8010669c <alltraps>
80106fd1 <vector79>:
.globl vector79
vector79:
pushl $0
80106fd1: 6a 00 push $0x0
pushl $79
80106fd3: 6a 4f push $0x4f
jmp alltraps
80106fd5: e9 c2 f6 ff ff jmp 8010669c <alltraps>
80106fda <vector80>:
.globl vector80
vector80:
pushl $0
80106fda: 6a 00 push $0x0
pushl $80
80106fdc: 6a 50 push $0x50
jmp alltraps
80106fde: e9 b9 f6 ff ff jmp 8010669c <alltraps>
80106fe3 <vector81>:
.globl vector81
vector81:
pushl $0
80106fe3: 6a 00 push $0x0
pushl $81
80106fe5: 6a 51 push $0x51
jmp alltraps
80106fe7: e9 b0 f6 ff ff jmp 8010669c <alltraps>
80106fec <vector82>:
.globl vector82
vector82:
pushl $0
80106fec: 6a 00 push $0x0
pushl $82
80106fee: 6a 52 push $0x52
jmp alltraps
80106ff0: e9 a7 f6 ff ff jmp 8010669c <alltraps>
80106ff5 <vector83>:
.globl vector83
vector83:
pushl $0
80106ff5: 6a 00 push $0x0
pushl $83
80106ff7: 6a 53 push $0x53
jmp alltraps
80106ff9: e9 9e f6 ff ff jmp 8010669c <alltraps>
80106ffe <vector84>:
.globl vector84
vector84:
pushl $0
80106ffe: 6a 00 push $0x0
pushl $84
80107000: 6a 54 push $0x54
jmp alltraps
80107002: e9 95 f6 ff ff jmp 8010669c <alltraps>
80107007 <vector85>:
.globl vector85
vector85:
pushl $0
80107007: 6a 00 push $0x0
pushl $85
80107009: 6a 55 push $0x55
jmp alltraps
8010700b: e9 8c f6 ff ff jmp 8010669c <alltraps>
80107010 <vector86>:
.globl vector86
vector86:
pushl $0
80107010: 6a 00 push $0x0
pushl $86
80107012: 6a 56 push $0x56
jmp alltraps
80107014: e9 83 f6 ff ff jmp 8010669c <alltraps>
80107019 <vector87>:
.globl vector87
vector87:
pushl $0
80107019: 6a 00 push $0x0
pushl $87
8010701b: 6a 57 push $0x57
jmp alltraps
8010701d: e9 7a f6 ff ff jmp 8010669c <alltraps>
80107022 <vector88>:
.globl vector88
vector88:
pushl $0
80107022: 6a 00 push $0x0
pushl $88
80107024: 6a 58 push $0x58
jmp alltraps
80107026: e9 71 f6 ff ff jmp 8010669c <alltraps>
8010702b <vector89>:
.globl vector89
vector89:
pushl $0
8010702b: 6a 00 push $0x0
pushl $89
8010702d: 6a 59 push $0x59
jmp alltraps
8010702f: e9 68 f6 ff ff jmp 8010669c <alltraps>
80107034 <vector90>:
.globl vector90
vector90:
pushl $0
80107034: 6a 00 push $0x0
pushl $90
80107036: 6a 5a push $0x5a
jmp alltraps
80107038: e9 5f f6 ff ff jmp 8010669c <alltraps>
8010703d <vector91>:
.globl vector91
vector91:
pushl $0
8010703d: 6a 00 push $0x0
pushl $91
8010703f: 6a 5b push $0x5b
jmp alltraps
80107041: e9 56 f6 ff ff jmp 8010669c <alltraps>
80107046 <vector92>:
.globl vector92
vector92:
pushl $0
80107046: 6a 00 push $0x0
pushl $92
80107048: 6a 5c push $0x5c
jmp alltraps
8010704a: e9 4d f6 ff ff jmp 8010669c <alltraps>
8010704f <vector93>:
.globl vector93
vector93:
pushl $0
8010704f: 6a 00 push $0x0
pushl $93
80107051: 6a 5d push $0x5d
jmp alltraps
80107053: e9 44 f6 ff ff jmp 8010669c <alltraps>
80107058 <vector94>:
.globl vector94
vector94:
pushl $0
80107058: 6a 00 push $0x0
pushl $94
8010705a: 6a 5e push $0x5e
jmp alltraps
8010705c: e9 3b f6 ff ff jmp 8010669c <alltraps>
80107061 <vector95>:
.globl vector95
vector95:
pushl $0
80107061: 6a 00 push $0x0
pushl $95
80107063: 6a 5f push $0x5f
jmp alltraps
80107065: e9 32 f6 ff ff jmp 8010669c <alltraps>
8010706a <vector96>:
.globl vector96
vector96:
pushl $0
8010706a: 6a 00 push $0x0
pushl $96
8010706c: 6a 60 push $0x60
jmp alltraps
8010706e: e9 29 f6 ff ff jmp 8010669c <alltraps>
80107073 <vector97>:
.globl vector97
vector97:
pushl $0
80107073: 6a 00 push $0x0
pushl $97
80107075: 6a 61 push $0x61
jmp alltraps
80107077: e9 20 f6 ff ff jmp 8010669c <alltraps>
8010707c <vector98>:
.globl vector98
vector98:
pushl $0
8010707c: 6a 00 push $0x0
pushl $98
8010707e: 6a 62 push $0x62
jmp alltraps
80107080: e9 17 f6 ff ff jmp 8010669c <alltraps>
80107085 <vector99>:
.globl vector99
vector99:
pushl $0
80107085: 6a 00 push $0x0
pushl $99
80107087: 6a 63 push $0x63
jmp alltraps
80107089: e9 0e f6 ff ff jmp 8010669c <alltraps>
8010708e <vector100>:
.globl vector100
vector100:
pushl $0
8010708e: 6a 00 push $0x0
pushl $100
80107090: 6a 64 push $0x64
jmp alltraps
80107092: e9 05 f6 ff ff jmp 8010669c <alltraps>
80107097 <vector101>:
.globl vector101
vector101:
pushl $0
80107097: 6a 00 push $0x0
pushl $101
80107099: 6a 65 push $0x65
jmp alltraps
8010709b: e9 fc f5 ff ff jmp 8010669c <alltraps>
801070a0 <vector102>:
.globl vector102
vector102:
pushl $0
801070a0: 6a 00 push $0x0
pushl $102
801070a2: 6a 66 push $0x66
jmp alltraps
801070a4: e9 f3 f5 ff ff jmp 8010669c <alltraps>
801070a9 <vector103>:
.globl vector103
vector103:
pushl $0
801070a9: 6a 00 push $0x0
pushl $103
801070ab: 6a 67 push $0x67
jmp alltraps
801070ad: e9 ea f5 ff ff jmp 8010669c <alltraps>
801070b2 <vector104>:
.globl vector104
vector104:
pushl $0
801070b2: 6a 00 push $0x0
pushl $104
801070b4: 6a 68 push $0x68
jmp alltraps
801070b6: e9 e1 f5 ff ff jmp 8010669c <alltraps>
801070bb <vector105>:
.globl vector105
vector105:
pushl $0
801070bb: 6a 00 push $0x0
pushl $105
801070bd: 6a 69 push $0x69
jmp alltraps
801070bf: e9 d8 f5 ff ff jmp 8010669c <alltraps>
801070c4 <vector106>:
.globl vector106
vector106:
pushl $0
801070c4: 6a 00 push $0x0
pushl $106
801070c6: 6a 6a push $0x6a
jmp alltraps
801070c8: e9 cf f5 ff ff jmp 8010669c <alltraps>
801070cd <vector107>:
.globl vector107
vector107:
pushl $0
801070cd: 6a 00 push $0x0
pushl $107
801070cf: 6a 6b push $0x6b
jmp alltraps
801070d1: e9 c6 f5 ff ff jmp 8010669c <alltraps>
801070d6 <vector108>:
.globl vector108
vector108:
pushl $0
801070d6: 6a 00 push $0x0
pushl $108
801070d8: 6a 6c push $0x6c
jmp alltraps
801070da: e9 bd f5 ff ff jmp 8010669c <alltraps>
801070df <vector109>:
.globl vector109
vector109:
pushl $0
801070df: 6a 00 push $0x0
pushl $109
801070e1: 6a 6d push $0x6d
jmp alltraps
801070e3: e9 b4 f5 ff ff jmp 8010669c <alltraps>
801070e8 <vector110>:
.globl vector110
vector110:
pushl $0
801070e8: 6a 00 push $0x0
pushl $110
801070ea: 6a 6e push $0x6e
jmp alltraps
801070ec: e9 ab f5 ff ff jmp 8010669c <alltraps>
801070f1 <vector111>:
.globl vector111
vector111:
pushl $0
801070f1: 6a 00 push $0x0
pushl $111
801070f3: 6a 6f push $0x6f
jmp alltraps
801070f5: e9 a2 f5 ff ff jmp 8010669c <alltraps>
801070fa <vector112>:
.globl vector112
vector112:
pushl $0
801070fa: 6a 00 push $0x0
pushl $112
801070fc: 6a 70 push $0x70
jmp alltraps
801070fe: e9 99 f5 ff ff jmp 8010669c <alltraps>
80107103 <vector113>:
.globl vector113
vector113:
pushl $0
80107103: 6a 00 push $0x0
pushl $113
80107105: 6a 71 push $0x71
jmp alltraps
80107107: e9 90 f5 ff ff jmp 8010669c <alltraps>
8010710c <vector114>:
.globl vector114
vector114:
pushl $0
8010710c: 6a 00 push $0x0
pushl $114
8010710e: 6a 72 push $0x72
jmp alltraps
80107110: e9 87 f5 ff ff jmp 8010669c <alltraps>
80107115 <vector115>:
.globl vector115
vector115:
pushl $0
80107115: 6a 00 push $0x0
pushl $115
80107117: 6a 73 push $0x73
jmp alltraps
80107119: e9 7e f5 ff ff jmp 8010669c <alltraps>
8010711e <vector116>:
.globl vector116
vector116:
pushl $0
8010711e: 6a 00 push $0x0
pushl $116
80107120: 6a 74 push $0x74
jmp alltraps
80107122: e9 75 f5 ff ff jmp 8010669c <alltraps>
80107127 <vector117>:
.globl vector117
vector117:
pushl $0
80107127: 6a 00 push $0x0
pushl $117
80107129: 6a 75 push $0x75
jmp alltraps
8010712b: e9 6c f5 ff ff jmp 8010669c <alltraps>
80107130 <vector118>:
.globl vector118
vector118:
pushl $0
80107130: 6a 00 push $0x0
pushl $118
80107132: 6a 76 push $0x76
jmp alltraps
80107134: e9 63 f5 ff ff jmp 8010669c <alltraps>
80107139 <vector119>:
.globl vector119
vector119:
pushl $0
80107139: 6a 00 push $0x0
pushl $119
8010713b: 6a 77 push $0x77
jmp alltraps
8010713d: e9 5a f5 ff ff jmp 8010669c <alltraps>
80107142 <vector120>:
.globl vector120
vector120:
pushl $0
80107142: 6a 00 push $0x0
pushl $120
80107144: 6a 78 push $0x78
jmp alltraps
80107146: e9 51 f5 ff ff jmp 8010669c <alltraps>
8010714b <vector121>:
.globl vector121
vector121:
pushl $0
8010714b: 6a 00 push $0x0
pushl $121
8010714d: 6a 79 push $0x79
jmp alltraps
8010714f: e9 48 f5 ff ff jmp 8010669c <alltraps>
80107154 <vector122>:
.globl vector122
vector122:
pushl $0
80107154: 6a 00 push $0x0
pushl $122
80107156: 6a 7a push $0x7a
jmp alltraps
80107158: e9 3f f5 ff ff jmp 8010669c <alltraps>
8010715d <vector123>:
.globl vector123
vector123:
pushl $0
8010715d: 6a 00 push $0x0
pushl $123
8010715f: 6a 7b push $0x7b
jmp alltraps
80107161: e9 36 f5 ff ff jmp 8010669c <alltraps>
80107166 <vector124>:
.globl vector124
vector124:
pushl $0
80107166: 6a 00 push $0x0
pushl $124
80107168: 6a 7c push $0x7c
jmp alltraps
8010716a: e9 2d f5 ff ff jmp 8010669c <alltraps>
8010716f <vector125>:
.globl vector125
vector125:
pushl $0
8010716f: 6a 00 push $0x0
pushl $125
80107171: 6a 7d push $0x7d
jmp alltraps
80107173: e9 24 f5 ff ff jmp 8010669c <alltraps>
80107178 <vector126>:
.globl vector126
vector126:
pushl $0
80107178: 6a 00 push $0x0
pushl $126
8010717a: 6a 7e push $0x7e
jmp alltraps
8010717c: e9 1b f5 ff ff jmp 8010669c <alltraps>
80107181 <vector127>:
.globl vector127
vector127:
pushl $0
80107181: 6a 00 push $0x0
pushl $127
80107183: 6a 7f push $0x7f
jmp alltraps
80107185: e9 12 f5 ff ff jmp 8010669c <alltraps>
8010718a <vector128>:
.globl vector128
vector128:
pushl $0
8010718a: 6a 00 push $0x0
pushl $128
8010718c: 68 80 00 00 00 push $0x80
jmp alltraps
80107191: e9 06 f5 ff ff jmp 8010669c <alltraps>
80107196 <vector129>:
.globl vector129
vector129:
pushl $0
80107196: 6a 00 push $0x0
pushl $129
80107198: 68 81 00 00 00 push $0x81
jmp alltraps
8010719d: e9 fa f4 ff ff jmp 8010669c <alltraps>
801071a2 <vector130>:
.globl vector130
vector130:
pushl $0
801071a2: 6a 00 push $0x0
pushl $130
801071a4: 68 82 00 00 00 push $0x82
jmp alltraps
801071a9: e9 ee f4 ff ff jmp 8010669c <alltraps>
801071ae <vector131>:
.globl vector131
vector131:
pushl $0
801071ae: 6a 00 push $0x0
pushl $131
801071b0: 68 83 00 00 00 push $0x83
jmp alltraps
801071b5: e9 e2 f4 ff ff jmp 8010669c <alltraps>
801071ba <vector132>:
.globl vector132
vector132:
pushl $0
801071ba: 6a 00 push $0x0
pushl $132
801071bc: 68 84 00 00 00 push $0x84
jmp alltraps
801071c1: e9 d6 f4 ff ff jmp 8010669c <alltraps>
801071c6 <vector133>:
.globl vector133
vector133:
pushl $0
801071c6: 6a 00 push $0x0
pushl $133
801071c8: 68 85 00 00 00 push $0x85
jmp alltraps
801071cd: e9 ca f4 ff ff jmp 8010669c <alltraps>
801071d2 <vector134>:
.globl vector134
vector134:
pushl $0
801071d2: 6a 00 push $0x0
pushl $134
801071d4: 68 86 00 00 00 push $0x86
jmp alltraps
801071d9: e9 be f4 ff ff jmp 8010669c <alltraps>
801071de <vector135>:
.globl vector135
vector135:
pushl $0
801071de: 6a 00 push $0x0
pushl $135
801071e0: 68 87 00 00 00 push $0x87
jmp alltraps
801071e5: e9 b2 f4 ff ff jmp 8010669c <alltraps>
801071ea <vector136>:
.globl vector136
vector136:
pushl $0
801071ea: 6a 00 push $0x0
pushl $136
801071ec: 68 88 00 00 00 push $0x88
jmp alltraps
801071f1: e9 a6 f4 ff ff jmp 8010669c <alltraps>
801071f6 <vector137>:
.globl vector137
vector137:
pushl $0
801071f6: 6a 00 push $0x0
pushl $137
801071f8: 68 89 00 00 00 push $0x89
jmp alltraps
801071fd: e9 9a f4 ff ff jmp 8010669c <alltraps>
80107202 <vector138>:
.globl vector138
vector138:
pushl $0
80107202: 6a 00 push $0x0
pushl $138
80107204: 68 8a 00 00 00 push $0x8a
jmp alltraps
80107209: e9 8e f4 ff ff jmp 8010669c <alltraps>
8010720e <vector139>:
.globl vector139
vector139:
pushl $0
8010720e: 6a 00 push $0x0
pushl $139
80107210: 68 8b 00 00 00 push $0x8b
jmp alltraps
80107215: e9 82 f4 ff ff jmp 8010669c <alltraps>
8010721a <vector140>:
.globl vector140
vector140:
pushl $0
8010721a: 6a 00 push $0x0
pushl $140
8010721c: 68 8c 00 00 00 push $0x8c
jmp alltraps
80107221: e9 76 f4 ff ff jmp 8010669c <alltraps>
80107226 <vector141>:
.globl vector141
vector141:
pushl $0
80107226: 6a 00 push $0x0
pushl $141
80107228: 68 8d 00 00 00 push $0x8d
jmp alltraps
8010722d: e9 6a f4 ff ff jmp 8010669c <alltraps>
80107232 <vector142>:
.globl vector142
vector142:
pushl $0
80107232: 6a 00 push $0x0
pushl $142
80107234: 68 8e 00 00 00 push $0x8e
jmp alltraps
80107239: e9 5e f4 ff ff jmp 8010669c <alltraps>
8010723e <vector143>:
.globl vector143
vector143:
pushl $0
8010723e: 6a 00 push $0x0
pushl $143
80107240: 68 8f 00 00 00 push $0x8f
jmp alltraps
80107245: e9 52 f4 ff ff jmp 8010669c <alltraps>
8010724a <vector144>:
.globl vector144
vector144:
pushl $0
8010724a: 6a 00 push $0x0
pushl $144
8010724c: 68 90 00 00 00 push $0x90
jmp alltraps
80107251: e9 46 f4 ff ff jmp 8010669c <alltraps>
80107256 <vector145>:
.globl vector145
vector145:
pushl $0
80107256: 6a 00 push $0x0
pushl $145
80107258: 68 91 00 00 00 push $0x91
jmp alltraps
8010725d: e9 3a f4 ff ff jmp 8010669c <alltraps>
80107262 <vector146>:
.globl vector146
vector146:
pushl $0
80107262: 6a 00 push $0x0
pushl $146
80107264: 68 92 00 00 00 push $0x92
jmp alltraps
80107269: e9 2e f4 ff ff jmp 8010669c <alltraps>
8010726e <vector147>:
.globl vector147
vector147:
pushl $0
8010726e: 6a 00 push $0x0
pushl $147
80107270: 68 93 00 00 00 push $0x93
jmp alltraps
80107275: e9 22 f4 ff ff jmp 8010669c <alltraps>
8010727a <vector148>:
.globl vector148
vector148:
pushl $0
8010727a: 6a 00 push $0x0
pushl $148
8010727c: 68 94 00 00 00 push $0x94
jmp alltraps
80107281: e9 16 f4 ff ff jmp 8010669c <alltraps>
80107286 <vector149>:
.globl vector149
vector149:
pushl $0
80107286: 6a 00 push $0x0
pushl $149
80107288: 68 95 00 00 00 push $0x95
jmp alltraps
8010728d: e9 0a f4 ff ff jmp 8010669c <alltraps>
80107292 <vector150>:
.globl vector150
vector150:
pushl $0
80107292: 6a 00 push $0x0
pushl $150
80107294: 68 96 00 00 00 push $0x96
jmp alltraps
80107299: e9 fe f3 ff ff jmp 8010669c <alltraps>
8010729e <vector151>:
.globl vector151
vector151:
pushl $0
8010729e: 6a 00 push $0x0
pushl $151
801072a0: 68 97 00 00 00 push $0x97
jmp alltraps
801072a5: e9 f2 f3 ff ff jmp 8010669c <alltraps>
801072aa <vector152>:
.globl vector152
vector152:
pushl $0
801072aa: 6a 00 push $0x0
pushl $152
801072ac: 68 98 00 00 00 push $0x98
jmp alltraps
801072b1: e9 e6 f3 ff ff jmp 8010669c <alltraps>
801072b6 <vector153>:
.globl vector153
vector153:
pushl $0
801072b6: 6a 00 push $0x0
pushl $153
801072b8: 68 99 00 00 00 push $0x99
jmp alltraps
801072bd: e9 da f3 ff ff jmp 8010669c <alltraps>
801072c2 <vector154>:
.globl vector154
vector154:
pushl $0
801072c2: 6a 00 push $0x0
pushl $154
801072c4: 68 9a 00 00 00 push $0x9a
jmp alltraps
801072c9: e9 ce f3 ff ff jmp 8010669c <alltraps>
801072ce <vector155>:
.globl vector155
vector155:
pushl $0
801072ce: 6a 00 push $0x0
pushl $155
801072d0: 68 9b 00 00 00 push $0x9b
jmp alltraps
801072d5: e9 c2 f3 ff ff jmp 8010669c <alltraps>
801072da <vector156>:
.globl vector156
vector156:
pushl $0
801072da: 6a 00 push $0x0
pushl $156
801072dc: 68 9c 00 00 00 push $0x9c
jmp alltraps
801072e1: e9 b6 f3 ff ff jmp 8010669c <alltraps>
801072e6 <vector157>:
.globl vector157
vector157:
pushl $0
801072e6: 6a 00 push $0x0
pushl $157
801072e8: 68 9d 00 00 00 push $0x9d
jmp alltraps
801072ed: e9 aa f3 ff ff jmp 8010669c <alltraps>
801072f2 <vector158>:
.globl vector158
vector158:
pushl $0
801072f2: 6a 00 push $0x0
pushl $158
801072f4: 68 9e 00 00 00 push $0x9e
jmp alltraps
801072f9: e9 9e f3 ff ff jmp 8010669c <alltraps>
801072fe <vector159>:
.globl vector159
vector159:
pushl $0
801072fe: 6a 00 push $0x0
pushl $159
80107300: 68 9f 00 00 00 push $0x9f
jmp alltraps
80107305: e9 92 f3 ff ff jmp 8010669c <alltraps>
8010730a <vector160>:
.globl vector160
vector160:
pushl $0
8010730a: 6a 00 push $0x0
pushl $160
8010730c: 68 a0 00 00 00 push $0xa0
jmp alltraps
80107311: e9 86 f3 ff ff jmp 8010669c <alltraps>
80107316 <vector161>:
.globl vector161
vector161:
pushl $0
80107316: 6a 00 push $0x0
pushl $161
80107318: 68 a1 00 00 00 push $0xa1
jmp alltraps
8010731d: e9 7a f3 ff ff jmp 8010669c <alltraps>
80107322 <vector162>:
.globl vector162
vector162:
pushl $0
80107322: 6a 00 push $0x0
pushl $162
80107324: 68 a2 00 00 00 push $0xa2
jmp alltraps
80107329: e9 6e f3 ff ff jmp 8010669c <alltraps>
8010732e <vector163>:
.globl vector163
vector163:
pushl $0
8010732e: 6a 00 push $0x0
pushl $163
80107330: 68 a3 00 00 00 push $0xa3
jmp alltraps
80107335: e9 62 f3 ff ff jmp 8010669c <alltraps>
8010733a <vector164>:
.globl vector164
vector164:
pushl $0
8010733a: 6a 00 push $0x0
pushl $164
8010733c: 68 a4 00 00 00 push $0xa4
jmp alltraps
80107341: e9 56 f3 ff ff jmp 8010669c <alltraps>
80107346 <vector165>:
.globl vector165
vector165:
pushl $0
80107346: 6a 00 push $0x0
pushl $165
80107348: 68 a5 00 00 00 push $0xa5
jmp alltraps
8010734d: e9 4a f3 ff ff jmp 8010669c <alltraps>
80107352 <vector166>:
.globl vector166
vector166:
pushl $0
80107352: 6a 00 push $0x0
pushl $166
80107354: 68 a6 00 00 00 push $0xa6
jmp alltraps
80107359: e9 3e f3 ff ff jmp 8010669c <alltraps>
8010735e <vector167>:
.globl vector167
vector167:
pushl $0
8010735e: 6a 00 push $0x0
pushl $167
80107360: 68 a7 00 00 00 push $0xa7
jmp alltraps
80107365: e9 32 f3 ff ff jmp 8010669c <alltraps>
8010736a <vector168>:
.globl vector168
vector168:
pushl $0
8010736a: 6a 00 push $0x0
pushl $168
8010736c: 68 a8 00 00 00 push $0xa8
jmp alltraps
80107371: e9 26 f3 ff ff jmp 8010669c <alltraps>
80107376 <vector169>:
.globl vector169
vector169:
pushl $0
80107376: 6a 00 push $0x0
pushl $169
80107378: 68 a9 00 00 00 push $0xa9
jmp alltraps
8010737d: e9 1a f3 ff ff jmp 8010669c <alltraps>
80107382 <vector170>:
.globl vector170
vector170:
pushl $0
80107382: 6a 00 push $0x0
pushl $170
80107384: 68 aa 00 00 00 push $0xaa
jmp alltraps
80107389: e9 0e f3 ff ff jmp 8010669c <alltraps>
8010738e <vector171>:
.globl vector171
vector171:
pushl $0
8010738e: 6a 00 push $0x0
pushl $171
80107390: 68 ab 00 00 00 push $0xab
jmp alltraps
80107395: e9 02 f3 ff ff jmp 8010669c <alltraps>
8010739a <vector172>:
.globl vector172
vector172:
pushl $0
8010739a: 6a 00 push $0x0
pushl $172
8010739c: 68 ac 00 00 00 push $0xac
jmp alltraps
801073a1: e9 f6 f2 ff ff jmp 8010669c <alltraps>
801073a6 <vector173>:
.globl vector173
vector173:
pushl $0
801073a6: 6a 00 push $0x0
pushl $173
801073a8: 68 ad 00 00 00 push $0xad
jmp alltraps
801073ad: e9 ea f2 ff ff jmp 8010669c <alltraps>
801073b2 <vector174>:
.globl vector174
vector174:
pushl $0
801073b2: 6a 00 push $0x0
pushl $174
801073b4: 68 ae 00 00 00 push $0xae
jmp alltraps
801073b9: e9 de f2 ff ff jmp 8010669c <alltraps>
801073be <vector175>:
.globl vector175
vector175:
pushl $0
801073be: 6a 00 push $0x0
pushl $175
801073c0: 68 af 00 00 00 push $0xaf
jmp alltraps
801073c5: e9 d2 f2 ff ff jmp 8010669c <alltraps>
801073ca <vector176>:
.globl vector176
vector176:
pushl $0
801073ca: 6a 00 push $0x0
pushl $176
801073cc: 68 b0 00 00 00 push $0xb0
jmp alltraps
801073d1: e9 c6 f2 ff ff jmp 8010669c <alltraps>
801073d6 <vector177>:
.globl vector177
vector177:
pushl $0
801073d6: 6a 00 push $0x0
pushl $177
801073d8: 68 b1 00 00 00 push $0xb1
jmp alltraps
801073dd: e9 ba f2 ff ff jmp 8010669c <alltraps>
801073e2 <vector178>:
.globl vector178
vector178:
pushl $0
801073e2: 6a 00 push $0x0
pushl $178
801073e4: 68 b2 00 00 00 push $0xb2
jmp alltraps
801073e9: e9 ae f2 ff ff jmp 8010669c <alltraps>
801073ee <vector179>:
.globl vector179
vector179:
pushl $0
801073ee: 6a 00 push $0x0
pushl $179
801073f0: 68 b3 00 00 00 push $0xb3
jmp alltraps
801073f5: e9 a2 f2 ff ff jmp 8010669c <alltraps>
801073fa <vector180>:
.globl vector180
vector180:
pushl $0
801073fa: 6a 00 push $0x0
pushl $180
801073fc: 68 b4 00 00 00 push $0xb4
jmp alltraps
80107401: e9 96 f2 ff ff jmp 8010669c <alltraps>
80107406 <vector181>:
.globl vector181
vector181:
pushl $0
80107406: 6a 00 push $0x0
pushl $181
80107408: 68 b5 00 00 00 push $0xb5
jmp alltraps
8010740d: e9 8a f2 ff ff jmp 8010669c <alltraps>
80107412 <vector182>:
.globl vector182
vector182:
pushl $0
80107412: 6a 00 push $0x0
pushl $182
80107414: 68 b6 00 00 00 push $0xb6
jmp alltraps
80107419: e9 7e f2 ff ff jmp 8010669c <alltraps>
8010741e <vector183>:
.globl vector183
vector183:
pushl $0
8010741e: 6a 00 push $0x0
pushl $183
80107420: 68 b7 00 00 00 push $0xb7
jmp alltraps
80107425: e9 72 f2 ff ff jmp 8010669c <alltraps>
8010742a <vector184>:
.globl vector184
vector184:
pushl $0
8010742a: 6a 00 push $0x0
pushl $184
8010742c: 68 b8 00 00 00 push $0xb8
jmp alltraps
80107431: e9 66 f2 ff ff jmp 8010669c <alltraps>
80107436 <vector185>:
.globl vector185
vector185:
pushl $0
80107436: 6a 00 push $0x0
pushl $185
80107438: 68 b9 00 00 00 push $0xb9
jmp alltraps
8010743d: e9 5a f2 ff ff jmp 8010669c <alltraps>
80107442 <vector186>:
.globl vector186
vector186:
pushl $0
80107442: 6a 00 push $0x0
pushl $186
80107444: 68 ba 00 00 00 push $0xba
jmp alltraps
80107449: e9 4e f2 ff ff jmp 8010669c <alltraps>
8010744e <vector187>:
.globl vector187
vector187:
pushl $0
8010744e: 6a 00 push $0x0
pushl $187
80107450: 68 bb 00 00 00 push $0xbb
jmp alltraps
80107455: e9 42 f2 ff ff jmp 8010669c <alltraps>
8010745a <vector188>:
.globl vector188
vector188:
pushl $0
8010745a: 6a 00 push $0x0
pushl $188
8010745c: 68 bc 00 00 00 push $0xbc
jmp alltraps
80107461: e9 36 f2 ff ff jmp 8010669c <alltraps>
80107466 <vector189>:
.globl vector189
vector189:
pushl $0
80107466: 6a 00 push $0x0
pushl $189
80107468: 68 bd 00 00 00 push $0xbd
jmp alltraps
8010746d: e9 2a f2 ff ff jmp 8010669c <alltraps>
80107472 <vector190>:
.globl vector190
vector190:
pushl $0
80107472: 6a 00 push $0x0
pushl $190
80107474: 68 be 00 00 00 push $0xbe
jmp alltraps
80107479: e9 1e f2 ff ff jmp 8010669c <alltraps>
8010747e <vector191>:
.globl vector191
vector191:
pushl $0
8010747e: 6a 00 push $0x0
pushl $191
80107480: 68 bf 00 00 00 push $0xbf
jmp alltraps
80107485: e9 12 f2 ff ff jmp 8010669c <alltraps>
8010748a <vector192>:
.globl vector192
vector192:
pushl $0
8010748a: 6a 00 push $0x0
pushl $192
8010748c: 68 c0 00 00 00 push $0xc0
jmp alltraps
80107491: e9 06 f2 ff ff jmp 8010669c <alltraps>
80107496 <vector193>:
.globl vector193
vector193:
pushl $0
80107496: 6a 00 push $0x0
pushl $193
80107498: 68 c1 00 00 00 push $0xc1
jmp alltraps
8010749d: e9 fa f1 ff ff jmp 8010669c <alltraps>
801074a2 <vector194>:
.globl vector194
vector194:
pushl $0
801074a2: 6a 00 push $0x0
pushl $194
801074a4: 68 c2 00 00 00 push $0xc2
jmp alltraps
801074a9: e9 ee f1 ff ff jmp 8010669c <alltraps>
801074ae <vector195>:
.globl vector195
vector195:
pushl $0
801074ae: 6a 00 push $0x0
pushl $195
801074b0: 68 c3 00 00 00 push $0xc3
jmp alltraps
801074b5: e9 e2 f1 ff ff jmp 8010669c <alltraps>
801074ba <vector196>:
.globl vector196
vector196:
pushl $0
801074ba: 6a 00 push $0x0
pushl $196
801074bc: 68 c4 00 00 00 push $0xc4
jmp alltraps
801074c1: e9 d6 f1 ff ff jmp 8010669c <alltraps>
801074c6 <vector197>:
.globl vector197
vector197:
pushl $0
801074c6: 6a 00 push $0x0
pushl $197
801074c8: 68 c5 00 00 00 push $0xc5
jmp alltraps
801074cd: e9 ca f1 ff ff jmp 8010669c <alltraps>
801074d2 <vector198>:
.globl vector198
vector198:
pushl $0
801074d2: 6a 00 push $0x0
pushl $198
801074d4: 68 c6 00 00 00 push $0xc6
jmp alltraps
801074d9: e9 be f1 ff ff jmp 8010669c <alltraps>
801074de <vector199>:
.globl vector199
vector199:
pushl $0
801074de: 6a 00 push $0x0
pushl $199
801074e0: 68 c7 00 00 00 push $0xc7
jmp alltraps
801074e5: e9 b2 f1 ff ff jmp 8010669c <alltraps>
801074ea <vector200>:
.globl vector200
vector200:
pushl $0
801074ea: 6a 00 push $0x0
pushl $200
801074ec: 68 c8 00 00 00 push $0xc8
jmp alltraps
801074f1: e9 a6 f1 ff ff jmp 8010669c <alltraps>
801074f6 <vector201>:
.globl vector201
vector201:
pushl $0
801074f6: 6a 00 push $0x0
pushl $201
801074f8: 68 c9 00 00 00 push $0xc9
jmp alltraps
801074fd: e9 9a f1 ff ff jmp 8010669c <alltraps>
80107502 <vector202>:
.globl vector202
vector202:
pushl $0
80107502: 6a 00 push $0x0
pushl $202
80107504: 68 ca 00 00 00 push $0xca
jmp alltraps
80107509: e9 8e f1 ff ff jmp 8010669c <alltraps>
8010750e <vector203>:
.globl vector203
vector203:
pushl $0
8010750e: 6a 00 push $0x0
pushl $203
80107510: 68 cb 00 00 00 push $0xcb
jmp alltraps
80107515: e9 82 f1 ff ff jmp 8010669c <alltraps>
8010751a <vector204>:
.globl vector204
vector204:
pushl $0
8010751a: 6a 00 push $0x0
pushl $204
8010751c: 68 cc 00 00 00 push $0xcc
jmp alltraps
80107521: e9 76 f1 ff ff jmp 8010669c <alltraps>
80107526 <vector205>:
.globl vector205
vector205:
pushl $0
80107526: 6a 00 push $0x0
pushl $205
80107528: 68 cd 00 00 00 push $0xcd
jmp alltraps
8010752d: e9 6a f1 ff ff jmp 8010669c <alltraps>
80107532 <vector206>:
.globl vector206
vector206:
pushl $0
80107532: 6a 00 push $0x0
pushl $206
80107534: 68 ce 00 00 00 push $0xce
jmp alltraps
80107539: e9 5e f1 ff ff jmp 8010669c <alltraps>
8010753e <vector207>:
.globl vector207
vector207:
pushl $0
8010753e: 6a 00 push $0x0
pushl $207
80107540: 68 cf 00 00 00 push $0xcf
jmp alltraps
80107545: e9 52 f1 ff ff jmp 8010669c <alltraps>
8010754a <vector208>:
.globl vector208
vector208:
pushl $0
8010754a: 6a 00 push $0x0
pushl $208
8010754c: 68 d0 00 00 00 push $0xd0
jmp alltraps
80107551: e9 46 f1 ff ff jmp 8010669c <alltraps>
80107556 <vector209>:
.globl vector209
vector209:
pushl $0
80107556: 6a 00 push $0x0
pushl $209
80107558: 68 d1 00 00 00 push $0xd1
jmp alltraps
8010755d: e9 3a f1 ff ff jmp 8010669c <alltraps>
80107562 <vector210>:
.globl vector210
vector210:
pushl $0
80107562: 6a 00 push $0x0
pushl $210
80107564: 68 d2 00 00 00 push $0xd2
jmp alltraps
80107569: e9 2e f1 ff ff jmp 8010669c <alltraps>
8010756e <vector211>:
.globl vector211
vector211:
pushl $0
8010756e: 6a 00 push $0x0
pushl $211
80107570: 68 d3 00 00 00 push $0xd3
jmp alltraps
80107575: e9 22 f1 ff ff jmp 8010669c <alltraps>
8010757a <vector212>:
.globl vector212
vector212:
pushl $0
8010757a: 6a 00 push $0x0
pushl $212
8010757c: 68 d4 00 00 00 push $0xd4
jmp alltraps
80107581: e9 16 f1 ff ff jmp 8010669c <alltraps>
80107586 <vector213>:
.globl vector213
vector213:
pushl $0
80107586: 6a 00 push $0x0
pushl $213
80107588: 68 d5 00 00 00 push $0xd5
jmp alltraps
8010758d: e9 0a f1 ff ff jmp 8010669c <alltraps>
80107592 <vector214>:
.globl vector214
vector214:
pushl $0
80107592: 6a 00 push $0x0
pushl $214
80107594: 68 d6 00 00 00 push $0xd6
jmp alltraps
80107599: e9 fe f0 ff ff jmp 8010669c <alltraps>
8010759e <vector215>:
.globl vector215
vector215:
pushl $0
8010759e: 6a 00 push $0x0
pushl $215
801075a0: 68 d7 00 00 00 push $0xd7
jmp alltraps
801075a5: e9 f2 f0 ff ff jmp 8010669c <alltraps>
801075aa <vector216>:
.globl vector216
vector216:
pushl $0
801075aa: 6a 00 push $0x0
pushl $216
801075ac: 68 d8 00 00 00 push $0xd8
jmp alltraps
801075b1: e9 e6 f0 ff ff jmp 8010669c <alltraps>
801075b6 <vector217>:
.globl vector217
vector217:
pushl $0
801075b6: 6a 00 push $0x0
pushl $217
801075b8: 68 d9 00 00 00 push $0xd9
jmp alltraps
801075bd: e9 da f0 ff ff jmp 8010669c <alltraps>
801075c2 <vector218>:
.globl vector218
vector218:
pushl $0
801075c2: 6a 00 push $0x0
pushl $218
801075c4: 68 da 00 00 00 push $0xda
jmp alltraps
801075c9: e9 ce f0 ff ff jmp 8010669c <alltraps>
801075ce <vector219>:
.globl vector219
vector219:
pushl $0
801075ce: 6a 00 push $0x0
pushl $219
801075d0: 68 db 00 00 00 push $0xdb
jmp alltraps
801075d5: e9 c2 f0 ff ff jmp 8010669c <alltraps>
801075da <vector220>:
.globl vector220
vector220:
pushl $0
801075da: 6a 00 push $0x0
pushl $220
801075dc: 68 dc 00 00 00 push $0xdc
jmp alltraps
801075e1: e9 b6 f0 ff ff jmp 8010669c <alltraps>
801075e6 <vector221>:
.globl vector221
vector221:
pushl $0
801075e6: 6a 00 push $0x0
pushl $221
801075e8: 68 dd 00 00 00 push $0xdd
jmp alltraps
801075ed: e9 aa f0 ff ff jmp 8010669c <alltraps>
801075f2 <vector222>:
.globl vector222
vector222:
pushl $0
801075f2: 6a 00 push $0x0
pushl $222
801075f4: 68 de 00 00 00 push $0xde
jmp alltraps
801075f9: e9 9e f0 ff ff jmp 8010669c <alltraps>
801075fe <vector223>:
.globl vector223
vector223:
pushl $0
801075fe: 6a 00 push $0x0
pushl $223
80107600: 68 df 00 00 00 push $0xdf
jmp alltraps
80107605: e9 92 f0 ff ff jmp 8010669c <alltraps>
8010760a <vector224>:
.globl vector224
vector224:
pushl $0
8010760a: 6a 00 push $0x0
pushl $224
8010760c: 68 e0 00 00 00 push $0xe0
jmp alltraps
80107611: e9 86 f0 ff ff jmp 8010669c <alltraps>
80107616 <vector225>:
.globl vector225
vector225:
pushl $0
80107616: 6a 00 push $0x0
pushl $225
80107618: 68 e1 00 00 00 push $0xe1
jmp alltraps
8010761d: e9 7a f0 ff ff jmp 8010669c <alltraps>
80107622 <vector226>:
.globl vector226
vector226:
pushl $0
80107622: 6a 00 push $0x0
pushl $226
80107624: 68 e2 00 00 00 push $0xe2
jmp alltraps
80107629: e9 6e f0 ff ff jmp 8010669c <alltraps>
8010762e <vector227>:
.globl vector227
vector227:
pushl $0
8010762e: 6a 00 push $0x0
pushl $227
80107630: 68 e3 00 00 00 push $0xe3
jmp alltraps
80107635: e9 62 f0 ff ff jmp 8010669c <alltraps>
8010763a <vector228>:
.globl vector228
vector228:
pushl $0
8010763a: 6a 00 push $0x0
pushl $228
8010763c: 68 e4 00 00 00 push $0xe4
jmp alltraps
80107641: e9 56 f0 ff ff jmp 8010669c <alltraps>
80107646 <vector229>:
.globl vector229
vector229:
pushl $0
80107646: 6a 00 push $0x0
pushl $229
80107648: 68 e5 00 00 00 push $0xe5
jmp alltraps
8010764d: e9 4a f0 ff ff jmp 8010669c <alltraps>
80107652 <vector230>:
.globl vector230
vector230:
pushl $0
80107652: 6a 00 push $0x0
pushl $230
80107654: 68 e6 00 00 00 push $0xe6
jmp alltraps
80107659: e9 3e f0 ff ff jmp 8010669c <alltraps>
8010765e <vector231>:
.globl vector231
vector231:
pushl $0
8010765e: 6a 00 push $0x0
pushl $231
80107660: 68 e7 00 00 00 push $0xe7
jmp alltraps
80107665: e9 32 f0 ff ff jmp 8010669c <alltraps>
8010766a <vector232>:
.globl vector232
vector232:
pushl $0
8010766a: 6a 00 push $0x0
pushl $232
8010766c: 68 e8 00 00 00 push $0xe8
jmp alltraps
80107671: e9 26 f0 ff ff jmp 8010669c <alltraps>
80107676 <vector233>:
.globl vector233
vector233:
pushl $0
80107676: 6a 00 push $0x0
pushl $233
80107678: 68 e9 00 00 00 push $0xe9
jmp alltraps
8010767d: e9 1a f0 ff ff jmp 8010669c <alltraps>
80107682 <vector234>:
.globl vector234
vector234:
pushl $0
80107682: 6a 00 push $0x0
pushl $234
80107684: 68 ea 00 00 00 push $0xea
jmp alltraps
80107689: e9 0e f0 ff ff jmp 8010669c <alltraps>
8010768e <vector235>:
.globl vector235
vector235:
pushl $0
8010768e: 6a 00 push $0x0
pushl $235
80107690: 68 eb 00 00 00 push $0xeb
jmp alltraps
80107695: e9 02 f0 ff ff jmp 8010669c <alltraps>
8010769a <vector236>:
.globl vector236
vector236:
pushl $0
8010769a: 6a 00 push $0x0
pushl $236
8010769c: 68 ec 00 00 00 push $0xec
jmp alltraps
801076a1: e9 f6 ef ff ff jmp 8010669c <alltraps>
801076a6 <vector237>:
.globl vector237
vector237:
pushl $0
801076a6: 6a 00 push $0x0
pushl $237
801076a8: 68 ed 00 00 00 push $0xed
jmp alltraps
801076ad: e9 ea ef ff ff jmp 8010669c <alltraps>
801076b2 <vector238>:
.globl vector238
vector238:
pushl $0
801076b2: 6a 00 push $0x0
pushl $238
801076b4: 68 ee 00 00 00 push $0xee
jmp alltraps
801076b9: e9 de ef ff ff jmp 8010669c <alltraps>
801076be <vector239>:
.globl vector239
vector239:
pushl $0
801076be: 6a 00 push $0x0
pushl $239
801076c0: 68 ef 00 00 00 push $0xef
jmp alltraps
801076c5: e9 d2 ef ff ff jmp 8010669c <alltraps>
801076ca <vector240>:
.globl vector240
vector240:
pushl $0
801076ca: 6a 00 push $0x0
pushl $240
801076cc: 68 f0 00 00 00 push $0xf0
jmp alltraps
801076d1: e9 c6 ef ff ff jmp 8010669c <alltraps>
801076d6 <vector241>:
.globl vector241
vector241:
pushl $0
801076d6: 6a 00 push $0x0
pushl $241
801076d8: 68 f1 00 00 00 push $0xf1
jmp alltraps
801076dd: e9 ba ef ff ff jmp 8010669c <alltraps>
801076e2 <vector242>:
.globl vector242
vector242:
pushl $0
801076e2: 6a 00 push $0x0
pushl $242
801076e4: 68 f2 00 00 00 push $0xf2
jmp alltraps
801076e9: e9 ae ef ff ff jmp 8010669c <alltraps>
801076ee <vector243>:
.globl vector243
vector243:
pushl $0
801076ee: 6a 00 push $0x0
pushl $243
801076f0: 68 f3 00 00 00 push $0xf3
jmp alltraps
801076f5: e9 a2 ef ff ff jmp 8010669c <alltraps>
801076fa <vector244>:
.globl vector244
vector244:
pushl $0
801076fa: 6a 00 push $0x0
pushl $244
801076fc: 68 f4 00 00 00 push $0xf4
jmp alltraps
80107701: e9 96 ef ff ff jmp 8010669c <alltraps>
80107706 <vector245>:
.globl vector245
vector245:
pushl $0
80107706: 6a 00 push $0x0
pushl $245
80107708: 68 f5 00 00 00 push $0xf5
jmp alltraps
8010770d: e9 8a ef ff ff jmp 8010669c <alltraps>
80107712 <vector246>:
.globl vector246
vector246:
pushl $0
80107712: 6a 00 push $0x0
pushl $246
80107714: 68 f6 00 00 00 push $0xf6
jmp alltraps
80107719: e9 7e ef ff ff jmp 8010669c <alltraps>
8010771e <vector247>:
.globl vector247
vector247:
pushl $0
8010771e: 6a 00 push $0x0
pushl $247
80107720: 68 f7 00 00 00 push $0xf7
jmp alltraps
80107725: e9 72 ef ff ff jmp 8010669c <alltraps>
8010772a <vector248>:
.globl vector248
vector248:
pushl $0
8010772a: 6a 00 push $0x0
pushl $248
8010772c: 68 f8 00 00 00 push $0xf8
jmp alltraps
80107731: e9 66 ef ff ff jmp 8010669c <alltraps>
80107736 <vector249>:
.globl vector249
vector249:
pushl $0
80107736: 6a 00 push $0x0
pushl $249
80107738: 68 f9 00 00 00 push $0xf9
jmp alltraps
8010773d: e9 5a ef ff ff jmp 8010669c <alltraps>
80107742 <vector250>:
.globl vector250
vector250:
pushl $0
80107742: 6a 00 push $0x0
pushl $250
80107744: 68 fa 00 00 00 push $0xfa
jmp alltraps
80107749: e9 4e ef ff ff jmp 8010669c <alltraps>
8010774e <vector251>:
.globl vector251
vector251:
pushl $0
8010774e: 6a 00 push $0x0
pushl $251
80107750: 68 fb 00 00 00 push $0xfb
jmp alltraps
80107755: e9 42 ef ff ff jmp 8010669c <alltraps>
8010775a <vector252>:
.globl vector252
vector252:
pushl $0
8010775a: 6a 00 push $0x0
pushl $252
8010775c: 68 fc 00 00 00 push $0xfc
jmp alltraps
80107761: e9 36 ef ff ff jmp 8010669c <alltraps>
80107766 <vector253>:
.globl vector253
vector253:
pushl $0
80107766: 6a 00 push $0x0
pushl $253
80107768: 68 fd 00 00 00 push $0xfd
jmp alltraps
8010776d: e9 2a ef ff ff jmp 8010669c <alltraps>
80107772 <vector254>:
.globl vector254
vector254:
pushl $0
80107772: 6a 00 push $0x0
pushl $254
80107774: 68 fe 00 00 00 push $0xfe
jmp alltraps
80107779: e9 1e ef ff ff jmp 8010669c <alltraps>
8010777e <vector255>:
.globl vector255
vector255:
pushl $0
8010777e: 6a 00 push $0x0
pushl $255
80107780: 68 ff 00 00 00 push $0xff
jmp alltraps
80107785: e9 12 ef ff ff jmp 8010669c <alltraps>
...
8010778c <lgdt>:
struct segdesc;
static inline void
lgdt(struct segdesc *p, int size)
{
8010778c: 55 push %ebp
8010778d: 89 e5 mov %esp,%ebp
8010778f: 83 ec 10 sub $0x10,%esp
volatile ushort pd[3];
pd[0] = size-1;
80107792: 8b 45 0c mov 0xc(%ebp),%eax
80107795: 83 e8 01 sub $0x1,%eax
80107798: 66 89 45 fa mov %ax,-0x6(%ebp)
pd[1] = (uint)p;
8010779c: 8b 45 08 mov 0x8(%ebp),%eax
8010779f: 66 89 45 fc mov %ax,-0x4(%ebp)
pd[2] = (uint)p >> 16;
801077a3: 8b 45 08 mov 0x8(%ebp),%eax
801077a6: c1 e8 10 shr $0x10,%eax
801077a9: 66 89 45 fe mov %ax,-0x2(%ebp)
asm volatile("lgdt (%0)" : : "r" (pd));
801077ad: 8d 45 fa lea -0x6(%ebp),%eax
801077b0: 0f 01 10 lgdtl (%eax)
}
801077b3: c9 leave
801077b4: c3 ret
801077b5 <ltr>:
asm volatile("lidt (%0)" : : "r" (pd));
}
static inline void
ltr(ushort sel)
{
801077b5: 55 push %ebp
801077b6: 89 e5 mov %esp,%ebp
801077b8: 83 ec 04 sub $0x4,%esp
801077bb: 8b 45 08 mov 0x8(%ebp),%eax
801077be: 66 89 45 fc mov %ax,-0x4(%ebp)
asm volatile("ltr %0" : : "r" (sel));
801077c2: 0f b7 45 fc movzwl -0x4(%ebp),%eax
801077c6: 0f 00 d8 ltr %ax
}
801077c9: c9 leave
801077ca: c3 ret
801077cb <loadgs>:
return eflags;
}
static inline void
loadgs(ushort v)
{
801077cb: 55 push %ebp
801077cc: 89 e5 mov %esp,%ebp
801077ce: 83 ec 04 sub $0x4,%esp
801077d1: 8b 45 08 mov 0x8(%ebp),%eax
801077d4: 66 89 45 fc mov %ax,-0x4(%ebp)
asm volatile("movw %0, %%gs" : : "r" (v));
801077d8: 0f b7 45 fc movzwl -0x4(%ebp),%eax
801077dc: 8e e8 mov %eax,%gs
}
801077de: c9 leave
801077df: c3 ret
801077e0 <lcr3>:
return val;
}
static inline void
lcr3(uint val)
{
801077e0: 55 push %ebp
801077e1: 89 e5 mov %esp,%ebp
asm volatile("movl %0,%%cr3" : : "r" (val));
801077e3: 8b 45 08 mov 0x8(%ebp),%eax
801077e6: 0f 22 d8 mov %eax,%cr3
}
801077e9: 5d pop %ebp
801077ea: c3 ret
801077eb <v2p>:
#define KERNBASE 0x80000000 // First kernel virtual address
#define KERNLINK (KERNBASE+EXTMEM) // Address where kernel is linked
#ifndef __ASSEMBLER__
static inline uint v2p(void *a) { return ((uint) (a)) - KERNBASE; }
801077eb: 55 push %ebp
801077ec: 89 e5 mov %esp,%ebp
801077ee: 8b 45 08 mov 0x8(%ebp),%eax
801077f1: 2d 00 00 00 80 sub $0x80000000,%eax
801077f6: 5d pop %ebp
801077f7: c3 ret
801077f8 <p2v>:
static inline void *p2v(uint a) { return (void *) ((a) + KERNBASE); }
801077f8: 55 push %ebp
801077f9: 89 e5 mov %esp,%ebp
801077fb: 8b 45 08 mov 0x8(%ebp),%eax
801077fe: 2d 00 00 00 80 sub $0x80000000,%eax
80107803: 5d pop %ebp
80107804: c3 ret
80107805 <seginit>:
// Set up CPU's kernel segment descriptors.
// Run once on entry on each CPU.
void
seginit(void)
{
80107805: 55 push %ebp
80107806: 89 e5 mov %esp,%ebp
80107808: 53 push %ebx
80107809: 83 ec 24 sub $0x24,%esp
// Map "logical" addresses to virtual addresses using identity map.
// Cannot share a CODE descriptor for both kernel and user
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpunum()];
8010780c: e8 73 b6 ff ff call 80102e84 <cpunum>
80107811: 69 c0 bc 00 00 00 imul $0xbc,%eax,%eax
80107817: 05 40 f9 10 80 add $0x8010f940,%eax
8010781c: 89 45 f4 mov %eax,-0xc(%ebp)
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
8010781f: 8b 45 f4 mov -0xc(%ebp),%eax
80107822: 66 c7 40 78 ff ff movw $0xffff,0x78(%eax)
80107828: 8b 45 f4 mov -0xc(%ebp),%eax
8010782b: 66 c7 40 7a 00 00 movw $0x0,0x7a(%eax)
80107831: 8b 45 f4 mov -0xc(%ebp),%eax
80107834: c6 40 7c 00 movb $0x0,0x7c(%eax)
80107838: 8b 45 f4 mov -0xc(%ebp),%eax
8010783b: 0f b6 50 7d movzbl 0x7d(%eax),%edx
8010783f: 83 e2 f0 and $0xfffffff0,%edx
80107842: 83 ca 0a or $0xa,%edx
80107845: 88 50 7d mov %dl,0x7d(%eax)
80107848: 8b 45 f4 mov -0xc(%ebp),%eax
8010784b: 0f b6 50 7d movzbl 0x7d(%eax),%edx
8010784f: 83 ca 10 or $0x10,%edx
80107852: 88 50 7d mov %dl,0x7d(%eax)
80107855: 8b 45 f4 mov -0xc(%ebp),%eax
80107858: 0f b6 50 7d movzbl 0x7d(%eax),%edx
8010785c: 83 e2 9f and $0xffffff9f,%edx
8010785f: 88 50 7d mov %dl,0x7d(%eax)
80107862: 8b 45 f4 mov -0xc(%ebp),%eax
80107865: 0f b6 50 7d movzbl 0x7d(%eax),%edx
80107869: 83 ca 80 or $0xffffff80,%edx
8010786c: 88 50 7d mov %dl,0x7d(%eax)
8010786f: 8b 45 f4 mov -0xc(%ebp),%eax
80107872: 0f b6 50 7e movzbl 0x7e(%eax),%edx
80107876: 83 ca 0f or $0xf,%edx
80107879: 88 50 7e mov %dl,0x7e(%eax)
8010787c: 8b 45 f4 mov -0xc(%ebp),%eax
8010787f: 0f b6 50 7e movzbl 0x7e(%eax),%edx
80107883: 83 e2 ef and $0xffffffef,%edx
80107886: 88 50 7e mov %dl,0x7e(%eax)
80107889: 8b 45 f4 mov -0xc(%ebp),%eax
8010788c: 0f b6 50 7e movzbl 0x7e(%eax),%edx
80107890: 83 e2 df and $0xffffffdf,%edx
80107893: 88 50 7e mov %dl,0x7e(%eax)
80107896: 8b 45 f4 mov -0xc(%ebp),%eax
80107899: 0f b6 50 7e movzbl 0x7e(%eax),%edx
8010789d: 83 ca 40 or $0x40,%edx
801078a0: 88 50 7e mov %dl,0x7e(%eax)
801078a3: 8b 45 f4 mov -0xc(%ebp),%eax
801078a6: 0f b6 50 7e movzbl 0x7e(%eax),%edx
801078aa: 83 ca 80 or $0xffffff80,%edx
801078ad: 88 50 7e mov %dl,0x7e(%eax)
801078b0: 8b 45 f4 mov -0xc(%ebp),%eax
801078b3: c6 40 7f 00 movb $0x0,0x7f(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
801078b7: 8b 45 f4 mov -0xc(%ebp),%eax
801078ba: 66 c7 80 80 00 00 00 movw $0xffff,0x80(%eax)
801078c1: ff ff
801078c3: 8b 45 f4 mov -0xc(%ebp),%eax
801078c6: 66 c7 80 82 00 00 00 movw $0x0,0x82(%eax)
801078cd: 00 00
801078cf: 8b 45 f4 mov -0xc(%ebp),%eax
801078d2: c6 80 84 00 00 00 00 movb $0x0,0x84(%eax)
801078d9: 8b 45 f4 mov -0xc(%ebp),%eax
801078dc: 0f b6 90 85 00 00 00 movzbl 0x85(%eax),%edx
801078e3: 83 e2 f0 and $0xfffffff0,%edx
801078e6: 83 ca 02 or $0x2,%edx
801078e9: 88 90 85 00 00 00 mov %dl,0x85(%eax)
801078ef: 8b 45 f4 mov -0xc(%ebp),%eax
801078f2: 0f b6 90 85 00 00 00 movzbl 0x85(%eax),%edx
801078f9: 83 ca 10 or $0x10,%edx
801078fc: 88 90 85 00 00 00 mov %dl,0x85(%eax)
80107902: 8b 45 f4 mov -0xc(%ebp),%eax
80107905: 0f b6 90 85 00 00 00 movzbl 0x85(%eax),%edx
8010790c: 83 e2 9f and $0xffffff9f,%edx
8010790f: 88 90 85 00 00 00 mov %dl,0x85(%eax)
80107915: 8b 45 f4 mov -0xc(%ebp),%eax
80107918: 0f b6 90 85 00 00 00 movzbl 0x85(%eax),%edx
8010791f: 83 ca 80 or $0xffffff80,%edx
80107922: 88 90 85 00 00 00 mov %dl,0x85(%eax)
80107928: 8b 45 f4 mov -0xc(%ebp),%eax
8010792b: 0f b6 90 86 00 00 00 movzbl 0x86(%eax),%edx
80107932: 83 ca 0f or $0xf,%edx
80107935: 88 90 86 00 00 00 mov %dl,0x86(%eax)
8010793b: 8b 45 f4 mov -0xc(%ebp),%eax
8010793e: 0f b6 90 86 00 00 00 movzbl 0x86(%eax),%edx
80107945: 83 e2 ef and $0xffffffef,%edx
80107948: 88 90 86 00 00 00 mov %dl,0x86(%eax)
8010794e: 8b 45 f4 mov -0xc(%ebp),%eax
80107951: 0f b6 90 86 00 00 00 movzbl 0x86(%eax),%edx
80107958: 83 e2 df and $0xffffffdf,%edx
8010795b: 88 90 86 00 00 00 mov %dl,0x86(%eax)
80107961: 8b 45 f4 mov -0xc(%ebp),%eax
80107964: 0f b6 90 86 00 00 00 movzbl 0x86(%eax),%edx
8010796b: 83 ca 40 or $0x40,%edx
8010796e: 88 90 86 00 00 00 mov %dl,0x86(%eax)
80107974: 8b 45 f4 mov -0xc(%ebp),%eax
80107977: 0f b6 90 86 00 00 00 movzbl 0x86(%eax),%edx
8010797e: 83 ca 80 or $0xffffff80,%edx
80107981: 88 90 86 00 00 00 mov %dl,0x86(%eax)
80107987: 8b 45 f4 mov -0xc(%ebp),%eax
8010798a: c6 80 87 00 00 00 00 movb $0x0,0x87(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80107991: 8b 45 f4 mov -0xc(%ebp),%eax
80107994: 66 c7 80 90 00 00 00 movw $0xffff,0x90(%eax)
8010799b: ff ff
8010799d: 8b 45 f4 mov -0xc(%ebp),%eax
801079a0: 66 c7 80 92 00 00 00 movw $0x0,0x92(%eax)
801079a7: 00 00
801079a9: 8b 45 f4 mov -0xc(%ebp),%eax
801079ac: c6 80 94 00 00 00 00 movb $0x0,0x94(%eax)
801079b3: 8b 45 f4 mov -0xc(%ebp),%eax
801079b6: 0f b6 90 95 00 00 00 movzbl 0x95(%eax),%edx
801079bd: 83 e2 f0 and $0xfffffff0,%edx
801079c0: 83 ca 0a or $0xa,%edx
801079c3: 88 90 95 00 00 00 mov %dl,0x95(%eax)
801079c9: 8b 45 f4 mov -0xc(%ebp),%eax
801079cc: 0f b6 90 95 00 00 00 movzbl 0x95(%eax),%edx
801079d3: 83 ca 10 or $0x10,%edx
801079d6: 88 90 95 00 00 00 mov %dl,0x95(%eax)
801079dc: 8b 45 f4 mov -0xc(%ebp),%eax
801079df: 0f b6 90 95 00 00 00 movzbl 0x95(%eax),%edx
801079e6: 83 ca 60 or $0x60,%edx
801079e9: 88 90 95 00 00 00 mov %dl,0x95(%eax)
801079ef: 8b 45 f4 mov -0xc(%ebp),%eax
801079f2: 0f b6 90 95 00 00 00 movzbl 0x95(%eax),%edx
801079f9: 83 ca 80 or $0xffffff80,%edx
801079fc: 88 90 95 00 00 00 mov %dl,0x95(%eax)
80107a02: 8b 45 f4 mov -0xc(%ebp),%eax
80107a05: 0f b6 90 96 00 00 00 movzbl 0x96(%eax),%edx
80107a0c: 83 ca 0f or $0xf,%edx
80107a0f: 88 90 96 00 00 00 mov %dl,0x96(%eax)
80107a15: 8b 45 f4 mov -0xc(%ebp),%eax
80107a18: 0f b6 90 96 00 00 00 movzbl 0x96(%eax),%edx
80107a1f: 83 e2 ef and $0xffffffef,%edx
80107a22: 88 90 96 00 00 00 mov %dl,0x96(%eax)
80107a28: 8b 45 f4 mov -0xc(%ebp),%eax
80107a2b: 0f b6 90 96 00 00 00 movzbl 0x96(%eax),%edx
80107a32: 83 e2 df and $0xffffffdf,%edx
80107a35: 88 90 96 00 00 00 mov %dl,0x96(%eax)
80107a3b: 8b 45 f4 mov -0xc(%ebp),%eax
80107a3e: 0f b6 90 96 00 00 00 movzbl 0x96(%eax),%edx
80107a45: 83 ca 40 or $0x40,%edx
80107a48: 88 90 96 00 00 00 mov %dl,0x96(%eax)
80107a4e: 8b 45 f4 mov -0xc(%ebp),%eax
80107a51: 0f b6 90 96 00 00 00 movzbl 0x96(%eax),%edx
80107a58: 83 ca 80 or $0xffffff80,%edx
80107a5b: 88 90 96 00 00 00 mov %dl,0x96(%eax)
80107a61: 8b 45 f4 mov -0xc(%ebp),%eax
80107a64: c6 80 97 00 00 00 00 movb $0x0,0x97(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80107a6b: 8b 45 f4 mov -0xc(%ebp),%eax
80107a6e: 66 c7 80 98 00 00 00 movw $0xffff,0x98(%eax)
80107a75: ff ff
80107a77: 8b 45 f4 mov -0xc(%ebp),%eax
80107a7a: 66 c7 80 9a 00 00 00 movw $0x0,0x9a(%eax)
80107a81: 00 00
80107a83: 8b 45 f4 mov -0xc(%ebp),%eax
80107a86: c6 80 9c 00 00 00 00 movb $0x0,0x9c(%eax)
80107a8d: 8b 45 f4 mov -0xc(%ebp),%eax
80107a90: 0f b6 90 9d 00 00 00 movzbl 0x9d(%eax),%edx
80107a97: 83 e2 f0 and $0xfffffff0,%edx
80107a9a: 83 ca 02 or $0x2,%edx
80107a9d: 88 90 9d 00 00 00 mov %dl,0x9d(%eax)
80107aa3: 8b 45 f4 mov -0xc(%ebp),%eax
80107aa6: 0f b6 90 9d 00 00 00 movzbl 0x9d(%eax),%edx
80107aad: 83 ca 10 or $0x10,%edx
80107ab0: 88 90 9d 00 00 00 mov %dl,0x9d(%eax)
80107ab6: 8b 45 f4 mov -0xc(%ebp),%eax
80107ab9: 0f b6 90 9d 00 00 00 movzbl 0x9d(%eax),%edx
80107ac0: 83 ca 60 or $0x60,%edx
80107ac3: 88 90 9d 00 00 00 mov %dl,0x9d(%eax)
80107ac9: 8b 45 f4 mov -0xc(%ebp),%eax
80107acc: 0f b6 90 9d 00 00 00 movzbl 0x9d(%eax),%edx
80107ad3: 83 ca 80 or $0xffffff80,%edx
80107ad6: 88 90 9d 00 00 00 mov %dl,0x9d(%eax)
80107adc: 8b 45 f4 mov -0xc(%ebp),%eax
80107adf: 0f b6 90 9e 00 00 00 movzbl 0x9e(%eax),%edx
80107ae6: 83 ca 0f or $0xf,%edx
80107ae9: 88 90 9e 00 00 00 mov %dl,0x9e(%eax)
80107aef: 8b 45 f4 mov -0xc(%ebp),%eax
80107af2: 0f b6 90 9e 00 00 00 movzbl 0x9e(%eax),%edx
80107af9: 83 e2 ef and $0xffffffef,%edx
80107afc: 88 90 9e 00 00 00 mov %dl,0x9e(%eax)
80107b02: 8b 45 f4 mov -0xc(%ebp),%eax
80107b05: 0f b6 90 9e 00 00 00 movzbl 0x9e(%eax),%edx
80107b0c: 83 e2 df and $0xffffffdf,%edx
80107b0f: 88 90 9e 00 00 00 mov %dl,0x9e(%eax)
80107b15: 8b 45 f4 mov -0xc(%ebp),%eax
80107b18: 0f b6 90 9e 00 00 00 movzbl 0x9e(%eax),%edx
80107b1f: 83 ca 40 or $0x40,%edx
80107b22: 88 90 9e 00 00 00 mov %dl,0x9e(%eax)
80107b28: 8b 45 f4 mov -0xc(%ebp),%eax
80107b2b: 0f b6 90 9e 00 00 00 movzbl 0x9e(%eax),%edx
80107b32: 83 ca 80 or $0xffffff80,%edx
80107b35: 88 90 9e 00 00 00 mov %dl,0x9e(%eax)
80107b3b: 8b 45 f4 mov -0xc(%ebp),%eax
80107b3e: c6 80 9f 00 00 00 00 movb $0x0,0x9f(%eax)
// Map cpu, and curproc
c->gdt[SEG_KCPU] = SEG(STA_W, &c->cpu, 8, 0);
80107b45: 8b 45 f4 mov -0xc(%ebp),%eax
80107b48: 05 b4 00 00 00 add $0xb4,%eax
80107b4d: 89 c3 mov %eax,%ebx
80107b4f: 8b 45 f4 mov -0xc(%ebp),%eax
80107b52: 05 b4 00 00 00 add $0xb4,%eax
80107b57: c1 e8 10 shr $0x10,%eax
80107b5a: 89 c1 mov %eax,%ecx
80107b5c: 8b 45 f4 mov -0xc(%ebp),%eax
80107b5f: 05 b4 00 00 00 add $0xb4,%eax
80107b64: c1 e8 18 shr $0x18,%eax
80107b67: 89 c2 mov %eax,%edx
80107b69: 8b 45 f4 mov -0xc(%ebp),%eax
80107b6c: 66 c7 80 88 00 00 00 movw $0x0,0x88(%eax)
80107b73: 00 00
80107b75: 8b 45 f4 mov -0xc(%ebp),%eax
80107b78: 66 89 98 8a 00 00 00 mov %bx,0x8a(%eax)
80107b7f: 8b 45 f4 mov -0xc(%ebp),%eax
80107b82: 88 88 8c 00 00 00 mov %cl,0x8c(%eax)
80107b88: 8b 45 f4 mov -0xc(%ebp),%eax
80107b8b: 0f b6 88 8d 00 00 00 movzbl 0x8d(%eax),%ecx
80107b92: 83 e1 f0 and $0xfffffff0,%ecx
80107b95: 83 c9 02 or $0x2,%ecx
80107b98: 88 88 8d 00 00 00 mov %cl,0x8d(%eax)
80107b9e: 8b 45 f4 mov -0xc(%ebp),%eax
80107ba1: 0f b6 88 8d 00 00 00 movzbl 0x8d(%eax),%ecx
80107ba8: 83 c9 10 or $0x10,%ecx
80107bab: 88 88 8d 00 00 00 mov %cl,0x8d(%eax)
80107bb1: 8b 45 f4 mov -0xc(%ebp),%eax
80107bb4: 0f b6 88 8d 00 00 00 movzbl 0x8d(%eax),%ecx
80107bbb: 83 e1 9f and $0xffffff9f,%ecx
80107bbe: 88 88 8d 00 00 00 mov %cl,0x8d(%eax)
80107bc4: 8b 45 f4 mov -0xc(%ebp),%eax
80107bc7: 0f b6 88 8d 00 00 00 movzbl 0x8d(%eax),%ecx
80107bce: 83 c9 80 or $0xffffff80,%ecx
80107bd1: 88 88 8d 00 00 00 mov %cl,0x8d(%eax)
80107bd7: 8b 45 f4 mov -0xc(%ebp),%eax
80107bda: 0f b6 88 8e 00 00 00 movzbl 0x8e(%eax),%ecx
80107be1: 83 e1 f0 and $0xfffffff0,%ecx
80107be4: 88 88 8e 00 00 00 mov %cl,0x8e(%eax)
80107bea: 8b 45 f4 mov -0xc(%ebp),%eax
80107bed: 0f b6 88 8e 00 00 00 movzbl 0x8e(%eax),%ecx
80107bf4: 83 e1 ef and $0xffffffef,%ecx
80107bf7: 88 88 8e 00 00 00 mov %cl,0x8e(%eax)
80107bfd: 8b 45 f4 mov -0xc(%ebp),%eax
80107c00: 0f b6 88 8e 00 00 00 movzbl 0x8e(%eax),%ecx
80107c07: 83 e1 df and $0xffffffdf,%ecx
80107c0a: 88 88 8e 00 00 00 mov %cl,0x8e(%eax)
80107c10: 8b 45 f4 mov -0xc(%ebp),%eax
80107c13: 0f b6 88 8e 00 00 00 movzbl 0x8e(%eax),%ecx
80107c1a: 83 c9 40 or $0x40,%ecx
80107c1d: 88 88 8e 00 00 00 mov %cl,0x8e(%eax)
80107c23: 8b 45 f4 mov -0xc(%ebp),%eax
80107c26: 0f b6 88 8e 00 00 00 movzbl 0x8e(%eax),%ecx
80107c2d: 83 c9 80 or $0xffffff80,%ecx
80107c30: 88 88 8e 00 00 00 mov %cl,0x8e(%eax)
80107c36: 8b 45 f4 mov -0xc(%ebp),%eax
80107c39: 88 90 8f 00 00 00 mov %dl,0x8f(%eax)
lgdt(c->gdt, sizeof(c->gdt));
80107c3f: 8b 45 f4 mov -0xc(%ebp),%eax
80107c42: 83 c0 70 add $0x70,%eax
80107c45: c7 44 24 04 38 00 00 movl $0x38,0x4(%esp)
80107c4c: 00
80107c4d: 89 04 24 mov %eax,(%esp)
80107c50: e8 37 fb ff ff call 8010778c <lgdt>
loadgs(SEG_KCPU << 3);
80107c55: c7 04 24 18 00 00 00 movl $0x18,(%esp)
80107c5c: e8 6a fb ff ff call 801077cb <loadgs>
// Initialize cpu-local storage.
cpu = c;
80107c61: 8b 45 f4 mov -0xc(%ebp),%eax
80107c64: 65 a3 00 00 00 00 mov %eax,%gs:0x0
proc = 0;
80107c6a: 65 c7 05 04 00 00 00 movl $0x0,%gs:0x4
80107c71: 00 00 00 00
}
80107c75: 83 c4 24 add $0x24,%esp
80107c78: 5b pop %ebx
80107c79: 5d pop %ebp
80107c7a: c3 ret
80107c7b <walkpgdir>:
// Return the address of the PTE in page table pgdir
// that corresponds to virtual address va. If alloc!=0,
// create any required page table pages.
static pte_t *
walkpgdir(pde_t *pgdir, const void *va, int alloc)
{
80107c7b: 55 push %ebp
80107c7c: 89 e5 mov %esp,%ebp
80107c7e: 83 ec 28 sub $0x28,%esp
pde_t *pde;
pte_t *pgtab;
pde = &pgdir[PDX(va)];
80107c81: 8b 45 0c mov 0xc(%ebp),%eax
80107c84: c1 e8 16 shr $0x16,%eax
80107c87: c1 e0 02 shl $0x2,%eax
80107c8a: 03 45 08 add 0x8(%ebp),%eax
80107c8d: 89 45 f0 mov %eax,-0x10(%ebp)
if(*pde & PTE_P){
80107c90: 8b 45 f0 mov -0x10(%ebp),%eax
80107c93: 8b 00 mov (%eax),%eax
80107c95: 83 e0 01 and $0x1,%eax
80107c98: 84 c0 test %al,%al
80107c9a: 74 17 je 80107cb3 <walkpgdir+0x38>
pgtab = (pte_t*)p2v(PTE_ADDR(*pde));
80107c9c: 8b 45 f0 mov -0x10(%ebp),%eax
80107c9f: 8b 00 mov (%eax),%eax
80107ca1: 25 00 f0 ff ff and $0xfffff000,%eax
80107ca6: 89 04 24 mov %eax,(%esp)
80107ca9: e8 4a fb ff ff call 801077f8 <p2v>
80107cae: 89 45 f4 mov %eax,-0xc(%ebp)
80107cb1: eb 4b jmp 80107cfe <walkpgdir+0x83>
} else {
if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
80107cb3: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80107cb7: 74 0e je 80107cc7 <walkpgdir+0x4c>
80107cb9: e8 4c ae ff ff call 80102b0a <kalloc>
80107cbe: 89 45 f4 mov %eax,-0xc(%ebp)
80107cc1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80107cc5: 75 07 jne 80107cce <walkpgdir+0x53>
return 0;
80107cc7: b8 00 00 00 00 mov $0x0,%eax
80107ccc: eb 41 jmp 80107d0f <walkpgdir+0x94>
// Make sure all those PTE_P bits are zero.
memset(pgtab, 0, PGSIZE);
80107cce: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80107cd5: 00
80107cd6: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80107cdd: 00
80107cde: 8b 45 f4 mov -0xc(%ebp),%eax
80107ce1: 89 04 24 mov %eax,(%esp)
80107ce4: e8 d1 d4 ff ff call 801051ba <memset>
// The permissions here are overly generous, but they can
// be further restricted by the permissions in the page table
// entries, if necessary.
*pde = v2p(pgtab) | PTE_P | PTE_W | PTE_U;
80107ce9: 8b 45 f4 mov -0xc(%ebp),%eax
80107cec: 89 04 24 mov %eax,(%esp)
80107cef: e8 f7 fa ff ff call 801077eb <v2p>
80107cf4: 89 c2 mov %eax,%edx
80107cf6: 83 ca 07 or $0x7,%edx
80107cf9: 8b 45 f0 mov -0x10(%ebp),%eax
80107cfc: 89 10 mov %edx,(%eax)
}
return &pgtab[PTX(va)];
80107cfe: 8b 45 0c mov 0xc(%ebp),%eax
80107d01: c1 e8 0c shr $0xc,%eax
80107d04: 25 ff 03 00 00 and $0x3ff,%eax
80107d09: c1 e0 02 shl $0x2,%eax
80107d0c: 03 45 f4 add -0xc(%ebp),%eax
}
80107d0f: c9 leave
80107d10: c3 ret
80107d11 <mappages>:
// Create PTEs for virtual addresses starting at va that refer to
// physical addresses starting at pa. va and size might not
// be page-aligned.
static int
mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm)
{
80107d11: 55 push %ebp
80107d12: 89 e5 mov %esp,%ebp
80107d14: 83 ec 28 sub $0x28,%esp
char *a, *last;
pte_t *pte;
a = (char*)PGROUNDDOWN((uint)va);
80107d17: 8b 45 0c mov 0xc(%ebp),%eax
80107d1a: 25 00 f0 ff ff and $0xfffff000,%eax
80107d1f: 89 45 ec mov %eax,-0x14(%ebp)
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
80107d22: 8b 45 0c mov 0xc(%ebp),%eax
80107d25: 03 45 10 add 0x10(%ebp),%eax
80107d28: 83 e8 01 sub $0x1,%eax
80107d2b: 25 00 f0 ff ff and $0xfffff000,%eax
80107d30: 89 45 f0 mov %eax,-0x10(%ebp)
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
80107d33: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
80107d3a: 00
80107d3b: 8b 45 ec mov -0x14(%ebp),%eax
80107d3e: 89 44 24 04 mov %eax,0x4(%esp)
80107d42: 8b 45 08 mov 0x8(%ebp),%eax
80107d45: 89 04 24 mov %eax,(%esp)
80107d48: e8 2e ff ff ff call 80107c7b <walkpgdir>
80107d4d: 89 45 f4 mov %eax,-0xc(%ebp)
80107d50: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80107d54: 75 07 jne 80107d5d <mappages+0x4c>
return -1;
80107d56: b8 ff ff ff ff mov $0xffffffff,%eax
80107d5b: eb 46 jmp 80107da3 <mappages+0x92>
if(*pte & PTE_P)
80107d5d: 8b 45 f4 mov -0xc(%ebp),%eax
80107d60: 8b 00 mov (%eax),%eax
80107d62: 83 e0 01 and $0x1,%eax
80107d65: 84 c0 test %al,%al
80107d67: 74 0c je 80107d75 <mappages+0x64>
panic("remap");
80107d69: c7 04 24 c0 8b 10 80 movl $0x80108bc0,(%esp)
80107d70: e8 c5 87 ff ff call 8010053a <panic>
*pte = pa | perm | PTE_P;
80107d75: 8b 45 18 mov 0x18(%ebp),%eax
80107d78: 0b 45 14 or 0x14(%ebp),%eax
80107d7b: 89 c2 mov %eax,%edx
80107d7d: 83 ca 01 or $0x1,%edx
80107d80: 8b 45 f4 mov -0xc(%ebp),%eax
80107d83: 89 10 mov %edx,(%eax)
if(a == last)
80107d85: 8b 45 ec mov -0x14(%ebp),%eax
80107d88: 3b 45 f0 cmp -0x10(%ebp),%eax
80107d8b: 74 10 je 80107d9d <mappages+0x8c>
break;
a += PGSIZE;
80107d8d: 81 45 ec 00 10 00 00 addl $0x1000,-0x14(%ebp)
pa += PGSIZE;
80107d94: 81 45 14 00 10 00 00 addl $0x1000,0x14(%ebp)
}
80107d9b: eb 96 jmp 80107d33 <mappages+0x22>
return -1;
if(*pte & PTE_P)
panic("remap");
*pte = pa | perm | PTE_P;
if(a == last)
break;
80107d9d: 90 nop
a += PGSIZE;
pa += PGSIZE;
}
return 0;
80107d9e: b8 00 00 00 00 mov $0x0,%eax
}
80107da3: c9 leave
80107da4: c3 ret
80107da5 <setupkvm>:
};
// Set up kernel part of a page table.
pde_t*
setupkvm(void)
{
80107da5: 55 push %ebp
80107da6: 89 e5 mov %esp,%ebp
80107da8: 53 push %ebx
80107da9: 83 ec 34 sub $0x34,%esp
pde_t *pgdir;
struct kmap *k;
if((pgdir = (pde_t*)kalloc()) == 0)
80107dac: e8 59 ad ff ff call 80102b0a <kalloc>
80107db1: 89 45 f0 mov %eax,-0x10(%ebp)
80107db4: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80107db8: 75 0a jne 80107dc4 <setupkvm+0x1f>
return 0;
80107dba: b8 00 00 00 00 mov $0x0,%eax
80107dbf: e9 99 00 00 00 jmp 80107e5d <setupkvm+0xb8>
memset(pgdir, 0, PGSIZE);
80107dc4: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80107dcb: 00
80107dcc: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80107dd3: 00
80107dd4: 8b 45 f0 mov -0x10(%ebp),%eax
80107dd7: 89 04 24 mov %eax,(%esp)
80107dda: e8 db d3 ff ff call 801051ba <memset>
if (p2v(PHYSTOP) > (void*)DEVSPACE)
80107ddf: c7 04 24 00 00 00 0e movl $0xe000000,(%esp)
80107de6: e8 0d fa ff ff call 801077f8 <p2v>
80107deb: 3d 00 00 00 fe cmp $0xfe000000,%eax
80107df0: 76 0c jbe 80107dfe <setupkvm+0x59>
panic("PHYSTOP too high");
80107df2: c7 04 24 c6 8b 10 80 movl $0x80108bc6,(%esp)
80107df9: e8 3c 87 ff ff call 8010053a <panic>
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80107dfe: c7 45 f4 c0 b4 10 80 movl $0x8010b4c0,-0xc(%ebp)
80107e05: eb 49 jmp 80107e50 <setupkvm+0xab>
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
80107e07: 8b 45 f4 mov -0xc(%ebp),%eax
80107e0a: 8b 48 0c mov 0xc(%eax),%ecx
80107e0d: 8b 45 f4 mov -0xc(%ebp),%eax
80107e10: 8b 50 04 mov 0x4(%eax),%edx
80107e13: 8b 45 f4 mov -0xc(%ebp),%eax
80107e16: 8b 58 08 mov 0x8(%eax),%ebx
80107e19: 8b 45 f4 mov -0xc(%ebp),%eax
80107e1c: 8b 40 04 mov 0x4(%eax),%eax
80107e1f: 29 c3 sub %eax,%ebx
80107e21: 8b 45 f4 mov -0xc(%ebp),%eax
80107e24: 8b 00 mov (%eax),%eax
80107e26: 89 4c 24 10 mov %ecx,0x10(%esp)
80107e2a: 89 54 24 0c mov %edx,0xc(%esp)
80107e2e: 89 5c 24 08 mov %ebx,0x8(%esp)
80107e32: 89 44 24 04 mov %eax,0x4(%esp)
80107e36: 8b 45 f0 mov -0x10(%ebp),%eax
80107e39: 89 04 24 mov %eax,(%esp)
80107e3c: e8 d0 fe ff ff call 80107d11 <mappages>
80107e41: 85 c0 test %eax,%eax
80107e43: 79 07 jns 80107e4c <setupkvm+0xa7>
(uint)k->phys_start, k->perm) < 0)
return 0;
80107e45: b8 00 00 00 00 mov $0x0,%eax
80107e4a: eb 11 jmp 80107e5d <setupkvm+0xb8>
if((pgdir = (pde_t*)kalloc()) == 0)
return 0;
memset(pgdir, 0, PGSIZE);
if (p2v(PHYSTOP) > (void*)DEVSPACE)
panic("PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80107e4c: 83 45 f4 10 addl $0x10,-0xc(%ebp)
80107e50: b8 00 b5 10 80 mov $0x8010b500,%eax
80107e55: 39 45 f4 cmp %eax,-0xc(%ebp)
80107e58: 72 ad jb 80107e07 <setupkvm+0x62>
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
(uint)k->phys_start, k->perm) < 0)
return 0;
return pgdir;
80107e5a: 8b 45 f0 mov -0x10(%ebp),%eax
}
80107e5d: 83 c4 34 add $0x34,%esp
80107e60: 5b pop %ebx
80107e61: 5d pop %ebp
80107e62: c3 ret
80107e63 <kvmalloc>:
// Allocate one page table for the machine for the kernel address
// space for scheduler processes.
void
kvmalloc(void)
{
80107e63: 55 push %ebp
80107e64: 89 e5 mov %esp,%ebp
80107e66: 83 ec 08 sub $0x8,%esp
kpgdir = setupkvm();
80107e69: e8 37 ff ff ff call 80107da5 <setupkvm>
80107e6e: a3 18 29 11 80 mov %eax,0x80112918
switchkvm();
80107e73: e8 02 00 00 00 call 80107e7a <switchkvm>
}
80107e78: c9 leave
80107e79: c3 ret
80107e7a <switchkvm>:
// Switch h/w page table register to the kernel-only page table,
// for when no process is running.
void
switchkvm(void)
{
80107e7a: 55 push %ebp
80107e7b: 89 e5 mov %esp,%ebp
80107e7d: 83 ec 04 sub $0x4,%esp
lcr3(v2p(kpgdir)); // switch to the kernel page table
80107e80: a1 18 29 11 80 mov 0x80112918,%eax
80107e85: 89 04 24 mov %eax,(%esp)
80107e88: e8 5e f9 ff ff call 801077eb <v2p>
80107e8d: 89 04 24 mov %eax,(%esp)
80107e90: e8 4b f9 ff ff call 801077e0 <lcr3>
}
80107e95: c9 leave
80107e96: c3 ret
80107e97 <switchuvm>:
// Switch TSS and h/w page table to correspond to process p.
void
switchuvm(struct proc *p)
{
80107e97: 55 push %ebp
80107e98: 89 e5 mov %esp,%ebp
80107e9a: 53 push %ebx
80107e9b: 83 ec 14 sub $0x14,%esp
pushcli();
80107e9e: e8 11 d2 ff ff call 801050b4 <pushcli>
cpu->gdt[SEG_TSS] = SEG16(STS_T32A, &cpu->ts, sizeof(cpu->ts)-1, 0);
80107ea3: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80107ea9: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
80107eb0: 83 c2 08 add $0x8,%edx
80107eb3: 89 d3 mov %edx,%ebx
80107eb5: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
80107ebc: 83 c2 08 add $0x8,%edx
80107ebf: c1 ea 10 shr $0x10,%edx
80107ec2: 89 d1 mov %edx,%ecx
80107ec4: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
80107ecb: 83 c2 08 add $0x8,%edx
80107ece: c1 ea 18 shr $0x18,%edx
80107ed1: 66 c7 80 a0 00 00 00 movw $0x67,0xa0(%eax)
80107ed8: 67 00
80107eda: 66 89 98 a2 00 00 00 mov %bx,0xa2(%eax)
80107ee1: 88 88 a4 00 00 00 mov %cl,0xa4(%eax)
80107ee7: 0f b6 88 a5 00 00 00 movzbl 0xa5(%eax),%ecx
80107eee: 83 e1 f0 and $0xfffffff0,%ecx
80107ef1: 83 c9 09 or $0x9,%ecx
80107ef4: 88 88 a5 00 00 00 mov %cl,0xa5(%eax)
80107efa: 0f b6 88 a5 00 00 00 movzbl 0xa5(%eax),%ecx
80107f01: 83 c9 10 or $0x10,%ecx
80107f04: 88 88 a5 00 00 00 mov %cl,0xa5(%eax)
80107f0a: 0f b6 88 a5 00 00 00 movzbl 0xa5(%eax),%ecx
80107f11: 83 e1 9f and $0xffffff9f,%ecx
80107f14: 88 88 a5 00 00 00 mov %cl,0xa5(%eax)
80107f1a: 0f b6 88 a5 00 00 00 movzbl 0xa5(%eax),%ecx
80107f21: 83 c9 80 or $0xffffff80,%ecx
80107f24: 88 88 a5 00 00 00 mov %cl,0xa5(%eax)
80107f2a: 0f b6 88 a6 00 00 00 movzbl 0xa6(%eax),%ecx
80107f31: 83 e1 f0 and $0xfffffff0,%ecx
80107f34: 88 88 a6 00 00 00 mov %cl,0xa6(%eax)
80107f3a: 0f b6 88 a6 00 00 00 movzbl 0xa6(%eax),%ecx
80107f41: 83 e1 ef and $0xffffffef,%ecx
80107f44: 88 88 a6 00 00 00 mov %cl,0xa6(%eax)
80107f4a: 0f b6 88 a6 00 00 00 movzbl 0xa6(%eax),%ecx
80107f51: 83 e1 df and $0xffffffdf,%ecx
80107f54: 88 88 a6 00 00 00 mov %cl,0xa6(%eax)
80107f5a: 0f b6 88 a6 00 00 00 movzbl 0xa6(%eax),%ecx
80107f61: 83 c9 40 or $0x40,%ecx
80107f64: 88 88 a6 00 00 00 mov %cl,0xa6(%eax)
80107f6a: 0f b6 88 a6 00 00 00 movzbl 0xa6(%eax),%ecx
80107f71: 83 e1 7f and $0x7f,%ecx
80107f74: 88 88 a6 00 00 00 mov %cl,0xa6(%eax)
80107f7a: 88 90 a7 00 00 00 mov %dl,0xa7(%eax)
cpu->gdt[SEG_TSS].s = 0;
80107f80: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80107f86: 0f b6 90 a5 00 00 00 movzbl 0xa5(%eax),%edx
80107f8d: 83 e2 ef and $0xffffffef,%edx
80107f90: 88 90 a5 00 00 00 mov %dl,0xa5(%eax)
cpu->ts.ss0 = SEG_KDATA << 3;
80107f96: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80107f9c: 66 c7 40 10 10 00 movw $0x10,0x10(%eax)
cpu->ts.esp0 = (uint)proc->kstack + KSTACKSIZE;
80107fa2: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80107fa8: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
80107faf: 8b 52 08 mov 0x8(%edx),%edx
80107fb2: 81 c2 00 10 00 00 add $0x1000,%edx
80107fb8: 89 50 0c mov %edx,0xc(%eax)
ltr(SEG_TSS << 3);
80107fbb: c7 04 24 30 00 00 00 movl $0x30,(%esp)
80107fc2: e8 ee f7 ff ff call 801077b5 <ltr>
if(p->pgdir == 0)
80107fc7: 8b 45 08 mov 0x8(%ebp),%eax
80107fca: 8b 40 04 mov 0x4(%eax),%eax
80107fcd: 85 c0 test %eax,%eax
80107fcf: 75 0c jne 80107fdd <switchuvm+0x146>
panic("switchuvm: no pgdir");
80107fd1: c7 04 24 d7 8b 10 80 movl $0x80108bd7,(%esp)
80107fd8: e8 5d 85 ff ff call 8010053a <panic>
lcr3(v2p(p->pgdir)); // switch to new address space
80107fdd: 8b 45 08 mov 0x8(%ebp),%eax
80107fe0: 8b 40 04 mov 0x4(%eax),%eax
80107fe3: 89 04 24 mov %eax,(%esp)
80107fe6: e8 00 f8 ff ff call 801077eb <v2p>
80107feb: 89 04 24 mov %eax,(%esp)
80107fee: e8 ed f7 ff ff call 801077e0 <lcr3>
popcli();
80107ff3: e8 04 d1 ff ff call 801050fc <popcli>
}
80107ff8: 83 c4 14 add $0x14,%esp
80107ffb: 5b pop %ebx
80107ffc: 5d pop %ebp
80107ffd: c3 ret
80107ffe <inituvm>:
// Load the initcode into address 0 of pgdir.
// sz must be less than a page.
void
inituvm(pde_t *pgdir, char *init, uint sz)
{
80107ffe: 55 push %ebp
80107fff: 89 e5 mov %esp,%ebp
80108001: 83 ec 38 sub $0x38,%esp
char *mem;
if(sz >= PGSIZE)
80108004: 81 7d 10 ff 0f 00 00 cmpl $0xfff,0x10(%ebp)
8010800b: 76 0c jbe 80108019 <inituvm+0x1b>
panic("inituvm: more than a page");
8010800d: c7 04 24 eb 8b 10 80 movl $0x80108beb,(%esp)
80108014: e8 21 85 ff ff call 8010053a <panic>
mem = kalloc();
80108019: e8 ec aa ff ff call 80102b0a <kalloc>
8010801e: 89 45 f4 mov %eax,-0xc(%ebp)
memset(mem, 0, PGSIZE);
80108021: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80108028: 00
80108029: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80108030: 00
80108031: 8b 45 f4 mov -0xc(%ebp),%eax
80108034: 89 04 24 mov %eax,(%esp)
80108037: e8 7e d1 ff ff call 801051ba <memset>
mappages(pgdir, 0, PGSIZE, v2p(mem), PTE_W|PTE_U);
8010803c: 8b 45 f4 mov -0xc(%ebp),%eax
8010803f: 89 04 24 mov %eax,(%esp)
80108042: e8 a4 f7 ff ff call 801077eb <v2p>
80108047: c7 44 24 10 06 00 00 movl $0x6,0x10(%esp)
8010804e: 00
8010804f: 89 44 24 0c mov %eax,0xc(%esp)
80108053: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
8010805a: 00
8010805b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80108062: 00
80108063: 8b 45 08 mov 0x8(%ebp),%eax
80108066: 89 04 24 mov %eax,(%esp)
80108069: e8 a3 fc ff ff call 80107d11 <mappages>
memmove(mem, init, sz);
8010806e: 8b 45 10 mov 0x10(%ebp),%eax
80108071: 89 44 24 08 mov %eax,0x8(%esp)
80108075: 8b 45 0c mov 0xc(%ebp),%eax
80108078: 89 44 24 04 mov %eax,0x4(%esp)
8010807c: 8b 45 f4 mov -0xc(%ebp),%eax
8010807f: 89 04 24 mov %eax,(%esp)
80108082: e8 06 d2 ff ff call 8010528d <memmove>
}
80108087: c9 leave
80108088: c3 ret
80108089 <loaduvm>:
// Load a program segment into pgdir. addr must be page-aligned
// and the pages from addr to addr+sz must already be mapped.
int
loaduvm(pde_t *pgdir, char *addr, struct inode *ip, uint offset, uint sz)
{
80108089: 55 push %ebp
8010808a: 89 e5 mov %esp,%ebp
8010808c: 53 push %ebx
8010808d: 83 ec 24 sub $0x24,%esp
uint i, pa, n;
pte_t *pte;
if((uint) addr % PGSIZE != 0)
80108090: 8b 45 0c mov 0xc(%ebp),%eax
80108093: 25 ff 0f 00 00 and $0xfff,%eax
80108098: 85 c0 test %eax,%eax
8010809a: 74 0c je 801080a8 <loaduvm+0x1f>
panic("loaduvm: addr must be page aligned");
8010809c: c7 04 24 08 8c 10 80 movl $0x80108c08,(%esp)
801080a3: e8 92 84 ff ff call 8010053a <panic>
for(i = 0; i < sz; i += PGSIZE){
801080a8: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp)
801080af: e9 ae 00 00 00 jmp 80108162 <loaduvm+0xd9>
if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
801080b4: 8b 45 e8 mov -0x18(%ebp),%eax
801080b7: 8b 55 0c mov 0xc(%ebp),%edx
801080ba: 8d 04 02 lea (%edx,%eax,1),%eax
801080bd: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
801080c4: 00
801080c5: 89 44 24 04 mov %eax,0x4(%esp)
801080c9: 8b 45 08 mov 0x8(%ebp),%eax
801080cc: 89 04 24 mov %eax,(%esp)
801080cf: e8 a7 fb ff ff call 80107c7b <walkpgdir>
801080d4: 89 45 f4 mov %eax,-0xc(%ebp)
801080d7: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801080db: 75 0c jne 801080e9 <loaduvm+0x60>
panic("loaduvm: address should exist");
801080dd: c7 04 24 2b 8c 10 80 movl $0x80108c2b,(%esp)
801080e4: e8 51 84 ff ff call 8010053a <panic>
pa = PTE_ADDR(*pte);
801080e9: 8b 45 f4 mov -0xc(%ebp),%eax
801080ec: 8b 00 mov (%eax),%eax
801080ee: 25 00 f0 ff ff and $0xfffff000,%eax
801080f3: 89 45 ec mov %eax,-0x14(%ebp)
if(sz - i < PGSIZE)
801080f6: 8b 45 e8 mov -0x18(%ebp),%eax
801080f9: 8b 55 18 mov 0x18(%ebp),%edx
801080fc: 89 d1 mov %edx,%ecx
801080fe: 29 c1 sub %eax,%ecx
80108100: 89 c8 mov %ecx,%eax
80108102: 3d ff 0f 00 00 cmp $0xfff,%eax
80108107: 77 11 ja 8010811a <loaduvm+0x91>
n = sz - i;
80108109: 8b 45 e8 mov -0x18(%ebp),%eax
8010810c: 8b 55 18 mov 0x18(%ebp),%edx
8010810f: 89 d1 mov %edx,%ecx
80108111: 29 c1 sub %eax,%ecx
80108113: 89 c8 mov %ecx,%eax
80108115: 89 45 f0 mov %eax,-0x10(%ebp)
80108118: eb 07 jmp 80108121 <loaduvm+0x98>
else
n = PGSIZE;
8010811a: c7 45 f0 00 10 00 00 movl $0x1000,-0x10(%ebp)
if(readi(ip, p2v(pa), offset+i, n) != n)
80108121: 8b 45 e8 mov -0x18(%ebp),%eax
80108124: 8b 55 14 mov 0x14(%ebp),%edx
80108127: 8d 1c 02 lea (%edx,%eax,1),%ebx
8010812a: 8b 45 ec mov -0x14(%ebp),%eax
8010812d: 89 04 24 mov %eax,(%esp)
80108130: e8 c3 f6 ff ff call 801077f8 <p2v>
80108135: 8b 55 f0 mov -0x10(%ebp),%edx
80108138: 89 54 24 0c mov %edx,0xc(%esp)
8010813c: 89 5c 24 08 mov %ebx,0x8(%esp)
80108140: 89 44 24 04 mov %eax,0x4(%esp)
80108144: 8b 45 10 mov 0x10(%ebp),%eax
80108147: 89 04 24 mov %eax,(%esp)
8010814a: e8 25 9c ff ff call 80101d74 <readi>
8010814f: 3b 45 f0 cmp -0x10(%ebp),%eax
80108152: 74 07 je 8010815b <loaduvm+0xd2>
return -1;
80108154: b8 ff ff ff ff mov $0xffffffff,%eax
80108159: eb 18 jmp 80108173 <loaduvm+0xea>
uint i, pa, n;
pte_t *pte;
if((uint) addr % PGSIZE != 0)
panic("loaduvm: addr must be page aligned");
for(i = 0; i < sz; i += PGSIZE){
8010815b: 81 45 e8 00 10 00 00 addl $0x1000,-0x18(%ebp)
80108162: 8b 45 e8 mov -0x18(%ebp),%eax
80108165: 3b 45 18 cmp 0x18(%ebp),%eax
80108168: 0f 82 46 ff ff ff jb 801080b4 <loaduvm+0x2b>
else
n = PGSIZE;
if(readi(ip, p2v(pa), offset+i, n) != n)
return -1;
}
return 0;
8010816e: b8 00 00 00 00 mov $0x0,%eax
}
80108173: 83 c4 24 add $0x24,%esp
80108176: 5b pop %ebx
80108177: 5d pop %ebp
80108178: c3 ret
80108179 <allocuvm>:
// Allocate page tables and physical memory to grow process from oldsz to
// newsz, which need not be page aligned. Returns new size or 0 on error.
int
allocuvm(pde_t *pgdir, uint oldsz, uint newsz)
{
80108179: 55 push %ebp
8010817a: 89 e5 mov %esp,%ebp
8010817c: 83 ec 38 sub $0x38,%esp
char *mem;
uint a;
if(newsz >= KERNBASE)
8010817f: 8b 45 10 mov 0x10(%ebp),%eax
80108182: 85 c0 test %eax,%eax
80108184: 79 0a jns 80108190 <allocuvm+0x17>
return 0;
80108186: b8 00 00 00 00 mov $0x0,%eax
8010818b: e9 c1 00 00 00 jmp 80108251 <allocuvm+0xd8>
if(newsz < oldsz)
80108190: 8b 45 10 mov 0x10(%ebp),%eax
80108193: 3b 45 0c cmp 0xc(%ebp),%eax
80108196: 73 08 jae 801081a0 <allocuvm+0x27>
return oldsz;
80108198: 8b 45 0c mov 0xc(%ebp),%eax
8010819b: e9 b1 00 00 00 jmp 80108251 <allocuvm+0xd8>
a = PGROUNDUP(oldsz);
801081a0: 8b 45 0c mov 0xc(%ebp),%eax
801081a3: 05 ff 0f 00 00 add $0xfff,%eax
801081a8: 25 00 f0 ff ff and $0xfffff000,%eax
801081ad: 89 45 f4 mov %eax,-0xc(%ebp)
for(; a < newsz; a += PGSIZE){
801081b0: e9 8d 00 00 00 jmp 80108242 <allocuvm+0xc9>
mem = kalloc();
801081b5: e8 50 a9 ff ff call 80102b0a <kalloc>
801081ba: 89 45 f0 mov %eax,-0x10(%ebp)
if(mem == 0){
801081bd: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
801081c1: 75 2c jne 801081ef <allocuvm+0x76>
cprintf("allocuvm out of memory\n");
801081c3: c7 04 24 49 8c 10 80 movl $0x80108c49,(%esp)
801081ca: e8 cb 81 ff ff call 8010039a <cprintf>
deallocuvm(pgdir, newsz, oldsz);
801081cf: 8b 45 0c mov 0xc(%ebp),%eax
801081d2: 89 44 24 08 mov %eax,0x8(%esp)
801081d6: 8b 45 10 mov 0x10(%ebp),%eax
801081d9: 89 44 24 04 mov %eax,0x4(%esp)
801081dd: 8b 45 08 mov 0x8(%ebp),%eax
801081e0: 89 04 24 mov %eax,(%esp)
801081e3: e8 6b 00 00 00 call 80108253 <deallocuvm>
return 0;
801081e8: b8 00 00 00 00 mov $0x0,%eax
801081ed: eb 62 jmp 80108251 <allocuvm+0xd8>
}
memset(mem, 0, PGSIZE);
801081ef: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
801081f6: 00
801081f7: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801081fe: 00
801081ff: 8b 45 f0 mov -0x10(%ebp),%eax
80108202: 89 04 24 mov %eax,(%esp)
80108205: e8 b0 cf ff ff call 801051ba <memset>
mappages(pgdir, (char*)a, PGSIZE, v2p(mem), PTE_W|PTE_U);
8010820a: 8b 45 f0 mov -0x10(%ebp),%eax
8010820d: 89 04 24 mov %eax,(%esp)
80108210: e8 d6 f5 ff ff call 801077eb <v2p>
80108215: 8b 55 f4 mov -0xc(%ebp),%edx
80108218: c7 44 24 10 06 00 00 movl $0x6,0x10(%esp)
8010821f: 00
80108220: 89 44 24 0c mov %eax,0xc(%esp)
80108224: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
8010822b: 00
8010822c: 89 54 24 04 mov %edx,0x4(%esp)
80108230: 8b 45 08 mov 0x8(%ebp),%eax
80108233: 89 04 24 mov %eax,(%esp)
80108236: e8 d6 fa ff ff call 80107d11 <mappages>
return 0;
if(newsz < oldsz)
return oldsz;
a = PGROUNDUP(oldsz);
for(; a < newsz; a += PGSIZE){
8010823b: 81 45 f4 00 10 00 00 addl $0x1000,-0xc(%ebp)
80108242: 8b 45 f4 mov -0xc(%ebp),%eax
80108245: 3b 45 10 cmp 0x10(%ebp),%eax
80108248: 0f 82 67 ff ff ff jb 801081b5 <allocuvm+0x3c>
return 0;
}
memset(mem, 0, PGSIZE);
mappages(pgdir, (char*)a, PGSIZE, v2p(mem), PTE_W|PTE_U);
}
return newsz;
8010824e: 8b 45 10 mov 0x10(%ebp),%eax
}
80108251: c9 leave
80108252: c3 ret
80108253 <deallocuvm>:
// newsz. oldsz and newsz need not be page-aligned, nor does newsz
// need to be less than oldsz. oldsz can be larger than the actual
// process size. Returns the new process size.
int
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
{
80108253: 55 push %ebp
80108254: 89 e5 mov %esp,%ebp
80108256: 83 ec 28 sub $0x28,%esp
pte_t *pte;
uint a, pa;
if(newsz >= oldsz)
80108259: 8b 45 10 mov 0x10(%ebp),%eax
8010825c: 3b 45 0c cmp 0xc(%ebp),%eax
8010825f: 72 08 jb 80108269 <deallocuvm+0x16>
return oldsz;
80108261: 8b 45 0c mov 0xc(%ebp),%eax
80108264: e9 a4 00 00 00 jmp 8010830d <deallocuvm+0xba>
a = PGROUNDUP(newsz);
80108269: 8b 45 10 mov 0x10(%ebp),%eax
8010826c: 05 ff 0f 00 00 add $0xfff,%eax
80108271: 25 00 f0 ff ff and $0xfffff000,%eax
80108276: 89 45 ec mov %eax,-0x14(%ebp)
for(; a < oldsz; a += PGSIZE){
80108279: e9 80 00 00 00 jmp 801082fe <deallocuvm+0xab>
pte = walkpgdir(pgdir, (char*)a, 0);
8010827e: 8b 45 ec mov -0x14(%ebp),%eax
80108281: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80108288: 00
80108289: 89 44 24 04 mov %eax,0x4(%esp)
8010828d: 8b 45 08 mov 0x8(%ebp),%eax
80108290: 89 04 24 mov %eax,(%esp)
80108293: e8 e3 f9 ff ff call 80107c7b <walkpgdir>
80108298: 89 45 e8 mov %eax,-0x18(%ebp)
if(!pte)
8010829b: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
8010829f: 75 09 jne 801082aa <deallocuvm+0x57>
a += (NPTENTRIES - 1) * PGSIZE;
801082a1: 81 45 ec 00 f0 3f 00 addl $0x3ff000,-0x14(%ebp)
801082a8: eb 4d jmp 801082f7 <deallocuvm+0xa4>
else if((*pte & PTE_P) != 0){
801082aa: 8b 45 e8 mov -0x18(%ebp),%eax
801082ad: 8b 00 mov (%eax),%eax
801082af: 83 e0 01 and $0x1,%eax
801082b2: 84 c0 test %al,%al
801082b4: 74 41 je 801082f7 <deallocuvm+0xa4>
pa = PTE_ADDR(*pte);
801082b6: 8b 45 e8 mov -0x18(%ebp),%eax
801082b9: 8b 00 mov (%eax),%eax
801082bb: 25 00 f0 ff ff and $0xfffff000,%eax
801082c0: 89 45 f0 mov %eax,-0x10(%ebp)
if(pa == 0)
801082c3: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
801082c7: 75 0c jne 801082d5 <deallocuvm+0x82>
panic("kfree");
801082c9: c7 04 24 61 8c 10 80 movl $0x80108c61,(%esp)
801082d0: e8 65 82 ff ff call 8010053a <panic>
char *v = p2v(pa);
801082d5: 8b 45 f0 mov -0x10(%ebp),%eax
801082d8: 89 04 24 mov %eax,(%esp)
801082db: e8 18 f5 ff ff call 801077f8 <p2v>
801082e0: 89 45 f4 mov %eax,-0xc(%ebp)
kfree(v);
801082e3: 8b 45 f4 mov -0xc(%ebp),%eax
801082e6: 89 04 24 mov %eax,(%esp)
801082e9: e8 83 a7 ff ff call 80102a71 <kfree>
*pte = 0;
801082ee: 8b 45 e8 mov -0x18(%ebp),%eax
801082f1: c7 00 00 00 00 00 movl $0x0,(%eax)
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
for(; a < oldsz; a += PGSIZE){
801082f7: 81 45 ec 00 10 00 00 addl $0x1000,-0x14(%ebp)
801082fe: 8b 45 ec mov -0x14(%ebp),%eax
80108301: 3b 45 0c cmp 0xc(%ebp),%eax
80108304: 0f 82 74 ff ff ff jb 8010827e <deallocuvm+0x2b>
char *v = p2v(pa);
kfree(v);
*pte = 0;
}
}
return newsz;
8010830a: 8b 45 10 mov 0x10(%ebp),%eax
}
8010830d: c9 leave
8010830e: c3 ret
8010830f <freevm>:
// Free a page table and all the physical memory pages
// in the user part.
void
freevm(pde_t *pgdir)
{
8010830f: 55 push %ebp
80108310: 89 e5 mov %esp,%ebp
80108312: 83 ec 28 sub $0x28,%esp
uint i;
if(pgdir == 0)
80108315: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
80108319: 75 0c jne 80108327 <freevm+0x18>
panic("freevm: no pgdir");
8010831b: c7 04 24 67 8c 10 80 movl $0x80108c67,(%esp)
80108322: e8 13 82 ff ff call 8010053a <panic>
deallocuvm(pgdir, KERNBASE, 0);
80108327: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
8010832e: 00
8010832f: c7 44 24 04 00 00 00 movl $0x80000000,0x4(%esp)
80108336: 80
80108337: 8b 45 08 mov 0x8(%ebp),%eax
8010833a: 89 04 24 mov %eax,(%esp)
8010833d: e8 11 ff ff ff call 80108253 <deallocuvm>
for(i = 0; i < NPDENTRIES; i++){
80108342: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
80108349: eb 3c jmp 80108387 <freevm+0x78>
if(pgdir[i] & PTE_P){
8010834b: 8b 45 f0 mov -0x10(%ebp),%eax
8010834e: c1 e0 02 shl $0x2,%eax
80108351: 03 45 08 add 0x8(%ebp),%eax
80108354: 8b 00 mov (%eax),%eax
80108356: 83 e0 01 and $0x1,%eax
80108359: 84 c0 test %al,%al
8010835b: 74 26 je 80108383 <freevm+0x74>
char * v = p2v(PTE_ADDR(pgdir[i]));
8010835d: 8b 45 f0 mov -0x10(%ebp),%eax
80108360: c1 e0 02 shl $0x2,%eax
80108363: 03 45 08 add 0x8(%ebp),%eax
80108366: 8b 00 mov (%eax),%eax
80108368: 25 00 f0 ff ff and $0xfffff000,%eax
8010836d: 89 04 24 mov %eax,(%esp)
80108370: e8 83 f4 ff ff call 801077f8 <p2v>
80108375: 89 45 f4 mov %eax,-0xc(%ebp)
kfree(v);
80108378: 8b 45 f4 mov -0xc(%ebp),%eax
8010837b: 89 04 24 mov %eax,(%esp)
8010837e: e8 ee a6 ff ff call 80102a71 <kfree>
uint i;
if(pgdir == 0)
panic("freevm: no pgdir");
deallocuvm(pgdir, KERNBASE, 0);
for(i = 0; i < NPDENTRIES; i++){
80108383: 83 45 f0 01 addl $0x1,-0x10(%ebp)
80108387: 81 7d f0 ff 03 00 00 cmpl $0x3ff,-0x10(%ebp)
8010838e: 76 bb jbe 8010834b <freevm+0x3c>
if(pgdir[i] & PTE_P){
char * v = p2v(PTE_ADDR(pgdir[i]));
kfree(v);
}
}
kfree((char*)pgdir);
80108390: 8b 45 08 mov 0x8(%ebp),%eax
80108393: 89 04 24 mov %eax,(%esp)
80108396: e8 d6 a6 ff ff call 80102a71 <kfree>
}
8010839b: c9 leave
8010839c: c3 ret
8010839d <clearpteu>:
// Clear PTE_U on a page. Used to create an inaccessible
// page beneath the user stack.
void
clearpteu(pde_t *pgdir, char *uva)
{
8010839d: 55 push %ebp
8010839e: 89 e5 mov %esp,%ebp
801083a0: 83 ec 28 sub $0x28,%esp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
801083a3: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
801083aa: 00
801083ab: 8b 45 0c mov 0xc(%ebp),%eax
801083ae: 89 44 24 04 mov %eax,0x4(%esp)
801083b2: 8b 45 08 mov 0x8(%ebp),%eax
801083b5: 89 04 24 mov %eax,(%esp)
801083b8: e8 be f8 ff ff call 80107c7b <walkpgdir>
801083bd: 89 45 f4 mov %eax,-0xc(%ebp)
if(pte == 0)
801083c0: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801083c4: 75 0c jne 801083d2 <clearpteu+0x35>
panic("clearpteu");
801083c6: c7 04 24 78 8c 10 80 movl $0x80108c78,(%esp)
801083cd: e8 68 81 ff ff call 8010053a <panic>
*pte &= ~PTE_U;
801083d2: 8b 45 f4 mov -0xc(%ebp),%eax
801083d5: 8b 00 mov (%eax),%eax
801083d7: 89 c2 mov %eax,%edx
801083d9: 83 e2 fb and $0xfffffffb,%edx
801083dc: 8b 45 f4 mov -0xc(%ebp),%eax
801083df: 89 10 mov %edx,(%eax)
}
801083e1: c9 leave
801083e2: c3 ret
801083e3 <copyuvm>:
// Given a parent process's page table, create a copy
// of it for a child.
pde_t*
copyuvm(pde_t *pgdir, uint sz)
{
801083e3: 55 push %ebp
801083e4: 89 e5 mov %esp,%ebp
801083e6: 53 push %ebx
801083e7: 83 ec 44 sub $0x44,%esp
pde_t *d;
pte_t *pte;
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
801083ea: e8 b6 f9 ff ff call 80107da5 <setupkvm>
801083ef: 89 45 e0 mov %eax,-0x20(%ebp)
801083f2: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
801083f6: 75 0a jne 80108402 <copyuvm+0x1f>
return 0;
801083f8: b8 00 00 00 00 mov $0x0,%eax
801083fd: e9 fd 00 00 00 jmp 801084ff <copyuvm+0x11c>
for(i = 0; i < sz; i += PGSIZE){
80108402: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80108409: e9 cc 00 00 00 jmp 801084da <copyuvm+0xf7>
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
8010840e: 8b 45 ec mov -0x14(%ebp),%eax
80108411: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80108418: 00
80108419: 89 44 24 04 mov %eax,0x4(%esp)
8010841d: 8b 45 08 mov 0x8(%ebp),%eax
80108420: 89 04 24 mov %eax,(%esp)
80108423: e8 53 f8 ff ff call 80107c7b <walkpgdir>
80108428: 89 45 e4 mov %eax,-0x1c(%ebp)
8010842b: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
8010842f: 75 0c jne 8010843d <copyuvm+0x5a>
panic("copyuvm: pte should exist");
80108431: c7 04 24 82 8c 10 80 movl $0x80108c82,(%esp)
80108438: e8 fd 80 ff ff call 8010053a <panic>
if(!(*pte & PTE_P))
8010843d: 8b 45 e4 mov -0x1c(%ebp),%eax
80108440: 8b 00 mov (%eax),%eax
80108442: 83 e0 01 and $0x1,%eax
80108445: 85 c0 test %eax,%eax
80108447: 75 0c jne 80108455 <copyuvm+0x72>
panic("copyuvm: page not present");
80108449: c7 04 24 9c 8c 10 80 movl $0x80108c9c,(%esp)
80108450: e8 e5 80 ff ff call 8010053a <panic>
pa = PTE_ADDR(*pte);
80108455: 8b 45 e4 mov -0x1c(%ebp),%eax
80108458: 8b 00 mov (%eax),%eax
8010845a: 25 00 f0 ff ff and $0xfffff000,%eax
8010845f: 89 45 e8 mov %eax,-0x18(%ebp)
flags = PTE_FLAGS(*pte);
80108462: 8b 45 e4 mov -0x1c(%ebp),%eax
80108465: 8b 00 mov (%eax),%eax
80108467: 25 ff 0f 00 00 and $0xfff,%eax
8010846c: 89 45 f0 mov %eax,-0x10(%ebp)
if((mem = kalloc()) == 0)
8010846f: e8 96 a6 ff ff call 80102b0a <kalloc>
80108474: 89 45 f4 mov %eax,-0xc(%ebp)
80108477: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8010847b: 74 6e je 801084eb <copyuvm+0x108>
goto bad;
memmove(mem, (char*)p2v(pa), PGSIZE);
8010847d: 8b 45 e8 mov -0x18(%ebp),%eax
80108480: 89 04 24 mov %eax,(%esp)
80108483: e8 70 f3 ff ff call 801077f8 <p2v>
80108488: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
8010848f: 00
80108490: 89 44 24 04 mov %eax,0x4(%esp)
80108494: 8b 45 f4 mov -0xc(%ebp),%eax
80108497: 89 04 24 mov %eax,(%esp)
8010849a: e8 ee cd ff ff call 8010528d <memmove>
if(mappages(d, (void*)i, PGSIZE, v2p(mem), flags) < 0)
8010849f: 8b 5d f0 mov -0x10(%ebp),%ebx
801084a2: 8b 45 f4 mov -0xc(%ebp),%eax
801084a5: 89 04 24 mov %eax,(%esp)
801084a8: e8 3e f3 ff ff call 801077eb <v2p>
801084ad: 8b 55 ec mov -0x14(%ebp),%edx
801084b0: 89 5c 24 10 mov %ebx,0x10(%esp)
801084b4: 89 44 24 0c mov %eax,0xc(%esp)
801084b8: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
801084bf: 00
801084c0: 89 54 24 04 mov %edx,0x4(%esp)
801084c4: 8b 45 e0 mov -0x20(%ebp),%eax
801084c7: 89 04 24 mov %eax,(%esp)
801084ca: e8 42 f8 ff ff call 80107d11 <mappages>
801084cf: 85 c0 test %eax,%eax
801084d1: 78 1b js 801084ee <copyuvm+0x10b>
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
return 0;
for(i = 0; i < sz; i += PGSIZE){
801084d3: 81 45 ec 00 10 00 00 addl $0x1000,-0x14(%ebp)
801084da: 8b 45 ec mov -0x14(%ebp),%eax
801084dd: 3b 45 0c cmp 0xc(%ebp),%eax
801084e0: 0f 82 28 ff ff ff jb 8010840e <copyuvm+0x2b>
goto bad;
memmove(mem, (char*)p2v(pa), PGSIZE);
if(mappages(d, (void*)i, PGSIZE, v2p(mem), flags) < 0)
goto bad;
}
return d;
801084e6: 8b 45 e0 mov -0x20(%ebp),%eax
801084e9: eb 14 jmp 801084ff <copyuvm+0x11c>
if(!(*pte & PTE_P))
panic("copyuvm: page not present");
pa = PTE_ADDR(*pte);
flags = PTE_FLAGS(*pte);
if((mem = kalloc()) == 0)
goto bad;
801084eb: 90 nop
801084ec: eb 01 jmp 801084ef <copyuvm+0x10c>
memmove(mem, (char*)p2v(pa), PGSIZE);
if(mappages(d, (void*)i, PGSIZE, v2p(mem), flags) < 0)
goto bad;
801084ee: 90 nop
}
return d;
bad:
freevm(d);
801084ef: 8b 45 e0 mov -0x20(%ebp),%eax
801084f2: 89 04 24 mov %eax,(%esp)
801084f5: e8 15 fe ff ff call 8010830f <freevm>
return 0;
801084fa: b8 00 00 00 00 mov $0x0,%eax
}
801084ff: 83 c4 44 add $0x44,%esp
80108502: 5b pop %ebx
80108503: 5d pop %ebp
80108504: c3 ret
80108505 <uva2ka>:
//PAGEBREAK!
// Map user virtual address to kernel address.
char*
uva2ka(pde_t *pgdir, char *uva)
{
80108505: 55 push %ebp
80108506: 89 e5 mov %esp,%ebp
80108508: 83 ec 28 sub $0x28,%esp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
8010850b: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80108512: 00
80108513: 8b 45 0c mov 0xc(%ebp),%eax
80108516: 89 44 24 04 mov %eax,0x4(%esp)
8010851a: 8b 45 08 mov 0x8(%ebp),%eax
8010851d: 89 04 24 mov %eax,(%esp)
80108520: e8 56 f7 ff ff call 80107c7b <walkpgdir>
80108525: 89 45 f4 mov %eax,-0xc(%ebp)
if((*pte & PTE_P) == 0)
80108528: 8b 45 f4 mov -0xc(%ebp),%eax
8010852b: 8b 00 mov (%eax),%eax
8010852d: 83 e0 01 and $0x1,%eax
80108530: 85 c0 test %eax,%eax
80108532: 75 07 jne 8010853b <uva2ka+0x36>
return 0;
80108534: b8 00 00 00 00 mov $0x0,%eax
80108539: eb 25 jmp 80108560 <uva2ka+0x5b>
if((*pte & PTE_U) == 0)
8010853b: 8b 45 f4 mov -0xc(%ebp),%eax
8010853e: 8b 00 mov (%eax),%eax
80108540: 83 e0 04 and $0x4,%eax
80108543: 85 c0 test %eax,%eax
80108545: 75 07 jne 8010854e <uva2ka+0x49>
return 0;
80108547: b8 00 00 00 00 mov $0x0,%eax
8010854c: eb 12 jmp 80108560 <uva2ka+0x5b>
return (char*)p2v(PTE_ADDR(*pte));
8010854e: 8b 45 f4 mov -0xc(%ebp),%eax
80108551: 8b 00 mov (%eax),%eax
80108553: 25 00 f0 ff ff and $0xfffff000,%eax
80108558: 89 04 24 mov %eax,(%esp)
8010855b: e8 98 f2 ff ff call 801077f8 <p2v>
}
80108560: c9 leave
80108561: c3 ret
80108562 <copyout>:
// Copy len bytes from p to user address va in page table pgdir.
// Most useful when pgdir is not the current page table.
// uva2ka ensures this only works for PTE_U pages.
int
copyout(pde_t *pgdir, uint va, void *p, uint len)
{
80108562: 55 push %ebp
80108563: 89 e5 mov %esp,%ebp
80108565: 83 ec 28 sub $0x28,%esp
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
80108568: 8b 45 10 mov 0x10(%ebp),%eax
8010856b: 89 45 e8 mov %eax,-0x18(%ebp)
while(len > 0){
8010856e: e9 8b 00 00 00 jmp 801085fe <copyout+0x9c>
va0 = (uint)PGROUNDDOWN(va);
80108573: 8b 45 0c mov 0xc(%ebp),%eax
80108576: 25 00 f0 ff ff and $0xfffff000,%eax
8010857b: 89 45 f4 mov %eax,-0xc(%ebp)
pa0 = uva2ka(pgdir, (char*)va0);
8010857e: 8b 45 f4 mov -0xc(%ebp),%eax
80108581: 89 44 24 04 mov %eax,0x4(%esp)
80108585: 8b 45 08 mov 0x8(%ebp),%eax
80108588: 89 04 24 mov %eax,(%esp)
8010858b: e8 75 ff ff ff call 80108505 <uva2ka>
80108590: 89 45 ec mov %eax,-0x14(%ebp)
if(pa0 == 0)
80108593: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80108597: 75 07 jne 801085a0 <copyout+0x3e>
return -1;
80108599: b8 ff ff ff ff mov $0xffffffff,%eax
8010859e: eb 6d jmp 8010860d <copyout+0xab>
n = PGSIZE - (va - va0);
801085a0: 8b 45 0c mov 0xc(%ebp),%eax
801085a3: 8b 55 f4 mov -0xc(%ebp),%edx
801085a6: 89 d1 mov %edx,%ecx
801085a8: 29 c1 sub %eax,%ecx
801085aa: 89 c8 mov %ecx,%eax
801085ac: 05 00 10 00 00 add $0x1000,%eax
801085b1: 89 45 f0 mov %eax,-0x10(%ebp)
if(n > len)
801085b4: 8b 45 f0 mov -0x10(%ebp),%eax
801085b7: 3b 45 14 cmp 0x14(%ebp),%eax
801085ba: 76 06 jbe 801085c2 <copyout+0x60>
n = len;
801085bc: 8b 45 14 mov 0x14(%ebp),%eax
801085bf: 89 45 f0 mov %eax,-0x10(%ebp)
memmove(pa0 + (va - va0), buf, n);
801085c2: 8b 45 f4 mov -0xc(%ebp),%eax
801085c5: 8b 55 0c mov 0xc(%ebp),%edx
801085c8: 89 d1 mov %edx,%ecx
801085ca: 29 c1 sub %eax,%ecx
801085cc: 89 c8 mov %ecx,%eax
801085ce: 03 45 ec add -0x14(%ebp),%eax
801085d1: 8b 55 f0 mov -0x10(%ebp),%edx
801085d4: 89 54 24 08 mov %edx,0x8(%esp)
801085d8: 8b 55 e8 mov -0x18(%ebp),%edx
801085db: 89 54 24 04 mov %edx,0x4(%esp)
801085df: 89 04 24 mov %eax,(%esp)
801085e2: e8 a6 cc ff ff call 8010528d <memmove>
len -= n;
801085e7: 8b 45 f0 mov -0x10(%ebp),%eax
801085ea: 29 45 14 sub %eax,0x14(%ebp)
buf += n;
801085ed: 8b 45 f0 mov -0x10(%ebp),%eax
801085f0: 01 45 e8 add %eax,-0x18(%ebp)
va = va0 + PGSIZE;
801085f3: 8b 45 f4 mov -0xc(%ebp),%eax
801085f6: 05 00 10 00 00 add $0x1000,%eax
801085fb: 89 45 0c mov %eax,0xc(%ebp)
{
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
801085fe: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
80108602: 0f 85 6b ff ff ff jne 80108573 <copyout+0x11>
memmove(pa0 + (va - va0), buf, n);
len -= n;
buf += n;
va = va0 + PGSIZE;
}
return 0;
80108608: b8 00 00 00 00 mov $0x0,%eax
}
8010860d: c9 leave
8010860e: c3 ret
| 37.524596 | 74 | 0.537364 |
9143eee93a16b681de161e985a3ea71df4a96828 | 380 | asm | Assembly | oeis/052/A052659.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/052/A052659.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/052/A052659.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A052659: E.g.f. (1-2x)(1-x)/(1-4x+2x^2).
; Submitted by Simon Strandgaard
; 1,1,8,84,1152,19680,403200,9636480,263208960,8087869440,276137164800,10370703974400,424893579264000,18858806481715200,901431900123955200,46165215285116928000,2521886466187984896000
cmp $1,$0
mov $2,1
mov $3,$0
lpb $3
mul $1,$3
mul $1,2
mul $2,$3
add $1,$2
add $2,$1
sub $3,1
lpe
mov $0,$1
| 22.352941 | 182 | 0.707895 |
3a1a0c238f21a52fd5836aa84941cfe1e1b39b0e | 3,508 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_3_1015.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_3_1015.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_3_1015.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r8
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1723c, %rsi
lea addresses_A_ht+0x142fc, %rdi
nop
nop
add $37018, %rbp
mov $10, %rcx
rep movsw
nop
nop
nop
dec %r14
lea addresses_normal_ht+0x1d0bc, %rbp
nop
nop
add $30129, %r8
movl $0x61626364, (%rbp)
nop
nop
xor %rcx, %rcx
lea addresses_UC_ht+0x13bbc, %rsi
lea addresses_WC_ht+0x59fc, %rdi
nop
add %rbx, %rbx
mov $1, %rcx
rep movsl
nop
nop
and %r14, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r8
push %r9
push %rbx
push %rcx
push %rdx
// Store
lea addresses_D+0x89c, %rbx
nop
and %r8, %r8
mov $0x5152535455565758, %rdx
movq %rdx, (%rbx)
cmp $14710, %r12
// Store
lea addresses_WT+0x87bc, %rcx
and %r9, %r9
mov $0x5152535455565758, %rbx
movq %rbx, %xmm4
vmovups %ymm4, (%rcx)
nop
add $33041, %rcx
// Store
lea addresses_D+0xad84, %rdx
nop
xor %r12, %r12
mov $0x5152535455565758, %r8
movq %r8, (%rdx)
nop
nop
cmp $63482, %r13
// Load
lea addresses_WT+0x197bc, %rdx
add $53147, %r12
mov (%rdx), %bx
nop
nop
nop
cmp $26171, %r12
// Store
lea addresses_D+0x1cd00, %rbx
nop
nop
nop
nop
nop
and $46344, %rcx
movl $0x51525354, (%rbx)
nop
nop
nop
nop
and $43619, %r12
// Store
mov $0xfbc, %rdx
nop
nop
nop
nop
add %r13, %r13
mov $0x5152535455565758, %r9
movq %r9, %xmm1
vmovaps %ymm1, (%rdx)
nop
nop
nop
nop
cmp $29921, %r12
// Load
lea addresses_RW+0x13bbc, %r13
nop
nop
nop
nop
xor $11540, %r12
movups (%r13), %xmm6
vpextrq $0, %xmm6, %rdx
nop
nop
nop
nop
nop
sub $27689, %r9
// Faulty Load
lea addresses_WT+0x87bc, %r13
nop
nop
nop
nop
and $37952, %rbx
vmovups (%r13), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %r9
lea oracles, %rcx
and $0xff, %r9
shlq $12, %r9
mov (%rcx,%r9,1), %r9
pop %rdx
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': True, 'congruent': 11, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 9, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}}
{'00': 3}
00 00 00
*/
| 19.169399 | 149 | 0.642531 |
9d11bab1a239591fd87b718c20cb5a2a77604dd5 | 1,405 | asm | Assembly | Library/Chart/Utils/utilsFile.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Chart/Utils/utilsFile.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Chart/Utils/utilsFile.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: utilsFile.asm
AUTHOR: Chris Boyke
METHODS:
Name Description
---- -----------
FUNCTIONS:
Scope Name Description
----- ---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
CDB 2/19/92 Initial version.
DESCRIPTION:
File utilities
$Id: utilsFile.asm,v 1.1 97/04/04 17:47:45 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UtilGetVMFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the VM file holding the passed block
CALLED BY: GLOBAL within chart
PASS: ds - segment of a block in the VM file
RETURN: bx - vm file handle
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CDB 2/19/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UtilGetVMFile proc far
uses ax
.enter
mov bx, ds:[LMBH_handle]
mov ax, MGIT_OWNER_OR_VM_FILE_HANDLE
call MemGetInfo
mov bx, ax ; VM file handle
.leave
ret
UtilGetVMFile endp
| 18.986486 | 71 | 0.469751 |
d96848585422b868e4496d8c82d459fe070024c9 | 689 | asm | Assembly | oeis/174/A174765.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/174/A174765.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/174/A174765.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A174765: y-values in the solution to x^2 - 19*y^2 = 1.
; Submitted by Jamie Morken(w4)
; 0,39,13260,4508361,1532829480,521157514839,177192022215780,60244766395850361,20483043382566906960,6964174505306352516039,2367798848760777288546300,805044644404158971753225961,273712811298565289618808280440,93061550796867794311423062123639,31640653558123751500594222313756820,10757729148211278642407724163615195161,3657596269738276614667125621406852597920,1243571973981865837708180303554166268097639,422810813557564646544166636082795124300599340,143754433037597997959178948087846788095935677961
lpb $0
sub $0,1
mov $1,$3
mul $1,338
add $2,13
add $2,$1
add $3,$2
lpe
mov $0,$2
mul $0,3
| 45.933333 | 495 | 0.847605 |
d04d8c2cdd61dd194702fddfabd679fb65e10527 | 421 | asm | Assembly | programs/oeis/075/A075553.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/075/A075553.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/075/A075553.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A075553: Numerators in the Maclaurin series for arctan(1+x).
; 0,1,-1,1,0,-1,1,-1,0,1,-1,1,0,-1,1,-1,0,1,-1,1,0,-1,1,-1,0,1,-1,1,0,-1,1,-1,0,1,-1,1,0,-1,1,-1,0,1,-1,1,0,-1,1,-1,0,1,-1,1,0,-1,1,-1,0,1,-1,1,0,-1,1,-1,0,1,-1,1,0,-1,1,-1,0,1,-1,1,0,-1,1,-1,0,1,-1,1,0,-1,1,-1,0,1,-1,1,0,-1,1,-1,0,1,-1,1
add $0,1
mod $0,8
mov $2,$0
trn $2,3
add $2,$0
mov $1,$2
mul $1,$0
mul $1,$0
lpb $1
mod $1,3
lpe
sub $1,1
mov $0,$1
| 24.764706 | 238 | 0.498812 |
effae5f80ccc234c766d541c59160337ea739ad0 | 545 | asm | Assembly | oeis/010/A010966.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/010/A010966.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/010/A010966.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A010966: a(n) = binomial(n,13).
; 1,14,105,560,2380,8568,27132,77520,203490,497420,1144066,2496144,5200300,10400600,20058300,37442160,67863915,119759850,206253075,347373600,573166440,927983760,1476337800,2310789600,3562467300,5414950296,8122425444,12033222880,17620076360,25518731280,36576848168,51915526432,73006209045,101766230790,140676848445,192928249296,262596783764,354860518600,476260169700,635013559600,841392966470,1108176102180,1451182990950,1889912732400,2448296039700,3155581562280,4047376351620,5166863427600
add $0,13
bin $0,13
| 90.833333 | 489 | 0.866055 |
b35e0bf43e911ad890e8739cbc23935e1a5be2dd | 7,548 | asm | Assembly | src/sm/transition.asm | SmolBig/alttp_sm_combo_randomizer_rom | 571ca88e10cce0b4477be8a0f5f9bdbe4693757c | [
"MIT"
] | null | null | null | src/sm/transition.asm | SmolBig/alttp_sm_combo_randomizer_rom | 571ca88e10cce0b4477be8a0f5f9bdbe4693757c | [
"MIT"
] | null | null | null | src/sm/transition.asm | SmolBig/alttp_sm_combo_randomizer_rom | 571ca88e10cce0b4477be8a0f5f9bdbe4693757c | [
"MIT"
] | null | null | null | ; Transition into Super Metroid
org $c18003
base $818003
jml sm_save_hook
org $c1807F
base $81807F
jml sm_save_done_hook
org $c18087
base $818087
jml sm_load_hook
; Place all the transition code in the top of the upper bank AA/EA (free space in SM)
org $eafd00
base $aafd00
; room id in !SRAM_SM_EXIT
; When we're entering this routine, ALTTP is running but all the relevant SRAM data
; and extra state data has already been saved, so all we do here is setup SM in a
; proper state and then trigger the door transition.
transition_to_sm:
sei ; Disable IRQ's
%i16()
%a8()
phk
plb ; Set data bank program bank
lda #$01
sta $420d ; Toggle FastROM on
lda #$00
sta $004200 ; Disable NMI and Joypad autoread
sta $00420c ; Disable H-DMA
lda #$8f
sta $002100 ; Enable PPU force blank
jsl sm_spc_reset ; Kill the ALTTP music engine and put the SPC in IPL upload mode
; Gotta do this before switching RAM contents
-
bit $4212 ; Wait for a fresh NMI
bmi -
-
bit $4212
bpl -
%a16()
lda !SRAM_SM_EXIT
tax
lda $830003,x ; Load door direction bit
and #$0003
beq +
%a8()
ldx.w #sm_vram>>16 ; Put SM VRAM bank in X
jsl copy_to_vram ; Call the DMA routine to copy SM template VRAM from ROM
ldx.w #sm_wram>>16 ; Put SM WRAM bank in X
jsl copy_to_wram ; Call the DMA routine to copy SM template WRAM from ROM
jmp ++
+
%a8()
ldx.w #sm_vram_right>>16 ; Put SM VRAM bank in X
jsl copy_to_vram ; Call the DMA routine to copy SM template VRAM from ROM
ldx.w #sm_wram_right>>16 ; Put SM WRAM bank in X
jsl copy_to_wram ; Call the DMA routine to copy SM template WRAM from ROM
++
%ai16()
ldx #$1ff0
txs ; Adjust stack pointer
lda #$ffff ; Set the "game flag" to SM so IRQ's/NMI runs using the
sta !SRAM_CURRENT_GAME ; correct game
jsl sm_fix_checksum ; Fix SRAM checksum (otherwise SM deletes the file on load)
lda #$0000
jsl $818085 ; Load SRAM contents back into RAM
; jsl $80858c ; Update map
; removing this call because the region is not set correctly at this point
; we will be moving it to another location
jsl $809a79 ; Redraw HUD
jsr sm_spc_load ; Load SM's music engine
lda !SRAM_SM_EXIT
sta $078d ; Store the selected door index
jsl sm_setup_door
%ai16()
lda #$000b
sta $0998 ; Set game mode to loading door
lda #$e29e
sta $099c
lda #$0001
sta.l $7fff10 ; Set this transition to not count for stats
lda #$001b ; Add transition to SM
jsl inc_stat
%a8()
lda $84
sta $4200 ; Turn NMI/IRQ/Autojoypad read back on
%ai16()
cli ; Enable interrupts and push processor status to the stack
php
lda $4210 ; Acknowledge any pending IRQ's
pea $8282
plb
plb
jml $82897a ; Put game directly into "Wait for IRQ" in the main game loop
sm_spc_reset:
pha
php
%a8()
lda #$ff ; Send N-SPC into "upload mode"
sta $2140
lda.b #sm_spc_data ; Store the location of our "exploit data"
sta $00 ; so that the ALTTP music upload routine
lda.b #sm_spc_data>>8 ; uses it.
sta $01
lda.b #sm_spc_data>>16
sta $02
jsl alttp_load_music ; Call the alttp SPC upload routine
plp
pla
rtl
sm_spc_load:
jsl $80800a ; Call the SM SPC upload routine with the parameter set to
dl $cf8000 ; the whole full music engine and samples.
rts
sm_fix_checksum:
pha
phx
phy
php
%ai16()
lda $14
pha
stz $14
ldx #$0010
-
lda.l $a16000,x
clc
adc $14
sta $14
inx
inx
cpx #$065c
bne -
ldx #$0000
lda $14
sta.l $a16000,x
sta.l $a17ff0,x
eor #$ffff
sta.l $a16008,x
sta.l $a17ff8,x
pla
sta $14
plp
ply
plx
pla
rtl
sm_save_hook:
phb : phx : phy : pha
pea $7e00
plb
plb
lda #$0001
sta.l !SRAM_SAVING
jsl sm_save_alttp_items
jsl stats_save_sram
jsl mw_save_sram
pla
jml $81800b
sm_save_done_hook:
lda #$0000
sta.l !SRAM_SAVING
ply : plx : clc : plb : plp
rtl
sm_load_hook:
phb : phx : phy
pea $7e00
plb
plb
jsl sm_copy_alttp_items
jsl stats_load_sram
jsl mw_load_sram
jml $81808f
sm_copy_alttp_items: ; Copies ALTTP items into a temporary SRAM buffer used when SM writes data to ALTTP (so that when Samus dies, alttp progress doesn't stay)
pha
phx
php
%a16()
ldx #$0000
-
lda.l !SRAM_ALTTP_START+$300,x ; copy 300-3FF from ALTTP SRAM
sta.l !SRAM_ALTTP_ITEM_BUF,X ; save to temporary buffer
inx : inx
cpx #$0100
bne -
plp
plx
pla
rtl
sm_save_alttp_items: ; Restores ALTTP items to the real SRAM
pha
phx
php
%a16()
ldx #$0000
-
lda.l !SRAM_ALTTP_ITEM_BUF,X ; save to temporary buffer
sta.l !SRAM_ALTTP_START+$300,x ; copy 300-3FF from ALTTP SRAM
inx : inx
cpx #$0100
bne -
plp
plx
pla
rtl
sm_spc_data: ; Upload this data to the SM music engine to kill it and put it back into IPL mode
dw $002a, $0b00
db $8f, $6c, $f2
db $8f, $e0, $f3 ; Disable echo buffer writes and mute amplifier
db $8f, $7c, $f2
db $8f, $ff, $f3 ; ENDX
db $8f, $7d, $f2
db $8f, $00, $f3 ; Disable echo delay
db $8f, $4d, $f2
db $8f, $00, $f3 ; EON
db $8f, $5c, $f2
db $8f, $ff, $f3 ; KOFF
db $8f, $5c, $f2
db $8f, $00, $f3 ; KOFF
db $8f, $80, $f1 ; Enable IPL ROM
db $5f, $c0, $ff ; jmp $ffc0
dw $0000, $0a00
org $c2f710
base $82f710
sm_setup_door:
php ; This runs some important routines to update the RAM with
phb ; needed values for the door transition to work at all
rep #$30
pea $8f00
plb
plb
jsr $dfc7
jsr $ddf1
jsr $de12
jsr $de6f ; ADDING this call here. it will set the region number. this is called every door transition
jsr $def2
jsr $d961
jsl $80858c ; and then we're adding in the map restoration here
plb
plp
rtl
; Game state template data (banks e0-e7 = ALTTP, e8-ef = SM)
org $e60000
sm_wram:
incbin "../data/sm-wram-lo-1.bin"
org $e70000
incbin "../data/sm-wram-lo-2.bin"
org $e80000
incbin "../data/sm-wram-hi-1.bin"
org $e90000
incbin "../data/sm-wram-hi-2.bin"
org $ea0000
sm_wram_right:
incbin "../data/sm-wram-right-lo-1.bin"
org $eb0000
incbin "../data/sm-wram-right-lo-2.bin"
org $ec0000
incbin "../data/sm-wram-right-hi-1.bin"
org $ed0000
incbin "../data/sm-wram-right-hi-2.bin"
org $ee0000
sm_vram:
incbin "../data/sm-vram-1.bin"
org $ef0000
incbin "../data/sm-vram-2.bin"
org $f00000
sm_vram_right:
incbin "../data/sm-vram-right-1.bin"
org $f10000
incbin "../data/sm-vram-right-2.bin"
| 22.464286 | 159 | 0.569687 |
e477c9ecbead9cedf22a4dc23f11479a762e770a | 263 | asm | Assembly | oeis/259/A259098.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/259/A259098.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/259/A259098.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A259098: Row sums of A146565.
; Submitted by Christian Krause
; 1,2,3,6,12,26,52,104,208,416,832,1664
lpb $0
sub $0,1
add $2,1
sub $2,$1
add $3,$2
mov $1,$3
cmp $2,6
mul $2,2
add $4,$3
bin $1,$4
mov $3,$2
mov $2,$4
lpe
mov $0,$2
add $0,1
| 13.15 | 39 | 0.558935 |
e844ac6ec7f1f24d32bf1a5d8b36a342c4e0fbc5 | 765 | asm | Assembly | data/pokemon/base_stats/squirtle.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | data/pokemon/base_stats/squirtle.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | data/pokemon/base_stats/squirtle.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | db DEX_SQUIRTLE ; pokedex id
db 44, 48, 65, 43, 50
; hp atk def spd spc
db WATER, WATER ; type
db 45 ; catch rate
db 66 ; base exp
INCBIN "gfx/pokemon/front/squirtle.pic", 0, 1 ; sprite dimensions
dw SquirtlePicFront, SquirtlePicBack
db TACKLE, TAIL_WHIP, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_SLOW ; growth rate
; tm/hm learnset
tmhm MEGA_PUNCH, MEGA_KICK, TOXIC, BODY_SLAM, TAKE_DOWN, \
DOUBLE_EDGE, BUBBLEBEAM, WATER_GUN, ICE_BEAM, BLIZZARD, \
SUBMISSION, COUNTER, SEISMIC_TOSS, RAGE, DIG, \
MIMIC, DOUBLE_TEAM, REFLECT, BIDE, SKULL_BASH, \
REST, SUBSTITUTE, SURF, STRENGTH
; end
db 0 ; padding
| 30.6 | 77 | 0.605229 |
21570279bd76a29536327206d429410f19b0f4a9 | 1,123 | asm | Assembly | Irvine/Examples/ch07/64 bit/mul_and_imul.asm | alieonsido/ASM_TESTING | 4d5e2a3e11d921eeb50d69bbe4352cfc0e99afa7 | [
"Apache-2.0"
] | null | null | null | Irvine/Examples/ch07/64 bit/mul_and_imul.asm | alieonsido/ASM_TESTING | 4d5e2a3e11d921eeb50d69bbe4352cfc0e99afa7 | [
"Apache-2.0"
] | null | null | null | Irvine/Examples/ch07/64 bit/mul_and_imul.asm | alieonsido/ASM_TESTING | 4d5e2a3e11d921eeb50d69bbe4352cfc0e99afa7 | [
"Apache-2.0"
] | null | null | null | ; Mul_and_imul.asm
; Demonstration of the MUL and IMUL instructions
; with 64-bit operands
ExitProcess proto
WriteHex64 proto
Crlf proto
.data
multiplier qword 10h
.code
main proc
sub rsp,28h
; 64-bit DIV example
.data
dividend_hi qword 00000108h
dividend_lo qword 33300020h
divisor qword 00010000h
.code
mov rdx, dividend_hi
mov rax, dividend_lo
div divisor ; RAX = 0108000000003330
; RDX = 0000000000000020
; IMUL examples
mov rax,-4
mov rbx,4
imul rbx ; RAX = -16, RDX = 0FFFFFFFFFFFFFFFF
.data
multiplicand qword -16
.code
imul rax, multiplicand, 4 ; RAX = FFFFFFFFFFFFFFC0 (-64)
; MUL examples
mov rax,0AABBBBCCCCDDDDh
mul multiplier ; RDX:RAX = 00AABBBBCCCCDDDD0
call Display ; optional
mov rax,0FFFF0000FFFF0000h
mov rbx,2
mul rbx ; RDX:RAX = 1FFFE0001FFFE0000
call Display ; optional
mov ecx,0 ; assign a process return code
call ExitProcess ; terminate the program
main endp
Display proc
; displays RDX:RAX in hexadecimal
push rax
mov rax,rdx
call WriteHex64
pop rax
call WriteHex64
call Crlf
ret
Display endp
end
| 17.276923 | 60 | 0.721282 |
4ae759c1f49f11b8925a0b8d6f87b61fbb5d79ce | 16,558 | asm | Assembly | _inc/AnimateLevelGfx.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 9 | 2021-01-15T13:47:53.000Z | 2022-01-17T15:33:55.000Z | _inc/AnimateLevelGfx.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 7 | 2021-01-14T02:18:48.000Z | 2021-03-24T15:44:30.000Z | _inc/AnimateLevelGfx.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 2 | 2021-01-14T13:14:26.000Z | 2021-01-29T17:46:04.000Z | ; ---------------------------------------------------------------------------
; Subroutine to animate level graphics
; ---------------------------------------------------------------------------
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
AnimateLevelGfx:
tst.w (f_pause).w ; is the game paused?
bne.s @ispaused ; if yes, branch
lea (vdp_data_port).l,a6
bsr.w AniArt_GiantRing
moveq #0,d0
move.b (v_zone).w,d0
add.w d0,d0
move.w AniArt_Index(pc,d0.w),d0
jmp AniArt_Index(pc,d0.w)
@ispaused:
rts
; ===========================================================================
AniArt_Index: dc.w AniArt_GHZ-AniArt_Index, AniArt_none-AniArt_Index
dc.w AniArt_MZ-AniArt_Index, AniArt_none-AniArt_Index
dc.w AniArt_none-AniArt_Index, AniArt_SBZ-AniArt_Index
zonewarning AniArt_Index,2
dc.w AniArt_Ending-AniArt_Index
; ===========================================================================
; ---------------------------------------------------------------------------
; Animated pattern routine - Green Hill
; ---------------------------------------------------------------------------
AniArt_GHZ:
AniArt_GHZ_Waterfall:
@size: equ 8 ; number of tiles per frame
subq.b #1,(v_lani0_time).w ; decrement timer
bpl.s AniArt_GHZ_Bigflower ; branch if not 0
move.b #5,(v_lani0_time).w ; time to display each frame
lea (Art_GhzWater).l,a1 ; load waterfall patterns
move.b (v_lani0_frame).w,d0
addq.b #1,(v_lani0_frame).w ; increment frame counter
andi.w #1,d0 ; there are only 2 frames
beq.s @isframe0 ; branch if frame 0
lea @size*$20(a1),a1 ; use graphics for frame 1
@isframe0:
locVRAM $6F00 ; VRAM address
move.w #@size-1,d1 ; number of 8x8 tiles
bra.w LoadTiles
; ===========================================================================
AniArt_GHZ_Bigflower:
@size: equ 16 ; number of tiles per frame
subq.b #1,(v_lani1_time).w
bpl.s AniArt_GHZ_Smallflower
move.b #$F,(v_lani1_time).w
lea (Art_GhzFlower1).l,a1 ; load big flower patterns
move.b (v_lani1_frame).w,d0
addq.b #1,(v_lani1_frame).w
andi.w #1,d0
beq.s @isframe0
lea @size*$20(a1),a1
@isframe0:
locVRAM $6B80
move.w #@size-1,d1
bra.w LoadTiles
; ===========================================================================
AniArt_GHZ_Smallflower:
@size: equ 12 ; number of tiles per frame
subq.b #1,(v_lani2_time).w
bpl.s @end
move.b #7,(v_lani2_time).w
move.b (v_lani2_frame).w,d0
addq.b #1,(v_lani2_frame).w ; increment frame counter
andi.w #3,d0 ; there are 4 frames
move.b @sequence(pc,d0.w),d0
btst #0,d0 ; is frame 0 or 2? (actual frame, not frame counter)
bne.s @isframe1 ; if not, branch
move.b #$7F,(v_lani2_time).w ; set longer duration for frames 0 and 2
@isframe1:
lsl.w #7,d0 ; multiply frame num by $80
move.w d0,d1
add.w d0,d0
add.w d1,d0 ; multiply that by 3 (i.e. frame num times 12 * $20)
locVRAM $6D80
lea (Art_GhzFlower2).l,a1 ; load small flower patterns
lea (a1,d0.w),a1 ; jump to appropriate tile
move.w #@size-1,d1
bsr.w LoadTiles
@end:
rts
@sequence: dc.b 0, 1, 2, 1
; ===========================================================================
; ---------------------------------------------------------------------------
; Animated pattern routine - Marble
; ---------------------------------------------------------------------------
AniArt_MZ:
AniArt_MZ_Lava:
@size: equ 8 ; number of tiles per frame
subq.b #1,(v_lani0_time).w ; decrement timer
bpl.s AniArt_MZ_Magma ; branch if not 0
move.b #$13,(v_lani0_time).w ; time to display each frame
lea (Art_MzLava1).l,a1 ; load lava surface patterns
moveq #0,d0
move.b (v_lani0_frame).w,d0
addq.b #1,d0 ; increment frame counter
cmpi.b #3,d0 ; there are 3 frames
bne.s @frame01or2 ; branch if frame 0, 1 or 2
moveq #0,d0
@frame01or2:
move.b d0,(v_lani0_frame).w
mulu.w #@size*$20,d0
adda.w d0,a1 ; jump to appropriate tile
locVRAM $5C40
move.w #@size-1,d1
bsr.w LoadTiles
AniArt_MZ_Magma:
subq.b #1,(v_lani1_time).w ; decrement timer
bpl.s AniArt_MZ_Torch ; branch if not 0
move.b #1,(v_lani1_time).w ; time between each gfx change
moveq #0,d0
move.b (v_lani0_frame).w,d0 ; get surface lava frame number
lea (Art_MzLava2).l,a4 ; load magma gfx
ror.w #7,d0 ; multiply frame num by $200
adda.w d0,a4 ; jump to appropriate tile
locVRAM $5A40
moveq #0,d3
move.b (v_lani1_frame).w,d3
addq.b #1,(v_lani1_frame).w ; increment frame counter (unused)
move.b (v_oscillate+$A).w,d3 ; get oscillating value
move.w #3,d2
@loop:
move.w d3,d0
add.w d0,d0
andi.w #$1E,d0
lea (AniArt_MZextra).l,a3
move.w (a3,d0.w),d0
lea (a3,d0.w),a3
movea.l a4,a1
move.w #$1F,d1
jsr (a3)
addq.w #4,d3
dbf d2,@loop
rts
; ===========================================================================
AniArt_MZ_Torch:
@size: equ 6 ; number of tiles per frame
subq.b #1,(v_lani2_time).w ; decrement timer
bpl.w @end ; branch if not 0
move.b #7,(v_lani2_time).w ; time to display each frame
lea (Art_MzTorch).l,a1 ; load torch patterns
moveq #0,d0
move.b (v_lani3_frame).w,d0
addq.b #1,(v_lani3_frame).w ; increment frame counter
andi.b #3,(v_lani3_frame).w ; there are 3 frames
mulu.w #@size*$20,d0
adda.w d0,a1 ; jump to appropriate tile
locVRAM $5E40
move.w #@size-1,d1
bra.w LoadTiles
@end:
rts
; ===========================================================================
; ---------------------------------------------------------------------------
; Animated pattern routine - Scrap Brain
; ---------------------------------------------------------------------------
AniArt_SBZ:
@size: equ 12 ; number of tiles per frame
tst.b (v_lani2_frame).w
beq.s @smokepuff ; branch if counter hits 0
subq.b #1,(v_lani2_frame).w ; decrement counter
bra.s @chk_smokepuff2
; ===========================================================================
@smokepuff:
subq.b #1,(v_lani0_time).w ; decrement timer
bpl.s @chk_smokepuff2 ; branch if not 0
move.b #7,(v_lani0_time).w ; time to display each frame
lea (Art_SbzSmoke).l,a1 ; load smoke patterns
locVRAM $8900
move.b (v_lani0_frame).w,d0
addq.b #1,(v_lani0_frame).w ; increment frame counter
andi.w #7,d0
beq.s @untilnextpuff ; branch if frame 0
subq.w #1,d0
mulu.w #@size*$20,d0
lea (a1,d0.w),a1
move.w #@size-1,d1
bra.w LoadTiles
; ===========================================================================
@untilnextpuff:
move.b #180,(v_lani2_frame).w ; time between smoke puffs (3 seconds)
@clearsky:
move.w #(@size/2)-1,d1
bsr.w LoadTiles
lea (Art_SbzSmoke).l,a1
move.w #(@size/2)-1,d1
bra.w LoadTiles ; load blank tiles for no smoke puff
; ===========================================================================
@chk_smokepuff2:
tst.b (v_lani2_time).w
beq.s @smokepuff2 ; branch if counter hits 0
subq.b #1,(v_lani2_time).w ; decrement counter
bra.s @end
; ===========================================================================
@smokepuff2:
subq.b #1,(v_lani1_time).w ; decrement timer
bpl.s @end ; branch if not 0
move.b #7,(v_lani1_time).w ; time to display each frame
lea (Art_SbzSmoke).l,a1 ; load smoke patterns
locVRAM $8A80
move.b (v_lani1_frame).w,d0
addq.b #1,(v_lani1_frame).w ; increment frame counter
andi.w #7,d0
beq.s @untilnextpuff2 ; branch if frame 0
subq.w #1,d0
mulu.w #@size*$20,d0
lea (a1,d0.w),a1
move.w #@size-1,d1
bra.w LoadTiles
; ===========================================================================
@untilnextpuff2:
move.b #120,(v_lani2_time).w ; time between smoke puffs (2 seconds)
bra.s @clearsky
; ===========================================================================
@end:
rts
; ===========================================================================
; ---------------------------------------------------------------------------
; Animated pattern routine - ending sequence
; ---------------------------------------------------------------------------
AniArt_Ending:
AniArt_Ending_BigFlower:
@size: equ 16 ; number of tiles per frame
subq.b #1,(v_lani1_time).w ; decrement timer
bpl.s AniArt_Ending_SmallFlower ; branch if not 0
move.b #7,(v_lani1_time).w
lea (Art_GhzFlower1).l,a1 ; load big flower patterns
lea ($FFFF9400).w,a2 ; load 2nd big flower from RAM
move.b (v_lani1_frame).w,d0
addq.b #1,(v_lani1_frame).w ; increment frame counter
andi.w #1,d0 ; only 2 frames
beq.s @isframe0 ; branch if frame 0
lea @size*$20(a1),a1
lea @size*$20(a2),a2
@isframe0:
locVRAM $6B80
move.w #@size-1,d1
bsr.w LoadTiles
movea.l a2,a1
locVRAM $7200
move.w #@size-1,d1
bra.w LoadTiles
; ===========================================================================
AniArt_Ending_SmallFlower:
@size: equ 12 ; number of tiles per frame
subq.b #1,(v_lani2_time).w ; decrement timer
bpl.s AniArt_Ending_Flower3 ; branch if not 0
move.b #7,(v_lani2_time).w
move.b (v_lani2_frame).w,d0
addq.b #1,(v_lani2_frame).w ; increment frame counter
andi.w #7,d0 ; max 8 frames
move.b @sequence(pc,d0.w),d0 ; get actual frame num from sequence data
lsl.w #7,d0 ; multiply by $80
move.w d0,d1
add.w d0,d0
add.w d1,d0 ; multiply by 3
locVRAM $6D80
lea (Art_GhzFlower2).l,a1 ; load small flower patterns
lea (a1,d0.w),a1 ; jump to appropriate tile
move.w #@size-1,d1
bra.w LoadTiles
; ===========================================================================
@sequence: dc.b 0, 0, 0, 1, 2, 2, 2, 1
; ===========================================================================
AniArt_Ending_Flower3:
@size: equ 16 ; number of tiles per frame
subq.b #1,(v_lani4_time).w ; decrement timer
bpl.s AniArt_Ending_Flower4 ; branch if not 0
move.b #$E,(v_lani4_time).w
move.b (v_lani4_frame).w,d0
addq.b #1,(v_lani4_frame).w ; increment frame counter
andi.w #3,d0 ; max 4 frames
move.b AniArt_Ending_Flower3_sequence(pc,d0.w),d0 ; get actual frame num from sequence data
lsl.w #8,d0 ; multiply by $100
add.w d0,d0 ; multiply by 2
locVRAM $7000
lea ($FFFF9800).w,a1 ; load special flower patterns (from RAM)
lea (a1,d0.w),a1 ; jump to appropriate tile
move.w #@size-1,d1
bra.w LoadTiles
; ===========================================================================
AniArt_Ending_Flower3_sequence: dc.b 0, 1, 2, 1
; ===========================================================================
AniArt_Ending_Flower4:
@size: equ 16 ; number of tiles per frame
subq.b #1,(v_lani5_time).w ; decrement timer
bpl.s @end ; branch if not 0
move.b #$B,(v_lani5_time).w
move.b (v_lani5_frame).w,d0
addq.b #1,(v_lani5_frame).w ; increment frame counter
andi.w #3,d0
move.b AniArt_Ending_Flower3_sequence(pc,d0.w),d0 ; get actual frame num from sequence data
lsl.w #8,d0 ; multiply by $100
add.w d0,d0 ; multiply by 2
locVRAM $6800
lea ($FFFF9E00).w,a1 ; load special flower patterns (from RAM)
lea (a1,d0.w),a1 ; jump to appropriate tile
move.w #@size-1,d1
bra.w LoadTiles
; ===========================================================================
@end:
rts
; ===========================================================================
AniArt_none:
rts
; ---------------------------------------------------------------------------
; Subroutine to transfer graphics to VRAM
; input:
; a1 = source address
; a6 = vdp_data_port ($C00000)
; d1 = number of tiles to load (minus one)
; ---------------------------------------------------------------------------
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
LoadTiles:
move.l (a1)+,(a6)
move.l (a1)+,(a6)
move.l (a1)+,(a6)
move.l (a1)+,(a6)
move.l (a1)+,(a6)
move.l (a1)+,(a6)
move.l (a1)+,(a6)
move.l (a1)+,(a6)
dbf d1,LoadTiles
rts
; End of function LoadTiles
; ===========================================================================
; ---------------------------------------------------------------------------
; Animated pattern routine - more Marble Zone
; ---------------------------------------------------------------------------
AniArt_MZextra: dc.w loc_1C3EE-AniArt_MZextra, loc_1C3FA-AniArt_MZextra
dc.w loc_1C410-AniArt_MZextra, loc_1C41E-AniArt_MZextra
dc.w loc_1C434-AniArt_MZextra, loc_1C442-AniArt_MZextra
dc.w loc_1C458-AniArt_MZextra, loc_1C466-AniArt_MZextra
dc.w loc_1C47C-AniArt_MZextra, loc_1C48A-AniArt_MZextra
dc.w loc_1C4A0-AniArt_MZextra, loc_1C4AE-AniArt_MZextra
dc.w loc_1C4C4-AniArt_MZextra, loc_1C4D2-AniArt_MZextra
dc.w loc_1C4E8-AniArt_MZextra, loc_1C4FA-AniArt_MZextra
; ===========================================================================
loc_1C3EE:
move.l (a1),(a6)
lea $10(a1),a1
dbf d1,loc_1C3EE
rts
; ===========================================================================
loc_1C3FA:
move.l 2(a1),d0
move.b 1(a1),d0
ror.l #8,d0
move.l d0,(a6)
lea $10(a1),a1
dbf d1,loc_1C3FA
rts
; ===========================================================================
loc_1C410:
move.l 2(a1),(a6)
lea $10(a1),a1
dbf d1,loc_1C410
rts
; ===========================================================================
loc_1C41E:
move.l 4(a1),d0
move.b 3(a1),d0
ror.l #8,d0
move.l d0,(a6)
lea $10(a1),a1
dbf d1,loc_1C41E
rts
; ===========================================================================
loc_1C434:
move.l 4(a1),(a6)
lea $10(a1),a1
dbf d1,loc_1C434
rts
; ===========================================================================
loc_1C442:
move.l 6(a1),d0
move.b 5(a1),d0
ror.l #8,d0
move.l d0,(a6)
lea $10(a1),a1
dbf d1,loc_1C442
rts
; ===========================================================================
loc_1C458:
move.l 6(a1),(a6)
lea $10(a1),a1
dbf d1,loc_1C458
rts
; ===========================================================================
loc_1C466:
move.l 8(a1),d0
move.b 7(a1),d0
ror.l #8,d0
move.l d0,(a6)
lea $10(a1),a1
dbf d1,loc_1C466
rts
; ===========================================================================
loc_1C47C:
move.l 8(a1),(a6)
lea $10(a1),a1
dbf d1,loc_1C47C
rts
; ===========================================================================
loc_1C48A:
move.l $A(a1),d0
move.b 9(a1),d0
ror.l #8,d0
move.l d0,(a6)
lea $10(a1),a1
dbf d1,loc_1C48A
rts
; ===========================================================================
loc_1C4A0:
move.l $A(a1),(a6)
lea $10(a1),a1
dbf d1,loc_1C4A0
rts
; ===========================================================================
loc_1C4AE:
move.l $C(a1),d0
move.b $B(a1),d0
ror.l #8,d0
move.l d0,(a6)
lea $10(a1),a1
dbf d1,loc_1C4AE
rts
; ===========================================================================
loc_1C4C4:
move.l $C(a1),(a6)
lea $10(a1),a1
dbf d1,loc_1C4C4
rts
; ===========================================================================
loc_1C4D2:
move.l $C(a1),d0
rol.l #8,d0
move.b 0(a1),d0
move.l d0,(a6)
lea $10(a1),a1
dbf d1,loc_1C4D2
rts
; ===========================================================================
loc_1C4E8:
move.w $E(a1),(a6)
move.w 0(a1),(a6)
lea $10(a1),a1
dbf d1,loc_1C4E8
rts
; ===========================================================================
loc_1C4FA:
move.l 0(a1),d0
move.b $F(a1),d0
ror.l #8,d0
move.l d0,(a6)
lea $10(a1),a1
dbf d1,loc_1C4FA
rts
; ---------------------------------------------------------------------------
; Animated pattern routine - giant ring
; ---------------------------------------------------------------------------
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
AniArt_GiantRing:
@size: equ 14
tst.w (v_gfxbigring).w ; Is there any of the art left to load?
bne.s @loadTiles ; If so, get to work
rts
; ===========================================================================
; loc_1C518:
@loadTiles:
subi.w #@size*$20,(v_gfxbigring).w ; Count-down the 14 tiles we're going to load now
lea (Art_BigRing).l,a1 ; load giant ring patterns
moveq #0,d0
move.w (v_gfxbigring).w,d0
lea (a1,d0.w),a1
; Turn VRAM address into VDP command
addi.w #$8000,d0
lsl.l #2,d0
lsr.w #2,d0
ori.w #$4000,d0
swap d0
; Send VDP command (write to VRAM at address contained in v_gfxbigring)
move.l d0,4(a6)
move.w #@size-1,d1
bra.w LoadTiles
; End of function AniArt_GiantRing
| 28.064407 | 93 | 0.494202 |
47fa257db31a4067ee71bc1d91469a90989ebb3d | 293 | asm | Assembly | programs/oeis/131/A131870.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/131/A131870.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/131/A131870.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A131870: Period 8: repeat [1, 2, 3, 4, 6, 7, 8, 9].
; 1,2,3,4,6,7,8,9,1,2,3,4,6,7,8,9,1,2,3,4,6,7,8,9,1,2,3,4,6,7,8,9,1,2,3,4,6,7,8,9,1,2,3,4,6,7,8,9,1,2,3,4,6,7,8,9,1,2,3,4,6,7,8,9,1,2,3,4,6,7,8,9,1,2,3,4,6,7,8,9,1,2,3,4,6,7,8,9,1,2,3,4,6,7,8,9,1,2,3,4
mod $0,8
mul $0,5
div $0,4
add $0,1
| 36.625 | 201 | 0.505119 |
af6186ba33ef60b9b92024b5194814e966630ed0 | 1,745 | asm | Assembly | kernel/mm/heap.asm | leonardoruilova/xos | 1e72d2294a7373dbbd601e6796a8a95d0d7056a8 | [
"MIT"
] | 1 | 2021-03-21T19:49:05.000Z | 2021-03-21T19:49:05.000Z | kernel/mm/heap.asm | leonardoruilova/xos | 1e72d2294a7373dbbd601e6796a8a95d0d7056a8 | [
"MIT"
] | null | null | null | kernel/mm/heap.asm | leonardoruilova/xos | 1e72d2294a7373dbbd601e6796a8a95d0d7056a8 | [
"MIT"
] | null | null | null |
;; xOS32
;; Copyright (C) 2016-2017 by Omar Mohammad.
use32
KERNEL_HEAP = VBE_BACK_BUFFER + VBE_BUFFER_SIZE + 0x1000000
USER_HEAP = KERNEL_HEAP + 0x4000000 ; 64 MB
KMALLOC_FLAGS = PAGE_PRESENT OR PAGE_WRITEABLE
MALLOC_FLAGS = PAGE_PRESENT OR PAGE_WRITEABLE OR PAGE_USER
; kmalloc:
; Allocates memory in the kernel's heap
; In\ ECX = Bytes to allocate
; Out\ EAX = SSE-aligned pointer to allocated memory
; Note:
; kmalloc() NEVER returns NULL, because it never fails.
; When kmalloc() fails, it fires up a kernel panic.
kmalloc:
add ecx, 16 ; force sse-alignment
add ecx, 4095
shr ecx, 12 ; to pages
mov [.pages], ecx
mov eax, KERNEL_HEAP
mov ecx, [.pages]
call vmm_alloc_pages
cmp eax, USER_HEAP
jge .no
mov eax, KERNEL_HEAP
mov ecx, [.pages]
mov dl, KMALLOC_FLAGS
call vmm_alloc
cmp eax, 0
je .no
mov [.return], eax
mov edi, [.return]
mov eax, [.pages]
stosd
mov eax, [.return]
add eax, 16
ret
.no:
mov eax, 0
ret
.pages dd 0
.return dd 0
; kfree:
; Frees kernel memory
; In\ EAX = Pointer to memory
; Out\ Nothing
kfree:
mov ecx, [eax-16]
;sub ecx, 16
call vmm_free
ret
; malloc:
; Allocates user heap memory
; In\ ECX = Bytes to allocate
; Out\ EAX = SSE-aligned pointer, 0 on error
malloc:
add ecx, 16 ; force sse-alignment
add ecx, 4095
shr ecx, 12 ; to pages
mov [.pages], ecx
mov eax, USER_HEAP
mov ecx, [.pages]
mov dl, MALLOC_FLAGS
call vmm_alloc
cmp eax, 0
je .no
mov [.return], eax
mov edi, [.return]
mov eax, [.pages]
stosd
mov eax, [.return]
add eax, 16
ret
.no:
mov eax, 0
ret
.pages dd 0
.return dd 0
; free:
; Frees user memory
; In\ EAX = Pointer to memory
; Out\ Nothing
free:
mov ecx, [eax-16]
;sub ecx, 16
call vmm_free
ret
| 14.91453 | 61 | 0.675645 |
c4dcc61debc0f7d124768253be64c323819493da | 6,064 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0x84_notsx.log_21829_655.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0x84_notsx.log_21829_655.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0x84_notsx.log_21829_655.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r8
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x17a51, %rbx
and %r9, %r9
movl $0x61626364, (%rbx)
nop
nop
nop
inc %r13
lea addresses_normal_ht+0x18e19, %rbx
nop
nop
nop
and $59587, %r13
mov $0x6162636465666768, %rsi
movq %rsi, (%rbx)
nop
nop
mfence
lea addresses_WT_ht+0x11a51, %rsi
lea addresses_normal_ht+0x18a71, %rdi
nop
nop
nop
nop
nop
sub %rax, %rax
mov $107, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_normal_ht+0xc61, %r9
nop
nop
xor $8901, %rdi
movb $0x61, (%r9)
nop
add %rbx, %rbx
lea addresses_A_ht+0x1a8f1, %rsi
lea addresses_UC_ht+0x197e9, %rdi
nop
nop
dec %r13
mov $20, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %r13
lea addresses_WC_ht+0x17251, %rdi
nop
nop
nop
cmp %r13, %r13
mov (%rdi), %ebx
nop
nop
cmp %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %rax
push %rbp
push %rbx
push %rdi
push %rsi
// Store
lea addresses_WC+0x301, %r13
xor %rbx, %rbx
movw $0x5152, (%r13)
nop
nop
nop
dec %rbp
// Load
lea addresses_UC+0x12851, %rdi
nop
nop
nop
xor %r12, %r12
mov (%rdi), %eax
nop
add %rax, %rax
// Store
lea addresses_A+0x16e51, %rdi
nop
nop
nop
nop
cmp $11511, %r13
movl $0x51525354, (%rdi)
cmp $21209, %rbx
// Faulty Load
mov $0x6337e10000000251, %rsi
nop
xor $15693, %r13
mov (%rsi), %bx
lea oracles, %rdi
and $0xff, %rbx
shlq $12, %rbx
mov (%rdi,%rbx,1), %rbx
pop %rsi
pop %rdi
pop %rbx
pop %rbp
pop %rax
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC', 'same': False, 'size': 4, 'congruent': 9, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'same': True, 'size': 2, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': True}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 38.138365 | 2,999 | 0.656662 |
a0b79ff0b80f9952573ac14c0d63a46aaeafcedb | 616 | asm | Assembly | test/e2e/data/arm6.asm | matanlurey/armv4t.dart | 06235938d16cb1f2b09d26f564b985854e4155c0 | [
"MIT"
] | 8 | 2020-06-21T22:05:00.000Z | 2021-10-06T19:59:20.000Z | test/e2e/data/arm6.asm | matanlurey/armv4t.dart | 06235938d16cb1f2b09d26f564b985854e4155c0 | [
"MIT"
] | 82 | 2020-06-21T22:02:00.000Z | 2020-08-04T01:48:42.000Z | test/e2e/data/arm6.asm | matanlurey/armv4t.dart | 06235938d16cb1f2b09d26f564b985854e4155c0 | [
"MIT"
] | 1 | 2020-06-22T15:16:02.000Z | 2020-06-22T15:16:02.000Z | ; expected result: 0x1f4 = 0xa, 0x1f8 = 0xc, 0x1fc = 0x10, 0x200 = 6, 0x204 = 0x200
main:
mov r13, #0x200 ; r13 = 0x200
mov r1, #10 ; r1 = 0x10
mov r2, #12 ; r2 = 0x12
BL test_func ; pc = <@test_func>
stmia R13, {R0, R13}
B exit
test_func:
stmfd R13!, {R1, R2, R14} ; @0x1f4 = 0xa
; @0x1f8 = 0xc
; 0x1fc = 0x10
; r13 = 0x200 (?)
EOR R0, R1, R2
ldmfd R13!, {R1, R2, R15}
exit:
| 29.333333 | 83 | 0.371753 |
0cc4795a2abfe921a99af2cdc3b3f8db32caf7c9 | 106 | asm | Assembly | sw/552tests/inst_tests/slbi_1.asm | JPShen-UWM/ThreadKraken | 849c510531f28e36d3469535737b2120bd774935 | [
"MIT"
] | 1 | 2022-02-15T16:03:25.000Z | 2022-02-15T16:03:25.000Z | sw/552tests/inst_tests/slbi_1.asm | JPShen-UWM/ThreadKraken | 849c510531f28e36d3469535737b2120bd774935 | [
"MIT"
] | null | null | null | sw/552tests/inst_tests/slbi_1.asm | JPShen-UWM/ThreadKraken | 849c510531f28e36d3469535737b2120bd774935 | [
"MIT"
] | null | null | null | // Test provided by Karu
//test for SLBI instruction
//case: when Rs is zero
lbi r2, 0
slbi r2, 255
halt
| 15.142857 | 27 | 0.707547 |
dbfa66ee6dd904f6e64abe93e6742851eaa0c7b4 | 437 | asm | Assembly | oeis/200/A200649.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/200/A200649.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/200/A200649.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A200649: Number of 1's in the Stolarsky representation of n.
; Submitted by Christian Krause
; 0,1,2,1,3,2,2,4,1,3,3,3,5,2,2,4,2,4,4,4,6,1,3,3,3,5,3,3,5,3,5,5,5,7,2,2,4,2,4,4,4,6,2,4,4,4,6,4,4,6,4,6,6,6,8,1,3,3,3,5,3,3,5,3,5,5,5,7,3,3,5,3
seq $0,307096 ; Positive integers m such that for any positive integer k the last k bits of the binary expansion of m is not a multiple of 3.
mov $2,$0
lpb $0
div $2,2
sub $0,$2
lpe
sub $0,1
| 36.416667 | 145 | 0.645309 |
3e6601a6bbf4c1124813ca933d479ed162f15155 | 505 | asm | Assembly | oeis/344/A344496.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/344/A344496.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/344/A344496.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A344496: a(0)=0; for n > 0, a(n) = a(n-1)*n + n if n is odd, (a(n-1) + n)*n otherwise.
; Submitted by Christian Krause
; 0,1,6,21,100,505,3066,21469,171816,1546353,15463630,170099941,2041199436,26535592681,371498297730,5572474465965,89159591455696,1515713054746849,27282834985443606,518373864723428533,10367477294468571060,217717023183839992281,4789774510044479830666
mov $3,$0
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
sub $0,$3
add $2,1
add $4,$2
mod $2,2
mul $2,$0
mul $4,$0
lpe
mov $0,$4
| 28.055556 | 248 | 0.70495 |
336843426ef730fe90defb0f6957cc8ca232b7a0 | 648 | asm | Assembly | programs/oeis/255/A255876.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/255/A255876.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/255/A255876.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A255876: a(n) = (4*n^2 + 4*n - 3 - 3*(-1)^n)/2.
; 4,9,24,37,60,81,112,141,180,217,264,309,364,417,480,541,612,681,760,837,924,1009,1104,1197,1300,1401,1512,1621,1740,1857,1984,2109,2244,2377,2520,2661,2812,2961,3120,3277,3444,3609,3784,3957,4140,4321,4512,4701,4900,5097,5304,5509,5724,5937,6160,6381,6612,6841,7080,7317,7564,7809,8064,8317,8580,8841,9112,9381,9660,9937,10224,10509,10804,11097,11400,11701,12012,12321,12640,12957,13284,13609,13944,14277,14620,14961,15312,15661,16020,16377,16744,17109,17484,17857,18240,18621,19012,19401,19800,20197
add $0,1
mov $1,$0
add $0,1
pow $1,2
add $0,$1
gcd $1,2
sub $0,$1
mul $0,2
add $0,1
sub $0,$1
| 46.285714 | 502 | 0.725309 |
75a6c9e2d33539ae94e775a8b08184c1d818565b | 436 | asm | Assembly | programs/oeis/008/A008672.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/008/A008672.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/008/A008672.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A008672: Expansion of 1/((1-x)*(1-x^3)*(1-x^5)).
; 1,1,1,2,2,3,4,4,5,6,7,8,9,10,11,13,14,15,17,18,20,22,23,25,27,29,31,33,35,37,40,42,44,47,49,52,55,57,60,63,66,69,72,75,78,82,85,88,92,95,99,103,106,110,114,118,122,126,130,134,139,143,147,152,156,161,166,170,175,180,185,190,195,200,205,211,216,221,227,232,238,244,249,255,261,267,273,279,285,291,298,304,310,317,323,330,337,343,350,357
add $0,5
bin $0,2
sub $0,8
div $0,15
add $0,1
| 48.444444 | 337 | 0.662844 |
ecadeb81ec64df1313e2e9bf0788d93551bbfef0 | 483 | a51 | Assembly | a51test/(C8)XCH_A_Rn.a51 | Aimini/51cpu | cdeb75510d1dcd867fbebe10e963c4dbecd5ff13 | [
"MIT"
] | null | null | null | a51test/(C8)XCH_A_Rn.a51 | Aimini/51cpu | cdeb75510d1dcd867fbebe10e963c4dbecd5ff13 | [
"MIT"
] | null | null | null | a51test/(C8)XCH_A_Rn.a51 | Aimini/51cpu | cdeb75510d1dcd867fbebe10e963c4dbecd5ff13 | [
"MIT"
] | null | null | null | MOV 0xF0,#0x20
INIT:
MOV 0x00,A ; use R0 to r/w indirect address
MOV @R0,A
INC A
DJNZ 0xF0,INIT
MOV 0x00,#0x00
MOV A,#0xFF
MOV 0xD0,#0x00
XCH A,R0
XCH A,R1
XCH A,R2
XCH A,R3
XCH A,R4
XCH A,R5
XCH A,R6
XCH A,R7
MOV 0xD0,#0x08
XCH A,R0
XCH A,R1
XCH A,R2
XCH A,R3
XCH A,R4
XCH A,R5
XCH A,R6
XCH A,R7
MOV 0xD0,#0x10
XCH A,R0
XCH A,R1
XCH A,R2
XCH A,R3
XCH A,R4
XCH A,R5
XCH A,R6
XCH A,R7
MOV 0xD0,#0x18
XCH A,R0
XCH A,R1
XCH A,R2
XCH A,R3
XCH A,R4
XCH A,R5
XCH A,R6
XCH A,R7 | 9.857143 | 45 | 0.670807 |
eccf14deca44ffeac305e56a9c09af6d7a4fe738 | 491 | asm | Assembly | src/impl/x86_64/boot/header.asm | Kevnnm/tailoredOS | 5a671501b12c7f2d5dacbc4cb0a6f28e1d443986 | [
"MIT"
] | null | null | null | src/impl/x86_64/boot/header.asm | Kevnnm/tailoredOS | 5a671501b12c7f2d5dacbc4cb0a6f28e1d443986 | [
"MIT"
] | null | null | null | src/impl/x86_64/boot/header.asm | Kevnnm/tailoredOS | 5a671501b12c7f2d5dacbc4cb0a6f28e1d443986 | [
"MIT"
] | null | null | null | ;; Made following multiboot2 specs at:
;; `https://www.gnu.org/software/grub/manual/multiboot2/multiboot.html`
section .multiboot_header
align 64
header_start:
dd 0xE85250D6 ; Multiboot2 magic value
dd 0x00000000 ; Architecture (protected mode i386)
dd header_end - header_start ; header length
;; checksum
dd 0x100000000 - (0xE85250D6 + 0x00000000 + (header_end - header_start))
;; End tag
dw 0x0
dw 0x0
dd 0x8
header_end:
| 27.277778 | 76 | 0.672098 |
d5d873edc298eaad92b5399b4d940b8ddb205e56 | 3,231 | asm | Assembly | 2-math_ISA_9S12/src/convertionBCD-BIN/convertionBCD-BIN.asm | brown9804/Dragon12_MC9S12DP256 | 24a990017703636177d800410681dd63fc34da23 | [
"Apache-2.0"
] | null | null | null | 2-math_ISA_9S12/src/convertionBCD-BIN/convertionBCD-BIN.asm | brown9804/Dragon12_MC9S12DP256 | 24a990017703636177d800410681dd63fc34da23 | [
"Apache-2.0"
] | null | null | null | 2-math_ISA_9S12/src/convertionBCD-BIN/convertionBCD-BIN.asm | brown9804/Dragon12_MC9S12DP256 | 24a990017703636177d800410681dd63fc34da23 | [
"Apache-2.0"
] | null | null | null | ; Autor:
; Brown Ramírez, Belinda
; timna.brown@ucr.ac.cr
; Jan, 2021
; 2 routines
;BIN-BCD: 12 bits binary using XS3 algorithm, binary number is in D
;and results goes to NUM_BCD from $1010 mem position
;BCD-BIN: Multiplication of decades and addition algorithm,
;BCD >= 9999 binary number is in D. Results are saved NUM_BIN
;from $1020.
; ----
; BIN value $1000-$1001
; BCD value $1002-$1003
; FYI -> program started in $2000
; 1. BIN to D accumulador.
; 2. BIN - BCD
; 3. BCD to D accumulador.
; 4. BCD - BIN
;##-------------------------------- DEFINITIONS ------------------------------------
BIN: EQU $1000
BCD: EQU $1002
NUM_BCD: EQU $1010 ; BIN-BCD results from this position
NUM_BIN: EQU $1020 ; BCD-BIN results from this position
ORG $1000 ; Flash ROM address for Dragon12+
DW #5 ; send value
ORG $1002 ; Flash ROM address for Dragon12+
DW #8 ; send value
;##-------------------------------- SPACE storage ------------------------------------
ORG $1100 ; Flash ROM address for Dragon12+
tail_val: DS 2
B_val: DS 2
;##-------------------------------- MAIN ------------------------------------
_init:
ORG $2000
LDY #0
LDD BIN
JMP _BIN_BCD
BCDtoBIN:
LDY #0
LDX #0
LDD BCD
JMP _BCD_BIN
FINAL_END:
JMP FINAL_END
;##-------------------------------- DEF BIN-BCD ------------------------------------
;# STEPS:
;# 1. Find the decimal equivalent of the given binary number.
;# 2. Add +3 to each digit of decimal number.
;# 4. Convert the newly obtained decimal number back to binary
;# number to get required excess-3 equivalent.
_BIN_BCD:
LDX #15
CLR NUM_BCD
CLR NUM_BCD+1
LDY NUM_BCD
COMP4Bytes:
ASLD ; shift double
ROL NUM_BCD+1
ROL NUM_BCD
STD tail_val
LDD NUM_BCD+1
ANDB #$0F
CMPB #5
BLO COMP_B
ADDB #3
COMP_B:
STAB B_val
LDAB NUM_BCD+1
CLRA
ANDB #$F0
CMPB #$50
BLO COMP_C
ADDD #$30 ; if B is $50
COMP_C:
ADDB B_val
ADCA #0
STAB NUM_BCD+1
ADDA NUM_BCD
STAA NUM_BCD
LDAB NUM_BCD
ANDB #$0F
CMPB #5
BLO storeNUM_BCD
ADDB #3
CLRA
storeNUM_BCD:
STAB B_val
LDAB NUM_BCD
ANDB #$F0
ADDB B_val
STAB NUM_BCD
LDD tail_val
DEX
BEQ X_0_value
JMP COMP4Bytes
X_0_value:
ASLD
ROL NUM_BCD+1
ROL NUM_BCD
JMP BCDtoBIN
;##-------------------------------- DEF BCD-BIN ------------------------------------
_BCD_BIN:
CLR NUM_BIN
CLR NUM_BIN+1
_BCD_BIN_COMP4Bytes:
ANDB #$0F
STAB NUM_BIN+1
_BCD_BIN_COMP_B:
LDAB BCD+1
ANDB #$F0
_BCD_BIN_TranformB:
LSRB ; B -> x0 to $0x
LSRB
LSRB
LSRB
LDAA #10 ; A = B * 10
MUL ; A:B
ADDB NUM_BIN+1
STAB NUM_BIN+1
_BCD_BIN_COMP_C:
LDAA BCD
ANDA #$0F
LDAB #100
MUL
ADDD NUM_BIN
STD NUM_BIN
_BCD_BIN_LAST_COMP:
LDAB BCD
ANDB #$F0
_BCD_BIN_TranformA:
LSRA ; A -> x0 to $0x
LSRA
LSRA
LSRA
CLRA
LDY #1000 ; load index
EMUL
ADDD NUM_BIN
STD NUM_BIN
_BCD_BIN_end:
JMP FINAL_END
| 19.118343 | 89 | 0.5342 |
bd03b82bdbde4c70728b4bfd5c877c1513e9c136 | 4,191 | asm | Assembly | kernel/usb/hub.asm | ssebs/xos | 8c50cb7753690ad67696131a8b9935947e1a8075 | [
"MIT"
] | 15 | 2020-05-02T22:04:24.000Z | 2021-08-31T16:56:59.000Z | kernel/usb/hub.asm | JamesLinus/xos | 3fba0cb15e84b5f7cd08e0a29ed5f86087192d2e | [
"MIT"
] | null | null | null | kernel/usb/hub.asm | JamesLinus/xos | 3fba0cb15e84b5f7cd08e0a29ed5f86087192d2e | [
"MIT"
] | 1 | 2019-07-20T10:10:36.000Z | 2019-07-20T10:10:36.000Z |
;; xOS32
;; Copyright (C) 2016-2017 by Omar Mohammad.
use32
; USB Hub-Specific Stuff
USB_HUB_CLASS = 0x09
USB_HUB_DESCRIPTOR = 0x29
; USB Hub Feature Selectors
USB_HUB_FEATURE_PORT_ENABLE = 1
USB_HUB_FEATURE_PORT_RESET = 4
USB_HUB_FEATURE_PORT_POWER = 8
USB_HUB_FEATURE_LOCAL_POWER = 0
; USB Hub Port Status
USB_HUB_PORT_CONNECT = 0x0001
USB_HUB_PORT_ENABLED = 0x0002
USB_HUB_PORT_RESET = 0x0010
; usb_hub_init:
; Initializes a non-root USB hub
; In\ EAX = Controller number
; In\ BL = Hub address
; Out\ Nothing
usb_hub_init:
mov [.controller], eax
mov [.address], bl
mov esi, .msg
call kprint
mov eax, [.controller]
call int_to_string
call kprint
mov esi, .msg2
call kprint
movzx eax, [.address]
call int_to_string
call kprint
mov esi, newline
call kprint
; request the hub descriptor
mov edi, usb_hub_descriptor
mov ecx, 7
mov al, 0
rep stosb
mov [usb_setup_packet.request_type], 0xA0
mov [usb_setup_packet.request], USB_GET_DESCRIPTOR
mov [usb_setup_packet.value], USB_HUB_DESCRIPTOR shl 8
mov [usb_setup_packet.index], 0
mov [usb_setup_packet.length], 7
mov eax, [.controller]
mov bl, [.address]
mov bh, 0 ; USB hubs can only have one endpoint
mov esi, usb_setup_packet
mov edi, usb_hub_descriptor
mov ecx, 7 or 0x80000000 ; request 7 bytes only
call usb_setup
; check for errors...
cmp eax, 0
jne .error
cmp [usb_hub_descriptor.type], USB_HUB_DESCRIPTOR
jne .error
mov al, [usb_hub_descriptor.ports] ; downstream port count
mov [.ports], al
; enable local power for the hub
mov [usb_setup_packet.request_type], 0x20
mov [usb_setup_packet.request], USB_SET_FEATURE
mov [usb_setup_packet.value], USB_HUB_FEATURE_LOCAL_POWER
mov [usb_setup_packet.index], 0
mov [usb_setup_packet.length], 0
mov eax, [.controller]
mov bl, [.address]
mov bh, 0
mov esi, usb_setup_packet
mov edi, 0
mov ecx, 0
call usb_setup
cmp eax, 0
jne .error
; reset all downstream ports on the hub
mov [.current_port], 1 ; one-based and not zero!
.ports_loop:
mov al, [.current_port]
cmp al, [.ports]
jg .done
; reset the port
mov [usb_setup_packet.request_type], 0x23
mov [usb_setup_packet.request], USB_SET_FEATURE
mov [usb_setup_packet.value], USB_HUB_FEATURE_PORT_RESET
movzx ax, [.current_port]
mov [usb_setup_packet.index], ax
mov [usb_setup_packet.length], 0
mov eax, [.controller]
mov bl, [.address]
mov bh, 0
mov esi, usb_setup_packet
mov edi, 0
mov ecx, 0
call usb_setup
cmp eax, 0
jne .error
.wait_reset:
; poll the port, wait for the reset to complete
mov [.port_status], 0
mov [usb_setup_packet.request_type], 0xA3
mov [usb_setup_packet.request], USB_GET_STATUS
mov [usb_setup_packet.value], 0
movzx ax, [.current_port]
mov [usb_setup_packet.index], ax
mov [usb_setup_packet.length], 2
mov eax, [.controller]
mov bl, [.address]
mov bh, 0
mov esi, usb_setup_packet
mov edi, .port_status
mov ecx, 2 or 0x80000000 ; device to host
call usb_setup
cmp eax, 0
jne .error
test [.port_status], USB_HUB_PORT_RESET
jnz .wait_reset
; if the port has a device attached, ensure it is enabled
mov [.port_status], 0
mov [usb_setup_packet.request_type], 0xA3
mov [usb_setup_packet.request], USB_GET_STATUS
mov [usb_setup_packet.value], 0
movzx ax, [.current_port]
mov [usb_setup_packet.index], ax
mov [usb_setup_packet.length], 2
mov eax, [.controller]
mov bl, [.address]
mov bh, 0
mov esi, usb_setup_packet
mov edi, .port_status
mov ecx, 2 or 0x80000000
call usb_setup
cmp eax, 0
jne .error
; connected?
test [.port_status], USB_HUB_PORT_CONNECT
jz .next_port
; yes -- enabled?
test [.port_status], USB_HUB_PORT_ENABLED
jz .error
.next_port:
inc [.current_port]
jmp .ports_loop
.done:
ret
.error:
mov esi, .error_msg
call kprint
ret
align 4
.controller dd 0
.ports db 0
.current_port db 0
.address db 0
align 2
.port_status dw 0
.msg db "usb-hub: initialize USB hub on controller ",0
.msg2 db ", address ",0
.error_msg db "usb-hub: failed to initialize USB hub.",10,0
; Hub Descriptor..
align 4
usb_hub_descriptor:
.length db 0
.type db 0
.ports db 0
.characteristics dw 0
.power_good_time db 0
.max_current db 0
| 19.676056 | 61 | 0.733238 |
26eb39615d43f1d6d7e7a025e3ecb1158adaf4aa | 1,089 | asm | Assembly | CS660/JST/res/helpful example mips.asm | T-R0D/Past-Courses | 0edc83a7bf09515f0d01d23a26df2ff90c0f458a | [
"MIT"
] | 7 | 2017-03-13T17:32:26.000Z | 2021-09-27T16:51:22.000Z | CS660/JST/res/helpful example mips.asm | T-R0D/Past-Courses | 0edc83a7bf09515f0d01d23a26df2ff90c0f458a | [
"MIT"
] | 1 | 2021-05-29T19:54:02.000Z | 2021-05-29T19:54:52.000Z | CS660/JST/res/helpful example mips.asm | T-R0D/Past-Courses | 0edc83a7bf09515f0d01d23a26df2ff90c0f458a | [
"MIT"
] | 25 | 2016-10-18T03:31:44.000Z | 2020-12-29T13:23:10.000Z | # some helpful macros
.macro print_int(%value)
li $v0, 1
li $a0, %value
syscall
.end_macro
# str_addr is the base address of a null terminated ascii string
.macro print_str(%str_addr)
li $v0, 4
la $a0, %str_addr
syscall
.end_macro
.macro LAND(%lhs, %rhs)
beqz %lhs, FALSE
beqz %rhs, FALSE
li $t7, 1
j END
FALSE:
li $t7, 0
END:
.end_macro
.macro LOR(%lhs, %rhs)
bnez %lhs, TRUE
bnez %rhs, TRUE
li $t7, 0
j END
TRUE:
li $t7, 1
END:
.end_macro
.data
# proper declarations of globals
g: .word 5 # int g = 5
fp1: .double 4.5 # double fp1 = 4.5
my_array: .space 5 # char my_array[5];
# since we can't load floating points with li, they might need to be declared this way
d1: .double 1.1
d2: .double 2.2
.text
# load some doubles into the coprocessor 1 registers and add them
# double word types are referenced by even number registers, but
# use the register below them also, i.e. $f2 and $f1
ldc1 $f2, d1
ldc1 $f4, d2
add.d $f6, $f2, $f4
li.s $f0, 3.2
li $t1, 0xFF
sw $t1, 0x10010001
lwc1 $f0, fp1
cvt.w.s $f1, $f0
mfc1 $t0, $f1
| 17.285714 | 87 | 0.654729 |
188afb58f4db121ae19feb30859e9df4b967ca8a | 2,431 | asm | Assembly | programs/oeis/179/A179064.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/179/A179064.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/179/A179064.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A179064: Number of non-attacking placements of 9 rooks on an n X n board.
; 0,0,0,0,0,0,0,0,362880,36288000,1097712000,17563392000,185513328000,1454424491520,9090153072000,47491411968000,214453407168000,857813628672000,3096707199505920,10237048593408000,31350961317312000,89786185074432000,242331081144768000,620367567730606080,1514569257154800000,3542729473483200000,7971141315337200000,17311287510316800000,36396981990441072000,74279555082532800000,147484819079161200000,285490462640947200000,539755405930540800000,998331598809128263680,1809106817368612608000,3216189897544200192000,5616025471604604672000,9642735768129666048000,16296223448139135621120,27132109799191068672000,44540113840273619568000,72147622418955615168000,115398749007481775472000,182377124962028340664320,284964257753169282288000,440456076994672170432000,673800189806946554352000,1020667743139516674048000,1531639532048737208993280,2277869619346723987200000,3358695510159200164800000,4911797003499446860800000,7126672408486542475200000,10262408268220621164288000,14670975903292712203200000,20827605447137141452800000,29370177993814484626800000,41150053632316504075200000,57297334677637500274308480,79304269450017301417728000,109131355999820406277872000,149341734589999872457152000,203270694303055381955568000,275238599624897469252894720,370817309762497387625472000,497162265720356608339968000,663424914036468732115968000,881263086039825170153472000,1165470431287668787527966720,1534750097637618129235968000,2012662654055991932746752000,2628783874685377218281472000,3420114567431243944390128000,4432792277219761382125524480,5724163581120559636009200000,7365285997895378137132800000,9443940458806595366578800000,12068249055110129428747200000,15371008643457615870369648000,19514869136704769206579200000,24698506251141973527076800000,31163962475638699567660800000,39205357467983017041931200000,49179200407837896577398497280,61516572532311080812275648000,76737488691005692981546752000,95467792883336964197456832000,118458995047037566214565888000,146611515588685087810246312320,181001871097142083716353472000,222914410255120998699453168000,273878294149999148351309568000,335710511069067833629602672000,410565823641008079993241413120,500994667166048934821390448000,610010153600516182231990272000,741165487503519726061569792000,898643270039616645511339008000,1087358356747936141068720199680,1313076146296263906616012800000
add $0,1
bin $0,9
pow $0,2
mul $0,362880
| 303.875 | 2,312 | 0.943233 |
6bb654f446e63a7b272f631c145fcb649d7772a9 | 149 | asm | Assembly | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/mak.lzh/mak/kart-calc-d.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/mak.lzh/mak/kart-calc-d.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/mak.lzh/mak/kart-calc-d.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: kart-calc-d.asm
Type: file
Size: 23670
Last-Modified: '1992-08-06T07:16:31Z'
SHA-1: 583F8212455B4E6C24A4850B0AFDD5F64303830F
Description: null
| 21.285714 | 47 | 0.805369 |
86da7d6d1c12c01da7bc6aad9e5ae5d5b4ee5a77 | 736 | asm | Assembly | programs/oeis/262/A262867.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/262/A262867.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/262/A262867.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A262867: Total number of ON (black) cells after n iterations of the "Rule 153" elementary cellular automaton starting with a single ON (black) cell.
; 1,2,5,8,15,22,31,38,53,68,85,100,121,140,161,176,207,238,271,302,339,374,411,442,487,530,575,614,663,706,751,782,845,908,973,1036,1105,1172,1241,1304,1381,1456,1533,1604,1685,1760,1837,1900,1993,2084,2177,2264,2361,2452,2545,2624,2729,2828,2929,3016,3121,3212,3305,3368,3495,3622,3751,3878,4011,4142,4275,4402,4543,4682,4823,4958,5103,5242,5383,5510,5667,5822,5979,6130,6291,6446,6603,6746,6915,7078,7243,7394,7563,7718,7875,8002,8191,8378,8567,8750
lpb $0
mov $2,$0
sub $0,1
seq $2,71042 ; Number of 0's in n-th row of triangle in A070886.
add $1,$2
lpe
add $1,1
mov $0,$1
| 61.333333 | 451 | 0.740489 |
881700a210fb56e83857c1a70c2715f5f28d7dd2 | 456 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_pow.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_pow.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_pow.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; double pow(double x, double y)
SECTION code_fp_math48
PUBLIC am48_pow
EXTERN mm48_pwr
; compute (AC')^(AC)
;
; enter : AC' = double x
; AC = double y
;
; exit : success
;
; AC' = x^y
; carry reset
;
; fail if out of domain or overflow
;
; AC' = +-inf or zero
; carry set, errno set
;
; uses : af, af', bc', de', hl'
defc am48_pow = mm48_pwr
| 16.285714 | 46 | 0.480263 |
f6c9af279bc5afb5304954971d9e574fa384339c | 752 | asm | Assembly | programs/oeis/052/A052849.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/052/A052849.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/052/A052849.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A052849: a(0) = 0; a(n+1) = 2*n! (n >= 0).
; 0,2,4,12,48,240,1440,10080,80640,725760,7257600,79833600,958003200,12454041600,174356582400,2615348736000,41845579776000,711374856192000,12804747411456000,243290200817664000,4865804016353280000,102181884343418880000,2248001455555215360000,51704033477769953280000,1240896803466478878720000,31022420086661971968000000,806582922253211271168000000,21777738900836704321536000000,609776689223427721003008000000,17683523987479403909087232000000,530505719624382117272616960000000,16445677308355845635451125760000000,526261673867387060334436024320000000
mov $1,$0
seq $0,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters).
pow $2,$1
sub $0,$2
mul $0,2
| 83.555556 | 546 | 0.840426 |
fea54144385d6fdda063ca7ce0496a168c345dea | 4,167 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_10_1509.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_10_1509.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_10_1509.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1bc19, %r14
nop
inc %r9
mov (%r14), %r8w
nop
nop
xor %r8, %r8
lea addresses_WT_ht+0x3619, %rsi
lea addresses_normal_ht+0x7c99, %rdi
and %r12, %r12
mov $106, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $31506, %r9
lea addresses_WC_ht+0x1b619, %rsi
lea addresses_D_ht+0x11259, %rdi
nop
nop
nop
add %r8, %r8
mov $13, %rcx
rep movsb
inc %rsi
lea addresses_A_ht+0x2bd1, %r9
nop
nop
cmp $10397, %rdi
movb (%r9), %cl
nop
nop
xor $26914, %r8
lea addresses_WC_ht+0x1a1d9, %rsi
lea addresses_WT_ht+0x1e3b9, %rdi
nop
xor $2349, %rax
mov $19, %rcx
rep movsb
nop
xor $63836, %r9
lea addresses_normal_ht+0x3c39, %rax
nop
nop
nop
dec %r14
mov (%rax), %r8
nop
nop
nop
nop
nop
cmp $22620, %r9
lea addresses_A_ht+0x1dd69, %r12
nop
cmp $5955, %r14
movw $0x6162, (%r12)
nop
nop
nop
cmp $55519, %r12
lea addresses_WT_ht+0xf609, %rdi
nop
nop
nop
nop
sub $56488, %r12
mov $0x6162636465666768, %r8
movq %r8, (%rdi)
nop
nop
nop
nop
nop
xor $37473, %rcx
lea addresses_WT_ht+0x29f3, %rcx
clflush (%rcx)
nop
inc %rdi
movups (%rcx), %xmm7
vpextrq $1, %xmm7, %rsi
nop
nop
nop
nop
nop
sub $62371, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r8
push %r9
push %rax
push %rbp
push %rsi
// Store
lea addresses_A+0x1f19, %r13
nop
nop
nop
sub $9321, %r8
movw $0x5152, (%r13)
nop
nop
nop
nop
nop
cmp %r13, %r13
// Store
lea addresses_RW+0x1f29d, %r15
nop
nop
cmp $2052, %rax
mov $0x5152535455565758, %r13
movq %r13, %xmm7
movups %xmm7, (%r15)
nop
nop
nop
nop
xor $58587, %rsi
// Load
lea addresses_A+0x1fa19, %r13
nop
nop
nop
nop
nop
xor $2736, %r9
movb (%r13), %r15b
sub %r15, %r15
// Load
lea addresses_US+0x2999, %rbp
add %r13, %r13
movb (%rbp), %al
nop
nop
nop
nop
nop
xor $18310, %r8
// Faulty Load
lea addresses_PSE+0x7619, %r15
nop
nop
nop
nop
and $8404, %rbp
mov (%r15), %si
lea oracles, %r8
and $0xff, %rsi
shlq $12, %rsi
mov (%r8,%rsi,1), %rsi
pop %rsi
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 9, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'33': 10}
33 33 33 33 33 33 33 33 33 33
*/
| 19.471963 | 152 | 0.643629 |
62dbb1b9dad289adab450d4c258f2a87b973a11a | 1,345 | asm | Assembly | programs/oeis/033/A033436.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/033/A033436.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/033/A033436.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A033436: a(n) = ceiling( (3*n^2 - 4)/8 ).
; 0,0,1,3,6,9,13,18,24,30,37,45,54,63,73,84,96,108,121,135,150,165,181,198,216,234,253,273,294,315,337,360,384,408,433,459,486,513,541,570,600,630,661,693,726,759,793,828,864,900,937,975,1014,1053,1093,1134,1176,1218,1261,1305,1350,1395,1441,1488,1536,1584,1633,1683,1734,1785,1837,1890,1944,1998,2053,2109,2166,2223,2281,2340,2400,2460,2521,2583,2646,2709,2773,2838,2904,2970,3037,3105,3174,3243,3313,3384,3456,3528,3601,3675,3750,3825,3901,3978,4056,4134,4213,4293,4374,4455,4537,4620,4704,4788,4873,4959,5046,5133,5221,5310,5400,5490,5581,5673,5766,5859,5953,6048,6144,6240,6337,6435,6534,6633,6733,6834,6936,7038,7141,7245,7350,7455,7561,7668,7776,7884,7993,8103,8214,8325,8437,8550,8664,8778,8893,9009,9126,9243,9361,9480,9600,9720,9841,9963,10086,10209,10333,10458,10584,10710,10837,10965,11094,11223,11353,11484,11616,11748,11881,12015,12150,12285,12421,12558,12696,12834,12973,13113,13254,13395,13537,13680,13824,13968,14113,14259,14406,14553,14701,14850,15000,15150,15301,15453,15606,15759,15913,16068,16224,16380,16537,16695,16854,17013,17173,17334,17496,17658,17821,17985,18150,18315,18481,18648,18816,18984,19153,19323,19494,19665,19837,20010,20184,20358,20533,20709,20886,21063,21241,21420,21600,21780,21961,22143,22326,22509,22693,22878,23064,23250
pow $0,2
mul $0,3
div $0,8
mov $1,$0
| 168.125 | 1,262 | 0.782156 |
e5a929617d6f63f4e681d13b8a938496a1fa10fb | 2,036 | asm | Assembly | programs/oeis/225/A225605.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/225/A225605.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/225/A225605.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A225605: (1) = least k such that 1/3 < H(k) - 1/3; a(2) = least k such that H(a(1)) - H(3) < H(k) -H(a(1)), and for n > 2, a(n) = least k such that H(a(n-1)) - H(a(n-2) > H(k) - H(a(n-1)), where H = harmonic number.
; 5,9,16,29,53,97,178,327,601,1105,2032,3737,6873,12641,23250,42763,78653,144665,266080,489397,900141,1655617,3045154,5600911,10301681,18947745,34850336,64099761,117897841,216847937,398845538,733591315,1349284789,2481721641,4564597744,8395604173,15441923557,28402125473,52239653202,96083702231,176725480905,325048836337,597858019472,1099632336713,2022539192521,3720029548705,6842201077938,12584769819163,23147000445805,42573971342905,78305741607872,144026713396581,264906426347357,487238881351809,896172021095746,1648317328794911,3031728231242465,5576217581133121,10256263141170496,18864208953546081,34696689675849697,63817161770566273,117378060399962050,215891911846378019,397087134016906341,730357106263246409,1343336152126530768,2470780392406683517,4544473650796460693,8358590195329674977,15373844238532819186,28276908084658954855,52009342518521449017,95660094841713223057,175946345444893626928,323615782805128299001,595222223091735148985,1094784351341757074913,2013622357238620522898,3703628931672112746795,6812035640252490344605,12529286929163223614297,23044951501087826705696,42386274070503540664597,77960512500754590984589,143391738072345958354881,263738524643604090004066,485090775216704639343535,892221037932654687702481,1641050337792963417050081,3018362150942322744096096,5551633526667940848848657,10211046015403227009994833,18781041693013490602939585,34543721235084658461783074,63535808943501376074717491,116860571871599525139440149,214940102050185559675940713,395336482865286460890098352,727137156787071545705479213
add $0,3
mov $1,4
lpb $0
mov $2,$0
trn $0,3
seq $2,232508 ; Number of (n+1) X (1+1) 0..2 arrays with every element next to itself plus and minus one within the range 0..2 horizontally, diagonally or antidiagonally, with no adjacent elements equal.
add $1,$2
lpe
div $1,4
mov $0,$1
| 145.428571 | 1,527 | 0.852161 |
b3949795a3913e3c730625ab25e600bd185c2f6b | 8,304 | asm | Assembly | Variables/initialise_game.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | null | null | null | Variables/initialise_game.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | null | null | null | Variables/initialise_game.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | null | null | null | ;;;;;;&0311,X \ FRIN,X \ the Type for each of the 12 ships allowed
;;;;;;
;;;;;;FLFLLS:
;;;;;; .FLFLLS \ -> &360A \ New Flood-filled Sun, ends with Acc=0
;;;;;;A0 BF LDY #191 \ #2*Y-1 is top of Yscreen
;;;;;;A9 00 LDA #0 \ clear each line
;;;;;; .SAL6 \ counter Y
;;;;;;99 00 0E STA &0E00,Y \ LSO,Y \ line buffer solar
;;;;;;88 DEY \ fill next line with zeros
;;;;;;D0 FA BNE SAL6 \ loop Y
;;;;;;88 DEY \ Yreg = #&FF
;;;;;;8C 00 0E STY &0E00 \ LSX \ overlaps with LSO vector
;;;;;;60 RTS
WipeScanner: ; WPSHPS \ -> &35D8 \ Wipe Ships on scanner
; "Wipe Scanner"
ld b,0
ld hl, FRIN
.OuterLoop:
ld a,(hl)
cp 0
jr z,.NothingInLocation ; in original it assumed free list shuffles, we won't and hard clear
bit 7,a
jr nz,.LoopAlsoPlanetOrSun
ld (TYPE),a
.SelectUnivBank:
ld a,b
MMUSelectUniverseA ; select correct universeobject page
ld c,31
; We won't copy as the bank holds a local copy of data all the time
ld de,UBnkexplDsp ; start with INWK+31
;we don;t need to copy into inwk as we can work from univ object data as we don;t have 6502 zero page on z80
ld (XSAV),b ; get scanner updated based on b
call SCAN ; draw ship b (XSAV holds a copy) on scanner
ld b,(XSAV)
ld a,(UBnkexplDsp)
and $A7 ; clear bits 6,4,3 (explode,invisible,dot)
ld (UBnkexplDsp),a ; and keep bits 7,5,2,1,0 (kill,exploding,missiles)
.LoopAlsoPlanetOrSun: ; loop and skip if planet or sun
inc b
cp UniverseListSize
jr nz,.OuterLoop
.ClearLineBuffers:
ld a,$FF
ld (LSX2),a ; Lines x2 and y2
ld (LSY2),a ; Lines x2 and y2
.FloodFills
; "TODO call FLFLLS"
ret
InitialilseUniverseBanks: ; Interrupts must be disabled before calling this
MMUSelectUniverseN 70 ; Select Primary ship register
ld c,71
ld b,12
.InitLoop:
push bc
ld a,c ; copy to bank 71 onwards
MMUSelectCpySrcA
ld hl,dmaCopySrcAddr
ld de,UniverseBankAddr
ld bc,$2000 ; just blanket copy all 78K for now
call memfill_dma
pop bc
inc c
djnz .InitLoop
ret
ZeroData:
game_reset: ;.RESET \ -> &3682 \ New player ship, called by TITLE
; "TODO call zero_data " ;ZERO \ zero-out &311-&34B, does this leave a as 0 -> Yes
xor a
ld b,7
ld hl, BETA
.ClearBetaLoop: ; Clears out BETA, BET1, XC, YC, both HyperCount, ECMActive
ld (hl),a ; These must be defined continguous
inc hl
djnz .ClearBetaLoop
ld a,PlayerDocked ; Set up in dock which happens to be also $FF
ld (DockedFlag),a
ld hl, PlayerForwardSheild0 ; Load player field 0 to 2 with FF
ld (hl),a
inc hl
ld (hl),a
inc hl
ld (hl),a
; Now fall into Reset2
Reset2: ; .RES2 \ -> &3697 \ Reset2
ld a,MaxNumberOfStars ; Init star count to 18
ld (NumberofStars),a
ld a,$FF ; bline buffers cleared, 78 bytes.
ld (LSX2),a
ld (LSY2),a
ld (MSTG),a ; missile has no target
ld a,$80 ; center joysticks position
xor a ; for next 0 = center
ld (JSTY),a ; joystick Y
ld (JSTX),a ; joystick X
ld (ALP2),a ; ALP2 \ roll sign
ld (BET2),a ; BET2 \ pitch sign
xor a ; = 0
ld (ALP2FLIP),a ; negated roll sign
ld (BET2FLIP),a ; negated pitch sign
ld (MCNT),a ; move count
ld (OuterHyperCount),a ; Reset Hyperspace Jump
ld (InnerHyperCount),a ; Reset HyperspaceJump
ld a,3 ; keep ship distance fixed on title screen
ld (DELTA),a ; bpl -2 inserted here to stall from title code if byte check fails
ld (ALPHA),a ; \ gentle roll to player for ship on title screen
ld (ALP2),a ; roll magnitude
.SpaceStationSetup:
ld a,(SpaceStationPresent) ; \ space station present, 0 is SUN.
cp 0
call nz,.SpaceStationBulb ; SPBLB \ space station bulb
ld a,(ECMActive) ; E.C.M. active
cp 0
call nz,.NoResetECMSound ; call sound reset if needed
.ResetScanner:
; "TODO call WipeScanner" ; WPSHPS \ wipe ships on scanner
; "TODO call ZeroData" ; zero-out &311-&34B
ld hl,ShipLineStackPointer
ld (hl),ShipLineStackTop ; Set stack, this will likley be removed by local page index lists of lines to draw
; "TODO call UpdateDials" ; DIALS \ update flight console
; "TODO call ClearKeyboard" ; \ Uperc \ clear keyboard logger
; "TODO call MissileBlobs" ; .msblob \ -> &3F3B \ update Missile blocks on console
.ZeroInformation: ;.ZINF \ -> &36D8 \ Zero Information, ends with Acc = #&E0
; "TODO Clear Rotation Matrix"
; "TODO Initialise universe ship banks"
;;;;;; ld TODO DEAL with Matrix
;;;;;;A0 24 LDY #36 \ #NI%-1 = NI%=37 is size of inner working space
;;;;;;A9 00 LDA #0
;;;;;; .ZI1 \ counter Y
;;;;;;99 46 00 STA &0046,Y \ INWK,Y
;;;;;;*** MAY NOT NEED SHIP LEVEL ROTAION MATRIX MAY ONLY NEED 1 GLOBAL
;;;;;;88 DEY
;;;;;;10 FA BPL ZI1 \ loop Y
;;;;;;A9 60 LDA #&60 \ unity in rotation matrix
;;;;;;85 58 STA &58 \ INWK+18 \ rotmat1y hi
;;;;;;85 5C STA &5C \ INWK+22 \ rotmat2x hi
;;;;;;09 80 ORA #&80 \ -ve unity = #&E0
;;;;;;85 54 STA &54 \ INWK+14 \ rotmat0z hi = -1
;;;;;;60 RTS
;;;;;;--- IN FLIGHT VERSION TO MERGE ---
;;;;;;A9 60 LDA #&60 \ unity in rotation matrix
;;;;;;85 58 STA &58 \ INWK+18 \ rotmat1y hi
;;;;;;85 5C STA &5C \ INWK+22 \ rotmat2x hi
;;;;;;09 80 ORA #&80 \ -ve unity = #&E0
;;;;;;85 54 STA &54 \ INWK+14 \ rotmat0z hi = -1
ret
HexMap DB "0123456789ABCDEF"
ShipFile macro filename
dw Filesize(filename)
db \0
db 0
; "file='",\0,"' size=",Filesize(\0)
endm
; Initially will just hold ship 0 but updated in loop, this used as all files must be same size
loadShipName ShipFile "ships\Ship01.Shp"
load_ships: ; sod selective load from disk, get them all in
xor a
ld (varGPLoopA),a
ld a, ShipDataBasePage
push af
.SelectPageInBankLoop:
MMUSelectShipModelA
.Cleardownpage:
ld hl, ShipmodelbankAddr ; Zap memory bank 6 now its selected
ld de, membanksize
xor a
call memfill_dma
.SetFilename:
pop af ; get page id and save again
push af
ld b,a ; save for 2nd char
and $F0 ; top 4 bits
swapnib ; move to lower 4 bits
ld hl,Hexmap
add hl,a
ld a,(hl) ; now we have hex as ascii
ld (loadShipName + 10),a ; set high digit of name
ld a,b ; get a value back
and $0F ; lower bits
ld hl,Hexmap
add hl,a
ld a,(hl) ; now we have hex as ascii
ld (loadShipName + 11),a ; set low digit of name
.ReadInFile:
ld hl, ShipFile
ld ix, ShipmodelbankAddr
call FileLoad
MESSAGE "For now sod error handling, if data is garbage tough :) "
.RepeatLoop:
ld a,(varGPLoopA)
inc a
cp ShipCountMax
jr c,.AllLoaded
ld (varGPLoopA),a
pop af
jr .SelectPageInBankLoop
.AllLoaded:
ret
reset_ships:
call load_ships ; LSHIPS \ Load ship(s) files
call game_reset ; RESET \ new player ship, controls, dust field.
ld a,PlayerDocked ; Docked flag set
ld (DockedFlag),a ; QQ12
ld (MenuIdMax),a ; QQ11 \ menu id max
ld a,KeyForwardsView ; red key #f0, forward view.
ret
; NOTE IN ORIGINAL THIS WOUDL BE DONE: jp force_keyboard_entry ; FRCE \ forced entry into keyboard main loop
| 37.917808 | 115 | 0.548049 |
e4897580edfc3ed6efdc9b2c9a72aa68ebaf2c56 | 488 | asm | Assembly | tests/nasm/paddd.asm | Tuna0128/Tuna0128.github.io | 7976c8236209a09f82fddd7c74ebcec86119d491 | [
"BSD-2-Clause-FreeBSD"
] | 12,700 | 2015-01-04T15:03:42.000Z | 2022-03-31T06:43:06.000Z | tests/nasm/paddd.asm | Tuna0128/Tuna0128.github.io | 7976c8236209a09f82fddd7c74ebcec86119d491 | [
"BSD-2-Clause-FreeBSD"
] | 566 | 2015-01-01T18:16:40.000Z | 2022-03-31T19:59:10.000Z | tests/nasm/paddd.asm | Tuna0128/Tuna0128.github.io | 7976c8236209a09f82fddd7c74ebcec86119d491 | [
"BSD-2-Clause-FreeBSD"
] | 1,182 | 2015-01-05T09:20:48.000Z | 2022-03-31T12:16:52.000Z | global _start
section .data
align 16
quad1:
dq 0x00ad80ad0fffffff
quad2:
dq 0x71ae01ff0f00ffbe
quad3:
dq 0xf100808080f0ff42
quad4:
dq 0xffffffffffffffff
mydword:
dd 0xcafebabe
myaddress:
dq 0x00adbeefc0de00ce
%include "header.inc"
movq mm0, [quad1]
movq mm1, [quad2]
movq mm2, [quad3]
movq mm3, [quad2]
movq mm4, [quad4]
paddd mm0, [quad2]
paddd mm0, [quad1]
paddd mm1, mm2
paddd mm2, [quad1]
paddd mm3, [quad1]
paddd mm4, [quad4]
%include "footer.inc"
| 13.942857 | 22 | 0.709016 |
314545d6a9a4bbab2ebb624b37cf16bb3db66d2c | 612 | nasm | Assembly | assignment-3/linux_x86_small_egghunter.nasm | rcesecurity/slae | 32c877607490f5ca3a935ff5c6b7786526da9d0e | [
"MIT"
] | 8 | 2015-09-20T08:45:34.000Z | 2020-12-25T13:05:57.000Z | assignment-3/linux_x86_small_egghunter.nasm | rcesecurity/slae | 32c877607490f5ca3a935ff5c6b7786526da9d0e | [
"MIT"
] | null | null | null | assignment-3/linux_x86_small_egghunter.nasm | rcesecurity/slae | 32c877607490f5ca3a935ff5c6b7786526da9d0e | [
"MIT"
] | 6 | 2015-05-18T20:56:31.000Z | 2020-04-26T22:54:19.000Z | ; SLAE - Assignment #3: Small Egghunter (Linux/x86) - 19 bytes
; Author: Julien Ahrens (@MrTuxracer)
; Website: http://www.rcesecurity.com
global _start
section .text
_start:
mov eax, esp ;get current working stack address
mov ebx, 0x42904a90 ;egg=INC EDX, NOP, DEC EDX, NOP
search_the_egg:
inc eax ;go upwards the stack addresses
cmp dword [eax], ebx ;check if address contains egg
jne search_the_egg ;loop until we found it
cmp dword[eax+4], ebx ;if egg is found, dheck next four bytes for egg again
jne search_the_egg ;not found? must be a standalone egg ;)
jmp eax ;execute egg+shellcode
| 27.818182 | 76 | 0.735294 |
992b91cd2a2cb631e0f1d175b818b27b9b8f75db | 28,769 | asm | Assembly | src/include/dinotun2.asm | pfiscarelli/Run-Dino-Run | d80ae23664b37ae17ccbfad4b3ad0aacd46fd118 | [
"MIT"
] | 3 | 2019-11-16T20:56:54.000Z | 2019-12-28T05:12:57.000Z | src/include/dinotun2.asm | pfiscarelli/Run-Dino-Run | d80ae23664b37ae17ccbfad4b3ad0aacd46fd118 | [
"MIT"
] | null | null | null | src/include/dinotun2.asm | pfiscarelli/Run-Dino-Run | d80ae23664b37ae17ccbfad4b3ad0aacd46fd118 | [
"MIT"
] | 1 | 2021-10-16T18:56:30.000Z | 2021-10-16T18:56:30.000Z | tune2 ; London Bridge
fcb $00,$44,$00
fcb $00,$44,$00
fcb $00,$44,$00
fcb $00,$44,$00
fcb $44,$44,$3D
fcb $44,$44,$41
fcb $44,$3A,$44
fcb $44,$3A,$3D
fcb $44,$44,$41
fcb $44,$44,$44
fcb $3A,$44,$44
fcb $3A,$44,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $42,$41,$3D
fcb $42,$41,$41
fcb $42,$41,$44
fcb $42,$41,$3D
fcb $41,$42,$41
fcb $41,$42,$44
fcb $41,$42,$44
fcb $41,$42,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $3F,$41,$36
fcb $3F,$41,$2E
fcb $3F,$41,$3D
fcb $3F,$41,$36
fcb $41,$42,$2E
fcb $41,$42,$3D
fcb $41,$42,$3D
fcb $41,$42,$3D
fcb $42,$42,$3D
fcb $42,$42,$3D
fcb $42,$42,$3D
fcb $42,$42,$3D
fcb $42,$41,$38
fcb $42,$41,$30
fcb $42,$41,$3F
fcb $42,$41,$38
fcb $41,$42,$30
fcb $41,$42,$3F
fcb $41,$42,$3F
fcb $41,$42,$3F
fcb $42,$44,$3F
fcb $42,$44,$3F
fcb $42,$44,$3F
fcb $42,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3D
fcb $44,$44,$41
fcb $44,$3A,$44
fcb $44,$3A,$3D
fcb $44,$44,$41
fcb $44,$44,$44
fcb $3A,$44,$44
fcb $3A,$44,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $42,$41,$3D
fcb $42,$41,$41
fcb $42,$41,$44
fcb $42,$41,$3D
fcb $41,$42,$41
fcb $41,$42,$44
fcb $41,$42,$44
fcb $41,$42,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $3F,$3F,$36
fcb $3F,$3F,$2E
fcb $3F,$3F,$3D
fcb $3F,$3F,$36
fcb $3F,$44,$2E
fcb $3F,$44,$3D
fcb $3F,$44,$3D
fcb $3F,$44,$3D
fcb $44,$44,$3D
fcb $44,$44,$3D
fcb $44,$44,$3D
fcb $44,$44,$3D
fcb $44,$41,$38
fcb $44,$41,$30
fcb $44,$41,$3F
fcb $44,$41,$38
fcb $41,$3D,$30
fcb $41,$3D,$3F
fcb $41,$3D,$3F
fcb $41,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$44,$3D
fcb $25,$44,$41
fcb $25,$3A,$44
fcb $25,$3A,$3D
fcb $31,$44,$41
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$41,$3D
fcb $25,$41,$41
fcb $25,$41,$44
fcb $25,$41,$3D
fcb $25,$42,$41
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$41,$36
fcb $2A,$41,$2E
fcb $2A,$41,$3D
fcb $2A,$41,$36
fcb $36,$42,$2E
fcb $36,$42,$3D
fcb $36,$42,$3D
fcb $36,$42,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2C,$41,$38
fcb $2C,$41,$30
fcb $2C,$41,$3F
fcb $2C,$41,$38
fcb $2C,$42,$30
fcb $2C,$42,$3F
fcb $2C,$42,$3F
fcb $2C,$42,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $25,$44,$3F
fcb $25,$44,$3F
fcb $25,$44,$3F
fcb $25,$44,$3F
fcb $25,$44,$3D
fcb $25,$44,$41
fcb $25,$3A,$44
fcb $25,$3A,$3D
fcb $31,$44,$41
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$41,$3D
fcb $25,$41,$41
fcb $25,$41,$44
fcb $25,$41,$3D
fcb $25,$42,$41
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$36
fcb $2A,$3F,$2E
fcb $2A,$3F,$3D
fcb $2A,$3F,$36
fcb $36,$44,$2E
fcb $36,$44,$3D
fcb $36,$44,$3D
fcb $36,$44,$3D
fcb $2B,$44,$3D
fcb $2B,$44,$3D
fcb $2B,$44,$3D
fcb $2B,$44,$3D
fcb $2C,$41,$38
fcb $2C,$41,$30
fcb $2C,$41,$3F
fcb $2C,$41,$38
fcb $2C,$3D,$30
fcb $2C,$3D,$3F
fcb $2C,$3D,$3F
fcb $2C,$3D,$3F
fcb $38,$3D,$3F
fcb $38,$3D,$3F
fcb $38,$3D,$3F
fcb $38,$3D,$3F
fcb $2C,$3D,$3F
fcb $2C,$3D,$3F
fcb $2C,$3D,$3F
fcb $2C,$3D,$3F
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$3A,$3D
fcb $25,$3A,$41
fcb $25,$3A,$44
fcb $25,$3A,$3D
fcb $31,$44,$41
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$3D
fcb $25,$3D,$41
fcb $25,$3D,$44
fcb $25,$3D,$3D
fcb $25,$3D,$41
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $31,$3D,$44
fcb $31,$3D,$44
fcb $31,$3D,$44
fcb $31,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $2A,$49,$44
fcb $2A,$49,$44
fcb $2A,$49,$44
fcb $2A,$49,$44
fcb $2A,$49,$36
fcb $2A,$49,$2E
fcb $2A,$49,$3D
fcb $2A,$49,$36
fcb $36,$3C,$2E
fcb $36,$3C,$3D
fcb $36,$3A,$3D
fcb $36,$3A,$3D
fcb $2B,$44,$3D
fcb $2B,$44,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2C,$44,$38
fcb $2C,$44,$30
fcb $2C,$3A,$3F
fcb $2C,$3A,$38
fcb $2C,$44,$30
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $2C,$3F,$3F
fcb $2C,$3F,$3F
fcb $2C,$3F,$3F
fcb $2C,$3F,$3F
fcb $25,$41,$3F
fcb $25,$41,$3F
fcb $25,$41,$3F
fcb $25,$41,$3F
fcb $25,$42,$3D
fcb $25,$42,$41
fcb $25,$42,$44
fcb $25,$42,$3D
fcb $31,$44,$41
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$49,$44
fcb $25,$49,$44
fcb $25,$49,$44
fcb $25,$49,$44
fcb $25,$49,$3D
fcb $25,$49,$41
fcb $25,$49,$44
fcb $25,$49,$3D
fcb $25,$49,$41
fcb $25,$49,$44
fcb $25,$49,$44
fcb $25,$49,$44
fcb $31,$49,$44
fcb $31,$49,$44
fcb $31,$49,$44
fcb $31,$49,$44
fcb $25,$4E,$44
fcb $25,$4E,$44
fcb $25,$4E,$44
fcb $25,$4E,$44
fcb $2A,$4E,$44
fcb $2A,$4E,$44
fcb $2A,$4E,$44
fcb $2A,$4E,$44
fcb $2A,$4D,$36
fcb $2A,$4D,$2E
fcb $2A,$4D,$3D
fcb $2A,$4D,$36
fcb $36,$49,$2E
fcb $36,$49,$3D
fcb $36,$49,$3D
fcb $36,$49,$3D
fcb $2B,$3A,$3D
fcb $2B,$3A,$3D
fcb $2B,$3A,$3D
fcb $2B,$3A,$3D
fcb $2C,$44,$38
fcb $2C,$44,$30
fcb $2C,$44,$3F
fcb $2C,$44,$38
fcb $2C,$3A,$30
fcb $2C,$3A,$3F
fcb $2C,$3A,$3F
fcb $2C,$3A,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$3A,$3D
fcb $25,$3A,$41
fcb $25,$3A,$44
fcb $25,$3A,$3D
fcb $31,$44,$41
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$3D
fcb $25,$3D,$41
fcb $25,$3D,$44
fcb $25,$3D,$3D
fcb $25,$3D,$41
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $31,$3D,$44
fcb $31,$3D,$44
fcb $31,$3D,$44
fcb $31,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $2A,$49,$44
fcb $2A,$49,$44
fcb $2A,$49,$44
fcb $2A,$49,$44
fcb $2A,$49,$36
fcb $2A,$49,$2E
fcb $2A,$49,$3D
fcb $2A,$49,$36
fcb $36,$4B,$2E
fcb $36,$4B,$3D
fcb $36,$49,$3D
fcb $36,$49,$3D
fcb $2B,$3C,$3D
fcb $2B,$3C,$3D
fcb $2B,$3A,$3D
fcb $2B,$3A,$3D
fcb $2C,$44,$38
fcb $2C,$44,$30
fcb $2C,$3A,$3F
fcb $2C,$3A,$38
fcb $2C,$44,$30
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $2C,$3F,$3F
fcb $2C,$3F,$3F
fcb $2C,$3F,$3F
fcb $2C,$3F,$3F
fcb $25,$41,$3F
fcb $25,$41,$3F
fcb $25,$41,$3F
fcb $25,$41,$3F
fcb $25,$42,$3D
fcb $25,$42,$41
fcb $25,$42,$44
fcb $25,$42,$3D
fcb $31,$44,$41
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$49,$44
fcb $25,$49,$44
fcb $25,$49,$44
fcb $25,$49,$44
fcb $25,$49,$3D
fcb $25,$49,$41
fcb $25,$49,$44
fcb $25,$49,$3D
fcb $25,$49,$41
fcb $25,$49,$44
fcb $25,$49,$44
fcb $25,$49,$44
fcb $31,$49,$44
fcb $31,$49,$44
fcb $31,$49,$44
fcb $31,$49,$44
fcb $25,$4E,$44
fcb $25,$4E,$44
fcb $25,$4E,$44
fcb $25,$4E,$44
fcb $2A,$4E,$44
fcb $2A,$4E,$44
fcb $2A,$4E,$44
fcb $2A,$4E,$44
fcb $2A,$4D,$36
fcb $2A,$4D,$2E
fcb $2A,$4D,$3D
fcb $2A,$4D,$36
fcb $36,$4E,$2E
fcb $36,$4E,$3D
fcb $36,$4E,$3D
fcb $36,$4E,$3D
fcb $2B,$50,$3D
fcb $2B,$50,$3D
fcb $2B,$50,$3D
fcb $2B,$50,$3D
fcb $2C,$50,$38
fcb $2C,$50,$30
fcb $2C,$50,$3F
fcb $2C,$50,$38
fcb $2C,$50,$30
fcb $2C,$50,$3F
fcb $2C,$50,$3F
fcb $2C,$50,$3F
fcb $38,$50,$3F
fcb $38,$50,$3F
fcb $38,$50,$3F
fcb $38,$50,$3F
fcb $2C,$50,$3F
fcb $2C,$50,$3F
fcb $2C,$50,$3F
fcb $2C,$50,$3F
fcb $25,$3D,$00
fcb $25,$3D,$00
fcb $25,$3D,$00
fcb $25,$3D,$00
fcb $25,$3D,$3D
fcb $25,$3D,$41
fcb $25,$3D,$44
fcb $25,$3D,$3D
fcb $31,$49,$41
fcb $31,$49,$44
fcb $31,$49,$44
fcb $31,$49,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$3D
fcb $25,$3D,$41
fcb $25,$3D,$44
fcb $25,$3D,$3D
fcb $25,$3D,$41
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $31,$49,$44
fcb $31,$49,$44
fcb $31,$3D,$44
fcb $31,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $2A,$42,$44
fcb $2A,$42,$44
fcb $2A,$42,$44
fcb $2A,$42,$44
fcb $2A,$42,$36
fcb $2A,$42,$2E
fcb $2A,$42,$3D
fcb $2A,$42,$36
fcb $36,$4E,$2E
fcb $36,$4E,$3D
fcb $36,$4E,$3D
fcb $36,$4E,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2C,$44,$38
fcb $2C,$44,$30
fcb $2C,$44,$3F
fcb $2C,$44,$38
fcb $2C,$44,$30
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $38,$50,$3F
fcb $38,$50,$3F
fcb $38,$50,$3F
fcb $38,$50,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $25,$3D,$3F
fcb $25,$3D,$3F
fcb $25,$3D,$3F
fcb $25,$3D,$3F
fcb $25,$3D,$3D
fcb $25,$3D,$41
fcb $25,$3D,$44
fcb $25,$3D,$3D
fcb $31,$49,$41
fcb $31,$49,$44
fcb $31,$49,$44
fcb $31,$49,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$3D
fcb $25,$3D,$41
fcb $25,$3D,$44
fcb $25,$3D,$3D
fcb $25,$3D,$41
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $31,$49,$44
fcb $31,$49,$44
fcb $31,$3D,$44
fcb $31,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $25,$3D,$44
fcb $2A,$42,$44
fcb $2A,$42,$44
fcb $2A,$42,$44
fcb $2A,$42,$44
fcb $2A,$42,$36
fcb $2A,$42,$2E
fcb $2A,$42,$3D
fcb $2A,$42,$36
fcb $36,$4E,$2E
fcb $36,$4E,$3D
fcb $36,$4E,$3D
fcb $36,$4E,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2C,$44,$38
fcb $2C,$44,$30
fcb $2C,$44,$3F
fcb $2C,$44,$38
fcb $2C,$44,$30
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $38,$50,$3F
fcb $38,$50,$3F
fcb $38,$50,$3F
fcb $38,$50,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $00,$44,$00
fcb $00,$44,$00
fcb $00,$44,$00
fcb $00,$44,$00
fcb $44,$44,$3D
fcb $44,$44,$41
fcb $44,$3A,$44
fcb $44,$3A,$3D
fcb $44,$44,$41
fcb $44,$44,$44
fcb $3A,$44,$44
fcb $3A,$44,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $42,$41,$3D
fcb $42,$41,$41
fcb $42,$41,$44
fcb $42,$41,$3D
fcb $41,$42,$41
fcb $41,$42,$44
fcb $41,$42,$44
fcb $41,$42,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $3F,$41,$36
fcb $3F,$41,$2E
fcb $3F,$41,$3D
fcb $3F,$41,$36
fcb $41,$42,$2E
fcb $41,$42,$3D
fcb $41,$42,$3D
fcb $41,$42,$3D
fcb $42,$42,$3D
fcb $42,$42,$3D
fcb $42,$42,$3D
fcb $42,$42,$3D
fcb $42,$41,$38
fcb $42,$41,$30
fcb $42,$41,$3F
fcb $42,$41,$38
fcb $41,$42,$30
fcb $41,$42,$3F
fcb $41,$42,$3F
fcb $41,$42,$3F
fcb $42,$44,$3F
fcb $42,$44,$3F
fcb $42,$44,$3F
fcb $42,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3F
fcb $44,$44,$3D
fcb $44,$44,$41
fcb $44,$3A,$44
fcb $44,$3A,$3D
fcb $44,$44,$41
fcb $44,$44,$44
fcb $3A,$44,$44
fcb $3A,$44,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $44,$42,$44
fcb $42,$41,$3D
fcb $42,$41,$41
fcb $42,$41,$44
fcb $42,$41,$3D
fcb $41,$42,$41
fcb $41,$42,$44
fcb $41,$42,$44
fcb $41,$42,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $42,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$44,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $44,$3F,$44
fcb $3F,$3F,$36
fcb $3F,$3F,$2E
fcb $3F,$3F,$3D
fcb $3F,$3F,$36
fcb $3F,$44,$2E
fcb $3F,$44,$3D
fcb $3F,$44,$3D
fcb $3F,$44,$3D
fcb $44,$44,$3D
fcb $44,$44,$3D
fcb $44,$44,$3D
fcb $44,$44,$3D
fcb $44,$41,$38
fcb $44,$41,$30
fcb $44,$41,$3F
fcb $44,$41,$38
fcb $41,$3D,$30
fcb $41,$3D,$3F
fcb $41,$3D,$3F
fcb $41,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $3D,$3D,$3F
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$44,$00
fcb $25,$44,$3D
fcb $25,$44,$41
fcb $25,$3A,$44
fcb $25,$3A,$3D
fcb $31,$44,$41
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$41,$3D
fcb $25,$41,$41
fcb $25,$41,$44
fcb $25,$41,$3D
fcb $25,$42,$41
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$41,$36
fcb $2A,$41,$2E
fcb $2A,$41,$3D
fcb $2A,$41,$36
fcb $36,$42,$2E
fcb $36,$42,$3D
fcb $36,$42,$3D
fcb $36,$42,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2B,$42,$3D
fcb $2C,$41,$38
fcb $2C,$41,$30
fcb $2C,$41,$3F
fcb $2C,$41,$38
fcb $2C,$42,$30
fcb $2C,$42,$3F
fcb $2C,$42,$3F
fcb $2C,$42,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $38,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $2C,$44,$3F
fcb $25,$44,$3F
fcb $25,$44,$3F
fcb $25,$44,$3F
fcb $25,$44,$3F
fcb $25,$44,$3D
fcb $25,$44,$41
fcb $25,$3A,$44
fcb $25,$3A,$3D
fcb $31,$44,$41
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$41,$3D
fcb $25,$41,$41
fcb $25,$41,$44
fcb $25,$41,$3D
fcb $25,$42,$41
fcb $25,$42,$44
fcb $25,$42,$44
fcb $25,$42,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $31,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $25,$44,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$44
fcb $2A,$3F,$36
fcb $2A,$3F,$2E
fcb $2A,$3F,$3D
fcb $2A,$3F,$36
fcb $36,$44,$2E
fcb $36,$44,$3D
fcb $36,$44,$3D
fcb $36,$44,$3D
fcb $2B,$44,$3D
fcb $2B,$44,$3D
fcb $2B,$44,$3D
fcb $2B,$44,$3D
fcb $2C,$41,$38
fcb $2C,$41,$30
fcb $2C,$41,$3F
fcb $2C,$41,$38
fcb $2C,$3D,$30
fcb $2C,$3D,$3F
fcb $2C,$3D,$3F
fcb $2C,$3D,$3F
fcb $38,$3D,$3F
fcb $38,$3D,$3F
fcb $38,$3D,$3F
fcb $38,$3D,$3F
fcb $2C,$3D,$3F
fcb $2C,$3D,$3F
fcb $2C,$3D,$3F
fcb $2C,$3D,$3F
endtune2 fcb $80,$80,$80
| 31.965556 | 51 | 0.281484 |
eaabdf2a94889fa62b4b64629780d23480934d1c | 192 | asm | Assembly | libsrc/target/bit90/games/joystick.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/bit90/games/joystick.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/bit90/games/joystick.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
PUBLIC joystick
PUBLIC _joystick
EXTERN joystick_inkey
EXTERN coleco_joypad
joystick:
_joystick:
ld a,l
cp 5
jp c,joystick_inkey
sub 4
ld l,a
jp coleco_joypad
| 10.666667 | 22 | 0.770833 |
f0cc7762385c68a3e2ecb29f27250ca272236207 | 4,370 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1131.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1131.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1131.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x643, %rsi
lea addresses_A_ht+0x1b4c3, %rdi
nop
cmp %r11, %r11
mov $0, %rcx
rep movsq
nop
nop
nop
nop
and %rbp, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %r9
push %rbx
push %rcx
push %rdx
// Store
lea addresses_D+0x17baf, %r14
nop
nop
nop
nop
nop
and $29755, %rbx
mov $0x5152535455565758, %r8
movq %r8, %xmm2
movups %xmm2, (%r14)
nop
cmp $37394, %r14
// Faulty Load
lea addresses_WT+0x18cc3, %r8
nop
nop
xor %r15, %r15
movb (%r8), %dl
lea oracles, %r15
and $0xff, %rdx
shlq $12, %rdx
mov (%r15,%rdx,1), %rdx
pop %rdx
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 2}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 9}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 53.950617 | 2,999 | 0.661785 |
34c269f60ac3ecd297913892c089fd2d664da0c0 | 1,519 | asm | Assembly | programs/oeis/158/A158253.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/158/A158253.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/158/A158253.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A158253: 289n - 1.
; 288,577,866,1155,1444,1733,2022,2311,2600,2889,3178,3467,3756,4045,4334,4623,4912,5201,5490,5779,6068,6357,6646,6935,7224,7513,7802,8091,8380,8669,8958,9247,9536,9825,10114,10403,10692,10981,11270,11559,11848,12137,12426,12715,13004,13293,13582,13871,14160,14449,14738,15027,15316,15605,15894,16183,16472,16761,17050,17339,17628,17917,18206,18495,18784,19073,19362,19651,19940,20229,20518,20807,21096,21385,21674,21963,22252,22541,22830,23119,23408,23697,23986,24275,24564,24853,25142,25431,25720,26009,26298,26587,26876,27165,27454,27743,28032,28321,28610,28899,29188,29477,29766,30055,30344,30633,30922,31211,31500,31789,32078,32367,32656,32945,33234,33523,33812,34101,34390,34679,34968,35257,35546,35835,36124,36413,36702,36991,37280,37569,37858,38147,38436,38725,39014,39303,39592,39881,40170,40459,40748,41037,41326,41615,41904,42193,42482,42771,43060,43349,43638,43927,44216,44505,44794,45083,45372,45661,45950,46239,46528,46817,47106,47395,47684,47973,48262,48551,48840,49129,49418,49707,49996,50285,50574,50863,51152,51441,51730,52019,52308,52597,52886,53175,53464,53753,54042,54331,54620,54909,55198,55487,55776,56065,56354,56643,56932,57221,57510,57799,58088,58377,58666,58955,59244,59533,59822,60111,60400,60689,60978,61267,61556,61845,62134,62423,62712,63001,63290,63579,63868,64157,64446,64735,65024,65313,65602,65891,66180,66469,66758,67047,67336,67625,67914,68203,68492,68781,69070,69359,69648,69937,70226,70515,70804,71093,71382,71671,71960,72249
mov $1,$0
mul $1,289
add $1,288
| 217 | 1,464 | 0.81896 |
51ef7ae97a66cbce7c09f13d5f6e6a6f02a48f29 | 1,979 | asm | Assembly | Transynther/x86/_processed/US/_ht_zr_/i9-9900K_12_0xa0_notsx.log_6_1475.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_ht_zr_/i9-9900K_12_0xa0_notsx.log_6_1475.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_ht_zr_/i9-9900K_12_0xa0_notsx.log_6_1475.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r15
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x82dd, %rsi
lea addresses_WC_ht+0x479d, %rdi
sub %r8, %r8
mov $95, %rcx
rep movsl
nop
nop
sub $2478, %r15
lea addresses_normal_ht+0xd2f7, %r12
nop
nop
nop
nop
nop
sub $61561, %r14
mov (%r12), %r15w
nop
sub $12193, %r12
lea addresses_WC_ht+0xd25d, %rcx
nop
nop
nop
nop
add %r8, %r8
vmovups (%rcx), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r15
nop
nop
nop
nop
nop
add $45464, %r14
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %rax
push %rbp
push %rcx
push %rdi
// Load
lea addresses_RW+0xcb5d, %rax
nop
nop
nop
lfence
movb (%rax), %r10b
nop
cmp $32681, %r12
// Faulty Load
lea addresses_US+0x1c35d, %rbp
nop
nop
nop
sub $36468, %rdi
vmovups (%rbp), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %r15
lea oracles, %rcx
and $0xff, %r15
shlq $12, %r15
mov (%rcx,%r15,1), %r15
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_US', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'44': 4, '00': 2}
00 00 44 44 44 44
*/
| 18.324074 | 152 | 0.651339 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.