hexsha
stringlengths
40
40
size
int64
6
1.05M
ext
stringclasses
3 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
232
max_stars_repo_name
stringlengths
7
106
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
7
max_stars_count
int64
1
33.5k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
232
max_issues_repo_name
stringlengths
7
106
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
7
max_issues_count
int64
1
37.5k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
232
max_forks_repo_name
stringlengths
7
106
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
7
max_forks_count
int64
1
12.6k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
6
1.05M
avg_line_length
float64
1.16
19.7k
max_line_length
int64
2
938k
alphanum_fraction
float64
0
1
f0f8b3911a7ca9d8b535daa98ff27c8c7446114a
446
asm
Assembly
programs/oeis/173/A173246.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/173/A173246.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/173/A173246.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A173246: Expansion of (1+x)^50 * (1-x)/(1 - x^51). ; 1,49,1175,18375,210700,1888460,13771940,83993700,436994250,1968555050,7766844470,27081460630,84045912300,233460867500,582985137700,1312983918820,2672860120455,4923689695575,8206149492625,12352414499425 mov $3,$0 mov $6,2 lpb $6 sub $6,1 add $0,$6 sub $0,1 mov $2,$6 mov $4,50 bin $4,$0 mov $5,$4 lpb $2 mov $1,$5 sub $2,1 lpe lpe lpb $3 sub $1,$5 mov $3,0 lpe
19.391304
203
0.665919
0f365d874c17839856237108f60dad871e8a799e
7,256
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1077.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1077.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1077.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r15 push %r8 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_WT_ht+0x146ff, %r9 nop cmp %r15, %r15 mov (%r9), %r11d nop add $25144, %r8 lea addresses_D_ht+0x1a3af, %rsi lea addresses_UC_ht+0x158ef, %rdi nop nop nop nop nop xor %rax, %rax mov $73, %rcx rep movsb nop nop nop xor $1936, %rax lea addresses_WT_ht+0x792b, %r15 clflush (%r15) nop sub $13655, %r11 mov (%r15), %r8 nop nop nop nop nop add %rdi, %rdi lea addresses_WT_ht+0x8ef, %rax nop nop nop inc %r8 movb (%rax), %cl nop nop xor %r8, %r8 lea addresses_WC_ht+0x6fd7, %r15 nop nop nop nop nop and $40374, %rdi mov $0x6162636465666768, %r8 movq %r8, %xmm5 vmovups %ymm5, (%r15) xor %rdi, %rdi lea addresses_normal_ht+0x20ec, %r11 clflush (%r11) nop nop nop nop nop xor %r8, %r8 movw $0x6162, (%r11) nop nop nop sub $15107, %rdi lea addresses_A_ht+0xd8ef, %r8 nop sub %rax, %rax movups (%r8), %xmm7 vpextrq $1, %xmm7, %rdi nop nop nop and %rcx, %rcx lea addresses_WC_ht+0x8b28, %r8 nop cmp $40160, %rax vmovups (%r8), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $1, %xmm3, %rcx nop nop nop add %r9, %r9 lea addresses_WT_ht+0xbeff, %r11 lfence movb $0x61, (%r11) nop nop nop xor $64761, %r11 lea addresses_A_ht+0x1e6ef, %rsi lea addresses_WT_ht+0x8e17, %rdi clflush (%rsi) nop and %r15, %r15 mov $51, %rcx rep movsl nop dec %rax pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r15 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r8 push %r9 push %rbp push %rcx push %rdi push %rdx push %rsi // Load lea addresses_A+0x9638, %r9 nop inc %rbp mov (%r9), %r8 nop and $53608, %r8 // REPMOV lea addresses_RW+0x13cef, %rsi lea addresses_UC+0x328f, %rdi clflush (%rdi) sub %rdx, %rdx mov $50, %rcx rep movsq nop nop nop nop and $43, %r12 // Load lea addresses_normal+0x106ef, %rbp nop nop nop nop xor %rcx, %rcx movups (%rbp), %xmm7 vpextrq $1, %xmm7, %rdx // Exception!!! nop nop nop nop nop mov (0), %r8 cmp %rdx, %rdx // Faulty Load lea addresses_RW+0x130ef, %rdi clflush (%rdi) nop nop nop nop add %rbp, %rbp movb (%rdi), %r12b lea oracles, %rdx and $0xff, %r12 shlq $12, %r12 mov (%rdx,%r12,1), %r12 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r9 pop %r8 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 4, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_RW', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC', 'congruent': 2, 'same': False}} {'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_normal', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}} {'src': {'same': True, 'congruent': 2, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}} {'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
33.437788
2,999
0.65215
82a9cd2494286d6e9dcc5b80f0c83c4b18fa2ac4
202
asm
Assembly
libsrc/_DEVELOPMENT/string/c/sdcc_iy/strnicmp_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/string/c/sdcc_iy/strnicmp_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/string/c/sdcc_iy/strnicmp_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; int strnicmp_callee(const char *s1, const char *s2, size_t n) SECTION code_clib SECTION code_string PUBLIC _strnicmp_callee EXTERN _strncasecmp_callee defc _strnicmp_callee = _strncasecmp_callee
16.833333
63
0.826733
0dc357961b4d0c9032dbeb4a19c18a4a51842fc6
8,078
asm
Assembly
Gas/Dos/UtilsLib/GasWord.asm
Gabidal/GAS_Pack
02f13531849bc5c03721a4319a9e315a60ba7707
[ "MIT" ]
1
2021-09-21T13:07:37.000Z
2021-09-21T13:07:37.000Z
Gas/Dos/UtilsLib/GasWord.asm
Gabidal/GAS_Pack
02f13531849bc5c03721a4319a9e315a60ba7707
[ "MIT" ]
null
null
null
Gas/Dos/UtilsLib/GasWord.asm
Gabidal/GAS_Pack
02f13531849bc5c03721a4319a9e315a60ba7707
[ "MIT" ]
null
null
null
;THIS IS THE HARD PART! %macro createMatrix 1 %1 times 16 dd 1 %endmacro %macro getFromMatrix 4 %assign location %2+(%3*4) lea esi, %1[location] mov eax,dword [esi] mov %4, eax %endmacro %macro editMatrix 4 %assign location1 %2+(%3*4) lea esi, %1[location1] mov [esi], dword %4 %endmacro %macro multiplyMatrix 4 %assign vecX %2 %assign vecY %3 %assign vecZ %4 ;FIRST ROW getFromMatrix %1, 0, 0, eax Mmul eax, %2 mov ecx, eax getFromMatrix %1, 0, 1, eax Mmul eax, %2 add ecx, eax getFromMatrix %1, 0, 2, eax Mmul eax, %2 add ecx, eax getFromMatrix %1, 0, 3, eax Mmul eax, %2 add ecx, eax push ecx ;SECOND ROW getFromMatrix %1, 1, 0, eax Mmul eax, %3 mov ecx, eax getFromMatrix %1, 1, 1, eax Mmul eax, %3 add ecx, eax getFromMatrix %1, 1, 2, eax Mmul eax, %3 add ecx, eax getFromMatrix %1, 1, 3, eax Mmul eax, %3 add ecx, eax push ecx ;TIRD ROW getFromMatrix %1, 2, 0, eax Mmul eax, %4 mov ecx, eax getFromMatrix %1, 2, 1, eax Mmul eax, %4 add ecx, eax getFromMatrix %1, 2, 2, eax Mmul eax, %4 add ecx, eax getFromMatrix %1, 2, 3, eax Mmul eax, %4 add ecx, eax push ecx editMatrix %1, 3, 3, 1 %endmacro %macro rotateMatrixX 3 editMatrix %1, 0, 0, 1 cos %2, eax, %3 editMatrix %1, 1, 1, eax sin %2, eax, %3%3 negate eax editMatrix %1, 2, 1, eax sin %2, eax, %3%3%3 editMatrix %1, 1, 2, eax cos %2, eax, %3%3%3%3 editMatrix %1, 2, 2, eax editMatrix %1, 3, 3, 1 %endmacro %macro rotateMatrixY 3 cos %2, eax, %3 editMatrix %1, 0, 0, eax sin %2, eax, %3%3 negate eax editMatrix %1, 2, 0, eax editMatrix %1, 1, 1, 1 sin %1, eax, %3%3%3 editMatrix %1, 0, 2, eax cos %2, eax, %3%3%3%3 editMatrix %1, 2, 2, eax editMatrix %1, 3, 3, 1 %endmacro %macro rotateMatrixZ 3 cos %2, eax, %3 editMatrix %1, 0, 0, eax sin %2, eax, %3%3 negate eax editMatrix %1, 1, 0, eax sin %2, eax, %3%3%3 editMatrix %1, 0, 1, eax cos %2, eax, %3%3%3%3 editMatrix %1, 1, 1, eax editMatrix %1, 2, 2, 1 editMatrix %1, 3, 3, 1 %endmacro %macro scaleMatrix 4 ;name, x, y, z editMatrix %1, 0, 0, %2 editMatrix %1, 1, 1, %3 editMatrix %1, 2, 2, %4 editMatrix %1, 3, 3, 1 %endmacro %macro translateMatrix 4 scaleMatrix %1, 1, 1, 1 editMatrix %1, 3, 0, %2; x editMatrix %1, 3, 1, %3; y editMatrix %1, 3, 2, %4; z %endmacro %macro identifyMatrix 1 scaleMatrix %1, 1, 1, 1 %endmacro %macro combineMatrix 3 getFromMatrix %1, 0, 0, eax getFromMatrix %2, 0, 0, ebx Mmul eax, bx getFromMatrix %2, 1, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 0, 0, eax ;next getFromMatrix %1, 1, 0, eax getFromMatrix %2, 0, 0, ebx Mmul eax, bx getFromMatrix %2, 1, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 1, 0, eax ;next getFromMatrix %1, 2, 0, eax getFromMatrix %2, 0, 0, ebx Mmul eax, bx getFromMatrix %2, 1, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 2, 0, eax ;next getFromMatrix %1, 3, 0, eax getFromMatrix %2, 0, 0, ebx Mmul eax, bx getFromMatrix %2, 1, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 0, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 3, 0, eax ;NEXT ROW getFromMatrix %1, 0, 1, eax getFromMatrix %2, 0, 1, ebx Mmul eax, bx getFromMatrix %2, 1, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 0, 1, eax ;next getFromMatrix %1, 1, 1, eax getFromMatrix %2, 0, 1, ebx Mmul eax, bx getFromMatrix %2, 1, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 1, 1, eax ;next getFromMatrix %1, 2, 1, eax getFromMatrix %2, 0, 1, ebx Mmul eax, bx getFromMatrix %2, 1, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 2, 1, eax ;next getFromMatrix %1, 3, 1, eax getFromMatrix %2, 0, 1, ebx Mmul eax, bx getFromMatrix %2, 1, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 1, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 3, 1, eax ;NEXT ROW getFromMatrix %1, 0, 2, eax getFromMatrix %2, 0, 2, ebx Mmul eax, bx getFromMatrix %2, 1, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 0, 2, eax ;next getFromMatrix %1, 1, 2, eax getFromMatrix %2, 0, 2, ebx Mmul eax, bx getFromMatrix %2, 1, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 1, 2, eax ;next getFromMatrix %1, 2, 2, eax getFromMatrix %2, 0, 2, ebx Mmul eax, bx getFromMatrix %2, 1, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 2, 2, eax ;next getFromMatrix %1, 3, 2, eax getFromMatrix %2, 0, 2, ebx Mmul eax, bx getFromMatrix %2, 1, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 2, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 3, 2, eax ;NEXT ROW getFromMatrix %1, 0, 3, eax getFromMatrix %2, 0, 3, ebx Mmul eax, bx getFromMatrix %2, 1, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 0, 3, eax ;next getFromMatrix %1, 1, 3, eax getFromMatrix %2, 0, 3, ebx Mmul eax, bx getFromMatrix %2, 1, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 1, 3, eax ;next getFromMatrix %1, 2, 3, eax getFromMatrix %2, 0, 3, ebx Mmul eax, bx getFromMatrix %2, 1, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 2, 3, eax ;next getFromMatrix %1, 3, 3, eax getFromMatrix %2, 0, 3, ebx Mmul eax, bx getFromMatrix %2, 1, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 2, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx getFromMatrix %2, 3, 3, ebx Mmul ecx, bx sum eax, ecx clean ecx editMatrix %3, 3, 3, eax ;NEXT ROW %endmacro
20.044665
30
0.587398
5fea3e80e3cc3267e6c8bb7c0ab746cf32b56031
266
asm
Assembly
programs/oeis/057/A057071.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/057/A057071.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/057/A057071.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A057071: floor[9^9/n]. ; 387420489,193710244,129140163,96855122,77484097,64570081,55345784,48427561,43046721,38742048,35220044,32285040,29801576,27672892,25828032,24213780,22789440,21523360,20390552,19371024,18448594 add $0,1 mov $1,387420489 div $1,$0 mov $0,$1
33.25
193
0.804511
7d8be95a706a2473d5df4d91ca11a90f2ac63fb5
7,586
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_1299.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_1299.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_1299.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r12 push %r15 push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x2e4, %r12 sub $42085, %rbx vmovups (%r12), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $1, %xmm5, %r10 nop nop nop sub %rbx, %rbx lea addresses_WC_ht+0x1935a, %r10 dec %rcx mov (%r10), %r15d nop cmp $13802, %rbx lea addresses_D_ht+0xc9aa, %rsi lea addresses_normal_ht+0x1650a, %rdi and $4762, %r11 mov $43, %rcx rep movsw nop nop nop nop nop add $47346, %rbx lea addresses_WC_ht+0x1e40a, %rsi lea addresses_UC_ht+0xf266, %rdi nop cmp $27378, %r12 mov $0, %rcx rep movsl nop nop and %rdi, %rdi lea addresses_D_ht+0x1230a, %r15 nop nop nop and $64143, %rdi movl $0x61626364, (%r15) nop nop nop nop sub $4632, %r10 lea addresses_UC_ht+0xd90a, %rsi lea addresses_normal_ht+0xbd0a, %rdi nop nop nop nop nop xor $25535, %r11 mov $57, %rcx rep movsb nop nop add $45796, %r12 lea addresses_WC_ht+0x16b1a, %r15 nop inc %rbx movb (%r15), %r10b nop nop cmp %rsi, %rsi lea addresses_A_ht+0x310a, %rsi lea addresses_UC_ht+0x6c8a, %rdi nop nop nop and $9274, %r10 mov $43, %rcx rep movsl nop nop nop nop inc %r12 lea addresses_UC_ht+0x1bb80, %r10 nop mfence mov $0x6162636465666768, %rbx movq %rbx, (%r10) dec %rsi lea addresses_normal_ht+0x1a50a, %rsi lea addresses_A_ht+0x17e0a, %rdi nop nop sub %r11, %r11 mov $10, %rcx rep movsw nop nop sub $45055, %r12 lea addresses_D_ht+0x1760a, %rsi lea addresses_normal_ht+0x1c474, %rdi nop nop nop nop nop and %r15, %r15 mov $100, %rcx rep movsw nop nop nop nop nop xor %r10, %r10 pop %rsi pop %rdi pop %rcx pop %rbx pop %r15 pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r15 push %r8 push %rcx push %rdx // Load lea addresses_D+0x8d8a, %r15 clflush (%r15) cmp %r13, %r13 mov (%r15), %r8w nop nop nop nop xor %rdx, %rdx // Store lea addresses_D+0x132ae, %r11 nop sub %rdx, %rdx mov $0x5152535455565758, %rcx movq %rcx, %xmm4 movaps %xmm4, (%r11) nop nop nop nop cmp %rcx, %rcx // Store lea addresses_WC+0x104f2, %r13 nop nop nop nop nop and $37005, %r12 movb $0x51, (%r13) add %r15, %r15 // Faulty Load lea addresses_WC+0xdd0a, %r12 nop nop nop nop nop xor %rcx, %rcx mov (%r12), %r13w lea oracles, %rcx and $0xff, %r13 shlq $12, %r13 mov (%rcx,%r13,1), %r13 pop %rdx pop %rcx pop %r8 pop %r15 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 7, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': True, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': True, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': True, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, '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 */
34.171171
2,999
0.658186
4543f25b11810102a3af21a2d58410dab155585c
58,510
asm
Assembly
Appl/FileMgrs/CommonDesktop/CUtil/cutilFileOpHigh.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Appl/FileMgrs/CommonDesktop/CUtil/cutilFileOpHigh.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Appl/FileMgrs/CommonDesktop/CUtil/cutilFileOpHigh.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @---------------------------------------------------------------------- Copyright (c) GeoWorks 1994 -- All Rights Reserved PROJECT: PC GEOS MODULE: Desktop/Util FILE: cutilFileOpHigh.asm ROUTINES: INT CopyMoveFileToDir - common routine to do high-level move/copy INT DeskFileCopy - copy file or directory!! INT FileCopyFile - copy single file INT DeskFileMove - move file or directory!! INT FileMoveFile - move single file INT FileCopyMoveDir - recursively move/copy directory INT GetNextFilename - parse filename list REVISION HISTORY: Name Date Description ---- ---- ----------- dlitwin 10/10/94 Broken out of cutilFileOp.asm DESCRIPTION: This file contains desktop utility routines. $Id: cutilFileOpHigh.asm,v 1.2 98/06/03 13:51:03 joon Exp $ ------------------------------------------------------------------------------@ FileOpLow segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VerifyMenuDeleteThrowAway %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: use high-level verification of delete if "confirm delete single" option is set CALLED BY: ProcessDragFilesCommon PASS: ax - MSG_FM_START_DELETE or MSG_FM_START_THROW_AWAY RETURN: carry clear if okay to continue delete carry set to cancel delete DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 06/07/90 broken out of FolderStartDelete for use in TreeStartDelete dlitwin 06/01/92 made it general for throw away and delete dlitwin 07/01/92 new three stage delete warnings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VerifyMenuDeleteThrowAway proc far if (not _FCAB and not _ZMGR) uses ax, bx, cx, dx, di, si, bp .enter push ax ; save incoming message GM< mov bx, handle OptionsDeleteWarnings > GM< mov si, offset OptionsDeleteWarnings > GM< mov cx, mask OMI_SINGLE_WARNING > GM< mov ax, MSG_GEN_BOOLEAN_GROUP_IS_BOOLEAN_SELECTED > GM< call ObjMessageCall > GM< pop ax ; restore incoming mesage > GM< jnc done ; no high-level confirm > GM< ; (continue delete) > ND< mov bx, handle FileDeleteOptionsGroup > ND< mov si, offset FileDeleteOptionsGroup > ND< mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION > ND< call ObjMessageCall > ND< cmp ax, OCDL_SINGLE > ND< pop ax > ND< jne continueDelete ; no high-level confirm > ND< ; (continue delete) > cmp ax, MSG_FM_START_DELETE mov ax, WARNING_DELETE_ITEMS ; else, give high-level confirm je gotWarningMsg mov ax, WARNING_THROW_AWAY_ITEMS ; else, give high-level confirm gotWarningMsg: call DesktopYesNoWarning cmp ax, YESNO_YES ; delete? stc ; assume cancel jne done ; nope, cancel ND<continueDelete:> clc ; else, return carry clear done: .leave else clc ; File Cabinet and Zoomer are always in "full" mode endif ; ((not _FCAB) and (not _ZMGR) and (not _NIKE)) ret VerifyMenuDeleteThrowAway endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MenuMoveCommon, MenuCopyCommon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: handle file move/copy from menu CALLED BY: INTERNAL FolderStartMove FolderStartCopy TreeStartMove TreeStartCopy PASS: bx = file list buffer RETURN: errors handled DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 05/08/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ MenuMoveCommon proc far mov ax, handle MoveToEntry mov si, offset MoveToEntry mov bp, mask CQNF_MOVE call MenuMoveCopyCommon ret MenuMoveCommon endp if not _FCAB MenuRecoverCommon proc far push ds mov cx, PATH_BUFFER_SIZE sub sp, cx mov dx, ss mov bp, sp push bx ; save file list block mov ax, MSG_GEN_FILE_SELECTOR_GET_DESTINATION_PATH mov bx, handle RecoverToEntry mov si, offset RecoverToEntry call ObjMessageCall ; dx:bp = path, cx = disk handle pop bx ; restore file list block mov ds, dx mov si, bp mov dx, cx ; put disk handle in dx call IsThisInTheWastebasket pop ds jc inWastebasket add sp, PATH_BUFFER_SIZE mov ax, handle RecoverToEntry mov si, offset RecoverToEntry mov bp, mask CQNF_MOVE call MenuMoveCopyCommon jmp exit inWastebasket: add sp, PATH_BUFFER_SIZE mov ax, ERROR_RECOVER_TO_WASTEBASKET call DesktopOKError exit: ret MenuRecoverCommon endp endif ; if (not _FCAB) MenuCopyCommon proc far mov ax, handle CopyToEntry mov si, offset CopyToEntry mov bp, mask CQNF_COPY call MenuMoveCopyCommon ret MenuCopyCommon endp ; ; pass: ; ax:si = file selector for destination ; bp = mask CQNF_MOVE for move ; or ; mask CQNF_COPY for copy ; bx = file list transfer buffer ; MenuMoveCopyCommon proc near ; ; set up parameters for move ; mov cx, PATH_BUFFER_SIZE sub sp, cx mov dx, sp push bp ; save move/copy flag push bx ; save file list buffer mov bp, dx mov dx, ss mov bx, ax ; bx:si = file selector mov ax, MSG_GEN_FILE_SELECTOR_GET_DESTINATION_PATH call ObjMessageCall ; dx:bp = path, cx = disk handle ; ; move files ; pop bx ; bx = file list buffer mov ds, dx ; ds:si = dest. path mov si, bp pop ax ; ax = move/copy flag jcxz done ; => no path, so do nothing mov dx, cx ; dx = dest. disk handle mov cx, 1 ; bx is heap block mov bp, ax ; pass file move/copy flag push bx if not _FCAB call IsThisInTheWastebasket jnc notTheWastebasket mov {byte} ss:[usingWastebasket], WASTEBASKET_WINDOW notTheWastebasket: endif ; if (not _FCAB) call ProcessDragFilesCommon ; (handles/reports errors) mov {byte} ss:[usingWastebasket], NOT_THE_WASTEBASKET pop bx done: call MemFree ; free file list buffer add sp, PATH_BUFFER_SIZE ret MenuMoveCopyCommon endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetQuickTransferMethod %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: determine whether quick transfer move or copy should be done CALLED BY: INTERNAL DriveToolCopyMoveFiles (FileOperation) DesktopDirToolQTInternal (FileOperation) FolderUpDirQT (FileOperation) PASS: dx = destination disk handle bx = file list block RETURN: carry - set on error - clear otherwise bp = mask CQNF_MOVE or mask CQNF_COPY depending on (src = dest) DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 05/31/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetQuickTransferMethod proc far uses ax, cx, dx, es .enter call MemLock mov es, ax call ShellGetRemoteFlagFromFQT tst ax jz fileIsLocal call MemUnlock jmp setToCopy fileIsLocal: call ShellGetTrueDiskHandleFromFQT call MemUnlock jnc noError call DesktopOKError stc ; carry - set jmp done noError: test dx, DISK_IS_STD_PATH_MASK jz compareThem NOFXIP< segmov es, <segment idata>, dx > FXIP< mov dx, bx > FXIP< GetResourceSegmentNS dgroup, es, TRASH_BX > FXIP< mov bx, dx > mov dx, es:[geosDiskHandle] ; SP's are on the system disk compareThem: cmp cx, dx mov bp, mask CQNF_MOVE clc ; clear out error flag je done setToCopy: mov bp, mask CQNF_COPY done: .leave ret GetQuickTransferMethod endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% StuffUIFAIntoFileList %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: store UIFA flags into file list header CALLED BY: INTERNAL ProcessDragFilesListItem ProcessTreeDragItem PASS: bx:ax = VM block containing file list dh = UIFA flags RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 06/26/90 Initial version dloft 10/7/92 Changed dx to dh so as not to dork the BATransferType record. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ StuffUIFAIntoFileList proc far uses ax, es, bp .enter call VMLock mov es, ax mov es:[FQTH_UIFA].high, dh call VMUnlock .leave ret StuffUIFAIntoFileList endp if not _FCAB FileOpLow ends PseudoResident segment resource ; Moved this here so that FileOpLow isn't loaded on startup -chrisb COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% IsThisInTheWastebasket %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Checks if the destination path (dx,ds:si) is the Wastebasket or if it is in the Wastebasket CALLED BY: FolderUpDirQT (FolderClass) ProcessDragFileListItem (FolderClass) ProcessTreeDragItem (TreeClass) DesktopDirToolQTInternal DriveToolCopyMoveFiles MenuMoveCopyCommon ({Folder,Tree}Start{Move,Copy}) PASS: ds:si = pathname dx = disk handle RETURN: carry set if path is the Wastebasket or in the Wastebasket zero flag set if it is the Wastebasket itself and not a subdir DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- dlitwin 5/27/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ IsThisInTheWastebasket proc far uses ax, bx, cx, dx, bp, di, si, es, ds .enter mov cx, size PathName mov bp, sp ; save pre-stack-buf. position sub sp, cx ; allocate stack buffer segmov es, ss, di mov di, sp ; es:di is destination buffer mov bx, dx ; bx, ds:si is source path clr dx ; no drive name requested call FileConstructActualPath mov di, sp ; reset es:di to buffer start call FileParseStandardPath ; bx, es:di is path to parse cmp ax, SP_WASTE_BASKET clc ; assume not equal jne exit SBCS < cmp {byte} es:[di], 0 > DBCS < cmp {wchar}es:[di], 0 > je setZeroFlag ; if no tail path SBCS < cmp {word} es:[di], C_BACKSLASH or (0 shl 8) > DBCS < cmp {wchar}es:[di], C_BACKSLASH > DBCS < jne haveTail > DBCS < cmp {wchar}es:[di][2], 0 > je setZeroFlag ; if no tail path DBCS <haveTail: > cmp ax, SP_TOP ; we know its SP_WASTE_BASKET jmp doneZeroFlag ; so this will clear z flag setZeroFlag: sub ax, ax ; sets zero flag doneZeroFlag: stc exit: mov sp, bp ; pop path buffer off stack .leave ret IsThisInTheWastebasket endp PseudoResident ends FileOpLow segment resource endif ;if (not _FCAB) COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ProcessDragFilesCommon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: common handler for move/copy of files being quick transfer'ed CALLED BY: INTERNAL FolderUpDirQT (FolderClass) ProcessDragFileListItem (FolderClass) ProcessTreeDragItem (TreeClass) DesktopDirToolQTInternal DriveToolCopyMoveFiles MenuMoveCopyCommon ({Folder,Tree}Start{Move,Copy}) PASS: ds:si = destination pathname for move/copy dx = disk handle of destination disk bp = mask CQNF_MOVE for move or mask CQNF_COPY for copy bx:ax = (VM file):(VM block) of quick transfer file list block OR bx = memory block handle of quick transfer file list block cx = 0 if bx:ax = VM block <> 0 if bx = memory block RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 01/19/90 broken out for common use %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ messageTable word \ 0, ; FOPT_NONE MSG_SHELL_OBJECT_DELETE, ; FOPT_DELETE MSG_SHELL_OBJECT_THROW_AWAY, ; FOPT_THROW_AWAY MSG_SHELL_OBJECT_COPY, ; FOPT_COPY MSG_SHELL_OBJECT_MOVE ; FOPT_MOVE .assert (size messageTable eq FileOperationProgressTypes) ProcessDragFilesCommon proc far quickNotifyFlags local ClipboardQuickNotifyFlags \ push bp if GPC_FOLDER_WINDOW_MENUS destIsDesktop local word endif .enter pusha ; save VM block handle, block type mov cx, ds call MemSegmentToHandle ; cx = handle EC < ERROR_NC -1 > push cx ; save block handle mov ax, ACTIVE_TYPE_FILE_OPERATION call DesktopMarkActive ; application will be active call MemDerefStackDS ; flags preserved popa ; retrieve VM block handle, block type LONG jnz realExit ; detaching already, do nothing call FileBatchChangeNotifications ; batch them all up, please ; as we don't want to consume ; billions of handles call IndicateBusy call InitForWindowUpdate ; ; whatever the operation, clear recursive error flag - brianc 5/24/93 ; mov ss:[recurErrorFlag], 0 if GPC_FOLDER_WINDOW_MENUS mov ss:[destIsDesktop], 0 ; ; enforce no dragging to non-document/non-floppy folders ; ds:si = dest path, dx = dest disk handle ; if GPC_DEBUG_MODE cmp ss:[debugMode], TRUE je allowDragTo endif push ax ; (+1) ; allow if on floppy or add-on drive (i.e. have Desktop drive icon) push bx mov bx, dx call checkFloppy pop bx jnc allowDragToPop ; don't allow if not under document directory push cx mov cx, SP_DOCUMENT call checkUnderSP pop cx jc dontAllowDragTo ; error, don't allow drag .assert (PCT_EQUAL lt PCT_SUBDIR) cmp al, PCT_SUBDIR jbe allowDragToPop ; is doc/under doc, allow drag ; allow if top-level wastebasket push cx mov cx, dx ; pass cx, ds:si call UtilCheckIfWasteDir ; carry set if so pop cx jc allowDragToPop ; allow if Desktop push cx mov cx, dx ; pass cx, ds:si call UtilCheckIfDesktopDir ; carry set if so lahf mov ss:[destIsDesktop], ax ; store for later pop cx jc allowDragToPop dontAllowDragTo: pop ax ; (-1) mov ax, ERROR_DRAG_NOT_ALLOWED ; generic drag error jmp preError allowDragToPop: pop ax ; (-1) allowDragTo: endif ; ; set destination directory as current directory ; push bx, ax ; save file list block handle mov bx, dx mov dx, si ; ds:dx = destination dir mov di, bx ; save diskhandle in di call FileSetCurrentPath pop bx, dx ; retrieve file list block jnc noError ; if no error, continue ND< call NDCheckIfDriveLink > preError:: call DesktopOKError ; else, report error jmp exit ; then quit noError: mov ax, dx ; bx:ax = VM transfer item ; ; go through filenames ; jcxz lockVMBlock push bx ; save mem handle for unlocking call MemLock ; ax = segment jmp short lockCommon lockVMBlock: mov di, bp ; save frame pointer call VMLock ; ax = segment, bp = mem handle push bp ; save mem handle for unlocking mov bp, di ; retrieve frame pointer lockCommon: push cx ; save block flag mov ds, ax ; ds = file list block if GPC_FOLDER_WINDOW_MENUS ; ; enforce no dragging from non-document/non-floppy folders ; ds:FQTH_diskHandle, ds:FQTH_pathname = source folder ; if GPC_DEBUG_MODE cmp ss:[debugMode], TRUE je allowDragFrom endif ; disallow if dragging directory _to_ desktop call checkFolderDragged jnc notDirToDesktop test ss:[destIsDesktop], mask CPU_CARRY shl 8 ; C if desktop dest jnz dontAllowDragFrom notDirToDesktop: ; allow if on floppy or add-on drive (i.e. have Desktop drive icon) push bx, si lea si, ds:[FQTH_pathname] mov bx, ds:[FQTH_diskHandle] call checkFloppy pop bx, si jnc allowDragFrom ; allow if from Desktop push cx, si lea si, ds:[FQTH_pathname] mov cx, ds:[FQTH_diskHandle] ; pass cx, ds:si call UtilCheckIfDesktopDir ; carry set if so pop cx, si jc allowDragFrom ; allow if from top-level wastebasket push cx, si lea si, ds:[FQTH_pathname] mov cx, ds:[FQTH_diskHandle] ; pass cx, ds:si call UtilCheckIfWasteDir ; carry set if so pop cx, si jc allowDragFrom ; don't allow if not under document directory push cx, dx, si lea si, ds:[FQTH_pathname] mov dx, ds:[FQTH_diskHandle] mov cx, SP_DOCUMENT call checkUnderSP pop cx, dx, si jc dontAllowDragFrom ; error, don't allow drag if GPC_PRESERVE_ARCHIVE cmp al, PCT_EQUAL jne notArchive call checkArchiveDragged jc dontAllowDragFrom ; contains Archive, no drag notArchive: endif .assert (PCT_EQUAL lt PCT_SUBDIR) cmp al, PCT_SUBDIR jbe allowDragFrom ; is doc/under doc, allow drag dontAllowDragFrom: mov ax, ERROR_DRAG_NOT_ALLOWED ; generic drag error call DesktopOKError jmp outtaHere allowDragFrom: endif ; **NewDesk Only** ; If there are items in the incoming list of files that need ; to be handled specially by a NewDesk system object (printer or ; wastebasket etc.) or a BA subclass, this routine breaks each file ; out and calls a subclassable message on it that allows a BA subclass ; to do anything it wants with the special object. ; ND< call NewDeskHandleSpecialObjects > ; ; set up file-operation progress box ; bp = quick method ; (give precendence to force-COPY if both set) ; mov ax, FOPT_COPY ; assume copy test ds:[FQTH_UIFA], (mask UIFA_COPY shl 8) ; explicit copy? jnz 2$ ; yes, use copy test ds:[FQTH_UIFA], (mask UIFA_MOVE shl 8) ; explicit move? jnz 1$ ; yes, use move test quickNotifyFlags, mask CQNF_COPY ; else, implicit copy? jnz 2$ ; yes 1$: mov ax, FOPT_MOVE ; else, move 2$: cmp {byte} ss:[usingWastebasket], NOT_THE_WASTEBASKET je gotType if not _FORCE_DELETE mov ax, FOPT_THROW_AWAY ; Wastebasket is always a move ; ; This code disables Delete override of the Alt key because someone ; might be forcing a move (Alt key as well) and accidentally drop ; a file on the open Wastebasket folder, causing a delete. This ; is the way things were originally spec'ed, but it was decided that ; it is too inconsistent to have Delete Override and the Wastebasket ; Never Saves work only some of the time (only with the Wastebasket ; dir button, which doesn't even exist in NewDesk). ; Comment it back in if it is decided that this is desired. ; ; cmp {byte} ss:[usingWastebasket], WASTEBASKET_WINDOW ; je gotType ; test ds:[FQTH_UIFA], (mask UIFA_MOVE shl 8) jnz deleteOverride ; allow overridding ; OMI_WB_NEVER_SAVES test ds:[FQTH_UIFA], (mask UIFA_COPY shl 8) jnz gotType push ax, bx, cx, dx, bp, si if GPC_FOLDER_WINDOW_MENUS mov bx, handle OptionsList2 mov si, offset OptionsList2 else mov bx, handle OptionsList mov si, offset OptionsList endif mov cx, mask OMI_WB_NEVER_SAVES mov ax, MSG_GEN_BOOLEAN_GROUP_IS_BOOLEAN_SELECTED call ObjMessageCall ; carry set if item set pop ax, bx, cx, dx, bp, si ; ; Blech. GeoManager Menu reviews decided that "Hold Items in WB" ; sounded better than "WB Never Saves", and so this flag means the ; exact opposite of what it says in GMGR. Wizard can't change to ; agree with GMGR, so GMGR will just use this flag but always do ; the opposite. ; if GPC_FOLDER_WINDOW_MENUS jc gotType ; opposite like GM else GM< jc gotType > ND< jnc gotType > endif deleteOverride: endif ; if (not _FORCE_DELETE) mov ax, FOPT_DELETE gotType: ; ; Figure out which message to send, based on the ; FileOperationProgressTypes ; mov dx, ax ; FileOperationProgressTypes mov_tr bx, ax mov ax, cs:[messageTable][bx] ; ; Get the type of the first object in the block, and send the ; message to process similar files ; tst ds:[FQTH_numFiles] jz outtaHere mov si, offset FQTH_files mov si, ds:[si].FOIE_info call UtilGetDummyFromTable ; ^lbx:si - dummy push ax, dx, bp mov cx, ds mov di, mask MF_CALL call ObjMessage pop ax, dx, bp outtaHere: pop cx ; retrieve block flag jcxz vmBlockUnlock pop bx ; bx = mem handle call MemUnlock ; unlock file list mem block jmp exit vmBlockUnlock: mov di, bp ; save frame pointer pop bp ; bp = VM mem handle call VMUnlock ; unlock file list VM block mov bp, di ; restore frame pointer exit: call FinishUpCommon realExit: .leave ret if GPC_FOLDER_WINDOW_MENUS ; pass: bx = disk handle ; ds:si = pathname ; return: carry clear if floppy ; destroys: nothing checkFloppy label near push ax, bx, cx, dx, es, di mov cx, PATH_BUFFER_SIZE sub sp, cx segmov es, ss, di mov di, sp ; es:di = buffer clr dx ; no drive name call FileConstructActualPath ; bx = real disk handle lea sp, es:[di][PATH_BUFFER_SIZE] ; preserves carry jc doneCheckFloppy ; error, not floppy call DiskGetDrive ; al = drive call NDGetDriveLinkIndexBlock ; es = seg, bx = handle jc doneCheckFloppy ; mem error, not floppy call NDDoWeNeedADriveLink ; carry clear if floppy call MemUnlock ; preserves flags doneCheckFloppy: pop ax, bx, cx, dx, es, di retn ; pass: ds:si = pathname ; dx = disk handle ; cx = StandardPath to compare against ; return: carry set if error ; al = PathCompareType for passed path relative to SP_DOCUMENT ; destroys: nothing checkUnderSP label near push bx, cx, dx, es, ds, si, di clr ax push ax ; es:di = null path on stack segmov es, ss, di mov di, sp xchg si, di segxchg ds, es ; path2 = src path call FileComparePathsEvalLinks ; al = result pop di ; clean up stack pop bx, cx, dx, es, ds, si, di retn checkFolderDragged label near push cx mov cx, ds:[FQTH_numFiles] clc ; no folder jcxz doneFolderCheck push si mov si, offset FQTH_files checkFolderDraggedLoop: call UtilCheckInfoEntrySubdir ; C set if so, (handles links) jc doneFolderCheckPop add si, size FileOperationInfoEntry loop checkFolderDraggedLoop clc ; no folder doneFolderCheckPop: pop si doneFolderCheck: pop cx retn if GPC_PRESERVE_ARCHIVE checkArchiveDragged label near push cx mov cx, ds:[FQTH_numFiles] clc ; no Archive jcxz doneArchiveCheck push si, es, di mov si, offset FQTH_files .assert (offset FOIE_name eq 0) segmov es, cs, di mov di, offset dragArchiveFolderName checkArchiveDraggedLoop: push cx clr cx call LocalCmpStrings pop cx stc ; may be Archive je doneArchiveCheckPop add si, size FileOperationInfoEntry loop checkArchiveDraggedLoop clc ; no Archive doneArchiveCheckPop: pop si, es, di doneArchiveCheck: pop cx retn endif ; GPC_PRESERVE_ARCHIVE endif ; GPC_FOLDER_WINDOW_MENUS ProcessDragFilesCommon endp if GPC_FOLDER_WINDOW_MENUS and GPC_PRESERVE_ARCHIVE dragArchiveFolderName TCHAR "Archive",0 endif if _NEWDESK COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NDCheckIfDriveLink %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Checks to see if a file is a drive link. If so it changes the error message accordingly. CALLED BY: ProcessDragFilesCommon PASS: ds:si - path of file di - diskhandle of file ax - error message from FileSetCurrentPath RETURN: ax - new error message if it is a drive link DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- dlitwin 6/ 9/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ NDCheckIfDriveLink proc near uses bx, cx, dx, di, es cmp ax, ERROR_PATH_NOT_FOUND jne dontCheck .enter call FilePushDir push ax, ds ; save error and path mov bx, di segmov ds, cs, dx mov dx, offset rootPath call FileSetCurrentPath ; change dir to root of drive pop ax, ds ; restore error and path jc exit push ax ; save error message mov dx, si ; ds:dx is filename segmov es, ss, di mov cx, size NewDeskObjectType sub sp, cx mov di, sp ; es:di is stack buffer buffer mov ax, FEA_DESKTOP_INFO call FileGetPathExtAttributes mov cx, ds:[di] ; get the file's WOT into cx add sp, size NewDeskObjectType pop ax ; restore error message jc exit cmp cx, WOT_DRIVE jne exit mov ax, ERROR_DRIVE_LINK_TARGET_GONE exit: call FilePopDir .leave dontCheck: ret NDCheckIfDriveLink endp LocalDefNLString rootPath <C_BACKSLASH, 0> endif ; if _NEWDESK COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% WastebasketDeleteFiles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: delete files CALLED BY: INTERNAL FolderStartDelete (same module) TreeStartDelete (diff. module) PASS: bx = mem handle of file list block RETURN: nothing DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 12/18/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ WastebasketDeleteFiles proc far uses ax, bx, cx, dx, bp, di, si, ds, es .enter mov ax, ACTIVE_TYPE_FILE_OPERATION call DesktopMarkActive ; application will be active jnz done call FileBatchChangeNotifications ; batch them all up, please ; as we don't want to consume ; billions of handles call IndicateBusy call InitForWindowUpdate call MemLock push bx mov ds, ax mov_tr cx, ax mov ax, MSG_SHELL_OBJECT_DELETE LoadBXSI DefaultDummy clr di call ObjMessage call FileFlushChangeNotifications pop bx call MemUnlock call FinishUpCommon mov ss:[showDeleteProgress], TRUE ; be sure delete progress is ; enabled when we leave done: .leave ret WastebasketDeleteFiles endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FinishUpCommon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Common code to finish up a multi-file operation CALLED BY: ProcessDragFilesCommon, WastebasketDeleteFiles PASS: nothing RETURN: nothing DESTROYED: ax,bx,cx,dx,si,di,bp,ds,es PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 2/10/93 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FinishUpCommon proc near .enter mov ax, SP_TOP ; just go to top-level call FileSetStandardPath call ClearFileOpProgressBox call IndicateNotBusy call MarkNotActive call FileFlushChangeNotifications .leave ret FinishUpCommon endp if _NEWDESK COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CompressFileQuickTransfer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Given a FileQuickTransfer block remove all entries with no name (null in the name field). *** This routine does not attempt to resize (shrink) the block, just compact the data within the block and update the count of files ***. CALLED BY: NewDeskHandleSpecialObjects PASS: ds - segment of locked down FileQuickTransfer block RETURN: ds - segment of locked down compressed FQT block DESTROYED: bx,cx,dx,si,di,bp,es PSEUDO CODE/STRATEGY: X is end of compressed section Y is begining of chunk to move up to X Z is ending of chunk to move up to X X = find first marked entry no files marked? exit! Y = X loopTop: Y = next unmarked entry or end of list end of list? exit! Z = next marked entry after Y or end of list move entries between Y and Z to X X = X + (|Z - Y|) (increment X to end of compressed) Y = Z jmp loopTop exit! KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- dlitwin 08/18/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CompressFileQuickTransfer proc near uses ax .enter segmov es, ds, ax mov di, offset FQTH_files mov cx, ds:[FQTH_numFiles] mov bp, cx ; keep number of entries in bp jcxz done mov dx, size FileOperationInfoEntry ; di = X, si = Y ; ; X = find first marked entry ; xLoop: cmp {byte} ds:[di].FOIE_name, 0 je xSet add di, dx ; dx is entry size loop xLoop ; ; no files marked? ; jmp done ; exit! xSet: ; ; Y = X ; mov si, di loopTop: ; **** loopTop **** ; Y = next unmarked entry or end of list yLoop: EC < call ECCheckBounds > cmp {byte} ds:[si].FOIE_name, 0 ; is entry marked? jne ySet add si, dx ; go to next entry dec bp ; update file count because loop yLoop ; we just skiped an entry ; end of list? exit! jmp done ySet: mov bx, si ; bx - si is length to copy zLoop: cmp {byte} ds:[bx].FOIE_name, 0 je zSet add bx, dx ; next entry loop zLoop ; reached end of FileQuickTransfer zSet: push cx ; save file entry counter mov cx, bx sub cx, si ; get length to copy into cx ; ; move entries between Y and Z to X ; rep movsb ; ; X (di) is updated properly to be X + |Y - Z| ; Y (si) is updated properly to be Z ; so just loop unless we are done ; pop cx ; restore Y entry position jcxz done ; done,if we moved the last file jmp loopTop done: mov ds:[FQTH_numFiles], bp ; reset to new number of files .leave ret CompressFileQuickTransfer endp endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UtilGetNextInfoEntryOfSameType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Search forward in the FileQuickTransfer block until we find a FileOperationInfoEntry of the same type as the current one. Place a NULL in the filename of the current entry, to signify that we're finished with it. CALLED BY: EXTERNAL PASS: ds:si - FileOperationInfoEntry RETURN: if found: carry clear ds:si - next FileOperationInfoEntry else: carry set DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 11/11/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UtilGetNextInfoEntryOfSameType proc far uses ax,bx,cx,dx .enter mov {byte} ds:[si].FOIE_name, 0 ; ; Figure out where the block ends ; mov ax, ds:[FQTH_numFiles] mov cx, size FileOperationInfoEntry mul cx add ax, offset FQTH_files ; ; Get the type of the current element ; mov bx, ds:[si].FOIE_info ; ; Scan forward for the next element of this type ; searchLoop: add si, size FileOperationInfoEntry cmp si, ax ja notFound cmp ds:[si].FOIE_info, bx jne searchLoop done: .leave ret notFound: stc jmp done UtilGetNextInfoEntryOfSameType endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrepFilenameForError %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Stuff current filename into global area for error reporting (if needed) CALLED BY: ProcessDragFilesCommon PASS: ds:si - filename RETURN: nothingy DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- dlitwin 5/27/92 added this header %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrepFilenameForError proc far uses si, es, di, cx .enter NOFXIP< segmov es, <segment dgroup>, di > FXIP< mov di, bx > FXIP< GetResourceSegmentNS dgroup, es, TRASH_BX > FXIP< mov bx, di > mov di, offset dgroup:fileOperationInfoEntryBuffer mov cx, size fileOperationInfoEntryBuffer rep movsb .leave ret PrepFilenameForError endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CopyMoveFileToDir %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: copies/moves the specified source file/directory into the specified destination directory CALLED BY: ShellObjectMoveCopyEntryCommon PASS: ds:si - FileOperationInfoEntry of source file ds: - FileQuickTransferHeader from which to get src dir current directory is destination directory ax - update strategy (passed on to MarkWindowForUpdate) fileOperationInfoEntryBuffer - 32 and 8.3 source name info RETURN: carry set if error AX - error updates folder window table, if no error ss:[recurErrorFlag] set if recursive operation error preserves ds, dx, es, di, cx, si, bp DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 8/28/89 Initial version brianc 9/8/89 Combined TextCopyFile, TextMoveFile brianc 2/90 rewritten dlitwin 5/22/92 added support for new Wastebasket %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CopyMoveFileToDir proc far updateStrategy local word push ax uses bx, ds, dx, es, di, cx, si .enter mov ss:[enteredFileOpRecursion], 0 ; in case of early error lea dx, ds:[si].FOIE_name call CheckRootSrcOperation ; can't copy/move root LONG jc exit ; if error, handle it if GPC_PRESERVE_DIRECTORIES ; ; don't allow moving system folder ; cmp ss:[fileOpProgressType], FOPT_COPY jne checkOp cmp ss:[debugMode], TRUE ; if debug mode, allow copy je opOkay checkOp: call FilePushDir push dx mov bx, ds:[FQTH_diskHandle] lea dx, ds:[FQTH_pathname] call FileSetCurrentPath pop dx call CheckSystemFolderDestruction call FilePopDir ; (preserves flags) LONG jc exit opOkay: endif if not _FCAB cmp {byte} ss:[usingWastebasket], NOT_THE_WASTEBASKET je doneThrowAwayCheck ; ; If it's a file or link, put up the "throw away file" ; warning, else put up the "throw away directory" warning ; mov ax, WARNING_THROW_AWAY_FILE ; assume file call UtilCheckInfoEntrySubdir jnc gotWastebasketWarning mov ax, WARNING_THROW_AWAY_DIR gotWastebasketWarning: test ds:[si].FOIE_attrs, mask FA_LINK jz haveWarning mov ax, WARNING_THROW_AWAY_LINK haveWarning: call DeleteWarningCommon cmp ax, YESNO_YES je doneThrowAwayCheck stc jc exit doneThrowAwayCheck: endif ; if (not _FCAB) ; ; check if complete destination file spec. specifies an existing ; file, if so, give replace warning if needed ; call CopyMoveExistenceCheck ; do battery of checks jc exit ; if error, exit with err code ;NOTE: we lose update needed for errors deleting existing directory with ;file-busy or access-denied files that are not deleted ;FAIL-CASE: attempt to overwrite directory contain file-in-use. A Folder ;Window on that directory will not get updated to reflect the successfully ;deleted files segmov es, ds lea di, ds:[si].FOIE_name ; copy/move to same name in ; destination ND < cmp {byte} ss:[usingWastebasket], NOT_THE_WASTEBASKET > ND < jne wastebasketThrowsAwayTemplatesTooYouKnow > ND < test ds:[si].FOIE_flags, mask GFHF_TEMPLATE ; force copy if > ND < jnz copyFile ; file is a template > ND <wastebasketThrowsAwayTemplatesTooYouKnow: ; and NOT throwingaway> cmp ss:[fileOpProgressType], FOPT_COPY je copyFile ; if so, do it call DeskFileMove ; move file to dest path jmp afterOp ; handle results copyFile: call DeskFileCopy ; copy file to dest path afterOp: jc exit mov ax, updateStrategy ; retrieve update strategy call MarkWindowForUpdate ; pass ds:dx = source clc exit: .leave ; preserves flags ret CopyMoveFileToDir endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CopyMoveExistenceCheck %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: checks if file exists CALLED BY: CopyMoveFileToDir PASS: ds = FileQuickTransferHeader ds:si = FileOperationInfoEntry of file being moved/copied current directory is destination directory RETURN: carry set if error ax - error code carry clear if source file can be copied to destination DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 02/12/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CopyMoveExistenceCheck proc near uses bx, cx, dx, ds, si, es, di, bp .enter clr ss:[useLocalMoveCopy] ; default to regular copy ; ; check if destination exists ; lea dx, ds:[si].FOIE_name call FileRootGetAttributes ; does file exist in dest.? jnc destExists ; yes cmp ax, ERROR_FILE_NOT_FOUND ; file doesn't exist in dest.? je exitJMP ; correct -- exit with carry ; clear errorExit: stc exitJMP: jmp exit destExists: ND< call NDCheckIfNotReplaceable > ND<LONG jc exit > ; ; Used to check for replacing a parent of the src, but that's handled ; in SetUpCopyMoveParams by the comparison against evilName, which ; was so gracefully set up by CheckSrcDestConflict ; ; We need to check to see if the file we are conflicting with has ; been merged into our directory by the magic or StandardPaths, or ; if it is actually a local file. ; call IsConflictingFileRemote LONG jc exit mov ss:[useLocalMoveCopy], -1 ; ; If the file we are copying is a remote file, then it may conflict ; with itself, as it may be mapped into our destination. In this case ; we want to ignore any warnings (as we are just making a local copy ; of what was already mapped in anyway) and just create a local copy, ; so skip to the end of the routine, and later routines will know what ; to do because we pass them the CLT_REMOTE_SELF value. ; cmp ax, CLT_REMOTE_SELF clc ; no error... LONG je exit ; ; If the file isn't conflicting with itself, it is either local or ; is mapped in from another StandardPath tree, so we want to warn ; the user of an overwrite situation. If it is local, we will delete ; the local file, but still want to force a local copy, as the regular ; copy might wind up conflicting with a mapped in remote file that has ; been exposed by the deletion of the local file that was obscuring it. ; If it is mapped in, we don't actually delete anything, and copy ; locally. Because the mapped in copy will be obscured by the new ; local version (which is a different copy), in the eyes of the user ; it is has been overwriten, and therefore we still want the warning. ; Check the CLT_REMOTE_OTHER or CLT_LOCAL later in the routine when ; we decide whether or not to delete the destination. ; mov bx, ax ; save ConflictLocationType ; across warning ; ; dest exists, ask user if s/he wishes to replace name file ; if (not _FCAB and not _ZMGR) call ReplaceWarning else mov ax, WARNING_REPLACE_32_FILE ; use 32 name call DesktopYesNoWarning endif ; if ((not _FCAB) and (not _ZMGR)) cmp ax, YESNO_YES ; user want to replace? ; (might be DESK_DB_DETACH ; or YESNO_CANCEL) jne errorExit ; they don't, return cancel ; ; user wishes to replace existing file ; cmp bx, CLT_REMOTE_OTHER ; no need to delete dest if it LONG je exit ; is remote... ; ; if not CLT_REMOTE_OTHER, it must be CLT_LOCAL. ; call CheckThatSourceStillExists ; if the source has been LONG jc exit ; deleted, cancel operation ; ; Create a fake FileQuickTransfer block ; ds = FileQuickTransferHeader (move/copy source path) ; ds:si = FileOperationInfoEntry (move/copy source filename) ; destination for move/copy = current dir ; push bx, cx, ds, si mov ax, size FileQuickTransferHeader + size FileOperationInfoEntry mov cx, ALLOC_DYNAMIC_LOCK call MemAlloc ; bx = handle, ax = segment jnc noMemErr mov ax, ERROR_INSUFFICIENT_MEMORY jmp removeExit noMemErr: push ds, si ; save incoming FOIE push bx ; save buffer handle mov ds, ax mov ds:[FQTH_nextBlock], 0 mov ds:[FQTH_UIFA], 0 ; feedback data and remote flag don't matter because this ; won't be used with a QuickTransfer, just internally. mov ds:[FQTH_numFiles], 1 mov si, offset FQTH_pathname mov cx, size FQTH_pathname call FileGetCurrentPath ; bx = disk handle mov ds:[FQTH_diskHandle], bx pop bx ; retreive buffer handle segmov es, ds ; es:di = FOIE_name mov di, offset FQTH_files pop ds, si ; ds:si = incoming FOIE .assert (offset FOIE_name eq 0) mov cx, size FOIE_name/2 rep movsw ; copy source name over segmov ds, es ; ds = new FQTH mov ds:[FQTH_files].FOIE_flags, 0 mov ds:[FQTH_files].FOIE_info, 0 sub sp, 3 * size FileExtAttrDesc mov di, sp segmov es, ss mov es:[di].FEAD_attr, FEA_FILE_TYPE mov es:[di].FEAD_value.segment, ds mov es:[di].FEAD_value.offset, offset FQTH_files.FOIE_type mov es:[di].FEAD_size, size GeosFileType add di, size FileExtAttrDesc mov es:[di].FEAD_attr, FEA_FILE_ATTR mov es:[di].FEAD_value.segment, ds mov es:[di].FEAD_value.offset, offset FQTH_files.FOIE_attrs mov es:[di].FEAD_size, size FileAttrs add di, size FileExtAttrDesc mov es:[di].FEAD_attr, FEA_PATH_INFO mov es:[di].FEAD_value.segment, ds mov es:[di].FEAD_value.offset, offset FQTH_files.FOIE_pathInfo mov es:[di].FEAD_size, size DirPathInfo mov di, sp mov cx, 3 mov ax, FEA_MULTIPLE mov dx, offset FQTH_files.FOIE_name call FileGetPathExtAttributes EC < WARNING_C WARNING_FILE_ERROR_IGNORED > add sp, 3 * size FileExtAttrDesc ; ; Turn off delete progress if thing being deleted is a file. ; If it's a directory, it will get turned on again by ; FileDeleteFileDirCommon, which is OK, I suppose... ; mov ss:[showDeleteProgress], FALSE mov cx, ss:[fileOpProgressType] mov ax, FOPT_DELETE call SetFileOpProgressBox mov si, offset FQTH_files ; ds:si = new FOIE call ForceFileDeleteFileDir ; else, del dest ; return with error status ; (might be "cancel") pushf call MemFree ; free created FQTH call RemoveFileOpProgressBox push ax mov_tr ax, cx call SetFileOpProgressBox pop ax popf removeExit: pop bx, cx, ds, si exit: .leave ret CopyMoveExistenceCheck endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckThatSourceStillExists %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: If the source file has been deleted for some reason, we don't want to delete the destination and then fail on the copy or move. Better to just bail out entirely. CALLED BY: CopyMoveExistenceCheck PASS: ds = segment of FileQuickTransferBlock of source ds:dx = filename of source RETURN: carry = set if source has been deleted = clear if source is still there DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- dlitwin 8/ 6/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CheckThatSourceStillExists proc near uses bx .enter call FilePushDir push dx ; save filename offset mov bx, ds:[FQTH_diskHandle] lea dx, ds:[FQTH_pathname] call FileSetCurrentPath pop dx ; restore filename offset jc exit ; bail if there were any ; problems setting the path call FileRootGetAttributes ; does source exist? ; carry will be set if there exit: ; is any problem finding the call FilePopDir ; file .leave ret CheckThatSourceStillExists endp if _NEWDESK COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NDCheckIfNotReplaceable %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Checks a file's WOT to see if this is a candidate for being replaced by another file. Only WOT_FOLDER, WOT_DOCUMENT and WOT_EXECUTABLE may be replaced. CALLED BY: CopyMoveExistenceCheck PASS: ds:dx = filename of item to check RETURN: carry = set if this item may not be replaced ax = ERROR_CANNOT_OVERWRITE_THIS_WOT = clear if it may be replaced DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- dlitwin 8/ 5/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ NDCheckIfNotReplaceable proc near uses bx,cx,dx,si,di,bp .enter segmov es, ss mov bp, sp ; preserve old stack mov cx, size NewDeskObjectType sub sp, cx mov di, sp mov ax, FEA_DESKTOP_INFO call FileGetPathExtAttributes mov bx, es:[di] ; put WOT in bx mov sp, bp ; reset stack jnc checkWOT ; ; if we can't fetch a WOT, this file doesn't have extended ; attributes and therefore is not something we have to worry ; about overwriting. If it failed for other reasons, go ahead ; and error for that reason. ; cmp ax, ERROR_ATTR_NOT_FOUND je okToOverwrite jmp doNotOverwrite checkWOT: cmp bx, WOT_FOLDER je okToOverwrite cmp bx, WOT_DOCUMENT je okToOverwrite cmp bx, WOT_EXECUTABLE je okToOverwrite mov ax, ERROR_CANNOT_OVERWRITE_THIS_WOT doNotOverwrite: stc ; any other WOT's are sacred jmp exit okToOverwrite: clc exit: .leave ret NDCheckIfNotReplaceable endp endif ; if _NEWDESK COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% IsConflictingFileRemote %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Checks to see if the file that we have a conflict with is a local file, or if it is remote (mapped in because of the StandardPath merging of trees). If it is remote, there is the posiblity that it is our source file, should our source be in a tree that is being mapped to our destination. In this case we don't want to warn the user of an overwrite, as we are just copying the same verion that they see in the destination to actually *be* in the destination instead of being mapped there, and want to copy/move the file to the local destination. If it is not our source file, then we want to warn the user of an overwrite because the file being moved/copied in will obscure the copy that was being mapped in, effectively 'overwriting' it. We then want to copy/move it to the local destination. Should the conflicting file be local, we want to delete it, but still want to use the FileCopyLocal routine, as the deletion of the local file might reveal a mapped in remote file that would cause a regular move/copy to complain. CALLED BY: CopyMoveExistenceCheck PASS: ds = FileQuickTransferHeader ds:si = FileOperationInfoEntry of file being moved/copied current directory is destination directory RETURN: carry = clear if no error ax = ConflictLocationType ss:[useLocalMoveCopy] updated correctly = set on error ax = FileError DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- dlitwin 10/14/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ IsConflictingFileRemote proc near uses bx,cx,dx,si,di attrArray local 3 dup (FileExtAttrDesc) srcDisk local word srcID local dword destDisk local word destID local dword destPathInfo local DirPathInfo .enter mov ax, ss lea bx, ss:[destDisk] lea cx, ss:[destID] lea dx, ss:[destPathInfo] ; ; Diskhandle FEAD ; mov ss:[attrArray].FEAD_attr, FEA_DISK mov ss:[attrArray].FEAD_value.segment, ax mov ss:[attrArray].FEAD_value.offset, bx ; destDisk is buffer mov ss:[attrArray].FEAD_size, word ; ; FileID FEAD ; add bp, size FileExtAttrDesc ; next FEAD mov ss:[attrArray].FEAD_attr, FEA_FILE_ID mov ss:[attrArray].FEAD_value.segment, ax mov ss:[attrArray].FEAD_value.offset, cx ; destID is buffer mov ss:[attrArray].FEAD_size, dword ; ; PathInfo FEAD ; add bp, size FileExtAttrDesc ; next FEAD mov ss:[attrArray].FEAD_attr, FEA_PATH_INFO mov ss:[attrArray].FEAD_value.segment, ax mov ss:[attrArray].FEAD_value.offset, dx ; destPathInfo is buffer mov ss:[attrArray].FEAD_size, size DirPathInfo sub bp, 2 * (size FileExtAttrDesc) ; restore bp segmov es, ss, di lea di, ss:[attrArray] ; es:di is FEAD array mov dx, si ; ds:dx is filename ; ; grab the attributes of the destination ; mov ax, FEA_MULTIPLE mov cx, 3 ; get all three attributes call FileGetPathExtAttributes jc exit test ss:[destPathInfo], mask DPI_EXISTS_LOCALLY mov ax, CLT_LOCAL clc ; no error jnz exit ; ; grab the attributes of the source ; call FilePushDir ; save dest directory mov bx, ds:[FQTH_diskHandle] mov dx, offset FQTH_pathname call FileSetCurrentPath ; set source as currentpath jc popDirAndExit lea ax, ss:[srcDisk] lea bx, ss:[srcID] mov ss:[attrArray].FEAD_value.offset, ax ; buffer is srcDisk add bp, size FileExtAttrDesc ; next FEAD mov ss:[attrArray].FEAD_value.offset, bx ; buffer is srcID sub bp, size FileExtAttrDesc ; restore bp mov dx, si ; ds:dx is filename mov ax, FEA_MULTIPLE mov cx, 2 ; we only want disk and fileID call FileGetPathExtAttributes popDirAndExit: call FilePopDir ; restore dest directory jc exit ; ; OK, so now we have the attributes we want... ; mov ax, CLT_REMOTE_OTHER ; assume different files... mov bx, ss:[srcDisk] cmp bx, ss:[destDisk] clc ; no error jne exit movdw bxcx, ss:[srcID] cmpdw bxcx, ss:[destID] clc ; no error jne exit mov ax, CLT_REMOTE_SELF exit: .leave ret IsConflictingFileRemote endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DeskFileCopy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: copy file/directory CALLED BY: CopyMoveFileToDir PASS: ds:si = FileOperationInfoEntry for source (file or directory) ds:0 = FileQuickTransferHeader containing source dir es:di = name for destination current directory is destination directory RETURN: carry set if error carry clear otherwise ax - error code ss:[recurErrorFlag] set if recursive operation error DESTROYED: nothing PSEUDO CODE/STRATEGY: if (file to copy is not a directory) { FileCopyFile(source pathname, complete destination pathname); } else { FileCreateDir(complete destination pathname); for each file X in directory { DeskFileCopy("source pathname/X", "complete destination pathname/X"); } } KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 9/1/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DeskFileCopy proc far .enter mov ss:[dirCopyMoveRoutine], offset FileCopyFile call CopyMoveFileOrDir .leave ret DeskFileCopy endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DeskFileMove %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: move file to new directory CALLED BY: CopyMoveFileToDir PASS: ds:si = FileOperationInfoEntry for source (file or directory) ds:0 = FileQuickTransferHeader containing source dir es:di = name for destination current directory is destination directory RETURN: carry set if error carry clear otherwise ax - error code ss:[recurErrorFlag] set if recursive operation error DESTROYED: nothing PSEUDO CODE/STRATEGY: if (file to move is not a directory) { FileMoveFile(source pathname, complete destination pathname); } else { FileCreateDir(complete destination pathname); for each file X in directory { FileMove("source pathname/X", "complete destination pathname/X"); } } KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 8/31/89 Initial version brianc 10/30/89 use FileMoveFile instead of FileRename so different drives are supported %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DeskFileMove proc far .enter mov ss:[dirCopyMoveRoutine], offset FileMoveFile call CopyMoveFileOrDir .leave ret DeskFileMove endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CopyMoveFileOrDir %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Copy or move the current file or directory using a function that depends on whether it is a file or a directory CALLED BY: DeskFileCopy, DeskFileMove PASS: ds:si = FileOperationInfoEntry for source ds:0 = FileQuickTransferHeader containing source dir es:di = name for destination current dir is destination directory ax = ConflictLocationType ss:[dirCopyMoveRoutine] = routine to call if source is a file RETURN: carry set on error: ax = error code carry clear if success: ax = destroyed DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 2/26/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CopyMoveFileOrDir proc near uses bx, cx, dx, ds, es, si, di, bp .enter if ENSURE_LOCAL_SP_SUBDIRS ; ; Ensure that subdirs of Standard Paths exists locally ; call EnsureLocalStandardPathSubdirs endif ; ; See if the source is a directory or file and react accordingly ; call UtilCheckInfoEntrySubdir jc doDirectory clr ax ; no enum info yet call ss:[dirCopyMoveRoutine] ; else, use regular file routine jmp done ; ; do directory ; ds:si - source FOIE ; es:di - destination filespec ; doDirectory: mov ss:[recurErrorFlag], 1 mov ss:[enteredFileOpRecursion], 0 ; no recursion yet push ds:[FQTH_nextBlock] clr ds:[FQTH_nextBlock] call FileCopyMoveDir ; do directory pop ds:[FQTH_nextBlock] done: .leave ret CopyMoveFileOrDir endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FileCopyFile %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: copy a single file CALLED BY: INTERNAL DeskFileCopy, FileCopyMoveDir PASS: ds:0 = FileQuickTransferHeader ds:si = FileOperationInfoEntry es:di - destination file in current directory destination file doesn't already exist RETURN: carry set if error ax - error code carry clear if success DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 8/28/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FileCopyFile proc near mov ax, offset doAction push ax call FileCopyOrMoveFile ret doAction: if TRY_CLOSE_ON_IN_USE_ERROR push bp mov bp, 1 ; do copy call TryCloseFileForMoveCopy pop bp endif tst ss:[useLocalMoveCopy] jz regularCopy call FileCopyLocal jmp afterCopy regularCopy: call FileCopy afterCopy: retn FileCopyFile endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FileMoveFile %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: move file CALLED BY: INTERNAL CopyMoveFileOrDir, FileCopyMoveDir PASS: ds:si - source FOIE ds:0 = FileQuickTransferHeader es:di - destination file current dir is destination dir RETURN: carry set if error ax - error code DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 10/30/89 Initial version dlitwin 11/04/93 added some readonly checks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FileMoveFile proc near call DoRemoteFileCheck jnc localFile call FileCopyFile jmp exit localFile: clr ss:[fileMoveSetReadOnly] ; assume not readonly test ds:[si].FOIE_attrs, mask FA_RDONLY jz startMove ; if not readonly, don't worry call FileMoveReadOnlyCheck jc exit ; readonly, user canceled cmp ax, YESNO_YES ; if ax = YESNO_YES, user chose clc ; to move the read only file jne exit ; ; move the file and reset the readonly bit afterward ; mov ss:[fileMoveSetReadOnly], -1 ; set reset bit after move startMove: mov ax, offset doAction push ax call FileCopyOrMoveFile jc exit tst ss:[fileMoveSetReadOnly] jz exit push ds, dx, cx segmov ds, es, dx mov dx, si ; ds:dx is filename clr ch mov cl, ds:[si].FOIE_attrs call FileSetAttributes ; set the readonly bit pop ds, dx, cx exit: ret ; EXIT HERE <------ doAction: tst ss:[useLocalMoveCopy] jz regularMove call DesktopFileMoveLocal ; no FileMoveLocal is currently jmp afterMove ; supported... regularMove: call FileMove afterMove: if TRY_CLOSE_ON_IN_USE_ERROR jnc afterTryClose push bp mov bp, 0 ; do move call TryCloseFileForMoveCopy pop bp afterTryClose: endif retn FileMoveFile endp FileOpLow ends
25.428075
80
0.639566
5c4a120c44b4e5cad71b5ce45bcb6dbbdfe715c2
467
asm
Assembly
data/mapObjects/Route11Gate1F.asm
AmateurPanda92/pokemon-rby-dx
f7ba1cc50b22d93ed176571e074a52d73360da93
[ "MIT" ]
9
2020-07-12T19:44:21.000Z
2022-03-03T23:32:40.000Z
data/mapObjects/Route11Gate1F.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
data/mapObjects/Route11Gate1F.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2021-03-28T18:33:43.000Z
2021-05-06T13:12:09.000Z
Route11Gate1F_Object: db $a ; border block db 5 ; warps warp 0, 4, 0, -1 warp 0, 5, 1, -1 warp 7, 4, 2, -1 warp 7, 5, 3, -1 warp 6, 8, 0, ROUTE_11_GATE_2F db 0 ; signs db 1 ; objects object SPRITE_GUARD, 4, 1, STAY, NONE, 1 ; person ; warp-to warp_to 0, 4, ROUTE_11_GATE_1F_WIDTH warp_to 0, 5, ROUTE_11_GATE_1F_WIDTH warp_to 7, 4, ROUTE_11_GATE_1F_WIDTH warp_to 7, 5, ROUTE_11_GATE_1F_WIDTH warp_to 6, 8, ROUTE_11_GATE_1F_WIDTH ; ROUTE_11_GATE_2F
21.227273
56
0.700214
86a0c7ab748ac8681ce3649c2957d0ebaff9c814
1,069
asm
Assembly
programs/oeis/001/A001579.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/001/A001579.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/001/A001579.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A001579: a(n) = 3^n + 5^n + 6^n. ; 3,14,70,368,2002,11144,63010,360248,2076802,12050504,70290850,411802328,2421454402,14282991464,84472462690,500716911608,2973740844802,17689728038024,105375041354530,628434388600088,3751529358488002,22413798258934184,134005921014342370,801651246151859768,4797986265526544002,28728312101095263944,172071846840828802210,1030940957299990562648,6178195140326227092802,37031917870342366051304,222005242501239968510050,1331100131815150936260728,7981944176164808036134402,47868381987064400687360264,287093876583882287610041890,1721981182844127506488986008,10328976713868997033275588802,61959308367535331441955894824,371683090627719302675029173730,2229734745881554089601990050488,13376589485873621015677053296002,80250441968187523815305998598984,481457177073927077490808727281570,2888515688767790975917979066846168,17329957264228544924308296991016002,103974059243482234431656262118256744,623815933751454139644383075237741410 mov $3,$0 seq $0,74516 ; a(n) = 1^n + 5^n + 6^n. add $0,6 mov $4,3 pow $4,$3 mov $2,$4 add $2,2 add $0,$2 sub $0,9
82.230769
917
0.880262
78298c759e2d8fa5b26778ae5fb871e802093060
445
asm
Assembly
programs/oeis/097/A097433.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/097/A097433.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/097/A097433.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A097433: Integer part of the hypotenuse of prime leg isosceles right triangles. ; 2,4,7,9,15,18,24,26,32,41,43,52,57,60,66,74,83,86,94,100,103,111,117,125,137,142,145,151,154,159,179,185,193,196,210,213,222,230,236,244,253,255,270,272,278,281,298,315,321,323,329,337,340,354,363,371,380 seq $0,40 ; The prime numbers. pow $0,2 seq $0,101776 ; Smallest k such that k^2 is equal to the sum of n not-necessarily-distinct primes plus 1. sub $0,1
55.625
206
0.730337
63e4b875801a0886cedf0981a4765b2fe23d7ae6
680
asm
Assembly
dv3/java/fd/ckwp.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
dv3/java/fd/ckwp.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
dv3/java/fd/ckwp.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
; DV3 Java Floppy Disk Check Wrte Protect V3.00  1993 Tony Tebby ; based on ; DV3 QPC Floppy Disk Check Write Protect V3.00  1993 Tony Tebby section dv3 xdef fd_ckwp include 'dev8_dv3_keys' include 'dev8_keys_java' ;+++ ; Check write protect ; ; ; a3 c p pointer to linkage block ; a4 c p pointer to drive definition ; ; all registers except d0 preserved ; ; status standard ; ;--- fd_ckwp movem.l d7,-(sp) move.b ddf_dnum(a4),d7 ; drive nbr (use same reg as for other traps) moveq #jt8.ckwp,d0 ; check write protect now (sets D0) dc.w jva.trp8 blt.s fcwp_rts sne ddf_wprot(a4) ; set write protect fcwp_rts moveq #0,d0 movem.l (sp)+,d7 rts end
17.435897
70
0.694118
5faf9cf17f3f9af3df09211c561f3699c1dd55b1
697
asm
Assembly
oeis/062/A062263.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/062/A062263.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/062/A062263.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A062263: Sixth (unsigned) column of triangle A062140 (generalized a=4 Laguerre). ; Submitted by Jon Maiga ; 1,60,2310,73920,2162160,60540480,1664863200,45664819200,1261490630400,35321737651200,1006669523059200,29284931579904000,871226714502144000,26538906072526848000,828392996692445184000,26508575894158245888000,869812646527067443200000,29266637283146033971200000,1009698986268538172006400000,35711458882760929030963200000,1294540384500083677372416000000,48082928567145965159546880000000,1829336873213689674479124480000000,71264601669541997753621544960000000,2841675991572987160425659105280000000 mov $1,$0 add $1,5 mov $0,$1 bin $0,5 add $1,4 lpb $1 mul $0,$1 sub $1,1 lpe div $0,362880
46.466667
492
0.862267
9c5c9348dccaf0a96cb1a7056888dd871ea6c463
514
asm
Assembly
programs/oeis/259/A259751.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/259/A259751.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/259/A259751.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A259751: Numbers that are congruent to {8,16} mod 24. ; 8,16,32,40,56,64,80,88,104,112,128,136,152,160,176,184,200,208,224,232,248,256,272,280,296,304,320,328,344,352,368,376,392,400,416,424,440,448,464,472,488,496,512,520,536,544,560,568,584,592,608,616,632,640,656,664,680,688,704,712,728,736,752,760,776,784,800,808,824,832,848,856,872,880,896,904,920,928,944,952,968,976,992,1000,1016,1024,1040,1048,1064,1072,1088,1096,1112,1120,1136,1144,1160,1168,1184,1192 mov $1,$0 div $0,2 add $0,$1 mul $0,8 add $0,8
57.111111
409
0.725681
9f1dbf5bb9094c7a829c6d4a8e5c03e853d74613
739
asm
Assembly
libsrc/sms/gotoxy.asm
andydansby/z88dk-mk2
51c15f1387293809c496f5eaf7b196f8a0e9b66b
[ "ClArtistic" ]
1
2020-09-15T08:35:49.000Z
2020-09-15T08:35:49.000Z
libsrc/sms/gotoxy.asm
dex4er/deb-z88dk
9ee4f23444fa6f6043462332a1bff7ae20a8504b
[ "ClArtistic" ]
null
null
null
libsrc/sms/gotoxy.asm
dex4er/deb-z88dk
9ee4f23444fa6f6043462332a1bff7ae20a8504b
[ "ClArtistic" ]
null
null
null
XLIB gotoxy INCLUDE "sms/sms.hdr" XREF fputc_vdp_offs ;============================================================== ; void gotoxy(int x, int y) ;============================================================== ; Places the software text cursor in the specified coordinates. ; Supposed to be used in conjunction with stdio ;============================================================== .gotoxy ld hl, 2 add hl, sp ld d, (hl) ; Y inc hl inc hl ld e, (hl) ; X ld l, d ld h, 0 add hl, hl add hl, hl add hl, hl add hl, hl add hl, hl ; HL = Y*32 ld d, 0 add hl, de ; HL = (Y*32) + X add hl, hl ; HL = ((Y*32) + X) * 2 ld a, l ld (fputc_vdp_offs), a ld a, h ld (fputc_vdp_offs+1), a ; Saves char offset ret
19.447368
63
0.449256
b4fdab1acb4cb25462fe0e3b9e6b078c8a47b156
2,340
asm
Assembly
programs/oeis/145/A145920.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/145/A145920.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/145/A145920.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A145920: List of numbers that are both pentagonal (A000326) and binomial coefficients C(n,4) (A000332). ; 0,1,5,35,70,210,330,715,1001,1820,2380,3876,4845,7315,8855,12650,14950,20475,23751,31465,35960,46376,52360,66045,73815,91390,101270,123410,135751,163185,178365,211876,230300,270725,292825,341055,367290,424270,455126,521855,557845,635376,677040,766480,814385,916895,971635,1088430,1150626,1282975,1353275,1502501,1581580,1749060,1837620,2024785,2123555,2331890,2441626,2672670,2794155,3049501,3183545,3464840,3612280,3921225,4082925,4421275,4598126,4967690,5160610,5563251,5773185,6210820,6438740,6913340,7160245,7673835,7940751,8495410,8783390,9381251,9691375,10334625,10668000,11358880,11716640,12457445,12840751,13633830,14043870,14891626,15329615,16234505,16701685,17666220,18163860,19190605,19720001,20811575,21374050,22533126,23130030,24359335,24992045,26294360,26964280,28342440,29051001,30507895,31256555,32795126,33585370,35208615,36041955,37752925,38630900,40432700,41356876,43252665,44224635,46217626,47239010,49332470,50404915,52602165,53727345,56031760,57211376,59626385,60862165,63391251,64684950,67331650,68685050,71452955,72867865,75760620,77238876,80260180,81803645,84957251,86567815,89857530,91537110,94966795,96717335,100290905,102114376,105835800,107734200,111607501,113582855,117612110,119666470,123855810,125991255,130344865,132563501,137085620,139389580,144084501,146475945,151348015,153829130,158882750,161455750,166695375,169362501,174792640,177556160,183181376,186043585,191868495,194831715,200860990,203927570,210165935,213338251,219790485,223070940,229741876,233132900,240027425,243531475,250654530,254274090,261630670,265368251,272963405,276821545,284660376,288641640,296729305,300836285,309177995,313413310,322014330,326380626,335246275,339746225,348881876,353518180,362929260,367704645,377396635,382313855,392292290,397354126,407624595,412833855,423402001,428761520,439633040,445145680,456326325,461994975,473490550,479318126,491134490,497123935,509267001,515421285,527897020,534219140,547033565,553526545,566685735,573352626,586862710,593706590,607573751,614597725,628828200,636035400,650635480,658029065,673005095,680588251,695946630,703722570,719469751,727441715,743584205,751755460,768299820,776673660,793626505,802206251,819574250 mov $1,4 mov $2,$0 mul $2,9 add $1,$2 div $1,6 add $1,2 bin $1,4
212.727273
2,167
0.868376
533ce0bdb0a26970af605098b02ad72b0604b374
2,187
asm
Assembly
programs/oeis/100/A100147.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/100/A100147.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/100/A100147.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A100147: Structured icosidodecahedral numbers. ; 1,30,135,364,765,1386,2275,3480,5049,7030,9471,12420,15925,20034,24795,30256,36465,43470,51319,60060,69741,80410,92115,104904,118825,133926,150255,167860,186789,207090,228811,252000,276705,302974,330855,360396,391645,424650,459459,496120,534681,575190,617695,662244,708885,757666,808635,861840,917329,975150,1035351,1097980,1163085,1230714,1300915,1373736,1449225,1527430,1608399,1692180,1778821,1868370,1960875,2056384,2154945,2256606,2361415,2469420,2580669,2695210,2813091,2934360,3059065,3187254,3318975,3454276,3593205,3735810,3882139,4032240,4186161,4343950,4505655,4671324,4841005,5014746,5192595,5374600,5560809,5751270,5946031,6145140,6348645,6556594,6769035,6986016,7207585,7433790,7664679,7900300,8140701,8385930,8636035,8891064,9151065,9416086,9686175,9961380,10241749,10527330,10818171,11114320,11415825,11722734,12035095,12352956,12676365,13005370,13340019,13680360,14026441,14378310,14736015,15099604,15469125,15844626,16226155,16613760,17007489,17407390,17813511,18225900,18644605,19069674,19501155,19939096,20383545,20834550,21292159,21756420,22227381,22705090,23189595,23680944,24179185,24684366,25196535,25715740,26242029,26775450,27316051,27863880,28418985,28981414,29551215,30128436,30713125,31305330,31905099,32512480,33127521,33750270,34380775,35019084,35665245,36319306,36981315,37651320,38329369,39015510,39709791,40412260,41122965,41841954,42569275,43304976,44049105,44801710,45562839,46332540,47110861,47897850,48693555,49498024,50311305,51133446,51964495,52804500,53653509,54511570,55378731,56255040,57140545,58035294,58939335,59852716,60775485,61707690,62649379,63600600,64561401,65531830,66511935,67501764,68501365,69510786,70530075,71559280,72598449,73647630,74706871,75776220,76855725,77945434,79045395,80155656,81276265,82407270,83548719,84700660,85863141,87036210,88219915,89414304,90619425,91835326,93062055,94299660,95548189,96807690,98078211,99359800,100652505,101956374,103271455,104597796,105935445,107284450,108644859,110016720,111400081,112794990,114201495,115619644,117049485,118491066,119944435,121409640,122886729,124375750 mov $2,$0 add $0,1 mov $1,$0 add $2,$0 mul $2,2 bin $2,2 mul $1,$2
198.818182
2,069
0.866027
e35ae16255689a03e60bcc34fbd1d9a072b7ed53
996
asm
Assembly
unittests/ASM/X87/D9_06_2.asm
cobalt2727/FEX
13087f8425aeaad28dc81bed46a83e1d72ff0db8
[ "MIT" ]
628
2020-03-06T14:01:32.000Z
2022-03-31T06:35:14.000Z
unittests/ASM/X87/D9_06_2.asm
cobalt2727/FEX
13087f8425aeaad28dc81bed46a83e1d72ff0db8
[ "MIT" ]
576
2020-03-06T08:25:12.000Z
2022-03-30T04:05:29.000Z
unittests/ASM/X87/D9_06_2.asm
cobalt2727/FEX
13087f8425aeaad28dc81bed46a83e1d72ff0db8
[ "MIT" ]
38
2020-03-07T06:10:00.000Z
2022-03-29T09:27:36.000Z
%ifdef CONFIG { "RegData": { "MM6": ["0x8000000000000000", "0x4000"], "MM7": ["0x8000000000000000", "0x3fff"] }, "MemoryRegions": { "0x100000000": "4096" } } %endif mov rdx, 0xe0000000 mov eax, 0x3f800000 ; 1.0 mov [rdx + 8 * 0], eax mov eax, 0x40000000 ; 2.0 mov [rdx + 8 * 1], eax mov eax, 0x40800000 ; 4.0 mov [rdx + 8 * 2], eax fld dword [rdx + 8 * 0] o32 fstenv [rdx + 8 * 3] fld dword [rdx + 8 * 2] o32 fldenv [rdx + 8 * 3] ; This will overwrite the previous load ; This is since the control word is stored and reloaded fld dword [rdx + 8 * 1] ; 14 bytes for 16bit ; 2 Bytes : FCW ; 2 Bytes : FSW ; 2 bytes : FTW ; 2 bytes : Instruction offset ; 2 bytes : Instruction CS selector ; 2 bytes : Data offset ; 2 bytes : Data selector ; 28 bytes for 32bit ; 4 bytes : FCW ; 4 bytes : FSW ; 4 bytes : FTW ; 4 bytes : Instruction pointer ; 2 bytes : instruction pointer selector ; 2 bytes : Opcode ; 4 bytes : data pointer offset ; 4 bytes : data pointer selector hlt
19.529412
55
0.640562
823a4004b6ece2dcfd05874c0cb6398df9d05b4c
127
asm
Assembly
libsrc/target/nc100/padgettime.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/target/nc100/padgettime.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/target/nc100/padgettime.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_clib PUBLIC padgettime PUBLIC _padgettime ; fastcall .padgettime ._padgettime jp 0xb875
12.7
33
0.677165
60af2aedad1ba7f6d0f780548e83715d24985259
34,290
asm
Assembly
out/zombie.asm
harveydong/learning-xv6
6bfe152a45e87dcca0ee1932625d3fe6dd34a203
[ "MIT-0" ]
null
null
null
out/zombie.asm
harveydong/learning-xv6
6bfe152a45e87dcca0ee1932625d3fe6dd34a203
[ "MIT-0" ]
null
null
null
out/zombie.asm
harveydong/learning-xv6
6bfe152a45e87dcca0ee1932625d3fe6dd34a203
[ "MIT-0" ]
null
null
null
.fs/zombie: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <main>: #include "stat.h" #include "user.h" int main(void) { 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp if(fork() > 0) 4: e8 70 01 00 00 callq 179 <fork> 9: 85 c0 test %eax,%eax b: 7e 0a jle 17 <main+0x17> sleep(5); // Let child exit before parent. d: bf 05 00 00 00 mov $0x5,%edi 12: e8 fa 01 00 00 callq 211 <sleep> exit(); 17: e8 65 01 00 00 callq 181 <exit> 000000000000001c <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { 1c: 55 push %rbp 1d: 48 89 f8 mov %rdi,%rax char *os; os = s; while((*s++ = *t++) != 0) 20: 31 d2 xor %edx,%edx #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { 22: 48 89 e5 mov %rsp,%rbp char *os; os = s; while((*s++ = *t++) != 0) 25: 8a 0c 16 mov (%rsi,%rdx,1),%cl 28: 88 0c 10 mov %cl,(%rax,%rdx,1) 2b: 48 ff c2 inc %rdx 2e: 84 c9 test %cl,%cl 30: 75 f3 jne 25 <strcpy+0x9> ; return os; } 32: 5d pop %rbp 33: c3 retq 0000000000000034 <strcmp>: int strcmp(const char *p, const char *q) { 34: 55 push %rbp 35: 48 89 e5 mov %rsp,%rbp while(*p && *p == *q) 38: 0f b6 07 movzbl (%rdi),%eax 3b: 84 c0 test %al,%al 3d: 74 0c je 4b <strcmp+0x17> 3f: 3a 06 cmp (%rsi),%al 41: 75 08 jne 4b <strcmp+0x17> p++, q++; 43: 48 ff c7 inc %rdi 46: 48 ff c6 inc %rsi 49: eb ed jmp 38 <strcmp+0x4> return (uchar)*p - (uchar)*q; 4b: 0f b6 16 movzbl (%rsi),%edx } 4e: 5d pop %rbp int strcmp(const char *p, const char *q) { while(*p && *p == *q) p++, q++; return (uchar)*p - (uchar)*q; 4f: 29 d0 sub %edx,%eax } 51: c3 retq 0000000000000052 <strlen>: uint strlen(const char *s) { 52: 55 push %rbp int n; for(n = 0; s[n]; n++) 53: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; } uint strlen(const char *s) { 55: 48 89 e5 mov %rsp,%rbp 58: 48 8d 50 01 lea 0x1(%rax),%rdx int n; for(n = 0; s[n]; n++) 5c: 80 7c 17 ff 00 cmpb $0x0,-0x1(%rdi,%rdx,1) 61: 74 05 je 68 <strlen+0x16> 63: 48 89 d0 mov %rdx,%rax 66: eb f0 jmp 58 <strlen+0x6> ; return n; } 68: 5d pop %rbp 69: c3 retq 000000000000006a <memset>: void* memset(void *dst, int c, uint n) { 6a: 55 push %rbp 6b: 49 89 f8 mov %rdi,%r8 } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 6e: 89 d1 mov %edx,%ecx 70: 89 f0 mov %esi,%eax 72: 48 89 e5 mov %rsp,%rbp 75: fc cld 76: f3 aa rep stos %al,%es:(%rdi) stosb(dst, c, n); return dst; } 78: 4c 89 c0 mov %r8,%rax 7b: 5d pop %rbp 7c: c3 retq 000000000000007d <strchr>: char* strchr(const char *s, char c) { 7d: 55 push %rbp 7e: 48 89 e5 mov %rsp,%rbp for(; *s; s++) 81: 8a 07 mov (%rdi),%al 83: 84 c0 test %al,%al 85: 74 0a je 91 <strchr+0x14> if(*s == c) 87: 40 38 f0 cmp %sil,%al 8a: 74 09 je 95 <strchr+0x18> } char* strchr(const char *s, char c) { for(; *s; s++) 8c: 48 ff c7 inc %rdi 8f: eb f0 jmp 81 <strchr+0x4> if(*s == c) return (char*)s; return 0; 91: 31 c0 xor %eax,%eax 93: eb 03 jmp 98 <strchr+0x1b> 95: 48 89 f8 mov %rdi,%rax } 98: 5d pop %rbp 99: c3 retq 000000000000009a <gets>: char* gets(char *buf, int max) { 9a: 55 push %rbp 9b: 48 89 e5 mov %rsp,%rbp 9e: 41 57 push %r15 a0: 41 56 push %r14 a2: 41 55 push %r13 a4: 41 54 push %r12 a6: 41 89 f7 mov %esi,%r15d a9: 53 push %rbx aa: 49 89 fc mov %rdi,%r12 ad: 49 89 fe mov %rdi,%r14 int i, cc; char c; for(i=0; i+1 < max; ){ b0: 31 db xor %ebx,%ebx return 0; } char* gets(char *buf, int max) { b2: 48 83 ec 18 sub $0x18,%rsp int i, cc; char c; for(i=0; i+1 < max; ){ b6: 44 8d 6b 01 lea 0x1(%rbx),%r13d ba: 45 39 fd cmp %r15d,%r13d bd: 7d 2c jge eb <gets+0x51> cc = read(0, &c, 1); bf: 48 8d 75 cf lea -0x31(%rbp),%rsi c3: 31 ff xor %edi,%edi c5: ba 01 00 00 00 mov $0x1,%edx ca: e8 ca 00 00 00 callq 199 <read> if(cc < 1) cf: 85 c0 test %eax,%eax d1: 7e 18 jle eb <gets+0x51> break; buf[i++] = c; d3: 8a 45 cf mov -0x31(%rbp),%al d6: 49 ff c6 inc %r14 d9: 49 63 dd movslq %r13d,%rbx dc: 41 88 46 ff mov %al,-0x1(%r14) if(c == '\n' || c == '\r') e0: 3c 0a cmp $0xa,%al e2: 74 04 je e8 <gets+0x4e> e4: 3c 0d cmp $0xd,%al e6: 75 ce jne b6 <gets+0x1c> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ e8: 49 63 dd movslq %r13d,%rbx break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; eb: 41 c6 04 1c 00 movb $0x0,(%r12,%rbx,1) return buf; } f0: 48 83 c4 18 add $0x18,%rsp f4: 4c 89 e0 mov %r12,%rax f7: 5b pop %rbx f8: 41 5c pop %r12 fa: 41 5d pop %r13 fc: 41 5e pop %r14 fe: 41 5f pop %r15 100: 5d pop %rbp 101: c3 retq 0000000000000102 <stat>: int stat(const char *n, struct stat *st) { 102: 55 push %rbp 103: 48 89 e5 mov %rsp,%rbp 106: 41 54 push %r12 108: 53 push %rbx 109: 48 89 f3 mov %rsi,%rbx int fd; int r; fd = open(n, O_RDONLY); 10c: 31 f6 xor %esi,%esi 10e: e8 ae 00 00 00 callq 1c1 <open> 113: 41 89 c4 mov %eax,%r12d 116: 83 c8 ff or $0xffffffff,%eax if(fd < 0) 119: 45 85 e4 test %r12d,%r12d 11c: 78 17 js 135 <stat+0x33> return -1; r = fstat(fd, st); 11e: 48 89 de mov %rbx,%rsi 121: 44 89 e7 mov %r12d,%edi 124: e8 b0 00 00 00 callq 1d9 <fstat> close(fd); 129: 44 89 e7 mov %r12d,%edi int r; fd = open(n, O_RDONLY); if(fd < 0) return -1; r = fstat(fd, st); 12c: 89 c3 mov %eax,%ebx close(fd); 12e: e8 76 00 00 00 callq 1a9 <close> return r; 133: 89 d8 mov %ebx,%eax } 135: 5b pop %rbx 136: 41 5c pop %r12 138: 5d pop %rbp 139: c3 retq 000000000000013a <atoi>: int atoi(const char *s) { 13a: 55 push %rbp int n; n = 0; 13b: 31 c0 xor %eax,%eax return r; } int atoi(const char *s) { 13d: 48 89 e5 mov %rsp,%rbp int n; n = 0; while('0' <= *s && *s <= '9') 140: 0f be 17 movsbl (%rdi),%edx 143: 8d 4a d0 lea -0x30(%rdx),%ecx 146: 80 f9 09 cmp $0x9,%cl 149: 77 0c ja 157 <atoi+0x1d> n = n*10 + *s++ - '0'; 14b: 6b c0 0a imul $0xa,%eax,%eax 14e: 48 ff c7 inc %rdi 151: 8d 44 10 d0 lea -0x30(%rax,%rdx,1),%eax 155: eb e9 jmp 140 <atoi+0x6> return n; } 157: 5d pop %rbp 158: c3 retq 0000000000000159 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 159: 55 push %rbp 15a: 48 89 f8 mov %rdi,%rax char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 15d: 31 c9 xor %ecx,%ecx return n; } void* memmove(void *vdst, const void *vsrc, int n) { 15f: 48 89 e5 mov %rsp,%rbp 162: 89 d7 mov %edx,%edi 164: 29 cf sub %ecx,%edi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 166: 85 ff test %edi,%edi 168: 7e 0d jle 177 <memmove+0x1e> *dst++ = *src++; 16a: 40 8a 3c 0e mov (%rsi,%rcx,1),%dil 16e: 40 88 3c 08 mov %dil,(%rax,%rcx,1) 172: 48 ff c1 inc %rcx 175: eb eb jmp 162 <memmove+0x9> return vdst; } 177: 5d pop %rbp 178: c3 retq 0000000000000179 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 179: b8 01 00 00 00 mov $0x1,%eax 17e: cd 40 int $0x40 180: c3 retq 0000000000000181 <exit>: SYSCALL(exit) 181: b8 02 00 00 00 mov $0x2,%eax 186: cd 40 int $0x40 188: c3 retq 0000000000000189 <wait>: SYSCALL(wait) 189: b8 03 00 00 00 mov $0x3,%eax 18e: cd 40 int $0x40 190: c3 retq 0000000000000191 <pipe>: SYSCALL(pipe) 191: b8 04 00 00 00 mov $0x4,%eax 196: cd 40 int $0x40 198: c3 retq 0000000000000199 <read>: SYSCALL(read) 199: b8 05 00 00 00 mov $0x5,%eax 19e: cd 40 int $0x40 1a0: c3 retq 00000000000001a1 <write>: SYSCALL(write) 1a1: b8 10 00 00 00 mov $0x10,%eax 1a6: cd 40 int $0x40 1a8: c3 retq 00000000000001a9 <close>: SYSCALL(close) 1a9: b8 15 00 00 00 mov $0x15,%eax 1ae: cd 40 int $0x40 1b0: c3 retq 00000000000001b1 <kill>: SYSCALL(kill) 1b1: b8 06 00 00 00 mov $0x6,%eax 1b6: cd 40 int $0x40 1b8: c3 retq 00000000000001b9 <exec>: SYSCALL(exec) 1b9: b8 07 00 00 00 mov $0x7,%eax 1be: cd 40 int $0x40 1c0: c3 retq 00000000000001c1 <open>: SYSCALL(open) 1c1: b8 0f 00 00 00 mov $0xf,%eax 1c6: cd 40 int $0x40 1c8: c3 retq 00000000000001c9 <mknod>: SYSCALL(mknod) 1c9: b8 11 00 00 00 mov $0x11,%eax 1ce: cd 40 int $0x40 1d0: c3 retq 00000000000001d1 <unlink>: SYSCALL(unlink) 1d1: b8 12 00 00 00 mov $0x12,%eax 1d6: cd 40 int $0x40 1d8: c3 retq 00000000000001d9 <fstat>: SYSCALL(fstat) 1d9: b8 08 00 00 00 mov $0x8,%eax 1de: cd 40 int $0x40 1e0: c3 retq 00000000000001e1 <link>: SYSCALL(link) 1e1: b8 13 00 00 00 mov $0x13,%eax 1e6: cd 40 int $0x40 1e8: c3 retq 00000000000001e9 <mkdir>: SYSCALL(mkdir) 1e9: b8 14 00 00 00 mov $0x14,%eax 1ee: cd 40 int $0x40 1f0: c3 retq 00000000000001f1 <chdir>: SYSCALL(chdir) 1f1: b8 09 00 00 00 mov $0x9,%eax 1f6: cd 40 int $0x40 1f8: c3 retq 00000000000001f9 <dup>: SYSCALL(dup) 1f9: b8 0a 00 00 00 mov $0xa,%eax 1fe: cd 40 int $0x40 200: c3 retq 0000000000000201 <getpid>: SYSCALL(getpid) 201: b8 0b 00 00 00 mov $0xb,%eax 206: cd 40 int $0x40 208: c3 retq 0000000000000209 <sbrk>: SYSCALL(sbrk) 209: b8 0c 00 00 00 mov $0xc,%eax 20e: cd 40 int $0x40 210: c3 retq 0000000000000211 <sleep>: SYSCALL(sleep) 211: b8 0d 00 00 00 mov $0xd,%eax 216: cd 40 int $0x40 218: c3 retq 0000000000000219 <uptime>: SYSCALL(uptime) 219: b8 0e 00 00 00 mov $0xe,%eax 21e: cd 40 int $0x40 220: c3 retq 0000000000000221 <chmod>: SYSCALL(chmod) 221: b8 16 00 00 00 mov $0x16,%eax 226: cd 40 int $0x40 228: c3 retq 0000000000000229 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 229: 55 push %rbp 22a: 41 89 d0 mov %edx,%r8d 22d: 48 89 e5 mov %rsp,%rbp 230: 41 54 push %r12 232: 53 push %rbx 233: 41 89 fc mov %edi,%r12d 236: 48 83 ec 20 sub $0x20,%rsp char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 23a: 85 c9 test %ecx,%ecx 23c: 74 12 je 250 <printint+0x27> 23e: 89 f0 mov %esi,%eax 240: c1 e8 1f shr $0x1f,%eax 243: 74 0b je 250 <printint+0x27> neg = 1; x = -xx; 245: 89 f0 mov %esi,%eax int i, neg; uint x; neg = 0; if(sgn && xx < 0){ neg = 1; 247: be 01 00 00 00 mov $0x1,%esi x = -xx; 24c: f7 d8 neg %eax 24e: eb 04 jmp 254 <printint+0x2b> } else { x = xx; 250: 89 f0 mov %esi,%eax static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 252: 31 f6 xor %esi,%esi 254: 48 8d 7d e0 lea -0x20(%rbp),%rdi x = -xx; } else { x = xx; } i = 0; 258: 31 c9 xor %ecx,%ecx do{ buf[i++] = digits[x % base]; 25a: 31 d2 xor %edx,%edx 25c: 48 ff c7 inc %rdi 25f: 8d 59 01 lea 0x1(%rcx),%ebx 262: 41 f7 f0 div %r8d 265: 89 d2 mov %edx,%edx 267: 8a 92 00 06 00 00 mov 0x600(%rdx),%dl 26d: 88 57 ff mov %dl,-0x1(%rdi) }while((x /= base) != 0); 270: 85 c0 test %eax,%eax 272: 74 04 je 278 <printint+0x4f> x = xx; } i = 0; do{ buf[i++] = digits[x % base]; 274: 89 d9 mov %ebx,%ecx 276: eb e2 jmp 25a <printint+0x31> }while((x /= base) != 0); if(neg) 278: 85 f6 test %esi,%esi 27a: 74 0b je 287 <printint+0x5e> buf[i++] = '-'; 27c: 48 63 db movslq %ebx,%rbx 27f: c6 44 1d e0 2d movb $0x2d,-0x20(%rbp,%rbx,1) 284: 8d 59 02 lea 0x2(%rcx),%ebx while(--i >= 0) 287: ff cb dec %ebx 289: 83 fb ff cmp $0xffffffff,%ebx 28c: 74 1d je 2ab <printint+0x82> putc(fd, buf[i]); 28e: 48 63 c3 movslq %ebx,%rax #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 291: 48 8d 75 df lea -0x21(%rbp),%rsi 295: ba 01 00 00 00 mov $0x1,%edx 29a: 8a 44 05 e0 mov -0x20(%rbp,%rax,1),%al 29e: 44 89 e7 mov %r12d,%edi 2a1: 88 45 df mov %al,-0x21(%rbp) 2a4: e8 f8 fe ff ff callq 1a1 <write> 2a9: eb dc jmp 287 <printint+0x5e> if(neg) buf[i++] = '-'; while(--i >= 0) putc(fd, buf[i]); } 2ab: 48 83 c4 20 add $0x20,%rsp 2af: 5b pop %rbx 2b0: 41 5c pop %r12 2b2: 5d pop %rbp 2b3: c3 retq 00000000000002b4 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 2b4: 55 push %rbp 2b5: 48 89 e5 mov %rsp,%rbp 2b8: 41 56 push %r14 2ba: 41 55 push %r13 va_list ap; char *s; int c, i, state; va_start(ap, fmt); 2bc: 48 8d 45 10 lea 0x10(%rbp),%rax } // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 2c0: 41 54 push %r12 2c2: 53 push %rbx 2c3: 41 89 fc mov %edi,%r12d 2c6: 49 89 f6 mov %rsi,%r14 va_list ap; char *s; int c, i, state; va_start(ap, fmt); state = 0; 2c9: 31 db xor %ebx,%ebx } // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 2cb: 48 83 ec 50 sub $0x50,%rsp va_list ap; char *s; int c, i, state; va_start(ap, fmt); 2cf: 48 89 45 a0 mov %rax,-0x60(%rbp) 2d3: 48 8d 45 b0 lea -0x50(%rbp),%rax } // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 2d7: 48 89 55 c0 mov %rdx,-0x40(%rbp) 2db: 48 89 4d c8 mov %rcx,-0x38(%rbp) 2df: 4c 89 45 d0 mov %r8,-0x30(%rbp) 2e3: 4c 89 4d d8 mov %r9,-0x28(%rbp) va_list ap; char *s; int c, i, state; va_start(ap, fmt); 2e7: c7 45 98 10 00 00 00 movl $0x10,-0x68(%rbp) 2ee: 48 89 45 a8 mov %rax,-0x58(%rbp) state = 0; for(i = 0; fmt[i]; i++){ 2f2: 45 8a 2e mov (%r14),%r13b 2f5: 45 84 ed test %r13b,%r13b 2f8: 0f 84 8f 01 00 00 je 48d <printf+0x1d9> c = fmt[i] & 0xff; if(state == 0){ 2fe: 85 db test %ebx,%ebx int c, i, state; va_start(ap, fmt); state = 0; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; 300: 41 0f be d5 movsbl %r13b,%edx 304: 41 0f b6 c5 movzbl %r13b,%eax if(state == 0){ 308: 75 23 jne 32d <printf+0x79> if(c == '%'){ 30a: 83 f8 25 cmp $0x25,%eax 30d: 0f 84 6d 01 00 00 je 480 <printf+0x1cc> #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 313: 48 8d 75 92 lea -0x6e(%rbp),%rsi 317: ba 01 00 00 00 mov $0x1,%edx 31c: 44 89 e7 mov %r12d,%edi 31f: 44 88 6d 92 mov %r13b,-0x6e(%rbp) 323: e8 79 fe ff ff callq 1a1 <write> 328: e9 58 01 00 00 jmpq 485 <printf+0x1d1> if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 32d: 83 fb 25 cmp $0x25,%ebx 330: 0f 85 4f 01 00 00 jne 485 <printf+0x1d1> if(c == 'd'){ 336: 83 f8 64 cmp $0x64,%eax 339: 75 2e jne 369 <printf+0xb5> printint(fd, va_arg(ap, int), 10, 1); 33b: 8b 55 98 mov -0x68(%rbp),%edx 33e: 83 fa 2f cmp $0x2f,%edx 341: 77 0e ja 351 <printf+0x9d> 343: 89 d0 mov %edx,%eax 345: 83 c2 08 add $0x8,%edx 348: 48 03 45 a8 add -0x58(%rbp),%rax 34c: 89 55 98 mov %edx,-0x68(%rbp) 34f: eb 0c jmp 35d <printf+0xa9> 351: 48 8b 45 a0 mov -0x60(%rbp),%rax 355: 48 8d 50 08 lea 0x8(%rax),%rdx 359: 48 89 55 a0 mov %rdx,-0x60(%rbp) 35d: b9 01 00 00 00 mov $0x1,%ecx 362: ba 0a 00 00 00 mov $0xa,%edx 367: eb 34 jmp 39d <printf+0xe9> } else if(c == 'x' || c == 'p'){ 369: 81 e2 f7 00 00 00 and $0xf7,%edx 36f: 83 fa 70 cmp $0x70,%edx 372: 75 38 jne 3ac <printf+0xf8> printint(fd, va_arg(ap, int), 16, 0); 374: 8b 55 98 mov -0x68(%rbp),%edx 377: 83 fa 2f cmp $0x2f,%edx 37a: 77 0e ja 38a <printf+0xd6> 37c: 89 d0 mov %edx,%eax 37e: 83 c2 08 add $0x8,%edx 381: 48 03 45 a8 add -0x58(%rbp),%rax 385: 89 55 98 mov %edx,-0x68(%rbp) 388: eb 0c jmp 396 <printf+0xe2> 38a: 48 8b 45 a0 mov -0x60(%rbp),%rax 38e: 48 8d 50 08 lea 0x8(%rax),%rdx 392: 48 89 55 a0 mov %rdx,-0x60(%rbp) 396: 31 c9 xor %ecx,%ecx 398: ba 10 00 00 00 mov $0x10,%edx 39d: 8b 30 mov (%rax),%esi 39f: 44 89 e7 mov %r12d,%edi 3a2: e8 82 fe ff ff callq 229 <printint> 3a7: e9 d0 00 00 00 jmpq 47c <printf+0x1c8> } else if(c == 's'){ 3ac: 83 f8 73 cmp $0x73,%eax 3af: 75 56 jne 407 <printf+0x153> s = va_arg(ap, char*); 3b1: 8b 55 98 mov -0x68(%rbp),%edx 3b4: 83 fa 2f cmp $0x2f,%edx 3b7: 77 0e ja 3c7 <printf+0x113> 3b9: 89 d0 mov %edx,%eax 3bb: 83 c2 08 add $0x8,%edx 3be: 48 03 45 a8 add -0x58(%rbp),%rax 3c2: 89 55 98 mov %edx,-0x68(%rbp) 3c5: eb 0c jmp 3d3 <printf+0x11f> 3c7: 48 8b 45 a0 mov -0x60(%rbp),%rax 3cb: 48 8d 50 08 lea 0x8(%rax),%rdx 3cf: 48 89 55 a0 mov %rdx,-0x60(%rbp) 3d3: 48 8b 18 mov (%rax),%rbx if(s == 0) s = "(null)"; 3d6: 48 c7 c0 f0 05 00 00 mov $0x5f0,%rax 3dd: 48 85 db test %rbx,%rbx 3e0: 48 0f 44 d8 cmove %rax,%rbx while(*s != 0){ 3e4: 8a 03 mov (%rbx),%al 3e6: 84 c0 test %al,%al 3e8: 0f 84 8e 00 00 00 je 47c <printf+0x1c8> #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 3ee: 48 8d 75 93 lea -0x6d(%rbp),%rsi 3f2: ba 01 00 00 00 mov $0x1,%edx 3f7: 44 89 e7 mov %r12d,%edi 3fa: 88 45 93 mov %al,-0x6d(%rbp) s = va_arg(ap, char*); if(s == 0) s = "(null)"; while(*s != 0){ putc(fd, *s); s++; 3fd: 48 ff c3 inc %rbx #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 400: e8 9c fd ff ff callq 1a1 <write> 405: eb dd jmp 3e4 <printf+0x130> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 407: 83 f8 63 cmp $0x63,%eax 40a: 75 32 jne 43e <printf+0x18a> putc(fd, va_arg(ap, uint)); 40c: 8b 55 98 mov -0x68(%rbp),%edx 40f: 83 fa 2f cmp $0x2f,%edx 412: 77 0e ja 422 <printf+0x16e> 414: 89 d0 mov %edx,%eax 416: 83 c2 08 add $0x8,%edx 419: 48 03 45 a8 add -0x58(%rbp),%rax 41d: 89 55 98 mov %edx,-0x68(%rbp) 420: eb 0c jmp 42e <printf+0x17a> 422: 48 8b 45 a0 mov -0x60(%rbp),%rax 426: 48 8d 50 08 lea 0x8(%rax),%rdx 42a: 48 89 55 a0 mov %rdx,-0x60(%rbp) 42e: 8b 00 mov (%rax),%eax #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 430: ba 01 00 00 00 mov $0x1,%edx 435: 48 8d 75 94 lea -0x6c(%rbp),%rsi 439: 88 45 94 mov %al,-0x6c(%rbp) 43c: eb 36 jmp 474 <printf+0x1c0> putc(fd, *s); s++; } } else if(c == 'c'){ putc(fd, va_arg(ap, uint)); } else if(c == '%'){ 43e: 83 f8 25 cmp $0x25,%eax 441: 75 0f jne 452 <printf+0x19e> 443: 44 88 6d 95 mov %r13b,-0x6b(%rbp) #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 447: ba 01 00 00 00 mov $0x1,%edx 44c: 48 8d 75 95 lea -0x6b(%rbp),%rsi 450: eb 22 jmp 474 <printf+0x1c0> 452: 48 8d 75 97 lea -0x69(%rbp),%rsi 456: ba 01 00 00 00 mov $0x1,%edx 45b: 44 89 e7 mov %r12d,%edi 45e: c6 45 97 25 movb $0x25,-0x69(%rbp) 462: e8 3a fd ff ff callq 1a1 <write> 467: 48 8d 75 96 lea -0x6a(%rbp),%rsi 46b: 44 88 6d 96 mov %r13b,-0x6a(%rbp) 46f: ba 01 00 00 00 mov $0x1,%edx 474: 44 89 e7 mov %r12d,%edi 477: e8 25 fd ff ff callq 1a1 <write> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 47c: 31 db xor %ebx,%ebx 47e: eb 05 jmp 485 <printf+0x1d1> state = 0; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ state = '%'; 480: bb 25 00 00 00 mov $0x25,%ebx 485: 49 ff c6 inc %r14 488: e9 65 fe ff ff jmpq 2f2 <printf+0x3e> putc(fd, c); } state = 0; } } } 48d: 48 83 c4 50 add $0x50,%rsp 491: 5b pop %rbx 492: 41 5c pop %r12 494: 41 5d pop %r13 496: 41 5e pop %r14 498: 5d pop %rbp 499: c3 retq 000000000000049a <free>: static Header base; static Header *freep; void free(void *ap) { 49a: 55 push %rbp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 49b: 48 8b 05 9e 03 00 00 mov 0x39e(%rip),%rax # 840 <__bss_start> void free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; 4a2: 48 8d 57 f0 lea -0x10(%rdi),%rdx static Header base; static Header *freep; void free(void *ap) { 4a6: 48 89 e5 mov %rsp,%rbp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 4a9: 48 39 d0 cmp %rdx,%rax 4ac: 48 8b 08 mov (%rax),%rcx 4af: 72 14 jb 4c5 <free+0x2b> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 4b1: 48 39 c8 cmp %rcx,%rax 4b4: 72 0a jb 4c0 <free+0x26> 4b6: 48 39 ca cmp %rcx,%rdx 4b9: 72 0f jb 4ca <free+0x30> 4bb: 48 39 d0 cmp %rdx,%rax 4be: 72 0a jb 4ca <free+0x30> static Header base; static Header *freep; void free(void *ap) { 4c0: 48 89 c8 mov %rcx,%rax 4c3: eb e4 jmp 4a9 <free+0xf> Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 4c5: 48 39 ca cmp %rcx,%rdx 4c8: 73 e7 jae 4b1 <free+0x17> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 4ca: 8b 77 f8 mov -0x8(%rdi),%esi 4cd: 49 89 f0 mov %rsi,%r8 4d0: 48 c1 e6 04 shl $0x4,%rsi 4d4: 48 01 d6 add %rdx,%rsi 4d7: 48 39 ce cmp %rcx,%rsi 4da: 75 0e jne 4ea <free+0x50> bp->s.size += p->s.ptr->s.size; 4dc: 44 03 41 08 add 0x8(%rcx),%r8d 4e0: 44 89 47 f8 mov %r8d,-0x8(%rdi) bp->s.ptr = p->s.ptr->s.ptr; 4e4: 48 8b 08 mov (%rax),%rcx 4e7: 48 8b 09 mov (%rcx),%rcx } else bp->s.ptr = p->s.ptr; 4ea: 48 89 4f f0 mov %rcx,-0x10(%rdi) if(p + p->s.size == bp){ 4ee: 8b 48 08 mov 0x8(%rax),%ecx 4f1: 48 89 ce mov %rcx,%rsi 4f4: 48 c1 e1 04 shl $0x4,%rcx 4f8: 48 01 c1 add %rax,%rcx 4fb: 48 39 ca cmp %rcx,%rdx 4fe: 75 0a jne 50a <free+0x70> p->s.size += bp->s.size; 500: 03 77 f8 add -0x8(%rdi),%esi 503: 89 70 08 mov %esi,0x8(%rax) p->s.ptr = bp->s.ptr; 506: 48 8b 57 f0 mov -0x10(%rdi),%rdx } else p->s.ptr = bp; 50a: 48 89 10 mov %rdx,(%rax) freep = p; 50d: 48 89 05 2c 03 00 00 mov %rax,0x32c(%rip) # 840 <__bss_start> } 514: 5d pop %rbp 515: c3 retq 0000000000000516 <malloc>: return freep; } void* malloc(uint nbytes) { 516: 55 push %rbp 517: 48 89 e5 mov %rsp,%rbp 51a: 41 55 push %r13 51c: 41 54 push %r12 51e: 53 push %rbx Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 51f: 89 fb mov %edi,%ebx return freep; } void* malloc(uint nbytes) { 521: 51 push %rcx Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ 522: 48 8b 0d 17 03 00 00 mov 0x317(%rip),%rcx # 840 <__bss_start> malloc(uint nbytes) { Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 529: 48 83 c3 0f add $0xf,%rbx 52d: 48 c1 eb 04 shr $0x4,%rbx 531: ff c3 inc %ebx if((prevp = freep) == 0){ 533: 48 85 c9 test %rcx,%rcx 536: 75 27 jne 55f <malloc+0x49> base.s.ptr = freep = prevp = &base; 538: 48 c7 05 fd 02 00 00 movq $0x850,0x2fd(%rip) # 840 <__bss_start> 53f: 50 08 00 00 543: 48 c7 05 02 03 00 00 movq $0x850,0x302(%rip) # 850 <base> 54a: 50 08 00 00 54e: 48 c7 c1 50 08 00 00 mov $0x850,%rcx base.s.size = 0; 555: c7 05 f9 02 00 00 00 movl $0x0,0x2f9(%rip) # 858 <base+0x8> 55c: 00 00 00 55f: 81 fb 00 10 00 00 cmp $0x1000,%ebx 565: 41 bc 00 10 00 00 mov $0x1000,%r12d } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 56b: 48 8b 01 mov (%rcx),%rax 56e: 44 0f 43 e3 cmovae %ebx,%r12d char *p; Header *hp; if(nu < 4096) nu = 4096; p = sbrk(nu * sizeof(Header)); 572: 45 89 e5 mov %r12d,%r13d 575: 41 c1 e5 04 shl $0x4,%r13d if((prevp = freep) == 0){ 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){ 579: 8b 50 08 mov 0x8(%rax),%edx 57c: 39 d3 cmp %edx,%ebx 57e: 77 26 ja 5a6 <malloc+0x90> if(p->s.size == nunits) 580: 75 08 jne 58a <malloc+0x74> prevp->s.ptr = p->s.ptr; 582: 48 8b 10 mov (%rax),%rdx 585: 48 89 11 mov %rdx,(%rcx) 588: eb 0f jmp 599 <malloc+0x83> else { p->s.size -= nunits; 58a: 29 da sub %ebx,%edx 58c: 89 50 08 mov %edx,0x8(%rax) p += p->s.size; 58f: 48 c1 e2 04 shl $0x4,%rdx 593: 48 01 d0 add %rdx,%rax p->s.size = nunits; 596: 89 58 08 mov %ebx,0x8(%rax) } freep = prevp; 599: 48 89 0d a0 02 00 00 mov %rcx,0x2a0(%rip) # 840 <__bss_start> return (void*)(p + 1); 5a0: 48 83 c0 10 add $0x10,%rax 5a4: eb 3a jmp 5e0 <malloc+0xca> } if(p == freep) 5a6: 48 3b 05 93 02 00 00 cmp 0x293(%rip),%rax # 840 <__bss_start> 5ad: 75 27 jne 5d6 <malloc+0xc0> char *p; Header *hp; if(nu < 4096) nu = 4096; p = sbrk(nu * sizeof(Header)); 5af: 44 89 ef mov %r13d,%edi 5b2: e8 52 fc ff ff callq 209 <sbrk> if(p == (char*)-1) 5b7: 48 83 f8 ff cmp $0xffffffffffffffff,%rax 5bb: 74 21 je 5de <malloc+0xc8> return 0; hp = (Header*)p; hp->s.size = nu; free((void*)(hp + 1)); 5bd: 48 8d 78 10 lea 0x10(%rax),%rdi nu = 4096; p = sbrk(nu * sizeof(Header)); if(p == (char*)-1) return 0; hp = (Header*)p; hp->s.size = nu; 5c1: 44 89 60 08 mov %r12d,0x8(%rax) free((void*)(hp + 1)); 5c5: e8 d0 fe ff ff callq 49a <free> return freep; 5ca: 48 8b 05 6f 02 00 00 mov 0x26f(%rip),%rax # 840 <__bss_start> } freep = prevp; return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) 5d1: 48 85 c0 test %rax,%rax 5d4: 74 08 je 5de <malloc+0xc8> return 0; } 5d6: 48 89 c1 mov %rax,%rcx nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 5d9: 48 8b 00 mov (%rax),%rax return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 5dc: eb 9b jmp 579 <malloc+0x63> freep = prevp; return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; 5de: 31 c0 xor %eax,%eax } } 5e0: 5a pop %rdx 5e1: 5b pop %rbx 5e2: 41 5c pop %r12 5e4: 41 5d pop %r13 5e6: 5d pop %rbp 5e7: c3 retq
29.13339
80
0.43902
96c8e28cb1c60f56df252a14a43fa32f9ab2a695
262
asm
Assembly
programs/oeis/070/A070472.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/070/A070472.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/070/A070472.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A070472: a(n) = n^3 mod 7. ; 0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1,6,1,6,6,0,1,1 pow $0,3 mov $1,$0 mod $1,7
37.428571
203
0.5
772d6088fe66fe361c00516f350c5c8203d87fb1
527
asm
Assembly
mc-sema/validator/x86/tests/SHUFPSrmi.asm
randolphwong/mcsema
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
[ "BSD-3-Clause" ]
2
2021-08-07T16:21:29.000Z
2021-11-17T10:58:37.000Z
mc-sema/validator/x86/tests/SHUFPSrmi.asm
randolphwong/mcsema
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
[ "BSD-3-Clause" ]
null
null
null
mc-sema/validator/x86/tests/SHUFPSrmi.asm
randolphwong/mcsema
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
[ "BSD-3-Clause" ]
null
null
null
BITS 32 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS=FLAG_SF|FLAG_PF ;TEST_FILE_META_END ;TEST_BEGIN_RECORDING lea ecx, [esp-0x30] and ecx, 0xFFFFFFF0 mov dword [ecx+0x00], 0xEEEEEEEE mov dword [ecx+0x04], 0xFFFFFFFF mov dword [ecx+0x08], 0x11111111 mov dword [ecx+0x0C], 0x22222222 movdqu xmm0, [ecx] mov dword [ecx+0x00], 0xAAAAAAAA mov dword [ecx+0x04], 0xBBBBBBBB mov dword [ecx+0x08], 0xCCCCCCCC mov dword [ecx+0x0C], 0xDDDDDDDD shufps xmm0, [ecx], 0x4E mov ecx, 0 ;TEST_END_RECORDING cvtsi2sd xmm0, ecx
19.518519
33
0.774194
455043529a7974b1dbf1d166ad45688d4d5cf09c
1,072
asm
Assembly
libsrc/fcntl/spectrum/zxbasdrv/readbyte.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
null
null
null
libsrc/fcntl/spectrum/zxbasdrv/readbyte.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
null
null
null
libsrc/fcntl/spectrum/zxbasdrv/readbyte.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
1
2019-12-03T23:57:48.000Z
2019-12-03T23:57:48.000Z
; ; Read a byte by the BASIC driver ; It is based on the INPUT-AD ROM routines, designed to get a char ; from the current stream. We trap errors too, because it happens ; that the shadow roms prefer to stop directly when an EOF is reached. ; ; Stefano - 5/7/2006 ; ; int __LIB__ __FASTCALL__ readbyte(int handle) ; ; $Id: readbyte.asm,v 1.5 2016/06/23 20:40:25 dom Exp $ SECTION code_clib PUBLIC readbyte PUBLIC _readbyte .readbyte ._readbyte ld a,l call $1601 ld bc,($5c3d) push bc ; save original ERR_SP ld bc,error push bc ld ($5c3d),sp ; update error handling routine .again call $15e6 ; INPUT-AD ccf ; we adapt the carry condition to the Z88DK requirements ld h,0 ld l,a jr nc,gotchar jr z,again ; No new char present.. try again ; We'll fall here rarely, I think ld hl,-1 ; EOF .gotchar pop bc pop bc ld ($5c3d),bc ; restore orginal ERR_SP ret ; Errors ? Probably it's an EOF ! .error pop bc ld ($5c3d),bc ; restore orginal ERR_SP ld (iy+0),255 ; reset ERR_NR ld (iy+124),0 ; clear FLAGS3 scf ccf ld hl,-1 ; EOF ret
18.807018
70
0.689366
458c3ae9490e20daf656fd9d26de1d30e6f97b35
596
asm
Assembly
oeis/081/A081267.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/081/A081267.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/081/A081267.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A081267: Diagonal of triangular spiral in A051682. ; 1,9,26,52,87,131,184,246,317,397,486,584,691,807,932,1066,1209,1361,1522,1692,1871,2059,2256,2462,2677,2901,3134,3376,3627,3887,4156,4434,4721,5017,5322,5636,5959,6291,6632,6982,7341,7709,8086,8472,8867,9271,9684,10106,10537,10977,11426,11884,12351,12827,13312,13806,14309,14821,15342,15872,16411,16959,17516,18082,18657,19241,19834,20436,21047,21667,22296,22934,23581,24237,24902,25576,26259,26951,27652,28362,29081,29809,30546,31292,32047,32811,33584,34366,35157,35957,36766,37584,38411,39247 mul $0,9 add $0,4 bin $0,2 div $0,9 add $0,1
66.222222
496
0.785235
eba2b78d633e38d2c23ccc215f90a7cba6b86af8
2,482
asm
Assembly
programs/oeis/212/A212523.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/212/A212523.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/212/A212523.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A212523: Number of (w,x,y,z) with all terms in {1,...,n} and w+x<y+z. ; 0,0,5,31,106,270,575,1085,1876,3036,4665,6875,9790,13546,18291,24185,31400,40120,50541,62871,77330,94150,113575,135861,161276,190100,222625,259155,300006,345506,395995,451825,513360,580976,655061,736015,824250,920190,1024271,1136941,1258660,1389900,1531145,1682891,1845646,2019930,2206275,2405225,2617336,2843176,3083325,3338375,3608930,3895606,4199031,4519845,4858700,5216260,5593201,5990211,6407990,6847250,7308715,7793121,8301216,8833760,9391525,9975295,10585866,11224046,11890655,12586525,13312500,14069436,14858201,15679675,16534750,17424330,18349331,19310681,20309320,21346200,22422285,23538551,24695986,25895590,27138375,28425365,29757596,31136116,32561985,34036275,35560070,37134466,38760571,40439505,42172400,43960400,45804661,47706351,49666650,51686750,53767855,55911181,58117956,60389420,62726825,65131435,67604526,70147386,72761315,75447625,78207640,81042696,83954141,86943335,90011650,93160470,96391191,99705221,103103980,106588900,110161425,113823011,117575126,121419250,125356875,129389505,133518656,137745856,142072645,146500575,151031210,155666126,160406911,165255165,170212500,175280540,180460921,185755291,191165310,196692650,202338995,208106041,213995496,220009080,226148525,232415575,238811986,245339526,251999975,258795125,265726780,272796756,280006881,287358995,294854950,302496610,310285851,318224561,326314640,334558000,342956565,351512271,360227066,369102910,378141775,387345645,396716516,406256396,415967305,425851275,435910350,446146586,456562051,467158825,477939000,488904680,500057981,511401031,522935970,534664950,546590135,558713701,571037836,583564740,596296625,609235715,622384246,635744466,649318635,663109025,677117920,691347616,705800421,720478655,735384650,750520750,765889311,781492701,797333300,813413500,829735705,846302331,863115806,880178570,897493075,915061785,932887176,950971736,969317965,987928375,1006805490,1025951846,1045369991,1065062485,1085031900,1105280820,1125811841,1146627571,1167730630,1189123650,1210809275,1232790161,1255068976,1277648400,1300531125,1323719855,1347217306,1371026206,1395149295,1419589325,1444349060,1469431276,1494838761,1520574315,1546640750,1573040890,1599777571,1626853641,1654271960,1682035400,1710146845,1738609191,1767425346,1796598230,1826130775,1856025925,1886286636,1916915876 mov $2,$0 lpb $0 lpb $0 sub $0,1 add $4,$2 lpe lpb $2 sub $2,1 add $4,1 add $3,$4 add $1,$3 lpe sub $1,$3 lpe
137.888889
2,264
0.852538
32d9cad1da39397455ab2a292f4397cc22ab393a
389
asm
Assembly
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_iy/sp1_GetTiles_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_iy/sp1_GetTiles_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_iy/sp1_GetTiles_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void sp1_GetTiles(struct sp1_Rect *r, struct sp1_tp *dest) SECTION code_clib SECTION code_temp_sp1 PUBLIC _sp1_GetTiles_callee, l0_sp1_GetTiles EXTERN asm_sp1_GetTiles _sp1_GetTiles_callee: pop af pop hl pop de push af l0_sp1_GetTiles: push de ld d,(hl) inc hl ld e,(hl) inc hl ld b,(hl) inc hl ld c,(hl) pop hl jp asm_sp1_GetTiles
12.15625
60
0.683805
df847db92e9b22806bea3b4c86fe22b4546215e2
428
asm
Assembly
oeis/028/A028080.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/028/A028080.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/028/A028080.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A028080: Expansion of 1/((1-3x)(1-6x)(1-8x)(1-10x)). ; Submitted by Jon Maiga ; 1,27,469,6687,85357,1016775,11565973,127403199,1371332413,14511863223,151627818277,1569077088111,16117515157069,164615225572071,1673829571276981,16960654592840223,171391059145733725 mov $1,1 mov $2,$0 mov $3,$0 lpb $2 mov $0,$3 mul $1,10 sub $2,1 sub $0,$2 seq $0,17932 ; Expansion of 1/((1-3x)(1-6x)(1-8x)). add $1,$0 lpe mov $0,$1
25.176471
183
0.698598
2746fb05f6b3e1b5a565f6cce89434bbcf2f2583
458
asm
Assembly
oeis/342/A342394.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/342/A342394.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/342/A342394.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A342394: a(n) = Sum_{k=1..n} k^(gcd(k,n) - 1). ; Submitted by Christian Krause ; 1,3,11,68,629,7793,117655,2097228,43046772,1000000649,25937424611,743008379146,23298085122493,793714773371841,29192926025401528,1152921504608945960,48661191875666868497,2185911559738739835591,104127350297911241532859 add $0,1 mov $2,$0 lpb $0 add $3,$1 cmp $3,$2 cmp $3,0 mul $3,$0 sub $0,1 mov $4,$2 gcd $4,$3 sub $4,1 pow $3,$4 add $1,$3 lpe mov $0,$1
22.9
218
0.696507
70ca8308dc58bec344a418d241f0776b14cf971d
2,438
asm
Assembly
programs/oeis/305/A305291.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/305/A305291.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/305/A305291.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A305291: Numbers k such that 4*k + 3 is a perfect cube, sorted by absolute values. ; -1,6,-32,85,-183,332,-550,843,-1229,1714,-2316,3041,-3907,4920,-6098,7447,-8985,10718,-12664,14829,-17231,19876,-22782,25955,-29413,33162,-37220,41593,-46299,51344,-56746,62511,-68657,75190,-82128,89477,-97255,105468,-114134,123259,-132861,142946,-153532,164625,-176243,188392,-201090,214343,-228169,242574,-257576,273181,-289407,306260,-323758,341907,-360725,380218,-400404,421289,-442891,465216,-488282,512095,-536673,562022,-588160,615093,-642839,671404,-700806,731051,-762157,794130,-826988,860737,-895395,930968,-967474,1004919,-1043321,1082686,-1123032,1164365,-1206703,1250052,-1294430,1339843,-1386309,1433834,-1482436,1532121,-1582907,1634800,-1687818,1741967,-1797265,1853718,-1911344,1970149,-2030151,2091356,-2153782,2217435,-2282333,2348482,-2415900,2484593,-2554579,2625864,-2698466,2772391,-2847657,2924270,-3002248,3081597,-3162335,3244468,-3328014,3412979,-3499381,3587226,-3676532,3767305,-3859563,3953312,-4048570,4145343,-4243649,4343494,-4444896,4547861,-4652407,4758540,-4866278,4975627,-5086605,5199218,-5313484,5429409,-5547011,5666296,-5787282,5909975,-6034393,6160542,-6288440,6418093,-6549519,6682724,-6817726,6954531,-7093157,7233610,-7375908,7520057,-7666075,7813968,-7963754,8115439,-8269041,8424566,-8582032,8741445,-8902823,9066172,-9231510,9398843,-9568189,9739554,-9912956,10088401,-10265907,10445480,-10627138,10810887,-10996745,11184718,-11374824,11567069,-11761471,11958036,-12156782,12357715,-12560853,12766202,-12973780,13183593,-13395659,13609984,-13826586,14045471,-14266657,14490150,-14715968,14944117,-15174615,15407468,-15642694,15880299,-16120301,16362706,-16607532,16854785,-17104483,17356632,-17611250,17868343,-18127929,18390014,-18654616,18921741,-19191407,19463620,-19738398,20015747,-20295685,20578218,-20863364,21151129,-21441531,21734576,-22030282,22328655,-22629713,22933462,-23239920,23549093,-23860999,24175644,-24493046,24813211,-25136157,25461890,-25790428,26121777,-26455955,26792968,-27132834,27475559,-27821161,28169646,-28521032,28875325,-29232543,29592692,-29955790,30321843,-30690869,31062874 mul $0,2 add $0,1 pow $0,3 lpb $0 add $2,29 sub $2,$0 add $5,4 mod $2,$5 add $2,1 mov $3,$2 sub $3,$0 mul $3,$2 add $3,1 add $4,$0 mov $0,$3 mul $4,2 sub $4,1 div $4,2 add $0,$4 sub $0,1 sub $3,2 lpe add $0,$3 mul $0,5 mov $1,$0 sub $1,135 div $1,20 add $1,6
76.1875
2,058
0.773175
5fd7f7603ef669f15384d5fec20332668a9d18d7
5,225
asm
Assembly
Library/Chart/Utils/utilsUI.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/Chart/Utils/utilsUI.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/Chart/Utils/utilsUI.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1992 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: utilsUI.asm AUTHOR: Chris Boyke METHODS: Name Description ---- ----------- FUNCTIONS: Scope Name Description ----- ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 1/23/92 Initial version. DESCRIPTION: $Id: utilsUI.asm,v 1.1 97/04/04 17:47:48 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UtilCombineEtype %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Combine an etype in the notification block with the current object's value CALLED BY: ChartGroupCombineChartType, ChartGroupCombineGroupFlags PASS: ds:si - etype in source object es:di - etype in notification block RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 1/22/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UtilCombineEtype proc far uses ax .enter EC_BOUNDS ds si EC_BOUNDS es di test es:[CNBH_flags], mask CCF_FOUND jz firstOne mov al, es:[di] cmp al, ds:[si] je done mov {byte} es:[di], -1 done: .leave ret firstOne: mov al, ds:[si] mov es:[di], al jmp done UtilCombineEtype endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UtilCombineFlags %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Update the notification block based on the current object's flags -- assume flags are an 8-bit record CALLED BY: EXTERNAL PASS: ds:si - flags in source object es:di - flags in notification block es:bp - record of "differences" RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 1/22/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UtilCombineFlags proc far uses ax .enter EC_BOUNDS es bp EC_BOUNDS es di test es:[CNBH_flags], mask CCF_FOUND jz firstOne mov al, ds:[si] xor al, es:[di] or es:[bp], al done: .leave ret firstOne: ; copy source flags directly to destination mov al, ds:[si] mov es:[di], al mov {byte} es:[bp], 0 jmp done UtilCombineFlags endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UtilStartCombine %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Lock the memory block whose handle is in CX, set ES to the segment, and move handle into BX CALLED BY: EXTERNAL PASS: cx - handle of notification block RETURN: bx - handle of notification block es - segment of notification block DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 1/23/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UtilStartCombine proc far uses ax .enter mov bx, cx call MemLock mov es, ax .leave ret UtilStartCombine endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UtilEndCombine %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Set the "Found" flag so that the notification block will have record of at least one object dealing with it. CALLED BY: EXTERNAL PASS: es:0 - ChartNotifyBlockHeader bx - handle of notification block at segment ES RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 1/23/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UtilEndCombine proc far if ERROR_CHECK ; ; Make sure BX is the handle of the block in ES ; push ax, bx mov ax, MGIT_ADDRESS call MemGetInfo mov bx, es cmp ax, bx ERROR_NE ILLEGAL_SEGMENT pop ax, bx endif ornf es:[CNBH_flags], mask CCF_FOUND call MemUnlock ret UtilEndCombine endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UtilUpdateUI %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Update the user interface CALLED BY: EXTERNAL PASS: cx - UpdateFlags RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 1/23/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UtilUpdateUI proc far uses ax .enter mov ax, MSG_CHART_BODY_UPDATE_UI call UtilCallChartBody .leave ret UtilUpdateUI endp
19.642857
71
0.503541
7fda979f90847e584671df24411ad12289bb8b98
638
asm
Assembly
oeis/208/A208296.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/208/A208296.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/208/A208296.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A208296: Smallest positive nontrivial odd solution of the congruence x^2 == 1 (mod A001748(n+2)), n >= 1. ; Submitted by Jon Maiga ; 11,13,23,25,35,37,47,59,61,73,83,85,95,107,119,121,133,143,145,157,167,179,193,203,205,215,217,227,253,263,275,277,299,301,313,325,335,347,359,361,383,385,395,397,421,445,455,457,467,479,481,503,515,527,539,541,553,563,565,587,613,623,625,635,661,673,695,697,707,719,733,745,757,767,779,793,803,817,839,841,863,865,877,887,899,913,923,925,935,959,973,983,997,1007,1019,1043,1045,1081,1093,1115 seq $0,173064 ; a(n) = prime(n) - 5. seq $0,47249 ; Numbers that are congruent to {3, 4, 5} mod 6. add $0,8
79.75
395
0.711599
6708b1786a1c2313e0d79a491835b8a1d07140ab
145
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math16/c/sccz80/cm16_sccz80_atan.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/math/float/math16/c/sccz80/cm16_sccz80_atan.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/math/float/math16/c/sccz80/cm16_sccz80_atan.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_fp_math16 PUBLIC cm16_sccz80_atan EXTERN cm16_sccz80_read1, atanf16 cm16_sccz80_atan: call cm16_sccz80_read1 jp atanf16
13.181818
33
0.82069
1b55f5af4761ed1ff2e543e1dbdf0de7d02c7fcf
3,205
asm
Assembly
dino/lcs/item/80.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
6
2020-10-14T15:29:10.000Z
2022-02-12T18:58:54.000Z
dino/lcs/item/80.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
null
null
null
dino/lcs/item/80.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
1
2020-12-17T08:59:10.000Z
2020-12-17T08:59:10.000Z
copyright zengfr site:http://github.com/zengfr/romhack 00042A move.l D1, (A0)+ 00042C dbra D0, $42a 004D38 move.l D0, (A4)+ 004D3A move.l D0, (A4)+ 0246BC move.b D0, ($80,A6) 0246C0 beq $24714 [item+80] 0248B0 move.b #$1e, ($80,A6) 0248B6 move.l #$2000200, ($4,A6) [item+80] 024934 move.b #$1e, ($80,A6) 02493A move.l #$2000200, ($4,A6) [item+80] 024E12 move.b #$5, ($80,A6) [item+6A] 024E18 bra $25060 [item+80] 024E30 clr.b ($80,A6) [item+A2] 024E34 moveq #$30, D0 02546C subq.b #1, ($80,A6) 025470 bne $25490 [item+80] 025474 move.b #$5, ($80,A6) 02547A jsr $6248.l [item+80] 0255D2 move.b D4, ($80,A6) 0255D6 andi.w #$1, D4 [item+80] 02625A move.b #$a, ($80,A6) [item+ 4, item+ 6] 026260 move.b #$2, ($81,A6) [item+80] 02639A move.b #$1e, ($80,A6) 0263A0 moveq #$11, D0 [item+80] 0263AC subq.b #1, ($80,A6) [item+ 6] 0263B0 bcc $263ba [item+80] 0263CC subq.b #1, ($80,A6) 0263D0 bne $26406 [item+80] 0263D4 move.b #$a, ($80,A6) 0263DA moveq #$0, D0 [item+80] 028DB0 move.b #$32, ($80,A6) [item+6A] 028DB6 moveq #$0, D0 [item+80] 028EBA subq.b #1, ($80,A6) 028EBE bcc $28ece [item+80] 028EC2 move.b #$32, ($80,A6) 028EC8 move.b #$84, ($23,A6) [item+80] 029142 move.b #$1, ($80,A6) [item+81] 029148 move.b #$3c, ($b1,A6) [item+80] 02918E subq.b #1, ($80,A6) 029192 bne $291b2 [item+80] 02919A move.b ($81,A6), ($80,A6) [item+81] 0291A0 jsr $173c.l [item+80] 02A42C move.b D0, ($80,A6) 02A430 addq.b #2, ($4,A6) [item+80] 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] 0AAACE move.w D0, ($2,A0) 0AAAD2 cmp.l (A0), D0 0AAAD4 bne $aaafc 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
53.416667
350
0.624961
58472619b4a5e478d0ea0e875718dcd5b852456f
1,885
asm
Assembly
maps/ViridianNicknameSpeechHouse.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
maps/ViridianNicknameSpeechHouse.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
maps/ViridianNicknameSpeechHouse.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
object_const_def ; object_event constants const VIRIDIANNICKNAMESPEECHHOUSE_POKEFAN_M const VIRIDIANNICKNAMESPEECHHOUSE_LASS const VIRIDIANNICKNAMESPEECHHOUSE_SPEARY const VIRIDIANNICKNAMESPEECHHOUSE_RATTEY ViridianNicknameSpeechHouse_MapScripts: db 0 ; scene scripts db 0 ; callbacks ViridianNicknameSpeechHousePokefanMScript: jumptextfaceplayer ViridianNicknameSpeechHousePokefanMText ViridianNicknameSpeechHouseLassScript: jumptextfaceplayer ViridianNicknameSpeechHouseLassText Speary: opentext writetext SpearyText cry SPEAROW waitbutton closetext end Rattey: opentext writetext RatteyText cry RATTATA waitbutton closetext end ViridianNicknameSpeechHousePokefanMText: text "Do you put a lot" line "of thought into" para "naming your" line "#MON?" para "Giving them good" line "nicknames adds to" para "the fun of trading" line "with others." done ViridianNicknameSpeechHouseLassText: text "They're SPEARY--" line "a SPEAROW--and" cont "RATTEY--a RATTATA." done SpearyText: text "SPEARY: Ch-chun!" done RatteyText: text "RATTEY: Kikiii!" done ViridianNicknameSpeechHouse_MapEvents: db 0, 0 ; filler db 2 ; warp events warp_event 2, 7, VIRIDIAN_CITY, 2 warp_event 3, 7, VIRIDIAN_CITY, 2 db 0 ; coord events db 0 ; bg events db 4 ; object events object_event 2, 4, SPRITE_POKEFAN_M, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, ViridianNicknameSpeechHousePokefanMScript, -1 object_event 5, 4, SPRITE_LASS, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, ViridianNicknameSpeechHouseLassScript, -1 object_event 5, 2, SPRITE_MOLTRES, SPRITEMOVEDATA_POKEMON, 2, 0, -1, -1, PAL_NPC_BROWN, OBJECTTYPE_SCRIPT, 0, Speary, -1 object_event 6, 3, SPRITE_GROWLITHE, SPRITEMOVEDATA_POKEMON, 2, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, Rattey, -1
24.166667
165
0.788859
ea797672dde4cf006642e65fdcba1d7b00972d58
266
asm
Assembly
libsrc/target/smc777/stdio/conio_vars.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/target/smc777/stdio/conio_vars.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/target/smc777/stdio/conio_vars.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
MODULE console_vars PUBLIC __smc777_mode PUBLIC __smc777_attr PUBLIC __smc777_paper16 PUBLIC __smc777_ink16 SECTION data_clib __smc777_mode: defb 0 __smc777_attr: defb 7 __smc777_ink16: defb $7 ;white __smc777_paper16: defb $c ;light cyan
15.647059
38
0.766917
ecf5846e45a34382a6643366d4df9b71e41d36d1
175
asm
Assembly
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_saddr2aaddr.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
38
2021-06-18T12:56:15.000Z
2022-03-12T20:38:40.000Z
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_saddr2aaddr.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
2
2021-06-20T16:28:12.000Z
2021-11-17T21:33:56.000Z
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_saddr2aaddr.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
6
2021-06-18T18:18:36.000Z
2021-12-22T08:01:32.000Z
; void *tshc_saddr2aaddr(void *saddr) SECTION code_clib SECTION code_arch PUBLIC tshc_saddr2aaddr EXTERN asm_tshc_saddr2aaddr defc tshc_saddr2aaddr = asm_tshc_saddr2aaddr
15.909091
44
0.851429
08ceda1252e7dfd716f05f7a7f6b72fb199953d4
3,774
asm
Assembly
Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2_notsx.log_29_540.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2_notsx.log_29_540.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2_notsx.log_29_540.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r14 push %r9 push %rcx push %rdi push %rsi lea addresses_WC_ht+0x165f, %r9 nop nop nop sub $33876, %r14 vmovups (%r9), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %r13 nop inc %r14 lea addresses_D_ht+0x3bdf, %rsi lea addresses_WC_ht+0x1c9df, %rdi nop sub %r9, %r9 mov $26, %rcx rep movsl nop nop dec %rdi lea addresses_UC_ht+0x1999f, %rsi lea addresses_WC_ht+0x1be8b, %rdi nop nop nop nop dec %r14 mov $25, %rcx rep movsb nop nop nop nop nop dec %r14 lea addresses_UC_ht+0xabdf, %rsi lea addresses_D_ht+0x4adf, %rdi nop nop nop nop nop dec %r10 mov $14, %rcx rep movsb nop dec %rdi lea addresses_D_ht+0xc423, %r14 nop nop cmp %r9, %r9 mov (%r14), %edi nop inc %r14 lea addresses_D_ht+0x176af, %rsi lea addresses_normal_ht+0x54df, %rdi nop inc %r9 mov $75, %rcx rep movsl nop nop dec %rcx pop %rsi pop %rdi pop %rcx pop %r9 pop %r14 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r8 push %rax push %rbp push %rbx push %rcx push %rsi // Load mov $0x719a940000000bdf, %rbp nop nop nop inc %r11 movntdqa (%rbp), %xmm5 vpextrq $0, %xmm5, %rax nop nop nop nop sub %r11, %r11 // Load lea addresses_UC+0xb3df, %rbx nop nop nop inc %rax movups (%rbx), %xmm5 vpextrq $0, %xmm5, %r11 nop xor %rsi, %rsi // Store lea addresses_WT+0x1981f, %rbp dec %rsi movb $0x51, (%rbp) nop nop nop nop nop xor %r8, %r8 // Store lea addresses_PSE+0x4366, %rsi nop nop nop nop sub $53135, %rcx movw $0x5152, (%rsi) and %rsi, %rsi // Store lea addresses_normal+0x1eeff, %rbx nop and $15363, %r11 mov $0x5152535455565758, %r8 movq %r8, %xmm4 vmovups %ymm4, (%rbx) nop nop nop dec %rsi // Faulty Load mov $0x719a940000000bdf, %rsi nop nop nop nop sub %r8, %r8 movb (%rsi), %cl lea oracles, %rsi and $0xff, %rcx shlq $12, %rcx mov (%rsi,%rcx,1), %rcx pop %rsi pop %rcx pop %rbx pop %rbp pop %rax pop %r8 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': True, 'NT': True, 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}} {'00': 29} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
19.759162
151
0.647059
57388e0895ae52b95647f778f6942d86ebb8cb1f
560
asm
Assembly
programs/oeis/335/A335262.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/335/A335262.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/335/A335262.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A335262: Triangle of triangular numbers, read by rows, constructed like this: Given a sequence t, start row 0 with t(0). Compute row n for n > 0 by reversing row n-1 and prepending t(n). The sequence t is here chosen as the triangular numbers. ; 0,1,0,3,0,1,6,1,0,3,10,3,0,1,6,15,6,1,0,3,10,21,10,3,0,1,6,15,28,15,6,1,0,3,10,21,36,21,10,3,0,1,6,15,28,45,28,15,6,1,0,3,10,21,36,55,36,21,10,3,0,1,6,15,28,45,66,45,28,15,6,1,0,3,10,21,36,55 mul $0,2 mov $1,2 lpb $0 sub $0,1 sub $1,2 add $0,$1 lpe mov $1,$0 pow $0,2 add $1,3 add $1,$0 sub $1,2 div $1,2
32.941176
245
0.646429
4de153e806a9f7bed9d1b566b7229cec993d23df
8,229
asm
Assembly
source/cynthmidi.asm
brijohn/cynthcart
c2f4c72f90ca26a5209e08f5006db31b4737d4e7
[ "MIT" ]
25
2019-02-05T03:06:22.000Z
2022-03-03T12:51:34.000Z
source/cynthmidi.asm
brijohn/cynthcart
c2f4c72f90ca26a5209e08f5006db31b4737d4e7
[ "MIT" ]
null
null
null
source/cynthmidi.asm
brijohn/cynthcart
c2f4c72f90ca26a5209e08f5006db31b4737d4e7
[ "MIT" ]
7
2019-03-13T12:36:59.000Z
2021-10-03T13:33:01.000Z
; public MIDI interface routines: ; midiDetect ; midiInit ; midiRead ; midiWrite ; interface type for midiDetect and midiInit: ; 0: no MIDI interface was detected ; 1: Sequential Circuits Inc. ; 2: Passport & Syntech ; 3: DATEL/Siel/JMS ; 4: Namesoft ;BUFFER_SIZE_MASK equ #$1F ; original size BUFFER_SIZE_MASK equ #$FF processor 6502 TRUE equ 1 FALSE equ 0 PRA equ $dc00 ; CIA#1 (Port Register A) DDRA equ $dc02 ; CIA#1 (Data Direction Register A) PRB equ $dc01 ; CIA#1 (Port Register B) DDRB equ $dc03 ; CIA#1 (Data Direction Register B) ;loopCount equ 1104 ;irqCountTotal equ 1105 ;irqCountMidi equ 1106 ;irqCountTDREmpty equ 1107 ;saveY equ 1140 ;firstPass equ 1141 statusSample1 equ 1104 statusSample2 equ 1105 TEST_KEYBOARD equ FALSE INCLUDE_DETECT_IRQ equ FALSE ;========================================================================= ; MIDI DETECT ; ========================================================================= ; detect MIDI interface, return type in accu midiDetect: ; TODO ;lda #0 ;sta irqCountTotal ;sta irqCountMidi ;sta loopCount ; old code to manually set interface type lda #3 ; DATEL (DEFAULT, THIS ONE SHOULD BE SELECTED UNLESS DEBUGGING) ;lda #2 ; PASSPORT ;lda #4 ; NAMESOFT (NOT SUPPORTED YET!) ;lda #0 ; MIDI OFF IF DEVICE_CONFIG=KERBEROS rts ; <--DETECT FUNCTION DISABLED ENDIF sta midiInterfaceType testingLoop: ; save interface type from ACC lda midiInterfaceType tax dex sei ; disable IRQ interrupts ;cli ; enable IRQ interrupts ; init addresses lda midiControlOfs,x sta midiControl lda midiStatusOfs,x sta midiStatus lda midiTxOfs,x sta midiTx lda midiRxOfs,x sta midiRx lda #$de sta midiControl+1 sta midiStatus+1 sta midiTx+1 sta midiRx+1 ; send reset code to MIDI adapter jsr midiReset ; small delay ldx #0 detectDelay1: dex bne detectDelay1 ; read midi status lda (midiStatus),y ora (midiStatus),y ora (midiStatus),y sta 1024+160 ; DEBUG sta statusSample1 ; enable IRQ/NMI ;lda #3 ; MIDI reset (DEBUG) lda #$B4 ; $Bx turns on transmit interrupt as well as receive interrupt ;lda #$34 ; transmit interrupt only ;lda #$94 ; receive interrupt only (default) ora midiCr0Cr1,x sta (midiControl),y ; small delay ldx #0 detectDelay2: dex bne detectDelay2 ; read midi status ldy #0 lda (midiStatus),y ora (midiStatus),y ora (midiStatus),y sta 1024+160+1 ; DEBUG sta statusSample2 lock: ; DEBUG!!!!!!!!!!!!!!!!!!!! ;inc 1065 ;jmp lock ; DEBUG!!!!!!!!!!!!!!!!!!!! ; set the interface to DATEL or NO_MIDI based on results lda statusSample1 bne midiNotDetected lda statusSample2 beq midiNotDetected ;lda midiInterfaceType ; use current interface ;cli ;rts ; quit jmp quitDetect midiNotDetected: ldx midiInterfaceType dex stx midiInterfaceType ;cpx #1 beq noMidi ; loop again to try next interface jmp testingLoop noMidi: lda #0 ; last interface, so no MIDI sta midiInterfaceType ;cli ;rts ; quit quitDetect: jsr midiReset lda midiInterfaceType cli rts ;;------------------------------------==================================== ; ========================================================================= ; MIDI INIT ; ========================================================================= ; init MIDI interface, type in accu from midiDetect midiInit: ;rts ; <-- MIDI DISABLED (DEBUG!!) sei ; disable IRQ interrupts sta midiInterfaceType tax dex lda #$ff ; CIA#1 port A = outputs sta DDRA lda #0 ; CIA#1 port B = inputs sta DDRB ; clear memory variables lda #0 sta keyPressed sta keyTestIndex sta keyPressedIntern ; init addresses lda midiControlOfs,x sta midiControl lda midiStatusOfs,x sta midiStatus lda midiTxOfs,x sta midiTx lda midiRxOfs,x sta midiRx lda #$de sta midiControl+1 sta midiStatus+1 sta midiTx+1 sta midiRx+1 ; send reset code to MIDI adapter jsr midiReset ; clear ringbuffer lda #0 sta midiRingbufferReadIndex sta midiRingbufferWriteIndex ; if the adapter uses NMI interrupts instead of IRQ lda midiIrqType,x bne midiSetIrq ; set NMI routine lda #<midiNmi sta $0318 lda #>midiNmi sta $0319 ; set IRQ routine midiSetIrq: ;--------------------------- lda #<midiIrq sta $0314 lda #>midiIrq sta $0315 ;--------------------------- ; enable IRQ/NMI lda #$94 ora midiCr0Cr1,x sta (midiControl),y cli rts ; ========================================================================= midiRelease: sei jsr midiReset lda #$31 sta $0314 lda #$ea sta $0315 lda #$47 sta $0318 lda #$fe sta $0319 cli rts ; MC68B50 master reset and IRQ off midiReset: ldy #0 lda #3 sta (midiControl),y rts midiCanRead: ldx midiRingbufferReadIndex cpx midiRingbufferWriteIndex rts ; read MIDI byte from ringbuffer midiRead: ldx midiRingbufferReadIndex ; if the read and write pointers are different... cpx midiRingbufferWriteIndex bne processMidi ; Slocum: modified to not wait for data... ;beq midiRead rts ; No new data, so return ; wait for MIDI byte and read it from ringbuffer midiReadWait: ldx midiRingbufferReadIndex ; if the read and write pointers are different... cpx midiRingbufferWriteIndex bne processMidi ; Slocum: modified to not wait for data... jmp midiReadWait ;rts ; No new data, so return processMidi: ; read next character from ringbuffer lda midiRingbuffer,x tay ; save next byte into y inx ; increment buffer pointer... txa ;and #31 ; wrap around at end and #BUFFER_SIZE_MASK sta midiRingbufferReadIndex ; save it tya ; the byte read from the buffer ends up in both y and a ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; DEBUG - SHOW MIDI DATA IF DEBUG_SHOW_MIDI=1 ;IF DEBUG_DISPLAY=1 sta temp bpl notStatusByte lda #$E sta hexDispColor jmp endColor notStatusByte lda #$F sta hexDispColor endColor: lda debugOffset and #$F0 lsr lsr lsr tax ;ldx #34 lda debugOffset and #$0F tay iny iny iny iny iny iny lda temp jsr displayHex inc debugOffset ;ldy debugOffset ;iny ;tya ;and #$0F ;sta debugOffset ;adc #5 ;tay lda temp ldy temp ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; rts ; write MIDI byte and wait for write complete midiWrite: rts ; TODO ; NMI handler midiNmi: pha txa pha tya pha ; test if it was a NMI from the MIDI interface ldy #0 lda (midiStatus),y and #1 beq midiNmiEnd jsr midiStore midiNmiEnd: pla tay pla tax pla rti ; IRQ handler midiIrq: ldx midiInterfaceType dex lda midiIrqType,x beq midiIrqKey ; test if it was an IRQ from the MIDI interface ldy #0 lda (midiStatus),y and #1 beq midiIrqKey jsr midiStore jmp midiNmiEnd ; keyboard test midiIrqKey: IF TEST_KEYBOARD=1 jsr keyboardTest ENDIF lda $dc0d jmp midiNmiEnd ; get MIDI byte and store in ringbuffer midiStore: lda (midiRx),y ldx midiRingbufferWriteIndex sta midiRingbuffer,x inx txa ;and #31 and #BUFFER_SIZE_MASK sta midiRingbufferWriteIndex rts ; MC68B50 control register (relative to $de00) midiControlOfs: .byte 0, 8, 4, 0 ; MC68B50 status register midiStatusOfs: .byte 2, 8, 6, 2 ; MC68B50 TX register midiTxOfs: .byte 1, 9, 5, 1 ; MC68B50 RX register offset midiRxOfs: .byte 3, 9, 7, 3 ; counter divide bits CR0 and CR1 for the MC68B50 midiCr0Cr1: .byte 1, 1, 2, 1 ; 1=IRQ, 0=NMI midiIrqType: .byte 1, 1, 1, 0 IF TEST_KEYBOARD=1 ; keyboard test keyboardTest: ldx keyTestIndex lda keys,x ; load colum sta PRA inx lda PRB and keys,x ; mask row inx cmp #0 bne kbt2 lda keys,x cmp #$80 bne jump1 inc shiftPressed bne kbt2 jump1: sta keyPressedIntern kbt2: inx cpx #18 bne kbt3 ldx keyPressedIntern beq jump2 lda shiftPressed beq jump2 inx jump2: stx keyPressed bne jump3 lda shiftPressed beq jump3 lda #$40 sta keyPressed jump3: ldx #0 stx shiftPressed stx keyPressedIntern kbt3: stx keyTestIndex rts keys: .byte %11111110, %00010000, 1 ; F1 .byte %11111110, %00100000, 3 ; F3 .byte %11111110, %01000000, 5 ; F5 .byte %11111110, %00001000, 7 ; F7 .byte %10111111, %00010000, $80 ; right shift .byte %10111101, %10000000, $80 ; left shift ENDIF
17.583333
78
0.658403
8efb03740dc39234e1e07479ba9594f1ceb28a66
3,173
asm
Assembly
test/cases/cl64-sum.asm
dvirtz/compiler-explorer
d6a026f3f788aa2a2c3ca490248dc125d0bb6a88
[ "BSD-2-Clause" ]
null
null
null
test/cases/cl64-sum.asm
dvirtz/compiler-explorer
d6a026f3f788aa2a2c3ca490248dc125d0bb6a88
[ "BSD-2-Clause" ]
null
null
null
test/cases/cl64-sum.asm
dvirtz/compiler-explorer
d6a026f3f788aa2a2c3ca490248dc125d0bb6a88
[ "BSD-2-Clause" ]
null
null
null
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23918.0 INCLUDELIB LIBCMT INCLUDELIB OLDNAMES PUBLIC ?testFunction@@YAHPEAHH@Z ; COMDAT pdata pdata SEGMENT $pdata$?testFunction@@YAHPEAHH@Z DD imagerel $LN22 DD imagerel $LN22+225 DD imagerel $unwind$?testFunction@@YAHPEAHH@Z pdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$?testFunction@@YAHPEAHH@Z DD 020501H DD 013405H xdata ENDS ; Function compile flags: /Ogtpy ; COMDAT ?testFunction@@YAHPEAHH@Z _TEXT SEGMENT input$ = 8 length$ = 16 testFunction, COMDAT PROC $LN22: 0000 00 01 mov QWORD PTR [rsp+8], rbx 0000 00 01 xor r8d, r8d 0000 00 01 movsxd rbx, edx 0000 00 01 mov r9, rcx 0000 00 01 mov r11d, r8d 0000 00 01 mov r10d, r8d 0000 00 01 test edx, edx 0000 00 01 jle SHORT $LN9@testFuncti 0000 00 01 cmp ebx, 8 0000 00 01 jb SHORT $LN9@testFuncti 0000 00 01 mov eax, ebx 0000 00 01 and eax, -2147483641 ; ffffffff80000007H 0000 00 01 jge SHORT $LN19@testFuncti 0000 00 01 dec eax 0000 00 01 or eax, -8 0000 00 01 inc eax $LN19@testFuncti: 0000 00 01 mov edx, ebx 0000 00 01 xorps xmm2, xmm2 0000 00 01 sub edx, eax 0000 00 01 movdqa xmm1, xmm2 0000 00 01 npad 8 $LL4@testFuncti: 0000 00 01 movsxd rax, r10d 0000 00 01 movdqu xmm0, XMMWORD PTR [r9+rax*4] 0000 00 01 lea eax, DWORD PTR [r10+4] 0000 00 01 add r10d, 8 0000 00 01 movsxd rcx, eax 0000 00 01 paddd xmm0, xmm2 0000 00 01 movdqa xmm2, xmm0 0000 00 01 movdqu xmm0, XMMWORD PTR [r9+rcx*4] 0000 00 01 paddd xmm0, xmm1 0000 00 01 movdqa xmm1, xmm0 0000 00 01 cmp r10d, edx 0000 00 01 jl SHORT $LL4@testFuncti 0000 00 01 paddd xmm1, xmm2 0000 00 01 movdqa xmm0, xmm1 0000 00 01 psrldq xmm0, 8 0000 00 01 paddd xmm1, xmm0 0000 00 01 movdqa xmm0, xmm1 0000 00 01 psrldq xmm0, 4 0000 00 01 paddd xmm1, xmm0 0000 00 01 movd r11d, xmm1 $LN9@testFuncti: 0000 00 01 movsxd rcx, r10d 0000 00 01 mov edx, r8d 0000 00 01 cmp rcx, rbx 0000 00 01 jge SHORT $LN20@testFuncti 0000 00 01 mov rax, rbx 0000 00 01 sub rax, rcx 0000 00 01 cmp rax, 2 0000 00 01 jl SHORT $LC14@testFuncti 0000 00 01 lea rax, QWORD PTR [rbx-1] 0000 00 01 npad 3 $LL16@testFuncti: 0000 00 01 add r8d, DWORD PTR [r9+rcx*4] 0000 00 01 add edx, DWORD PTR [r9+rcx*4+4] 0000 00 01 add rcx, 2 0000 00 01 cmp rcx, rax 0000 00 01 jl SHORT $LL16@testFuncti $LC14@testFuncti: 0000 00 01 cmp rcx, rbx 0000 00 01 jge SHORT $LN15@testFuncti 0000 00 01 add r11d, DWORD PTR [r9+rcx*4] $LN15@testFuncti: 0000 00 01 lea eax, DWORD PTR [rdx+r8] 0000 00 01 add eax, r11d 0000 00 01 mov rbx, QWORD PTR [rsp+8] 0000 00 01 ret 0 $LN20@testFuncti: 0000 00 01 mov rbx, QWORD PTR [rsp+8] 0000 00 01 mov eax, r11d 0000 00 01 ret 0 testFunction ENDP _TEXT ENDS END
27.833333
79
0.618657
b74125df1eae8462fbf11b756c03d7461d2570ec
5,747
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1278.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1278.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1278.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r14 push %r15 push %r8 push %rax push %rcx push %rdi push %rsi lea addresses_D_ht+0x80a4, %rsi lea addresses_D_ht+0x18cd8, %rdi nop dec %r15 mov $113, %rcx rep movsq nop nop nop nop nop add %r14, %r14 lea addresses_normal_ht+0x13a54, %rsi lea addresses_normal_ht+0x1ed68, %rdi nop nop nop dec %rax mov $83, %rcx rep movsw nop nop nop nop nop xor $30597, %r15 lea addresses_WC_ht+0x68d8, %rsi lea addresses_D_ht+0x8deb, %rdi nop and $51564, %r12 mov $7, %rcx rep movsl dec %rax lea addresses_WT_ht+0x1ba18, %rsi lea addresses_normal_ht+0x15fd8, %rdi nop nop nop sub $23065, %r8 mov $78, %rcx rep movsl nop nop nop nop nop and $28516, %rsi lea addresses_D_ht+0x1c4d8, %rsi lea addresses_WC_ht+0x12618, %rdi clflush (%rdi) nop nop nop nop add %rax, %rax mov $124, %rcx rep movsq nop nop nop dec %r15 lea addresses_D_ht+0xf4d8, %rdi nop nop mfence mov $0x6162636465666768, %r15 movq %r15, (%rdi) nop cmp %rax, %rax lea addresses_A_ht+0x34c5, %rsi nop nop nop nop dec %r14 mov (%rsi), %r15w nop add %rsi, %rsi pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r15 pop %r14 pop %r12 ret .global s_faulty_load s_faulty_load: push %r13 push %r8 push %rbp push %rdi push %rdx // Faulty Load lea addresses_WT+0xd4d8, %r8 inc %rbp mov (%r8), %edi lea oracles, %r13 and $0xff, %rdi shlq $12, %rdi mov (%r13,%rdi,1), %rdi pop %rdx pop %rdi pop %rbp pop %r8 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 10, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'src': {'congruent': 5, 'same': True, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 8, 'same': True, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'39': 21829} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
41.345324
2,999
0.663999
48e50da422bef4ed8946bb8cf3343cd737860955
5,746
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i7-7700_9_0xca.log_21829_1832.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i7-7700_9_0xca.log_21829_1832.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i7-7700_9_0xca.log_21829_1832.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r12 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0xbd6b, %r12 nop cmp %rcx, %rcx mov (%r12), %edx nop nop nop nop cmp $4672, %rdi lea addresses_A_ht+0x855e, %rsi lea addresses_WT_ht+0x1dacb, %rdi nop nop dec %rax mov $127, %rcx rep movsw and $16750, %rsi lea addresses_UC_ht+0x185cb, %rsi lea addresses_normal_ht+0x1acb, %rdi nop nop nop dec %r11 mov $65, %rcx rep movsq nop nop nop nop sub $20491, %r11 lea addresses_WT_ht+0x4acb, %r12 and $5646, %rcx mov $0x6162636465666768, %rdi movq %rdi, %xmm2 vmovups %ymm2, (%r12) nop nop nop sub $21544, %rsi lea addresses_UC_ht+0xc8cb, %rsi lea addresses_WT_ht+0x1967d, %rdi clflush (%rsi) nop nop nop nop sub $10024, %r10 mov $118, %rcx rep movsl nop nop nop dec %rdx lea addresses_normal_ht+0x1d52b, %r12 nop nop nop nop cmp %r11, %r11 mov (%r12), %ax nop nop nop nop dec %r11 lea addresses_D_ht+0x152cb, %rdi nop xor %rdx, %rdx mov (%rdi), %ax xor %r12, %r12 pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r15 push %rax push %rbp push %rcx push %rdx // Faulty Load mov $0x2cb, %rax nop nop nop add $5432, %r11 vmovntdqa (%rax), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $0, %xmm6, %rcx lea oracles, %rdx and $0xff, %rcx shlq $12, %rcx mov (%rdx,%rcx,1), %rcx pop %rdx pop %rcx pop %rbp pop %rax pop %r15 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_P'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': True, 'type': 'addresses_P'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'45': 986, '00': 20843} 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
41.637681
2,999
0.660982
2f25385e2f2fb7d620e60a421eef5f446c6b914e
571
asm
Assembly
subs/getsmmod.asm
DigitalMars/optlink
493de158282046641ef2a3a60a88e25e26d88ec4
[ "BSL-1.0" ]
28
2015-02-03T01:38:24.000Z
2022-03-23T05:48:24.000Z
subs/getsmmod.asm
DigitalMars/optlink
493de158282046641ef2a3a60a88e25e26d88ec4
[ "BSL-1.0" ]
20
2015-01-02T14:51:20.000Z
2021-01-09T21:37:19.000Z
subs/getsmmod.asm
DigitalMars/optlink
493de158282046641ef2a3a60a88e25e26d88ec4
[ "BSL-1.0" ]
9
2015-02-11T17:43:56.000Z
2019-09-05T11:07:02.000Z
TITLE GETSMMOD - Copyright (c) SLR Systems 1994 INCLUDE MACROS INCLUDE SEGMENTS INCLUDE MODULES PUBLIC GET_SM_MODULE .DATA EXTERNDEF CSEG_GARRAY:STD_PTR_S .CODE ROOT_TEXT GET_SM_MODULE PROC ; ;EAX IS SEGMOD PHYSICAL, RETURN EAX IS PARENT MODULE GINDEX ; ASSUME EAX:PTR SEGMOD_STRUCT MOV CL,[EAX]._SM_FLAGS_2 MOV EAX,[EAX]._SM_MODULE_CSEG_GINDEX AND CL,MASK SM2_CSEG_DONE JNZ L1$ RET L1$: CONVERT EAX,EAX,CSEG_GARRAY ASSUME EAX:PTR CSEG_STRUCT MOV EAX,[EAX]._CSEG_PARENT_MOD_GINDEX RET GET_SM_MODULE ENDP END
12.688889
61
0.732049
9a1e5442c4c0333c3d5f2603631380e6365702a2
521
asm
Assembly
libsrc/_DEVELOPMENT/arch/ts2068/display/z80/asm_tshc_saddrpright.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/ts2068/display/z80/asm_tshc_saddrpright.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/ts2068/display/z80/asm_tshc_saddrpright.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; =============================================================== ; May 2017 ; =============================================================== ; ; void *tshc_saddrpright(void *saddr, uint bitmask) ; ; Modify screen address and bitmask to move right one pixel. ; Indicate error if pixel is at the rightmost edge. ; ; =============================================================== SECTION code_clib SECTION code_arch PUBLIC asm_tshc_saddrpright EXTERN asm_zx_saddrpright defc asm_tshc_saddrpright = asm_zx_saddrpright
26.05
65
0.497121
9a9e50455f0480a9306a7a487a1231bff1b83f9f
284
asm
Assembly
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_saddrpleft.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_saddrpleft.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_saddrpleft.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void *tshc_saddrpleft(void *saddr, uchar bitmask) SECTION code_clib SECTION code_arch PUBLIC tshc_saddrpleft EXTERN zx_saddrpleft defc tshc_saddrpleft = zx_saddrpleft ; SDCC bridge for Classic IF __CLASSIC PUBLIC _tshc_saddrpleft defc _tshc_saddrpleft = tshc_saddrpleft ENDIF
15.777778
51
0.834507
948a36fdc2059f555ff1980dca5981e5e31ceddc
593
asm
Assembly
libsrc/stdio/__scanf_format_table.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
38
2021-06-18T12:56:15.000Z
2022-03-12T20:38:40.000Z
libsrc/stdio/__scanf_format_table.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
2
2021-06-20T16:28:12.000Z
2021-11-17T21:33:56.000Z
libsrc/stdio/__scanf_format_table.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
6
2021-06-18T18:18:36.000Z
2021-12-22T08:01:32.000Z
; ; Default format table for scanf family MODULE __scanf_format_table SECTION rodata_clib PUBLIC __scanf_format_table EXTERN __scanf_handle_d EXTERN __scanf_handle_s EXTERN __scanf_handle_c EXTERN __scanf_handle_x EXTERN __scanf_handle_o EXTERN __scanf_handle_B EXTERN __scanf_handle_i __scanf_format_table: defb 'd' defw __scanf_handle_d defb 's' defw __scanf_handle_s defb 'c' defw __scanf_handle_c defb 'u' defw __scanf_handle_d defb 'x' defw __scanf_handle_x defb 'o' defw __scanf_handle_o defb 'B' defw __scanf_handle_B defb 'i' defw __scanf_handle_i defb 0
17.969697
39
0.81113
1dfa8ce0690b7b2d3c05a979cfb5691a755cb800
719
asm
Assembly
oeis/091/A091002.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/091/A091002.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/091/A091002.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A091002: Number of walks of length n between non-adjacent nodes on the Petersen graph. ; Submitted by Jamie Morken(s3.) ; 0,0,1,2,9,22,77,210,673,1934,5973,17578,53417,158886,479389,1432706,4309041,12905278,38759525,116191194,348748345,1045895510,3138385581,9413758642,28244072129,84726623982,254191056757,762550800650,2287697141193,6863001945094,20589184792253,61767196462818,185302305216337,555905483993246,1667719315291269,5003152219250746,15009468110998361,45028381426502838,135085190092493005,405255478651510034,1215766619206468065,3647299491115528270,10941899206354336661,32825696153047506282,98477091391173526249 add $0,1 mov $1,$0 min $0,1 sub $0,3 pow $0,$1 mov $2,3 pow $2,$1 sub $2,$0 mov $0,$2 div $0,30
47.933333
499
0.831711
38c59554008908c533ceacbe5a251c36e56cca8c
235
asm
Assembly
libsrc/msx/gen_vram.asm
andydansby/z88dk-mk2
51c15f1387293809c496f5eaf7b196f8a0e9b66b
[ "ClArtistic" ]
1
2020-09-15T08:35:49.000Z
2020-09-15T08:35:49.000Z
libsrc/msx/gen_vram.asm
andydansby/z88dk-MK2
51c15f1387293809c496f5eaf7b196f8a0e9b66b
[ "ClArtistic" ]
null
null
null
libsrc/msx/gen_vram.asm
andydansby/z88dk-MK2
51c15f1387293809c496f5eaf7b196f8a0e9b66b
[ "ClArtistic" ]
null
null
null
; ; z88dk library: Generic VDP support code ; ; int msx_vram(); ; ; Detects the VRAM size (in KB) ; ; $Id: gen_vram.asm,v 1.1 2010/06/30 13:21:38 stefano Exp $ ; XLIB msx_vram INCLUDE "msx/vdp.inc" msx_vram: ld hl,VRAM_SIZE ret
13.055556
59
0.67234
c6738759d7bd43f6ffc96709200aeb38a198d3fc
743
asm
Assembly
4.6.Fibonacci.asm
souzaitor/Assembly
7002df98e13cc3b89beb9211b77f811dfb6c4ce8
[ "MIT" ]
null
null
null
4.6.Fibonacci.asm
souzaitor/Assembly
7002df98e13cc3b89beb9211b77f811dfb6c4ce8
[ "MIT" ]
null
null
null
4.6.Fibonacci.asm
souzaitor/Assembly
7002df98e13cc3b89beb9211b77f811dfb6c4ce8
[ "MIT" ]
null
null
null
TITLE Fibonacci Numbers ;-------------------- ; Autor: Heitor Souza ; Data: 15/07/2021 ; ; Capítulo 4 Exercício 6 ; Descrição: Programa que use um loop para calcular os primeiros sete valores da sequência de números de Fibonacci, ; descrito pela seguinte fórmula: Fib (1) = 1, Fib (2) = 1, Fib (n) = Fib (n - 1) + Fib (n - 2) ;-------------------- INCLUDE Irvine32.inc .data PRIMEIRO DWORD ? SEGUNDO DWORD ? RESULTADO DWORD ? .code main PROC mov ecx, 12 mov PRIMEIRO, 0 mov SEGUNDO, 1 l1: mov eax, PRIMEIRO add eax, SEGUNDO call DumpRegs mov RESULTADO, eax mov eax, SEGUNDO mov PRIMEIRO, eax mov eax, RESULTADO mov SEGUNDO, eax loop l1 exit main ENDP END main
18.575
116
0.60969
18dc6f5e511b0c912d8bd547da1ecb7d839a8841
624
asm
Assembly
libsrc/target/vz/vz_sound_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
38
2021-06-18T12:56:15.000Z
2022-03-12T20:38:40.000Z
libsrc/target/vz/vz_sound_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
2
2021-06-20T16:28:12.000Z
2021-11-17T21:33:56.000Z
libsrc/target/vz/vz_sound_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
6
2021-06-18T18:18:36.000Z
2021-12-22T08:01:32.000Z
;***************************************************** ; ; Video Technology library for small C compiler ; ; Juergen Buchmueller ; ;***************************************************** ; ----- void __CALLEE__ vz_sound_callee(int freq, int cycles) SECTION code_clib PUBLIC vz_sound_callee PUBLIC _vz_sound_callee EXTERN ASMDISP_VZ_SOUND_CALLEE .vz_sound_callee ._vz_sound_callee pop de pop bc pop hl push de ; bc = cycles ; hl = freq .asmentry ; similar to z88dk bit_beep() jp $345c ; sound DEFC ASMDISP_VZ_SOUND_CALLEE = asmentry - vz_sound_callee
18.909091
61
0.55609
bb02820aeb20c5aca4fe767cf11f8a768c1c2f2b
407
asm
Assembly
oeis/126/A126884.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/126/A126884.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/126/A126884.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A126884: a(n) = (2^0)*(2^1)*(2^2)*(2^3)...(2^n)+1 = 2^T_n+1 (cf. A000217). ; 2,3,9,65,1025,32769,2097153,268435457,68719476737,35184372088833,36028797018963969,73786976294838206465,302231454903657293676545,2475880078570760549798248449,40564819207303340847894502572033,1329227995784915872903807060280344577,87112285931760246646623899502532662132737 add $0,1 bin $0,2 mov $1,2 pow $1,$0 add $1,1 mov $0,$1
40.7
272
0.781327
3598e4be6d61d744d193ba8713d5ba51f4ea90e6
49,667
asm
Assembly
testSched.asm
LongLeonardoLe/xv6
b10f1ad3bce4c3c264fc9746cd6efe1a78d606c5
[ "MIT-0" ]
null
null
null
testSched.asm
LongLeonardoLe/xv6
b10f1ad3bce4c3c264fc9746cd6efe1a78d606c5
[ "MIT-0" ]
null
null
null
testSched.asm
LongLeonardoLe/xv6
b10f1ad3bce4c3c264fc9746cd6efe1a78d606c5
[ "MIT-0" ]
null
null
null
_testSched: file format elf32-i386 Disassembly of section .text: 00000000 <countForever>: #define PrioCount 7 #define numChildren 10 void countForever(int i) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 18 sub $0x18,%esp int j, p, rc; unsigned long count = 0; 6: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) j = getpid(); d: e8 97 04 00 00 call 4a9 <getpid> 12: 89 45 ec mov %eax,-0x14(%ebp) p = i%PrioCount; 15: 8b 4d 08 mov 0x8(%ebp),%ecx 18: ba 93 24 49 92 mov $0x92492493,%edx 1d: 89 c8 mov %ecx,%eax 1f: f7 ea imul %edx 21: 8d 04 0a lea (%edx,%ecx,1),%eax 24: c1 f8 02 sar $0x2,%eax 27: 89 c2 mov %eax,%edx 29: 89 c8 mov %ecx,%eax 2b: c1 f8 1f sar $0x1f,%eax 2e: 29 c2 sub %eax,%edx 30: 89 d0 mov %edx,%eax 32: c1 e0 03 shl $0x3,%eax 35: 29 d0 sub %edx,%eax 37: 29 c1 sub %eax,%ecx 39: 89 c8 mov %ecx,%eax 3b: 89 45 f4 mov %eax,-0xc(%ebp) rc = setpriority(j, p); 3e: 83 ec 08 sub $0x8,%esp 41: ff 75 f4 pushl -0xc(%ebp) 44: ff 75 ec pushl -0x14(%ebp) 47: e8 bd 04 00 00 call 509 <setpriority> 4c: 83 c4 10 add $0x10,%esp 4f: 89 45 e8 mov %eax,-0x18(%ebp) if (rc == 0) 52: 83 7d e8 00 cmpl $0x0,-0x18(%ebp) 56: 75 17 jne 6f <countForever+0x6f> printf(1, "%d: start prio %d\n", j, p); 58: ff 75 f4 pushl -0xc(%ebp) 5b: ff 75 ec pushl -0x14(%ebp) 5e: 68 b8 09 00 00 push $0x9b8 63: 6a 01 push $0x1 65: e8 96 05 00 00 call 600 <printf> 6a: 83 c4 10 add $0x10,%esp 6d: eb 1b jmp 8a <countForever+0x8a> else { printf(1, "setpriority failed. file %s at %d\n", __FILE__, __LINE__); 6f: 6a 13 push $0x13 71: 68 cb 09 00 00 push $0x9cb 76: 68 d8 09 00 00 push $0x9d8 7b: 6a 01 push $0x1 7d: e8 7e 05 00 00 call 600 <printf> 82: 83 c4 10 add $0x10,%esp exit(); 85: e8 9f 03 00 00 call 429 <exit> } while (1) { count++; 8a: 83 45 f0 01 addl $0x1,-0x10(%ebp) if ((count & (0x1FFFFFFF)) == 0) { 8e: 8b 45 f0 mov -0x10(%ebp),%eax 91: 25 ff ff ff 1f and $0x1fffffff,%eax 96: 85 c0 test %eax,%eax 98: 75 f0 jne 8a <countForever+0x8a> p = (p+1) & PrioCount; 9a: 8b 45 f4 mov -0xc(%ebp),%eax 9d: 83 c0 01 add $0x1,%eax a0: 83 e0 07 and $0x7,%eax a3: 89 45 f4 mov %eax,-0xc(%ebp) rc = setpriority(j, p); a6: 83 ec 08 sub $0x8,%esp a9: ff 75 f4 pushl -0xc(%ebp) ac: ff 75 ec pushl -0x14(%ebp) af: e8 55 04 00 00 call 509 <setpriority> b4: 83 c4 10 add $0x10,%esp b7: 89 45 e8 mov %eax,-0x18(%ebp) if (rc == 0) ba: 83 7d e8 00 cmpl $0x0,-0x18(%ebp) be: 75 17 jne d7 <countForever+0xd7> printf(1, "%d: start prio %d\n", j, p); c0: ff 75 f4 pushl -0xc(%ebp) c3: ff 75 ec pushl -0x14(%ebp) c6: 68 b8 09 00 00 push $0x9b8 cb: 6a 01 push $0x1 cd: e8 2e 05 00 00 call 600 <printf> d2: 83 c4 10 add $0x10,%esp d5: eb b3 jmp 8a <countForever+0x8a> else { printf(1, "setpriority failed. file %s at %d\n", __FILE__, __LINE__); d7: 6a 1f push $0x1f d9: 68 cb 09 00 00 push $0x9cb de: 68 d8 09 00 00 push $0x9d8 e3: 6a 01 push $0x1 e5: e8 16 05 00 00 call 600 <printf> ea: 83 c4 10 add $0x10,%esp exit(); ed: e8 37 03 00 00 call 429 <exit> 000000f2 <main>: } } int main(void) { f2: 8d 4c 24 04 lea 0x4(%esp),%ecx f6: 83 e4 f0 and $0xfffffff0,%esp f9: ff 71 fc pushl -0x4(%ecx) fc: 55 push %ebp fd: 89 e5 mov %esp,%ebp ff: 51 push %ecx 100: 83 ec 14 sub $0x14,%esp int i, rc; for (i = 0; i < numChildren; i++) { 103: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 10a: eb 20 jmp 12c <main+0x3a> rc = fork(); 10c: e8 10 03 00 00 call 421 <fork> 111: 89 45 f0 mov %eax,-0x10(%ebp) if (!rc) { 114: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 118: 75 0e jne 128 <main+0x36> countForever(i); 11a: 83 ec 0c sub $0xc,%esp 11d: ff 75 f4 pushl -0xc(%ebp) 120: e8 db fe ff ff call 0 <countForever> 125: 83 c4 10 add $0x10,%esp int main(void) { int i, rc; for (i = 0; i < numChildren; i++) { 128: 83 45 f4 01 addl $0x1,-0xc(%ebp) 12c: 83 7d f4 09 cmpl $0x9,-0xc(%ebp) 130: 7e da jle 10c <main+0x1a> if (!rc) { countForever(i); } } countForever(1); 132: 83 ec 0c sub $0xc,%esp 135: 6a 01 push $0x1 137: e8 c4 fe ff ff call 0 <countForever> 13c: 83 c4 10 add $0x10,%esp exit(); 13f: e8 e5 02 00 00 call 429 <exit> 00000144 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 144: 55 push %ebp 145: 89 e5 mov %esp,%ebp 147: 57 push %edi 148: 53 push %ebx asm volatile("cld; rep stosb" : 149: 8b 4d 08 mov 0x8(%ebp),%ecx 14c: 8b 55 10 mov 0x10(%ebp),%edx 14f: 8b 45 0c mov 0xc(%ebp),%eax 152: 89 cb mov %ecx,%ebx 154: 89 df mov %ebx,%edi 156: 89 d1 mov %edx,%ecx 158: fc cld 159: f3 aa rep stos %al,%es:(%edi) 15b: 89 ca mov %ecx,%edx 15d: 89 fb mov %edi,%ebx 15f: 89 5d 08 mov %ebx,0x8(%ebp) 162: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 165: 90 nop 166: 5b pop %ebx 167: 5f pop %edi 168: 5d pop %ebp 169: c3 ret 0000016a <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 16a: 55 push %ebp 16b: 89 e5 mov %esp,%ebp 16d: 83 ec 10 sub $0x10,%esp char *os; os = s; 170: 8b 45 08 mov 0x8(%ebp),%eax 173: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 176: 90 nop 177: 8b 45 08 mov 0x8(%ebp),%eax 17a: 8d 50 01 lea 0x1(%eax),%edx 17d: 89 55 08 mov %edx,0x8(%ebp) 180: 8b 55 0c mov 0xc(%ebp),%edx 183: 8d 4a 01 lea 0x1(%edx),%ecx 186: 89 4d 0c mov %ecx,0xc(%ebp) 189: 0f b6 12 movzbl (%edx),%edx 18c: 88 10 mov %dl,(%eax) 18e: 0f b6 00 movzbl (%eax),%eax 191: 84 c0 test %al,%al 193: 75 e2 jne 177 <strcpy+0xd> ; return os; 195: 8b 45 fc mov -0x4(%ebp),%eax } 198: c9 leave 199: c3 ret 0000019a <strcmp>: int strcmp(const char *p, const char *q) { 19a: 55 push %ebp 19b: 89 e5 mov %esp,%ebp while(*p && *p == *q) 19d: eb 08 jmp 1a7 <strcmp+0xd> p++, q++; 19f: 83 45 08 01 addl $0x1,0x8(%ebp) 1a3: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 1a7: 8b 45 08 mov 0x8(%ebp),%eax 1aa: 0f b6 00 movzbl (%eax),%eax 1ad: 84 c0 test %al,%al 1af: 74 10 je 1c1 <strcmp+0x27> 1b1: 8b 45 08 mov 0x8(%ebp),%eax 1b4: 0f b6 10 movzbl (%eax),%edx 1b7: 8b 45 0c mov 0xc(%ebp),%eax 1ba: 0f b6 00 movzbl (%eax),%eax 1bd: 38 c2 cmp %al,%dl 1bf: 74 de je 19f <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 1c1: 8b 45 08 mov 0x8(%ebp),%eax 1c4: 0f b6 00 movzbl (%eax),%eax 1c7: 0f b6 d0 movzbl %al,%edx 1ca: 8b 45 0c mov 0xc(%ebp),%eax 1cd: 0f b6 00 movzbl (%eax),%eax 1d0: 0f b6 c0 movzbl %al,%eax 1d3: 29 c2 sub %eax,%edx 1d5: 89 d0 mov %edx,%eax } 1d7: 5d pop %ebp 1d8: c3 ret 000001d9 <strlen>: uint strlen(char *s) { 1d9: 55 push %ebp 1da: 89 e5 mov %esp,%ebp 1dc: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 1df: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 1e6: eb 04 jmp 1ec <strlen+0x13> 1e8: 83 45 fc 01 addl $0x1,-0x4(%ebp) 1ec: 8b 55 fc mov -0x4(%ebp),%edx 1ef: 8b 45 08 mov 0x8(%ebp),%eax 1f2: 01 d0 add %edx,%eax 1f4: 0f b6 00 movzbl (%eax),%eax 1f7: 84 c0 test %al,%al 1f9: 75 ed jne 1e8 <strlen+0xf> ; return n; 1fb: 8b 45 fc mov -0x4(%ebp),%eax } 1fe: c9 leave 1ff: c3 ret 00000200 <memset>: void* memset(void *dst, int c, uint n) { 200: 55 push %ebp 201: 89 e5 mov %esp,%ebp stosb(dst, c, n); 203: 8b 45 10 mov 0x10(%ebp),%eax 206: 50 push %eax 207: ff 75 0c pushl 0xc(%ebp) 20a: ff 75 08 pushl 0x8(%ebp) 20d: e8 32 ff ff ff call 144 <stosb> 212: 83 c4 0c add $0xc,%esp return dst; 215: 8b 45 08 mov 0x8(%ebp),%eax } 218: c9 leave 219: c3 ret 0000021a <strchr>: char* strchr(const char *s, char c) { 21a: 55 push %ebp 21b: 89 e5 mov %esp,%ebp 21d: 83 ec 04 sub $0x4,%esp 220: 8b 45 0c mov 0xc(%ebp),%eax 223: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 226: eb 14 jmp 23c <strchr+0x22> if(*s == c) 228: 8b 45 08 mov 0x8(%ebp),%eax 22b: 0f b6 00 movzbl (%eax),%eax 22e: 3a 45 fc cmp -0x4(%ebp),%al 231: 75 05 jne 238 <strchr+0x1e> return (char*)s; 233: 8b 45 08 mov 0x8(%ebp),%eax 236: eb 13 jmp 24b <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 238: 83 45 08 01 addl $0x1,0x8(%ebp) 23c: 8b 45 08 mov 0x8(%ebp),%eax 23f: 0f b6 00 movzbl (%eax),%eax 242: 84 c0 test %al,%al 244: 75 e2 jne 228 <strchr+0xe> if(*s == c) return (char*)s; return 0; 246: b8 00 00 00 00 mov $0x0,%eax } 24b: c9 leave 24c: c3 ret 0000024d <gets>: char* gets(char *buf, int max) { 24d: 55 push %ebp 24e: 89 e5 mov %esp,%ebp 250: 83 ec 18 sub $0x18,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 253: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 25a: eb 42 jmp 29e <gets+0x51> cc = read(0, &c, 1); 25c: 83 ec 04 sub $0x4,%esp 25f: 6a 01 push $0x1 261: 8d 45 ef lea -0x11(%ebp),%eax 264: 50 push %eax 265: 6a 00 push $0x0 267: e8 d5 01 00 00 call 441 <read> 26c: 83 c4 10 add $0x10,%esp 26f: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 272: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 276: 7e 33 jle 2ab <gets+0x5e> break; buf[i++] = c; 278: 8b 45 f4 mov -0xc(%ebp),%eax 27b: 8d 50 01 lea 0x1(%eax),%edx 27e: 89 55 f4 mov %edx,-0xc(%ebp) 281: 89 c2 mov %eax,%edx 283: 8b 45 08 mov 0x8(%ebp),%eax 286: 01 c2 add %eax,%edx 288: 0f b6 45 ef movzbl -0x11(%ebp),%eax 28c: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 28e: 0f b6 45 ef movzbl -0x11(%ebp),%eax 292: 3c 0a cmp $0xa,%al 294: 74 16 je 2ac <gets+0x5f> 296: 0f b6 45 ef movzbl -0x11(%ebp),%eax 29a: 3c 0d cmp $0xd,%al 29c: 74 0e je 2ac <gets+0x5f> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 29e: 8b 45 f4 mov -0xc(%ebp),%eax 2a1: 83 c0 01 add $0x1,%eax 2a4: 3b 45 0c cmp 0xc(%ebp),%eax 2a7: 7c b3 jl 25c <gets+0xf> 2a9: eb 01 jmp 2ac <gets+0x5f> cc = read(0, &c, 1); if(cc < 1) break; 2ab: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 2ac: 8b 55 f4 mov -0xc(%ebp),%edx 2af: 8b 45 08 mov 0x8(%ebp),%eax 2b2: 01 d0 add %edx,%eax 2b4: c6 00 00 movb $0x0,(%eax) return buf; 2b7: 8b 45 08 mov 0x8(%ebp),%eax } 2ba: c9 leave 2bb: c3 ret 000002bc <stat>: int stat(char *n, struct stat *st) { 2bc: 55 push %ebp 2bd: 89 e5 mov %esp,%ebp 2bf: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 2c2: 83 ec 08 sub $0x8,%esp 2c5: 6a 00 push $0x0 2c7: ff 75 08 pushl 0x8(%ebp) 2ca: e8 9a 01 00 00 call 469 <open> 2cf: 83 c4 10 add $0x10,%esp 2d2: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 2d5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 2d9: 79 07 jns 2e2 <stat+0x26> return -1; 2db: b8 ff ff ff ff mov $0xffffffff,%eax 2e0: eb 25 jmp 307 <stat+0x4b> r = fstat(fd, st); 2e2: 83 ec 08 sub $0x8,%esp 2e5: ff 75 0c pushl 0xc(%ebp) 2e8: ff 75 f4 pushl -0xc(%ebp) 2eb: e8 91 01 00 00 call 481 <fstat> 2f0: 83 c4 10 add $0x10,%esp 2f3: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 2f6: 83 ec 0c sub $0xc,%esp 2f9: ff 75 f4 pushl -0xc(%ebp) 2fc: e8 50 01 00 00 call 451 <close> 301: 83 c4 10 add $0x10,%esp return r; 304: 8b 45 f0 mov -0x10(%ebp),%eax } 307: c9 leave 308: c3 ret 00000309 <atoi>: int atoi(const char *s) { 309: 55 push %ebp 30a: 89 e5 mov %esp,%ebp 30c: 83 ec 10 sub $0x10,%esp int n; n = 0; 30f: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 316: eb 25 jmp 33d <atoi+0x34> n = n*10 + *s++ - '0'; 318: 8b 55 fc mov -0x4(%ebp),%edx 31b: 89 d0 mov %edx,%eax 31d: c1 e0 02 shl $0x2,%eax 320: 01 d0 add %edx,%eax 322: 01 c0 add %eax,%eax 324: 89 c1 mov %eax,%ecx 326: 8b 45 08 mov 0x8(%ebp),%eax 329: 8d 50 01 lea 0x1(%eax),%edx 32c: 89 55 08 mov %edx,0x8(%ebp) 32f: 0f b6 00 movzbl (%eax),%eax 332: 0f be c0 movsbl %al,%eax 335: 01 c8 add %ecx,%eax 337: 83 e8 30 sub $0x30,%eax 33a: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 33d: 8b 45 08 mov 0x8(%ebp),%eax 340: 0f b6 00 movzbl (%eax),%eax 343: 3c 2f cmp $0x2f,%al 345: 7e 0a jle 351 <atoi+0x48> 347: 8b 45 08 mov 0x8(%ebp),%eax 34a: 0f b6 00 movzbl (%eax),%eax 34d: 3c 39 cmp $0x39,%al 34f: 7e c7 jle 318 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 351: 8b 45 fc mov -0x4(%ebp),%eax } 354: c9 leave 355: c3 ret 00000356 <atoo>: int atoo(const char *s) { 356: 55 push %ebp 357: 89 e5 mov %esp,%ebp 359: 83 ec 10 sub $0x10,%esp int n, sign; n = 0; 35c: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while (*s == ' ') 363: eb 04 jmp 369 <atoo+0x13> s++; 365: 83 45 08 01 addl $0x1,0x8(%ebp) int atoo(const char *s) { int n, sign; n = 0; while (*s == ' ') 369: 8b 45 08 mov 0x8(%ebp),%eax 36c: 0f b6 00 movzbl (%eax),%eax 36f: 3c 20 cmp $0x20,%al 371: 74 f2 je 365 <atoo+0xf> s++; sign = (*s == '-') ? -1 : 1; 373: 8b 45 08 mov 0x8(%ebp),%eax 376: 0f b6 00 movzbl (%eax),%eax 379: 3c 2d cmp $0x2d,%al 37b: 75 07 jne 384 <atoo+0x2e> 37d: b8 ff ff ff ff mov $0xffffffff,%eax 382: eb 05 jmp 389 <atoo+0x33> 384: b8 01 00 00 00 mov $0x1,%eax 389: 89 45 f8 mov %eax,-0x8(%ebp) if (*s == '+' || *s == '-') 38c: 8b 45 08 mov 0x8(%ebp),%eax 38f: 0f b6 00 movzbl (%eax),%eax 392: 3c 2b cmp $0x2b,%al 394: 74 0a je 3a0 <atoo+0x4a> 396: 8b 45 08 mov 0x8(%ebp),%eax 399: 0f b6 00 movzbl (%eax),%eax 39c: 3c 2d cmp $0x2d,%al 39e: 75 27 jne 3c7 <atoo+0x71> s++; 3a0: 83 45 08 01 addl $0x1,0x8(%ebp) while ('0' <= *s && *s <= '7') 3a4: eb 21 jmp 3c7 <atoo+0x71> n = n*8 + *s++ - '0'; 3a6: 8b 45 fc mov -0x4(%ebp),%eax 3a9: 8d 0c c5 00 00 00 00 lea 0x0(,%eax,8),%ecx 3b0: 8b 45 08 mov 0x8(%ebp),%eax 3b3: 8d 50 01 lea 0x1(%eax),%edx 3b6: 89 55 08 mov %edx,0x8(%ebp) 3b9: 0f b6 00 movzbl (%eax),%eax 3bc: 0f be c0 movsbl %al,%eax 3bf: 01 c8 add %ecx,%eax 3c1: 83 e8 30 sub $0x30,%eax 3c4: 89 45 fc mov %eax,-0x4(%ebp) while (*s == ' ') s++; sign = (*s == '-') ? -1 : 1; if (*s == '+' || *s == '-') s++; while ('0' <= *s && *s <= '7') 3c7: 8b 45 08 mov 0x8(%ebp),%eax 3ca: 0f b6 00 movzbl (%eax),%eax 3cd: 3c 2f cmp $0x2f,%al 3cf: 7e 0a jle 3db <atoo+0x85> 3d1: 8b 45 08 mov 0x8(%ebp),%eax 3d4: 0f b6 00 movzbl (%eax),%eax 3d7: 3c 37 cmp $0x37,%al 3d9: 7e cb jle 3a6 <atoo+0x50> n = n*8 + *s++ - '0'; return sign*n; 3db: 8b 45 f8 mov -0x8(%ebp),%eax 3de: 0f af 45 fc imul -0x4(%ebp),%eax } 3e2: c9 leave 3e3: c3 ret 000003e4 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 3e4: 55 push %ebp 3e5: 89 e5 mov %esp,%ebp 3e7: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 3ea: 8b 45 08 mov 0x8(%ebp),%eax 3ed: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 3f0: 8b 45 0c mov 0xc(%ebp),%eax 3f3: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 3f6: eb 17 jmp 40f <memmove+0x2b> *dst++ = *src++; 3f8: 8b 45 fc mov -0x4(%ebp),%eax 3fb: 8d 50 01 lea 0x1(%eax),%edx 3fe: 89 55 fc mov %edx,-0x4(%ebp) 401: 8b 55 f8 mov -0x8(%ebp),%edx 404: 8d 4a 01 lea 0x1(%edx),%ecx 407: 89 4d f8 mov %ecx,-0x8(%ebp) 40a: 0f b6 12 movzbl (%edx),%edx 40d: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 40f: 8b 45 10 mov 0x10(%ebp),%eax 412: 8d 50 ff lea -0x1(%eax),%edx 415: 89 55 10 mov %edx,0x10(%ebp) 418: 85 c0 test %eax,%eax 41a: 7f dc jg 3f8 <memmove+0x14> *dst++ = *src++; return vdst; 41c: 8b 45 08 mov 0x8(%ebp),%eax } 41f: c9 leave 420: c3 ret 00000421 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 421: b8 01 00 00 00 mov $0x1,%eax 426: cd 40 int $0x40 428: c3 ret 00000429 <exit>: SYSCALL(exit) 429: b8 02 00 00 00 mov $0x2,%eax 42e: cd 40 int $0x40 430: c3 ret 00000431 <wait>: SYSCALL(wait) 431: b8 03 00 00 00 mov $0x3,%eax 436: cd 40 int $0x40 438: c3 ret 00000439 <pipe>: SYSCALL(pipe) 439: b8 04 00 00 00 mov $0x4,%eax 43e: cd 40 int $0x40 440: c3 ret 00000441 <read>: SYSCALL(read) 441: b8 05 00 00 00 mov $0x5,%eax 446: cd 40 int $0x40 448: c3 ret 00000449 <write>: SYSCALL(write) 449: b8 10 00 00 00 mov $0x10,%eax 44e: cd 40 int $0x40 450: c3 ret 00000451 <close>: SYSCALL(close) 451: b8 15 00 00 00 mov $0x15,%eax 456: cd 40 int $0x40 458: c3 ret 00000459 <kill>: SYSCALL(kill) 459: b8 06 00 00 00 mov $0x6,%eax 45e: cd 40 int $0x40 460: c3 ret 00000461 <exec>: SYSCALL(exec) 461: b8 07 00 00 00 mov $0x7,%eax 466: cd 40 int $0x40 468: c3 ret 00000469 <open>: SYSCALL(open) 469: b8 0f 00 00 00 mov $0xf,%eax 46e: cd 40 int $0x40 470: c3 ret 00000471 <mknod>: SYSCALL(mknod) 471: b8 11 00 00 00 mov $0x11,%eax 476: cd 40 int $0x40 478: c3 ret 00000479 <unlink>: SYSCALL(unlink) 479: b8 12 00 00 00 mov $0x12,%eax 47e: cd 40 int $0x40 480: c3 ret 00000481 <fstat>: SYSCALL(fstat) 481: b8 08 00 00 00 mov $0x8,%eax 486: cd 40 int $0x40 488: c3 ret 00000489 <link>: SYSCALL(link) 489: b8 13 00 00 00 mov $0x13,%eax 48e: cd 40 int $0x40 490: c3 ret 00000491 <mkdir>: SYSCALL(mkdir) 491: b8 14 00 00 00 mov $0x14,%eax 496: cd 40 int $0x40 498: c3 ret 00000499 <chdir>: SYSCALL(chdir) 499: b8 09 00 00 00 mov $0x9,%eax 49e: cd 40 int $0x40 4a0: c3 ret 000004a1 <dup>: SYSCALL(dup) 4a1: b8 0a 00 00 00 mov $0xa,%eax 4a6: cd 40 int $0x40 4a8: c3 ret 000004a9 <getpid>: SYSCALL(getpid) 4a9: b8 0b 00 00 00 mov $0xb,%eax 4ae: cd 40 int $0x40 4b0: c3 ret 000004b1 <sbrk>: SYSCALL(sbrk) 4b1: b8 0c 00 00 00 mov $0xc,%eax 4b6: cd 40 int $0x40 4b8: c3 ret 000004b9 <sleep>: SYSCALL(sleep) 4b9: b8 0d 00 00 00 mov $0xd,%eax 4be: cd 40 int $0x40 4c0: c3 ret 000004c1 <uptime>: SYSCALL(uptime) 4c1: b8 0e 00 00 00 mov $0xe,%eax 4c6: cd 40 int $0x40 4c8: c3 ret 000004c9 <halt>: SYSCALL(halt) 4c9: b8 16 00 00 00 mov $0x16,%eax 4ce: cd 40 int $0x40 4d0: c3 ret 000004d1 <date>: SYSCALL(date) 4d1: b8 17 00 00 00 mov $0x17,%eax 4d6: cd 40 int $0x40 4d8: c3 ret 000004d9 <getuid>: SYSCALL(getuid) 4d9: b8 18 00 00 00 mov $0x18,%eax 4de: cd 40 int $0x40 4e0: c3 ret 000004e1 <getgid>: SYSCALL(getgid) 4e1: b8 19 00 00 00 mov $0x19,%eax 4e6: cd 40 int $0x40 4e8: c3 ret 000004e9 <getppid>: SYSCALL(getppid) 4e9: b8 1a 00 00 00 mov $0x1a,%eax 4ee: cd 40 int $0x40 4f0: c3 ret 000004f1 <setuid>: SYSCALL(setuid) 4f1: b8 1b 00 00 00 mov $0x1b,%eax 4f6: cd 40 int $0x40 4f8: c3 ret 000004f9 <setgid>: SYSCALL(setgid) 4f9: b8 1c 00 00 00 mov $0x1c,%eax 4fe: cd 40 int $0x40 500: c3 ret 00000501 <getprocs>: SYSCALL(getprocs) 501: b8 1d 00 00 00 mov $0x1d,%eax 506: cd 40 int $0x40 508: c3 ret 00000509 <setpriority>: SYSCALL(setpriority) 509: b8 1e 00 00 00 mov $0x1e,%eax 50e: cd 40 int $0x40 510: c3 ret 00000511 <chmod>: SYSCALL(chmod) 511: b8 1f 00 00 00 mov $0x1f,%eax 516: cd 40 int $0x40 518: c3 ret 00000519 <chown>: SYSCALL(chown) 519: b8 20 00 00 00 mov $0x20,%eax 51e: cd 40 int $0x40 520: c3 ret 00000521 <chgrp>: SYSCALL(chgrp) 521: b8 21 00 00 00 mov $0x21,%eax 526: cd 40 int $0x40 528: c3 ret 00000529 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 529: 55 push %ebp 52a: 89 e5 mov %esp,%ebp 52c: 83 ec 18 sub $0x18,%esp 52f: 8b 45 0c mov 0xc(%ebp),%eax 532: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 535: 83 ec 04 sub $0x4,%esp 538: 6a 01 push $0x1 53a: 8d 45 f4 lea -0xc(%ebp),%eax 53d: 50 push %eax 53e: ff 75 08 pushl 0x8(%ebp) 541: e8 03 ff ff ff call 449 <write> 546: 83 c4 10 add $0x10,%esp } 549: 90 nop 54a: c9 leave 54b: c3 ret 0000054c <printint>: static void printint(int fd, int xx, int base, int sgn) { 54c: 55 push %ebp 54d: 89 e5 mov %esp,%ebp 54f: 53 push %ebx 550: 83 ec 24 sub $0x24,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 553: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 55a: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 55e: 74 17 je 577 <printint+0x2b> 560: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 564: 79 11 jns 577 <printint+0x2b> neg = 1; 566: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 56d: 8b 45 0c mov 0xc(%ebp),%eax 570: f7 d8 neg %eax 572: 89 45 ec mov %eax,-0x14(%ebp) 575: eb 06 jmp 57d <printint+0x31> } else { x = xx; 577: 8b 45 0c mov 0xc(%ebp),%eax 57a: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 57d: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 584: 8b 4d f4 mov -0xc(%ebp),%ecx 587: 8d 41 01 lea 0x1(%ecx),%eax 58a: 89 45 f4 mov %eax,-0xc(%ebp) 58d: 8b 5d 10 mov 0x10(%ebp),%ebx 590: 8b 45 ec mov -0x14(%ebp),%eax 593: ba 00 00 00 00 mov $0x0,%edx 598: f7 f3 div %ebx 59a: 89 d0 mov %edx,%eax 59c: 0f b6 80 88 0c 00 00 movzbl 0xc88(%eax),%eax 5a3: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); 5a7: 8b 5d 10 mov 0x10(%ebp),%ebx 5aa: 8b 45 ec mov -0x14(%ebp),%eax 5ad: ba 00 00 00 00 mov $0x0,%edx 5b2: f7 f3 div %ebx 5b4: 89 45 ec mov %eax,-0x14(%ebp) 5b7: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 5bb: 75 c7 jne 584 <printint+0x38> if(neg) 5bd: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 5c1: 74 2d je 5f0 <printint+0xa4> buf[i++] = '-'; 5c3: 8b 45 f4 mov -0xc(%ebp),%eax 5c6: 8d 50 01 lea 0x1(%eax),%edx 5c9: 89 55 f4 mov %edx,-0xc(%ebp) 5cc: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 5d1: eb 1d jmp 5f0 <printint+0xa4> putc(fd, buf[i]); 5d3: 8d 55 dc lea -0x24(%ebp),%edx 5d6: 8b 45 f4 mov -0xc(%ebp),%eax 5d9: 01 d0 add %edx,%eax 5db: 0f b6 00 movzbl (%eax),%eax 5de: 0f be c0 movsbl %al,%eax 5e1: 83 ec 08 sub $0x8,%esp 5e4: 50 push %eax 5e5: ff 75 08 pushl 0x8(%ebp) 5e8: e8 3c ff ff ff call 529 <putc> 5ed: 83 c4 10 add $0x10,%esp buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 5f0: 83 6d f4 01 subl $0x1,-0xc(%ebp) 5f4: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 5f8: 79 d9 jns 5d3 <printint+0x87> putc(fd, buf[i]); } 5fa: 90 nop 5fb: 8b 5d fc mov -0x4(%ebp),%ebx 5fe: c9 leave 5ff: c3 ret 00000600 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 600: 55 push %ebp 601: 89 e5 mov %esp,%ebp 603: 83 ec 28 sub $0x28,%esp char *s; int c, i, state; uint *ap; state = 0; 606: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 60d: 8d 45 0c lea 0xc(%ebp),%eax 610: 83 c0 04 add $0x4,%eax 613: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 616: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 61d: e9 59 01 00 00 jmp 77b <printf+0x17b> c = fmt[i] & 0xff; 622: 8b 55 0c mov 0xc(%ebp),%edx 625: 8b 45 f0 mov -0x10(%ebp),%eax 628: 01 d0 add %edx,%eax 62a: 0f b6 00 movzbl (%eax),%eax 62d: 0f be c0 movsbl %al,%eax 630: 25 ff 00 00 00 and $0xff,%eax 635: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 638: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 63c: 75 2c jne 66a <printf+0x6a> if(c == '%'){ 63e: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 642: 75 0c jne 650 <printf+0x50> state = '%'; 644: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 64b: e9 27 01 00 00 jmp 777 <printf+0x177> } else { putc(fd, c); 650: 8b 45 e4 mov -0x1c(%ebp),%eax 653: 0f be c0 movsbl %al,%eax 656: 83 ec 08 sub $0x8,%esp 659: 50 push %eax 65a: ff 75 08 pushl 0x8(%ebp) 65d: e8 c7 fe ff ff call 529 <putc> 662: 83 c4 10 add $0x10,%esp 665: e9 0d 01 00 00 jmp 777 <printf+0x177> } } else if(state == '%'){ 66a: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 66e: 0f 85 03 01 00 00 jne 777 <printf+0x177> if(c == 'd'){ 674: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 678: 75 1e jne 698 <printf+0x98> printint(fd, *ap, 10, 1); 67a: 8b 45 e8 mov -0x18(%ebp),%eax 67d: 8b 00 mov (%eax),%eax 67f: 6a 01 push $0x1 681: 6a 0a push $0xa 683: 50 push %eax 684: ff 75 08 pushl 0x8(%ebp) 687: e8 c0 fe ff ff call 54c <printint> 68c: 83 c4 10 add $0x10,%esp ap++; 68f: 83 45 e8 04 addl $0x4,-0x18(%ebp) 693: e9 d8 00 00 00 jmp 770 <printf+0x170> } else if(c == 'x' || c == 'p'){ 698: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 69c: 74 06 je 6a4 <printf+0xa4> 69e: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 6a2: 75 1e jne 6c2 <printf+0xc2> printint(fd, *ap, 16, 0); 6a4: 8b 45 e8 mov -0x18(%ebp),%eax 6a7: 8b 00 mov (%eax),%eax 6a9: 6a 00 push $0x0 6ab: 6a 10 push $0x10 6ad: 50 push %eax 6ae: ff 75 08 pushl 0x8(%ebp) 6b1: e8 96 fe ff ff call 54c <printint> 6b6: 83 c4 10 add $0x10,%esp ap++; 6b9: 83 45 e8 04 addl $0x4,-0x18(%ebp) 6bd: e9 ae 00 00 00 jmp 770 <printf+0x170> } else if(c == 's'){ 6c2: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 6c6: 75 43 jne 70b <printf+0x10b> s = (char*)*ap; 6c8: 8b 45 e8 mov -0x18(%ebp),%eax 6cb: 8b 00 mov (%eax),%eax 6cd: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 6d0: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 6d4: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 6d8: 75 25 jne 6ff <printf+0xff> s = "(null)"; 6da: c7 45 f4 fb 09 00 00 movl $0x9fb,-0xc(%ebp) while(*s != 0){ 6e1: eb 1c jmp 6ff <printf+0xff> putc(fd, *s); 6e3: 8b 45 f4 mov -0xc(%ebp),%eax 6e6: 0f b6 00 movzbl (%eax),%eax 6e9: 0f be c0 movsbl %al,%eax 6ec: 83 ec 08 sub $0x8,%esp 6ef: 50 push %eax 6f0: ff 75 08 pushl 0x8(%ebp) 6f3: e8 31 fe ff ff call 529 <putc> 6f8: 83 c4 10 add $0x10,%esp s++; 6fb: 83 45 f4 01 addl $0x1,-0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 6ff: 8b 45 f4 mov -0xc(%ebp),%eax 702: 0f b6 00 movzbl (%eax),%eax 705: 84 c0 test %al,%al 707: 75 da jne 6e3 <printf+0xe3> 709: eb 65 jmp 770 <printf+0x170> putc(fd, *s); s++; } } else if(c == 'c'){ 70b: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 70f: 75 1d jne 72e <printf+0x12e> putc(fd, *ap); 711: 8b 45 e8 mov -0x18(%ebp),%eax 714: 8b 00 mov (%eax),%eax 716: 0f be c0 movsbl %al,%eax 719: 83 ec 08 sub $0x8,%esp 71c: 50 push %eax 71d: ff 75 08 pushl 0x8(%ebp) 720: e8 04 fe ff ff call 529 <putc> 725: 83 c4 10 add $0x10,%esp ap++; 728: 83 45 e8 04 addl $0x4,-0x18(%ebp) 72c: eb 42 jmp 770 <printf+0x170> } else if(c == '%'){ 72e: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 732: 75 17 jne 74b <printf+0x14b> putc(fd, c); 734: 8b 45 e4 mov -0x1c(%ebp),%eax 737: 0f be c0 movsbl %al,%eax 73a: 83 ec 08 sub $0x8,%esp 73d: 50 push %eax 73e: ff 75 08 pushl 0x8(%ebp) 741: e8 e3 fd ff ff call 529 <putc> 746: 83 c4 10 add $0x10,%esp 749: eb 25 jmp 770 <printf+0x170> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 74b: 83 ec 08 sub $0x8,%esp 74e: 6a 25 push $0x25 750: ff 75 08 pushl 0x8(%ebp) 753: e8 d1 fd ff ff call 529 <putc> 758: 83 c4 10 add $0x10,%esp putc(fd, c); 75b: 8b 45 e4 mov -0x1c(%ebp),%eax 75e: 0f be c0 movsbl %al,%eax 761: 83 ec 08 sub $0x8,%esp 764: 50 push %eax 765: ff 75 08 pushl 0x8(%ebp) 768: e8 bc fd ff ff call 529 <putc> 76d: 83 c4 10 add $0x10,%esp } state = 0; 770: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 777: 83 45 f0 01 addl $0x1,-0x10(%ebp) 77b: 8b 55 0c mov 0xc(%ebp),%edx 77e: 8b 45 f0 mov -0x10(%ebp),%eax 781: 01 d0 add %edx,%eax 783: 0f b6 00 movzbl (%eax),%eax 786: 84 c0 test %al,%al 788: 0f 85 94 fe ff ff jne 622 <printf+0x22> putc(fd, c); } state = 0; } } } 78e: 90 nop 78f: c9 leave 790: c3 ret 00000791 <free>: static Header base; static Header *freep; void free(void *ap) { 791: 55 push %ebp 792: 89 e5 mov %esp,%ebp 794: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 797: 8b 45 08 mov 0x8(%ebp),%eax 79a: 83 e8 08 sub $0x8,%eax 79d: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 7a0: a1 a4 0c 00 00 mov 0xca4,%eax 7a5: 89 45 fc mov %eax,-0x4(%ebp) 7a8: eb 24 jmp 7ce <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 7aa: 8b 45 fc mov -0x4(%ebp),%eax 7ad: 8b 00 mov (%eax),%eax 7af: 3b 45 fc cmp -0x4(%ebp),%eax 7b2: 77 12 ja 7c6 <free+0x35> 7b4: 8b 45 f8 mov -0x8(%ebp),%eax 7b7: 3b 45 fc cmp -0x4(%ebp),%eax 7ba: 77 24 ja 7e0 <free+0x4f> 7bc: 8b 45 fc mov -0x4(%ebp),%eax 7bf: 8b 00 mov (%eax),%eax 7c1: 3b 45 f8 cmp -0x8(%ebp),%eax 7c4: 77 1a ja 7e0 <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 7c6: 8b 45 fc mov -0x4(%ebp),%eax 7c9: 8b 00 mov (%eax),%eax 7cb: 89 45 fc mov %eax,-0x4(%ebp) 7ce: 8b 45 f8 mov -0x8(%ebp),%eax 7d1: 3b 45 fc cmp -0x4(%ebp),%eax 7d4: 76 d4 jbe 7aa <free+0x19> 7d6: 8b 45 fc mov -0x4(%ebp),%eax 7d9: 8b 00 mov (%eax),%eax 7db: 3b 45 f8 cmp -0x8(%ebp),%eax 7de: 76 ca jbe 7aa <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 7e0: 8b 45 f8 mov -0x8(%ebp),%eax 7e3: 8b 40 04 mov 0x4(%eax),%eax 7e6: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 7ed: 8b 45 f8 mov -0x8(%ebp),%eax 7f0: 01 c2 add %eax,%edx 7f2: 8b 45 fc mov -0x4(%ebp),%eax 7f5: 8b 00 mov (%eax),%eax 7f7: 39 c2 cmp %eax,%edx 7f9: 75 24 jne 81f <free+0x8e> bp->s.size += p->s.ptr->s.size; 7fb: 8b 45 f8 mov -0x8(%ebp),%eax 7fe: 8b 50 04 mov 0x4(%eax),%edx 801: 8b 45 fc mov -0x4(%ebp),%eax 804: 8b 00 mov (%eax),%eax 806: 8b 40 04 mov 0x4(%eax),%eax 809: 01 c2 add %eax,%edx 80b: 8b 45 f8 mov -0x8(%ebp),%eax 80e: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 811: 8b 45 fc mov -0x4(%ebp),%eax 814: 8b 00 mov (%eax),%eax 816: 8b 10 mov (%eax),%edx 818: 8b 45 f8 mov -0x8(%ebp),%eax 81b: 89 10 mov %edx,(%eax) 81d: eb 0a jmp 829 <free+0x98> } else bp->s.ptr = p->s.ptr; 81f: 8b 45 fc mov -0x4(%ebp),%eax 822: 8b 10 mov (%eax),%edx 824: 8b 45 f8 mov -0x8(%ebp),%eax 827: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 829: 8b 45 fc mov -0x4(%ebp),%eax 82c: 8b 40 04 mov 0x4(%eax),%eax 82f: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 836: 8b 45 fc mov -0x4(%ebp),%eax 839: 01 d0 add %edx,%eax 83b: 3b 45 f8 cmp -0x8(%ebp),%eax 83e: 75 20 jne 860 <free+0xcf> p->s.size += bp->s.size; 840: 8b 45 fc mov -0x4(%ebp),%eax 843: 8b 50 04 mov 0x4(%eax),%edx 846: 8b 45 f8 mov -0x8(%ebp),%eax 849: 8b 40 04 mov 0x4(%eax),%eax 84c: 01 c2 add %eax,%edx 84e: 8b 45 fc mov -0x4(%ebp),%eax 851: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 854: 8b 45 f8 mov -0x8(%ebp),%eax 857: 8b 10 mov (%eax),%edx 859: 8b 45 fc mov -0x4(%ebp),%eax 85c: 89 10 mov %edx,(%eax) 85e: eb 08 jmp 868 <free+0xd7> } else p->s.ptr = bp; 860: 8b 45 fc mov -0x4(%ebp),%eax 863: 8b 55 f8 mov -0x8(%ebp),%edx 866: 89 10 mov %edx,(%eax) freep = p; 868: 8b 45 fc mov -0x4(%ebp),%eax 86b: a3 a4 0c 00 00 mov %eax,0xca4 } 870: 90 nop 871: c9 leave 872: c3 ret 00000873 <morecore>: static Header* morecore(uint nu) { 873: 55 push %ebp 874: 89 e5 mov %esp,%ebp 876: 83 ec 18 sub $0x18,%esp char *p; Header *hp; if(nu < 4096) 879: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 880: 77 07 ja 889 <morecore+0x16> nu = 4096; 882: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 889: 8b 45 08 mov 0x8(%ebp),%eax 88c: c1 e0 03 shl $0x3,%eax 88f: 83 ec 0c sub $0xc,%esp 892: 50 push %eax 893: e8 19 fc ff ff call 4b1 <sbrk> 898: 83 c4 10 add $0x10,%esp 89b: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 89e: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 8a2: 75 07 jne 8ab <morecore+0x38> return 0; 8a4: b8 00 00 00 00 mov $0x0,%eax 8a9: eb 26 jmp 8d1 <morecore+0x5e> hp = (Header*)p; 8ab: 8b 45 f4 mov -0xc(%ebp),%eax 8ae: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 8b1: 8b 45 f0 mov -0x10(%ebp),%eax 8b4: 8b 55 08 mov 0x8(%ebp),%edx 8b7: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 8ba: 8b 45 f0 mov -0x10(%ebp),%eax 8bd: 83 c0 08 add $0x8,%eax 8c0: 83 ec 0c sub $0xc,%esp 8c3: 50 push %eax 8c4: e8 c8 fe ff ff call 791 <free> 8c9: 83 c4 10 add $0x10,%esp return freep; 8cc: a1 a4 0c 00 00 mov 0xca4,%eax } 8d1: c9 leave 8d2: c3 ret 000008d3 <malloc>: void* malloc(uint nbytes) { 8d3: 55 push %ebp 8d4: 89 e5 mov %esp,%ebp 8d6: 83 ec 18 sub $0x18,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 8d9: 8b 45 08 mov 0x8(%ebp),%eax 8dc: 83 c0 07 add $0x7,%eax 8df: c1 e8 03 shr $0x3,%eax 8e2: 83 c0 01 add $0x1,%eax 8e5: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 8e8: a1 a4 0c 00 00 mov 0xca4,%eax 8ed: 89 45 f0 mov %eax,-0x10(%ebp) 8f0: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 8f4: 75 23 jne 919 <malloc+0x46> base.s.ptr = freep = prevp = &base; 8f6: c7 45 f0 9c 0c 00 00 movl $0xc9c,-0x10(%ebp) 8fd: 8b 45 f0 mov -0x10(%ebp),%eax 900: a3 a4 0c 00 00 mov %eax,0xca4 905: a1 a4 0c 00 00 mov 0xca4,%eax 90a: a3 9c 0c 00 00 mov %eax,0xc9c base.s.size = 0; 90f: c7 05 a0 0c 00 00 00 movl $0x0,0xca0 916: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 919: 8b 45 f0 mov -0x10(%ebp),%eax 91c: 8b 00 mov (%eax),%eax 91e: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 921: 8b 45 f4 mov -0xc(%ebp),%eax 924: 8b 40 04 mov 0x4(%eax),%eax 927: 3b 45 ec cmp -0x14(%ebp),%eax 92a: 72 4d jb 979 <malloc+0xa6> if(p->s.size == nunits) 92c: 8b 45 f4 mov -0xc(%ebp),%eax 92f: 8b 40 04 mov 0x4(%eax),%eax 932: 3b 45 ec cmp -0x14(%ebp),%eax 935: 75 0c jne 943 <malloc+0x70> prevp->s.ptr = p->s.ptr; 937: 8b 45 f4 mov -0xc(%ebp),%eax 93a: 8b 10 mov (%eax),%edx 93c: 8b 45 f0 mov -0x10(%ebp),%eax 93f: 89 10 mov %edx,(%eax) 941: eb 26 jmp 969 <malloc+0x96> else { p->s.size -= nunits; 943: 8b 45 f4 mov -0xc(%ebp),%eax 946: 8b 40 04 mov 0x4(%eax),%eax 949: 2b 45 ec sub -0x14(%ebp),%eax 94c: 89 c2 mov %eax,%edx 94e: 8b 45 f4 mov -0xc(%ebp),%eax 951: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 954: 8b 45 f4 mov -0xc(%ebp),%eax 957: 8b 40 04 mov 0x4(%eax),%eax 95a: c1 e0 03 shl $0x3,%eax 95d: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 960: 8b 45 f4 mov -0xc(%ebp),%eax 963: 8b 55 ec mov -0x14(%ebp),%edx 966: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 969: 8b 45 f0 mov -0x10(%ebp),%eax 96c: a3 a4 0c 00 00 mov %eax,0xca4 return (void*)(p + 1); 971: 8b 45 f4 mov -0xc(%ebp),%eax 974: 83 c0 08 add $0x8,%eax 977: eb 3b jmp 9b4 <malloc+0xe1> } if(p == freep) 979: a1 a4 0c 00 00 mov 0xca4,%eax 97e: 39 45 f4 cmp %eax,-0xc(%ebp) 981: 75 1e jne 9a1 <malloc+0xce> if((p = morecore(nunits)) == 0) 983: 83 ec 0c sub $0xc,%esp 986: ff 75 ec pushl -0x14(%ebp) 989: e8 e5 fe ff ff call 873 <morecore> 98e: 83 c4 10 add $0x10,%esp 991: 89 45 f4 mov %eax,-0xc(%ebp) 994: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 998: 75 07 jne 9a1 <malloc+0xce> return 0; 99a: b8 00 00 00 00 mov $0x0,%eax 99f: eb 13 jmp 9b4 <malloc+0xe1> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 9a1: 8b 45 f4 mov -0xc(%ebp),%eax 9a4: 89 45 f0 mov %eax,-0x10(%ebp) 9a7: 8b 45 f4 mov -0xc(%ebp),%eax 9aa: 8b 00 mov (%eax),%eax 9ac: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 9af: e9 6d ff ff ff jmp 921 <malloc+0x4e> } 9b4: c9 leave 9b5: c3 ret
34.253103
85
0.422554
010eaef301930cb57a2c3551ff2d5a0d47c16258
2,387
asm
Assembly
programs/oeis/167/A167471.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/167/A167471.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/167/A167471.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A167471: Janet periodic table of the elements and structured hexagonal diamond numbers. a(n) = A166911(2n) + A166911(2n+1). ; 16,128,464,1152,2320,4096,6608,9984,14352,19840,26576,34688,44304,55552,68560,83456,100368,119424,140752,164480,190736,219648,251344,285952,323600,364416,408528,456064,507152,561920,620496,683008,749584,820352,895440,974976,1059088,1147904,1241552,1340160,1443856,1552768,1667024,1786752,1912080,2043136,2180048,2322944,2471952,2627200,2788816,2956928,3131664,3313152,3501520,3696896,3899408,4109184,4326352,4551040,4783376,5023488,5271504,5527552,5791760,6064256,6345168,6634624,6932752,7239680,7555536,7880448,8214544,8557952,8910800,9273216,9645328,10027264,10419152,10821120,11233296,11655808,12088784,12532352,12986640,13451776,13927888,14415104,14913552,15423360,15944656,16477568,17022224,17578752,18147280,18727936,19320848,19926144,20543952,21174400,21817616,22473728,23142864,23825152,24520720,25229696,25952208,26688384,27438352,28202240,28980176,29772288,30578704,31399552,32234960,33085056,33949968,34829824,35724752,36634880,37560336,38501248,39457744,40429952,41418000,42422016,43442128,44478464,45531152,46600320,47686096,48788608,49907984,51044352,52197840,53368576,54556688,55762304,56985552,58226560,59485456,60762368,62057424,63370752,64702480,66052736,67421648,68809344,70215952,71641600,73086416,74550528,76034064,77537152,79059920,80602496,82165008,83747584,85350352,86973440,88616976,90281088,91965904,93671552,95398160,97145856,98914768,100705024,102516752,104350080,106205136,108082048,109980944,111901952,113845200,115810816,117798928,119809664,121843152,123899520,125978896,128081408,130207184,132356352,134529040,136725376,138945488,141189504,143457552,145749760,148066256,150407168,152772624,155162752,157577680,160017536,162482448,164972544,167487952,170028800,172595216,175187328,177805264,180449152,183119120,185815296,188537808,191286784,194062352,196864640,199693776,202549888,205433104,208343552,211281360,214246656,217239568,220260224,223308752,226385280,229489936,232622848,235784144,238973952,242192400,245439616,248715728,252020864,255355152,258718720,262111696,265534208,268986384,272468352,275980240,279522176,283094288,286696704,290329552,293992960,297687056,301411968,305167824,308954752,312772880,316622336,320503248,324415744,328359952,332336000 mul $0,4 add $0,4 mov $1,$0 bin $1,3 add $1,$0 div $1,8 mul $1,16
217
2,193
0.868454
e87de8cac3faa3eabf1ddb854c016ddb70c900e1
1,345
asm
Assembly
Dependencies/ReturnSpoofer/ReturnSpoofer.asm
notSam25/Samplex-Rust
27f307bab28d201a8713d7435af8267825d9c239
[ "MIT" ]
null
null
null
Dependencies/ReturnSpoofer/ReturnSpoofer.asm
notSam25/Samplex-Rust
27f307bab28d201a8713d7435af8267825d9c239
[ "MIT" ]
null
null
null
Dependencies/ReturnSpoofer/ReturnSpoofer.asm
notSam25/Samplex-Rust
27f307bab28d201a8713d7435af8267825d9c239
[ "MIT" ]
null
null
null
PUBLIC SpooferStub option casemap :none ; if the line is labelled as MODIFY you need to modify the register it reads or writes to ; valid registers include: rbx, rbp+0x0, rdi, rsi, r12, r13+0x0, r14, r15 _TEXT SEGMENT SpooferStub PROC pop r11 ; poping without setting up stack frame, r11 is the return address (the one in our code) add rsp, 8 ; skipping callee reserved space mov rax, [rsp + 24] ; dereference shell_param mov r10, [rax] ; load shell_param.trampoline mov [rsp], r10 ; store address of trampoline as return address mov r10, [rax + 8] ; load shell_param.function mov [rax + 8], r11 ; store the original return address in shell_param.function mov [rax + 16], rdi ; preserve register in shell_param.register_ | MODIFY lea rdi, fixup ; load fixup address in register | MODIFY mov [rax], rdi ; store address of fixup label in shell_param.trampoline | MODIFY mov rdi, rax ; preserve address of shell_param in register | MODIFY jmp r10 ; call shell_param.function fixup: sub rsp, 16 mov rcx, rdi ; restore address of shell_param | MODIFY mov rdi, [rcx + 16] ; restore register from shell_param.register_ | MODIFY jmp QWORD PTR [rcx + 8] ; jmp to the original return address SpooferStub ENDP _TEXT ENDS END
40.757576
101
0.685502
89ece3ea50c986bc1572e0babbe3ee9baba09ff4
341
asm
Assembly
data/mapObjects/Route2TradeHouse.asm
AmateurPanda92/pokemon-rby-dx
f7ba1cc50b22d93ed176571e074a52d73360da93
[ "MIT" ]
9
2020-07-12T19:44:21.000Z
2022-03-03T23:32:40.000Z
data/mapObjects/Route2TradeHouse.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
data/mapObjects/Route2TradeHouse.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2021-03-28T18:33:43.000Z
2021-05-06T13:12:09.000Z
Route2TradeHouse_Object: db $a ; border block db 2 ; warps warp 2, 7, 2, -1 warp 3, 7, 2, -1 db 0 ; signs db 2 ; objects object SPRITE_OAK_AIDE, 2, 4, STAY, RIGHT, 1 ; person object SPRITE_GAMEBOY_KID_COPY, 4, 1, STAY, DOWN, 2 ; person ; warp-to warp_to 2, 7, ROUTE_2_TRADE_HOUSE_WIDTH warp_to 3, 7, ROUTE_2_TRADE_HOUSE_WIDTH
20.058824
61
0.697947
c683ff41ad9b6e9f7894abe7bef90576ca8404e4
607
asm
Assembly
examples/memory.asm
michalmalik/pvm
59def05cd36437c99f665afdc57ef87f6652b999
[ "MIT" ]
2
2018-11-13T09:48:06.000Z
2021-06-30T09:29:50.000Z
examples/memory.asm
michalmalik/pvm
59def05cd36437c99f665afdc57ef87f6652b999
[ "MIT" ]
null
null
null
examples/memory.asm
michalmalik/pvm
59def05cd36437c99f665afdc57ef87f6652b999
[ "MIT" ]
2
2017-03-06T20:46:09.000Z
2018-06-15T02:09:53.000Z
.dst_addr DAT 0 .src_addr DAT 0 ; IN ; +1 Destination address ; +2 Value ; +3 Count ; OUT ; None :write_mem STO Z,SP STO [dst_addr],[Z+1] STO Y,[Z+2] STO J,[Z+3] STO A,0 :write_mem_loop STO X,[dst_addr] ADD X,A STO [X],Y ADD A,1 IFL A,J JMP write_mem_loop STO SP,Z RET ; IN ; +1 Destination address ; +2 Source address ; +3 Count ; OUT ; None :copy_mem STO Z,SP STO [dst_addr],[Z+1] STO [src_addr],[Z+2] STO J,[Z+3] STO A,0 :copy_mem_loop STO X,[dst_addr] STO Y,[src_addr] ADD X,A ADD Y,A STO [X],[Y] ADD A,1 IFL A,J JMP copy_mem_loop STO SP,Z RET
11.45283
25
0.604613
0575b2ca2e87c7b9b95e85d5c701de0592235691
1,497
asm
Assembly
Assembly/sprite_randomizer.asm
CaitSith2/Enemizer
53be2143063c5ca03216f76821ebbbce67313e34
[ "WTFPL" ]
2
2020-06-21T14:38:23.000Z
2021-02-03T00:43:49.000Z
Assembly/sprite_randomizer.asm
CaitSith2/Enemizer
53be2143063c5ca03216f76821ebbbce67313e34
[ "WTFPL" ]
5
2020-07-16T22:12:30.000Z
2020-08-31T22:11:54.000Z
Assembly/sprite_randomizer.asm
CaitSith2/Enemizer
53be2143063c5ca03216f76821ebbbce67313e34
[ "WTFPL" ]
2
2020-07-16T22:34:11.000Z
2020-11-18T19:39:50.000Z
Palette_ArmorAndGloves: { ;DEDF9 LDA !RANDOM_SPRITE_FLAG : BNE .continue LDA.b #$10 : STA $BC ; Load Original Sprite Location REP #$21 LDA $7EF35B JSL $1BEDFF;Read Original Palette Code RTL .part_two SEP #$30 LDA !RANDOM_SPRITE_FLAG : BNE .continue REP #$30 LDA $7EF354 JSL $1BEE21;Read Original Palette Code RTL .continue PHX : PHY : PHA ; Load armor palette PHB : PHK : PLB REP #$20 ; Check what Link's armor value is. LDA $7EF35B : AND.w #$00FF : TAX ; (DEC06, X) LDA $1BEC06, X : AND.w #$00FF : ASL A : ADC.w #$F000 : STA $00 ;replace D308 by 7000 and search REP #$10 LDA.w #$01E2 ; Target SP-7 (sprite palette 6) LDX.w #$000E ; Palette has 15 colors TXY : TAX ;LDA $7EC178 : AND #$00FF : STA $02 LDA.b $BC : AND #$00FF : STA $02 .loop LDA [$00] : STA $7EC300, X : STA $7EC500, X INC $00 : INC $00 INX #2 DEY : BPL .loop SEP #$30 PLB INC $15 PLA : PLY : PLX RTL } change_sprite: { ;JSL $09C114 ; Restore the dungeon_resetsprites LDA !RANDOM_SPRITE_FLAG : BEQ .continue JSL GetRandomInt : AND #$1F : !ADD #$60 : STA $BC STA $7EC178 JSL Palette_ArmorAndGloves STZ $0710 .continue LDA $0E20, X : CMP.b #$61 ; Restored Code Bank06.asm(5967) ; LDA $0E20, X : CMP.b #$61 : BNE .not_beamos_laser RTL }
19.441558
114
0.549098
bb6c6993c486c3a3b92f947a9a58e2b29ecf9d88
1,208
asm
Assembly
programs/oeis/064/A064198.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/064/A064198.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/064/A064198.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A064198: a(n) = 3*(n-2)*(n-3)*(3*n^2-3*n-8)/2. ; 0,0,84,468,1476,3540,7200,13104,22008,34776,52380,75900,106524,145548,194376,254520,327600,415344,519588,642276,785460,951300,1142064,1360128,1607976,1888200,2203500,2556684,2950668,3388476,3873240,4408200,4996704,5642208,6348276,7118580,7956900,8867124,9853248,10919376,12069720,13308600,14640444,16069788,17601276,19239660,20989800,22856664,24845328,26960976,29208900,31594500,34123284,36800868,39632976,42625440,45784200,49115304,52624908,56319276,60204780,64287900,68575224,73073448,77789376,82729920,87902100,93313044,98969988,104880276,111051360,117490800,124206264,131205528,138496476,146087100,153985500,162199884,170738568,179609976,188822640,198385200,208306404,218595108,229260276,240310980,251756400,263605824,275868648,288554376,301672620,315233100,329245644,343720188,358666776,374095560,390016800,406440864,423378228,440839476 mov $4,$0 mov $5,$0 lpb $4 mov $0,$5 sub $4,1 sub $0,$4 mov $6,$0 mov $7,$0 mov $8,0 lpb $6 mov $0,$7 sub $6,1 sub $0,$6 mov $3,$0 mul $0,2 mov $2,3 add $3,1 add $3,$0 mul $2,$3 trn $3,5 mul $2,$3 mul $2,2 add $8,$2 lpe add $1,$8 lpe mov $0,$1
38.967742
843
0.738411
8e1179231424da4236571555158a5ef911933c30
6,942
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_690.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_690.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_690.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x1d8d2, %rdi nop and $37053, %rdx movb $0x61, (%rdi) nop nop nop nop and %r10, %r10 lea addresses_normal_ht+0x11642, %r13 clflush (%r13) nop nop nop nop nop and $60123, %rbp movb (%r13), %r10b and %rbp, %rbp lea addresses_A_ht+0x19042, %rsi lea addresses_A_ht+0x17942, %rdi nop nop nop sub %rbx, %rbx mov $107, %rcx rep movsl nop nop nop nop add $63114, %rcx lea addresses_normal_ht+0x13b54, %r13 nop nop xor $19122, %rsi vmovups (%r13), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $1, %xmm3, %rbx nop nop nop dec %rbp lea addresses_UC_ht+0x119e2, %rsi lea addresses_WC_ht+0x13042, %rdi nop add %rdx, %rdx mov $44, %rcx rep movsl nop nop add %rbp, %rbp lea addresses_A_ht+0xc919, %rsi lea addresses_normal_ht+0x66e2, %rdi nop nop nop nop nop cmp $21008, %rbx mov $26, %rcx rep movsq nop cmp $40530, %rsi lea addresses_D_ht+0x12cde, %rsi lea addresses_A_ht+0x15ac2, %rdi clflush (%rsi) nop nop nop nop nop and $48069, %rdx mov $93, %rcx rep movsl nop nop nop nop nop add $45327, %rbx lea addresses_normal_ht+0x3dc2, %r13 nop nop nop nop cmp %rbp, %rbp movl $0x61626364, (%r13) nop nop nop and $53590, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r15 push %r8 push %rax push %rdx push %rsi // Store lea addresses_PSE+0x169ba, %rdx nop nop nop xor $41284, %rax mov $0x5152535455565758, %r15 movq %r15, %xmm3 vmovups %ymm3, (%rdx) nop nop nop cmp $49633, %r8 // Store lea addresses_WC+0x10ad2, %rax sub %r11, %r11 mov $0x5152535455565758, %rdx movq %rdx, %xmm5 movups %xmm5, (%rax) nop nop nop nop xor $47107, %r11 // Store mov $0x33a, %rdx sub $61183, %r8 movw $0x5152, (%rdx) nop cmp %rax, %rax // Faulty Load lea addresses_normal+0x1ee42, %r11 nop nop nop add %rax, %rax vmovups (%r11), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $0, %xmm7, %rdx lea oracles, %r8 and $0xff, %rdx shlq $12, %rdx mov (%r8,%rdx,1), %rdx pop %rsi pop %rdx pop %rax pop %r8 pop %r15 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 3}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 3}} [Faulty Load] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 3}} {'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}} {'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': True}} {'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 6}} {'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 */
34.884422
2,999
0.659608
262fa14da709fe9b01a94dc3012dfacdf53d0c0b
583
asm
Assembly
Gas/Prism/GIC/GIT.asm
Gabidal/GAS_Pack
02f13531849bc5c03721a4319a9e315a60ba7707
[ "MIT" ]
1
2021-09-21T13:07:37.000Z
2021-09-21T13:07:37.000Z
Gas/Prism/GIC/GIT.asm
Gabidal/GAS_Pack
02f13531849bc5c03721a4319a9e315a60ba7707
[ "MIT" ]
null
null
null
Gas/Prism/GIC/GIT.asm
Gabidal/GAS_Pack
02f13531849bc5c03721a4319a9e315a60ba7707
[ "MIT" ]
null
null
null
;GAS COMMAND TREE tryCatch GTree, jmp sumAB: add ax, bx cycle subAB: sub ax, bx cycle mulAB: clean dx mul bx cycle divAB: clean dx div bx cycle swichAB: xchg ax, bx cycle ifAB: cmp ax, bx je trueAB jne falseAB cycle trueAB: getFromGic jmp endCycle falseAB: getFromGic getFromGic jmp endCycle globalize: mov sv[0], word ax mov di, -1 jmp quickCycle externize: mov bx, word sv[0] mov di, -1 jmp quickCycle conEG: mov bx, word sv[0] mov di, 0 jmp quickCycle endGTree:
8.449275
20
0.602058
59fb7b3553566b1f305326433615d642283e72d0
2,113
asm
Assembly
src/strings/check.asm
majioa/fleco
ca5baad52c97f3fbba8ae4fe02044af84b55ce05
[ "MIT" ]
null
null
null
src/strings/check.asm
majioa/fleco
ca5baad52c97f3fbba8ae4fe02044af84b55ce05
[ "MIT" ]
null
null
null
src/strings/check.asm
majioa/fleco
ca5baad52c97f3fbba8ae4fe02044af84b55ce05
[ "MIT" ]
null
null
null
;[]-----------------------------------------------------------------[] ;| CHECK.ASM -- string checking functions | ;[]-----------------------------------------------------------------[] ; ; $Copyright: 2005$ ; $Revision: 1.1.1.1 $ ; ;bool __fastcall IsDelimiter(const AnsiString& delimiters, int index) const; ;bool __fastcall IsEmpty() const; ;bool __fastcall IsPathDelimiter(int index) const; %include 'constant.inc' ; EXTERN GetSymbol ; EXTERN GetRutfSymbol ; EXTERN CompareSymbol ; EXTERN ConvertSymbol EXTERN ConvertSymbol_table EXTERN CompareSymbol_table GLOBAL @FastString@IsDelimiter$xqqrrx10FastStringui GLOBAL @FastString@IsEmpty$xqqrv GLOBAL @FastString@IsPathDelimiter$xqqrui GLOBAL IsEmpty section _TEXT IsEmpty: mov eax, [eax] or eax, eax jz IsEmpty_exit cmp dword [eax-SIZEOF_FASTSTRING+FastString.Length],0 IsEmpty_exit: ret @FastString@IsDelimiter$xqqrrx10FastStringui: ;in ;eax: this ;edx: delimiters fast string ;ecx: index call IsEmpty jz @FastString@IsDelimiter$xqqrrx10FastStringui_exit push ebx push esi push edi mov esi, [eax] mov edi, edx ; ; mov eax, [esi-SIZEOF_FASTSTRING+FastString.Locale] ; movzx eax, byte [eax-SIZEOF_LOCALE+Locale.Type] movzx eax, word [esi-SIZEOF_FASTSTRING+FastString.CP] shr eax, 12 and eax, 1100b movzx edx, word [edi-SIZEOF_FASTSTRING+FastString.CP] shr edx, 14 call [ConvertSymbol_table+edx*4+eax] ; call GetCPS call [CompareSymbol_table+edx*4] pop edi pop esi pop ebx @FastString@IsDelimiter$xqqrrx10FastStringui_exit: ret @FastString@IsEmpty$xqqrv: call IsEmpty setz al ret @FastString@IsPathDelimiter$xqqrui: ;in ;eax: this ;edx: index call IsEmpty jz @FastString@IsPathDelimiter$xqqrui_exit push ebx mov ebx, [eax] movzx eax, word [ebx-SIZEOF_FASTSTRING+FastString.CP] shr eax, 14 or eax, 1100b call [ConvertSymbol_table+eax] ; call GetRutfSymbol cmp eax, [PathDelimiter] setz al pop ebx @FastString@IsPathDelimiter$xqqrui_exit: ret section _DATA PathDelimiter: dd '/'
22.478723
77
0.675343
47f1cd1b43cf0b25f58c92d834dddfb1836d01a3
363
asm
Assembly
programs/oeis/102/A102900.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/102/A102900.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/102/A102900.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A102900: a(n) = 3*a(n-1) + 4*a(n-2), a(0)=a(1)=1. ; 1,1,7,25,103,409,1639,6553,26215,104857,419431,1677721,6710887,26843545,107374183,429496729,1717986919,6871947673,27487790695,109951162777,439804651111,1759218604441,7036874417767,28147497671065,112589990684263,450359962737049,1801439850948199,7205759403792793 mov $1,4 pow $1,$0 div $1,15 mul $1,6 add $1,1
40.333333
262
0.774105
d3c1663951a8739b56c2fc57d27eefb72c2a3268
496
asm
Assembly
programs/oeis/111/A111250.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/111/A111250.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/111/A111250.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A111250: Numbers n such that 7*n + 10 is prime. ; 1,3,7,9,13,21,27,31,33,37,39,43,49,51,57,67,73,79,81,87,91,93,109,111,117,121,133,139,141,147,157,159,163,169,177,181,183,187,193,207,211,219,223,229,231,237,241,249,259,267,271,277,297,303,319,333,339,343,351,363,367,369,373,379,381,387,397,399,411,421,423,427,433,439,451,453,457,463,471,483,489,493,501,507,519,523,531,537,541,549,553,559,571,573,577,583,589,601,603,607 add $0,1 seq $0,89033 ; Numbers n such that 7*n+3 is prime. sub $0,1
70.857143
375
0.711694
a4d17739b3d7b565f8b56a9925b3b99ec8258503
5,946
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1662.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1662.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1662.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r8 push %r9 push %rax push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x904f, %rax nop nop nop nop inc %rbp mov $0x6162636465666768, %rbx movq %rbx, (%rax) nop nop nop nop nop sub $32224, %rcx lea addresses_A_ht+0x14f6f, %rsi and %r9, %r9 mov $0x6162636465666768, %rbp movq %rbp, %xmm6 vmovups %ymm6, (%rsi) nop nop nop and $5469, %rbp lea addresses_A_ht+0x4a3b, %rbp nop and %r8, %r8 mov (%rbp), %r9w nop nop nop nop cmp $50259, %r9 lea addresses_normal_ht+0x160cf, %rbp nop nop nop nop cmp $8442, %rax movw $0x6162, (%rbp) nop inc %rcx lea addresses_WC_ht+0xcf8f, %rsi lea addresses_WC_ht+0x1864f, %rdi clflush (%rdi) nop inc %rbp mov $95, %rcx rep movsq nop nop nop xor $42205, %rdi lea addresses_A_ht+0x284f, %rsi lea addresses_WC_ht+0x464f, %rdi add $58549, %rbx mov $91, %rcx rep movsb nop nop nop nop dec %r8 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %rax pop %r9 pop %r8 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r15 push %rbp push %rcx push %rsi // Store lea addresses_WT+0x478f, %r13 nop and %r12, %r12 mov $0x5152535455565758, %rsi movq %rsi, %xmm2 movups %xmm2, (%r13) nop nop add %rsi, %rsi // Store lea addresses_D+0x274f, %r12 clflush (%r12) nop and $27506, %r10 movw $0x5152, (%r12) nop nop nop nop nop sub $65327, %rcx // Faulty Load lea addresses_D+0xae4f, %r12 nop nop sub %r15, %r15 movb (%r12), %r13b lea oracles, %r12 and $0xff, %r13 shlq $12, %r13 mov (%r12,%r13,1), %r13 pop %rsi pop %rcx pop %rbp pop %r15 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'AVXalign': True, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 7}} [Faulty Load] {'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8, 'NT': True, 'same': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 4}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 2, 'NT': False, 'same': False, 'congruent': 7}} {'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': True}} {'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 */
38.61039
2,999
0.658089
ff24218bbea4097f676e74c86d2d9c04a0a54f38
1,041
asm
Assembly
programs/oeis/063/A063914.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/063/A063914.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/063/A063914.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A063914: Odd numbers interlaced with numbers 3m+2. ; 1,2,3,5,5,8,7,11,9,14,11,17,13,20,15,23,17,26,19,29,21,32,23,35,25,38,27,41,29,44,31,47,33,50,35,53,37,56,39,59,41,62,43,65,45,68,47,71,49,74,51,77,53,80,55,83,57,86,59,89,61,92,63,95,65,98,67,101,69,104,71,107,73,110,75,113,77,116,79,119,81,122,83,125,85,128,87,131,89,134,91,137,93,140,95,143,97,146,99,149,101,152,103,155,105,158,107,161,109,164,111,167,113,170,115,173,117,176,119,179,121,182,123,185,125,188,127,191,129,194,131,197,133,200,135,203,137,206,139,209,141,212,143,215,145,218,147,221,149,224,151,227,153,230,155,233,157,236,159,239,161,242,163,245,165,248,167,251,169,254,171,257,173,260,175,263,177,266,179,269,181,272,183,275,185,278,187,281,189,284,191,287,193,290,195,293,197,296,199,299,201,302,203,305,205,308,207,311,209,314,211,317,213,320,215,323,217,326,219,329,221,332,223,335,225,338,227,341,229,344,231,347,233,350,235,353,237,356,239,359,241,362,243,365,245,368,247,371,249,374 mov $1,$0 mul $1,2 mov $2,$0 mod $0,2 pow $2,$0 add $1,$2 div $1,2 add $1,1
86.75
910
0.710855
19cbb04bf2d37cdc48e834e1b5ae7f2513b0ef91
822
asm
Assembly
Testcases/testcase.asm
Felipe-Rubin/MIPS-Monocycle-32-bits
cb51d0dbc132acce492c67ec0389ef17847bdfe3
[ "MIT" ]
null
null
null
Testcases/testcase.asm
Felipe-Rubin/MIPS-Monocycle-32-bits
cb51d0dbc132acce492c67ec0389ef17847bdfe3
[ "MIT" ]
null
null
null
Testcases/testcase.asm
Felipe-Rubin/MIPS-Monocycle-32-bits
cb51d0dbc132acce492c67ec0389ef17847bdfe3
[ "MIT" ]
null
null
null
.text .globl main main: la $t0, A # Carrega pos mem A lw $t0, 0 ($t0) # carrega valor pos mem A xori $t1, $zero, 0 # Zera $t1 la $t2, B #Carrega pos mem B lw $t2, 0 ($t2) #Carrega valor pos mem B addu $t0, $t0, $t2 # Soma Val[A] + Val[B] addiu $t0, $t0, 3 # incrementa o valor da soma em 3 ori $t5, $zero, 2 # i = 2 beq $zero, $zero, loop # Salta pro loop loop: sll $t0, $t0, 4 # $t0 * 8 srl $t0, $t0, 2 # $t0 / 4 addiu $t5, $t5, -1 # i-- bne $t5, $zero, loop # Se i = 0, para, senao loop denovo fim: andi $t7, $t0, 1 #Verifica se o resultado eh par = 0, ou impar = 1 slt $t8, $t5, $t0 # 1 se 0 < Resultado, senao 0 sltiu $t9, $t0, 10 # 1 se Resultado < 10, senao 0 la $t1, C # Carrega pos mem C sw $t0, 0 ($t1) # Salva o resultado em C .data A: .word 0x3 B: .word 0x4 C: .word 0x0
20.55
67
0.571776
1478e8566703e7d43ba94b9e59e869ebbacddf8a
3,964
asm
Assembly
externals/mpir-3.0.0/mpn/x86/pentium/sub_n.asm
JaminChan/eos_win
c03e57151cfe152d0d3120abb13226f4df74f37e
[ "MIT" ]
1
2018-08-14T03:52:21.000Z
2018-08-14T03:52:21.000Z
externals/mpir-3.0.0/mpn/x86/pentium/sub_n.asm
JaminChan/eos_win
c03e57151cfe152d0d3120abb13226f4df74f37e
[ "MIT" ]
null
null
null
externals/mpir-3.0.0/mpn/x86/pentium/sub_n.asm
JaminChan/eos_win
c03e57151cfe152d0d3120abb13226f4df74f37e
[ "MIT" ]
null
null
null
dnl Intel Pentium mpn_add_n/mpn_sub_n -- mpn addition and subtraction. dnl Copyright 1992, 1994, 1995, 1996, 1999, 2000, 2002 Free Software dnl Foundation, Inc. dnl dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or dnl modify it under the terms of the GNU Lesser General Public License as dnl published by the Free Software Foundation; either version 2.1 of the dnl License, or (at your option) any later version. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Lesser General Public License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public dnl License along with the GNU MP Library; see the file COPYING.LIB. If dnl not, write to the Free Software Foundation, Inc., 51 Franklin Street, dnl Fifth Floor, Boston, MA 02110-1301, USA. include(`../config.m4') C P5: 2.375 cycles/limb define(`OPERATION_sub_n',1) ifdef(`OPERATION_add_n',` define(M4_inst, adcl) define(M4_function_n, mpn_add_n) define(M4_function_nc, mpn_add_nc) ',`ifdef(`OPERATION_sub_n',` define(M4_inst, sbbl) define(M4_function_n, mpn_sub_n) define(M4_function_nc, mpn_sub_nc) ',`m4_error(`Need OPERATION_add_n or OPERATION_sub_n ')')') MULFUNC_PROLOGUE(mpn_sub_n mpn_sub_nc) C mp_limb_t M4_function_n (mp_ptr dst, mp_srcptr src1, mp_srcptr src2, C mp_size_t size); C mp_limb_t M4_function_nc (mp_ptr dst, mp_srcptr src1, mp_srcptr src2, C mp_size_t size, mp_limb_t carry); defframe(PARAM_CARRY,20) defframe(PARAM_SIZE, 16) defframe(PARAM_SRC2, 12) defframe(PARAM_SRC1, 8) defframe(PARAM_DST, 4) TEXT ALIGN(8) PROLOGUE(M4_function_nc) pushl %edi pushl %esi pushl %ebx pushl %ebp deflit(`FRAME',16) movl PARAM_DST,%edi movl PARAM_SRC1,%esi movl PARAM_SRC2,%ebp movl PARAM_SIZE,%ecx movl (%ebp),%ebx decl %ecx movl %ecx,%edx shrl $3,%ecx andl $7,%edx testl %ecx,%ecx C zero carry flag jz L(endgo) pushl %edx FRAME_pushl() movl PARAM_CARRY,%eax shrl $1,%eax C shift bit 0 into carry jmp L(oop) L(endgo): deflit(`FRAME',16) movl PARAM_CARRY,%eax shrl $1,%eax C shift bit 0 into carry jmp L(end) EPILOGUE() ALIGN(8) PROLOGUE(M4_function_n) pushl %edi pushl %esi pushl %ebx pushl %ebp deflit(`FRAME',16) movl PARAM_DST,%edi movl PARAM_SRC1,%esi movl PARAM_SRC2,%ebp movl PARAM_SIZE,%ecx movl (%ebp),%ebx decl %ecx movl %ecx,%edx shrl $3,%ecx andl $7,%edx testl %ecx,%ecx C zero carry flag jz L(end) pushl %edx FRAME_pushl() ALIGN(8) L(oop): movl 28(%edi),%eax C fetch destination cache line leal 32(%edi),%edi L(1): movl (%esi),%eax movl 4(%esi),%edx M4_inst %ebx,%eax movl 4(%ebp),%ebx M4_inst %ebx,%edx movl 8(%ebp),%ebx movl %eax,-32(%edi) movl %edx,-28(%edi) L(2): movl 8(%esi),%eax movl 12(%esi),%edx M4_inst %ebx,%eax movl 12(%ebp),%ebx M4_inst %ebx,%edx movl 16(%ebp),%ebx movl %eax,-24(%edi) movl %edx,-20(%edi) L(3): movl 16(%esi),%eax movl 20(%esi),%edx M4_inst %ebx,%eax movl 20(%ebp),%ebx M4_inst %ebx,%edx movl 24(%ebp),%ebx movl %eax,-16(%edi) movl %edx,-12(%edi) L(4): movl 24(%esi),%eax movl 28(%esi),%edx M4_inst %ebx,%eax movl 28(%ebp),%ebx M4_inst %ebx,%edx movl 32(%ebp),%ebx movl %eax,-8(%edi) movl %edx,-4(%edi) leal 32(%esi),%esi leal 32(%ebp),%ebp decl %ecx jnz L(oop) popl %edx FRAME_popl() L(end): decl %edx C test %edx w/o clobbering carry js L(end2) incl %edx L(oop2): leal 4(%edi),%edi movl (%esi),%eax M4_inst %ebx,%eax movl 4(%ebp),%ebx movl %eax,-4(%edi) leal 4(%esi),%esi leal 4(%ebp),%ebp decl %edx jnz L(oop2) L(end2): movl (%esi),%eax M4_inst %ebx,%eax movl %eax,(%edi) sbbl %eax,%eax negl %eax popl %ebp popl %ebx popl %esi popl %edi ret EPILOGUE()
20.121827
74
0.689455
c4bbb301a90c6ac1fbabc866ce63fd607e396e9e
97
asm
Assembly
tests/testAssembler/testCases/prog2.asm
1sand0s/Lc3B-Assembler
050ed50e2b9f594a5ed510b6c5d4ed120e779981
[ "MIT" ]
null
null
null
tests/testAssembler/testCases/prog2.asm
1sand0s/Lc3B-Assembler
050ed50e2b9f594a5ed510b6c5d4ed120e779981
[ "MIT" ]
null
null
null
tests/testAssembler/testCases/prog2.asm
1sand0s/Lc3B-Assembler
050ed50e2b9f594a5ed510b6c5d4ed120e779981
[ "MIT" ]
null
null
null
.ORIG x4000 MAIN LEA R2,L0 JSRR R2 JSR L1 HALT L0 ADD R0,R0,#5 RET L1 ADD R1,R1,#5 RET .END
8.818182
15
0.659794
d662296c84cbbbdb96a334262ba755ffeae170a9
396
asm
Assembly
programs/oeis/133/A133572.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/133/A133572.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/133/A133572.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A133572: Row sums of triangle A133571. ; 1,4,6,16,24,64,96,256,384,1024,1536,4096,6144,16384,24576,65536,98304,262144,393216,1048576,1572864,4194304,6291456,16777216,25165824,67108864,100663296,268435456,402653184,1073741824,1610612736,4294967296 mov $4,3 lpb $0,1 sub $0,1 mov $1,$4 add $2,5 mov $3,$2 mul $4,2 sub $4,1 mul $4,2 mov $2,$4 add $4,$3 sub $4,$2 lpe add $1,1
22
207
0.689394
c6227d8b35cca3b953e866653d098733f55fb52e
506
asm
Assembly
programs/oeis/122/A122918.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/122/A122918.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/122/A122918.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A122918: Expansion of (1+x)^2/(1+x+x^2)^2. ; 1,0,-2,2,1,-4,3,2,-6,4,3,-8,5,4,-10,6,5,-12,7,6,-14,8,7,-16,9,8,-18,10,9,-20,11,10,-22,12,11,-24,13,12,-26,14,13,-28,15,14,-30,16,15,-32,17,16,-34,18,17,-36,19,18,-38,20,19,-40,21,20,-42,22,21,-44,23,22,-46,24,23,-48,25,24,-50,26,25,-52,27,26,-54,28,27,-56,29,28,-58,30,29,-60,31,30,-62,32,31,-64,33,32,-66,34 mov $1,$0 mul $1,2 mov $2,$0 lpb $1 add $0,$1 sub $0,$2 sub $1,1 add $2,$0 sub $0,$3 mov $3,2 lpe mov $1,$0 add $1,3 mov $0,$1 div $0,3
26.631579
311
0.543478
f7176431489e92a554ba0958847f2d98756cb64c
2,494
asm
Assembly
boot/boot.asm
dengtong/toyos
e3f7c97b74825c773650d7d05f84e8a7edc2e1d6
[ "MIT" ]
null
null
null
boot/boot.asm
dengtong/toyos
e3f7c97b74825c773650d7d05f84e8a7edc2e1d6
[ "MIT" ]
null
null
null
boot/boot.asm
dengtong/toyos
e3f7c97b74825c773650d7d05f84e8a7edc2e1d6
[ "MIT" ]
null
null
null
;代码清单5-1 ;文件名:c05_mbr.asm ;文件说明:硬盘主引导扇区代码 ;创建日期:2011-3-31 21:15 mov ax,0xb800 ;指向文本模式的显示缓冲区 mov es,ax ;以下显示字符串"Label offset:" mov byte [es:0x00],'L' mov byte [es:0x01],0x07 mov byte [es:0x02],'a' mov byte [es:0x03],0x07 mov byte [es:0x04],'b' mov byte [es:0x05],0x07 mov byte [es:0x06],'e' mov byte [es:0x07],0x07 mov byte [es:0x08],'l' mov byte [es:0x09],0x07 mov byte [es:0x0a],' ' mov byte [es:0x0b],0x07 mov byte [es:0x0c],"o" mov byte [es:0x0d],0x07 mov byte [es:0x0e],'f' mov byte [es:0x0f],0x07 mov byte [es:0x10],'f' mov byte [es:0x11],0x07 mov byte [es:0x12],'s' mov byte [es:0x13],0x07 mov byte [es:0x14],'e' mov byte [es:0x15],0x07 mov byte [es:0x16],'t' mov byte [es:0x17],0x07 mov byte [es:0x18],':' mov byte [es:0x19],0x07 mov ax,number ;取得标号number的偏移地址 mov bx,10 ;设置数据段的基地址 mov cx,cs mov ds,cx ;求个位上的数字 mov dx,0 div bx mov [0x7c00+number+0x00],dl ;保存个位上的数字 ;求十位上的数字 xor dx,dx div bx mov [0x7c00+number+0x01],dl ;保存十位上的数字 ;求百位上的数字 xor dx,dx div bx mov [0x7c00+number+0x02],dl ;保存百位上的数字 ;求千位上的数字 xor dx,dx div bx mov [0x7c00+number+0x03],dl ;保存千位上的数字 ;求万位上的数字 xor dx,dx div bx mov [0x7c00+number+0x04],dl ;保存万位上的数字 ;以下用十进制显示标号的偏移地址 mov al,[0x7c00+number+0x04] add al,0x30 mov [es:0x1a],al mov byte [es:0x1b],0x04 mov al,[0x7c00+number+0x03] add al,0x30 mov [es:0x1c],al mov byte [es:0x1d],0x04 mov al,[0x7c00+number+0x02] add al,0x30 mov [es:0x1e],al mov byte [es:0x1f],0x04 mov al,[0x7c00+number+0x01] add al,0x30 mov [es:0x20],al mov byte [es:0x21],0x04 mov al,[0x7c00+number+0x00] add al,0x30 mov [es:0x22],al mov byte [es:0x23],0x04 mov byte [es:0x24],'D' mov byte [es:0x25],0x07 infi: jmp near infi ;无限循环 number db 0,0,0,0,0 times 203 db 0 db 0x55,0xaa
24.213592
55
0.473136
69a10509cb30024ac73966f7d6526c1ded0b1a78
767
asm
Assembly
oeis/031/A031393.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/031/A031393.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/031/A031393.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A031393: a(n) = prime(6*n - 4). ; Submitted by Jon Maiga ; 3,19,43,71,101,131,163,193,229,263,293,337,373,409,443,479,521,569,601,641,673,719,757,809,839,881,929,971,1013,1049,1091,1123,1181,1223,1277,1301,1361,1423,1451,1487,1531,1571,1609,1657,1699,1747,1789,1861,1889,1949,1997,2029,2083,2129,2161,2237,2273,2311,2357,2393,2441,2503,2551,2617,2663,2693,2729,2777,2819,2861,2917,2969,3023,3079,3137,3191,3251,3301,3331,3373,3449,3491,3533,3571,3617,3671,3709,3767,3821,3863,3917,3947,4013,4057,4111,4157,4219,4259,4297,4363 mov $2,36 mul $2,$0 mul $0,6 mov $4,2 lpb $2 mov $3,$4 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 mov $1,$0 max $1,0 cmp $1,$0 mul $2,$1 sub $2,1 add $4,2 lpe mov $0,$4 add $0,1
34.863636
468
0.698827
f95d9a1c0742f2d927f6a6b28d49f643f1675bbe
46,843
asm
Assembly
wc.asm
yonigev/OSAssignment2
f9f538b32135ae2841900fbb24386417908f49ab
[ "MIT-0" ]
null
null
null
wc.asm
yonigev/OSAssignment2
f9f538b32135ae2841900fbb24386417908f49ab
[ "MIT-0" ]
null
null
null
wc.asm
yonigev/OSAssignment2
f9f538b32135ae2841900fbb24386417908f49ab
[ "MIT-0" ]
null
null
null
_wc: file format elf32-i386 Disassembly of section .text: 00000000 <wc>: char buf[512]; void wc(int fd, char *name) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 28 sub $0x28,%esp int i, n; int l, w, c, inword; l = w = c = 0; 6: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp) d: 8b 45 e8 mov -0x18(%ebp),%eax 10: 89 45 ec mov %eax,-0x14(%ebp) 13: 8b 45 ec mov -0x14(%ebp),%eax 16: 89 45 f0 mov %eax,-0x10(%ebp) inword = 0; 19: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) while((n = read(fd, buf, sizeof(buf))) > 0){ 20: eb 69 jmp 8b <wc+0x8b> for(i=0; i<n; i++){ 22: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 29: eb 58 jmp 83 <wc+0x83> c++; 2b: 83 45 e8 01 addl $0x1,-0x18(%ebp) if(buf[i] == '\n') 2f: 8b 45 f4 mov -0xc(%ebp),%eax 32: 05 40 0c 00 00 add $0xc40,%eax 37: 0f b6 00 movzbl (%eax),%eax 3a: 3c 0a cmp $0xa,%al 3c: 75 04 jne 42 <wc+0x42> l++; 3e: 83 45 f0 01 addl $0x1,-0x10(%ebp) if(strchr(" \r\t\n\v", buf[i])) 42: 8b 45 f4 mov -0xc(%ebp),%eax 45: 05 40 0c 00 00 add $0xc40,%eax 4a: 0f b6 00 movzbl (%eax),%eax 4d: 0f be c0 movsbl %al,%eax 50: 83 ec 08 sub $0x8,%esp 53: 50 push %eax 54: 68 59 09 00 00 push $0x959 59: e8 35 02 00 00 call 293 <strchr> 5e: 83 c4 10 add $0x10,%esp 61: 85 c0 test %eax,%eax 63: 74 09 je 6e <wc+0x6e> inword = 0; 65: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 6c: eb 11 jmp 7f <wc+0x7f> else if(!inword){ 6e: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 72: 75 0b jne 7f <wc+0x7f> w++; 74: 83 45 ec 01 addl $0x1,-0x14(%ebp) inword = 1; 78: c7 45 e4 01 00 00 00 movl $0x1,-0x1c(%ebp) int l, w, c, inword; l = w = c = 0; inword = 0; while((n = read(fd, buf, sizeof(buf))) > 0){ for(i=0; i<n; i++){ 7f: 83 45 f4 01 addl $0x1,-0xc(%ebp) 83: 8b 45 f4 mov -0xc(%ebp),%eax 86: 3b 45 e0 cmp -0x20(%ebp),%eax 89: 7c a0 jl 2b <wc+0x2b> int i, n; int l, w, c, inword; l = w = c = 0; inword = 0; while((n = read(fd, buf, sizeof(buf))) > 0){ 8b: 83 ec 04 sub $0x4,%esp 8e: 68 00 02 00 00 push $0x200 93: 68 40 0c 00 00 push $0xc40 98: ff 75 08 pushl 0x8(%ebp) 9b: e8 8c 03 00 00 call 42c <read> a0: 83 c4 10 add $0x10,%esp a3: 89 45 e0 mov %eax,-0x20(%ebp) a6: 83 7d e0 00 cmpl $0x0,-0x20(%ebp) aa: 0f 8f 72 ff ff ff jg 22 <wc+0x22> w++; inword = 1; } } } if(n < 0){ b0: 83 7d e0 00 cmpl $0x0,-0x20(%ebp) b4: 79 17 jns cd <wc+0xcd> printf(1, "wc: read error\n"); b6: 83 ec 08 sub $0x8,%esp b9: 68 5f 09 00 00 push $0x95f be: 6a 01 push $0x1 c0: e8 de 04 00 00 call 5a3 <printf> c5: 83 c4 10 add $0x10,%esp exit(); c8: e8 47 03 00 00 call 414 <exit> } printf(1, "%d %d %d %s\n", l, w, c, name); cd: 83 ec 08 sub $0x8,%esp d0: ff 75 0c pushl 0xc(%ebp) d3: ff 75 e8 pushl -0x18(%ebp) d6: ff 75 ec pushl -0x14(%ebp) d9: ff 75 f0 pushl -0x10(%ebp) dc: 68 6f 09 00 00 push $0x96f e1: 6a 01 push $0x1 e3: e8 bb 04 00 00 call 5a3 <printf> e8: 83 c4 20 add $0x20,%esp } eb: 90 nop ec: c9 leave ed: c3 ret 000000ee <main>: int main(int argc, char *argv[]) { ee: 8d 4c 24 04 lea 0x4(%esp),%ecx f2: 83 e4 f0 and $0xfffffff0,%esp f5: ff 71 fc pushl -0x4(%ecx) f8: 55 push %ebp f9: 89 e5 mov %esp,%ebp fb: 53 push %ebx fc: 51 push %ecx fd: 83 ec 10 sub $0x10,%esp 100: 89 cb mov %ecx,%ebx int fd, i; if(argc <= 1){ 102: 83 3b 01 cmpl $0x1,(%ebx) 105: 7f 17 jg 11e <main+0x30> wc(0, ""); 107: 83 ec 08 sub $0x8,%esp 10a: 68 7c 09 00 00 push $0x97c 10f: 6a 00 push $0x0 111: e8 ea fe ff ff call 0 <wc> 116: 83 c4 10 add $0x10,%esp exit(); 119: e8 f6 02 00 00 call 414 <exit> } for(i = 1; i < argc; i++){ 11e: c7 45 f4 01 00 00 00 movl $0x1,-0xc(%ebp) 125: e9 83 00 00 00 jmp 1ad <main+0xbf> if((fd = open(argv[i], 0)) < 0){ 12a: 8b 45 f4 mov -0xc(%ebp),%eax 12d: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 134: 8b 43 04 mov 0x4(%ebx),%eax 137: 01 d0 add %edx,%eax 139: 8b 00 mov (%eax),%eax 13b: 83 ec 08 sub $0x8,%esp 13e: 6a 00 push $0x0 140: 50 push %eax 141: e8 0e 03 00 00 call 454 <open> 146: 83 c4 10 add $0x10,%esp 149: 89 45 f0 mov %eax,-0x10(%ebp) 14c: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 150: 79 29 jns 17b <main+0x8d> printf(1, "wc: cannot open %s\n", argv[i]); 152: 8b 45 f4 mov -0xc(%ebp),%eax 155: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 15c: 8b 43 04 mov 0x4(%ebx),%eax 15f: 01 d0 add %edx,%eax 161: 8b 00 mov (%eax),%eax 163: 83 ec 04 sub $0x4,%esp 166: 50 push %eax 167: 68 7d 09 00 00 push $0x97d 16c: 6a 01 push $0x1 16e: e8 30 04 00 00 call 5a3 <printf> 173: 83 c4 10 add $0x10,%esp exit(); 176: e8 99 02 00 00 call 414 <exit> } wc(fd, argv[i]); 17b: 8b 45 f4 mov -0xc(%ebp),%eax 17e: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 185: 8b 43 04 mov 0x4(%ebx),%eax 188: 01 d0 add %edx,%eax 18a: 8b 00 mov (%eax),%eax 18c: 83 ec 08 sub $0x8,%esp 18f: 50 push %eax 190: ff 75 f0 pushl -0x10(%ebp) 193: e8 68 fe ff ff call 0 <wc> 198: 83 c4 10 add $0x10,%esp close(fd); 19b: 83 ec 0c sub $0xc,%esp 19e: ff 75 f0 pushl -0x10(%ebp) 1a1: e8 96 02 00 00 call 43c <close> 1a6: 83 c4 10 add $0x10,%esp if(argc <= 1){ wc(0, ""); exit(); } for(i = 1; i < argc; i++){ 1a9: 83 45 f4 01 addl $0x1,-0xc(%ebp) 1ad: 8b 45 f4 mov -0xc(%ebp),%eax 1b0: 3b 03 cmp (%ebx),%eax 1b2: 0f 8c 72 ff ff ff jl 12a <main+0x3c> exit(); } wc(fd, argv[i]); close(fd); } exit(); 1b8: e8 57 02 00 00 call 414 <exit> 000001bd <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 1bd: 55 push %ebp 1be: 89 e5 mov %esp,%ebp 1c0: 57 push %edi 1c1: 53 push %ebx asm volatile("cld; rep stosb" : 1c2: 8b 4d 08 mov 0x8(%ebp),%ecx 1c5: 8b 55 10 mov 0x10(%ebp),%edx 1c8: 8b 45 0c mov 0xc(%ebp),%eax 1cb: 89 cb mov %ecx,%ebx 1cd: 89 df mov %ebx,%edi 1cf: 89 d1 mov %edx,%ecx 1d1: fc cld 1d2: f3 aa rep stos %al,%es:(%edi) 1d4: 89 ca mov %ecx,%edx 1d6: 89 fb mov %edi,%ebx 1d8: 89 5d 08 mov %ebx,0x8(%ebp) 1db: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 1de: 90 nop 1df: 5b pop %ebx 1e0: 5f pop %edi 1e1: 5d pop %ebp 1e2: c3 ret 000001e3 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 1e3: 55 push %ebp 1e4: 89 e5 mov %esp,%ebp 1e6: 83 ec 10 sub $0x10,%esp char *os; os = s; 1e9: 8b 45 08 mov 0x8(%ebp),%eax 1ec: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 1ef: 90 nop 1f0: 8b 45 08 mov 0x8(%ebp),%eax 1f3: 8d 50 01 lea 0x1(%eax),%edx 1f6: 89 55 08 mov %edx,0x8(%ebp) 1f9: 8b 55 0c mov 0xc(%ebp),%edx 1fc: 8d 4a 01 lea 0x1(%edx),%ecx 1ff: 89 4d 0c mov %ecx,0xc(%ebp) 202: 0f b6 12 movzbl (%edx),%edx 205: 88 10 mov %dl,(%eax) 207: 0f b6 00 movzbl (%eax),%eax 20a: 84 c0 test %al,%al 20c: 75 e2 jne 1f0 <strcpy+0xd> ; return os; 20e: 8b 45 fc mov -0x4(%ebp),%eax } 211: c9 leave 212: c3 ret 00000213 <strcmp>: int strcmp(const char *p, const char *q) { 213: 55 push %ebp 214: 89 e5 mov %esp,%ebp while(*p && *p == *q) 216: eb 08 jmp 220 <strcmp+0xd> p++, q++; 218: 83 45 08 01 addl $0x1,0x8(%ebp) 21c: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 220: 8b 45 08 mov 0x8(%ebp),%eax 223: 0f b6 00 movzbl (%eax),%eax 226: 84 c0 test %al,%al 228: 74 10 je 23a <strcmp+0x27> 22a: 8b 45 08 mov 0x8(%ebp),%eax 22d: 0f b6 10 movzbl (%eax),%edx 230: 8b 45 0c mov 0xc(%ebp),%eax 233: 0f b6 00 movzbl (%eax),%eax 236: 38 c2 cmp %al,%dl 238: 74 de je 218 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 23a: 8b 45 08 mov 0x8(%ebp),%eax 23d: 0f b6 00 movzbl (%eax),%eax 240: 0f b6 d0 movzbl %al,%edx 243: 8b 45 0c mov 0xc(%ebp),%eax 246: 0f b6 00 movzbl (%eax),%eax 249: 0f b6 c0 movzbl %al,%eax 24c: 29 c2 sub %eax,%edx 24e: 89 d0 mov %edx,%eax } 250: 5d pop %ebp 251: c3 ret 00000252 <strlen>: uint strlen(char *s) { 252: 55 push %ebp 253: 89 e5 mov %esp,%ebp 255: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 258: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 25f: eb 04 jmp 265 <strlen+0x13> 261: 83 45 fc 01 addl $0x1,-0x4(%ebp) 265: 8b 55 fc mov -0x4(%ebp),%edx 268: 8b 45 08 mov 0x8(%ebp),%eax 26b: 01 d0 add %edx,%eax 26d: 0f b6 00 movzbl (%eax),%eax 270: 84 c0 test %al,%al 272: 75 ed jne 261 <strlen+0xf> ; return n; 274: 8b 45 fc mov -0x4(%ebp),%eax } 277: c9 leave 278: c3 ret 00000279 <memset>: void* memset(void *dst, int c, uint n) { 279: 55 push %ebp 27a: 89 e5 mov %esp,%ebp stosb(dst, c, n); 27c: 8b 45 10 mov 0x10(%ebp),%eax 27f: 50 push %eax 280: ff 75 0c pushl 0xc(%ebp) 283: ff 75 08 pushl 0x8(%ebp) 286: e8 32 ff ff ff call 1bd <stosb> 28b: 83 c4 0c add $0xc,%esp return dst; 28e: 8b 45 08 mov 0x8(%ebp),%eax } 291: c9 leave 292: c3 ret 00000293 <strchr>: char* strchr(const char *s, char c) { 293: 55 push %ebp 294: 89 e5 mov %esp,%ebp 296: 83 ec 04 sub $0x4,%esp 299: 8b 45 0c mov 0xc(%ebp),%eax 29c: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 29f: eb 14 jmp 2b5 <strchr+0x22> if(*s == c) 2a1: 8b 45 08 mov 0x8(%ebp),%eax 2a4: 0f b6 00 movzbl (%eax),%eax 2a7: 3a 45 fc cmp -0x4(%ebp),%al 2aa: 75 05 jne 2b1 <strchr+0x1e> return (char*)s; 2ac: 8b 45 08 mov 0x8(%ebp),%eax 2af: eb 13 jmp 2c4 <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 2b1: 83 45 08 01 addl $0x1,0x8(%ebp) 2b5: 8b 45 08 mov 0x8(%ebp),%eax 2b8: 0f b6 00 movzbl (%eax),%eax 2bb: 84 c0 test %al,%al 2bd: 75 e2 jne 2a1 <strchr+0xe> if(*s == c) return (char*)s; return 0; 2bf: b8 00 00 00 00 mov $0x0,%eax } 2c4: c9 leave 2c5: c3 ret 000002c6 <gets>: char* gets(char *buf, int max) { 2c6: 55 push %ebp 2c7: 89 e5 mov %esp,%ebp 2c9: 83 ec 18 sub $0x18,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 2cc: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 2d3: eb 42 jmp 317 <gets+0x51> cc = read(0, &c, 1); 2d5: 83 ec 04 sub $0x4,%esp 2d8: 6a 01 push $0x1 2da: 8d 45 ef lea -0x11(%ebp),%eax 2dd: 50 push %eax 2de: 6a 00 push $0x0 2e0: e8 47 01 00 00 call 42c <read> 2e5: 83 c4 10 add $0x10,%esp 2e8: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 2eb: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 2ef: 7e 33 jle 324 <gets+0x5e> break; buf[i++] = c; 2f1: 8b 45 f4 mov -0xc(%ebp),%eax 2f4: 8d 50 01 lea 0x1(%eax),%edx 2f7: 89 55 f4 mov %edx,-0xc(%ebp) 2fa: 89 c2 mov %eax,%edx 2fc: 8b 45 08 mov 0x8(%ebp),%eax 2ff: 01 c2 add %eax,%edx 301: 0f b6 45 ef movzbl -0x11(%ebp),%eax 305: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 307: 0f b6 45 ef movzbl -0x11(%ebp),%eax 30b: 3c 0a cmp $0xa,%al 30d: 74 16 je 325 <gets+0x5f> 30f: 0f b6 45 ef movzbl -0x11(%ebp),%eax 313: 3c 0d cmp $0xd,%al 315: 74 0e je 325 <gets+0x5f> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 317: 8b 45 f4 mov -0xc(%ebp),%eax 31a: 83 c0 01 add $0x1,%eax 31d: 3b 45 0c cmp 0xc(%ebp),%eax 320: 7c b3 jl 2d5 <gets+0xf> 322: eb 01 jmp 325 <gets+0x5f> cc = read(0, &c, 1); if(cc < 1) break; 324: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 325: 8b 55 f4 mov -0xc(%ebp),%edx 328: 8b 45 08 mov 0x8(%ebp),%eax 32b: 01 d0 add %edx,%eax 32d: c6 00 00 movb $0x0,(%eax) return buf; 330: 8b 45 08 mov 0x8(%ebp),%eax } 333: c9 leave 334: c3 ret 00000335 <stat>: int stat(char *n, struct stat *st) { 335: 55 push %ebp 336: 89 e5 mov %esp,%ebp 338: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 33b: 83 ec 08 sub $0x8,%esp 33e: 6a 00 push $0x0 340: ff 75 08 pushl 0x8(%ebp) 343: e8 0c 01 00 00 call 454 <open> 348: 83 c4 10 add $0x10,%esp 34b: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 34e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 352: 79 07 jns 35b <stat+0x26> return -1; 354: b8 ff ff ff ff mov $0xffffffff,%eax 359: eb 25 jmp 380 <stat+0x4b> r = fstat(fd, st); 35b: 83 ec 08 sub $0x8,%esp 35e: ff 75 0c pushl 0xc(%ebp) 361: ff 75 f4 pushl -0xc(%ebp) 364: e8 03 01 00 00 call 46c <fstat> 369: 83 c4 10 add $0x10,%esp 36c: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 36f: 83 ec 0c sub $0xc,%esp 372: ff 75 f4 pushl -0xc(%ebp) 375: e8 c2 00 00 00 call 43c <close> 37a: 83 c4 10 add $0x10,%esp return r; 37d: 8b 45 f0 mov -0x10(%ebp),%eax } 380: c9 leave 381: c3 ret 00000382 <atoi>: int atoi(const char *s) { 382: 55 push %ebp 383: 89 e5 mov %esp,%ebp 385: 83 ec 10 sub $0x10,%esp int n; n = 0; 388: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 38f: eb 25 jmp 3b6 <atoi+0x34> n = n*10 + *s++ - '0'; 391: 8b 55 fc mov -0x4(%ebp),%edx 394: 89 d0 mov %edx,%eax 396: c1 e0 02 shl $0x2,%eax 399: 01 d0 add %edx,%eax 39b: 01 c0 add %eax,%eax 39d: 89 c1 mov %eax,%ecx 39f: 8b 45 08 mov 0x8(%ebp),%eax 3a2: 8d 50 01 lea 0x1(%eax),%edx 3a5: 89 55 08 mov %edx,0x8(%ebp) 3a8: 0f b6 00 movzbl (%eax),%eax 3ab: 0f be c0 movsbl %al,%eax 3ae: 01 c8 add %ecx,%eax 3b0: 83 e8 30 sub $0x30,%eax 3b3: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 3b6: 8b 45 08 mov 0x8(%ebp),%eax 3b9: 0f b6 00 movzbl (%eax),%eax 3bc: 3c 2f cmp $0x2f,%al 3be: 7e 0a jle 3ca <atoi+0x48> 3c0: 8b 45 08 mov 0x8(%ebp),%eax 3c3: 0f b6 00 movzbl (%eax),%eax 3c6: 3c 39 cmp $0x39,%al 3c8: 7e c7 jle 391 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 3ca: 8b 45 fc mov -0x4(%ebp),%eax } 3cd: c9 leave 3ce: c3 ret 000003cf <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 3cf: 55 push %ebp 3d0: 89 e5 mov %esp,%ebp 3d2: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 3d5: 8b 45 08 mov 0x8(%ebp),%eax 3d8: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 3db: 8b 45 0c mov 0xc(%ebp),%eax 3de: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 3e1: eb 17 jmp 3fa <memmove+0x2b> *dst++ = *src++; 3e3: 8b 45 fc mov -0x4(%ebp),%eax 3e6: 8d 50 01 lea 0x1(%eax),%edx 3e9: 89 55 fc mov %edx,-0x4(%ebp) 3ec: 8b 55 f8 mov -0x8(%ebp),%edx 3ef: 8d 4a 01 lea 0x1(%edx),%ecx 3f2: 89 4d f8 mov %ecx,-0x8(%ebp) 3f5: 0f b6 12 movzbl (%edx),%edx 3f8: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 3fa: 8b 45 10 mov 0x10(%ebp),%eax 3fd: 8d 50 ff lea -0x1(%eax),%edx 400: 89 55 10 mov %edx,0x10(%ebp) 403: 85 c0 test %eax,%eax 405: 7f dc jg 3e3 <memmove+0x14> *dst++ = *src++; return vdst; 407: 8b 45 08 mov 0x8(%ebp),%eax } 40a: c9 leave 40b: c3 ret 0000040c <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 40c: b8 01 00 00 00 mov $0x1,%eax 411: cd 40 int $0x40 413: c3 ret 00000414 <exit>: SYSCALL(exit) 414: b8 02 00 00 00 mov $0x2,%eax 419: cd 40 int $0x40 41b: c3 ret 0000041c <wait>: SYSCALL(wait) 41c: b8 03 00 00 00 mov $0x3,%eax 421: cd 40 int $0x40 423: c3 ret 00000424 <pipe>: SYSCALL(pipe) 424: b8 04 00 00 00 mov $0x4,%eax 429: cd 40 int $0x40 42b: c3 ret 0000042c <read>: SYSCALL(read) 42c: b8 05 00 00 00 mov $0x5,%eax 431: cd 40 int $0x40 433: c3 ret 00000434 <write>: SYSCALL(write) 434: b8 10 00 00 00 mov $0x10,%eax 439: cd 40 int $0x40 43b: c3 ret 0000043c <close>: SYSCALL(close) 43c: b8 15 00 00 00 mov $0x15,%eax 441: cd 40 int $0x40 443: c3 ret 00000444 <kill>: SYSCALL(kill) 444: b8 06 00 00 00 mov $0x6,%eax 449: cd 40 int $0x40 44b: c3 ret 0000044c <exec>: SYSCALL(exec) 44c: b8 07 00 00 00 mov $0x7,%eax 451: cd 40 int $0x40 453: c3 ret 00000454 <open>: SYSCALL(open) 454: b8 0f 00 00 00 mov $0xf,%eax 459: cd 40 int $0x40 45b: c3 ret 0000045c <mknod>: SYSCALL(mknod) 45c: b8 11 00 00 00 mov $0x11,%eax 461: cd 40 int $0x40 463: c3 ret 00000464 <unlink>: SYSCALL(unlink) 464: b8 12 00 00 00 mov $0x12,%eax 469: cd 40 int $0x40 46b: c3 ret 0000046c <fstat>: SYSCALL(fstat) 46c: b8 08 00 00 00 mov $0x8,%eax 471: cd 40 int $0x40 473: c3 ret 00000474 <link>: SYSCALL(link) 474: b8 13 00 00 00 mov $0x13,%eax 479: cd 40 int $0x40 47b: c3 ret 0000047c <mkdir>: SYSCALL(mkdir) 47c: b8 14 00 00 00 mov $0x14,%eax 481: cd 40 int $0x40 483: c3 ret 00000484 <chdir>: SYSCALL(chdir) 484: b8 09 00 00 00 mov $0x9,%eax 489: cd 40 int $0x40 48b: c3 ret 0000048c <dup>: SYSCALL(dup) 48c: b8 0a 00 00 00 mov $0xa,%eax 491: cd 40 int $0x40 493: c3 ret 00000494 <getpid>: SYSCALL(getpid) 494: b8 0b 00 00 00 mov $0xb,%eax 499: cd 40 int $0x40 49b: c3 ret 0000049c <sbrk>: SYSCALL(sbrk) 49c: b8 0c 00 00 00 mov $0xc,%eax 4a1: cd 40 int $0x40 4a3: c3 ret 000004a4 <sleep>: SYSCALL(sleep) 4a4: b8 0d 00 00 00 mov $0xd,%eax 4a9: cd 40 int $0x40 4ab: c3 ret 000004ac <uptime>: SYSCALL(uptime) 4ac: b8 0e 00 00 00 mov $0xe,%eax 4b1: cd 40 int $0x40 4b3: c3 ret 000004b4 <sigprocmask>: SYSCALL(sigprocmask) 4b4: b8 16 00 00 00 mov $0x16,%eax 4b9: cd 40 int $0x40 4bb: c3 ret 000004bc <signal>: SYSCALL(signal) 4bc: b8 17 00 00 00 mov $0x17,%eax 4c1: cd 40 int $0x40 4c3: c3 ret 000004c4 <sigret>: SYSCALL(sigret) 4c4: b8 18 00 00 00 mov $0x18,%eax 4c9: cd 40 int $0x40 4cb: c3 ret 000004cc <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 4cc: 55 push %ebp 4cd: 89 e5 mov %esp,%ebp 4cf: 83 ec 18 sub $0x18,%esp 4d2: 8b 45 0c mov 0xc(%ebp),%eax 4d5: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 4d8: 83 ec 04 sub $0x4,%esp 4db: 6a 01 push $0x1 4dd: 8d 45 f4 lea -0xc(%ebp),%eax 4e0: 50 push %eax 4e1: ff 75 08 pushl 0x8(%ebp) 4e4: e8 4b ff ff ff call 434 <write> 4e9: 83 c4 10 add $0x10,%esp } 4ec: 90 nop 4ed: c9 leave 4ee: c3 ret 000004ef <printint>: static void printint(int fd, int xx, int base, int sgn) { 4ef: 55 push %ebp 4f0: 89 e5 mov %esp,%ebp 4f2: 53 push %ebx 4f3: 83 ec 24 sub $0x24,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 4f6: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 4fd: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 501: 74 17 je 51a <printint+0x2b> 503: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 507: 79 11 jns 51a <printint+0x2b> neg = 1; 509: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 510: 8b 45 0c mov 0xc(%ebp),%eax 513: f7 d8 neg %eax 515: 89 45 ec mov %eax,-0x14(%ebp) 518: eb 06 jmp 520 <printint+0x31> } else { x = xx; 51a: 8b 45 0c mov 0xc(%ebp),%eax 51d: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 520: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 527: 8b 4d f4 mov -0xc(%ebp),%ecx 52a: 8d 41 01 lea 0x1(%ecx),%eax 52d: 89 45 f4 mov %eax,-0xc(%ebp) 530: 8b 5d 10 mov 0x10(%ebp),%ebx 533: 8b 45 ec mov -0x14(%ebp),%eax 536: ba 00 00 00 00 mov $0x0,%edx 53b: f7 f3 div %ebx 53d: 89 d0 mov %edx,%eax 53f: 0f b6 80 04 0c 00 00 movzbl 0xc04(%eax),%eax 546: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); 54a: 8b 5d 10 mov 0x10(%ebp),%ebx 54d: 8b 45 ec mov -0x14(%ebp),%eax 550: ba 00 00 00 00 mov $0x0,%edx 555: f7 f3 div %ebx 557: 89 45 ec mov %eax,-0x14(%ebp) 55a: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 55e: 75 c7 jne 527 <printint+0x38> if(neg) 560: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 564: 74 2d je 593 <printint+0xa4> buf[i++] = '-'; 566: 8b 45 f4 mov -0xc(%ebp),%eax 569: 8d 50 01 lea 0x1(%eax),%edx 56c: 89 55 f4 mov %edx,-0xc(%ebp) 56f: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 574: eb 1d jmp 593 <printint+0xa4> putc(fd, buf[i]); 576: 8d 55 dc lea -0x24(%ebp),%edx 579: 8b 45 f4 mov -0xc(%ebp),%eax 57c: 01 d0 add %edx,%eax 57e: 0f b6 00 movzbl (%eax),%eax 581: 0f be c0 movsbl %al,%eax 584: 83 ec 08 sub $0x8,%esp 587: 50 push %eax 588: ff 75 08 pushl 0x8(%ebp) 58b: e8 3c ff ff ff call 4cc <putc> 590: 83 c4 10 add $0x10,%esp buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 593: 83 6d f4 01 subl $0x1,-0xc(%ebp) 597: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 59b: 79 d9 jns 576 <printint+0x87> putc(fd, buf[i]); } 59d: 90 nop 59e: 8b 5d fc mov -0x4(%ebp),%ebx 5a1: c9 leave 5a2: c3 ret 000005a3 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 5a3: 55 push %ebp 5a4: 89 e5 mov %esp,%ebp 5a6: 83 ec 28 sub $0x28,%esp char *s; int c, i, state; uint *ap; state = 0; 5a9: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 5b0: 8d 45 0c lea 0xc(%ebp),%eax 5b3: 83 c0 04 add $0x4,%eax 5b6: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 5b9: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 5c0: e9 59 01 00 00 jmp 71e <printf+0x17b> c = fmt[i] & 0xff; 5c5: 8b 55 0c mov 0xc(%ebp),%edx 5c8: 8b 45 f0 mov -0x10(%ebp),%eax 5cb: 01 d0 add %edx,%eax 5cd: 0f b6 00 movzbl (%eax),%eax 5d0: 0f be c0 movsbl %al,%eax 5d3: 25 ff 00 00 00 and $0xff,%eax 5d8: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 5db: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 5df: 75 2c jne 60d <printf+0x6a> if(c == '%'){ 5e1: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 5e5: 75 0c jne 5f3 <printf+0x50> state = '%'; 5e7: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 5ee: e9 27 01 00 00 jmp 71a <printf+0x177> } else { putc(fd, c); 5f3: 8b 45 e4 mov -0x1c(%ebp),%eax 5f6: 0f be c0 movsbl %al,%eax 5f9: 83 ec 08 sub $0x8,%esp 5fc: 50 push %eax 5fd: ff 75 08 pushl 0x8(%ebp) 600: e8 c7 fe ff ff call 4cc <putc> 605: 83 c4 10 add $0x10,%esp 608: e9 0d 01 00 00 jmp 71a <printf+0x177> } } else if(state == '%'){ 60d: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 611: 0f 85 03 01 00 00 jne 71a <printf+0x177> if(c == 'd'){ 617: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 61b: 75 1e jne 63b <printf+0x98> printint(fd, *ap, 10, 1); 61d: 8b 45 e8 mov -0x18(%ebp),%eax 620: 8b 00 mov (%eax),%eax 622: 6a 01 push $0x1 624: 6a 0a push $0xa 626: 50 push %eax 627: ff 75 08 pushl 0x8(%ebp) 62a: e8 c0 fe ff ff call 4ef <printint> 62f: 83 c4 10 add $0x10,%esp ap++; 632: 83 45 e8 04 addl $0x4,-0x18(%ebp) 636: e9 d8 00 00 00 jmp 713 <printf+0x170> } else if(c == 'x' || c == 'p'){ 63b: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 63f: 74 06 je 647 <printf+0xa4> 641: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 645: 75 1e jne 665 <printf+0xc2> printint(fd, *ap, 16, 0); 647: 8b 45 e8 mov -0x18(%ebp),%eax 64a: 8b 00 mov (%eax),%eax 64c: 6a 00 push $0x0 64e: 6a 10 push $0x10 650: 50 push %eax 651: ff 75 08 pushl 0x8(%ebp) 654: e8 96 fe ff ff call 4ef <printint> 659: 83 c4 10 add $0x10,%esp ap++; 65c: 83 45 e8 04 addl $0x4,-0x18(%ebp) 660: e9 ae 00 00 00 jmp 713 <printf+0x170> } else if(c == 's'){ 665: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 669: 75 43 jne 6ae <printf+0x10b> s = (char*)*ap; 66b: 8b 45 e8 mov -0x18(%ebp),%eax 66e: 8b 00 mov (%eax),%eax 670: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 673: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 677: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 67b: 75 25 jne 6a2 <printf+0xff> s = "(null)"; 67d: c7 45 f4 91 09 00 00 movl $0x991,-0xc(%ebp) while(*s != 0){ 684: eb 1c jmp 6a2 <printf+0xff> putc(fd, *s); 686: 8b 45 f4 mov -0xc(%ebp),%eax 689: 0f b6 00 movzbl (%eax),%eax 68c: 0f be c0 movsbl %al,%eax 68f: 83 ec 08 sub $0x8,%esp 692: 50 push %eax 693: ff 75 08 pushl 0x8(%ebp) 696: e8 31 fe ff ff call 4cc <putc> 69b: 83 c4 10 add $0x10,%esp s++; 69e: 83 45 f4 01 addl $0x1,-0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 6a2: 8b 45 f4 mov -0xc(%ebp),%eax 6a5: 0f b6 00 movzbl (%eax),%eax 6a8: 84 c0 test %al,%al 6aa: 75 da jne 686 <printf+0xe3> 6ac: eb 65 jmp 713 <printf+0x170> putc(fd, *s); s++; } } else if(c == 'c'){ 6ae: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 6b2: 75 1d jne 6d1 <printf+0x12e> putc(fd, *ap); 6b4: 8b 45 e8 mov -0x18(%ebp),%eax 6b7: 8b 00 mov (%eax),%eax 6b9: 0f be c0 movsbl %al,%eax 6bc: 83 ec 08 sub $0x8,%esp 6bf: 50 push %eax 6c0: ff 75 08 pushl 0x8(%ebp) 6c3: e8 04 fe ff ff call 4cc <putc> 6c8: 83 c4 10 add $0x10,%esp ap++; 6cb: 83 45 e8 04 addl $0x4,-0x18(%ebp) 6cf: eb 42 jmp 713 <printf+0x170> } else if(c == '%'){ 6d1: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 6d5: 75 17 jne 6ee <printf+0x14b> putc(fd, c); 6d7: 8b 45 e4 mov -0x1c(%ebp),%eax 6da: 0f be c0 movsbl %al,%eax 6dd: 83 ec 08 sub $0x8,%esp 6e0: 50 push %eax 6e1: ff 75 08 pushl 0x8(%ebp) 6e4: e8 e3 fd ff ff call 4cc <putc> 6e9: 83 c4 10 add $0x10,%esp 6ec: eb 25 jmp 713 <printf+0x170> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 6ee: 83 ec 08 sub $0x8,%esp 6f1: 6a 25 push $0x25 6f3: ff 75 08 pushl 0x8(%ebp) 6f6: e8 d1 fd ff ff call 4cc <putc> 6fb: 83 c4 10 add $0x10,%esp putc(fd, c); 6fe: 8b 45 e4 mov -0x1c(%ebp),%eax 701: 0f be c0 movsbl %al,%eax 704: 83 ec 08 sub $0x8,%esp 707: 50 push %eax 708: ff 75 08 pushl 0x8(%ebp) 70b: e8 bc fd ff ff call 4cc <putc> 710: 83 c4 10 add $0x10,%esp } state = 0; 713: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 71a: 83 45 f0 01 addl $0x1,-0x10(%ebp) 71e: 8b 55 0c mov 0xc(%ebp),%edx 721: 8b 45 f0 mov -0x10(%ebp),%eax 724: 01 d0 add %edx,%eax 726: 0f b6 00 movzbl (%eax),%eax 729: 84 c0 test %al,%al 72b: 0f 85 94 fe ff ff jne 5c5 <printf+0x22> putc(fd, c); } state = 0; } } } 731: 90 nop 732: c9 leave 733: c3 ret 00000734 <free>: static Header base; static Header *freep; void free(void *ap) { 734: 55 push %ebp 735: 89 e5 mov %esp,%ebp 737: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 73a: 8b 45 08 mov 0x8(%ebp),%eax 73d: 83 e8 08 sub $0x8,%eax 740: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 743: a1 28 0c 00 00 mov 0xc28,%eax 748: 89 45 fc mov %eax,-0x4(%ebp) 74b: eb 24 jmp 771 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 74d: 8b 45 fc mov -0x4(%ebp),%eax 750: 8b 00 mov (%eax),%eax 752: 3b 45 fc cmp -0x4(%ebp),%eax 755: 77 12 ja 769 <free+0x35> 757: 8b 45 f8 mov -0x8(%ebp),%eax 75a: 3b 45 fc cmp -0x4(%ebp),%eax 75d: 77 24 ja 783 <free+0x4f> 75f: 8b 45 fc mov -0x4(%ebp),%eax 762: 8b 00 mov (%eax),%eax 764: 3b 45 f8 cmp -0x8(%ebp),%eax 767: 77 1a ja 783 <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 769: 8b 45 fc mov -0x4(%ebp),%eax 76c: 8b 00 mov (%eax),%eax 76e: 89 45 fc mov %eax,-0x4(%ebp) 771: 8b 45 f8 mov -0x8(%ebp),%eax 774: 3b 45 fc cmp -0x4(%ebp),%eax 777: 76 d4 jbe 74d <free+0x19> 779: 8b 45 fc mov -0x4(%ebp),%eax 77c: 8b 00 mov (%eax),%eax 77e: 3b 45 f8 cmp -0x8(%ebp),%eax 781: 76 ca jbe 74d <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 783: 8b 45 f8 mov -0x8(%ebp),%eax 786: 8b 40 04 mov 0x4(%eax),%eax 789: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 790: 8b 45 f8 mov -0x8(%ebp),%eax 793: 01 c2 add %eax,%edx 795: 8b 45 fc mov -0x4(%ebp),%eax 798: 8b 00 mov (%eax),%eax 79a: 39 c2 cmp %eax,%edx 79c: 75 24 jne 7c2 <free+0x8e> bp->s.size += p->s.ptr->s.size; 79e: 8b 45 f8 mov -0x8(%ebp),%eax 7a1: 8b 50 04 mov 0x4(%eax),%edx 7a4: 8b 45 fc mov -0x4(%ebp),%eax 7a7: 8b 00 mov (%eax),%eax 7a9: 8b 40 04 mov 0x4(%eax),%eax 7ac: 01 c2 add %eax,%edx 7ae: 8b 45 f8 mov -0x8(%ebp),%eax 7b1: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 7b4: 8b 45 fc mov -0x4(%ebp),%eax 7b7: 8b 00 mov (%eax),%eax 7b9: 8b 10 mov (%eax),%edx 7bb: 8b 45 f8 mov -0x8(%ebp),%eax 7be: 89 10 mov %edx,(%eax) 7c0: eb 0a jmp 7cc <free+0x98> } else bp->s.ptr = p->s.ptr; 7c2: 8b 45 fc mov -0x4(%ebp),%eax 7c5: 8b 10 mov (%eax),%edx 7c7: 8b 45 f8 mov -0x8(%ebp),%eax 7ca: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 7cc: 8b 45 fc mov -0x4(%ebp),%eax 7cf: 8b 40 04 mov 0x4(%eax),%eax 7d2: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 7d9: 8b 45 fc mov -0x4(%ebp),%eax 7dc: 01 d0 add %edx,%eax 7de: 3b 45 f8 cmp -0x8(%ebp),%eax 7e1: 75 20 jne 803 <free+0xcf> p->s.size += bp->s.size; 7e3: 8b 45 fc mov -0x4(%ebp),%eax 7e6: 8b 50 04 mov 0x4(%eax),%edx 7e9: 8b 45 f8 mov -0x8(%ebp),%eax 7ec: 8b 40 04 mov 0x4(%eax),%eax 7ef: 01 c2 add %eax,%edx 7f1: 8b 45 fc mov -0x4(%ebp),%eax 7f4: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 7f7: 8b 45 f8 mov -0x8(%ebp),%eax 7fa: 8b 10 mov (%eax),%edx 7fc: 8b 45 fc mov -0x4(%ebp),%eax 7ff: 89 10 mov %edx,(%eax) 801: eb 08 jmp 80b <free+0xd7> } else p->s.ptr = bp; 803: 8b 45 fc mov -0x4(%ebp),%eax 806: 8b 55 f8 mov -0x8(%ebp),%edx 809: 89 10 mov %edx,(%eax) freep = p; 80b: 8b 45 fc mov -0x4(%ebp),%eax 80e: a3 28 0c 00 00 mov %eax,0xc28 } 813: 90 nop 814: c9 leave 815: c3 ret 00000816 <morecore>: static Header* morecore(uint nu) { 816: 55 push %ebp 817: 89 e5 mov %esp,%ebp 819: 83 ec 18 sub $0x18,%esp char *p; Header *hp; if(nu < 4096) 81c: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 823: 77 07 ja 82c <morecore+0x16> nu = 4096; 825: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 82c: 8b 45 08 mov 0x8(%ebp),%eax 82f: c1 e0 03 shl $0x3,%eax 832: 83 ec 0c sub $0xc,%esp 835: 50 push %eax 836: e8 61 fc ff ff call 49c <sbrk> 83b: 83 c4 10 add $0x10,%esp 83e: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 841: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 845: 75 07 jne 84e <morecore+0x38> return 0; 847: b8 00 00 00 00 mov $0x0,%eax 84c: eb 26 jmp 874 <morecore+0x5e> hp = (Header*)p; 84e: 8b 45 f4 mov -0xc(%ebp),%eax 851: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 854: 8b 45 f0 mov -0x10(%ebp),%eax 857: 8b 55 08 mov 0x8(%ebp),%edx 85a: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 85d: 8b 45 f0 mov -0x10(%ebp),%eax 860: 83 c0 08 add $0x8,%eax 863: 83 ec 0c sub $0xc,%esp 866: 50 push %eax 867: e8 c8 fe ff ff call 734 <free> 86c: 83 c4 10 add $0x10,%esp return freep; 86f: a1 28 0c 00 00 mov 0xc28,%eax } 874: c9 leave 875: c3 ret 00000876 <malloc>: void* malloc(uint nbytes) { 876: 55 push %ebp 877: 89 e5 mov %esp,%ebp 879: 83 ec 18 sub $0x18,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 87c: 8b 45 08 mov 0x8(%ebp),%eax 87f: 83 c0 07 add $0x7,%eax 882: c1 e8 03 shr $0x3,%eax 885: 83 c0 01 add $0x1,%eax 888: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 88b: a1 28 0c 00 00 mov 0xc28,%eax 890: 89 45 f0 mov %eax,-0x10(%ebp) 893: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 897: 75 23 jne 8bc <malloc+0x46> base.s.ptr = freep = prevp = &base; 899: c7 45 f0 20 0c 00 00 movl $0xc20,-0x10(%ebp) 8a0: 8b 45 f0 mov -0x10(%ebp),%eax 8a3: a3 28 0c 00 00 mov %eax,0xc28 8a8: a1 28 0c 00 00 mov 0xc28,%eax 8ad: a3 20 0c 00 00 mov %eax,0xc20 base.s.size = 0; 8b2: c7 05 24 0c 00 00 00 movl $0x0,0xc24 8b9: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 8bc: 8b 45 f0 mov -0x10(%ebp),%eax 8bf: 8b 00 mov (%eax),%eax 8c1: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 8c4: 8b 45 f4 mov -0xc(%ebp),%eax 8c7: 8b 40 04 mov 0x4(%eax),%eax 8ca: 3b 45 ec cmp -0x14(%ebp),%eax 8cd: 72 4d jb 91c <malloc+0xa6> if(p->s.size == nunits) 8cf: 8b 45 f4 mov -0xc(%ebp),%eax 8d2: 8b 40 04 mov 0x4(%eax),%eax 8d5: 3b 45 ec cmp -0x14(%ebp),%eax 8d8: 75 0c jne 8e6 <malloc+0x70> prevp->s.ptr = p->s.ptr; 8da: 8b 45 f4 mov -0xc(%ebp),%eax 8dd: 8b 10 mov (%eax),%edx 8df: 8b 45 f0 mov -0x10(%ebp),%eax 8e2: 89 10 mov %edx,(%eax) 8e4: eb 26 jmp 90c <malloc+0x96> else { p->s.size -= nunits; 8e6: 8b 45 f4 mov -0xc(%ebp),%eax 8e9: 8b 40 04 mov 0x4(%eax),%eax 8ec: 2b 45 ec sub -0x14(%ebp),%eax 8ef: 89 c2 mov %eax,%edx 8f1: 8b 45 f4 mov -0xc(%ebp),%eax 8f4: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 8f7: 8b 45 f4 mov -0xc(%ebp),%eax 8fa: 8b 40 04 mov 0x4(%eax),%eax 8fd: c1 e0 03 shl $0x3,%eax 900: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 903: 8b 45 f4 mov -0xc(%ebp),%eax 906: 8b 55 ec mov -0x14(%ebp),%edx 909: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 90c: 8b 45 f0 mov -0x10(%ebp),%eax 90f: a3 28 0c 00 00 mov %eax,0xc28 return (void*)(p + 1); 914: 8b 45 f4 mov -0xc(%ebp),%eax 917: 83 c0 08 add $0x8,%eax 91a: eb 3b jmp 957 <malloc+0xe1> } if(p == freep) 91c: a1 28 0c 00 00 mov 0xc28,%eax 921: 39 45 f4 cmp %eax,-0xc(%ebp) 924: 75 1e jne 944 <malloc+0xce> if((p = morecore(nunits)) == 0) 926: 83 ec 0c sub $0xc,%esp 929: ff 75 ec pushl -0x14(%ebp) 92c: e8 e5 fe ff ff call 816 <morecore> 931: 83 c4 10 add $0x10,%esp 934: 89 45 f4 mov %eax,-0xc(%ebp) 937: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 93b: 75 07 jne 944 <malloc+0xce> return 0; 93d: b8 00 00 00 00 mov $0x0,%eax 942: eb 13 jmp 957 <malloc+0xe1> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 944: 8b 45 f4 mov -0xc(%ebp),%eax 947: 89 45 f0 mov %eax,-0x10(%ebp) 94a: 8b 45 f4 mov -0xc(%ebp),%eax 94d: 8b 00 mov (%eax),%eax 94f: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 952: e9 6d ff ff ff jmp 8c4 <malloc+0x4e> } 957: c9 leave 958: c3 ret
34.241959
60
0.422155
a222b7497e31ffaefcfc92479ae9c41386bb6667
334
asm
Assembly
MIPS_CPU/P8/test/uart/test_for_uart.asm
CPUmaker/ComputerOrganizationDesign
30c078a4f284845c68899be417028d704293a52b
[ "MIT" ]
1
2021-01-13T09:21:45.000Z
2021-01-13T09:21:45.000Z
MIPS_CPU/P8/test/uart/test_for_uart.asm
CPUmaker/ComputerOrganizationDesign
30c078a4f284845c68899be417028d704293a52b
[ "MIT" ]
null
null
null
MIPS_CPU/P8/test/uart/test_for_uart.asm
CPUmaker/ComputerOrganizationDesign
30c078a4f284845c68899be417028d704293a52b
[ "MIT" ]
null
null
null
.text ori $s0, $0, 0xfc01 mtc0 $s0, $12 ori $s0, $0, 0x7f34 lui $s1, 0x5555 ori $s1, $s1, 0x5555 sw $s1, 0($s0) ori $s0, $0, 0x7f38 lui $s1, 0x7654 ori $s1, $s1, 0x3210 sw $s1, 0($s0) go: j go nop .ktext 0x00004180 mfc0 $k0, $13 andi $k0, $k0, 0x0800 beq $k0, $0, return ori $t0, $0, 0x7f10 lw $k1, 0($t0) sw $k1, 0($t0) return: eret
13.916667
21
0.607784
684600783e3d86f3a23de573689249afad764103
4,247
asm
Assembly
source/tokeniser/detokenise/dtprint.asm
paulscottrobson/6502-basic
d4c360041bfa49427a506465e58bb0ef94beaa44
[ "MIT" ]
3
2021-09-30T19:34:11.000Z
2021-10-31T06:55:50.000Z
source/tokeniser/detokenise/dtprint.asm
paulscottrobson/6502-Basic
d4c360041bfa49427a506465e58bb0ef94beaa44
[ "MIT" ]
null
null
null
source/tokeniser/detokenise/dtprint.asm
paulscottrobson/6502-Basic
d4c360041bfa49427a506465e58bb0ef94beaa44
[ "MIT" ]
1
2021-12-07T21:58:44.000Z
2021-12-07T21:58:44.000Z
; ************************************************************************************************ ; ************************************************************************************************ ; ; Name: dtprint.asm ; Purpose: Printing functions for detokenising. ; Created: 7th March 2021 ; Reviewed: 16th March 2021 ; Author: Paul Robson (paul@robsons.org.uk) ; ; ************************************************************************************************ ; ************************************************************************************************ .section storage tPrintCount: .fill 1 .send storage .section code ; ************************************************************************************************ ; ; Print integer at TOS,X in base A ; ; ************************************************************************************************ DTPrintInteger: pha ; save base set16 temp0,convertBuffer ; set convert buffer addr .puly ; base in Y and convert stack level in A. txa .main_inttostr tax ; then drop through here. ; ************************************************************************************************ ; ; Print length prefix string at temp0, with bit 7 stripped ; ; ************************************************************************************************ DTPrintLengthPrefix: tax ; A = 0 = don't case convert. .pshy ; save Y ldy #0 ; get string length = chars to print. lda (temp0),y sta tPrintCount beq _DTPLPExit ; empty string _DTPLPLoop: iny ; get next. lda (temp0),y and #$7F cpx #0 ; skip if not case converting beq _DTPLPNoCase cmp #"A" ; if converting UC -> LC bcc _DTPLPNoCase cmp #"Z"+1 bcs _DTPLPNoCase eor #"A"^"a" _DTPLPNoCase jsr ListOutputCharacter ; call handler dec tPrintCount ; do all the characters bne _DTPLPLoop _DTPLPExit: .puly rts ; ************************************************************************************************ ; ; Print for listing. Expects CR, ASCII and 1..9 for colour elements ; ; ************************************************************************************************ ListOutputCharacter: sta tempShort pha .pshx .pshy lda tempShort ; convert ASCII 6 bit (0-31) to 7 bit. cmp #32 bcs _LOCHiBit ora #64 ; conversion cmp #64 ; make l/c beq _LOCHiBit cmp #65+26 bcs _LOCHiBit adc #32 _LOCHiBit: jsr _LOCCallVector ; call o/p handler routine .puly .pulx pla _LOCExit: rts _LOCCallVector: ; allow detokenising to other places. jmp (deTokeniseVector) ; ************************************************************************************************ ; ; Printer for list to output device ; ; ************************************************************************************************ deTokenPrint: cmp #0 ; if bit 7 sets ink colour bmi _dtpInk .device_printascii rts _dtpInk:cmp #255 ; e.g. herhe, get ink and set it beq _dtpCR ; except $FF => CRLF and #7 .device_ink rts _dtpCR: .device_crlf rts ; ************************************************************************************************ ; ; Switch mode, punctuation or identifier constant, may need space ; ; ************************************************************************************************ DTSwitchMode: cmp LastCharacterClass ; if changed, update character class beq _DTSMNoChange sta LastCharacterClass _DTSMExit: rts _DTSMNoChange: cmp #1 ; if didn't change to punctuation, two identifiers so we beq _DTSMExit ; need a space. lda #" " jmp ListOutputCharacter .send code ; ************************************************************************************************ ; ; Changes and Updates ; ; ************************************************************************************************ ; ; Date Notes ; ==== ===== ; 07-Mar-21 Pre code read v0.01 ; ; ************************************************************************************************
29.089041
98
0.379091
479bbd6103b306d0e6e96c25c5d320d57ab233b7
491
asm
Assembly
programs/oeis/311/A311535.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/311/A311535.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/311/A311535.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A311535: Coordination sequence Gal.5.53.1 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,4,8,12,17,22,27,32,36,40,44,48,52,56,61,66,71,76,80,84,88,92,96,100,105,110,115,120,124,128,132,136,140,144,149,154,159,164,168,172,176,180,184,188,193,198,203,208,212,216 mov $1,$0 mov $2,$0 trn $0,3 trn $1,1 lpb $0 add $1,$0 trn $0,4 sub $1,$0 trn $0,6 lpe lpb $2 add $1,3 sub $2,1 lpe add $1,1
25.842105
176
0.676171
21d28c15525cd432c97759dab305ff17bf5f7fb3
3,032
asm
Assembly
editor/editor.asm
dbatbold/bootstrap
0a756c41a2ab2ac209637bda5f2e41111b2d051a
[ "MIT" ]
null
null
null
editor/editor.asm
dbatbold/bootstrap
0a756c41a2ab2ac209637bda5f2e41111b2d051a
[ "MIT" ]
null
null
null
editor/editor.asm
dbatbold/bootstrap
0a756c41a2ab2ac209637bda5f2e41111b2d051a
[ "MIT" ]
null
null
null
; 'editor.asm' is a text editor that can be loaded by 'mbr' as below: ; ; >d0080 - change device (boot device) ; >r0002000f - read 15 blocks starting from the second sector ; >x - execute 'editor.bin' ; ; Memory map: ; 0x07c00 ; 512B mbr.bin ; 0x07dff ; 0x07e00 ; 28KB MBR reserved memory ; 0x0ffff ; 0x10000 ; 480KB Free memory ; 0x7ffff use16 org 0x9000 call clear_screen ;mov ax,0102h ;call enable_cursor mov ax,0000h call move_cursor start: call print_page .read_key: call read_keypress ; key code -> AL cmp al,1bh ; is ESC je start cmp al,0dh ; is ENTER jne .edit mov al,0ah ; convert 0xd to 0xa call print_char mov al,0dh .edit: cmp [cursor_pos],0ffffh ; check if memory is full jne .store call print_new_line mov ax,out_of_memory call print_string jmp .read_key .store: ; store pressed key code (AL) to memory mov si,[cursor_pos] push [buffer_seg] pop es mov byte [es:si],al call print_page ;call print_char inc [cursor_pos] ; increment cursor inc [buffer_size] ; increment file size jmp .read_key ; call read_commnad ; call print_new_line ; jmp start print_page: push cx si mov ax,0000h call move_cursor mov cx,[page_size] ; page counter xor si,si push [buffer_seg] pop es .next: cmp si,[buffer_size] je .done mov al,byte [es:si] cmp al,0ah ; new line? jne .print call print_new_line loop .next jmp .next_char .print: call print_char .next_char: inc si jmp .next .done: pop si cx ret print_new_line: push ax mov al,0ah ; new line call print_char mov al,0dh call print_char pop ax ret read_keypress: ; read key press to AL mov ah,0 int 16h ret print_char: ; prints AL to TTY push ax bx mov ah,0eh mov bh,0 ; page 0 mov bl,0f1h ; white on light gray int 10h pop bx ax ret print_string: push bx si mov bh,0 ; page 0 mov bl,0f1h ; light gray on black mov si,ax .next: mov al,[si] cmp al,0 je .done mov ah,0eh int 10h inc si jmp .next .done: pop si bx ret clear_screen: mov al,03 ; 80x25 16-bit color mov ah,00 int 10h ret enable_cursor: ; AL - start scanline ; AH - end scanline push cx mov ch,ah mov cl,al mov ah,01h int 10h pop cx ret move_cursor: ; AH - row ; AL - column push dx mov dh,ah mov dl,al mov ah,02h int 10h pop dx ret print_byte_hex: ; prints AL value to TTY in hex format push ax call hex_to_string xchg ah,al ; print AH call print_char xchg ah,al ; print AL call print_char pop ax ret hex_to_string: ; converts AL value to hex ascii characters into AX mov ah,al ; copy AL shr ah,4 ; high 4-bit of hex cmp ah,9 jg .high_hex add ah,'0' jmp .high_done .high_hex: add ah,'a'-10 .high_done: and al,0fh ; low 4-bit of hex cmp al,9 jg .low_hex add al,'0' ret .low_hex: add al,'a'-10 ret cursor_pos dw 0 ; cursor position buffer_size dw 0 ; file buffer size buffer_seg dw 1000h ; file buffer segment page_size dw 10 ; number of lines on a page out_of_memory db 'memory is full',0
15.874346
69
0.682718
e24fbdf84e9db4405f388c8aba9487ece06e9324
345
asm
Assembly
oeis/119/A119580.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/119/A119580.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/119/A119580.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A119580: (n^2+n^3)*(binomial(2*n,n)). ; Submitted by Jamie Morken(s2) ; 0,4,72,720,5600,37800,232848,1345344,7413120,39382200,203231600,1024287264,5062180032,24607819600,117942804000,558423072000,2615901857280,12139419556440,55866532906800,255192804636000 mov $1,$0 add $0,1 mul $1,2 bin $1,$0 mul $1,$0 bin $0,2 mul $1,$0 mov $0,$1 mul $0,2
24.642857
185
0.73913
09591c6d89eb65a2d2a3035c145e9ab28985563d
464
asm
Assembly
data/pokemon/base_stats/magikarp.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
2
2021-07-31T07:05:06.000Z
2021-10-16T03:32:26.000Z
data/pokemon/base_stats/magikarp.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
null
null
null
data/pokemon/base_stats/magikarp.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
3
2021-01-15T18:45:40.000Z
2021-10-16T03:35:27.000Z
db 0 ; species ID placeholder db 20, 10, 55, 80, 15, 20 ; hp atk def spd sat sdf db WATER, WATER ; type db 255 ; catch rate db 20 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 100 ; unknown 1 db 5 ; step cycles to hatch db 5 ; unknown 2 INCBIN "gfx/pokemon/magikarp/front.dimensions" db 0, 0, 0, 0 ; padding db GROWTH_SLOW ; growth rate dn EGG_WATER_2, EGG_DRAGON ; egg groups ; tm/hm learnset tmhm ; end
21.090909
47
0.665948
358c5ebc61c328f725535ea960657ef541a92551
3,979
asm
Assembly
Engine Hacks/Skill System/Stances/Stances.asm
sme23/MekkahRestrictedHackComp1
1cc9d2fec557424f358b6bfa21f9f3bb6faf2978
[ "CC0-1.0" ]
null
null
null
Engine Hacks/Skill System/Stances/Stances.asm
sme23/MekkahRestrictedHackComp1
1cc9d2fec557424f358b6bfa21f9f3bb6faf2978
[ "CC0-1.0" ]
null
null
null
Engine Hacks/Skill System/Stances/Stances.asm
sme23/MekkahRestrictedHackComp1
1cc9d2fec557424f358b6bfa21f9f3bb6faf2978
[ "CC0-1.0" ]
null
null
null
.thumb .global StancesASM .type StancesASM, %function .macro blh to, reg ldr \reg, =\to mov lr, \reg .short 0xF800 .endm End2: pop { r4 - r7 } pop { r3 } bx r3 StancesASM: push { r4 - r7, lr } mov r4, r0 mov r5, r1 ldr r0, =#0x0203A56C cmp r0, r4 bne End2 @ Cool it's defending. I need to check if the enemy's weapon is magic. ldr r0, [ r5, #0x4C ] mov r1, #0x02 tst r0, r1 beq NotMagic @ So it is a magic thing. mov r7, #0x01 NotMagic: mov r6, #0x00 @ CheckBracingStance: bl CheckNextStance cmp r0, #0x00 beq CheckDartingStance mov r1, #0x5C ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 def/res. strh r0, [ r4, r1 ] CheckDartingStance: bl CheckNextStance cmp r0, #0x00 beq CheckFierceStance mov r1, #0x5E ldrh r0, [ r4, r1 ] add r0, #0x06 @ Add 6 attack speed. strh r0, [ r4, r1 ] mov r1, #0x62 ldrh r0, [ r4, r1 ] add r0, #0x0C @ Add 12 avoid. strh r0, [ r4, r1 ] CheckFierceStance: bl CheckNextStance cmp r0, #0x00 beq CheckKestrelStance mov r1, #0x5A ldrh r0, [ r4, r1 ] add r0, #0x06 @ Add 6 attack. strh r0, [ r4, r1 ] CheckKestrelStance: bl CheckNextStance cmp r0, #0x00 beq CheckMirrorStance mov r1, #0x5A ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 attack. strh r0, [ r4, r1 ] mov r1, #0x5E ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 attack speed. strh r0, [ r4, r1 ] mov r1, #0x62 ldrh r0, [ r4, r1 ] add r0, #0x08 @ Add 8 avoid. strh r0, [ r4, r1 ] CheckMirrorStance: bl CheckNextStance cmp r0, #0x00 beq CheckReadyStance mov r1, #0x5A ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 attack. strh r0, [ r4, r1 ] @ I need to check if the enemy's weapon is magic since this calls for +4 res specifically. cmp r7, #0x01 bne CheckReadyStance mov r1, #0x5C ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 res. strh r0, [ r4, r1 ] CheckReadyStance: bl CheckNextStance cmp r0, #0x00 beq CheckSteadyStance mov r1, #0x5E ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 attack speed. strh r0, [ r4, r1 ] mov r1, #0x62 ldrh r0, [ r4, r1 ] add r0, #0x08 @ Add 8 avoid. strh r0, [ r4, r1 ] cmp r7, #0x01 beq CheckSteadyStance mov r1, #0x5C ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 def. strh r0, [ r4, r1 ] CheckSteadyStance: bl CheckNextStance cmp r0, #0x00 beq CheckSturdyStance cmp r7, #0x01 beq CheckSturdyStance mov r1, #0x5C ldrh r0, [ r4, r1 ] add r0, #0x06 @ Add 6 def. strh r0, [ r4, r1 ] CheckSturdyStance: bl CheckNextStance cmp r0, #0x00 beq CheckSwiftStance mov r1, #0x5A ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 attack. strh r0, [ r4, r1 ] cmp r7, #0x01 beq CheckSwiftStance mov r1, #0x5C ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 def. strh r0, [ r4, r1 ] CheckSwiftStance: bl CheckNextStance cmp r0, #0x00 beq CheckWardingStance mov r1, #0x5E ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 attack speed. strh r0, [ r4, r1 ] mov r1, #0x62 ldrh r0, [ r4, r1 ] add r0, #0x08 @ Add 8 avoid. strh r0, [ r4, r1 ] cmp r7, #0x01 bne CheckWardingStance mov r1, #0x5C ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 res. strh r0, [ r4, r1 ] CheckWardingStance: bl CheckNextStance cmp r0, #0x00 beq CheckSpectrumStance cmp r7, #0x01 bne CheckSpectrumStance mov r1, #0x5C ldrh r0, [ r4, r1 ] add r0, #0x06 @ Add 6 res. strh r0, [ r4, r1 ] CheckSpectrumStance: bl CheckNextStance cmp r0, #0x00 beq End mov r1, #0x5A ldrh r0, [ r4, r1 ] add r0, #0x02 @ Add 2 attack. strh r0, [ r4, r1 ] mov r1, #0x5E ldrh r0, [ r4, r1 ] add r0, #0x02 @ Add 2 attack speed. strh r0, [ r4, r1 ] mov r1, #0x62 ldrh r0, [ r4, r1 ] add r0, #0x04 @ Add 4 avoid. strh r0, [ r4, r1 ] mov r1, #0x5C ldrh r0, [ r4, r1 ] add r0, #0x02 @ Add 2 def/res. strh r0, [ r4, r1 ] End: pop { r4 - r7 } pop { r3 } bx r3 CheckNextStance: push { lr } ldr r1, =StanceSkillList ldrb r1, [ r1, r6 ] mov r0, r4 blh SkillTester, r3 add r6, #0x01 pop { r3 } bx r3 @Bracing Stance- +4 res/def @Darting Stance- +6 Speed @Fierce Stance - +6 Attack @Kestrel Stance- +4 atk/spd @Mirror Stance- +4 atk/res @Steady Stance- +6 def @Sturdy Stance- +4 atk/def @Ready Stance - +4 spd/def @Swift Stance- +4 spd/res @Warding Stance- +6 res
18.16895
90
0.662478
b64fb7d48728c411e1c7b606eb0ada0c8688287f
270
asm
Assembly
libpal/intel_64bit_systemv_nasm/vmcall_xen.asm
mars-research/pal
5977394cda8750ff5dcb89c2bf193ec1ef4cd137
[ "MIT" ]
26
2020-01-06T23:53:17.000Z
2022-02-01T08:58:21.000Z
libpal/intel_64bit_systemv_nasm/vmcall_xen.asm
mars-research/pal
5977394cda8750ff5dcb89c2bf193ec1ef4cd137
[ "MIT" ]
30
2019-11-13T00:55:22.000Z
2022-01-06T08:09:35.000Z
libpal/intel_64bit_systemv_nasm/vmcall_xen.asm
mars-research/pal
5977394cda8750ff5dcb89c2bf193ec1ef4cd137
[ "MIT" ]
14
2019-11-15T16:56:22.000Z
2021-12-22T10:14:17.000Z
bits 64 default rel section .text global pal_execute_vmcall_xen pal_execute_vmcall_xen : mov rax, rdi mov rdi, rsi mov rsi, rdx mov rdx, rcx mov r10, r8 mov r8, r9 pop r9 push rcx push r11 vmcall pop r11 pop rcx ret
12.857143
29
0.622222
e2f2895ad857e96333fe57cc34f906af2a911c9d
3,478
asm
Assembly
ary-stack.asm
kosmospredanie/mips-asm-examples
7086a7dc9cf87e6544e56223ba30c870acdda3f5
[ "MIT" ]
null
null
null
ary-stack.asm
kosmospredanie/mips-asm-examples
7086a7dc9cf87e6544e56223ba30c870acdda3f5
[ "MIT" ]
null
null
null
ary-stack.asm
kosmospredanie/mips-asm-examples
7086a7dc9cf87e6544e56223ba30c870acdda3f5
[ "MIT" ]
null
null
null
# ary-stack.asm # # Implement Stack using an array (stack capacity: 10) # ## DATA ## .data # Current length len: .word 0 # Array (cap: 10) arr: .word 0 0 0 0 0 0 0 0 0 0 ## MACROS ## .include "macros.asm" .eqv CAPACITY 10 # Gets the address to (base + idx*4) # # @param %base The base address # @param %idx Index (either an immediate value or register name) # @result $v0 The address .macro getaddr (%base, %idx) add $v0, $zero, %idx mul $v0, $v0, 4 # 1 word = 4 bytes la $a0, %base add $v0, $v0, $a0 .end_macro # Gets the value of the address (base + idx*4) # # @param %base The base address # @param %idx Index (either an immediate value or register name) # @result $v0 The value of the address .macro getval (%base, %idx) getaddr(%base, %idx) lw $v0, 0($v0) .end_macro # Sets the value to the address (base + idx*4) # # @param %base The base address # @param %idx Index (either an immediate value or register name) # @param %val register of new value # @param $v0 The value of the address .macro setval (%base, %idx, %val) getaddr(%base, %idx) sw %val, 0($v0) .end_macro # Gets the current size of the stack # # @result $v0 The current size .macro getsize () getval(len, 0) .end_macro # Sets the current size of the stack # # @param %size new value register .macro setsize (%size) setval(len, 0, %size) .end_macro # Increases the current size by 1 .macro inc_size () getsize() add $a1, $v0, 1 setsize($a1) .end_macro # Decreases the current size by 1 .macro dec_size () getsize() sub $a1, $v0, 1 setsize($a1) .end_macro # Prints the stack. .macro print_stack () print_str(":: Stack: (size: ") getsize() move $t1, $v0 # $t1 = the current length of the array print_int($t1) print_str(") [ ") ble $t1, 0, printstack_end # goto printstack_end if len <= 0 li $t0, 0 printstack_loop: getval(arr, $t0) print_int($v0) print_str(" ") add $t0, $t0, 1 blt $t0, $t1, printstack_loop # repeat if $t0 < len printstack_end: print_str("]\n") .end_macro # Pushes an item into the stack. # # @param %val An item (either an immediate value or register name) .macro push (%val) add $t0, $zero, %val # $t0 = item getsize() li $t1, CAPACITY # $t1 = CAPACITY blt $v0, $t1, do_push # goto do_push if len < CAPACITY print_str(":: WARN: Stack capacity exceeded! Your input has been discarded\n") print_stack() j push_end do_push: setval(arr, $v0, $t0) # arr[len] = item inc_size() # Update length print_stack() push_end: .end_macro # Removes and gets an item from the stack. # # @result $v0 An pop .macro pop () getsize() sub $t0, $v0, 1 # $t0 = len - 1 bgt $v0, 0, do_pop # goto do_pop if not empty print_str(":: WARN: Stack is empty!\n") print_stack() j pop_end do_pop: print_str(":: Popped item: ") getval(arr, $t0) # get arr[len-1] print_int($v0) dec_size() # Update length print_char('\n') print_stack() pop_end: .end_macro ## TEXT (PROGRAM) ## .text .globl main main: print_str(":: Usage:\n") print_str(":: - Input a zero or positive number => push\n") print_str(":: - Input a negative number => pop\n") loop: print_str("> Input: ") read_int() bge $v0, 0, push_input # goto push_input if the input is not a negative number pop() j loop push_input: push($v0) j loop
22.732026
82
0.617309
a474c5d9a68c9f95440bd8f90379a8f9ce94704d
34,567
asm
Assembly
worker/deps/openssl/config/archs/VC-WIN64A/asm_avx2/crypto/bn/rsaz-x86_64.asm
SteveMcFarlin/mediasoup
05498223878408e9fa6c1bedec3c7a6ad642c462
[ "0BSD" ]
1,666
2017-01-12T03:58:44.000Z
2017-08-20T23:39:20.000Z
worker/deps/openssl/config/archs/VC-WIN64A/asm_avx2/crypto/bn/rsaz-x86_64.asm
SteveMcFarlin/mediasoup
05498223878408e9fa6c1bedec3c7a6ad642c462
[ "0BSD" ]
116
2021-05-29T16:32:51.000Z
2021-08-13T16:05:29.000Z
worker/deps/openssl/config/archs/VC-WIN64A/asm_avx2/crypto/bn/rsaz-x86_64.asm
SteveMcFarlin/mediasoup
05498223878408e9fa6c1bedec3c7a6ad642c462
[ "0BSD" ]
161
2017-08-25T20:20:01.000Z
2022-02-08T02:59:03.000Z
default rel %define XMMWORD %define YMMWORD %define ZMMWORD section .text code align=64 EXTERN OPENSSL_ia32cap_P global rsaz_512_sqr ALIGN 32 rsaz_512_sqr: mov QWORD[8+rsp],rdi ;WIN64 prologue mov QWORD[16+rsp],rsi mov rax,rsp $L$SEH_begin_rsaz_512_sqr: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8,QWORD[40+rsp] push rbx push rbp push r12 push r13 push r14 push r15 sub rsp,128+24 $L$sqr_body: DB 102,72,15,110,202 mov rdx,QWORD[rsi] mov rax,QWORD[8+rsi] mov QWORD[128+rsp],rcx mov r11d,0x80100 and r11d,DWORD[((OPENSSL_ia32cap_P+8))] cmp r11d,0x80100 je NEAR $L$oop_sqrx jmp NEAR $L$oop_sqr ALIGN 32 $L$oop_sqr: mov DWORD[((128+8))+rsp],r8d mov rbx,rdx mov rbp,rax mul rdx mov r8,rax mov rax,QWORD[16+rsi] mov r9,rdx mul rbx add r9,rax mov rax,QWORD[24+rsi] mov r10,rdx adc r10,0 mul rbx add r10,rax mov rax,QWORD[32+rsi] mov r11,rdx adc r11,0 mul rbx add r11,rax mov rax,QWORD[40+rsi] mov r12,rdx adc r12,0 mul rbx add r12,rax mov rax,QWORD[48+rsi] mov r13,rdx adc r13,0 mul rbx add r13,rax mov rax,QWORD[56+rsi] mov r14,rdx adc r14,0 mul rbx add r14,rax mov rax,rbx adc rdx,0 xor rcx,rcx add r8,r8 mov r15,rdx adc rcx,0 mul rax add rdx,r8 adc rcx,0 mov QWORD[rsp],rax mov QWORD[8+rsp],rdx mov rax,QWORD[16+rsi] mul rbp add r10,rax mov rax,QWORD[24+rsi] mov rbx,rdx adc rbx,0 mul rbp add r11,rax mov rax,QWORD[32+rsi] adc rdx,0 add r11,rbx mov rbx,rdx adc rbx,0 mul rbp add r12,rax mov rax,QWORD[40+rsi] adc rdx,0 add r12,rbx mov rbx,rdx adc rbx,0 mul rbp add r13,rax mov rax,QWORD[48+rsi] adc rdx,0 add r13,rbx mov rbx,rdx adc rbx,0 mul rbp add r14,rax mov rax,QWORD[56+rsi] adc rdx,0 add r14,rbx mov rbx,rdx adc rbx,0 mul rbp add r15,rax mov rax,rbp adc rdx,0 add r15,rbx adc rdx,0 xor rbx,rbx add r9,r9 mov r8,rdx adc r10,r10 adc rbx,0 mul rax add rax,rcx mov rbp,QWORD[16+rsi] add r9,rax mov rax,QWORD[24+rsi] adc r10,rdx adc rbx,0 mov QWORD[16+rsp],r9 mov QWORD[24+rsp],r10 mul rbp add r12,rax mov rax,QWORD[32+rsi] mov rcx,rdx adc rcx,0 mul rbp add r13,rax mov rax,QWORD[40+rsi] adc rdx,0 add r13,rcx mov rcx,rdx adc rcx,0 mul rbp add r14,rax mov rax,QWORD[48+rsi] adc rdx,0 add r14,rcx mov rcx,rdx adc rcx,0 mul rbp add r15,rax mov rax,QWORD[56+rsi] adc rdx,0 add r15,rcx mov rcx,rdx adc rcx,0 mul rbp add r8,rax mov rax,rbp adc rdx,0 add r8,rcx adc rdx,0 xor rcx,rcx add r11,r11 mov r9,rdx adc r12,r12 adc rcx,0 mul rax add rax,rbx mov r10,QWORD[24+rsi] add r11,rax mov rax,QWORD[32+rsi] adc r12,rdx adc rcx,0 mov QWORD[32+rsp],r11 mov QWORD[40+rsp],r12 mov r11,rax mul r10 add r14,rax mov rax,QWORD[40+rsi] mov rbx,rdx adc rbx,0 mov r12,rax mul r10 add r15,rax mov rax,QWORD[48+rsi] adc rdx,0 add r15,rbx mov rbx,rdx adc rbx,0 mov rbp,rax mul r10 add r8,rax mov rax,QWORD[56+rsi] adc rdx,0 add r8,rbx mov rbx,rdx adc rbx,0 mul r10 add r9,rax mov rax,r10 adc rdx,0 add r9,rbx adc rdx,0 xor rbx,rbx add r13,r13 mov r10,rdx adc r14,r14 adc rbx,0 mul rax add rax,rcx add r13,rax mov rax,r12 adc r14,rdx adc rbx,0 mov QWORD[48+rsp],r13 mov QWORD[56+rsp],r14 mul r11 add r8,rax mov rax,rbp mov rcx,rdx adc rcx,0 mul r11 add r9,rax mov rax,QWORD[56+rsi] adc rdx,0 add r9,rcx mov rcx,rdx adc rcx,0 mov r14,rax mul r11 add r10,rax mov rax,r11 adc rdx,0 add r10,rcx adc rdx,0 xor rcx,rcx add r15,r15 mov r11,rdx adc r8,r8 adc rcx,0 mul rax add rax,rbx add r15,rax mov rax,rbp adc r8,rdx adc rcx,0 mov QWORD[64+rsp],r15 mov QWORD[72+rsp],r8 mul r12 add r10,rax mov rax,r14 mov rbx,rdx adc rbx,0 mul r12 add r11,rax mov rax,r12 adc rdx,0 add r11,rbx adc rdx,0 xor rbx,rbx add r9,r9 mov r12,rdx adc r10,r10 adc rbx,0 mul rax add rax,rcx add r9,rax mov rax,r14 adc r10,rdx adc rbx,0 mov QWORD[80+rsp],r9 mov QWORD[88+rsp],r10 mul rbp add r12,rax mov rax,rbp adc rdx,0 xor rcx,rcx add r11,r11 mov r13,rdx adc r12,r12 adc rcx,0 mul rax add rax,rbx add r11,rax mov rax,r14 adc r12,rdx adc rcx,0 mov QWORD[96+rsp],r11 mov QWORD[104+rsp],r12 xor rbx,rbx add r13,r13 adc rbx,0 mul rax add rax,rcx add rax,r13 adc rdx,rbx mov r8,QWORD[rsp] mov r9,QWORD[8+rsp] mov r10,QWORD[16+rsp] mov r11,QWORD[24+rsp] mov r12,QWORD[32+rsp] mov r13,QWORD[40+rsp] mov r14,QWORD[48+rsp] mov r15,QWORD[56+rsp] DB 102,72,15,126,205 mov QWORD[112+rsp],rax mov QWORD[120+rsp],rdx call __rsaz_512_reduce add r8,QWORD[64+rsp] adc r9,QWORD[72+rsp] adc r10,QWORD[80+rsp] adc r11,QWORD[88+rsp] adc r12,QWORD[96+rsp] adc r13,QWORD[104+rsp] adc r14,QWORD[112+rsp] adc r15,QWORD[120+rsp] sbb rcx,rcx call __rsaz_512_subtract mov rdx,r8 mov rax,r9 mov r8d,DWORD[((128+8))+rsp] mov rsi,rdi dec r8d jnz NEAR $L$oop_sqr jmp NEAR $L$sqr_tail ALIGN 32 $L$oop_sqrx: mov DWORD[((128+8))+rsp],r8d DB 102,72,15,110,199 mulx r9,r8,rax mov rbx,rax mulx r10,rcx,QWORD[16+rsi] xor rbp,rbp mulx r11,rax,QWORD[24+rsi] adcx r9,rcx DB 0xc4,0x62,0xf3,0xf6,0xa6,0x20,0x00,0x00,0x00 adcx r10,rax DB 0xc4,0x62,0xfb,0xf6,0xae,0x28,0x00,0x00,0x00 adcx r11,rcx mulx r14,rcx,QWORD[48+rsi] adcx r12,rax adcx r13,rcx mulx r15,rax,QWORD[56+rsi] adcx r14,rax adcx r15,rbp mulx rdi,rax,rdx mov rdx,rbx xor rcx,rcx adox r8,r8 adcx r8,rdi adox rcx,rbp adcx rcx,rbp mov QWORD[rsp],rax mov QWORD[8+rsp],r8 DB 0xc4,0xe2,0xfb,0xf6,0x9e,0x10,0x00,0x00,0x00 adox r10,rax adcx r11,rbx mulx r8,rdi,QWORD[24+rsi] adox r11,rdi DB 0x66 adcx r12,r8 mulx rbx,rax,QWORD[32+rsi] adox r12,rax adcx r13,rbx mulx r8,rdi,QWORD[40+rsi] adox r13,rdi adcx r14,r8 DB 0xc4,0xe2,0xfb,0xf6,0x9e,0x30,0x00,0x00,0x00 adox r14,rax adcx r15,rbx DB 0xc4,0x62,0xc3,0xf6,0x86,0x38,0x00,0x00,0x00 adox r15,rdi adcx r8,rbp mulx rdi,rax,rdx adox r8,rbp DB 0x48,0x8b,0x96,0x10,0x00,0x00,0x00 xor rbx,rbx adox r9,r9 adcx rax,rcx adox r10,r10 adcx r9,rax adox rbx,rbp adcx r10,rdi adcx rbx,rbp mov QWORD[16+rsp],r9 DB 0x4c,0x89,0x94,0x24,0x18,0x00,0x00,0x00 mulx r9,rdi,QWORD[24+rsi] adox r12,rdi adcx r13,r9 mulx rcx,rax,QWORD[32+rsi] adox r13,rax adcx r14,rcx DB 0xc4,0x62,0xc3,0xf6,0x8e,0x28,0x00,0x00,0x00 adox r14,rdi adcx r15,r9 DB 0xc4,0xe2,0xfb,0xf6,0x8e,0x30,0x00,0x00,0x00 adox r15,rax adcx r8,rcx mulx r9,rdi,QWORD[56+rsi] adox r8,rdi adcx r9,rbp mulx rdi,rax,rdx adox r9,rbp mov rdx,QWORD[24+rsi] xor rcx,rcx adox r11,r11 adcx rax,rbx adox r12,r12 adcx r11,rax adox rcx,rbp adcx r12,rdi adcx rcx,rbp mov QWORD[32+rsp],r11 mov QWORD[40+rsp],r12 mulx rbx,rax,QWORD[32+rsi] adox r14,rax adcx r15,rbx mulx r10,rdi,QWORD[40+rsi] adox r15,rdi adcx r8,r10 mulx rbx,rax,QWORD[48+rsi] adox r8,rax adcx r9,rbx mulx r10,rdi,QWORD[56+rsi] adox r9,rdi adcx r10,rbp mulx rdi,rax,rdx adox r10,rbp mov rdx,QWORD[32+rsi] xor rbx,rbx adox r13,r13 adcx rax,rcx adox r14,r14 adcx r13,rax adox rbx,rbp adcx r14,rdi adcx rbx,rbp mov QWORD[48+rsp],r13 mov QWORD[56+rsp],r14 mulx r11,rdi,QWORD[40+rsi] adox r8,rdi adcx r9,r11 mulx rcx,rax,QWORD[48+rsi] adox r9,rax adcx r10,rcx mulx r11,rdi,QWORD[56+rsi] adox r10,rdi adcx r11,rbp mulx rdi,rax,rdx mov rdx,QWORD[40+rsi] adox r11,rbp xor rcx,rcx adox r15,r15 adcx rax,rbx adox r8,r8 adcx r15,rax adox rcx,rbp adcx r8,rdi adcx rcx,rbp mov QWORD[64+rsp],r15 mov QWORD[72+rsp],r8 DB 0xc4,0xe2,0xfb,0xf6,0x9e,0x30,0x00,0x00,0x00 adox r10,rax adcx r11,rbx DB 0xc4,0x62,0xc3,0xf6,0xa6,0x38,0x00,0x00,0x00 adox r11,rdi adcx r12,rbp mulx rdi,rax,rdx adox r12,rbp mov rdx,QWORD[48+rsi] xor rbx,rbx adox r9,r9 adcx rax,rcx adox r10,r10 adcx r9,rax adcx r10,rdi adox rbx,rbp adcx rbx,rbp mov QWORD[80+rsp],r9 mov QWORD[88+rsp],r10 DB 0xc4,0x62,0xfb,0xf6,0xae,0x38,0x00,0x00,0x00 adox r12,rax adox r13,rbp mulx rdi,rax,rdx xor rcx,rcx mov rdx,QWORD[56+rsi] adox r11,r11 adcx rax,rbx adox r12,r12 adcx r11,rax adox rcx,rbp adcx r12,rdi adcx rcx,rbp DB 0x4c,0x89,0x9c,0x24,0x60,0x00,0x00,0x00 DB 0x4c,0x89,0xa4,0x24,0x68,0x00,0x00,0x00 mulx rdx,rax,rdx xor rbx,rbx adox r13,r13 adcx rax,rcx adox rbx,rbp adcx rax,r13 adcx rbx,rdx DB 102,72,15,126,199 DB 102,72,15,126,205 mov rdx,QWORD[128+rsp] mov r8,QWORD[rsp] mov r9,QWORD[8+rsp] mov r10,QWORD[16+rsp] mov r11,QWORD[24+rsp] mov r12,QWORD[32+rsp] mov r13,QWORD[40+rsp] mov r14,QWORD[48+rsp] mov r15,QWORD[56+rsp] mov QWORD[112+rsp],rax mov QWORD[120+rsp],rbx call __rsaz_512_reducex add r8,QWORD[64+rsp] adc r9,QWORD[72+rsp] adc r10,QWORD[80+rsp] adc r11,QWORD[88+rsp] adc r12,QWORD[96+rsp] adc r13,QWORD[104+rsp] adc r14,QWORD[112+rsp] adc r15,QWORD[120+rsp] sbb rcx,rcx call __rsaz_512_subtract mov rdx,r8 mov rax,r9 mov r8d,DWORD[((128+8))+rsp] mov rsi,rdi dec r8d jnz NEAR $L$oop_sqrx $L$sqr_tail: lea rax,[((128+24+48))+rsp] mov r15,QWORD[((-48))+rax] mov r14,QWORD[((-40))+rax] mov r13,QWORD[((-32))+rax] mov r12,QWORD[((-24))+rax] mov rbp,QWORD[((-16))+rax] mov rbx,QWORD[((-8))+rax] lea rsp,[rax] $L$sqr_epilogue: mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_rsaz_512_sqr: global rsaz_512_mul ALIGN 32 rsaz_512_mul: mov QWORD[8+rsp],rdi ;WIN64 prologue mov QWORD[16+rsp],rsi mov rax,rsp $L$SEH_begin_rsaz_512_mul: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8,QWORD[40+rsp] push rbx push rbp push r12 push r13 push r14 push r15 sub rsp,128+24 $L$mul_body: DB 102,72,15,110,199 DB 102,72,15,110,201 mov QWORD[128+rsp],r8 mov r11d,0x80100 and r11d,DWORD[((OPENSSL_ia32cap_P+8))] cmp r11d,0x80100 je NEAR $L$mulx mov rbx,QWORD[rdx] mov rbp,rdx call __rsaz_512_mul DB 102,72,15,126,199 DB 102,72,15,126,205 mov r8,QWORD[rsp] mov r9,QWORD[8+rsp] mov r10,QWORD[16+rsp] mov r11,QWORD[24+rsp] mov r12,QWORD[32+rsp] mov r13,QWORD[40+rsp] mov r14,QWORD[48+rsp] mov r15,QWORD[56+rsp] call __rsaz_512_reduce jmp NEAR $L$mul_tail ALIGN 32 $L$mulx: mov rbp,rdx mov rdx,QWORD[rdx] call __rsaz_512_mulx DB 102,72,15,126,199 DB 102,72,15,126,205 mov rdx,QWORD[128+rsp] mov r8,QWORD[rsp] mov r9,QWORD[8+rsp] mov r10,QWORD[16+rsp] mov r11,QWORD[24+rsp] mov r12,QWORD[32+rsp] mov r13,QWORD[40+rsp] mov r14,QWORD[48+rsp] mov r15,QWORD[56+rsp] call __rsaz_512_reducex $L$mul_tail: add r8,QWORD[64+rsp] adc r9,QWORD[72+rsp] adc r10,QWORD[80+rsp] adc r11,QWORD[88+rsp] adc r12,QWORD[96+rsp] adc r13,QWORD[104+rsp] adc r14,QWORD[112+rsp] adc r15,QWORD[120+rsp] sbb rcx,rcx call __rsaz_512_subtract lea rax,[((128+24+48))+rsp] mov r15,QWORD[((-48))+rax] mov r14,QWORD[((-40))+rax] mov r13,QWORD[((-32))+rax] mov r12,QWORD[((-24))+rax] mov rbp,QWORD[((-16))+rax] mov rbx,QWORD[((-8))+rax] lea rsp,[rax] $L$mul_epilogue: mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_rsaz_512_mul: global rsaz_512_mul_gather4 ALIGN 32 rsaz_512_mul_gather4: mov QWORD[8+rsp],rdi ;WIN64 prologue mov QWORD[16+rsp],rsi mov rax,rsp $L$SEH_begin_rsaz_512_mul_gather4: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8,QWORD[40+rsp] mov r9,QWORD[48+rsp] push rbx push rbp push r12 push r13 push r14 push r15 sub rsp,328 movaps XMMWORD[160+rsp],xmm6 movaps XMMWORD[176+rsp],xmm7 movaps XMMWORD[192+rsp],xmm8 movaps XMMWORD[208+rsp],xmm9 movaps XMMWORD[224+rsp],xmm10 movaps XMMWORD[240+rsp],xmm11 movaps XMMWORD[256+rsp],xmm12 movaps XMMWORD[272+rsp],xmm13 movaps XMMWORD[288+rsp],xmm14 movaps XMMWORD[304+rsp],xmm15 $L$mul_gather4_body: movd xmm8,r9d movdqa xmm1,XMMWORD[(($L$inc+16))] movdqa xmm0,XMMWORD[$L$inc] pshufd xmm8,xmm8,0 movdqa xmm7,xmm1 movdqa xmm2,xmm1 paddd xmm1,xmm0 pcmpeqd xmm0,xmm8 movdqa xmm3,xmm7 paddd xmm2,xmm1 pcmpeqd xmm1,xmm8 movdqa xmm4,xmm7 paddd xmm3,xmm2 pcmpeqd xmm2,xmm8 movdqa xmm5,xmm7 paddd xmm4,xmm3 pcmpeqd xmm3,xmm8 movdqa xmm6,xmm7 paddd xmm5,xmm4 pcmpeqd xmm4,xmm8 paddd xmm6,xmm5 pcmpeqd xmm5,xmm8 paddd xmm7,xmm6 pcmpeqd xmm6,xmm8 pcmpeqd xmm7,xmm8 movdqa xmm8,XMMWORD[rdx] movdqa xmm9,XMMWORD[16+rdx] movdqa xmm10,XMMWORD[32+rdx] movdqa xmm11,XMMWORD[48+rdx] pand xmm8,xmm0 movdqa xmm12,XMMWORD[64+rdx] pand xmm9,xmm1 movdqa xmm13,XMMWORD[80+rdx] pand xmm10,xmm2 movdqa xmm14,XMMWORD[96+rdx] pand xmm11,xmm3 movdqa xmm15,XMMWORD[112+rdx] lea rbp,[128+rdx] pand xmm12,xmm4 pand xmm13,xmm5 pand xmm14,xmm6 pand xmm15,xmm7 por xmm8,xmm10 por xmm9,xmm11 por xmm8,xmm12 por xmm9,xmm13 por xmm8,xmm14 por xmm9,xmm15 por xmm8,xmm9 pshufd xmm9,xmm8,0x4e por xmm8,xmm9 mov r11d,0x80100 and r11d,DWORD[((OPENSSL_ia32cap_P+8))] cmp r11d,0x80100 je NEAR $L$mulx_gather DB 102,76,15,126,195 mov QWORD[128+rsp],r8 mov QWORD[((128+8))+rsp],rdi mov QWORD[((128+16))+rsp],rcx mov rax,QWORD[rsi] mov rcx,QWORD[8+rsi] mul rbx mov QWORD[rsp],rax mov rax,rcx mov r8,rdx mul rbx add r8,rax mov rax,QWORD[16+rsi] mov r9,rdx adc r9,0 mul rbx add r9,rax mov rax,QWORD[24+rsi] mov r10,rdx adc r10,0 mul rbx add r10,rax mov rax,QWORD[32+rsi] mov r11,rdx adc r11,0 mul rbx add r11,rax mov rax,QWORD[40+rsi] mov r12,rdx adc r12,0 mul rbx add r12,rax mov rax,QWORD[48+rsi] mov r13,rdx adc r13,0 mul rbx add r13,rax mov rax,QWORD[56+rsi] mov r14,rdx adc r14,0 mul rbx add r14,rax mov rax,QWORD[rsi] mov r15,rdx adc r15,0 lea rdi,[8+rsp] mov ecx,7 jmp NEAR $L$oop_mul_gather ALIGN 32 $L$oop_mul_gather: movdqa xmm8,XMMWORD[rbp] movdqa xmm9,XMMWORD[16+rbp] movdqa xmm10,XMMWORD[32+rbp] movdqa xmm11,XMMWORD[48+rbp] pand xmm8,xmm0 movdqa xmm12,XMMWORD[64+rbp] pand xmm9,xmm1 movdqa xmm13,XMMWORD[80+rbp] pand xmm10,xmm2 movdqa xmm14,XMMWORD[96+rbp] pand xmm11,xmm3 movdqa xmm15,XMMWORD[112+rbp] lea rbp,[128+rbp] pand xmm12,xmm4 pand xmm13,xmm5 pand xmm14,xmm6 pand xmm15,xmm7 por xmm8,xmm10 por xmm9,xmm11 por xmm8,xmm12 por xmm9,xmm13 por xmm8,xmm14 por xmm9,xmm15 por xmm8,xmm9 pshufd xmm9,xmm8,0x4e por xmm8,xmm9 DB 102,76,15,126,195 mul rbx add r8,rax mov rax,QWORD[8+rsi] mov QWORD[rdi],r8 mov r8,rdx adc r8,0 mul rbx add r9,rax mov rax,QWORD[16+rsi] adc rdx,0 add r8,r9 mov r9,rdx adc r9,0 mul rbx add r10,rax mov rax,QWORD[24+rsi] adc rdx,0 add r9,r10 mov r10,rdx adc r10,0 mul rbx add r11,rax mov rax,QWORD[32+rsi] adc rdx,0 add r10,r11 mov r11,rdx adc r11,0 mul rbx add r12,rax mov rax,QWORD[40+rsi] adc rdx,0 add r11,r12 mov r12,rdx adc r12,0 mul rbx add r13,rax mov rax,QWORD[48+rsi] adc rdx,0 add r12,r13 mov r13,rdx adc r13,0 mul rbx add r14,rax mov rax,QWORD[56+rsi] adc rdx,0 add r13,r14 mov r14,rdx adc r14,0 mul rbx add r15,rax mov rax,QWORD[rsi] adc rdx,0 add r14,r15 mov r15,rdx adc r15,0 lea rdi,[8+rdi] dec ecx jnz NEAR $L$oop_mul_gather mov QWORD[rdi],r8 mov QWORD[8+rdi],r9 mov QWORD[16+rdi],r10 mov QWORD[24+rdi],r11 mov QWORD[32+rdi],r12 mov QWORD[40+rdi],r13 mov QWORD[48+rdi],r14 mov QWORD[56+rdi],r15 mov rdi,QWORD[((128+8))+rsp] mov rbp,QWORD[((128+16))+rsp] mov r8,QWORD[rsp] mov r9,QWORD[8+rsp] mov r10,QWORD[16+rsp] mov r11,QWORD[24+rsp] mov r12,QWORD[32+rsp] mov r13,QWORD[40+rsp] mov r14,QWORD[48+rsp] mov r15,QWORD[56+rsp] call __rsaz_512_reduce jmp NEAR $L$mul_gather_tail ALIGN 32 $L$mulx_gather: DB 102,76,15,126,194 mov QWORD[128+rsp],r8 mov QWORD[((128+8))+rsp],rdi mov QWORD[((128+16))+rsp],rcx mulx r8,rbx,QWORD[rsi] mov QWORD[rsp],rbx xor edi,edi mulx r9,rax,QWORD[8+rsi] mulx r10,rbx,QWORD[16+rsi] adcx r8,rax mulx r11,rax,QWORD[24+rsi] adcx r9,rbx mulx r12,rbx,QWORD[32+rsi] adcx r10,rax mulx r13,rax,QWORD[40+rsi] adcx r11,rbx mulx r14,rbx,QWORD[48+rsi] adcx r12,rax mulx r15,rax,QWORD[56+rsi] adcx r13,rbx adcx r14,rax DB 0x67 mov rbx,r8 adcx r15,rdi mov rcx,-7 jmp NEAR $L$oop_mulx_gather ALIGN 32 $L$oop_mulx_gather: movdqa xmm8,XMMWORD[rbp] movdqa xmm9,XMMWORD[16+rbp] movdqa xmm10,XMMWORD[32+rbp] movdqa xmm11,XMMWORD[48+rbp] pand xmm8,xmm0 movdqa xmm12,XMMWORD[64+rbp] pand xmm9,xmm1 movdqa xmm13,XMMWORD[80+rbp] pand xmm10,xmm2 movdqa xmm14,XMMWORD[96+rbp] pand xmm11,xmm3 movdqa xmm15,XMMWORD[112+rbp] lea rbp,[128+rbp] pand xmm12,xmm4 pand xmm13,xmm5 pand xmm14,xmm6 pand xmm15,xmm7 por xmm8,xmm10 por xmm9,xmm11 por xmm8,xmm12 por xmm9,xmm13 por xmm8,xmm14 por xmm9,xmm15 por xmm8,xmm9 pshufd xmm9,xmm8,0x4e por xmm8,xmm9 DB 102,76,15,126,194 DB 0xc4,0x62,0xfb,0xf6,0x86,0x00,0x00,0x00,0x00 adcx rbx,rax adox r8,r9 mulx r9,rax,QWORD[8+rsi] adcx r8,rax adox r9,r10 mulx r10,rax,QWORD[16+rsi] adcx r9,rax adox r10,r11 DB 0xc4,0x62,0xfb,0xf6,0x9e,0x18,0x00,0x00,0x00 adcx r10,rax adox r11,r12 mulx r12,rax,QWORD[32+rsi] adcx r11,rax adox r12,r13 mulx r13,rax,QWORD[40+rsi] adcx r12,rax adox r13,r14 DB 0xc4,0x62,0xfb,0xf6,0xb6,0x30,0x00,0x00,0x00 adcx r13,rax DB 0x67 adox r14,r15 mulx r15,rax,QWORD[56+rsi] mov QWORD[64+rcx*8+rsp],rbx adcx r14,rax adox r15,rdi mov rbx,r8 adcx r15,rdi inc rcx jnz NEAR $L$oop_mulx_gather mov QWORD[64+rsp],r8 mov QWORD[((64+8))+rsp],r9 mov QWORD[((64+16))+rsp],r10 mov QWORD[((64+24))+rsp],r11 mov QWORD[((64+32))+rsp],r12 mov QWORD[((64+40))+rsp],r13 mov QWORD[((64+48))+rsp],r14 mov QWORD[((64+56))+rsp],r15 mov rdx,QWORD[128+rsp] mov rdi,QWORD[((128+8))+rsp] mov rbp,QWORD[((128+16))+rsp] mov r8,QWORD[rsp] mov r9,QWORD[8+rsp] mov r10,QWORD[16+rsp] mov r11,QWORD[24+rsp] mov r12,QWORD[32+rsp] mov r13,QWORD[40+rsp] mov r14,QWORD[48+rsp] mov r15,QWORD[56+rsp] call __rsaz_512_reducex $L$mul_gather_tail: add r8,QWORD[64+rsp] adc r9,QWORD[72+rsp] adc r10,QWORD[80+rsp] adc r11,QWORD[88+rsp] adc r12,QWORD[96+rsp] adc r13,QWORD[104+rsp] adc r14,QWORD[112+rsp] adc r15,QWORD[120+rsp] sbb rcx,rcx call __rsaz_512_subtract lea rax,[((128+24+48))+rsp] movaps xmm6,XMMWORD[((160-200))+rax] movaps xmm7,XMMWORD[((176-200))+rax] movaps xmm8,XMMWORD[((192-200))+rax] movaps xmm9,XMMWORD[((208-200))+rax] movaps xmm10,XMMWORD[((224-200))+rax] movaps xmm11,XMMWORD[((240-200))+rax] movaps xmm12,XMMWORD[((256-200))+rax] movaps xmm13,XMMWORD[((272-200))+rax] movaps xmm14,XMMWORD[((288-200))+rax] movaps xmm15,XMMWORD[((304-200))+rax] lea rax,[176+rax] mov r15,QWORD[((-48))+rax] mov r14,QWORD[((-40))+rax] mov r13,QWORD[((-32))+rax] mov r12,QWORD[((-24))+rax] mov rbp,QWORD[((-16))+rax] mov rbx,QWORD[((-8))+rax] lea rsp,[rax] $L$mul_gather4_epilogue: mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_rsaz_512_mul_gather4: global rsaz_512_mul_scatter4 ALIGN 32 rsaz_512_mul_scatter4: mov QWORD[8+rsp],rdi ;WIN64 prologue mov QWORD[16+rsp],rsi mov rax,rsp $L$SEH_begin_rsaz_512_mul_scatter4: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8,QWORD[40+rsp] mov r9,QWORD[48+rsp] push rbx push rbp push r12 push r13 push r14 push r15 mov r9d,r9d sub rsp,128+24 $L$mul_scatter4_body: lea r8,[r9*8+r8] DB 102,72,15,110,199 DB 102,72,15,110,202 DB 102,73,15,110,208 mov QWORD[128+rsp],rcx mov rbp,rdi mov r11d,0x80100 and r11d,DWORD[((OPENSSL_ia32cap_P+8))] cmp r11d,0x80100 je NEAR $L$mulx_scatter mov rbx,QWORD[rdi] call __rsaz_512_mul DB 102,72,15,126,199 DB 102,72,15,126,205 mov r8,QWORD[rsp] mov r9,QWORD[8+rsp] mov r10,QWORD[16+rsp] mov r11,QWORD[24+rsp] mov r12,QWORD[32+rsp] mov r13,QWORD[40+rsp] mov r14,QWORD[48+rsp] mov r15,QWORD[56+rsp] call __rsaz_512_reduce jmp NEAR $L$mul_scatter_tail ALIGN 32 $L$mulx_scatter: mov rdx,QWORD[rdi] call __rsaz_512_mulx DB 102,72,15,126,199 DB 102,72,15,126,205 mov rdx,QWORD[128+rsp] mov r8,QWORD[rsp] mov r9,QWORD[8+rsp] mov r10,QWORD[16+rsp] mov r11,QWORD[24+rsp] mov r12,QWORD[32+rsp] mov r13,QWORD[40+rsp] mov r14,QWORD[48+rsp] mov r15,QWORD[56+rsp] call __rsaz_512_reducex $L$mul_scatter_tail: add r8,QWORD[64+rsp] adc r9,QWORD[72+rsp] adc r10,QWORD[80+rsp] adc r11,QWORD[88+rsp] adc r12,QWORD[96+rsp] adc r13,QWORD[104+rsp] adc r14,QWORD[112+rsp] adc r15,QWORD[120+rsp] DB 102,72,15,126,214 sbb rcx,rcx call __rsaz_512_subtract mov QWORD[rsi],r8 mov QWORD[128+rsi],r9 mov QWORD[256+rsi],r10 mov QWORD[384+rsi],r11 mov QWORD[512+rsi],r12 mov QWORD[640+rsi],r13 mov QWORD[768+rsi],r14 mov QWORD[896+rsi],r15 lea rax,[((128+24+48))+rsp] mov r15,QWORD[((-48))+rax] mov r14,QWORD[((-40))+rax] mov r13,QWORD[((-32))+rax] mov r12,QWORD[((-24))+rax] mov rbp,QWORD[((-16))+rax] mov rbx,QWORD[((-8))+rax] lea rsp,[rax] $L$mul_scatter4_epilogue: mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_rsaz_512_mul_scatter4: global rsaz_512_mul_by_one ALIGN 32 rsaz_512_mul_by_one: mov QWORD[8+rsp],rdi ;WIN64 prologue mov QWORD[16+rsp],rsi mov rax,rsp $L$SEH_begin_rsaz_512_mul_by_one: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 push rbx push rbp push r12 push r13 push r14 push r15 sub rsp,128+24 $L$mul_by_one_body: mov eax,DWORD[((OPENSSL_ia32cap_P+8))] mov rbp,rdx mov QWORD[128+rsp],rcx mov r8,QWORD[rsi] pxor xmm0,xmm0 mov r9,QWORD[8+rsi] mov r10,QWORD[16+rsi] mov r11,QWORD[24+rsi] mov r12,QWORD[32+rsi] mov r13,QWORD[40+rsi] mov r14,QWORD[48+rsi] mov r15,QWORD[56+rsi] movdqa XMMWORD[rsp],xmm0 movdqa XMMWORD[16+rsp],xmm0 movdqa XMMWORD[32+rsp],xmm0 movdqa XMMWORD[48+rsp],xmm0 movdqa XMMWORD[64+rsp],xmm0 movdqa XMMWORD[80+rsp],xmm0 movdqa XMMWORD[96+rsp],xmm0 and eax,0x80100 cmp eax,0x80100 je NEAR $L$by_one_callx call __rsaz_512_reduce jmp NEAR $L$by_one_tail ALIGN 32 $L$by_one_callx: mov rdx,QWORD[128+rsp] call __rsaz_512_reducex $L$by_one_tail: mov QWORD[rdi],r8 mov QWORD[8+rdi],r9 mov QWORD[16+rdi],r10 mov QWORD[24+rdi],r11 mov QWORD[32+rdi],r12 mov QWORD[40+rdi],r13 mov QWORD[48+rdi],r14 mov QWORD[56+rdi],r15 lea rax,[((128+24+48))+rsp] mov r15,QWORD[((-48))+rax] mov r14,QWORD[((-40))+rax] mov r13,QWORD[((-32))+rax] mov r12,QWORD[((-24))+rax] mov rbp,QWORD[((-16))+rax] mov rbx,QWORD[((-8))+rax] lea rsp,[rax] $L$mul_by_one_epilogue: mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_rsaz_512_mul_by_one: ALIGN 32 __rsaz_512_reduce: mov rbx,r8 imul rbx,QWORD[((128+8))+rsp] mov rax,QWORD[rbp] mov ecx,8 jmp NEAR $L$reduction_loop ALIGN 32 $L$reduction_loop: mul rbx mov rax,QWORD[8+rbp] neg r8 mov r8,rdx adc r8,0 mul rbx add r9,rax mov rax,QWORD[16+rbp] adc rdx,0 add r8,r9 mov r9,rdx adc r9,0 mul rbx add r10,rax mov rax,QWORD[24+rbp] adc rdx,0 add r9,r10 mov r10,rdx adc r10,0 mul rbx add r11,rax mov rax,QWORD[32+rbp] adc rdx,0 add r10,r11 mov rsi,QWORD[((128+8))+rsp] adc rdx,0 mov r11,rdx mul rbx add r12,rax mov rax,QWORD[40+rbp] adc rdx,0 imul rsi,r8 add r11,r12 mov r12,rdx adc r12,0 mul rbx add r13,rax mov rax,QWORD[48+rbp] adc rdx,0 add r12,r13 mov r13,rdx adc r13,0 mul rbx add r14,rax mov rax,QWORD[56+rbp] adc rdx,0 add r13,r14 mov r14,rdx adc r14,0 mul rbx mov rbx,rsi add r15,rax mov rax,QWORD[rbp] adc rdx,0 add r14,r15 mov r15,rdx adc r15,0 dec ecx jne NEAR $L$reduction_loop DB 0F3h,0C3h ;repret ALIGN 32 __rsaz_512_reducex: imul rdx,r8 xor rsi,rsi mov ecx,8 jmp NEAR $L$reduction_loopx ALIGN 32 $L$reduction_loopx: mov rbx,r8 mulx r8,rax,QWORD[rbp] adcx rax,rbx adox r8,r9 mulx r9,rax,QWORD[8+rbp] adcx r8,rax adox r9,r10 mulx r10,rbx,QWORD[16+rbp] adcx r9,rbx adox r10,r11 mulx r11,rbx,QWORD[24+rbp] adcx r10,rbx adox r11,r12 DB 0xc4,0x62,0xe3,0xf6,0xa5,0x20,0x00,0x00,0x00 mov rax,rdx mov rdx,r8 adcx r11,rbx adox r12,r13 mulx rdx,rbx,QWORD[((128+8))+rsp] mov rdx,rax mulx r13,rax,QWORD[40+rbp] adcx r12,rax adox r13,r14 DB 0xc4,0x62,0xfb,0xf6,0xb5,0x30,0x00,0x00,0x00 adcx r13,rax adox r14,r15 mulx r15,rax,QWORD[56+rbp] mov rdx,rbx adcx r14,rax adox r15,rsi adcx r15,rsi dec ecx jne NEAR $L$reduction_loopx DB 0F3h,0C3h ;repret ALIGN 32 __rsaz_512_subtract: mov QWORD[rdi],r8 mov QWORD[8+rdi],r9 mov QWORD[16+rdi],r10 mov QWORD[24+rdi],r11 mov QWORD[32+rdi],r12 mov QWORD[40+rdi],r13 mov QWORD[48+rdi],r14 mov QWORD[56+rdi],r15 mov r8,QWORD[rbp] mov r9,QWORD[8+rbp] neg r8 not r9 and r8,rcx mov r10,QWORD[16+rbp] and r9,rcx not r10 mov r11,QWORD[24+rbp] and r10,rcx not r11 mov r12,QWORD[32+rbp] and r11,rcx not r12 mov r13,QWORD[40+rbp] and r12,rcx not r13 mov r14,QWORD[48+rbp] and r13,rcx not r14 mov r15,QWORD[56+rbp] and r14,rcx not r15 and r15,rcx add r8,QWORD[rdi] adc r9,QWORD[8+rdi] adc r10,QWORD[16+rdi] adc r11,QWORD[24+rdi] adc r12,QWORD[32+rdi] adc r13,QWORD[40+rdi] adc r14,QWORD[48+rdi] adc r15,QWORD[56+rdi] mov QWORD[rdi],r8 mov QWORD[8+rdi],r9 mov QWORD[16+rdi],r10 mov QWORD[24+rdi],r11 mov QWORD[32+rdi],r12 mov QWORD[40+rdi],r13 mov QWORD[48+rdi],r14 mov QWORD[56+rdi],r15 DB 0F3h,0C3h ;repret ALIGN 32 __rsaz_512_mul: lea rdi,[8+rsp] mov rax,QWORD[rsi] mul rbx mov QWORD[rdi],rax mov rax,QWORD[8+rsi] mov r8,rdx mul rbx add r8,rax mov rax,QWORD[16+rsi] mov r9,rdx adc r9,0 mul rbx add r9,rax mov rax,QWORD[24+rsi] mov r10,rdx adc r10,0 mul rbx add r10,rax mov rax,QWORD[32+rsi] mov r11,rdx adc r11,0 mul rbx add r11,rax mov rax,QWORD[40+rsi] mov r12,rdx adc r12,0 mul rbx add r12,rax mov rax,QWORD[48+rsi] mov r13,rdx adc r13,0 mul rbx add r13,rax mov rax,QWORD[56+rsi] mov r14,rdx adc r14,0 mul rbx add r14,rax mov rax,QWORD[rsi] mov r15,rdx adc r15,0 lea rbp,[8+rbp] lea rdi,[8+rdi] mov ecx,7 jmp NEAR $L$oop_mul ALIGN 32 $L$oop_mul: mov rbx,QWORD[rbp] mul rbx add r8,rax mov rax,QWORD[8+rsi] mov QWORD[rdi],r8 mov r8,rdx adc r8,0 mul rbx add r9,rax mov rax,QWORD[16+rsi] adc rdx,0 add r8,r9 mov r9,rdx adc r9,0 mul rbx add r10,rax mov rax,QWORD[24+rsi] adc rdx,0 add r9,r10 mov r10,rdx adc r10,0 mul rbx add r11,rax mov rax,QWORD[32+rsi] adc rdx,0 add r10,r11 mov r11,rdx adc r11,0 mul rbx add r12,rax mov rax,QWORD[40+rsi] adc rdx,0 add r11,r12 mov r12,rdx adc r12,0 mul rbx add r13,rax mov rax,QWORD[48+rsi] adc rdx,0 add r12,r13 mov r13,rdx adc r13,0 mul rbx add r14,rax mov rax,QWORD[56+rsi] adc rdx,0 add r13,r14 mov r14,rdx lea rbp,[8+rbp] adc r14,0 mul rbx add r15,rax mov rax,QWORD[rsi] adc rdx,0 add r14,r15 mov r15,rdx adc r15,0 lea rdi,[8+rdi] dec ecx jnz NEAR $L$oop_mul mov QWORD[rdi],r8 mov QWORD[8+rdi],r9 mov QWORD[16+rdi],r10 mov QWORD[24+rdi],r11 mov QWORD[32+rdi],r12 mov QWORD[40+rdi],r13 mov QWORD[48+rdi],r14 mov QWORD[56+rdi],r15 DB 0F3h,0C3h ;repret ALIGN 32 __rsaz_512_mulx: mulx r8,rbx,QWORD[rsi] mov rcx,-6 mulx r9,rax,QWORD[8+rsi] mov QWORD[8+rsp],rbx mulx r10,rbx,QWORD[16+rsi] adc r8,rax mulx r11,rax,QWORD[24+rsi] adc r9,rbx mulx r12,rbx,QWORD[32+rsi] adc r10,rax mulx r13,rax,QWORD[40+rsi] adc r11,rbx mulx r14,rbx,QWORD[48+rsi] adc r12,rax mulx r15,rax,QWORD[56+rsi] mov rdx,QWORD[8+rbp] adc r13,rbx adc r14,rax adc r15,0 xor rdi,rdi jmp NEAR $L$oop_mulx ALIGN 32 $L$oop_mulx: mov rbx,r8 mulx r8,rax,QWORD[rsi] adcx rbx,rax adox r8,r9 mulx r9,rax,QWORD[8+rsi] adcx r8,rax adox r9,r10 mulx r10,rax,QWORD[16+rsi] adcx r9,rax adox r10,r11 mulx r11,rax,QWORD[24+rsi] adcx r10,rax adox r11,r12 DB 0x3e,0xc4,0x62,0xfb,0xf6,0xa6,0x20,0x00,0x00,0x00 adcx r11,rax adox r12,r13 mulx r13,rax,QWORD[40+rsi] adcx r12,rax adox r13,r14 mulx r14,rax,QWORD[48+rsi] adcx r13,rax adox r14,r15 mulx r15,rax,QWORD[56+rsi] mov rdx,QWORD[64+rcx*8+rbp] mov QWORD[((8+64-8))+rcx*8+rsp],rbx adcx r14,rax adox r15,rdi adcx r15,rdi inc rcx jnz NEAR $L$oop_mulx mov rbx,r8 mulx r8,rax,QWORD[rsi] adcx rbx,rax adox r8,r9 DB 0xc4,0x62,0xfb,0xf6,0x8e,0x08,0x00,0x00,0x00 adcx r8,rax adox r9,r10 DB 0xc4,0x62,0xfb,0xf6,0x96,0x10,0x00,0x00,0x00 adcx r9,rax adox r10,r11 mulx r11,rax,QWORD[24+rsi] adcx r10,rax adox r11,r12 mulx r12,rax,QWORD[32+rsi] adcx r11,rax adox r12,r13 mulx r13,rax,QWORD[40+rsi] adcx r12,rax adox r13,r14 DB 0xc4,0x62,0xfb,0xf6,0xb6,0x30,0x00,0x00,0x00 adcx r13,rax adox r14,r15 DB 0xc4,0x62,0xfb,0xf6,0xbe,0x38,0x00,0x00,0x00 adcx r14,rax adox r15,rdi adcx r15,rdi mov QWORD[((8+64-8))+rsp],rbx mov QWORD[((8+64))+rsp],r8 mov QWORD[((8+64+8))+rsp],r9 mov QWORD[((8+64+16))+rsp],r10 mov QWORD[((8+64+24))+rsp],r11 mov QWORD[((8+64+32))+rsp],r12 mov QWORD[((8+64+40))+rsp],r13 mov QWORD[((8+64+48))+rsp],r14 mov QWORD[((8+64+56))+rsp],r15 DB 0F3h,0C3h ;repret global rsaz_512_scatter4 ALIGN 16 rsaz_512_scatter4: lea rcx,[r8*8+rcx] mov r9d,8 jmp NEAR $L$oop_scatter ALIGN 16 $L$oop_scatter: mov rax,QWORD[rdx] lea rdx,[8+rdx] mov QWORD[rcx],rax lea rcx,[128+rcx] dec r9d jnz NEAR $L$oop_scatter DB 0F3h,0C3h ;repret global rsaz_512_gather4 ALIGN 16 rsaz_512_gather4: $L$SEH_begin_rsaz_512_gather4: DB 0x48,0x81,0xec,0xa8,0x00,0x00,0x00 DB 0x0f,0x29,0x34,0x24 DB 0x0f,0x29,0x7c,0x24,0x10 DB 0x44,0x0f,0x29,0x44,0x24,0x20 DB 0x44,0x0f,0x29,0x4c,0x24,0x30 DB 0x44,0x0f,0x29,0x54,0x24,0x40 DB 0x44,0x0f,0x29,0x5c,0x24,0x50 DB 0x44,0x0f,0x29,0x64,0x24,0x60 DB 0x44,0x0f,0x29,0x6c,0x24,0x70 DB 0x44,0x0f,0x29,0xb4,0x24,0x80,0,0,0 DB 0x44,0x0f,0x29,0xbc,0x24,0x90,0,0,0 movd xmm8,r8d movdqa xmm1,XMMWORD[(($L$inc+16))] movdqa xmm0,XMMWORD[$L$inc] pshufd xmm8,xmm8,0 movdqa xmm7,xmm1 movdqa xmm2,xmm1 paddd xmm1,xmm0 pcmpeqd xmm0,xmm8 movdqa xmm3,xmm7 paddd xmm2,xmm1 pcmpeqd xmm1,xmm8 movdqa xmm4,xmm7 paddd xmm3,xmm2 pcmpeqd xmm2,xmm8 movdqa xmm5,xmm7 paddd xmm4,xmm3 pcmpeqd xmm3,xmm8 movdqa xmm6,xmm7 paddd xmm5,xmm4 pcmpeqd xmm4,xmm8 paddd xmm6,xmm5 pcmpeqd xmm5,xmm8 paddd xmm7,xmm6 pcmpeqd xmm6,xmm8 pcmpeqd xmm7,xmm8 mov r9d,8 jmp NEAR $L$oop_gather ALIGN 16 $L$oop_gather: movdqa xmm8,XMMWORD[rdx] movdqa xmm9,XMMWORD[16+rdx] movdqa xmm10,XMMWORD[32+rdx] movdqa xmm11,XMMWORD[48+rdx] pand xmm8,xmm0 movdqa xmm12,XMMWORD[64+rdx] pand xmm9,xmm1 movdqa xmm13,XMMWORD[80+rdx] pand xmm10,xmm2 movdqa xmm14,XMMWORD[96+rdx] pand xmm11,xmm3 movdqa xmm15,XMMWORD[112+rdx] lea rdx,[128+rdx] pand xmm12,xmm4 pand xmm13,xmm5 pand xmm14,xmm6 pand xmm15,xmm7 por xmm8,xmm10 por xmm9,xmm11 por xmm8,xmm12 por xmm9,xmm13 por xmm8,xmm14 por xmm9,xmm15 por xmm8,xmm9 pshufd xmm9,xmm8,0x4e por xmm8,xmm9 movq QWORD[rcx],xmm8 lea rcx,[8+rcx] dec r9d jnz NEAR $L$oop_gather movaps xmm6,XMMWORD[rsp] movaps xmm7,XMMWORD[16+rsp] movaps xmm8,XMMWORD[32+rsp] movaps xmm9,XMMWORD[48+rsp] movaps xmm10,XMMWORD[64+rsp] movaps xmm11,XMMWORD[80+rsp] movaps xmm12,XMMWORD[96+rsp] movaps xmm13,XMMWORD[112+rsp] movaps xmm14,XMMWORD[128+rsp] movaps xmm15,XMMWORD[144+rsp] add rsp,0xa8 DB 0F3h,0C3h ;repret $L$SEH_end_rsaz_512_gather4: ALIGN 64 $L$inc: DD 0,0,1,1 DD 2,2,2,2 EXTERN __imp_RtlVirtualUnwind ALIGN 16 se_handler: push rsi push rdi push rbx push rbp push r12 push r13 push r14 push r15 pushfq sub rsp,64 mov rax,QWORD[120+r8] mov rbx,QWORD[248+r8] mov rsi,QWORD[8+r9] mov r11,QWORD[56+r9] mov r10d,DWORD[r11] lea r10,[r10*1+rsi] cmp rbx,r10 jb NEAR $L$common_seh_tail mov rax,QWORD[152+r8] mov r10d,DWORD[4+r11] lea r10,[r10*1+rsi] cmp rbx,r10 jae NEAR $L$common_seh_tail lea rax,[((128+24+48))+rax] lea rbx,[$L$mul_gather4_epilogue] cmp rbx,r10 jne NEAR $L$se_not_in_mul_gather4 lea rax,[176+rax] lea rsi,[((-48-168))+rax] lea rdi,[512+r8] mov ecx,20 DD 0xa548f3fc $L$se_not_in_mul_gather4: mov rbx,QWORD[((-8))+rax] mov rbp,QWORD[((-16))+rax] mov r12,QWORD[((-24))+rax] mov r13,QWORD[((-32))+rax] mov r14,QWORD[((-40))+rax] mov r15,QWORD[((-48))+rax] mov QWORD[144+r8],rbx mov QWORD[160+r8],rbp mov QWORD[216+r8],r12 mov QWORD[224+r8],r13 mov QWORD[232+r8],r14 mov QWORD[240+r8],r15 $L$common_seh_tail: mov rdi,QWORD[8+rax] mov rsi,QWORD[16+rax] mov QWORD[152+r8],rax mov QWORD[168+r8],rsi mov QWORD[176+r8],rdi mov rdi,QWORD[40+r9] mov rsi,r8 mov ecx,154 DD 0xa548f3fc mov rsi,r9 xor rcx,rcx mov rdx,QWORD[8+rsi] mov r8,QWORD[rsi] mov r9,QWORD[16+rsi] mov r10,QWORD[40+rsi] lea r11,[56+rsi] lea r12,[24+rsi] mov QWORD[32+rsp],r10 mov QWORD[40+rsp],r11 mov QWORD[48+rsp],r12 mov QWORD[56+rsp],rcx call QWORD[__imp_RtlVirtualUnwind] mov eax,1 add rsp,64 popfq pop r15 pop r14 pop r13 pop r12 pop rbp pop rbx pop rdi pop rsi DB 0F3h,0C3h ;repret section .pdata rdata align=4 ALIGN 4 DD $L$SEH_begin_rsaz_512_sqr wrt ..imagebase DD $L$SEH_end_rsaz_512_sqr wrt ..imagebase DD $L$SEH_info_rsaz_512_sqr wrt ..imagebase DD $L$SEH_begin_rsaz_512_mul wrt ..imagebase DD $L$SEH_end_rsaz_512_mul wrt ..imagebase DD $L$SEH_info_rsaz_512_mul wrt ..imagebase DD $L$SEH_begin_rsaz_512_mul_gather4 wrt ..imagebase DD $L$SEH_end_rsaz_512_mul_gather4 wrt ..imagebase DD $L$SEH_info_rsaz_512_mul_gather4 wrt ..imagebase DD $L$SEH_begin_rsaz_512_mul_scatter4 wrt ..imagebase DD $L$SEH_end_rsaz_512_mul_scatter4 wrt ..imagebase DD $L$SEH_info_rsaz_512_mul_scatter4 wrt ..imagebase DD $L$SEH_begin_rsaz_512_mul_by_one wrt ..imagebase DD $L$SEH_end_rsaz_512_mul_by_one wrt ..imagebase DD $L$SEH_info_rsaz_512_mul_by_one wrt ..imagebase DD $L$SEH_begin_rsaz_512_gather4 wrt ..imagebase DD $L$SEH_end_rsaz_512_gather4 wrt ..imagebase DD $L$SEH_info_rsaz_512_gather4 wrt ..imagebase section .xdata rdata align=8 ALIGN 8 $L$SEH_info_rsaz_512_sqr: DB 9,0,0,0 DD se_handler wrt ..imagebase DD $L$sqr_body wrt ..imagebase,$L$sqr_epilogue wrt ..imagebase $L$SEH_info_rsaz_512_mul: DB 9,0,0,0 DD se_handler wrt ..imagebase DD $L$mul_body wrt ..imagebase,$L$mul_epilogue wrt ..imagebase $L$SEH_info_rsaz_512_mul_gather4: DB 9,0,0,0 DD se_handler wrt ..imagebase DD $L$mul_gather4_body wrt ..imagebase,$L$mul_gather4_epilogue wrt ..imagebase $L$SEH_info_rsaz_512_mul_scatter4: DB 9,0,0,0 DD se_handler wrt ..imagebase DD $L$mul_scatter4_body wrt ..imagebase,$L$mul_scatter4_epilogue wrt ..imagebase $L$SEH_info_rsaz_512_mul_by_one: DB 9,0,0,0 DD se_handler wrt ..imagebase DD $L$mul_by_one_body wrt ..imagebase,$L$mul_by_one_epilogue wrt ..imagebase $L$SEH_info_rsaz_512_gather4: DB 0x01,0x46,0x16,0x00 DB 0x46,0xf8,0x09,0x00 DB 0x3d,0xe8,0x08,0x00 DB 0x34,0xd8,0x07,0x00 DB 0x2e,0xc8,0x06,0x00 DB 0x28,0xb8,0x05,0x00 DB 0x22,0xa8,0x04,0x00 DB 0x1c,0x98,0x03,0x00 DB 0x16,0x88,0x02,0x00 DB 0x10,0x78,0x01,0x00 DB 0x0b,0x68,0x00,0x00 DB 0x07,0x01,0x15,0x00
15.281609
81
0.704313
35b5b9a0d4ca09790fecf8229ec9b23a05d941da
369
asm
Assembly
oeis/324/A324267.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/324/A324267.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/324/A324267.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A324267: a(n) = 11*7^(5*n). ; Submitted by Christian Krause ; 11,184877,3107227739,52223176609373,877714929273732011,14751754816303613908877,247932743197614838966495739,4167005614922312598509893885373,70034863369999307843155786531464011,1177075948659578366919919304234315632877,19783115469121533612823083746266142841763739 mov $2,16807 pow $2,$0 mov $0,$2 mul $0,11
41
262
0.853659
d6d1abc429a0f02e35ec90452acc50e5480a065e
806
asm
Assembly
oeis/037/A037757.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/037/A037757.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/037/A037757.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A037757: Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 2,3,1,0. ; Submitted by Jon Maiga ; 2,23,231,2310,23102,231023,2310231,23102310,231023102,2310231023,23102310231,231023102310,2310231023102,23102310231023,231023102310231,2310231023102310,23102310231023102,231023102310231023,2310231023102310231,23102310231023102310,231023102310231023102,2310231023102310231023,23102310231023102310231,231023102310231023102310,2310231023102310231023102,23102310231023102310231023,231023102310231023102310231,2310231023102310231023102310,23102310231023102310231023102,231023102310231023102310231023 add $0,1 mov $2,2 lpb $0 mov $3,$2 lpb $3 add $2,2 mod $3,5 sub $3,1 add $4,1 lpe sub $0,1 add $2,2 mul $4,10 lpe mov $0,$4 div $0,10
38.380952
496
0.808933
b65f50dfa59650ca75d070c5b2416546f0415351
466
asm
Assembly
testcode/test_sti.asm
1justinbarnett/ece411-sp2017
ee0d07724f717e7ab8ba8a6277a2e57c985cf42c
[ "CC0-1.0" ]
null
null
null
testcode/test_sti.asm
1justinbarnett/ece411-sp2017
ee0d07724f717e7ab8ba8a6277a2e57c985cf42c
[ "CC0-1.0" ]
null
null
null
testcode/test_sti.asm
1justinbarnett/ece411-sp2017
ee0d07724f717e7ab8ba8a6277a2e57c985cf42c
[ "CC0-1.0" ]
null
null
null
ORIGIN 4x0000 SEGMENT CodeSegment: LEA R1, GOOD NOP NOP NOP NOP NOP NOP NOP LDR R2, R1, 0 LEA R1, VALUE1 NOP NOP NOP NOP NOP NOP NOP STI R2, R1, 1 ; Value 4x600D should be in VALUE3 LEA R1, VALUE3 NOP NOP NOP NOP NOP NOP NOP LDR R0, R1, 0 ; R0 should contain the value 4x600D ENDLOOP: BRnzp ENDLOOP NOP NOP NOP NOP NOP NOP NOP SEGMENT DATA: GOOD: DATA2 4x600D VALUE1: DATA2 VALUE2 VALUE2: DATA2 VALUE3 VALUE3: DATA2 4x0000
8.792453
37
0.688841
687440ebe06cb94215a0248e9821dee6606564b5
815
asm
Assembly
oeis/196/A196700.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/196/A196700.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/196/A196700.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A196700: Number of n X 1 0..4 arrays with each element x equal to the number of its horizontal and vertical neighbors equal to 3,1,0,4,2 for x=0,1,2,3,4. ; Submitted by Christian Krause ; 1,2,4,6,12,22,40,74,136,250,460,846,1556,2862,5264,9682,17808,32754,60244,110806,203804,374854,689464,1268122,2332440,4290026,7890588,14513054,26693668,49097310,90304032,166095010,305496352,561895394,1033486756,1900878502,3496260652,6430625910,11827765064,21754651626,40013042600,73595459290,135363153516,248971655406,457930268212,842265077134,1549167000752,2849362346098,5240794423984,9639323770834,17729480540916,32609598735734,59978403047484,110317482324134,202905484107352,373201369478970 mov $2,1 mov $3,1 mov $4,1 lpb $0 sub $0,1 add $2,$1 add $1,$4 mov $4,$2 add $2,$3 mov $3,$1 sub $4,$1 lpe mov $0,$2
45.277778
494
0.784049
48d438701797e30e41c61c89a0328a261d7d85bb
5,884
asm
Assembly
libsrc/sprites/software/sp1/zx81hr/updater/sp1_Initialize_callee.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/sprites/software/sp1/zx81hr/updater/sp1_Initialize_callee.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/sprites/software/sp1/zx81hr/updater/sp1_Initialize_callee.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void __CALLEE__ sp1_Initialize_callee(uchar iflag, uchar tile) ; 02.2008 aralbrec, Sprite Pack v3.0 ; zx81 hi-res version INCLUDE "zx81hr/customize.asm" SECTION code_sprite_sp1 PUBLIC sp1_Initialize_callee PUBLIC ASMDISP_SP1_INITIALIZE_CALLEE EXTERN base_graphics EXTERN zx81toasc PUBLIC SP1V_DISPORIGX PUBLIC SP1V_DISPORIGY PUBLIC SP1V_DISPWIDTH PUBLIC SP1V_DISPHEIGHT PUBLIC SP1V_PIXELBUFFER PUBLIC SP1V_TILEARRAY PUBLIC SP1V_UPDATEARRAY PUBLIC SP1V_ROTTBL PUBLIC SP1V_UPDATELISTH PUBLIC SP1V_UPDATELISTT PUBLIC SP1V_TEMP_IX PUBLIC SP1V_TEMP_IY PUBLIC SP1V_TEMP_AF .sp1_Initialize_callee pop bc pop hl pop de ld a,e push bc .asmentry ; 1. Constructs the rotation table if SP1_IFLAG_MAKE_ROTTBL flag set ; 2. Initializes tile array so that ROM character set is used by ; default - if SP1_IFLAG_OVERWRITE_TILES flag is set will not alter ; graphic pointers for character codes set previously (any non-zero ; pointer is not touched) ; 3. Resets the invalidated list to empty ; 4. Resets the update array, generating display file addresses for ; each char square if SP1_IFLAG_OVERWRITE_DFILE flag is set ; ; enter : hl= startup background tile ; a = flag, bit 0 = 1 if rotation table needed, bit 1 = 1 to overwrite all tile defs ; bit 2 = 1 to overwrite screen addresses in update structs ; used : af, bc, de, hl .SP1Initialize push hl ; save tile bit 0,a jr z, norottbl ; if flag bit not set, do not construct rotation table ; construct the rotation table ld c,7 ; rotate by c bits push af .rottbllp ld a,c add a,a or SP1V_ROTTBL/256 ld h,a ld l,0 .entrylp ld b,c ld e,l xor a .rotlp srl e rra djnz rotlp ld (hl),e inc h ld (hl),a dec h inc l jp nz, entrylp dec c jp nz, rottbllp pop af .norottbl ; Initialize tile array to point to characters in ROM ; The problem here is that the zx81 character set is not ; in ascii sequence and the bitmaps stored in ROM are in ; the zx81 character set sequence. So here we step through ; all 64 bitmap definitions, convert the associated zx81 ; code (0-63) to an ascii code and then store the bitmap ; address for that ascii code into the tile map. ; ; The zx81 does not contain bitmap definitions for lower ; case letters so in the second phase we copy the bitmaps ; for the upper case letters into the lower case tile maps. ; This way, initially, all alpha chars both upper and lower ; case will at least display as upper case letters. ; a = flag ld c,a ld b,64 ld d,SP1V_TILEARRAY/256 ld hl,$1e00 ; zx81 rom char bitmaps .tileloop ld a,64 sub b cp 11 jr c, codeok ; if it's a block graphic, leave in 0-10 call zx81toasc+1 ; convert zx81 code in A to ascii .codeok ld e,a ; de = tile array entry for ascii code ex de,hl ; hl = tile array entry, de = zx81 rom bitmap ld a,(hl) ; if a tile address is already present (ie non-zero entry) inc h ; then we will skip it bit 1,c jr nz, overwrite ; unless overwrite flag set or (hl) jr nz, tilepresent .overwrite ld (hl),d dec h ld (hl),e inc h .tilepresent dec h ld a,8 add a,e ld e,a ld a,0 adc a,d ld d,a ex de,hl djnz tileloop ; now copy upper case tiles to lower case tiles ld de,SP1V_TILEARRAY + 'A' ; tile entry for 'A' ld hl,SP1V_TILEARRAY + 'a' ; tile entry for 'a' ld b,26 ; 26 letters in the english alphabet .tileloop2 ld a,(hl) ; if a tile address is already present (ie non-zero entry) inc h ; then we will skip it bit 1,c jr nz, overwrite2 ; unless overwrite flag set or (hl) jr nz, tilepresent2 .overwrite2 inc d ld a,(de) ld (hl),a dec h dec d ld a,(de) ld (hl),a inc h .tilepresent2 dec h inc hl inc de djnz tileloop2 ; init the invalidated list ld hl,SP1V_UPDATELISTH ; this variable points at a dummy struct sp1_update that is ld (SP1V_UPDATELISTT),hl ld hl,0 ld (SP1V_UPDATELISTH+5),hl ; nothing in invalidate list ; initialize the update array pop de ; de = tile code ld b,SP1V_DISPORIGY ; b = current row coord ld hl,SP1V_UPDATEARRAY ; hl = current struct sp1_update bit 2,c push af .rowloop ld c,SP1V_DISPORIGX ; c = current col coord .colloop ld (hl),1 ; # of occluding sprites in this tile + 1 inc hl ld (hl),e ; write tile code inc hl ld (hl),0 inc hl ld (hl),0 inc hl ld (hl),0 ; no sprites in the tile inc hl ld (hl),0 inc hl ld (hl),0 ; not in invalidated list inc hl pop af jr z, skipscrnaddr push af ld a,(base_graphics) ; compute screen address for char coord (b,c) add a,c ld (hl),a inc hl ld a,(base_graphics + 1) adc a,b ld (hl),a .rejoinscrnaddr inc hl ; hl points at next struct sp1_update inc c ; next column ld a,c cp SP1V_DISPORIGX + SP1V_DISPWIDTH jr c, colloop inc b ; next row ld a,b cp SP1V_DISPORIGY + SP1V_DISPHEIGHT jr c, rowloop pop af ret .skipscrnaddr push af inc hl jp rejoinscrnaddr DEFC ASMDISP_SP1_INITIALIZE_CALLEE = asmentry - sp1_Initialize_callee
22.203774
95
0.603161
52c35a8fe0a05336d43a6d79a7cce03cb5f94371
1,274
asm
Assembly
test/asm_com/jmp2.asm
nigelperks/BasicAssembler
13dcc861254fa6c19f1d450682b4495bbebcf934
[ "MIT" ]
null
null
null
test/asm_com/jmp2.asm
nigelperks/BasicAssembler
13dcc861254fa6c19f1d450682b4495bbebcf934
[ "MIT" ]
null
null
null
test/asm_com/jmp2.asm
nigelperks/BasicAssembler
13dcc861254fa6c19f1d450682b4495bbebcf934
[ "MIT" ]
null
null
null
IDEAL SEGMENT image ORG 0100h ASSUME CS:image, DS:image, SS:image, ES:image start: jmp ahead ; max short forward nop behind: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop ahead: jmp behind ; max short behind ; end ENDS image END start
8.666667
49
0.409733
29ffb6b9b57006c335246d56607dcefcad9a1ced
217
asm
Assembly
data/mapHeaders/ssanne5.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
16
2018-08-28T21:47:01.000Z
2022-02-20T20:29:59.000Z
data/mapHeaders/ssanne5.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
5
2019-04-03T19:53:11.000Z
2022-03-11T22:49:34.000Z
data/mapHeaders/ssanne5.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
2
2019-12-09T19:46:02.000Z
2020-12-05T21:36:30.000Z
SSAnne5_h: db SHIP ; tileset db SS_ANNE_5_HEIGHT, SS_ANNE_5_WIDTH ; dimensions (y, x) dw SSAnne5Blocks, SSAnne5TextPointers, SSAnne5Script ; blocks, texts, scripts db $00 ; connections dw SSAnne5Object ; objects
31
78
0.778802
e847565cfaf7b00579af4206deaf46307049d0dd
296
asm
Assembly
programs/oeis/027/A027766.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/027/A027766.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/027/A027766.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A027766: (n+1)*C(n+1,6). ; 6,49,224,756,2100,5082,11088,22308,42042,75075,128128,210392,334152,515508,775200,1139544,1641486,2321781,3230304,4427500,5985980,7992270,10548720,13775580,17813250,22824711,28998144,36549744,45726736,56810600,70120512,86017008 add $0,6 mov $1,$0 bin $1,6 mul $0,$1
37
229
0.773649
f43eeaa1f034e9d3a65a3a3ee7a1804f2d5e71a6
745
asm
Assembly
oeis/137/A137781.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/137/A137781.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/137/A137781.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A137781: a(n) = (2^prime(n) + 2^prime(n+1)) / 4. ; Submitted by Christian Krause ; 3,10,40,544,2560,34816,163840,2228224,136314880,671088640,34896609280,584115552256,2748779069440,37383395344384,2286984185774080,146366987889541120,720575940379279360,37469948899722526720,627189298506124754944,2951479051793528258560,153476910693263469445120,2568967366681086996250624,157160356549901792711802880,39768823762042841331134365696,673439381371246869545123577856,3169126500570573503741758013440,43100120407759799650887908982784,202824096036516704239472512860160 seq $0,124669 ; Product of successive primes minus 2. add $0,1 seq $0,328337 ; The number whose binary indices are the nontrivial divisors of n (greater than 1 and less than n). div $0,2
82.777778
473
0.851007
afdf0dd1bc31fd9e5faaa7a3e30f10be26875663
10,291
asm
Assembly
testbins/hh1.asm
lwerdna/debugger
d792e8f02859280a07196485caa0a732140dcbe6
[ "MIT" ]
155
2020-02-12T21:25:43.000Z
2022-03-30T04:33:16.000Z
testbins/hh1.asm
lwerdna/debugger
d792e8f02859280a07196485caa0a732140dcbe6
[ "MIT" ]
133
2020-02-13T15:25:11.000Z
2022-03-22T02:17:22.000Z
testbins/hh1.asm
lwerdna/debugger
d792e8f02859280a07196485caa0a732140dcbe6
[ "MIT" ]
19
2020-02-13T23:26:37.000Z
2022-01-28T09:20:43.000Z
; ; hh1.nasm: 664-byte, tiny hello-world Win32 PE .exe ; by pts@fazekas.hu at Sat Jan 13 11:53:58 CET 2018 ; ; How to compile hh1.exe: ; ; $ nasm -f bin -o hh1.exe hh1.nasm ; $ chmod 755 hh1.exe # For QEMU Samba server. ; $ ndisasm -b 32 -e 0x200 -o 0x403000 hh1.exe ; ; hh1.asm was inspired by the 268-byte .exe on ; https://www.codejuggle.dj/creating-the-smallest-possible-windows-executable-using-assembly-language/ ; . The fundamental difference is that hh1.exe works on Windows XP ... Windows ; 10, while the program above doesn't work on Windows XP. ; ; The generated hh1.exe works on: ; ; * Wine 1.6.2 on Linux. ; * Windows XP SP3, 32-bit: Microsoft Windows XP [Version 5.1.2600] ; * Windows 10 64-bit: Microsoft Windows [Version 10.0.16299.192] ; ; Output .exe file size in bytes (approximately): ; ; len(text_bytes) + len(data_bytes) + len(rodata_bytes) + ; + 384 ; + sum(len(name) for name in imported_names) + 2 * len(imported_names) - 1 ; + 8 * len(imported_names) + 6 ; + sum(len(name) for name in library_names) + len(library_names) ; + 20 * len(library_names) ; ; Assumptions: ; ; * len(imported_names) >= 1: ['ExitProcess'] ; * len(library_names) >= 1: ['kernel32'] ; bits 32 imagebase equ 0x400000 ; Default base since Windows 95. textbase equ imagebase + 0x3000 file_alignment equ 0x200 bits 32 org 0 ; Can be anything, this file doesn't depend on it. _filestart: ;_text: IMAGE_DOS_HEADER: ; Truncated, breaks file(1) etc. db 'MZ' times 10 db 'x' IMAGE_NT_HEADERS: Signature: dw 'PE', 0 IMAGE_FILE_HEADER: Machine: dw 0x14c ; IMAGE_FILE_MACHINE_I386 NumberOfSections: dw (_headers_end - _sechead) / 40 ; Windows XP needs >= 3. TimeDateStamp: dd 0x00000000 PointerToSymbolTable: dd 0x00000000 NumberOfSymbols: dd 0x00000000 SizeOfOptionalHeader: dw _datadir_end - _opthd ; Windows XP needs >= 0x78. Characteristics: dw 0x030f _opthd: IMAGE_OPTIONAL_HEADER32: Magic: dw 0x10b ; IMAGE_NT_OPTIONAL_HDR32_MAGIC MajorLinkerVersion: db 0 MinorLinkerVersion: db 0 SizeOfCode: dd 0x00000000 SizeOfInitializedData: dd 0x00000000 SizeOfUninitializedData: dd 0x00000000 AddressOfEntryPoint: dd (textbase - imagebase) + (_entry - _text) BaseOfCode: dd 0x00000000 BaseOfData: dd (IMAGE_NT_HEADERS - _filestart) ; Overlaps with: IMAGE_DOS_HEADER.e_lfanew. ImageBase: dd imagebase SectionAlignment: dd 0x1000 ; Minimum value for Windows XP. %if file_alignment == 0 || file_alignment & (file_alignment - 1) %fatal Invalid file_alignment, must be a power of 2. %endif %if file_alignment < 0x200 %fatal Windows XP needs file_alignment >= 0x200 %endif FileAlignment: dd file_alignment ; Minimum value for Windows XP. MajorOperatingSystemVersion: dw 4 MinorOperatingSystemVersion: dw 0 MajorImageVersion: dw 1 MinorImageVersion: dw 0 MajorSubsystemVersion: dw 4 MinorSubsystemVersion: dw 0 Win32VersionValue: dd 0 SizeOfImage: dd (textbase - imagebase) + (_eof + bss_size - _text) ; Wine rounds it up to a multiple of 0x1000, and loads and maps that much. SizeOfHeaders: dd _headers_end - _filestart ; Windows XP needs > 0. CheckSum: dd 0 Subsystem: dw 3 ; IMAGE_SUBSYSTEM_WINDOWS_CUI; gcc -mconsole DllCharacteristics: dw 0 SizeOfStackReserve: dd 0x00100000 SizeOfStackCommit: dd 0x00001000 SizeOfHeapReserve: dd 0 SizeOfHeapCommit: dd 0 LoaderFlags: dd 0 ; If we hardcode 2 here, on Windows XP we can put arbitrary bytes to ; IMAGE_DIRECTORY_ENTRY_RESOURCE.VirtualAddress and .Size. If we put ; 3 here (autogenerated), then the values must be 0. ;NumberOfRvaAndSizes: dd (_datadir_end - _datadir) / 8 ; Number of IMAGE_DATA_DIRECTORY entries below. NumberOfRvaAndSizes: dd 2 _datadir: DataDirectory: IMAGE_DIRECTORY_ENTRY_EXPORT: .VirtualAddress: dd 0x00000000 .Size: dd 0x00000000 IMAGE_DIRECTORY_ENTRY_IMPORT: .VirtualAddress: dd (textbase - imagebase) + (_idescs - _text) .Size: dd _idata_data_end - _idata IMAGE_DIRECTORY_ENTRY_RESOURCE: .VirtualAddress_AndSize: db 'tiny.exe' %if 0 ; Changing all 0x78787878 to 0 below may fix startup errors. IMAGE_DIRECTORY_ENTRY_EXCEPTION: .VirtualAddress: dd 0x78787878 .Size: dd 0x78787878 IMAGE_DIRECTORY_ENTRY_SECURITY: .VirtualAddress: dd 0x78787878 .Size: dd 0x78787878 IMAGE_DIRECTORY_ENTRY_BASERELOC: .VirtualAddress: dd 0x78787878 .Size: dd 0x78787878 IMAGE_DIRECTORY_ENTRY_DEBUG: .VirtualAddress: dd 0x78787878 .Size: dd 0x00000000 IMAGE_DIRECTORY_ENTRY_ARCHITECTURE: .VirtualAddress: dd 0x00000000 .Size: dd 0x00000000 IMAGE_DIRECTORY_ENTRY_GLOBALPTR: .VirtualAddress: dd 0x00000000 .Size: dd 0x78787878 IMAGE_DIRECTORY_ENTRY_TLS: .VirtualAddress: dd 0x78787878 .Size: dd 0x78787878 IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG: .VirtualAddress: dd 0x78787878 .Size: dd 0x78787878 IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT: .VirtualAddress: dd 0x78787878 .Size: dd 0x78787878 IMAGE_DIRECTORY_ENTRY_IAT: .VirtualAddress: dd 0x78787878 .Size: dd 0x78787878 IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT: .VirtualAddress: dd 0x78787878 .Size: dd 0x78787878 Missing: IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR: .VirtualAddress: dd 0x78787878 .Size: dd 0x78787878 IMAGE_DIRECTORY_ENTRY_RESERVED: .VirtualAddress: dd 0x78787878 .Size: dd 0x78787878 %endif _datadir_end: _sechead: IMAGE_SECTION_HEADER__0: .Name: db '.dummy1', 0 .VirtualSize: dd 0x000000001 ; Must be positive for Windows XP. .VirtualAddress: dd 0x1000 ; Must be positive and divisible by 0x1000 for Windows XP. .SizeOfRawData: dd 0x00000000 .PointerToRawData: dd 0x00000000 .PointerToRelocations: dd 0 .PointerToLineNumbers: dd 0 .NumberOfRelocations: dw 0 .NumberOfLineNumbers: dw 0 .Characteristics: dd 0xc0300040 IMAGE_SECTION_HEADER__1: .Name: db '.dummy2', 0 .VirtualSize: dd 0x00000001 ; Must be positive for Windows XP. .VirtualAddress: dd 0x2000 ; Must be positive, divisible by 0x1000, and larger then the prev .VirtualAddress for Windows XP. .SizeOfRawData: dd 0x00000000 .PointerToRawData: dd 0x00000000 .PointerToRelocations: dd 0 .PointerToLineNumbers: dd 0 .NumberOfRelocations: dw 0 .NumberOfLineNumbers: dw 0 .Characteristics: dd 0xc0300040 IMAGE_SECTION_HEADER__2: .Name: db '.text', 0, 0, 0 .VirtualSize: dd (_eof - _text) + bss_size %if (textbase - imagebase) & 0xfff %fatal _text doesn't start at page boundary, needed by Windows XP. %endif %if (textbase - imagebase) <= 0x2000 %fatal _text doesn't start later than the previous sections, needed by Windows XP. %endif .VirtualAddress: dd textbase - imagebase .SizeOfRawData: dd _eof - _text .PointerToRawData: dd _text - _filestart .PointerToRelocations: dd 0 .PointerToLineNumbers: dd 0 .NumberOfRelocations: dw 0 .NumberOfLineNumbers: dw 0 .Characteristics: dd 0xe0300020 _headers_end: ; We can check it only this late, when _headers_end is defined. %if (_headers_end - _sechead) % 40 != 0 %fatal Multiples of IMAGE_SECTION_HEADER needed. %endif %if (_headers_end - _sechead) / 40 < 3 %fatal Windows XP needs at least 3 sections. %endif times 0x200 - ($-$$) db 'x' ;times 0x100 db 'y' ; Doesn't work, _text is not aligned properly. ;times 0x200 db 'y' ; Works, making the .exe larger. _text: _entry: ; Arguments pushed in reverse order, popped by the callee. ; WINBASEAPI HANDLE WINAPI GetStdHandle (DWORD nStdHandle); ; HANDLE hfile = GetStdHandle(STD_OUTPUT_HANDLE); push byte -11 ; STD_OUTPUT_HANDLE call [textbase + (__imp__GetStdHandle@4 - _text)] ; Arguments pushed in reverse order, popped by the callee. ; WINBASEAPI WINBOOL WINAPI WriteFile (HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); ; DWORD bw; push eax ; Value does't matter. mov ecx, esp push byte 0 ; lpOverlapped push ecx ; lpNumberOfBytesWritten = &dw push byte (_msg_end - _msg) ; nNumberOfBytesToWrite push textbase + (_msg - _text) ; lpBuffer push eax ; hFile = hfile call [textbase + (__imp__WriteFile@20 - _text)] ;pop eax ; This would pop dw. Needed for cleanup. ; Arguments pushed in reverse order, popped by the callee. ; WINBASEAPI DECLSPEC_NORETURN VOID WINAPI ExitProcess(UINT uExitCode); push byte 0 ; uExitCode call [textbase + (__imp__ExitProcess@4 - _text)] _data: _msg: db 'Hello, World!', 13, 10 _msg_end: ; This can be before of after _entry, it doesn't matter. _idata: ; Relocations, IMAGE_DIRECTORY_ENTRY_IMPORT data. _hintnames: dd (textbase - imagebase) + (IMAGE_IMPORT_BY_NAME_ExitProcess - _text) dd (textbase - imagebase) + (IMAGE_IMPORT_BY_NAME_GetStdHandle - _text) dd (textbase - imagebase) + (IMAGE_IMPORT_BY_NAME_WriteFile - _text) dd 0 ; Marks end-of-list. _iat: ; Modified by the PE loader before jumping to _entry. __imp__ExitProcess@4: dd (textbase - imagebase) + (IMAGE_IMPORT_BY_NAME_ExitProcess - _text) __imp__GetStdHandle@4: dd (textbase - imagebase) + (IMAGE_IMPORT_BY_NAME_GetStdHandle - _text) __imp__WriteFile@20: dd (textbase - imagebase) + (IMAGE_IMPORT_BY_NAME_WriteFile - _text) dd 0 ; Marks end-of-list. IMAGE_IMPORT_BY_NAME_ExitProcess: .Hint: dw 0 .Name: db 'ExitProcess' ; Terminated by the subsequent .Hint. IMAGE_IMPORT_BY_NAME_GetStdHandle: .Hint: dw 0 .Name: db 'GetStdHandle' ; Terminated by the subsequent .Hint. IMAGE_IMPORT_BY_NAME_WriteFile: .Hint: dw 0 .Name: db 'WriteFile' ; Terminated below. db 0 ; Terminates last .Name. _KERNEL32_str: db 'kernel32', 0 ; 'KERNEL32' and 'KERNEL32.dll' also work. _idescs: IMAGE_IMPORT_DESCRIPTOR__0: .OriginalFirstThunk: dd (textbase - imagebase) + (_hintnames - _text) .TimeDateStamp: dd 0 .ForwarderChain: dd 0 .Name: dd (textbase - imagebase) + (_KERNEL32_str - _text) .FirstThunk: dd (textbase - imagebase) + (_iat - _text) _idata_data_end: _eof: ;bss_size equ 0 ;IMAGE_IMPORT_DESCRIPTOR__1: ; Empty, marks end-of-list. ;.OriginalFirstThunk: dd 0 ;.TimeDateStamp: dd 0 ;.ForwarderChain: dd 0 ;.Name: dd 0 ;.FirstThunk: dd 0 ;_idata_end: bss_size equ 20 ; _idata_end - _eof %if (_text - _filestart) & (file_alignment - 1) %fatal _text is not aligned to file_alignment, needed by Windows XP. %endif
34.884746
160
0.741522
e68e6b188eb0e6aa9a856fef1ad8200da9a3fa95
2,125
asm
Assembly
src/core/asm/x86/inst_0x0f10.asm
Hiroshi123/bin_tools
95929eb218a82e30c43ee5bd209301a24abebffa
[ "MIT" ]
null
null
null
src/core/asm/x86/inst_0x0f10.asm
Hiroshi123/bin_tools
95929eb218a82e30c43ee5bd209301a24abebffa
[ "MIT" ]
4
2019-02-27T05:41:26.000Z
2020-07-16T00:24:24.000Z
src/core/asm/x86/inst_0x0f10.asm
Hiroshi123/bin_tools
95929eb218a82e30c43ee5bd209301a24abebffa
[ "MIT" ]
null
null
null
default rel section .text global _0x0f10_mov_xmm global _0x0f11_mov_xmm global _0x0f12_mov_xmm global _0x0f13_mov_xmm global _0x0f14_mov_xmm global _0x0f15_mov_xmm ;; movhps global _0x0f16_mov_xmm global _0x0f17_mov_xmm global _0x0f18_hint_nop global _0x0f19_hint_nop global _0x0f1a_hint_nop global _0x0f1b_hint_nop global _0x0f1c_hint_nop global _0x0f1d_hint_nop global _0x0f1e_hint_nop global _0x0f1f_hint_nop %include "extern_for_inst.asm" _0x66_movupd: ret _do: add dword [_rip],1 call _get_mod_xmm_rm call _set_scale_index_base call _fetch_displacement_by_mod ;; db 0xeb,0xfe ret _0xf2_movsd: jmp _do _0xf3_movss: jmp _do _movups: ret ;;; 66/f2/f3/ ;;; movss(32)/movsd(64) is reg is not xmm register. ;;; movupps(d) will be m128 _0x0f10_mov_xmm: _0x0f11_mov_xmm: ;; jmp _do cmp byte [_context._data_prefix],0 jne _0x66_movupd ;; cmp byte [_context._repz],0 jne _0xf2_movsd ;; cmp byte [_context._repnz],0 jne _0xf3_movss jmp _movups ;; _0x0f11_mov_xmm: ;; db 0xeb,0xfe _0x0f12_mov_xmm: db 0xeb,0xfe _0x0f13_mov_xmm: db 0xeb,0xfe ;;; 0f14/0f15 is unpcklp(unpack and interleave) ;;; TODO needs to check UNPCKLPS(64bit) use non-xmm register _0x0f14_mov_xmm: jmp _do_xmm_xmm db 0xeb,0xfe _0x0f15_mov_xmm: jmp _do db 0xeb,0xfe ;;; this is also move _0x0f16_mov_xmm: db 0xeb,0xfe _0x0f17_mov_xmm: db 0xeb,0xfe ;;; 0x18 mightbe pretchnta(0/1/2/3) which prefetch data into caches _0x0f18_hint_nop: ret _0x0f19_hint_nop: ret _0x0f1a_hint_nop: ret _0x0f1b_hint_nop: ret _0x0f1c_hint_nop: ret _0x0f1d_hint_nop: ret _0x0f1e_hint_nop: ret _0x0f1f_hint_nop: ;; this is a bit complicated ;; meanwhile fetch 5byte ;; call _fetch8 add dword [_rip],1 mov rax,[_rip] mov byte al,[rax] cmp byte al,0x00 je _0x0f1f_hint_nop.b2 cmp byte al,0x80 jb _0x0f1f_hint_nop.b1 jg _0x0f1f_hint_nop.b00 cmp byte [_context._data_prefix],0xff jne _0x0f1f_hint_nop.b0 .b00: add dword [_rip],1 .b0: add dword [_rip],5 ret .b1: cmp byte al,0x40 je _0x0f1f_hint_nop.b11 add dword [_rip],1 .b11: add dword [_rip],2 ret .b2: add dword [_rip],1 ret
15.977444
67
0.759059
488f780e16eab031ee2e164f4b717ed170e5025b
1,420
asm
Assembly
programs/oeis/321/A321812.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/321/A321812.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/321/A321812.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A321812: Sum of 8th powers of odd divisors of n. ; 1,1,6562,1,390626,6562,5764802,1,43053283,390626,214358882,6562,815730722,5764802,2563287812,1,6975757442,43053283,16983563042,390626,37828630724,214358882,78310985282,6562,152588281251,815730722,282472589764,5764802,500246412962,2563287812,852891037442,1,1406622983684,6975757442,2251881546052,43053283,3512479453922,16983563042,5352824997764,390626,7984925229122,37828630724,11688200277602,214358882,16817731725158,78310985282,23811286661762,6562,33232936334403,152588281251,45774920334404,815730722,62259690411362,282472589764,83734152640132,5764802,111446140681604,500246412962,146830437604322,2563287812,191707312997282,852891037442,248193651944966,1,318645629011972,1406622983684,406067677556642,6975757442,513876685420484,2251881546052,645753531245762,43053283,806460091894082,3512479453922,1001284301569062,16983563042,1235736511671364,5352824997764,1517108809906562,390626,1853302661441605,7984925229122,2252292232139042,37828630724,2724912226538692,11688200277602,3282616961856644,214358882,3936588805702082,16817731725158,4702526097647044,78310985282,5596670987694404,23811286661762,6634221296844292,6562,7837433594376962,33232936334403,9228853610309606,152588281251 add $0,1 mov $2,$0 lpb $0 dif $2,2 mov $3,$2 mov $4,$0 cmp $4,0 add $0,$4 dif $3,$0 cmp $3,$2 cmp $3,0 mul $3,$0 sub $0,1 pow $3,8 add $1,$3 lpe add $1,1 mov $0,$1
64.545455
1,179
0.846479
8f6846af6c2ec9661eda390bed9681fbcc209e13
743,204
asm
Assembly
Lab Quiz 4/160050064-labquiz4/xv6/kernel.asm
vamsi3/IITB-Operating-Systems
dfe37adbb6eab69b3dbce299a1caee87acb1728f
[ "MIT" ]
6
2020-09-22T13:48:30.000Z
2022-01-28T12:21:27.000Z
Lab Quiz 4/160050064-labquiz4/xv6/kernel.asm
vamsi3/IITB-Operating-Systems
dfe37adbb6eab69b3dbce299a1caee87acb1728f
[ "MIT" ]
null
null
null
Lab Quiz 4/160050064-labquiz4/xv6/kernel.asm
vamsi3/IITB-Operating-Systems
dfe37adbb6eab69b3dbce299a1caee87acb1728f
[ "MIT" ]
3
2020-11-05T22:33:15.000Z
2021-03-13T21:40:39.000Z
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 a0 10 00 mov $0x10a000,%eax movl %eax, %cr3 8010001a: 0f 22 d8 mov %eax,%cr3 # Turn on paging. movl %cr0, %eax 8010001d: 0f 20 c0 mov %cr0,%eax orl $(CR0_PG|CR0_WP), %eax 80100020: 0d 00 00 01 80 or $0x80010000,%eax movl %eax, %cr0 80100025: 0f 22 c0 mov %eax,%cr0 # Set up the stack pointer. movl $(stack + KSTACKSIZE), %esp 80100028: bc c0 c5 10 80 mov $0x8010c5c0,%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 60 2e 10 80 mov $0x80102e60,%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 c5 10 80 mov $0x8010c5f4,%ebx struct buf head; } bcache; void binit(void) { 80100049: 83 ec 0c sub $0xc,%esp struct buf *b; initlock(&bcache.lock, "bcache"); 8010004c: 68 a0 75 10 80 push $0x801075a0 80100051: 68 c0 c5 10 80 push $0x8010c5c0 80100056: e8 e5 46 00 00 call 80104740 <initlock> //PAGEBREAK! // Create linked list of buffers bcache.head.prev = &bcache.head; 8010005b: c7 05 0c 0d 11 80 bc movl $0x80110cbc,0x80110d0c 80100062: 0c 11 80 bcache.head.next = &bcache.head; 80100065: c7 05 10 0d 11 80 bc movl $0x80110cbc,0x80110d10 8010006c: 0c 11 80 8010006f: 83 c4 10 add $0x10,%esp 80100072: ba bc 0c 11 80 mov $0x80110cbc,%edx 80100077: eb 09 jmp 80100082 <binit+0x42> 80100079: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100080: 89 c3 mov %eax,%ebx for(b = bcache.buf; b < bcache.buf+NBUF; b++){ b->next = bcache.head.next; b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); 80100082: 8d 43 0c lea 0xc(%ebx),%eax 80100085: 83 ec 08 sub $0x8,%esp //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++){ b->next = bcache.head.next; 80100088: 89 53 54 mov %edx,0x54(%ebx) b->prev = &bcache.head; 8010008b: c7 43 50 bc 0c 11 80 movl $0x80110cbc,0x50(%ebx) initsleeplock(&b->lock, "buffer"); 80100092: 68 a7 75 10 80 push $0x801075a7 80100097: 50 push %eax 80100098: e8 93 45 00 00 call 80104630 <initsleeplock> bcache.head.next->prev = b; 8010009d: a1 10 0d 11 80 mov 0x80110d10,%eax //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++){ 801000a2: 83 c4 10 add $0x10,%esp 801000a5: 89 da mov %ebx,%edx b->next = bcache.head.next; b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); bcache.head.next->prev = b; 801000a7: 89 58 50 mov %ebx,0x50(%eax) //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++){ 801000aa: 8d 83 5c 02 00 00 lea 0x25c(%ebx),%eax b->next = bcache.head.next; b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); bcache.head.next->prev = b; bcache.head.next = b; 801000b0: 89 1d 10 0d 11 80 mov %ebx,0x80110d10 //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++){ 801000b6: 3d bc 0c 11 80 cmp $0x80110cbc,%eax 801000bb: 75 c3 jne 80100080 <binit+0x40> b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); bcache.head.next->prev = b; bcache.head.next = b; } } 801000bd: 8b 5d fc mov -0x4(%ebp),%ebx 801000c0: c9 leave 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 18 sub $0x18,%esp 801000d9: 8b 75 08 mov 0x8(%ebp),%esi 801000dc: 8b 7d 0c mov 0xc(%ebp),%edi static struct buf* bget(uint dev, uint blockno) { struct buf *b; acquire(&bcache.lock); 801000df: 68 c0 c5 10 80 push $0x8010c5c0 801000e4: e8 57 47 00 00 call 80104840 <acquire> // Is the block already cached? for(b = bcache.head.next; b != &bcache.head; b = b->next){ 801000e9: 8b 1d 10 0d 11 80 mov 0x80110d10,%ebx 801000ef: 83 c4 10 add $0x10,%esp 801000f2: 81 fb bc 0c 11 80 cmp $0x80110cbc,%ebx 801000f8: 75 11 jne 8010010b <bread+0x3b> 801000fa: eb 24 jmp 80100120 <bread+0x50> 801000fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100100: 8b 5b 54 mov 0x54(%ebx),%ebx 80100103: 81 fb bc 0c 11 80 cmp $0x80110cbc,%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 } // Not cached; recycle an unused buffer. // Even if refcnt==0, B_DIRTY indicates a buffer is in use // because log.c has modified it but not yet committed it. for(b = bcache.head.prev; b != &bcache.head; b = b->prev){ 80100120: 8b 1d 0c 0d 11 80 mov 0x80110d0c,%ebx 80100126: 81 fb bc 0c 11 80 cmp $0x80110cbc,%ebx 8010012c: 75 0d jne 8010013b <bread+0x6b> 8010012e: eb 60 jmp 80100190 <bread+0xc0> 80100130: 8b 5b 50 mov 0x50(%ebx),%ebx 80100133: 81 fb bc 0c 11 80 cmp $0x80110cbc,%ebx 80100139: 74 55 je 80100190 <bread+0xc0> 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: 83 ec 0c sub $0xc,%esp 8010015d: 68 c0 c5 10 80 push $0x8010c5c0 80100162: e8 f9 47 00 00 call 80104960 <release> acquiresleep(&b->lock); 80100167: 8d 43 0c lea 0xc(%ebx),%eax 8010016a: 89 04 24 mov %eax,(%esp) 8010016d: e8 fe 44 00 00 call 80104670 <acquiresleep> 80100172: 83 c4 10 add $0x10,%esp bread(uint dev, uint blockno) { struct buf *b; b = bget(dev, blockno); if((b->flags & B_VALID) == 0) { 80100175: f6 03 02 testb $0x2,(%ebx) 80100178: 75 0c jne 80100186 <bread+0xb6> iderw(b); 8010017a: 83 ec 0c sub $0xc,%esp 8010017d: 53 push %ebx 8010017e: e8 6d 1f 00 00 call 801020f0 <iderw> 80100183: 83 c4 10 add $0x10,%esp } return b; } 80100186: 8d 65 f4 lea -0xc(%ebp),%esp 80100189: 89 d8 mov %ebx,%eax 8010018b: 5b pop %ebx 8010018c: 5e pop %esi 8010018d: 5f pop %edi 8010018e: 5d pop %ebp 8010018f: c3 ret release(&bcache.lock); acquiresleep(&b->lock); return b; } } panic("bget: no buffers"); 80100190: 83 ec 0c sub $0xc,%esp 80100193: 68 ae 75 10 80 push $0x801075ae 80100198: e8 d3 01 00 00 call 80100370 <panic> 8010019d: 8d 76 00 lea 0x0(%esi),%esi 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 10 sub $0x10,%esp 801001a7: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001aa: 8d 43 0c lea 0xc(%ebx),%eax 801001ad: 50 push %eax 801001ae: e8 5d 45 00 00 call 80104710 <holdingsleep> 801001b3: 83 c4 10 add $0x10,%esp 801001b6: 85 c0 test %eax,%eax 801001b8: 74 0f je 801001c9 <bwrite+0x29> panic("bwrite"); b->flags |= B_DIRTY; 801001ba: 83 0b 04 orl $0x4,(%ebx) iderw(b); 801001bd: 89 5d 08 mov %ebx,0x8(%ebp) } 801001c0: 8b 5d fc mov -0x4(%ebp),%ebx 801001c3: c9 leave bwrite(struct buf *b) { if(!holdingsleep(&b->lock)) panic("bwrite"); b->flags |= B_DIRTY; iderw(b); 801001c4: e9 27 1f 00 00 jmp 801020f0 <iderw> // Write b's contents to disk. Must be locked. void bwrite(struct buf *b) { if(!holdingsleep(&b->lock)) panic("bwrite"); 801001c9: 83 ec 0c sub $0xc,%esp 801001cc: 68 bf 75 10 80 push $0x801075bf 801001d1: e8 9a 01 00 00 call 80100370 <panic> 801001d6: 8d 76 00 lea 0x0(%esi),%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: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001e8: 83 ec 0c sub $0xc,%esp 801001eb: 8d 73 0c lea 0xc(%ebx),%esi 801001ee: 56 push %esi 801001ef: e8 1c 45 00 00 call 80104710 <holdingsleep> 801001f4: 83 c4 10 add $0x10,%esp 801001f7: 85 c0 test %eax,%eax 801001f9: 74 66 je 80100261 <brelse+0x81> panic("brelse"); releasesleep(&b->lock); 801001fb: 83 ec 0c sub $0xc,%esp 801001fe: 56 push %esi 801001ff: e8 cc 44 00 00 call 801046d0 <releasesleep> acquire(&bcache.lock); 80100204: c7 04 24 c0 c5 10 80 movl $0x8010c5c0,(%esp) 8010020b: e8 30 46 00 00 call 80104840 <acquire> b->refcnt--; 80100210: 8b 43 4c mov 0x4c(%ebx),%eax if (b->refcnt == 0) { 80100213: 83 c4 10 add $0x10,%esp panic("brelse"); releasesleep(&b->lock); acquire(&bcache.lock); b->refcnt--; 80100216: 83 e8 01 sub $0x1,%eax if (b->refcnt == 0) { 80100219: 85 c0 test %eax,%eax panic("brelse"); releasesleep(&b->lock); acquire(&bcache.lock); b->refcnt--; 8010021b: 89 43 4c mov %eax,0x4c(%ebx) if (b->refcnt == 0) { 8010021e: 75 2f jne 8010024f <brelse+0x6f> // no one is waiting for it. b->next->prev = b->prev; 80100220: 8b 43 54 mov 0x54(%ebx),%eax 80100223: 8b 53 50 mov 0x50(%ebx),%edx 80100226: 89 50 50 mov %edx,0x50(%eax) b->prev->next = b->next; 80100229: 8b 43 50 mov 0x50(%ebx),%eax 8010022c: 8b 53 54 mov 0x54(%ebx),%edx 8010022f: 89 50 54 mov %edx,0x54(%eax) b->next = bcache.head.next; 80100232: a1 10 0d 11 80 mov 0x80110d10,%eax b->prev = &bcache.head; 80100237: c7 43 50 bc 0c 11 80 movl $0x80110cbc,0x50(%ebx) b->refcnt--; if (b->refcnt == 0) { // no one is waiting for it. b->next->prev = b->prev; b->prev->next = b->next; b->next = bcache.head.next; 8010023e: 89 43 54 mov %eax,0x54(%ebx) b->prev = &bcache.head; bcache.head.next->prev = b; 80100241: a1 10 0d 11 80 mov 0x80110d10,%eax 80100246: 89 58 50 mov %ebx,0x50(%eax) bcache.head.next = b; 80100249: 89 1d 10 0d 11 80 mov %ebx,0x80110d10 } release(&bcache.lock); 8010024f: c7 45 08 c0 c5 10 80 movl $0x8010c5c0,0x8(%ebp) } 80100256: 8d 65 f8 lea -0x8(%ebp),%esp 80100259: 5b pop %ebx 8010025a: 5e pop %esi 8010025b: 5d pop %ebp b->prev = &bcache.head; bcache.head.next->prev = b; bcache.head.next = b; } release(&bcache.lock); 8010025c: e9 ff 46 00 00 jmp 80104960 <release> // Move to the head of the MRU list. void brelse(struct buf *b) { if(!holdingsleep(&b->lock)) panic("brelse"); 80100261: 83 ec 0c sub $0xc,%esp 80100264: 68 c6 75 10 80 push $0x801075c6 80100269: e8 02 01 00 00 call 80100370 <panic> 8010026e: 66 90 xchg %ax,%ax 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 28 sub $0x28,%esp 80100279: 8b 7d 08 mov 0x8(%ebp),%edi 8010027c: 8b 75 0c mov 0xc(%ebp),%esi uint target; int c; iunlock(ip); 8010027f: 57 push %edi 80100280: e8 cb 14 00 00 call 80101750 <iunlock> target = n; acquire(&cons.lock); 80100285: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) 8010028c: e8 af 45 00 00 call 80104840 <acquire> while(n > 0){ 80100291: 8b 5d 10 mov 0x10(%ebp),%ebx 80100294: 83 c4 10 add $0x10,%esp 80100297: 31 c0 xor %eax,%eax 80100299: 85 db test %ebx,%ebx 8010029b: 0f 8e 9a 00 00 00 jle 8010033b <consoleread+0xcb> while(input.r == input.w){ 801002a1: a1 a0 0f 11 80 mov 0x80110fa0,%eax 801002a6: 3b 05 a4 0f 11 80 cmp 0x80110fa4,%eax 801002ac: 74 24 je 801002d2 <consoleread+0x62> 801002ae: eb 58 jmp 80100308 <consoleread+0x98> if(myproc()->killed){ release(&cons.lock); ilock(ip); return -1; } sleep(&input.r, &cons.lock); 801002b0: 83 ec 08 sub $0x8,%esp 801002b3: 68 20 b5 10 80 push $0x8010b520 801002b8: 68 a0 0f 11 80 push $0x80110fa0 801002bd: e8 6e 3a 00 00 call 80103d30 <sleep> iunlock(ip); target = n; acquire(&cons.lock); while(n > 0){ while(input.r == input.w){ 801002c2: a1 a0 0f 11 80 mov 0x80110fa0,%eax 801002c7: 83 c4 10 add $0x10,%esp 801002ca: 3b 05 a4 0f 11 80 cmp 0x80110fa4,%eax 801002d0: 75 36 jne 80100308 <consoleread+0x98> if(myproc()->killed){ 801002d2: e8 a9 34 00 00 call 80103780 <myproc> 801002d7: 8b 40 24 mov 0x24(%eax),%eax 801002da: 85 c0 test %eax,%eax 801002dc: 74 d2 je 801002b0 <consoleread+0x40> release(&cons.lock); 801002de: 83 ec 0c sub $0xc,%esp 801002e1: 68 20 b5 10 80 push $0x8010b520 801002e6: e8 75 46 00 00 call 80104960 <release> ilock(ip); 801002eb: 89 3c 24 mov %edi,(%esp) 801002ee: e8 7d 13 00 00 call 80101670 <ilock> return -1; 801002f3: 83 c4 10 add $0x10,%esp 801002f6: b8 ff ff ff ff mov $0xffffffff,%eax } release(&cons.lock); ilock(ip); return target - n; } 801002fb: 8d 65 f4 lea -0xc(%ebp),%esp 801002fe: 5b pop %ebx 801002ff: 5e pop %esi 80100300: 5f pop %edi 80100301: 5d pop %ebp 80100302: c3 ret 80100303: 90 nop 80100304: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ilock(ip); return -1; } sleep(&input.r, &cons.lock); } c = input.buf[input.r++ % INPUT_BUF]; 80100308: 8d 50 01 lea 0x1(%eax),%edx 8010030b: 89 15 a0 0f 11 80 mov %edx,0x80110fa0 80100311: 89 c2 mov %eax,%edx 80100313: 83 e2 7f and $0x7f,%edx 80100316: 0f be 92 20 0f 11 80 movsbl -0x7feef0e0(%edx),%edx if(c == C('D')){ // EOF 8010031d: 83 fa 04 cmp $0x4,%edx 80100320: 74 39 je 8010035b <consoleread+0xeb> // caller gets a 0-byte result. input.r--; } break; } *dst++ = c; 80100322: 83 c6 01 add $0x1,%esi --n; 80100325: 83 eb 01 sub $0x1,%ebx if(c == '\n') 80100328: 83 fa 0a cmp $0xa,%edx // caller gets a 0-byte result. input.r--; } break; } *dst++ = c; 8010032b: 88 56 ff mov %dl,-0x1(%esi) --n; if(c == '\n') 8010032e: 74 35 je 80100365 <consoleread+0xf5> int c; iunlock(ip); target = n; acquire(&cons.lock); while(n > 0){ 80100330: 85 db test %ebx,%ebx 80100332: 0f 85 69 ff ff ff jne 801002a1 <consoleread+0x31> 80100338: 8b 45 10 mov 0x10(%ebp),%eax *dst++ = c; --n; if(c == '\n') break; } release(&cons.lock); 8010033b: 83 ec 0c sub $0xc,%esp 8010033e: 89 45 e4 mov %eax,-0x1c(%ebp) 80100341: 68 20 b5 10 80 push $0x8010b520 80100346: e8 15 46 00 00 call 80104960 <release> ilock(ip); 8010034b: 89 3c 24 mov %edi,(%esp) 8010034e: e8 1d 13 00 00 call 80101670 <ilock> return target - n; 80100353: 83 c4 10 add $0x10,%esp 80100356: 8b 45 e4 mov -0x1c(%ebp),%eax 80100359: eb a0 jmp 801002fb <consoleread+0x8b> } sleep(&input.r, &cons.lock); } c = input.buf[input.r++ % INPUT_BUF]; if(c == C('D')){ // EOF if(n < target){ 8010035b: 39 5d 10 cmp %ebx,0x10(%ebp) 8010035e: 76 05 jbe 80100365 <consoleread+0xf5> // Save ^D for next time, to make sure // caller gets a 0-byte result. input.r--; 80100360: a3 a0 0f 11 80 mov %eax,0x80110fa0 80100365: 8b 45 10 mov 0x10(%ebp),%eax 80100368: 29 d8 sub %ebx,%eax 8010036a: eb cf jmp 8010033b <consoleread+0xcb> 8010036c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100370 <panic>: release(&cons.lock); } void panic(char *s) { 80100370: 55 push %ebp 80100371: 89 e5 mov %esp,%ebp 80100373: 56 push %esi 80100374: 53 push %ebx 80100375: 83 ec 30 sub $0x30,%esp } static inline void cli(void) { asm volatile("cli"); 80100378: fa cli int i; uint pcs[10]; cli(); cons.locking = 0; 80100379: c7 05 54 b5 10 80 00 movl $0x0,0x8010b554 80100380: 00 00 00 // use lapiccpunum so that we can call panic from mycpu() cprintf("lapicid %d: panic: ", lapicid()); cprintf(s); cprintf("\n"); getcallerpcs(&s, pcs); 80100383: 8d 5d d0 lea -0x30(%ebp),%ebx 80100386: 8d 75 f8 lea -0x8(%ebp),%esi uint pcs[10]; cli(); cons.locking = 0; // use lapiccpunum so that we can call panic from mycpu() cprintf("lapicid %d: panic: ", lapicid()); 80100389: e8 62 23 00 00 call 801026f0 <lapicid> 8010038e: 83 ec 08 sub $0x8,%esp 80100391: 50 push %eax 80100392: 68 cd 75 10 80 push $0x801075cd 80100397: e8 c4 02 00 00 call 80100660 <cprintf> cprintf(s); 8010039c: 58 pop %eax 8010039d: ff 75 08 pushl 0x8(%ebp) 801003a0: e8 bb 02 00 00 call 80100660 <cprintf> cprintf("\n"); 801003a5: c7 04 24 0b 80 10 80 movl $0x8010800b,(%esp) 801003ac: e8 af 02 00 00 call 80100660 <cprintf> getcallerpcs(&s, pcs); 801003b1: 5a pop %edx 801003b2: 8d 45 08 lea 0x8(%ebp),%eax 801003b5: 59 pop %ecx 801003b6: 53 push %ebx 801003b7: 50 push %eax 801003b8: e8 a3 43 00 00 call 80104760 <getcallerpcs> 801003bd: 83 c4 10 add $0x10,%esp for(i=0; i<10; i++) cprintf(" %p", pcs[i]); 801003c0: 83 ec 08 sub $0x8,%esp 801003c3: ff 33 pushl (%ebx) 801003c5: 83 c3 04 add $0x4,%ebx 801003c8: 68 e1 75 10 80 push $0x801075e1 801003cd: e8 8e 02 00 00 call 80100660 <cprintf> // use lapiccpunum so that we can call panic from mycpu() cprintf("lapicid %d: panic: ", lapicid()); cprintf(s); cprintf("\n"); getcallerpcs(&s, pcs); for(i=0; i<10; i++) 801003d2: 83 c4 10 add $0x10,%esp 801003d5: 39 f3 cmp %esi,%ebx 801003d7: 75 e7 jne 801003c0 <panic+0x50> cprintf(" %p", pcs[i]); panicked = 1; // freeze other CPU 801003d9: c7 05 58 b5 10 80 01 movl $0x1,0x8010b558 801003e0: 00 00 00 801003e3: eb fe jmp 801003e3 <panic+0x73> 801003e5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801003e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801003f0 <consputc>: } void consputc(int c) { if(panicked){ 801003f0: 8b 15 58 b5 10 80 mov 0x8010b558,%edx 801003f6: 85 d2 test %edx,%edx 801003f8: 74 06 je 80100400 <consputc+0x10> 801003fa: fa cli 801003fb: eb fe jmp 801003fb <consputc+0xb> 801003fd: 8d 76 00 lea 0x0(%esi),%esi crt[pos] = ' ' | 0x0700; } void consputc(int c) { 80100400: 55 push %ebp 80100401: 89 e5 mov %esp,%ebp 80100403: 57 push %edi 80100404: 56 push %esi 80100405: 53 push %ebx 80100406: 89 c3 mov %eax,%ebx 80100408: 83 ec 0c sub $0xc,%esp cli(); for(;;) ; } if(c == BACKSPACE){ 8010040b: 3d 00 01 00 00 cmp $0x100,%eax 80100410: 0f 84 b8 00 00 00 je 801004ce <consputc+0xde> uartputc('\b'); uartputc(' '); uartputc('\b'); } else uartputc(c); 80100416: 83 ec 0c sub $0xc,%esp 80100419: 50 push %eax 8010041a: e8 41 5d 00 00 call 80106160 <uartputc> 8010041f: 83 c4 10 add $0x10,%esp } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80100422: bf d4 03 00 00 mov $0x3d4,%edi 80100427: b8 0e 00 00 00 mov $0xe,%eax 8010042c: 89 fa mov %edi,%edx 8010042e: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010042f: be d5 03 00 00 mov $0x3d5,%esi 80100434: 89 f2 mov %esi,%edx 80100436: ec in (%dx),%al { int pos; // Cursor position: col + 80*row. outb(CRTPORT, 14); pos = inb(CRTPORT+1) << 8; 80100437: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010043a: 89 fa mov %edi,%edx 8010043c: c1 e0 08 shl $0x8,%eax 8010043f: 89 c1 mov %eax,%ecx 80100441: b8 0f 00 00 00 mov $0xf,%eax 80100446: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80100447: 89 f2 mov %esi,%edx 80100449: ec in (%dx),%al outb(CRTPORT, 15); pos |= inb(CRTPORT+1); 8010044a: 0f b6 c0 movzbl %al,%eax 8010044d: 09 c8 or %ecx,%eax if(c == '\n') 8010044f: 83 fb 0a cmp $0xa,%ebx 80100452: 0f 84 0b 01 00 00 je 80100563 <consputc+0x173> pos += 80 - pos%80; else if(c == BACKSPACE){ 80100458: 81 fb 00 01 00 00 cmp $0x100,%ebx 8010045e: 0f 84 e6 00 00 00 je 8010054a <consputc+0x15a> if(pos > 0) --pos; } else crt[pos++] = (c&0xff) | 0x0700; // black on white 80100464: 0f b6 d3 movzbl %bl,%edx 80100467: 8d 78 01 lea 0x1(%eax),%edi 8010046a: 80 ce 07 or $0x7,%dh 8010046d: 66 89 94 00 00 80 0b mov %dx,-0x7ff48000(%eax,%eax,1) 80100474: 80 if(pos < 0 || pos > 25*80) 80100475: 81 ff d0 07 00 00 cmp $0x7d0,%edi 8010047b: 0f 8f bc 00 00 00 jg 8010053d <consputc+0x14d> panic("pos under/overflow"); if((pos/80) >= 24){ // Scroll up. 80100481: 81 ff 7f 07 00 00 cmp $0x77f,%edi 80100487: 7f 6f jg 801004f8 <consputc+0x108> 80100489: 89 f8 mov %edi,%eax 8010048b: 8d 8c 3f 00 80 0b 80 lea -0x7ff48000(%edi,%edi,1),%ecx 80100492: 89 fb mov %edi,%ebx 80100494: c1 e8 08 shr $0x8,%eax 80100497: 89 c6 mov %eax,%esi } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80100499: bf d4 03 00 00 mov $0x3d4,%edi 8010049e: b8 0e 00 00 00 mov $0xe,%eax 801004a3: 89 fa mov %edi,%edx 801004a5: ee out %al,(%dx) 801004a6: ba d5 03 00 00 mov $0x3d5,%edx 801004ab: 89 f0 mov %esi,%eax 801004ad: ee out %al,(%dx) 801004ae: b8 0f 00 00 00 mov $0xf,%eax 801004b3: 89 fa mov %edi,%edx 801004b5: ee out %al,(%dx) 801004b6: ba d5 03 00 00 mov $0x3d5,%edx 801004bb: 89 d8 mov %ebx,%eax 801004bd: ee out %al,(%dx) outb(CRTPORT, 14); outb(CRTPORT+1, pos>>8); outb(CRTPORT, 15); outb(CRTPORT+1, pos); crt[pos] = ' ' | 0x0700; 801004be: b8 20 07 00 00 mov $0x720,%eax 801004c3: 66 89 01 mov %ax,(%ecx) if(c == BACKSPACE){ uartputc('\b'); uartputc(' '); uartputc('\b'); } else uartputc(c); cgaputc(c); } 801004c6: 8d 65 f4 lea -0xc(%ebp),%esp 801004c9: 5b pop %ebx 801004ca: 5e pop %esi 801004cb: 5f pop %edi 801004cc: 5d pop %ebp 801004cd: c3 ret for(;;) ; } if(c == BACKSPACE){ uartputc('\b'); uartputc(' '); uartputc('\b'); 801004ce: 83 ec 0c sub $0xc,%esp 801004d1: 6a 08 push $0x8 801004d3: e8 88 5c 00 00 call 80106160 <uartputc> 801004d8: c7 04 24 20 00 00 00 movl $0x20,(%esp) 801004df: e8 7c 5c 00 00 call 80106160 <uartputc> 801004e4: c7 04 24 08 00 00 00 movl $0x8,(%esp) 801004eb: e8 70 5c 00 00 call 80106160 <uartputc> 801004f0: 83 c4 10 add $0x10,%esp 801004f3: e9 2a ff ff ff jmp 80100422 <consputc+0x32> if(pos < 0 || pos > 25*80) panic("pos under/overflow"); if((pos/80) >= 24){ // Scroll up. memmove(crt, crt+80, sizeof(crt[0])*23*80); 801004f8: 83 ec 04 sub $0x4,%esp pos -= 80; 801004fb: 8d 5f b0 lea -0x50(%edi),%ebx if(pos < 0 || pos > 25*80) panic("pos under/overflow"); if((pos/80) >= 24){ // Scroll up. memmove(crt, crt+80, sizeof(crt[0])*23*80); 801004fe: 68 60 0e 00 00 push $0xe60 80100503: 68 a0 80 0b 80 push $0x800b80a0 80100508: 68 00 80 0b 80 push $0x800b8000 pos -= 80; memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 8010050d: 8d b4 1b 00 80 0b 80 lea -0x7ff48000(%ebx,%ebx,1),%esi if(pos < 0 || pos > 25*80) panic("pos under/overflow"); if((pos/80) >= 24){ // Scroll up. memmove(crt, crt+80, sizeof(crt[0])*23*80); 80100514: e8 47 45 00 00 call 80104a60 <memmove> pos -= 80; memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 80100519: b8 80 07 00 00 mov $0x780,%eax 8010051e: 83 c4 0c add $0xc,%esp 80100521: 29 d8 sub %ebx,%eax 80100523: 01 c0 add %eax,%eax 80100525: 50 push %eax 80100526: 6a 00 push $0x0 80100528: 56 push %esi 80100529: e8 82 44 00 00 call 801049b0 <memset> 8010052e: 89 f1 mov %esi,%ecx 80100530: 83 c4 10 add $0x10,%esp 80100533: be 07 00 00 00 mov $0x7,%esi 80100538: e9 5c ff ff ff jmp 80100499 <consputc+0xa9> if(pos > 0) --pos; } else crt[pos++] = (c&0xff) | 0x0700; // black on white if(pos < 0 || pos > 25*80) panic("pos under/overflow"); 8010053d: 83 ec 0c sub $0xc,%esp 80100540: 68 e5 75 10 80 push $0x801075e5 80100545: e8 26 fe ff ff call 80100370 <panic> pos |= inb(CRTPORT+1); if(c == '\n') pos += 80 - pos%80; else if(c == BACKSPACE){ if(pos > 0) --pos; 8010054a: 85 c0 test %eax,%eax 8010054c: 8d 78 ff lea -0x1(%eax),%edi 8010054f: 0f 85 20 ff ff ff jne 80100475 <consputc+0x85> 80100555: b9 00 80 0b 80 mov $0x800b8000,%ecx 8010055a: 31 db xor %ebx,%ebx 8010055c: 31 f6 xor %esi,%esi 8010055e: e9 36 ff ff ff jmp 80100499 <consputc+0xa9> pos = inb(CRTPORT+1) << 8; outb(CRTPORT, 15); pos |= inb(CRTPORT+1); if(c == '\n') pos += 80 - pos%80; 80100563: ba 67 66 66 66 mov $0x66666667,%edx 80100568: f7 ea imul %edx 8010056a: 89 d0 mov %edx,%eax 8010056c: c1 e8 05 shr $0x5,%eax 8010056f: 8d 04 80 lea (%eax,%eax,4),%eax 80100572: c1 e0 04 shl $0x4,%eax 80100575: 8d 78 50 lea 0x50(%eax),%edi 80100578: e9 f8 fe ff ff jmp 80100475 <consputc+0x85> 8010057d: 8d 76 00 lea 0x0(%esi),%esi 80100580 <printint>: int locking; } cons; static void printint(int xx, int base, int sign) { 80100580: 55 push %ebp 80100581: 89 e5 mov %esp,%ebp 80100583: 57 push %edi 80100584: 56 push %esi 80100585: 53 push %ebx 80100586: 89 d6 mov %edx,%esi 80100588: 83 ec 2c sub $0x2c,%esp static char digits[] = "0123456789abcdef"; char buf[16]; int i; uint x; if(sign && (sign = xx < 0)) 8010058b: 85 c9 test %ecx,%ecx int locking; } cons; static void printint(int xx, int base, int sign) { 8010058d: 89 4d d4 mov %ecx,-0x2c(%ebp) static char digits[] = "0123456789abcdef"; char buf[16]; int i; uint x; if(sign && (sign = xx < 0)) 80100590: 74 0c je 8010059e <printint+0x1e> 80100592: 89 c7 mov %eax,%edi 80100594: c1 ef 1f shr $0x1f,%edi 80100597: 85 c0 test %eax,%eax 80100599: 89 7d d4 mov %edi,-0x2c(%ebp) 8010059c: 78 51 js 801005ef <printint+0x6f> x = -xx; else x = xx; i = 0; 8010059e: 31 ff xor %edi,%edi 801005a0: 8d 5d d7 lea -0x29(%ebp),%ebx 801005a3: eb 05 jmp 801005aa <printint+0x2a> 801005a5: 8d 76 00 lea 0x0(%esi),%esi do{ buf[i++] = digits[x % base]; 801005a8: 89 cf mov %ecx,%edi 801005aa: 31 d2 xor %edx,%edx 801005ac: 8d 4f 01 lea 0x1(%edi),%ecx 801005af: f7 f6 div %esi 801005b1: 0f b6 92 10 76 10 80 movzbl -0x7fef89f0(%edx),%edx }while((x /= base) != 0); 801005b8: 85 c0 test %eax,%eax else x = xx; i = 0; do{ buf[i++] = digits[x % base]; 801005ba: 88 14 0b mov %dl,(%ebx,%ecx,1) }while((x /= base) != 0); 801005bd: 75 e9 jne 801005a8 <printint+0x28> if(sign) 801005bf: 8b 45 d4 mov -0x2c(%ebp),%eax 801005c2: 85 c0 test %eax,%eax 801005c4: 74 08 je 801005ce <printint+0x4e> buf[i++] = '-'; 801005c6: c6 44 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1) 801005cb: 8d 4f 02 lea 0x2(%edi),%ecx 801005ce: 8d 74 0d d7 lea -0x29(%ebp,%ecx,1),%esi 801005d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi while(--i >= 0) consputc(buf[i]); 801005d8: 0f be 06 movsbl (%esi),%eax 801005db: 83 ee 01 sub $0x1,%esi 801005de: e8 0d fe ff ff call 801003f0 <consputc> }while((x /= base) != 0); if(sign) buf[i++] = '-'; while(--i >= 0) 801005e3: 39 de cmp %ebx,%esi 801005e5: 75 f1 jne 801005d8 <printint+0x58> consputc(buf[i]); } 801005e7: 83 c4 2c add $0x2c,%esp 801005ea: 5b pop %ebx 801005eb: 5e pop %esi 801005ec: 5f pop %edi 801005ed: 5d pop %ebp 801005ee: c3 ret char buf[16]; int i; uint x; if(sign && (sign = xx < 0)) x = -xx; 801005ef: f7 d8 neg %eax 801005f1: eb ab jmp 8010059e <printint+0x1e> 801005f3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801005f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100600 <consolewrite>: return target - n; } int consolewrite(struct inode *ip, char *buf, int n) { 80100600: 55 push %ebp 80100601: 89 e5 mov %esp,%ebp 80100603: 57 push %edi 80100604: 56 push %esi 80100605: 53 push %ebx 80100606: 83 ec 18 sub $0x18,%esp int i; iunlock(ip); 80100609: ff 75 08 pushl 0x8(%ebp) return target - n; } int consolewrite(struct inode *ip, char *buf, int n) { 8010060c: 8b 75 10 mov 0x10(%ebp),%esi int i; iunlock(ip); 8010060f: e8 3c 11 00 00 call 80101750 <iunlock> acquire(&cons.lock); 80100614: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) 8010061b: e8 20 42 00 00 call 80104840 <acquire> 80100620: 8b 7d 0c mov 0xc(%ebp),%edi for(i = 0; i < n; i++) 80100623: 83 c4 10 add $0x10,%esp 80100626: 85 f6 test %esi,%esi 80100628: 8d 1c 37 lea (%edi,%esi,1),%ebx 8010062b: 7e 12 jle 8010063f <consolewrite+0x3f> 8010062d: 8d 76 00 lea 0x0(%esi),%esi consputc(buf[i] & 0xff); 80100630: 0f b6 07 movzbl (%edi),%eax 80100633: 83 c7 01 add $0x1,%edi 80100636: e8 b5 fd ff ff call 801003f0 <consputc> { int i; iunlock(ip); acquire(&cons.lock); for(i = 0; i < n; i++) 8010063b: 39 df cmp %ebx,%edi 8010063d: 75 f1 jne 80100630 <consolewrite+0x30> consputc(buf[i] & 0xff); release(&cons.lock); 8010063f: 83 ec 0c sub $0xc,%esp 80100642: 68 20 b5 10 80 push $0x8010b520 80100647: e8 14 43 00 00 call 80104960 <release> ilock(ip); 8010064c: 58 pop %eax 8010064d: ff 75 08 pushl 0x8(%ebp) 80100650: e8 1b 10 00 00 call 80101670 <ilock> return n; } 80100655: 8d 65 f4 lea -0xc(%ebp),%esp 80100658: 89 f0 mov %esi,%eax 8010065a: 5b pop %ebx 8010065b: 5e pop %esi 8010065c: 5f pop %edi 8010065d: 5d pop %ebp 8010065e: c3 ret 8010065f: 90 nop 80100660 <cprintf>: //PAGEBREAK: 50 // Print to the console. only understands %d, %x, %p, %s. void cprintf(char *fmt, ...) { 80100660: 55 push %ebp 80100661: 89 e5 mov %esp,%ebp 80100663: 57 push %edi 80100664: 56 push %esi 80100665: 53 push %ebx 80100666: 83 ec 1c sub $0x1c,%esp int i, c, locking; uint *argp; char *s; locking = cons.locking; 80100669: a1 54 b5 10 80 mov 0x8010b554,%eax if(locking) 8010066e: 85 c0 test %eax,%eax { int i, c, locking; uint *argp; char *s; locking = cons.locking; 80100670: 89 45 e0 mov %eax,-0x20(%ebp) if(locking) 80100673: 0f 85 47 01 00 00 jne 801007c0 <cprintf+0x160> acquire(&cons.lock); if (fmt == 0) 80100679: 8b 45 08 mov 0x8(%ebp),%eax 8010067c: 85 c0 test %eax,%eax 8010067e: 89 c1 mov %eax,%ecx 80100680: 0f 84 4f 01 00 00 je 801007d5 <cprintf+0x175> panic("null fmt"); argp = (uint*)(void*)(&fmt + 1); for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100686: 0f b6 00 movzbl (%eax),%eax 80100689: 31 db xor %ebx,%ebx 8010068b: 8d 75 0c lea 0xc(%ebp),%esi 8010068e: 89 cf mov %ecx,%edi 80100690: 85 c0 test %eax,%eax 80100692: 75 55 jne 801006e9 <cprintf+0x89> 80100694: eb 68 jmp 801006fe <cprintf+0x9e> 80100696: 8d 76 00 lea 0x0(%esi),%esi 80100699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(c != '%'){ consputc(c); continue; } c = fmt[++i] & 0xff; 801006a0: 83 c3 01 add $0x1,%ebx 801006a3: 0f b6 14 1f movzbl (%edi,%ebx,1),%edx if(c == 0) 801006a7: 85 d2 test %edx,%edx 801006a9: 74 53 je 801006fe <cprintf+0x9e> break; switch(c){ 801006ab: 83 fa 70 cmp $0x70,%edx 801006ae: 74 7a je 8010072a <cprintf+0xca> 801006b0: 7f 6e jg 80100720 <cprintf+0xc0> 801006b2: 83 fa 25 cmp $0x25,%edx 801006b5: 0f 84 ad 00 00 00 je 80100768 <cprintf+0x108> 801006bb: 83 fa 64 cmp $0x64,%edx 801006be: 0f 85 84 00 00 00 jne 80100748 <cprintf+0xe8> case 'd': printint(*argp++, 10, 1); 801006c4: 8d 46 04 lea 0x4(%esi),%eax 801006c7: b9 01 00 00 00 mov $0x1,%ecx 801006cc: ba 0a 00 00 00 mov $0xa,%edx 801006d1: 89 45 e4 mov %eax,-0x1c(%ebp) 801006d4: 8b 06 mov (%esi),%eax 801006d6: e8 a5 fe ff ff call 80100580 <printint> 801006db: 8b 75 e4 mov -0x1c(%ebp),%esi if (fmt == 0) panic("null fmt"); argp = (uint*)(void*)(&fmt + 1); for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006de: 83 c3 01 add $0x1,%ebx 801006e1: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax 801006e5: 85 c0 test %eax,%eax 801006e7: 74 15 je 801006fe <cprintf+0x9e> if(c != '%'){ 801006e9: 83 f8 25 cmp $0x25,%eax 801006ec: 74 b2 je 801006a0 <cprintf+0x40> s = "(null)"; for(; *s; s++) consputc(*s); break; case '%': consputc('%'); 801006ee: e8 fd fc ff ff call 801003f0 <consputc> if (fmt == 0) panic("null fmt"); argp = (uint*)(void*)(&fmt + 1); for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006f3: 83 c3 01 add $0x1,%ebx 801006f6: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax 801006fa: 85 c0 test %eax,%eax 801006fc: 75 eb jne 801006e9 <cprintf+0x89> consputc(c); break; } } if(locking) 801006fe: 8b 45 e0 mov -0x20(%ebp),%eax 80100701: 85 c0 test %eax,%eax 80100703: 74 10 je 80100715 <cprintf+0xb5> release(&cons.lock); 80100705: 83 ec 0c sub $0xc,%esp 80100708: 68 20 b5 10 80 push $0x8010b520 8010070d: e8 4e 42 00 00 call 80104960 <release> 80100712: 83 c4 10 add $0x10,%esp } 80100715: 8d 65 f4 lea -0xc(%ebp),%esp 80100718: 5b pop %ebx 80100719: 5e pop %esi 8010071a: 5f pop %edi 8010071b: 5d pop %ebp 8010071c: c3 ret 8010071d: 8d 76 00 lea 0x0(%esi),%esi continue; } c = fmt[++i] & 0xff; if(c == 0) break; switch(c){ 80100720: 83 fa 73 cmp $0x73,%edx 80100723: 74 5b je 80100780 <cprintf+0x120> 80100725: 83 fa 78 cmp $0x78,%edx 80100728: 75 1e jne 80100748 <cprintf+0xe8> case 'd': printint(*argp++, 10, 1); break; case 'x': case 'p': printint(*argp++, 16, 0); 8010072a: 8d 46 04 lea 0x4(%esi),%eax 8010072d: 31 c9 xor %ecx,%ecx 8010072f: ba 10 00 00 00 mov $0x10,%edx 80100734: 89 45 e4 mov %eax,-0x1c(%ebp) 80100737: 8b 06 mov (%esi),%eax 80100739: e8 42 fe ff ff call 80100580 <printint> 8010073e: 8b 75 e4 mov -0x1c(%ebp),%esi break; 80100741: eb 9b jmp 801006de <cprintf+0x7e> 80100743: 90 nop 80100744: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi case '%': consputc('%'); break; default: // Print unknown % sequence to draw attention. consputc('%'); 80100748: b8 25 00 00 00 mov $0x25,%eax 8010074d: 89 55 e4 mov %edx,-0x1c(%ebp) 80100750: e8 9b fc ff ff call 801003f0 <consputc> consputc(c); 80100755: 8b 55 e4 mov -0x1c(%ebp),%edx 80100758: 89 d0 mov %edx,%eax 8010075a: e8 91 fc ff ff call 801003f0 <consputc> break; 8010075f: e9 7a ff ff ff jmp 801006de <cprintf+0x7e> 80100764: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi s = "(null)"; for(; *s; s++) consputc(*s); break; case '%': consputc('%'); 80100768: b8 25 00 00 00 mov $0x25,%eax 8010076d: e8 7e fc ff ff call 801003f0 <consputc> 80100772: e9 7c ff ff ff jmp 801006f3 <cprintf+0x93> 80100777: 89 f6 mov %esi,%esi 80100779: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi case 'x': case 'p': printint(*argp++, 16, 0); break; case 's': if((s = (char*)*argp++) == 0) 80100780: 8d 46 04 lea 0x4(%esi),%eax 80100783: 8b 36 mov (%esi),%esi 80100785: 89 45 e4 mov %eax,-0x1c(%ebp) s = "(null)"; 80100788: b8 f8 75 10 80 mov $0x801075f8,%eax 8010078d: 85 f6 test %esi,%esi 8010078f: 0f 44 f0 cmove %eax,%esi for(; *s; s++) 80100792: 0f be 06 movsbl (%esi),%eax 80100795: 84 c0 test %al,%al 80100797: 74 16 je 801007af <cprintf+0x14f> 80100799: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801007a0: 83 c6 01 add $0x1,%esi consputc(*s); 801007a3: e8 48 fc ff ff call 801003f0 <consputc> printint(*argp++, 16, 0); break; case 's': if((s = (char*)*argp++) == 0) s = "(null)"; for(; *s; s++) 801007a8: 0f be 06 movsbl (%esi),%eax 801007ab: 84 c0 test %al,%al 801007ad: 75 f1 jne 801007a0 <cprintf+0x140> case 'x': case 'p': printint(*argp++, 16, 0); break; case 's': if((s = (char*)*argp++) == 0) 801007af: 8b 75 e4 mov -0x1c(%ebp),%esi 801007b2: e9 27 ff ff ff jmp 801006de <cprintf+0x7e> 801007b7: 89 f6 mov %esi,%esi 801007b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi uint *argp; char *s; locking = cons.locking; if(locking) acquire(&cons.lock); 801007c0: 83 ec 0c sub $0xc,%esp 801007c3: 68 20 b5 10 80 push $0x8010b520 801007c8: e8 73 40 00 00 call 80104840 <acquire> 801007cd: 83 c4 10 add $0x10,%esp 801007d0: e9 a4 fe ff ff jmp 80100679 <cprintf+0x19> if (fmt == 0) panic("null fmt"); 801007d5: 83 ec 0c sub $0xc,%esp 801007d8: 68 ff 75 10 80 push $0x801075ff 801007dd: e8 8e fb ff ff call 80100370 <panic> 801007e2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801007e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801007f0 <consoleintr>: #define C(x) ((x)-'@') // Control-x void consoleintr(int (*getc)(void)) { 801007f0: 55 push %ebp 801007f1: 89 e5 mov %esp,%ebp 801007f3: 57 push %edi 801007f4: 56 push %esi 801007f5: 53 push %ebx int c, doprocdump = 0; 801007f6: 31 f6 xor %esi,%esi #define C(x) ((x)-'@') // Control-x void consoleintr(int (*getc)(void)) { 801007f8: 83 ec 18 sub $0x18,%esp 801007fb: 8b 5d 08 mov 0x8(%ebp),%ebx int c, doprocdump = 0; acquire(&cons.lock); 801007fe: 68 20 b5 10 80 push $0x8010b520 80100803: e8 38 40 00 00 call 80104840 <acquire> while((c = getc()) >= 0){ 80100808: 83 c4 10 add $0x10,%esp 8010080b: 90 nop 8010080c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100810: ff d3 call *%ebx 80100812: 85 c0 test %eax,%eax 80100814: 89 c7 mov %eax,%edi 80100816: 78 48 js 80100860 <consoleintr+0x70> switch(c){ 80100818: 83 ff 10 cmp $0x10,%edi 8010081b: 0f 84 3f 01 00 00 je 80100960 <consoleintr+0x170> 80100821: 7e 5d jle 80100880 <consoleintr+0x90> 80100823: 83 ff 15 cmp $0x15,%edi 80100826: 0f 84 dc 00 00 00 je 80100908 <consoleintr+0x118> 8010082c: 83 ff 7f cmp $0x7f,%edi 8010082f: 75 54 jne 80100885 <consoleintr+0x95> input.e--; consputc(BACKSPACE); } break; case C('H'): case '\x7f': // Backspace if(input.e != input.w){ 80100831: a1 a8 0f 11 80 mov 0x80110fa8,%eax 80100836: 3b 05 a4 0f 11 80 cmp 0x80110fa4,%eax 8010083c: 74 d2 je 80100810 <consoleintr+0x20> input.e--; 8010083e: 83 e8 01 sub $0x1,%eax 80100841: a3 a8 0f 11 80 mov %eax,0x80110fa8 consputc(BACKSPACE); 80100846: b8 00 01 00 00 mov $0x100,%eax 8010084b: e8 a0 fb ff ff call 801003f0 <consputc> consoleintr(int (*getc)(void)) { int c, doprocdump = 0; acquire(&cons.lock); while((c = getc()) >= 0){ 80100850: ff d3 call *%ebx 80100852: 85 c0 test %eax,%eax 80100854: 89 c7 mov %eax,%edi 80100856: 79 c0 jns 80100818 <consoleintr+0x28> 80100858: 90 nop 80100859: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi } } break; } } release(&cons.lock); 80100860: 83 ec 0c sub $0xc,%esp 80100863: 68 20 b5 10 80 push $0x8010b520 80100868: e8 f3 40 00 00 call 80104960 <release> if(doprocdump) { 8010086d: 83 c4 10 add $0x10,%esp 80100870: 85 f6 test %esi,%esi 80100872: 0f 85 f8 00 00 00 jne 80100970 <consoleintr+0x180> procdump(); // now call procdump() wo. cons.lock held } } 80100878: 8d 65 f4 lea -0xc(%ebp),%esp 8010087b: 5b pop %ebx 8010087c: 5e pop %esi 8010087d: 5f pop %edi 8010087e: 5d pop %ebp 8010087f: c3 ret { int c, doprocdump = 0; acquire(&cons.lock); while((c = getc()) >= 0){ switch(c){ 80100880: 83 ff 08 cmp $0x8,%edi 80100883: 74 ac je 80100831 <consoleintr+0x41> input.e--; consputc(BACKSPACE); } break; default: if(c != 0 && input.e-input.r < INPUT_BUF){ 80100885: 85 ff test %edi,%edi 80100887: 74 87 je 80100810 <consoleintr+0x20> 80100889: a1 a8 0f 11 80 mov 0x80110fa8,%eax 8010088e: 89 c2 mov %eax,%edx 80100890: 2b 15 a0 0f 11 80 sub 0x80110fa0,%edx 80100896: 83 fa 7f cmp $0x7f,%edx 80100899: 0f 87 71 ff ff ff ja 80100810 <consoleintr+0x20> c = (c == '\r') ? '\n' : c; input.buf[input.e++ % INPUT_BUF] = c; 8010089f: 8d 50 01 lea 0x1(%eax),%edx 801008a2: 83 e0 7f and $0x7f,%eax consputc(BACKSPACE); } break; default: if(c != 0 && input.e-input.r < INPUT_BUF){ c = (c == '\r') ? '\n' : c; 801008a5: 83 ff 0d cmp $0xd,%edi input.buf[input.e++ % INPUT_BUF] = c; 801008a8: 89 15 a8 0f 11 80 mov %edx,0x80110fa8 consputc(BACKSPACE); } break; default: if(c != 0 && input.e-input.r < INPUT_BUF){ c = (c == '\r') ? '\n' : c; 801008ae: 0f 84 c8 00 00 00 je 8010097c <consoleintr+0x18c> input.buf[input.e++ % INPUT_BUF] = c; 801008b4: 89 f9 mov %edi,%ecx 801008b6: 88 88 20 0f 11 80 mov %cl,-0x7feef0e0(%eax) consputc(c); 801008bc: 89 f8 mov %edi,%eax 801008be: e8 2d fb ff ff call 801003f0 <consputc> if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){ 801008c3: 83 ff 0a cmp $0xa,%edi 801008c6: 0f 84 c1 00 00 00 je 8010098d <consoleintr+0x19d> 801008cc: 83 ff 04 cmp $0x4,%edi 801008cf: 0f 84 b8 00 00 00 je 8010098d <consoleintr+0x19d> 801008d5: a1 a0 0f 11 80 mov 0x80110fa0,%eax 801008da: 83 e8 80 sub $0xffffff80,%eax 801008dd: 39 05 a8 0f 11 80 cmp %eax,0x80110fa8 801008e3: 0f 85 27 ff ff ff jne 80100810 <consoleintr+0x20> input.w = input.e; wakeup(&input.r); 801008e9: 83 ec 0c sub $0xc,%esp if(c != 0 && input.e-input.r < INPUT_BUF){ c = (c == '\r') ? '\n' : c; input.buf[input.e++ % INPUT_BUF] = c; consputc(c); if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){ input.w = input.e; 801008ec: a3 a4 0f 11 80 mov %eax,0x80110fa4 wakeup(&input.r); 801008f1: 68 a0 0f 11 80 push $0x80110fa0 801008f6: e8 e5 35 00 00 call 80103ee0 <wakeup> 801008fb: 83 c4 10 add $0x10,%esp 801008fe: e9 0d ff ff ff jmp 80100810 <consoleintr+0x20> 80100903: 90 nop 80100904: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi case C('P'): // Process listing. // procdump() locks cons.lock indirectly; invoke later doprocdump = 1; break; case C('U'): // Kill line. while(input.e != input.w && 80100908: a1 a8 0f 11 80 mov 0x80110fa8,%eax 8010090d: 39 05 a4 0f 11 80 cmp %eax,0x80110fa4 80100913: 75 2b jne 80100940 <consoleintr+0x150> 80100915: e9 f6 fe ff ff jmp 80100810 <consoleintr+0x20> 8010091a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi input.buf[(input.e-1) % INPUT_BUF] != '\n'){ input.e--; 80100920: a3 a8 0f 11 80 mov %eax,0x80110fa8 consputc(BACKSPACE); 80100925: b8 00 01 00 00 mov $0x100,%eax 8010092a: e8 c1 fa ff ff call 801003f0 <consputc> case C('P'): // Process listing. // procdump() locks cons.lock indirectly; invoke later doprocdump = 1; break; case C('U'): // Kill line. while(input.e != input.w && 8010092f: a1 a8 0f 11 80 mov 0x80110fa8,%eax 80100934: 3b 05 a4 0f 11 80 cmp 0x80110fa4,%eax 8010093a: 0f 84 d0 fe ff ff je 80100810 <consoleintr+0x20> input.buf[(input.e-1) % INPUT_BUF] != '\n'){ 80100940: 83 e8 01 sub $0x1,%eax 80100943: 89 c2 mov %eax,%edx 80100945: 83 e2 7f and $0x7f,%edx case C('P'): // Process listing. // procdump() locks cons.lock indirectly; invoke later doprocdump = 1; break; case C('U'): // Kill line. while(input.e != input.w && 80100948: 80 ba 20 0f 11 80 0a cmpb $0xa,-0x7feef0e0(%edx) 8010094f: 75 cf jne 80100920 <consoleintr+0x130> 80100951: e9 ba fe ff ff jmp 80100810 <consoleintr+0x20> 80100956: 8d 76 00 lea 0x0(%esi),%esi 80100959: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi acquire(&cons.lock); while((c = getc()) >= 0){ switch(c){ case C('P'): // Process listing. // procdump() locks cons.lock indirectly; invoke later doprocdump = 1; 80100960: be 01 00 00 00 mov $0x1,%esi 80100965: e9 a6 fe ff ff jmp 80100810 <consoleintr+0x20> 8010096a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi } release(&cons.lock); if(doprocdump) { procdump(); // now call procdump() wo. cons.lock held } } 80100970: 8d 65 f4 lea -0xc(%ebp),%esp 80100973: 5b pop %ebx 80100974: 5e pop %esi 80100975: 5f pop %edi 80100976: 5d pop %ebp break; } } release(&cons.lock); if(doprocdump) { procdump(); // now call procdump() wo. cons.lock held 80100977: e9 54 36 00 00 jmp 80103fd0 <procdump> } break; default: if(c != 0 && input.e-input.r < INPUT_BUF){ c = (c == '\r') ? '\n' : c; input.buf[input.e++ % INPUT_BUF] = c; 8010097c: c6 80 20 0f 11 80 0a movb $0xa,-0x7feef0e0(%eax) consputc(c); 80100983: b8 0a 00 00 00 mov $0xa,%eax 80100988: e8 63 fa ff ff call 801003f0 <consputc> 8010098d: a1 a8 0f 11 80 mov 0x80110fa8,%eax 80100992: e9 52 ff ff ff jmp 801008e9 <consoleintr+0xf9> 80100997: 89 f6 mov %esi,%esi 80100999: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801009a0 <consoleinit>: return n; } void consoleinit(void) { 801009a0: 55 push %ebp 801009a1: 89 e5 mov %esp,%ebp 801009a3: 83 ec 10 sub $0x10,%esp initlock(&cons.lock, "console"); 801009a6: 68 08 76 10 80 push $0x80107608 801009ab: 68 20 b5 10 80 push $0x8010b520 801009b0: e8 8b 3d 00 00 call 80104740 <initlock> devsw[CONSOLE].write = consolewrite; devsw[CONSOLE].read = consoleread; cons.locking = 1; ioapicenable(IRQ_KBD, 0); 801009b5: 58 pop %eax 801009b6: 5a pop %edx 801009b7: 6a 00 push $0x0 801009b9: 6a 01 push $0x1 void consoleinit(void) { initlock(&cons.lock, "console"); devsw[CONSOLE].write = consolewrite; 801009bb: c7 05 6c 19 11 80 00 movl $0x80100600,0x8011196c 801009c2: 06 10 80 devsw[CONSOLE].read = consoleread; 801009c5: c7 05 68 19 11 80 70 movl $0x80100270,0x80111968 801009cc: 02 10 80 cons.locking = 1; 801009cf: c7 05 54 b5 10 80 01 movl $0x1,0x8010b554 801009d6: 00 00 00 ioapicenable(IRQ_KBD, 0); 801009d9: e8 c2 18 00 00 call 801022a0 <ioapicenable> } 801009de: 83 c4 10 add $0x10,%esp 801009e1: c9 leave 801009e2: c3 ret 801009e3: 66 90 xchg %ax,%ax 801009e5: 66 90 xchg %ax,%ax 801009e7: 66 90 xchg %ax,%ax 801009e9: 66 90 xchg %ax,%ax 801009eb: 66 90 xchg %ax,%ax 801009ed: 66 90 xchg %ax,%ax 801009ef: 90 nop 801009f0 <exec>: #include "x86.h" #include "elf.h" int exec(char *path, char **argv) { 801009f0: 55 push %ebp 801009f1: 89 e5 mov %esp,%ebp 801009f3: 57 push %edi 801009f4: 56 push %esi 801009f5: 53 push %ebx 801009f6: 81 ec 0c 01 00 00 sub $0x10c,%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(); 801009fc: e8 7f 2d 00 00 call 80103780 <myproc> 80100a01: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp) begin_op(); 80100a07: e8 44 21 00 00 call 80102b50 <begin_op> if((ip = namei(path)) == 0){ 80100a0c: 83 ec 0c sub $0xc,%esp 80100a0f: ff 75 08 pushl 0x8(%ebp) 80100a12: e8 a9 14 00 00 call 80101ec0 <namei> 80100a17: 83 c4 10 add $0x10,%esp 80100a1a: 85 c0 test %eax,%eax 80100a1c: 0f 84 9c 01 00 00 je 80100bbe <exec+0x1ce> end_op(); cprintf("exec: fail\n"); return -1; } ilock(ip); 80100a22: 83 ec 0c sub $0xc,%esp 80100a25: 89 c3 mov %eax,%ebx 80100a27: 50 push %eax 80100a28: e8 43 0c 00 00 call 80101670 <ilock> pgdir = 0; // Check ELF header if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) 80100a2d: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax 80100a33: 6a 34 push $0x34 80100a35: 6a 00 push $0x0 80100a37: 50 push %eax 80100a38: 53 push %ebx 80100a39: e8 12 0f 00 00 call 80101950 <readi> 80100a3e: 83 c4 20 add $0x20,%esp 80100a41: 83 f8 34 cmp $0x34,%eax 80100a44: 74 22 je 80100a68 <exec+0x78> bad: if(pgdir) freevm(pgdir); if(ip){ iunlockput(ip); 80100a46: 83 ec 0c sub $0xc,%esp 80100a49: 53 push %ebx 80100a4a: e8 b1 0e 00 00 call 80101900 <iunlockput> end_op(); 80100a4f: e8 6c 21 00 00 call 80102bc0 <end_op> 80100a54: 83 c4 10 add $0x10,%esp } return -1; 80100a57: b8 ff ff ff ff mov $0xffffffff,%eax } 80100a5c: 8d 65 f4 lea -0xc(%ebp),%esp 80100a5f: 5b pop %ebx 80100a60: 5e pop %esi 80100a61: 5f pop %edi 80100a62: 5d pop %ebp 80100a63: c3 ret 80100a64: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi pgdir = 0; // Check ELF header if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) goto bad; if(elf.magic != ELF_MAGIC) 80100a68: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp) 80100a6f: 45 4c 46 80100a72: 75 d2 jne 80100a46 <exec+0x56> goto bad; if((pgdir = setupkvm()) == 0) 80100a74: e8 77 68 00 00 call 801072f0 <setupkvm> 80100a79: 85 c0 test %eax,%eax 80100a7b: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp) 80100a81: 74 c3 je 80100a46 <exec+0x56> goto bad; // Load program into memory. sz = 0; for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100a83: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp) 80100a8a: 00 80100a8b: 8b b5 40 ff ff ff mov -0xc0(%ebp),%esi 80100a91: c7 85 ec fe ff ff 00 movl $0x0,-0x114(%ebp) 80100a98: 00 00 00 80100a9b: 0f 84 c5 00 00 00 je 80100b66 <exec+0x176> 80100aa1: 31 ff xor %edi,%edi 80100aa3: eb 18 jmp 80100abd <exec+0xcd> 80100aa5: 8d 76 00 lea 0x0(%esi),%esi 80100aa8: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax 80100aaf: 83 c7 01 add $0x1,%edi 80100ab2: 83 c6 20 add $0x20,%esi 80100ab5: 39 f8 cmp %edi,%eax 80100ab7: 0f 8e a9 00 00 00 jle 80100b66 <exec+0x176> if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph)) 80100abd: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax 80100ac3: 6a 20 push $0x20 80100ac5: 56 push %esi 80100ac6: 50 push %eax 80100ac7: 53 push %ebx 80100ac8: e8 83 0e 00 00 call 80101950 <readi> 80100acd: 83 c4 10 add $0x10,%esp 80100ad0: 83 f8 20 cmp $0x20,%eax 80100ad3: 75 7b jne 80100b50 <exec+0x160> goto bad; if(ph.type != ELF_PROG_LOAD) 80100ad5: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp) 80100adc: 75 ca jne 80100aa8 <exec+0xb8> continue; if(ph.memsz < ph.filesz) 80100ade: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax 80100ae4: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax 80100aea: 72 64 jb 80100b50 <exec+0x160> goto bad; if(ph.vaddr + ph.memsz < ph.vaddr) 80100aec: 03 85 0c ff ff ff add -0xf4(%ebp),%eax 80100af2: 72 5c jb 80100b50 <exec+0x160> goto bad; if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0) 80100af4: 83 ec 04 sub $0x4,%esp 80100af7: 50 push %eax 80100af8: ff b5 ec fe ff ff pushl -0x114(%ebp) 80100afe: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b04: e8 37 66 00 00 call 80107140 <allocuvm> 80100b09: 83 c4 10 add $0x10,%esp 80100b0c: 85 c0 test %eax,%eax 80100b0e: 89 85 ec fe ff ff mov %eax,-0x114(%ebp) 80100b14: 74 3a je 80100b50 <exec+0x160> goto bad; if(ph.vaddr % PGSIZE != 0) 80100b16: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax 80100b1c: a9 ff 0f 00 00 test $0xfff,%eax 80100b21: 75 2d jne 80100b50 <exec+0x160> goto bad; if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0) 80100b23: 83 ec 0c sub $0xc,%esp 80100b26: ff b5 14 ff ff ff pushl -0xec(%ebp) 80100b2c: ff b5 08 ff ff ff pushl -0xf8(%ebp) 80100b32: 53 push %ebx 80100b33: 50 push %eax 80100b34: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b3a: e8 41 65 00 00 call 80107080 <loaduvm> 80100b3f: 83 c4 20 add $0x20,%esp 80100b42: 85 c0 test %eax,%eax 80100b44: 0f 89 5e ff ff ff jns 80100aa8 <exec+0xb8> 80100b4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi freevm(oldpgdir); return 0; bad: if(pgdir) freevm(pgdir); 80100b50: 83 ec 0c sub $0xc,%esp 80100b53: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b59: e8 12 67 00 00 call 80107270 <freevm> 80100b5e: 83 c4 10 add $0x10,%esp 80100b61: e9 e0 fe ff ff jmp 80100a46 <exec+0x56> if(ph.vaddr % PGSIZE != 0) goto bad; if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0) goto bad; } iunlockput(ip); 80100b66: 83 ec 0c sub $0xc,%esp 80100b69: 53 push %ebx 80100b6a: e8 91 0d 00 00 call 80101900 <iunlockput> end_op(); 80100b6f: e8 4c 20 00 00 call 80102bc0 <end_op> ip = 0; // Allocate two pages at the next page boundary. // Make the first inaccessible. Use the second as the user stack. sz = PGROUNDUP(sz); 80100b74: 8b 85 ec fe ff ff mov -0x114(%ebp),%eax if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) 80100b7a: 83 c4 0c add $0xc,%esp end_op(); ip = 0; // Allocate two pages at the next page boundary. // Make the first inaccessible. Use the second as the user stack. sz = PGROUNDUP(sz); 80100b7d: 05 ff 0f 00 00 add $0xfff,%eax 80100b82: 25 00 f0 ff ff and $0xfffff000,%eax if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) 80100b87: 8d 90 00 20 00 00 lea 0x2000(%eax),%edx 80100b8d: 52 push %edx 80100b8e: 50 push %eax 80100b8f: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b95: e8 a6 65 00 00 call 80107140 <allocuvm> 80100b9a: 83 c4 10 add $0x10,%esp 80100b9d: 85 c0 test %eax,%eax 80100b9f: 89 c6 mov %eax,%esi 80100ba1: 75 3a jne 80100bdd <exec+0x1ed> freevm(oldpgdir); return 0; bad: if(pgdir) freevm(pgdir); 80100ba3: 83 ec 0c sub $0xc,%esp 80100ba6: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100bac: e8 bf 66 00 00 call 80107270 <freevm> 80100bb1: 83 c4 10 add $0x10,%esp if(ip){ iunlockput(ip); end_op(); } return -1; 80100bb4: b8 ff ff ff ff mov $0xffffffff,%eax 80100bb9: e9 9e fe ff ff jmp 80100a5c <exec+0x6c> struct proc *curproc = myproc(); begin_op(); if((ip = namei(path)) == 0){ end_op(); 80100bbe: e8 fd 1f 00 00 call 80102bc0 <end_op> cprintf("exec: fail\n"); 80100bc3: 83 ec 0c sub $0xc,%esp 80100bc6: 68 21 76 10 80 push $0x80107621 80100bcb: e8 90 fa ff ff call 80100660 <cprintf> return -1; 80100bd0: 83 c4 10 add $0x10,%esp 80100bd3: b8 ff ff ff ff mov $0xffffffff,%eax 80100bd8: e9 7f fe ff ff jmp 80100a5c <exec+0x6c> // Allocate two pages at the next page boundary. // Make the first inaccessible. Use the second as the user stack. sz = PGROUNDUP(sz); if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) goto bad; clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bdd: 8d 80 00 e0 ff ff lea -0x2000(%eax),%eax 80100be3: 83 ec 08 sub $0x8,%esp sp = sz; // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { 80100be6: 31 ff xor %edi,%edi 80100be8: 89 f3 mov %esi,%ebx // Allocate two pages at the next page boundary. // Make the first inaccessible. Use the second as the user stack. sz = PGROUNDUP(sz); if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) goto bad; clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bea: 50 push %eax 80100beb: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100bf1: e8 9a 67 00 00 call 80107390 <clearpteu> sp = sz; // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { 80100bf6: 8b 45 0c mov 0xc(%ebp),%eax 80100bf9: 83 c4 10 add $0x10,%esp 80100bfc: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx 80100c02: 8b 00 mov (%eax),%eax 80100c04: 85 c0 test %eax,%eax 80100c06: 74 79 je 80100c81 <exec+0x291> 80100c08: 89 b5 ec fe ff ff mov %esi,-0x114(%ebp) 80100c0e: 8b b5 f0 fe ff ff mov -0x110(%ebp),%esi 80100c14: eb 13 jmp 80100c29 <exec+0x239> 80100c16: 8d 76 00 lea 0x0(%esi),%esi 80100c19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(argc >= MAXARG) 80100c20: 83 ff 20 cmp $0x20,%edi 80100c23: 0f 84 7a ff ff ff je 80100ba3 <exec+0x1b3> goto bad; sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c29: 83 ec 0c sub $0xc,%esp 80100c2c: 50 push %eax 80100c2d: e8 be 3f 00 00 call 80104bf0 <strlen> 80100c32: f7 d0 not %eax 80100c34: 01 c3 add %eax,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c36: 8b 45 0c mov 0xc(%ebp),%eax 80100c39: 5a pop %edx // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { if(argc >= MAXARG) goto bad; sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c3a: 83 e3 fc and $0xfffffffc,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c3d: ff 34 b8 pushl (%eax,%edi,4) 80100c40: e8 ab 3f 00 00 call 80104bf0 <strlen> 80100c45: 83 c0 01 add $0x1,%eax 80100c48: 50 push %eax 80100c49: 8b 45 0c mov 0xc(%ebp),%eax 80100c4c: ff 34 b8 pushl (%eax,%edi,4) 80100c4f: 53 push %ebx 80100c50: 56 push %esi 80100c51: e8 9a 68 00 00 call 801074f0 <copyout> 80100c56: 83 c4 20 add $0x20,%esp 80100c59: 85 c0 test %eax,%eax 80100c5b: 0f 88 42 ff ff ff js 80100ba3 <exec+0x1b3> goto bad; clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); sp = sz; // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { 80100c61: 8b 45 0c mov 0xc(%ebp),%eax if(argc >= MAXARG) goto bad; sp = (sp - (strlen(argv[argc]) + 1)) & ~3; if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) goto bad; ustack[3+argc] = sp; 80100c64: 89 9c bd 64 ff ff ff mov %ebx,-0x9c(%ebp,%edi,4) goto bad; clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); sp = sz; // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { 80100c6b: 83 c7 01 add $0x1,%edi if(argc >= MAXARG) goto bad; sp = (sp - (strlen(argv[argc]) + 1)) & ~3; if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) goto bad; ustack[3+argc] = sp; 80100c6e: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx goto bad; clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); sp = sz; // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { 80100c74: 8b 04 b8 mov (%eax,%edi,4),%eax 80100c77: 85 c0 test %eax,%eax 80100c79: 75 a5 jne 80100c20 <exec+0x230> 80100c7b: 8b b5 ec fe ff ff mov -0x114(%ebp),%esi } ustack[3+argc] = 0; ustack[0] = 0xffffffff; // fake return PC ustack[1] = argc; ustack[2] = sp - (argc+1)*4; // argv pointer 80100c81: 8d 04 bd 04 00 00 00 lea 0x4(,%edi,4),%eax 80100c88: 89 d9 mov %ebx,%ecx sp = (sp - (strlen(argv[argc]) + 1)) & ~3; if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) goto bad; ustack[3+argc] = sp; } ustack[3+argc] = 0; 80100c8a: c7 84 bd 64 ff ff ff movl $0x0,-0x9c(%ebp,%edi,4) 80100c91: 00 00 00 00 ustack[0] = 0xffffffff; // fake return PC 80100c95: c7 85 58 ff ff ff ff movl $0xffffffff,-0xa8(%ebp) 80100c9c: ff ff ff ustack[1] = argc; 80100c9f: 89 bd 5c ff ff ff mov %edi,-0xa4(%ebp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100ca5: 29 c1 sub %eax,%ecx sp -= (3+argc+1) * 4; 80100ca7: 83 c0 0c add $0xc,%eax 80100caa: 29 c3 sub %eax,%ebx if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100cac: 50 push %eax 80100cad: 52 push %edx 80100cae: 53 push %ebx 80100caf: ff b5 f0 fe ff ff pushl -0x110(%ebp) } ustack[3+argc] = 0; ustack[0] = 0xffffffff; // fake return PC ustack[1] = argc; ustack[2] = sp - (argc+1)*4; // argv pointer 80100cb5: 89 8d 60 ff ff ff mov %ecx,-0xa0(%ebp) sp -= (3+argc+1) * 4; if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100cbb: e8 30 68 00 00 call 801074f0 <copyout> 80100cc0: 83 c4 10 add $0x10,%esp 80100cc3: 85 c0 test %eax,%eax 80100cc5: 0f 88 d8 fe ff ff js 80100ba3 <exec+0x1b3> goto bad; // Save program name for debugging. for(last=s=path; *s; s++) 80100ccb: 8b 45 08 mov 0x8(%ebp),%eax 80100cce: 0f b6 10 movzbl (%eax),%edx 80100cd1: 84 d2 test %dl,%dl 80100cd3: 74 19 je 80100cee <exec+0x2fe> 80100cd5: 8b 4d 08 mov 0x8(%ebp),%ecx 80100cd8: 83 c0 01 add $0x1,%eax if(*s == '/') last = s+1; 80100cdb: 80 fa 2f cmp $0x2f,%dl sp -= (3+argc+1) * 4; if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) goto bad; // Save program name for debugging. for(last=s=path; *s; s++) 80100cde: 0f b6 10 movzbl (%eax),%edx if(*s == '/') last = s+1; 80100ce1: 0f 44 c8 cmove %eax,%ecx 80100ce4: 83 c0 01 add $0x1,%eax sp -= (3+argc+1) * 4; if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) goto bad; // Save program name for debugging. for(last=s=path; *s; s++) 80100ce7: 84 d2 test %dl,%dl 80100ce9: 75 f0 jne 80100cdb <exec+0x2eb> 80100ceb: 89 4d 08 mov %ecx,0x8(%ebp) if(*s == '/') last = s+1; safestrcpy(curproc->name, last, sizeof(curproc->name)); 80100cee: 8b bd f4 fe ff ff mov -0x10c(%ebp),%edi 80100cf4: 50 push %eax 80100cf5: 6a 10 push $0x10 80100cf7: ff 75 08 pushl 0x8(%ebp) 80100cfa: 89 f8 mov %edi,%eax 80100cfc: 83 c0 6c add $0x6c,%eax 80100cff: 50 push %eax 80100d00: e8 ab 3e 00 00 call 80104bb0 <safestrcpy> // Commit to the user image. oldpgdir = curproc->pgdir; curproc->pgdir = pgdir; 80100d05: 8b 8d f0 fe ff ff mov -0x110(%ebp),%ecx if(*s == '/') last = s+1; safestrcpy(curproc->name, last, sizeof(curproc->name)); // Commit to the user image. oldpgdir = curproc->pgdir; 80100d0b: 89 f8 mov %edi,%eax 80100d0d: 8b 7f 04 mov 0x4(%edi),%edi curproc->pgdir = pgdir; curproc->sz = sz; 80100d10: 89 30 mov %esi,(%eax) last = s+1; safestrcpy(curproc->name, last, sizeof(curproc->name)); // Commit to the user image. oldpgdir = curproc->pgdir; curproc->pgdir = pgdir; 80100d12: 89 48 04 mov %ecx,0x4(%eax) curproc->sz = sz; curproc->tf->eip = elf.entry; // main 80100d15: 89 c1 mov %eax,%ecx 80100d17: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx 80100d1d: 8b 40 18 mov 0x18(%eax),%eax 80100d20: 89 50 38 mov %edx,0x38(%eax) curproc->tf->esp = sp; 80100d23: 8b 41 18 mov 0x18(%ecx),%eax 80100d26: 89 58 44 mov %ebx,0x44(%eax) switchuvm(curproc); 80100d29: 89 0c 24 mov %ecx,(%esp) 80100d2c: e8 bf 61 00 00 call 80106ef0 <switchuvm> freevm(oldpgdir); 80100d31: 89 3c 24 mov %edi,(%esp) 80100d34: e8 37 65 00 00 call 80107270 <freevm> return 0; 80100d39: 83 c4 10 add $0x10,%esp 80100d3c: 31 c0 xor %eax,%eax 80100d3e: e9 19 fd ff ff jmp 80100a5c <exec+0x6c> 80100d43: 66 90 xchg %ax,%ax 80100d45: 66 90 xchg %ax,%ax 80100d47: 66 90 xchg %ax,%ax 80100d49: 66 90 xchg %ax,%ax 80100d4b: 66 90 xchg %ax,%ax 80100d4d: 66 90 xchg %ax,%ax 80100d4f: 90 nop 80100d50 <fileinit>: struct file file[NFILE]; } ftable; void fileinit(void) { 80100d50: 55 push %ebp 80100d51: 89 e5 mov %esp,%ebp 80100d53: 83 ec 10 sub $0x10,%esp initlock(&ftable.lock, "ftable"); 80100d56: 68 2d 76 10 80 push $0x8010762d 80100d5b: 68 c0 0f 11 80 push $0x80110fc0 80100d60: e8 db 39 00 00 call 80104740 <initlock> } 80100d65: 83 c4 10 add $0x10,%esp 80100d68: c9 leave 80100d69: c3 ret 80100d6a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100d70 <filealloc>: // Allocate a file structure. struct file* filealloc(void) { 80100d70: 55 push %ebp 80100d71: 89 e5 mov %esp,%ebp 80100d73: 53 push %ebx struct file *f; acquire(&ftable.lock); for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d74: bb f4 0f 11 80 mov $0x80110ff4,%ebx } // Allocate a file structure. struct file* filealloc(void) { 80100d79: 83 ec 10 sub $0x10,%esp struct file *f; acquire(&ftable.lock); 80100d7c: 68 c0 0f 11 80 push $0x80110fc0 80100d81: e8 ba 3a 00 00 call 80104840 <acquire> 80100d86: 83 c4 10 add $0x10,%esp 80100d89: eb 10 jmp 80100d9b <filealloc+0x2b> 80100d8b: 90 nop 80100d8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d90: 83 c3 18 add $0x18,%ebx 80100d93: 81 fb 54 19 11 80 cmp $0x80111954,%ebx 80100d99: 74 25 je 80100dc0 <filealloc+0x50> if(f->ref == 0){ 80100d9b: 8b 43 04 mov 0x4(%ebx),%eax 80100d9e: 85 c0 test %eax,%eax 80100da0: 75 ee jne 80100d90 <filealloc+0x20> f->ref = 1; release(&ftable.lock); 80100da2: 83 ec 0c sub $0xc,%esp struct file *f; acquire(&ftable.lock); for(f = ftable.file; f < ftable.file + NFILE; f++){ if(f->ref == 0){ f->ref = 1; 80100da5: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) release(&ftable.lock); 80100dac: 68 c0 0f 11 80 push $0x80110fc0 80100db1: e8 aa 3b 00 00 call 80104960 <release> return f; 80100db6: 89 d8 mov %ebx,%eax 80100db8: 83 c4 10 add $0x10,%esp } } release(&ftable.lock); return 0; } 80100dbb: 8b 5d fc mov -0x4(%ebp),%ebx 80100dbe: c9 leave 80100dbf: c3 ret f->ref = 1; release(&ftable.lock); return f; } } release(&ftable.lock); 80100dc0: 83 ec 0c sub $0xc,%esp 80100dc3: 68 c0 0f 11 80 push $0x80110fc0 80100dc8: e8 93 3b 00 00 call 80104960 <release> return 0; 80100dcd: 83 c4 10 add $0x10,%esp 80100dd0: 31 c0 xor %eax,%eax } 80100dd2: 8b 5d fc mov -0x4(%ebp),%ebx 80100dd5: c9 leave 80100dd6: c3 ret 80100dd7: 89 f6 mov %esi,%esi 80100dd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100de0 <filedup>: // Increment ref count for file f. struct file* filedup(struct file *f) { 80100de0: 55 push %ebp 80100de1: 89 e5 mov %esp,%ebp 80100de3: 53 push %ebx 80100de4: 83 ec 10 sub $0x10,%esp 80100de7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ftable.lock); 80100dea: 68 c0 0f 11 80 push $0x80110fc0 80100def: e8 4c 3a 00 00 call 80104840 <acquire> if(f->ref < 1) 80100df4: 8b 43 04 mov 0x4(%ebx),%eax 80100df7: 83 c4 10 add $0x10,%esp 80100dfa: 85 c0 test %eax,%eax 80100dfc: 7e 1a jle 80100e18 <filedup+0x38> panic("filedup"); f->ref++; 80100dfe: 83 c0 01 add $0x1,%eax release(&ftable.lock); 80100e01: 83 ec 0c sub $0xc,%esp filedup(struct file *f) { acquire(&ftable.lock); if(f->ref < 1) panic("filedup"); f->ref++; 80100e04: 89 43 04 mov %eax,0x4(%ebx) release(&ftable.lock); 80100e07: 68 c0 0f 11 80 push $0x80110fc0 80100e0c: e8 4f 3b 00 00 call 80104960 <release> return f; } 80100e11: 89 d8 mov %ebx,%eax 80100e13: 8b 5d fc mov -0x4(%ebp),%ebx 80100e16: c9 leave 80100e17: c3 ret struct file* filedup(struct file *f) { acquire(&ftable.lock); if(f->ref < 1) panic("filedup"); 80100e18: 83 ec 0c sub $0xc,%esp 80100e1b: 68 34 76 10 80 push $0x80107634 80100e20: e8 4b f5 ff ff call 80100370 <panic> 80100e25: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100e29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100e30 <fileclose>: } // Close file f. (Decrement ref count, close when reaches 0.) void fileclose(struct file *f) { 80100e30: 55 push %ebp 80100e31: 89 e5 mov %esp,%ebp 80100e33: 57 push %edi 80100e34: 56 push %esi 80100e35: 53 push %ebx 80100e36: 83 ec 28 sub $0x28,%esp 80100e39: 8b 7d 08 mov 0x8(%ebp),%edi struct file ff; acquire(&ftable.lock); 80100e3c: 68 c0 0f 11 80 push $0x80110fc0 80100e41: e8 fa 39 00 00 call 80104840 <acquire> if(f->ref < 1) 80100e46: 8b 47 04 mov 0x4(%edi),%eax 80100e49: 83 c4 10 add $0x10,%esp 80100e4c: 85 c0 test %eax,%eax 80100e4e: 0f 8e 9b 00 00 00 jle 80100eef <fileclose+0xbf> panic("fileclose"); if(--f->ref > 0){ 80100e54: 83 e8 01 sub $0x1,%eax 80100e57: 85 c0 test %eax,%eax 80100e59: 89 47 04 mov %eax,0x4(%edi) 80100e5c: 74 1a je 80100e78 <fileclose+0x48> release(&ftable.lock); 80100e5e: c7 45 08 c0 0f 11 80 movl $0x80110fc0,0x8(%ebp) else if(ff.type == FD_INODE){ begin_op(); iput(ff.ip); end_op(); } } 80100e65: 8d 65 f4 lea -0xc(%ebp),%esp 80100e68: 5b pop %ebx 80100e69: 5e pop %esi 80100e6a: 5f pop %edi 80100e6b: 5d pop %ebp acquire(&ftable.lock); if(f->ref < 1) panic("fileclose"); if(--f->ref > 0){ release(&ftable.lock); 80100e6c: e9 ef 3a 00 00 jmp 80104960 <release> 80100e71: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return; } ff = *f; 80100e78: 0f b6 47 09 movzbl 0x9(%edi),%eax 80100e7c: 8b 1f mov (%edi),%ebx f->ref = 0; f->type = FD_NONE; release(&ftable.lock); 80100e7e: 83 ec 0c sub $0xc,%esp panic("fileclose"); if(--f->ref > 0){ release(&ftable.lock); return; } ff = *f; 80100e81: 8b 77 0c mov 0xc(%edi),%esi f->ref = 0; f->type = FD_NONE; 80100e84: c7 07 00 00 00 00 movl $0x0,(%edi) panic("fileclose"); if(--f->ref > 0){ release(&ftable.lock); return; } ff = *f; 80100e8a: 88 45 e7 mov %al,-0x19(%ebp) 80100e8d: 8b 47 10 mov 0x10(%edi),%eax f->ref = 0; f->type = FD_NONE; release(&ftable.lock); 80100e90: 68 c0 0f 11 80 push $0x80110fc0 panic("fileclose"); if(--f->ref > 0){ release(&ftable.lock); return; } ff = *f; 80100e95: 89 45 e0 mov %eax,-0x20(%ebp) f->ref = 0; f->type = FD_NONE; release(&ftable.lock); 80100e98: e8 c3 3a 00 00 call 80104960 <release> if(ff.type == FD_PIPE) 80100e9d: 83 c4 10 add $0x10,%esp 80100ea0: 83 fb 01 cmp $0x1,%ebx 80100ea3: 74 13 je 80100eb8 <fileclose+0x88> pipeclose(ff.pipe, ff.writable); else if(ff.type == FD_INODE){ 80100ea5: 83 fb 02 cmp $0x2,%ebx 80100ea8: 74 26 je 80100ed0 <fileclose+0xa0> begin_op(); iput(ff.ip); end_op(); } } 80100eaa: 8d 65 f4 lea -0xc(%ebp),%esp 80100ead: 5b pop %ebx 80100eae: 5e pop %esi 80100eaf: 5f pop %edi 80100eb0: 5d pop %ebp 80100eb1: c3 ret 80100eb2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi f->ref = 0; f->type = FD_NONE; release(&ftable.lock); if(ff.type == FD_PIPE) pipeclose(ff.pipe, ff.writable); 80100eb8: 0f be 5d e7 movsbl -0x19(%ebp),%ebx 80100ebc: 83 ec 08 sub $0x8,%esp 80100ebf: 53 push %ebx 80100ec0: 56 push %esi 80100ec1: e8 2a 24 00 00 call 801032f0 <pipeclose> 80100ec6: 83 c4 10 add $0x10,%esp 80100ec9: eb df jmp 80100eaa <fileclose+0x7a> 80100ecb: 90 nop 80100ecc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi else if(ff.type == FD_INODE){ begin_op(); 80100ed0: e8 7b 1c 00 00 call 80102b50 <begin_op> iput(ff.ip); 80100ed5: 83 ec 0c sub $0xc,%esp 80100ed8: ff 75 e0 pushl -0x20(%ebp) 80100edb: e8 c0 08 00 00 call 801017a0 <iput> end_op(); 80100ee0: 83 c4 10 add $0x10,%esp } } 80100ee3: 8d 65 f4 lea -0xc(%ebp),%esp 80100ee6: 5b pop %ebx 80100ee7: 5e pop %esi 80100ee8: 5f pop %edi 80100ee9: 5d pop %ebp if(ff.type == FD_PIPE) pipeclose(ff.pipe, ff.writable); else if(ff.type == FD_INODE){ begin_op(); iput(ff.ip); end_op(); 80100eea: e9 d1 1c 00 00 jmp 80102bc0 <end_op> { struct file ff; acquire(&ftable.lock); if(f->ref < 1) panic("fileclose"); 80100eef: 83 ec 0c sub $0xc,%esp 80100ef2: 68 3c 76 10 80 push $0x8010763c 80100ef7: e8 74 f4 ff ff call 80100370 <panic> 80100efc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100f00 <filestat>: } // Get metadata about file f. int filestat(struct file *f, struct stat *st) { 80100f00: 55 push %ebp 80100f01: 89 e5 mov %esp,%ebp 80100f03: 53 push %ebx 80100f04: 83 ec 04 sub $0x4,%esp 80100f07: 8b 5d 08 mov 0x8(%ebp),%ebx if(f->type == FD_INODE){ 80100f0a: 83 3b 02 cmpl $0x2,(%ebx) 80100f0d: 75 31 jne 80100f40 <filestat+0x40> ilock(f->ip); 80100f0f: 83 ec 0c sub $0xc,%esp 80100f12: ff 73 10 pushl 0x10(%ebx) 80100f15: e8 56 07 00 00 call 80101670 <ilock> stati(f->ip, st); 80100f1a: 58 pop %eax 80100f1b: 5a pop %edx 80100f1c: ff 75 0c pushl 0xc(%ebp) 80100f1f: ff 73 10 pushl 0x10(%ebx) 80100f22: e8 f9 09 00 00 call 80101920 <stati> iunlock(f->ip); 80100f27: 59 pop %ecx 80100f28: ff 73 10 pushl 0x10(%ebx) 80100f2b: e8 20 08 00 00 call 80101750 <iunlock> return 0; 80100f30: 83 c4 10 add $0x10,%esp 80100f33: 31 c0 xor %eax,%eax } return -1; } 80100f35: 8b 5d fc mov -0x4(%ebp),%ebx 80100f38: c9 leave 80100f39: c3 ret 80100f3a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi ilock(f->ip); stati(f->ip, st); iunlock(f->ip); return 0; } return -1; 80100f40: b8 ff ff ff ff mov $0xffffffff,%eax } 80100f45: 8b 5d fc mov -0x4(%ebp),%ebx 80100f48: c9 leave 80100f49: c3 ret 80100f4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100f50 <fileread>: // Read from file f. int fileread(struct file *f, char *addr, int n) { 80100f50: 55 push %ebp 80100f51: 89 e5 mov %esp,%ebp 80100f53: 57 push %edi 80100f54: 56 push %esi 80100f55: 53 push %ebx 80100f56: 83 ec 0c sub $0xc,%esp 80100f59: 8b 5d 08 mov 0x8(%ebp),%ebx 80100f5c: 8b 75 0c mov 0xc(%ebp),%esi 80100f5f: 8b 7d 10 mov 0x10(%ebp),%edi int r; if(f->readable == 0) 80100f62: 80 7b 08 00 cmpb $0x0,0x8(%ebx) 80100f66: 74 60 je 80100fc8 <fileread+0x78> return -1; if(f->type == FD_PIPE) 80100f68: 8b 03 mov (%ebx),%eax 80100f6a: 83 f8 01 cmp $0x1,%eax 80100f6d: 74 41 je 80100fb0 <fileread+0x60> return piperead(f->pipe, addr, n); if(f->type == FD_INODE){ 80100f6f: 83 f8 02 cmp $0x2,%eax 80100f72: 75 5b jne 80100fcf <fileread+0x7f> ilock(f->ip); 80100f74: 83 ec 0c sub $0xc,%esp 80100f77: ff 73 10 pushl 0x10(%ebx) 80100f7a: e8 f1 06 00 00 call 80101670 <ilock> if((r = readi(f->ip, addr, f->off, n)) > 0) 80100f7f: 57 push %edi 80100f80: ff 73 14 pushl 0x14(%ebx) 80100f83: 56 push %esi 80100f84: ff 73 10 pushl 0x10(%ebx) 80100f87: e8 c4 09 00 00 call 80101950 <readi> 80100f8c: 83 c4 20 add $0x20,%esp 80100f8f: 85 c0 test %eax,%eax 80100f91: 89 c6 mov %eax,%esi 80100f93: 7e 03 jle 80100f98 <fileread+0x48> f->off += r; 80100f95: 01 43 14 add %eax,0x14(%ebx) iunlock(f->ip); 80100f98: 83 ec 0c sub $0xc,%esp 80100f9b: ff 73 10 pushl 0x10(%ebx) 80100f9e: e8 ad 07 00 00 call 80101750 <iunlock> return r; 80100fa3: 83 c4 10 add $0x10,%esp return -1; if(f->type == FD_PIPE) return piperead(f->pipe, addr, n); if(f->type == FD_INODE){ ilock(f->ip); if((r = readi(f->ip, addr, f->off, n)) > 0) 80100fa6: 89 f0 mov %esi,%eax f->off += r; iunlock(f->ip); return r; } panic("fileread"); } 80100fa8: 8d 65 f4 lea -0xc(%ebp),%esp 80100fab: 5b pop %ebx 80100fac: 5e pop %esi 80100fad: 5f pop %edi 80100fae: 5d pop %ebp 80100faf: c3 ret int r; if(f->readable == 0) return -1; if(f->type == FD_PIPE) return piperead(f->pipe, addr, n); 80100fb0: 8b 43 0c mov 0xc(%ebx),%eax 80100fb3: 89 45 08 mov %eax,0x8(%ebp) f->off += r; iunlock(f->ip); return r; } panic("fileread"); } 80100fb6: 8d 65 f4 lea -0xc(%ebp),%esp 80100fb9: 5b pop %ebx 80100fba: 5e pop %esi 80100fbb: 5f pop %edi 80100fbc: 5d pop %ebp int r; if(f->readable == 0) return -1; if(f->type == FD_PIPE) return piperead(f->pipe, addr, n); 80100fbd: e9 ce 24 00 00 jmp 80103490 <piperead> 80100fc2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi fileread(struct file *f, char *addr, int n) { int r; if(f->readable == 0) return -1; 80100fc8: b8 ff ff ff ff mov $0xffffffff,%eax 80100fcd: eb d9 jmp 80100fa8 <fileread+0x58> if((r = readi(f->ip, addr, f->off, n)) > 0) f->off += r; iunlock(f->ip); return r; } panic("fileread"); 80100fcf: 83 ec 0c sub $0xc,%esp 80100fd2: 68 46 76 10 80 push $0x80107646 80100fd7: e8 94 f3 ff ff call 80100370 <panic> 80100fdc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100fe0 <filewrite>: //PAGEBREAK! // Write to file f. int filewrite(struct file *f, char *addr, int n) { 80100fe0: 55 push %ebp 80100fe1: 89 e5 mov %esp,%ebp 80100fe3: 57 push %edi 80100fe4: 56 push %esi 80100fe5: 53 push %ebx 80100fe6: 83 ec 1c sub $0x1c,%esp 80100fe9: 8b 75 08 mov 0x8(%ebp),%esi 80100fec: 8b 45 0c mov 0xc(%ebp),%eax int r; if(f->writable == 0) 80100fef: 80 7e 09 00 cmpb $0x0,0x9(%esi) //PAGEBREAK! // Write to file f. int filewrite(struct file *f, char *addr, int n) { 80100ff3: 89 45 dc mov %eax,-0x24(%ebp) 80100ff6: 8b 45 10 mov 0x10(%ebp),%eax 80100ff9: 89 45 e4 mov %eax,-0x1c(%ebp) int r; if(f->writable == 0) 80100ffc: 0f 84 aa 00 00 00 je 801010ac <filewrite+0xcc> return -1; if(f->type == FD_PIPE) 80101002: 8b 06 mov (%esi),%eax 80101004: 83 f8 01 cmp $0x1,%eax 80101007: 0f 84 c2 00 00 00 je 801010cf <filewrite+0xef> return pipewrite(f->pipe, addr, n); if(f->type == FD_INODE){ 8010100d: 83 f8 02 cmp $0x2,%eax 80101010: 0f 85 d8 00 00 00 jne 801010ee <filewrite+0x10e> // 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 = ((MAXOPBLOCKS-1-1-2) / 2) * 512; int i = 0; while(i < n){ 80101016: 8b 45 e4 mov -0x1c(%ebp),%eax 80101019: 31 ff xor %edi,%edi 8010101b: 85 c0 test %eax,%eax 8010101d: 7f 34 jg 80101053 <filewrite+0x73> 8010101f: e9 9c 00 00 00 jmp 801010c0 <filewrite+0xe0> 80101024: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi n1 = max; begin_op(); ilock(f->ip); if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) f->off += r; 80101028: 01 46 14 add %eax,0x14(%esi) iunlock(f->ip); 8010102b: 83 ec 0c sub $0xc,%esp 8010102e: ff 76 10 pushl 0x10(%esi) n1 = max; begin_op(); ilock(f->ip); if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) f->off += r; 80101031: 89 45 e0 mov %eax,-0x20(%ebp) iunlock(f->ip); 80101034: e8 17 07 00 00 call 80101750 <iunlock> end_op(); 80101039: e8 82 1b 00 00 call 80102bc0 <end_op> 8010103e: 8b 45 e0 mov -0x20(%ebp),%eax 80101041: 83 c4 10 add $0x10,%esp if(r < 0) break; if(r != n1) 80101044: 39 d8 cmp %ebx,%eax 80101046: 0f 85 95 00 00 00 jne 801010e1 <filewrite+0x101> panic("short filewrite"); i += r; 8010104c: 01 c7 add %eax,%edi // 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 = ((MAXOPBLOCKS-1-1-2) / 2) * 512; int i = 0; while(i < n){ 8010104e: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101051: 7e 6d jle 801010c0 <filewrite+0xe0> int n1 = n - i; 80101053: 8b 5d e4 mov -0x1c(%ebp),%ebx 80101056: b8 00 06 00 00 mov $0x600,%eax 8010105b: 29 fb sub %edi,%ebx 8010105d: 81 fb 00 06 00 00 cmp $0x600,%ebx 80101063: 0f 4f d8 cmovg %eax,%ebx if(n1 > max) n1 = max; begin_op(); 80101066: e8 e5 1a 00 00 call 80102b50 <begin_op> ilock(f->ip); 8010106b: 83 ec 0c sub $0xc,%esp 8010106e: ff 76 10 pushl 0x10(%esi) 80101071: e8 fa 05 00 00 call 80101670 <ilock> if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) 80101076: 8b 45 dc mov -0x24(%ebp),%eax 80101079: 53 push %ebx 8010107a: ff 76 14 pushl 0x14(%esi) 8010107d: 01 f8 add %edi,%eax 8010107f: 50 push %eax 80101080: ff 76 10 pushl 0x10(%esi) 80101083: e8 c8 09 00 00 call 80101a50 <writei> 80101088: 83 c4 20 add $0x20,%esp 8010108b: 85 c0 test %eax,%eax 8010108d: 7f 99 jg 80101028 <filewrite+0x48> f->off += r; iunlock(f->ip); 8010108f: 83 ec 0c sub $0xc,%esp 80101092: ff 76 10 pushl 0x10(%esi) 80101095: 89 45 e0 mov %eax,-0x20(%ebp) 80101098: e8 b3 06 00 00 call 80101750 <iunlock> end_op(); 8010109d: e8 1e 1b 00 00 call 80102bc0 <end_op> if(r < 0) 801010a2: 8b 45 e0 mov -0x20(%ebp),%eax 801010a5: 83 c4 10 add $0x10,%esp 801010a8: 85 c0 test %eax,%eax 801010aa: 74 98 je 80101044 <filewrite+0x64> i += r; } return i == n ? n : -1; } panic("filewrite"); } 801010ac: 8d 65 f4 lea -0xc(%ebp),%esp break; if(r != n1) panic("short filewrite"); i += r; } return i == n ? n : -1; 801010af: b8 ff ff ff ff mov $0xffffffff,%eax } panic("filewrite"); } 801010b4: 5b pop %ebx 801010b5: 5e pop %esi 801010b6: 5f pop %edi 801010b7: 5d pop %ebp 801010b8: c3 ret 801010b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi break; if(r != n1) panic("short filewrite"); i += r; } return i == n ? n : -1; 801010c0: 3b 7d e4 cmp -0x1c(%ebp),%edi 801010c3: 75 e7 jne 801010ac <filewrite+0xcc> } panic("filewrite"); } 801010c5: 8d 65 f4 lea -0xc(%ebp),%esp 801010c8: 89 f8 mov %edi,%eax 801010ca: 5b pop %ebx 801010cb: 5e pop %esi 801010cc: 5f pop %edi 801010cd: 5d pop %ebp 801010ce: c3 ret int r; if(f->writable == 0) return -1; if(f->type == FD_PIPE) return pipewrite(f->pipe, addr, n); 801010cf: 8b 46 0c mov 0xc(%esi),%eax 801010d2: 89 45 08 mov %eax,0x8(%ebp) i += r; } return i == n ? n : -1; } panic("filewrite"); } 801010d5: 8d 65 f4 lea -0xc(%ebp),%esp 801010d8: 5b pop %ebx 801010d9: 5e pop %esi 801010da: 5f pop %edi 801010db: 5d pop %ebp int r; if(f->writable == 0) return -1; if(f->type == FD_PIPE) return pipewrite(f->pipe, addr, n); 801010dc: e9 af 22 00 00 jmp 80103390 <pipewrite> end_op(); if(r < 0) break; if(r != n1) panic("short filewrite"); 801010e1: 83 ec 0c sub $0xc,%esp 801010e4: 68 4f 76 10 80 push $0x8010764f 801010e9: e8 82 f2 ff ff call 80100370 <panic> i += r; } return i == n ? n : -1; } panic("filewrite"); 801010ee: 83 ec 0c sub $0xc,%esp 801010f1: 68 55 76 10 80 push $0x80107655 801010f6: e8 75 f2 ff ff call 80100370 <panic> 801010fb: 66 90 xchg %ax,%ax 801010fd: 66 90 xchg %ax,%ax 801010ff: 90 nop 80101100 <balloc>: // Blocks. // Allocate a zeroed disk block. static uint balloc(uint dev) { 80101100: 55 push %ebp 80101101: 89 e5 mov %esp,%ebp 80101103: 57 push %edi 80101104: 56 push %esi 80101105: 53 push %ebx 80101106: 83 ec 1c sub $0x1c,%esp int b, bi, m; struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ 80101109: 8b 0d c0 19 11 80 mov 0x801119c0,%ecx // Blocks. // Allocate a zeroed disk block. static uint balloc(uint dev) { 8010110f: 89 45 d8 mov %eax,-0x28(%ebp) int b, bi, m; struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ 80101112: 85 c9 test %ecx,%ecx 80101114: 0f 84 85 00 00 00 je 8010119f <balloc+0x9f> 8010111a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) bp = bread(dev, BBLOCK(b, sb)); 80101121: 8b 75 dc mov -0x24(%ebp),%esi 80101124: 83 ec 08 sub $0x8,%esp 80101127: 89 f0 mov %esi,%eax 80101129: c1 f8 0c sar $0xc,%eax 8010112c: 03 05 d8 19 11 80 add 0x801119d8,%eax 80101132: 50 push %eax 80101133: ff 75 d8 pushl -0x28(%ebp) 80101136: e8 95 ef ff ff call 801000d0 <bread> 8010113b: 89 45 e4 mov %eax,-0x1c(%ebp) 8010113e: a1 c0 19 11 80 mov 0x801119c0,%eax 80101143: 83 c4 10 add $0x10,%esp 80101146: 89 45 e0 mov %eax,-0x20(%ebp) for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 80101149: 31 c0 xor %eax,%eax 8010114b: eb 2d jmp 8010117a <balloc+0x7a> 8010114d: 8d 76 00 lea 0x0(%esi),%esi m = 1 << (bi % 8); 80101150: 89 c1 mov %eax,%ecx 80101152: ba 01 00 00 00 mov $0x1,%edx if((bp->data[bi/8] & m) == 0){ // Is block free? 80101157: 8b 5d e4 mov -0x1c(%ebp),%ebx bp = 0; for(b = 0; b < sb.size; b += BPB){ bp = bread(dev, BBLOCK(b, sb)); for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ m = 1 << (bi % 8); 8010115a: 83 e1 07 and $0x7,%ecx 8010115d: d3 e2 shl %cl,%edx if((bp->data[bi/8] & m) == 0){ // Is block free? 8010115f: 89 c1 mov %eax,%ecx 80101161: c1 f9 03 sar $0x3,%ecx 80101164: 0f b6 7c 0b 5c movzbl 0x5c(%ebx,%ecx,1),%edi 80101169: 85 d7 test %edx,%edi 8010116b: 74 43 je 801011b0 <balloc+0xb0> struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ bp = bread(dev, BBLOCK(b, sb)); for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 8010116d: 83 c0 01 add $0x1,%eax 80101170: 83 c6 01 add $0x1,%esi 80101173: 3d 00 10 00 00 cmp $0x1000,%eax 80101178: 74 05 je 8010117f <balloc+0x7f> 8010117a: 3b 75 e0 cmp -0x20(%ebp),%esi 8010117d: 72 d1 jb 80101150 <balloc+0x50> brelse(bp); bzero(dev, b + bi); return b + bi; } } brelse(bp); 8010117f: 83 ec 0c sub $0xc,%esp 80101182: ff 75 e4 pushl -0x1c(%ebp) 80101185: e8 56 f0 ff ff call 801001e0 <brelse> { int b, bi, m; struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ 8010118a: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp) 80101191: 83 c4 10 add $0x10,%esp 80101194: 8b 45 dc mov -0x24(%ebp),%eax 80101197: 39 05 c0 19 11 80 cmp %eax,0x801119c0 8010119d: 77 82 ja 80101121 <balloc+0x21> return b + bi; } } brelse(bp); } panic("balloc: out of blocks"); 8010119f: 83 ec 0c sub $0xc,%esp 801011a2: 68 5f 76 10 80 push $0x8010765f 801011a7: e8 c4 f1 ff ff call 80100370 <panic> 801011ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(b = 0; b < sb.size; b += BPB){ bp = bread(dev, BBLOCK(b, sb)); for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ m = 1 << (bi % 8); if((bp->data[bi/8] & m) == 0){ // Is block free? bp->data[bi/8] |= m; // Mark block in use. 801011b0: 09 fa or %edi,%edx 801011b2: 8b 7d e4 mov -0x1c(%ebp),%edi log_write(bp); 801011b5: 83 ec 0c sub $0xc,%esp for(b = 0; b < sb.size; b += BPB){ bp = bread(dev, BBLOCK(b, sb)); for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ m = 1 << (bi % 8); if((bp->data[bi/8] & m) == 0){ // Is block free? bp->data[bi/8] |= m; // Mark block in use. 801011b8: 88 54 0f 5c mov %dl,0x5c(%edi,%ecx,1) log_write(bp); 801011bc: 57 push %edi 801011bd: e8 6e 1b 00 00 call 80102d30 <log_write> brelse(bp); 801011c2: 89 3c 24 mov %edi,(%esp) 801011c5: e8 16 f0 ff ff call 801001e0 <brelse> static void bzero(int dev, int bno) { struct buf *bp; bp = bread(dev, bno); 801011ca: 58 pop %eax 801011cb: 5a pop %edx 801011cc: 56 push %esi 801011cd: ff 75 d8 pushl -0x28(%ebp) 801011d0: e8 fb ee ff ff call 801000d0 <bread> 801011d5: 89 c3 mov %eax,%ebx memset(bp->data, 0, BSIZE); 801011d7: 8d 40 5c lea 0x5c(%eax),%eax 801011da: 83 c4 0c add $0xc,%esp 801011dd: 68 00 02 00 00 push $0x200 801011e2: 6a 00 push $0x0 801011e4: 50 push %eax 801011e5: e8 c6 37 00 00 call 801049b0 <memset> log_write(bp); 801011ea: 89 1c 24 mov %ebx,(%esp) 801011ed: e8 3e 1b 00 00 call 80102d30 <log_write> brelse(bp); 801011f2: 89 1c 24 mov %ebx,(%esp) 801011f5: e8 e6 ef ff ff call 801001e0 <brelse> } } brelse(bp); } panic("balloc: out of blocks"); } 801011fa: 8d 65 f4 lea -0xc(%ebp),%esp 801011fd: 89 f0 mov %esi,%eax 801011ff: 5b pop %ebx 80101200: 5e pop %esi 80101201: 5f pop %edi 80101202: 5d pop %ebp 80101203: c3 ret 80101204: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010120a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101210 <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) { 80101210: 55 push %ebp 80101211: 89 e5 mov %esp,%ebp 80101213: 57 push %edi 80101214: 56 push %esi 80101215: 53 push %ebx 80101216: 89 c7 mov %eax,%edi struct inode *ip, *empty; acquire(&icache.lock); // Is the inode already cached? empty = 0; 80101218: 31 f6 xor %esi,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010121a: bb 14 1a 11 80 mov $0x80111a14,%ebx // 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) { 8010121f: 83 ec 28 sub $0x28,%esp 80101222: 89 55 e4 mov %edx,-0x1c(%ebp) struct inode *ip, *empty; acquire(&icache.lock); 80101225: 68 e0 19 11 80 push $0x801119e0 8010122a: e8 11 36 00 00 call 80104840 <acquire> 8010122f: 83 c4 10 add $0x10,%esp // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 80101232: 8b 55 e4 mov -0x1c(%ebp),%edx 80101235: eb 1b jmp 80101252 <iget+0x42> 80101237: 89 f6 mov %esi,%esi 80101239: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 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. 80101240: 85 f6 test %esi,%esi 80101242: 74 44 je 80101288 <iget+0x78> acquire(&icache.lock); // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 80101244: 81 c3 90 00 00 00 add $0x90,%ebx 8010124a: 81 fb 34 36 11 80 cmp $0x80113634,%ebx 80101250: 74 4e je 801012a0 <iget+0x90> if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 80101252: 8b 4b 08 mov 0x8(%ebx),%ecx 80101255: 85 c9 test %ecx,%ecx 80101257: 7e e7 jle 80101240 <iget+0x30> 80101259: 39 3b cmp %edi,(%ebx) 8010125b: 75 e3 jne 80101240 <iget+0x30> 8010125d: 39 53 04 cmp %edx,0x4(%ebx) 80101260: 75 de jne 80101240 <iget+0x30> ip->ref++; release(&icache.lock); 80101262: 83 ec 0c sub $0xc,%esp // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ ip->ref++; 80101265: 83 c1 01 add $0x1,%ecx release(&icache.lock); return ip; 80101268: 89 de mov %ebx,%esi // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ ip->ref++; release(&icache.lock); 8010126a: 68 e0 19 11 80 push $0x801119e0 // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ ip->ref++; 8010126f: 89 4b 08 mov %ecx,0x8(%ebx) release(&icache.lock); 80101272: e8 e9 36 00 00 call 80104960 <release> return ip; 80101277: 83 c4 10 add $0x10,%esp ip->ref = 1; ip->valid = 0; release(&icache.lock); return ip; } 8010127a: 8d 65 f4 lea -0xc(%ebp),%esp 8010127d: 89 f0 mov %esi,%eax 8010127f: 5b pop %ebx 80101280: 5e pop %esi 80101281: 5f pop %edi 80101282: 5d pop %ebp 80101283: c3 ret 80101284: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 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. 80101288: 85 c9 test %ecx,%ecx 8010128a: 0f 44 f3 cmove %ebx,%esi acquire(&icache.lock); // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010128d: 81 c3 90 00 00 00 add $0x90,%ebx 80101293: 81 fb 34 36 11 80 cmp $0x80113634,%ebx 80101299: 75 b7 jne 80101252 <iget+0x42> 8010129b: 90 nop 8010129c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(empty == 0 && ip->ref == 0) // Remember empty slot. empty = ip; } // Recycle an inode cache entry. if(empty == 0) 801012a0: 85 f6 test %esi,%esi 801012a2: 74 2d je 801012d1 <iget+0xc1> ip = empty; ip->dev = dev; ip->inum = inum; ip->ref = 1; ip->valid = 0; release(&icache.lock); 801012a4: 83 ec 0c sub $0xc,%esp // Recycle an inode cache entry. if(empty == 0) panic("iget: no inodes"); ip = empty; ip->dev = dev; 801012a7: 89 3e mov %edi,(%esi) ip->inum = inum; 801012a9: 89 56 04 mov %edx,0x4(%esi) ip->ref = 1; 801012ac: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi) ip->valid = 0; 801012b3: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) release(&icache.lock); 801012ba: 68 e0 19 11 80 push $0x801119e0 801012bf: e8 9c 36 00 00 call 80104960 <release> return ip; 801012c4: 83 c4 10 add $0x10,%esp } 801012c7: 8d 65 f4 lea -0xc(%ebp),%esp 801012ca: 89 f0 mov %esi,%eax 801012cc: 5b pop %ebx 801012cd: 5e pop %esi 801012ce: 5f pop %edi 801012cf: 5d pop %ebp 801012d0: c3 ret empty = ip; } // Recycle an inode cache entry. if(empty == 0) panic("iget: no inodes"); 801012d1: 83 ec 0c sub $0xc,%esp 801012d4: 68 75 76 10 80 push $0x80107675 801012d9: e8 92 f0 ff ff call 80100370 <panic> 801012de: 66 90 xchg %ax,%ax 801012e0 <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) { 801012e0: 55 push %ebp 801012e1: 89 e5 mov %esp,%ebp 801012e3: 57 push %edi 801012e4: 56 push %esi 801012e5: 53 push %ebx 801012e6: 89 c6 mov %eax,%esi 801012e8: 83 ec 1c sub $0x1c,%esp uint addr, *a; struct buf *bp; if(bn < NDIRECT){ 801012eb: 83 fa 0b cmp $0xb,%edx 801012ee: 77 18 ja 80101308 <bmap+0x28> 801012f0: 8d 1c 90 lea (%eax,%edx,4),%ebx if((addr = ip->addrs[bn]) == 0) 801012f3: 8b 43 5c mov 0x5c(%ebx),%eax 801012f6: 85 c0 test %eax,%eax 801012f8: 74 76 je 80101370 <bmap+0x90> brelse(bp); return addr; } panic("bmap: out of range"); } 801012fa: 8d 65 f4 lea -0xc(%ebp),%esp 801012fd: 5b pop %ebx 801012fe: 5e pop %esi 801012ff: 5f pop %edi 80101300: 5d pop %ebp 80101301: c3 ret 80101302: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(bn < NDIRECT){ if((addr = ip->addrs[bn]) == 0) ip->addrs[bn] = addr = balloc(ip->dev); return addr; } bn -= NDIRECT; 80101308: 8d 5a f4 lea -0xc(%edx),%ebx if(bn < NINDIRECT){ 8010130b: 83 fb 7f cmp $0x7f,%ebx 8010130e: 0f 87 83 00 00 00 ja 80101397 <bmap+0xb7> // Load indirect block, allocating if necessary. if((addr = ip->addrs[NDIRECT]) == 0) 80101314: 8b 80 8c 00 00 00 mov 0x8c(%eax),%eax 8010131a: 85 c0 test %eax,%eax 8010131c: 74 6a je 80101388 <bmap+0xa8> ip->addrs[NDIRECT] = addr = balloc(ip->dev); bp = bread(ip->dev, addr); 8010131e: 83 ec 08 sub $0x8,%esp 80101321: 50 push %eax 80101322: ff 36 pushl (%esi) 80101324: e8 a7 ed ff ff call 801000d0 <bread> a = (uint*)bp->data; if((addr = a[bn]) == 0){ 80101329: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx 8010132d: 83 c4 10 add $0x10,%esp if(bn < NINDIRECT){ // Load indirect block, allocating if necessary. if((addr = ip->addrs[NDIRECT]) == 0) ip->addrs[NDIRECT] = addr = balloc(ip->dev); bp = bread(ip->dev, addr); 80101330: 89 c7 mov %eax,%edi a = (uint*)bp->data; if((addr = a[bn]) == 0){ 80101332: 8b 1a mov (%edx),%ebx 80101334: 85 db test %ebx,%ebx 80101336: 75 1d jne 80101355 <bmap+0x75> a[bn] = addr = balloc(ip->dev); 80101338: 8b 06 mov (%esi),%eax 8010133a: 89 55 e4 mov %edx,-0x1c(%ebp) 8010133d: e8 be fd ff ff call 80101100 <balloc> 80101342: 8b 55 e4 mov -0x1c(%ebp),%edx log_write(bp); 80101345: 83 ec 0c sub $0xc,%esp if((addr = ip->addrs[NDIRECT]) == 0) ip->addrs[NDIRECT] = addr = balloc(ip->dev); bp = bread(ip->dev, addr); a = (uint*)bp->data; if((addr = a[bn]) == 0){ a[bn] = addr = balloc(ip->dev); 80101348: 89 c3 mov %eax,%ebx 8010134a: 89 02 mov %eax,(%edx) log_write(bp); 8010134c: 57 push %edi 8010134d: e8 de 19 00 00 call 80102d30 <log_write> 80101352: 83 c4 10 add $0x10,%esp } brelse(bp); 80101355: 83 ec 0c sub $0xc,%esp 80101358: 57 push %edi 80101359: e8 82 ee ff ff call 801001e0 <brelse> 8010135e: 83 c4 10 add $0x10,%esp return addr; } panic("bmap: out of range"); } 80101361: 8d 65 f4 lea -0xc(%ebp),%esp a = (uint*)bp->data; if((addr = a[bn]) == 0){ a[bn] = addr = balloc(ip->dev); log_write(bp); } brelse(bp); 80101364: 89 d8 mov %ebx,%eax return addr; } panic("bmap: out of range"); } 80101366: 5b pop %ebx 80101367: 5e pop %esi 80101368: 5f pop %edi 80101369: 5d pop %ebp 8010136a: c3 ret 8010136b: 90 nop 8010136c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uint addr, *a; struct buf *bp; if(bn < NDIRECT){ if((addr = ip->addrs[bn]) == 0) ip->addrs[bn] = addr = balloc(ip->dev); 80101370: 8b 06 mov (%esi),%eax 80101372: e8 89 fd ff ff call 80101100 <balloc> 80101377: 89 43 5c mov %eax,0x5c(%ebx) brelse(bp); return addr; } panic("bmap: out of range"); } 8010137a: 8d 65 f4 lea -0xc(%ebp),%esp 8010137d: 5b pop %ebx 8010137e: 5e pop %esi 8010137f: 5f pop %edi 80101380: 5d pop %ebp 80101381: c3 ret 80101382: 8d b6 00 00 00 00 lea 0x0(%esi),%esi bn -= NDIRECT; if(bn < NINDIRECT){ // Load indirect block, allocating if necessary. if((addr = ip->addrs[NDIRECT]) == 0) ip->addrs[NDIRECT] = addr = balloc(ip->dev); 80101388: 8b 06 mov (%esi),%eax 8010138a: e8 71 fd ff ff call 80101100 <balloc> 8010138f: 89 86 8c 00 00 00 mov %eax,0x8c(%esi) 80101395: eb 87 jmp 8010131e <bmap+0x3e> } brelse(bp); return addr; } panic("bmap: out of range"); 80101397: 83 ec 0c sub $0xc,%esp 8010139a: 68 85 76 10 80 push $0x80107685 8010139f: e8 cc ef ff ff call 80100370 <panic> 801013a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801013aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801013b0 <readsb>: struct superblock sb; // Read the super block. void readsb(int dev, struct superblock *sb) { 801013b0: 55 push %ebp 801013b1: 89 e5 mov %esp,%ebp 801013b3: 56 push %esi 801013b4: 53 push %ebx 801013b5: 8b 75 0c mov 0xc(%ebp),%esi struct buf *bp; bp = bread(dev, 1); 801013b8: 83 ec 08 sub $0x8,%esp 801013bb: 6a 01 push $0x1 801013bd: ff 75 08 pushl 0x8(%ebp) 801013c0: e8 0b ed ff ff call 801000d0 <bread> 801013c5: 89 c3 mov %eax,%ebx memmove(sb, bp->data, sizeof(*sb)); 801013c7: 8d 40 5c lea 0x5c(%eax),%eax 801013ca: 83 c4 0c add $0xc,%esp 801013cd: 6a 1c push $0x1c 801013cf: 50 push %eax 801013d0: 56 push %esi 801013d1: e8 8a 36 00 00 call 80104a60 <memmove> brelse(bp); 801013d6: 89 5d 08 mov %ebx,0x8(%ebp) 801013d9: 83 c4 10 add $0x10,%esp } 801013dc: 8d 65 f8 lea -0x8(%ebp),%esp 801013df: 5b pop %ebx 801013e0: 5e pop %esi 801013e1: 5d pop %ebp { struct buf *bp; bp = bread(dev, 1); memmove(sb, bp->data, sizeof(*sb)); brelse(bp); 801013e2: e9 f9 ed ff ff jmp 801001e0 <brelse> 801013e7: 89 f6 mov %esi,%esi 801013e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801013f0 <bfree>: } // Free a disk block. static void bfree(int dev, uint b) { 801013f0: 55 push %ebp 801013f1: 89 e5 mov %esp,%ebp 801013f3: 56 push %esi 801013f4: 53 push %ebx 801013f5: 89 d3 mov %edx,%ebx 801013f7: 89 c6 mov %eax,%esi struct buf *bp; int bi, m; readsb(dev, &sb); 801013f9: 83 ec 08 sub $0x8,%esp 801013fc: 68 c0 19 11 80 push $0x801119c0 80101401: 50 push %eax 80101402: e8 a9 ff ff ff call 801013b0 <readsb> bp = bread(dev, BBLOCK(b, sb)); 80101407: 58 pop %eax 80101408: 5a pop %edx 80101409: 89 da mov %ebx,%edx 8010140b: c1 ea 0c shr $0xc,%edx 8010140e: 03 15 d8 19 11 80 add 0x801119d8,%edx 80101414: 52 push %edx 80101415: 56 push %esi 80101416: e8 b5 ec ff ff call 801000d0 <bread> bi = b % BPB; m = 1 << (bi % 8); 8010141b: 89 d9 mov %ebx,%ecx if((bp->data[bi/8] & m) == 0) 8010141d: 81 e3 ff 0f 00 00 and $0xfff,%ebx int bi, m; readsb(dev, &sb); bp = bread(dev, BBLOCK(b, sb)); bi = b % BPB; m = 1 << (bi % 8); 80101423: ba 01 00 00 00 mov $0x1,%edx 80101428: 83 e1 07 and $0x7,%ecx if((bp->data[bi/8] & m) == 0) 8010142b: c1 fb 03 sar $0x3,%ebx 8010142e: 83 c4 10 add $0x10,%esp int bi, m; readsb(dev, &sb); bp = bread(dev, BBLOCK(b, sb)); bi = b % BPB; m = 1 << (bi % 8); 80101431: d3 e2 shl %cl,%edx if((bp->data[bi/8] & m) == 0) 80101433: 0f b6 4c 18 5c movzbl 0x5c(%eax,%ebx,1),%ecx 80101438: 85 d1 test %edx,%ecx 8010143a: 74 27 je 80101463 <bfree+0x73> 8010143c: 89 c6 mov %eax,%esi panic("freeing free block"); bp->data[bi/8] &= ~m; 8010143e: f7 d2 not %edx 80101440: 89 c8 mov %ecx,%eax log_write(bp); 80101442: 83 ec 0c sub $0xc,%esp bp = bread(dev, BBLOCK(b, sb)); bi = b % BPB; m = 1 << (bi % 8); if((bp->data[bi/8] & m) == 0) panic("freeing free block"); bp->data[bi/8] &= ~m; 80101445: 21 d0 and %edx,%eax 80101447: 88 44 1e 5c mov %al,0x5c(%esi,%ebx,1) log_write(bp); 8010144b: 56 push %esi 8010144c: e8 df 18 00 00 call 80102d30 <log_write> brelse(bp); 80101451: 89 34 24 mov %esi,(%esp) 80101454: e8 87 ed ff ff call 801001e0 <brelse> } 80101459: 83 c4 10 add $0x10,%esp 8010145c: 8d 65 f8 lea -0x8(%ebp),%esp 8010145f: 5b pop %ebx 80101460: 5e pop %esi 80101461: 5d pop %ebp 80101462: c3 ret readsb(dev, &sb); bp = bread(dev, BBLOCK(b, sb)); bi = b % BPB; m = 1 << (bi % 8); if((bp->data[bi/8] & m) == 0) panic("freeing free block"); 80101463: 83 ec 0c sub $0xc,%esp 80101466: 68 98 76 10 80 push $0x80107698 8010146b: e8 00 ef ff ff call 80100370 <panic> 80101470 <iinit>: struct inode inode[NINODE]; } icache; void iinit(int dev) { 80101470: 55 push %ebp 80101471: 89 e5 mov %esp,%ebp 80101473: 53 push %ebx 80101474: bb 20 1a 11 80 mov $0x80111a20,%ebx 80101479: 83 ec 0c sub $0xc,%esp int i = 0; initlock(&icache.lock, "icache"); 8010147c: 68 ab 76 10 80 push $0x801076ab 80101481: 68 e0 19 11 80 push $0x801119e0 80101486: e8 b5 32 00 00 call 80104740 <initlock> 8010148b: 83 c4 10 add $0x10,%esp 8010148e: 66 90 xchg %ax,%ax for(i = 0; i < NINODE; i++) { initsleeplock(&icache.inode[i].lock, "inode"); 80101490: 83 ec 08 sub $0x8,%esp 80101493: 68 b2 76 10 80 push $0x801076b2 80101498: 53 push %ebx 80101499: 81 c3 90 00 00 00 add $0x90,%ebx 8010149f: e8 8c 31 00 00 call 80104630 <initsleeplock> iinit(int dev) { int i = 0; initlock(&icache.lock, "icache"); for(i = 0; i < NINODE; i++) { 801014a4: 83 c4 10 add $0x10,%esp 801014a7: 81 fb 40 36 11 80 cmp $0x80113640,%ebx 801014ad: 75 e1 jne 80101490 <iinit+0x20> initsleeplock(&icache.inode[i].lock, "inode"); } readsb(dev, &sb); 801014af: 83 ec 08 sub $0x8,%esp 801014b2: 68 c0 19 11 80 push $0x801119c0 801014b7: ff 75 08 pushl 0x8(%ebp) 801014ba: e8 f1 fe ff ff call 801013b0 <readsb> cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\ 801014bf: ff 35 d8 19 11 80 pushl 0x801119d8 801014c5: ff 35 d4 19 11 80 pushl 0x801119d4 801014cb: ff 35 d0 19 11 80 pushl 0x801119d0 801014d1: ff 35 cc 19 11 80 pushl 0x801119cc 801014d7: ff 35 c8 19 11 80 pushl 0x801119c8 801014dd: ff 35 c4 19 11 80 pushl 0x801119c4 801014e3: ff 35 c0 19 11 80 pushl 0x801119c0 801014e9: 68 18 77 10 80 push $0x80107718 801014ee: e8 6d f1 ff ff call 80100660 <cprintf> inodestart %d bmap start %d\n", sb.size, sb.nblocks, sb.ninodes, sb.nlog, sb.logstart, sb.inodestart, sb.bmapstart); } 801014f3: 83 c4 30 add $0x30,%esp 801014f6: 8b 5d fc mov -0x4(%ebp),%ebx 801014f9: c9 leave 801014fa: c3 ret 801014fb: 90 nop 801014fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101500 <ialloc>: // Allocate an inode on device dev. // Mark it as allocated by giving it type type. // Returns an unlocked but allocated and referenced inode. struct inode* ialloc(uint dev, short type) { 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 1c sub $0x1c,%esp int inum; struct buf *bp; struct dinode *dip; for(inum = 1; inum < sb.ninodes; inum++){ 80101509: 83 3d c8 19 11 80 01 cmpl $0x1,0x801119c8 // Allocate an inode on device dev. // Mark it as allocated by giving it type type. // Returns an unlocked but allocated and referenced inode. struct inode* ialloc(uint dev, short type) { 80101510: 8b 45 0c mov 0xc(%ebp),%eax 80101513: 8b 75 08 mov 0x8(%ebp),%esi 80101516: 89 45 e4 mov %eax,-0x1c(%ebp) int inum; struct buf *bp; struct dinode *dip; for(inum = 1; inum < sb.ninodes; inum++){ 80101519: 0f 86 91 00 00 00 jbe 801015b0 <ialloc+0xb0> 8010151f: bb 01 00 00 00 mov $0x1,%ebx 80101524: eb 21 jmp 80101547 <ialloc+0x47> 80101526: 8d 76 00 lea 0x0(%esi),%esi 80101529: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi dip->type = type; log_write(bp); // mark it allocated on the disk brelse(bp); return iget(dev, inum); } brelse(bp); 80101530: 83 ec 0c sub $0xc,%esp { int inum; struct buf *bp; struct dinode *dip; for(inum = 1; inum < sb.ninodes; inum++){ 80101533: 83 c3 01 add $0x1,%ebx dip->type = type; log_write(bp); // mark it allocated on the disk brelse(bp); return iget(dev, inum); } brelse(bp); 80101536: 57 push %edi 80101537: e8 a4 ec ff ff call 801001e0 <brelse> { int inum; struct buf *bp; struct dinode *dip; for(inum = 1; inum < sb.ninodes; inum++){ 8010153c: 83 c4 10 add $0x10,%esp 8010153f: 39 1d c8 19 11 80 cmp %ebx,0x801119c8 80101545: 76 69 jbe 801015b0 <ialloc+0xb0> bp = bread(dev, IBLOCK(inum, sb)); 80101547: 89 d8 mov %ebx,%eax 80101549: 83 ec 08 sub $0x8,%esp 8010154c: c1 e8 03 shr $0x3,%eax 8010154f: 03 05 d4 19 11 80 add 0x801119d4,%eax 80101555: 50 push %eax 80101556: 56 push %esi 80101557: e8 74 eb ff ff call 801000d0 <bread> 8010155c: 89 c7 mov %eax,%edi dip = (struct dinode*)bp->data + inum%IPB; 8010155e: 89 d8 mov %ebx,%eax if(dip->type == 0){ // a free inode 80101560: 83 c4 10 add $0x10,%esp struct buf *bp; struct dinode *dip; for(inum = 1; inum < sb.ninodes; inum++){ bp = bread(dev, IBLOCK(inum, sb)); dip = (struct dinode*)bp->data + inum%IPB; 80101563: 83 e0 07 and $0x7,%eax 80101566: c1 e0 06 shl $0x6,%eax 80101569: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx if(dip->type == 0){ // a free inode 8010156d: 66 83 39 00 cmpw $0x0,(%ecx) 80101571: 75 bd jne 80101530 <ialloc+0x30> memset(dip, 0, sizeof(*dip)); 80101573: 83 ec 04 sub $0x4,%esp 80101576: 89 4d e0 mov %ecx,-0x20(%ebp) 80101579: 6a 40 push $0x40 8010157b: 6a 00 push $0x0 8010157d: 51 push %ecx 8010157e: e8 2d 34 00 00 call 801049b0 <memset> dip->type = type; 80101583: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax 80101587: 8b 4d e0 mov -0x20(%ebp),%ecx 8010158a: 66 89 01 mov %ax,(%ecx) log_write(bp); // mark it allocated on the disk 8010158d: 89 3c 24 mov %edi,(%esp) 80101590: e8 9b 17 00 00 call 80102d30 <log_write> brelse(bp); 80101595: 89 3c 24 mov %edi,(%esp) 80101598: e8 43 ec ff ff call 801001e0 <brelse> return iget(dev, inum); 8010159d: 83 c4 10 add $0x10,%esp } brelse(bp); } panic("ialloc: no inodes"); } 801015a0: 8d 65 f4 lea -0xc(%ebp),%esp if(dip->type == 0){ // a free inode memset(dip, 0, sizeof(*dip)); dip->type = type; log_write(bp); // mark it allocated on the disk brelse(bp); return iget(dev, inum); 801015a3: 89 da mov %ebx,%edx 801015a5: 89 f0 mov %esi,%eax } brelse(bp); } panic("ialloc: no inodes"); } 801015a7: 5b pop %ebx 801015a8: 5e pop %esi 801015a9: 5f pop %edi 801015aa: 5d pop %ebp if(dip->type == 0){ // a free inode memset(dip, 0, sizeof(*dip)); dip->type = type; log_write(bp); // mark it allocated on the disk brelse(bp); return iget(dev, inum); 801015ab: e9 60 fc ff ff jmp 80101210 <iget> } brelse(bp); } panic("ialloc: no inodes"); 801015b0: 83 ec 0c sub $0xc,%esp 801015b3: 68 b8 76 10 80 push $0x801076b8 801015b8: e8 b3 ed ff ff call 80100370 <panic> 801015bd: 8d 76 00 lea 0x0(%esi),%esi 801015c0 <iupdate>: // Must be called after every change to an ip->xxx field // that lives on disk, since i-node cache is write-through. // Caller must hold ip->lock. void iupdate(struct inode *ip) { 801015c0: 55 push %ebp 801015c1: 89 e5 mov %esp,%ebp 801015c3: 56 push %esi 801015c4: 53 push %ebx 801015c5: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf *bp; struct dinode *dip; bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015c8: 83 ec 08 sub $0x8,%esp 801015cb: 8b 43 04 mov 0x4(%ebx),%eax dip->type = ip->type; dip->major = ip->major; dip->minor = ip->minor; dip->nlink = ip->nlink; dip->size = ip->size; memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015ce: 83 c3 5c add $0x5c,%ebx iupdate(struct inode *ip) { struct buf *bp; struct dinode *dip; bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015d1: c1 e8 03 shr $0x3,%eax 801015d4: 03 05 d4 19 11 80 add 0x801119d4,%eax 801015da: 50 push %eax 801015db: ff 73 a4 pushl -0x5c(%ebx) 801015de: e8 ed ea ff ff call 801000d0 <bread> 801015e3: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801015e5: 8b 43 a8 mov -0x58(%ebx),%eax dip->type = ip->type; 801015e8: 0f b7 53 f4 movzwl -0xc(%ebx),%edx dip->major = ip->major; dip->minor = ip->minor; dip->nlink = ip->nlink; dip->size = ip->size; memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015ec: 83 c4 0c add $0xc,%esp { struct buf *bp; struct dinode *dip; bp = bread(ip->dev, IBLOCK(ip->inum, sb)); dip = (struct dinode*)bp->data + ip->inum%IPB; 801015ef: 83 e0 07 and $0x7,%eax 801015f2: c1 e0 06 shl $0x6,%eax 801015f5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax dip->type = ip->type; 801015f9: 66 89 10 mov %dx,(%eax) dip->major = ip->major; 801015fc: 0f b7 53 f6 movzwl -0xa(%ebx),%edx dip->minor = ip->minor; dip->nlink = ip->nlink; dip->size = ip->size; memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80101600: 83 c0 0c add $0xc,%eax struct dinode *dip; bp = bread(ip->dev, IBLOCK(ip->inum, sb)); dip = (struct dinode*)bp->data + ip->inum%IPB; dip->type = ip->type; dip->major = ip->major; 80101603: 66 89 50 f6 mov %dx,-0xa(%eax) dip->minor = ip->minor; 80101607: 0f b7 53 f8 movzwl -0x8(%ebx),%edx 8010160b: 66 89 50 f8 mov %dx,-0x8(%eax) dip->nlink = ip->nlink; 8010160f: 0f b7 53 fa movzwl -0x6(%ebx),%edx 80101613: 66 89 50 fa mov %dx,-0x6(%eax) dip->size = ip->size; 80101617: 8b 53 fc mov -0x4(%ebx),%edx 8010161a: 89 50 fc mov %edx,-0x4(%eax) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8010161d: 6a 34 push $0x34 8010161f: 53 push %ebx 80101620: 50 push %eax 80101621: e8 3a 34 00 00 call 80104a60 <memmove> log_write(bp); 80101626: 89 34 24 mov %esi,(%esp) 80101629: e8 02 17 00 00 call 80102d30 <log_write> brelse(bp); 8010162e: 89 75 08 mov %esi,0x8(%ebp) 80101631: 83 c4 10 add $0x10,%esp } 80101634: 8d 65 f8 lea -0x8(%ebp),%esp 80101637: 5b pop %ebx 80101638: 5e pop %esi 80101639: 5d pop %ebp dip->minor = ip->minor; dip->nlink = ip->nlink; dip->size = ip->size; memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); log_write(bp); brelse(bp); 8010163a: e9 a1 eb ff ff jmp 801001e0 <brelse> 8010163f: 90 nop 80101640 <idup>: // Increment reference count for ip. // Returns ip to enable ip = idup(ip1) idiom. struct inode* idup(struct inode *ip) { 80101640: 55 push %ebp 80101641: 89 e5 mov %esp,%ebp 80101643: 53 push %ebx 80101644: 83 ec 10 sub $0x10,%esp 80101647: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&icache.lock); 8010164a: 68 e0 19 11 80 push $0x801119e0 8010164f: e8 ec 31 00 00 call 80104840 <acquire> ip->ref++; 80101654: 83 43 08 01 addl $0x1,0x8(%ebx) release(&icache.lock); 80101658: c7 04 24 e0 19 11 80 movl $0x801119e0,(%esp) 8010165f: e8 fc 32 00 00 call 80104960 <release> return ip; } 80101664: 89 d8 mov %ebx,%eax 80101666: 8b 5d fc mov -0x4(%ebp),%ebx 80101669: c9 leave 8010166a: c3 ret 8010166b: 90 nop 8010166c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101670 <ilock>: // Lock the given inode. // Reads the inode from disk if necessary. void ilock(struct inode *ip) { 80101670: 55 push %ebp 80101671: 89 e5 mov %esp,%ebp 80101673: 56 push %esi 80101674: 53 push %ebx 80101675: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf *bp; struct dinode *dip; if(ip == 0 || ip->ref < 1) 80101678: 85 db test %ebx,%ebx 8010167a: 0f 84 b7 00 00 00 je 80101737 <ilock+0xc7> 80101680: 8b 53 08 mov 0x8(%ebx),%edx 80101683: 85 d2 test %edx,%edx 80101685: 0f 8e ac 00 00 00 jle 80101737 <ilock+0xc7> panic("ilock"); acquiresleep(&ip->lock); 8010168b: 8d 43 0c lea 0xc(%ebx),%eax 8010168e: 83 ec 0c sub $0xc,%esp 80101691: 50 push %eax 80101692: e8 d9 2f 00 00 call 80104670 <acquiresleep> if(ip->valid == 0){ 80101697: 8b 43 4c mov 0x4c(%ebx),%eax 8010169a: 83 c4 10 add $0x10,%esp 8010169d: 85 c0 test %eax,%eax 8010169f: 74 0f je 801016b0 <ilock+0x40> brelse(bp); ip->valid = 1; if(ip->type == 0) panic("ilock: no type"); } } 801016a1: 8d 65 f8 lea -0x8(%ebp),%esp 801016a4: 5b pop %ebx 801016a5: 5e pop %esi 801016a6: 5d pop %ebp 801016a7: c3 ret 801016a8: 90 nop 801016a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi panic("ilock"); acquiresleep(&ip->lock); if(ip->valid == 0){ bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801016b0: 8b 43 04 mov 0x4(%ebx),%eax 801016b3: 83 ec 08 sub $0x8,%esp 801016b6: c1 e8 03 shr $0x3,%eax 801016b9: 03 05 d4 19 11 80 add 0x801119d4,%eax 801016bf: 50 push %eax 801016c0: ff 33 pushl (%ebx) 801016c2: e8 09 ea ff ff call 801000d0 <bread> 801016c7: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801016c9: 8b 43 04 mov 0x4(%ebx),%eax ip->type = dip->type; ip->major = dip->major; ip->minor = dip->minor; ip->nlink = dip->nlink; ip->size = dip->size; memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016cc: 83 c4 0c add $0xc,%esp acquiresleep(&ip->lock); if(ip->valid == 0){ bp = bread(ip->dev, IBLOCK(ip->inum, sb)); dip = (struct dinode*)bp->data + ip->inum%IPB; 801016cf: 83 e0 07 and $0x7,%eax 801016d2: c1 e0 06 shl $0x6,%eax 801016d5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax ip->type = dip->type; 801016d9: 0f b7 10 movzwl (%eax),%edx ip->major = dip->major; ip->minor = dip->minor; ip->nlink = dip->nlink; ip->size = dip->size; memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016dc: 83 c0 0c add $0xc,%eax acquiresleep(&ip->lock); if(ip->valid == 0){ bp = bread(ip->dev, IBLOCK(ip->inum, sb)); dip = (struct dinode*)bp->data + ip->inum%IPB; ip->type = dip->type; 801016df: 66 89 53 50 mov %dx,0x50(%ebx) ip->major = dip->major; 801016e3: 0f b7 50 f6 movzwl -0xa(%eax),%edx 801016e7: 66 89 53 52 mov %dx,0x52(%ebx) ip->minor = dip->minor; 801016eb: 0f b7 50 f8 movzwl -0x8(%eax),%edx 801016ef: 66 89 53 54 mov %dx,0x54(%ebx) ip->nlink = dip->nlink; 801016f3: 0f b7 50 fa movzwl -0x6(%eax),%edx 801016f7: 66 89 53 56 mov %dx,0x56(%ebx) ip->size = dip->size; 801016fb: 8b 50 fc mov -0x4(%eax),%edx 801016fe: 89 53 58 mov %edx,0x58(%ebx) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80101701: 6a 34 push $0x34 80101703: 50 push %eax 80101704: 8d 43 5c lea 0x5c(%ebx),%eax 80101707: 50 push %eax 80101708: e8 53 33 00 00 call 80104a60 <memmove> brelse(bp); 8010170d: 89 34 24 mov %esi,(%esp) 80101710: e8 cb ea ff ff call 801001e0 <brelse> ip->valid = 1; if(ip->type == 0) 80101715: 83 c4 10 add $0x10,%esp 80101718: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx) ip->minor = dip->minor; ip->nlink = dip->nlink; ip->size = dip->size; memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); brelse(bp); ip->valid = 1; 8010171d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) if(ip->type == 0) 80101724: 0f 85 77 ff ff ff jne 801016a1 <ilock+0x31> panic("ilock: no type"); 8010172a: 83 ec 0c sub $0xc,%esp 8010172d: 68 d0 76 10 80 push $0x801076d0 80101732: e8 39 ec ff ff call 80100370 <panic> { struct buf *bp; struct dinode *dip; if(ip == 0 || ip->ref < 1) panic("ilock"); 80101737: 83 ec 0c sub $0xc,%esp 8010173a: 68 ca 76 10 80 push $0x801076ca 8010173f: e8 2c ec ff ff call 80100370 <panic> 80101744: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010174a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101750 <iunlock>: } // Unlock the given inode. void iunlock(struct inode *ip) { 80101750: 55 push %ebp 80101751: 89 e5 mov %esp,%ebp 80101753: 56 push %esi 80101754: 53 push %ebx 80101755: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) 80101758: 85 db test %ebx,%ebx 8010175a: 74 28 je 80101784 <iunlock+0x34> 8010175c: 8d 73 0c lea 0xc(%ebx),%esi 8010175f: 83 ec 0c sub $0xc,%esp 80101762: 56 push %esi 80101763: e8 a8 2f 00 00 call 80104710 <holdingsleep> 80101768: 83 c4 10 add $0x10,%esp 8010176b: 85 c0 test %eax,%eax 8010176d: 74 15 je 80101784 <iunlock+0x34> 8010176f: 8b 43 08 mov 0x8(%ebx),%eax 80101772: 85 c0 test %eax,%eax 80101774: 7e 0e jle 80101784 <iunlock+0x34> panic("iunlock"); releasesleep(&ip->lock); 80101776: 89 75 08 mov %esi,0x8(%ebp) } 80101779: 8d 65 f8 lea -0x8(%ebp),%esp 8010177c: 5b pop %ebx 8010177d: 5e pop %esi 8010177e: 5d pop %ebp iunlock(struct inode *ip) { if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) panic("iunlock"); releasesleep(&ip->lock); 8010177f: e9 4c 2f 00 00 jmp 801046d0 <releasesleep> // Unlock the given inode. void iunlock(struct inode *ip) { if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) panic("iunlock"); 80101784: 83 ec 0c sub $0xc,%esp 80101787: 68 df 76 10 80 push $0x801076df 8010178c: e8 df eb ff ff call 80100370 <panic> 80101791: eb 0d jmp 801017a0 <iput> 80101793: 90 nop 80101794: 90 nop 80101795: 90 nop 80101796: 90 nop 80101797: 90 nop 80101798: 90 nop 80101799: 90 nop 8010179a: 90 nop 8010179b: 90 nop 8010179c: 90 nop 8010179d: 90 nop 8010179e: 90 nop 8010179f: 90 nop 801017a0 <iput>: // to it, free the inode (and its content) on disk. // All calls to iput() must be inside a transaction in // case it has to free the inode. void iput(struct inode *ip) { 801017a0: 55 push %ebp 801017a1: 89 e5 mov %esp,%ebp 801017a3: 57 push %edi 801017a4: 56 push %esi 801017a5: 53 push %ebx 801017a6: 83 ec 28 sub $0x28,%esp 801017a9: 8b 75 08 mov 0x8(%ebp),%esi acquiresleep(&ip->lock); 801017ac: 8d 7e 0c lea 0xc(%esi),%edi 801017af: 57 push %edi 801017b0: e8 bb 2e 00 00 call 80104670 <acquiresleep> if(ip->valid && ip->nlink == 0){ 801017b5: 8b 56 4c mov 0x4c(%esi),%edx 801017b8: 83 c4 10 add $0x10,%esp 801017bb: 85 d2 test %edx,%edx 801017bd: 74 07 je 801017c6 <iput+0x26> 801017bf: 66 83 7e 56 00 cmpw $0x0,0x56(%esi) 801017c4: 74 32 je 801017f8 <iput+0x58> ip->type = 0; iupdate(ip); ip->valid = 0; } } releasesleep(&ip->lock); 801017c6: 83 ec 0c sub $0xc,%esp 801017c9: 57 push %edi 801017ca: e8 01 2f 00 00 call 801046d0 <releasesleep> acquire(&icache.lock); 801017cf: c7 04 24 e0 19 11 80 movl $0x801119e0,(%esp) 801017d6: e8 65 30 00 00 call 80104840 <acquire> ip->ref--; 801017db: 83 6e 08 01 subl $0x1,0x8(%esi) release(&icache.lock); 801017df: 83 c4 10 add $0x10,%esp 801017e2: c7 45 08 e0 19 11 80 movl $0x801119e0,0x8(%ebp) } 801017e9: 8d 65 f4 lea -0xc(%ebp),%esp 801017ec: 5b pop %ebx 801017ed: 5e pop %esi 801017ee: 5f pop %edi 801017ef: 5d pop %ebp } releasesleep(&ip->lock); acquire(&icache.lock); ip->ref--; release(&icache.lock); 801017f0: e9 6b 31 00 00 jmp 80104960 <release> 801017f5: 8d 76 00 lea 0x0(%esi),%esi void iput(struct inode *ip) { acquiresleep(&ip->lock); if(ip->valid && ip->nlink == 0){ acquire(&icache.lock); 801017f8: 83 ec 0c sub $0xc,%esp 801017fb: 68 e0 19 11 80 push $0x801119e0 80101800: e8 3b 30 00 00 call 80104840 <acquire> int r = ip->ref; 80101805: 8b 5e 08 mov 0x8(%esi),%ebx release(&icache.lock); 80101808: c7 04 24 e0 19 11 80 movl $0x801119e0,(%esp) 8010180f: e8 4c 31 00 00 call 80104960 <release> if(r == 1){ 80101814: 83 c4 10 add $0x10,%esp 80101817: 83 fb 01 cmp $0x1,%ebx 8010181a: 75 aa jne 801017c6 <iput+0x26> 8010181c: 8d 8e 8c 00 00 00 lea 0x8c(%esi),%ecx 80101822: 89 7d e4 mov %edi,-0x1c(%ebp) 80101825: 8d 5e 5c lea 0x5c(%esi),%ebx 80101828: 89 cf mov %ecx,%edi 8010182a: eb 0b jmp 80101837 <iput+0x97> 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+0xb0> if(ip->addrs[i]){ 80101837: 8b 13 mov (%ebx),%edx 80101839: 85 d2 test %edx,%edx 8010183b: 74 f3 je 80101830 <iput+0x90> bfree(ip->dev, ip->addrs[i]); 8010183d: 8b 06 mov (%esi),%eax 8010183f: e8 ac fb ff ff call 801013f0 <bfree> ip->addrs[i] = 0; 80101844: c7 03 00 00 00 00 movl $0x0,(%ebx) 8010184a: eb e4 jmp 80101830 <iput+0x90> 8010184c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } 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 33 jne 80101890 <iput+0xf0> bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; iupdate(ip); 8010185d: 83 ec 0c sub $0xc,%esp brelse(bp); bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; 80101860: c7 46 58 00 00 00 00 movl $0x0,0x58(%esi) iupdate(ip); 80101867: 56 push %esi 80101868: e8 53 fd ff ff call 801015c0 <iupdate> int r = ip->ref; release(&icache.lock); if(r == 1){ // inode has no links and no other references: truncate and free. itrunc(ip); ip->type = 0; 8010186d: 31 c0 xor %eax,%eax 8010186f: 66 89 46 50 mov %ax,0x50(%esi) iupdate(ip); 80101873: 89 34 24 mov %esi,(%esp) 80101876: e8 45 fd ff ff call 801015c0 <iupdate> ip->valid = 0; 8010187b: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) 80101882: 83 c4 10 add $0x10,%esp 80101885: e9 3c ff ff ff jmp 801017c6 <iput+0x26> 8010188a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi ip->addrs[i] = 0; } } if(ip->addrs[NDIRECT]){ bp = bread(ip->dev, ip->addrs[NDIRECT]); 80101890: 83 ec 08 sub $0x8,%esp 80101893: 50 push %eax 80101894: ff 36 pushl (%esi) 80101896: e8 35 e8 ff ff call 801000d0 <bread> 8010189b: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx 801018a1: 89 7d e0 mov %edi,-0x20(%ebp) 801018a4: 89 45 e4 mov %eax,-0x1c(%ebp) a = (uint*)bp->data; 801018a7: 8d 58 5c lea 0x5c(%eax),%ebx 801018aa: 83 c4 10 add $0x10,%esp 801018ad: 89 cf mov %ecx,%edi 801018af: eb 0e jmp 801018bf <iput+0x11f> 801018b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801018b8: 83 c3 04 add $0x4,%ebx for(j = 0; j < NINDIRECT; j++){ 801018bb: 39 fb cmp %edi,%ebx 801018bd: 74 0f je 801018ce <iput+0x12e> if(a[j]) 801018bf: 8b 13 mov (%ebx),%edx 801018c1: 85 d2 test %edx,%edx 801018c3: 74 f3 je 801018b8 <iput+0x118> bfree(ip->dev, a[j]); 801018c5: 8b 06 mov (%esi),%eax 801018c7: e8 24 fb ff ff call 801013f0 <bfree> 801018cc: eb ea jmp 801018b8 <iput+0x118> } brelse(bp); 801018ce: 83 ec 0c sub $0xc,%esp 801018d1: ff 75 e4 pushl -0x1c(%ebp) 801018d4: 8b 7d e0 mov -0x20(%ebp),%edi 801018d7: e8 04 e9 ff ff call 801001e0 <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 801018dc: 8b 96 8c 00 00 00 mov 0x8c(%esi),%edx 801018e2: 8b 06 mov (%esi),%eax 801018e4: e8 07 fb ff ff call 801013f0 <bfree> ip->addrs[NDIRECT] = 0; 801018e9: c7 86 8c 00 00 00 00 movl $0x0,0x8c(%esi) 801018f0: 00 00 00 801018f3: 83 c4 10 add $0x10,%esp 801018f6: e9 62 ff ff ff jmp 8010185d <iput+0xbd> 801018fb: 90 nop 801018fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101900 <iunlockput>: } // Common idiom: unlock, then put. void iunlockput(struct inode *ip) { 80101900: 55 push %ebp 80101901: 89 e5 mov %esp,%ebp 80101903: 53 push %ebx 80101904: 83 ec 10 sub $0x10,%esp 80101907: 8b 5d 08 mov 0x8(%ebp),%ebx iunlock(ip); 8010190a: 53 push %ebx 8010190b: e8 40 fe ff ff call 80101750 <iunlock> iput(ip); 80101910: 89 5d 08 mov %ebx,0x8(%ebp) 80101913: 83 c4 10 add $0x10,%esp } 80101916: 8b 5d fc mov -0x4(%ebp),%ebx 80101919: c9 leave // Common idiom: unlock, then put. void iunlockput(struct inode *ip) { iunlock(ip); iput(ip); 8010191a: e9 81 fe ff ff jmp 801017a0 <iput> 8010191f: 90 nop 80101920 <stati>: // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 80101920: 55 push %ebp 80101921: 89 e5 mov %esp,%ebp 80101923: 8b 55 08 mov 0x8(%ebp),%edx 80101926: 8b 45 0c mov 0xc(%ebp),%eax st->dev = ip->dev; 80101929: 8b 0a mov (%edx),%ecx 8010192b: 89 48 04 mov %ecx,0x4(%eax) st->ino = ip->inum; 8010192e: 8b 4a 04 mov 0x4(%edx),%ecx 80101931: 89 48 08 mov %ecx,0x8(%eax) st->type = ip->type; 80101934: 0f b7 4a 50 movzwl 0x50(%edx),%ecx 80101938: 66 89 08 mov %cx,(%eax) st->nlink = ip->nlink; 8010193b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx 8010193f: 66 89 48 0c mov %cx,0xc(%eax) st->size = ip->size; 80101943: 8b 52 58 mov 0x58(%edx),%edx 80101946: 89 50 10 mov %edx,0x10(%eax) } 80101949: 5d pop %ebp 8010194a: c3 ret 8010194b: 90 nop 8010194c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101950 <readi>: //PAGEBREAK! // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 80101950: 55 push %ebp 80101951: 89 e5 mov %esp,%ebp 80101953: 57 push %edi 80101954: 56 push %esi 80101955: 53 push %ebx 80101956: 83 ec 1c sub $0x1c,%esp 80101959: 8b 45 08 mov 0x8(%ebp),%eax 8010195c: 8b 7d 0c mov 0xc(%ebp),%edi 8010195f: 8b 75 10 mov 0x10(%ebp),%esi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101962: 66 83 78 50 03 cmpw $0x3,0x50(%eax) //PAGEBREAK! // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 80101967: 89 7d e0 mov %edi,-0x20(%ebp) 8010196a: 8b 7d 14 mov 0x14(%ebp),%edi 8010196d: 89 45 d8 mov %eax,-0x28(%ebp) 80101970: 89 7d e4 mov %edi,-0x1c(%ebp) uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101973: 0f 84 a7 00 00 00 je 80101a20 <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) 80101979: 8b 45 d8 mov -0x28(%ebp),%eax 8010197c: 8b 40 58 mov 0x58(%eax),%eax 8010197f: 39 f0 cmp %esi,%eax 80101981: 0f 82 c1 00 00 00 jb 80101a48 <readi+0xf8> 80101987: 8b 7d e4 mov -0x1c(%ebp),%edi 8010198a: 89 fa mov %edi,%edx 8010198c: 01 f2 add %esi,%edx 8010198e: 0f 82 b4 00 00 00 jb 80101a48 <readi+0xf8> return -1; if(off + n > ip->size) n = ip->size - off; 80101994: 89 c1 mov %eax,%ecx 80101996: 29 f1 sub %esi,%ecx 80101998: 39 d0 cmp %edx,%eax 8010199a: 0f 43 cf cmovae %edi,%ecx for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 8010199d: 31 ff xor %edi,%edi 8010199f: 85 c9 test %ecx,%ecx } if(off > ip->size || off + n < off) return -1; if(off + n > ip->size) n = ip->size - off; 801019a1: 89 4d e4 mov %ecx,-0x1c(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019a4: 74 6d je 80101a13 <readi+0xc3> 801019a6: 8d 76 00 lea 0x0(%esi),%esi 801019a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019b0: 8b 5d d8 mov -0x28(%ebp),%ebx 801019b3: 89 f2 mov %esi,%edx 801019b5: c1 ea 09 shr $0x9,%edx 801019b8: 89 d8 mov %ebx,%eax 801019ba: e8 21 f9 ff ff call 801012e0 <bmap> 801019bf: 83 ec 08 sub $0x8,%esp 801019c2: 50 push %eax 801019c3: ff 33 pushl (%ebx) m = min(n - tot, BSIZE - off%BSIZE); 801019c5: bb 00 02 00 00 mov $0x200,%ebx return -1; if(off + n > ip->size) n = ip->size - off; for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019ca: e8 01 e7 ff ff call 801000d0 <bread> 801019cf: 89 c2 mov %eax,%edx m = min(n - tot, BSIZE - off%BSIZE); 801019d1: 8b 45 e4 mov -0x1c(%ebp),%eax 801019d4: 89 f1 mov %esi,%ecx 801019d6: 81 e1 ff 01 00 00 and $0x1ff,%ecx 801019dc: 83 c4 0c add $0xc,%esp memmove(dst, bp->data + off%BSIZE, m); 801019df: 89 55 dc mov %edx,-0x24(%ebp) if(off + n > ip->size) n = ip->size - off; for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); 801019e2: 29 cb sub %ecx,%ebx 801019e4: 29 f8 sub %edi,%eax 801019e6: 39 c3 cmp %eax,%ebx 801019e8: 0f 47 d8 cmova %eax,%ebx memmove(dst, bp->data + off%BSIZE, m); 801019eb: 8d 44 0a 5c lea 0x5c(%edx,%ecx,1),%eax 801019ef: 53 push %ebx if(off > ip->size || off + n < off) return -1; if(off + n > ip->size) n = ip->size - off; for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019f0: 01 df add %ebx,%edi 801019f2: 01 de add %ebx,%esi bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); memmove(dst, bp->data + off%BSIZE, m); 801019f4: 50 push %eax 801019f5: ff 75 e0 pushl -0x20(%ebp) 801019f8: e8 63 30 00 00 call 80104a60 <memmove> brelse(bp); 801019fd: 8b 55 dc mov -0x24(%ebp),%edx 80101a00: 89 14 24 mov %edx,(%esp) 80101a03: e8 d8 e7 ff ff call 801001e0 <brelse> if(off > ip->size || off + n < off) return -1; if(off + n > ip->size) n = ip->size - off; for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a08: 01 5d e0 add %ebx,-0x20(%ebp) 80101a0b: 83 c4 10 add $0x10,%esp 80101a0e: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101a11: 77 9d ja 801019b0 <readi+0x60> bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); memmove(dst, bp->data + off%BSIZE, m); brelse(bp); } return n; 80101a13: 8b 45 e4 mov -0x1c(%ebp),%eax } 80101a16: 8d 65 f4 lea -0xc(%ebp),%esp 80101a19: 5b pop %ebx 80101a1a: 5e pop %esi 80101a1b: 5f pop %edi 80101a1c: 5d pop %ebp 80101a1d: c3 ret 80101a1e: 66 90 xchg %ax,%ax { uint tot, m; struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) 80101a20: 0f bf 40 52 movswl 0x52(%eax),%eax 80101a24: 66 83 f8 09 cmp $0x9,%ax 80101a28: 77 1e ja 80101a48 <readi+0xf8> 80101a2a: 8b 04 c5 60 19 11 80 mov -0x7feee6a0(,%eax,8),%eax 80101a31: 85 c0 test %eax,%eax 80101a33: 74 13 je 80101a48 <readi+0xf8> return -1; return devsw[ip->major].read(ip, dst, n); 80101a35: 89 7d 10 mov %edi,0x10(%ebp) m = min(n - tot, BSIZE - off%BSIZE); memmove(dst, bp->data + off%BSIZE, m); brelse(bp); } return n; } 80101a38: 8d 65 f4 lea -0xc(%ebp),%esp 80101a3b: 5b pop %ebx 80101a3c: 5e pop %esi 80101a3d: 5f pop %edi 80101a3e: 5d pop %ebp struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) return -1; return devsw[ip->major].read(ip, dst, n); 80101a3f: ff e0 jmp *%eax 80101a41: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) return -1; 80101a48: b8 ff ff ff ff mov $0xffffffff,%eax 80101a4d: eb c7 jmp 80101a16 <readi+0xc6> 80101a4f: 90 nop 80101a50 <writei>: // PAGEBREAK! // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80101a50: 55 push %ebp 80101a51: 89 e5 mov %esp,%ebp 80101a53: 57 push %edi 80101a54: 56 push %esi 80101a55: 53 push %ebx 80101a56: 83 ec 1c sub $0x1c,%esp 80101a59: 8b 45 08 mov 0x8(%ebp),%eax 80101a5c: 8b 75 0c mov 0xc(%ebp),%esi 80101a5f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101a62: 66 83 78 50 03 cmpw $0x3,0x50(%eax) // PAGEBREAK! // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80101a67: 89 75 dc mov %esi,-0x24(%ebp) 80101a6a: 89 45 d8 mov %eax,-0x28(%ebp) 80101a6d: 8b 75 10 mov 0x10(%ebp),%esi 80101a70: 89 7d e0 mov %edi,-0x20(%ebp) uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101a73: 0f 84 b7 00 00 00 je 80101b30 <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) 80101a79: 8b 45 d8 mov -0x28(%ebp),%eax 80101a7c: 39 70 58 cmp %esi,0x58(%eax) 80101a7f: 0f 82 eb 00 00 00 jb 80101b70 <writei+0x120> 80101a85: 8b 7d e0 mov -0x20(%ebp),%edi 80101a88: 89 f8 mov %edi,%eax 80101a8a: 01 f0 add %esi,%eax return -1; if(off + n > MAXFILE*BSIZE) 80101a8c: 3d 00 18 01 00 cmp $0x11800,%eax 80101a91: 0f 87 d9 00 00 00 ja 80101b70 <writei+0x120> 80101a97: 39 c6 cmp %eax,%esi 80101a99: 0f 87 d1 00 00 00 ja 80101b70 <writei+0x120> return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101a9f: 85 ff test %edi,%edi 80101aa1: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 80101aa8: 74 78 je 80101b22 <writei+0xd2> 80101aaa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ab0: 8b 7d d8 mov -0x28(%ebp),%edi 80101ab3: 89 f2 mov %esi,%edx m = min(n - tot, BSIZE - off%BSIZE); 80101ab5: bb 00 02 00 00 mov $0x200,%ebx return -1; if(off + n > MAXFILE*BSIZE) return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101aba: c1 ea 09 shr $0x9,%edx 80101abd: 89 f8 mov %edi,%eax 80101abf: e8 1c f8 ff ff call 801012e0 <bmap> 80101ac4: 83 ec 08 sub $0x8,%esp 80101ac7: 50 push %eax 80101ac8: ff 37 pushl (%edi) 80101aca: e8 01 e6 ff ff call 801000d0 <bread> 80101acf: 89 c7 mov %eax,%edi m = min(n - tot, BSIZE - off%BSIZE); 80101ad1: 8b 45 e0 mov -0x20(%ebp),%eax 80101ad4: 2b 45 e4 sub -0x1c(%ebp),%eax 80101ad7: 89 f1 mov %esi,%ecx 80101ad9: 83 c4 0c add $0xc,%esp 80101adc: 81 e1 ff 01 00 00 and $0x1ff,%ecx 80101ae2: 29 cb sub %ecx,%ebx 80101ae4: 39 c3 cmp %eax,%ebx 80101ae6: 0f 47 d8 cmova %eax,%ebx memmove(bp->data + off%BSIZE, src, m); 80101ae9: 8d 44 0f 5c lea 0x5c(%edi,%ecx,1),%eax 80101aed: 53 push %ebx 80101aee: ff 75 dc pushl -0x24(%ebp) if(off > ip->size || off + n < off) return -1; if(off + n > MAXFILE*BSIZE) return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101af1: 01 de add %ebx,%esi bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); memmove(bp->data + off%BSIZE, src, m); 80101af3: 50 push %eax 80101af4: e8 67 2f 00 00 call 80104a60 <memmove> log_write(bp); 80101af9: 89 3c 24 mov %edi,(%esp) 80101afc: e8 2f 12 00 00 call 80102d30 <log_write> brelse(bp); 80101b01: 89 3c 24 mov %edi,(%esp) 80101b04: e8 d7 e6 ff ff call 801001e0 <brelse> if(off > ip->size || off + n < off) return -1; if(off + n > MAXFILE*BSIZE) return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b09: 01 5d e4 add %ebx,-0x1c(%ebp) 80101b0c: 01 5d dc add %ebx,-0x24(%ebp) 80101b0f: 83 c4 10 add $0x10,%esp 80101b12: 8b 55 e4 mov -0x1c(%ebp),%edx 80101b15: 39 55 e0 cmp %edx,-0x20(%ebp) 80101b18: 77 96 ja 80101ab0 <writei+0x60> memmove(bp->data + off%BSIZE, src, m); log_write(bp); brelse(bp); } if(n > 0 && off > ip->size){ 80101b1a: 8b 45 d8 mov -0x28(%ebp),%eax 80101b1d: 3b 70 58 cmp 0x58(%eax),%esi 80101b20: 77 36 ja 80101b58 <writei+0x108> ip->size = off; iupdate(ip); } return n; 80101b22: 8b 45 e0 mov -0x20(%ebp),%eax } 80101b25: 8d 65 f4 lea -0xc(%ebp),%esp 80101b28: 5b pop %ebx 80101b29: 5e pop %esi 80101b2a: 5f pop %edi 80101b2b: 5d pop %ebp 80101b2c: c3 ret 80101b2d: 8d 76 00 lea 0x0(%esi),%esi { uint tot, m; struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) 80101b30: 0f bf 40 52 movswl 0x52(%eax),%eax 80101b34: 66 83 f8 09 cmp $0x9,%ax 80101b38: 77 36 ja 80101b70 <writei+0x120> 80101b3a: 8b 04 c5 64 19 11 80 mov -0x7feee69c(,%eax,8),%eax 80101b41: 85 c0 test %eax,%eax 80101b43: 74 2b je 80101b70 <writei+0x120> return -1; return devsw[ip->major].write(ip, src, n); 80101b45: 89 7d 10 mov %edi,0x10(%ebp) if(n > 0 && off > ip->size){ ip->size = off; iupdate(ip); } return n; } 80101b48: 8d 65 f4 lea -0xc(%ebp),%esp 80101b4b: 5b pop %ebx 80101b4c: 5e pop %esi 80101b4d: 5f pop %edi 80101b4e: 5d pop %ebp struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) return -1; return devsw[ip->major].write(ip, src, n); 80101b4f: ff e0 jmp *%eax 80101b51: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi log_write(bp); brelse(bp); } if(n > 0 && off > ip->size){ ip->size = off; 80101b58: 8b 45 d8 mov -0x28(%ebp),%eax iupdate(ip); 80101b5b: 83 ec 0c sub $0xc,%esp log_write(bp); brelse(bp); } if(n > 0 && off > ip->size){ ip->size = off; 80101b5e: 89 70 58 mov %esi,0x58(%eax) iupdate(ip); 80101b61: 50 push %eax 80101b62: e8 59 fa ff ff call 801015c0 <iupdate> 80101b67: 83 c4 10 add $0x10,%esp 80101b6a: eb b6 jmp 80101b22 <writei+0xd2> 80101b6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) return -1; 80101b70: b8 ff ff ff ff mov $0xffffffff,%eax 80101b75: eb ae jmp 80101b25 <writei+0xd5> 80101b77: 89 f6 mov %esi,%esi 80101b79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101b80 <namecmp>: //PAGEBREAK! // Directories int namecmp(const char *s, const char *t) { 80101b80: 55 push %ebp 80101b81: 89 e5 mov %esp,%ebp 80101b83: 83 ec 0c sub $0xc,%esp return strncmp(s, t, DIRSIZ); 80101b86: 6a 0e push $0xe 80101b88: ff 75 0c pushl 0xc(%ebp) 80101b8b: ff 75 08 pushl 0x8(%ebp) 80101b8e: e8 4d 2f 00 00 call 80104ae0 <strncmp> } 80101b93: c9 leave 80101b94: c3 ret 80101b95: 8d 74 26 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 1c sub $0x1c,%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 80 00 00 00 jne 80101c37 <dirlookup+0x97> 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 5b jmp 80101c20 <dirlookup+0x80> 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 50 jbe 80101c20 <dirlookup+0x80> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101bd0: 6a 10 push $0x10 80101bd2: 57 push %edi 80101bd3: 56 push %esi 80101bd4: 53 push %ebx 80101bd5: e8 76 fd ff ff call 80101950 <readi> 80101bda: 83 c4 10 add $0x10,%esp 80101bdd: 83 f8 10 cmp $0x10,%eax 80101be0: 75 48 jne 80101c2a <dirlookup+0x8a> panic("dirlookup read"); if(de.inum == 0) 80101be2: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101be7: 74 df je 80101bc8 <dirlookup+0x28> // Directories int namecmp(const char *s, const char *t) { return strncmp(s, t, DIRSIZ); 80101be9: 8d 45 da lea -0x26(%ebp),%eax 80101bec: 83 ec 04 sub $0x4,%esp 80101bef: 6a 0e push $0xe 80101bf1: 50 push %eax 80101bf2: ff 75 0c pushl 0xc(%ebp) 80101bf5: e8 e6 2e 00 00 call 80104ae0 <strncmp> for(off = 0; off < dp->size; off += sizeof(de)){ if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("dirlookup read"); if(de.inum == 0) continue; if(namecmp(name, de.name) == 0){ 80101bfa: 83 c4 10 add $0x10,%esp 80101bfd: 85 c0 test %eax,%eax 80101bff: 75 c7 jne 80101bc8 <dirlookup+0x28> // entry matches path element if(poff) 80101c01: 8b 45 10 mov 0x10(%ebp),%eax 80101c04: 85 c0 test %eax,%eax 80101c06: 74 05 je 80101c0d <dirlookup+0x6d> *poff = off; 80101c08: 8b 45 10 mov 0x10(%ebp),%eax 80101c0b: 89 38 mov %edi,(%eax) inum = de.inum; return iget(dp->dev, inum); 80101c0d: 0f b7 55 d8 movzwl -0x28(%ebp),%edx 80101c11: 8b 03 mov (%ebx),%eax 80101c13: e8 f8 f5 ff ff call 80101210 <iget> } } return 0; } 80101c18: 8d 65 f4 lea -0xc(%ebp),%esp 80101c1b: 5b pop %ebx 80101c1c: 5e pop %esi 80101c1d: 5f pop %edi 80101c1e: 5d pop %ebp 80101c1f: c3 ret 80101c20: 8d 65 f4 lea -0xc(%ebp),%esp inum = de.inum; return iget(dp->dev, inum); } } return 0; 80101c23: 31 c0 xor %eax,%eax } 80101c25: 5b pop %ebx 80101c26: 5e pop %esi 80101c27: 5f pop %edi 80101c28: 5d pop %ebp 80101c29: c3 ret if(dp->type != T_DIR) panic("dirlookup not DIR"); for(off = 0; off < dp->size; off += sizeof(de)){ if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("dirlookup read"); 80101c2a: 83 ec 0c sub $0xc,%esp 80101c2d: 68 f9 76 10 80 push $0x801076f9 80101c32: e8 39 e7 ff ff call 80100370 <panic> { uint off, inum; struct dirent de; if(dp->type != T_DIR) panic("dirlookup not DIR"); 80101c37: 83 ec 0c sub $0xc,%esp 80101c3a: 68 e7 76 10 80 push $0x801076e7 80101c3f: e8 2c e7 ff ff call 80100370 <panic> 80101c44: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101c4a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101c50 <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) { 80101c50: 55 push %ebp 80101c51: 89 e5 mov %esp,%ebp 80101c53: 57 push %edi 80101c54: 56 push %esi 80101c55: 53 push %ebx 80101c56: 89 cf mov %ecx,%edi 80101c58: 89 c3 mov %eax,%ebx 80101c5a: 83 ec 1c sub $0x1c,%esp struct inode *ip, *next; if(*path == '/') 80101c5d: 80 38 2f cmpb $0x2f,(%eax) // 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: 89 55 e0 mov %edx,-0x20(%ebp) struct inode *ip, *next; if(*path == '/') 80101c63: 0f 84 53 01 00 00 je 80101dbc <namex+0x16c> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101c69: e8 12 1b 00 00 call 80103780 <myproc> // Increment reference count for ip. // Returns ip to enable ip = idup(ip1) idiom. struct inode* idup(struct inode *ip) { acquire(&icache.lock); 80101c6e: 83 ec 0c sub $0xc,%esp struct inode *ip, *next; if(*path == '/') ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101c71: 8b 70 68 mov 0x68(%eax),%esi // Increment reference count for ip. // Returns ip to enable ip = idup(ip1) idiom. struct inode* idup(struct inode *ip) { acquire(&icache.lock); 80101c74: 68 e0 19 11 80 push $0x801119e0 80101c79: e8 c2 2b 00 00 call 80104840 <acquire> ip->ref++; 80101c7e: 83 46 08 01 addl $0x1,0x8(%esi) release(&icache.lock); 80101c82: c7 04 24 e0 19 11 80 movl $0x801119e0,(%esp) 80101c89: e8 d2 2c 00 00 call 80104960 <release> 80101c8e: 83 c4 10 add $0x10,%esp 80101c91: eb 08 jmp 80101c9b <namex+0x4b> 80101c93: 90 nop 80101c94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi { char *s; int len; while(*path == '/') path++; 80101c98: 83 c3 01 add $0x1,%ebx skipelem(char *path, char *name) { char *s; int len; while(*path == '/') 80101c9b: 0f b6 03 movzbl (%ebx),%eax 80101c9e: 3c 2f cmp $0x2f,%al 80101ca0: 74 f6 je 80101c98 <namex+0x48> path++; if(*path == 0) 80101ca2: 84 c0 test %al,%al 80101ca4: 0f 84 e3 00 00 00 je 80101d8d <namex+0x13d> return 0; s = path; while(*path != '/' && *path != 0) 80101caa: 0f b6 03 movzbl (%ebx),%eax 80101cad: 89 da mov %ebx,%edx 80101caf: 84 c0 test %al,%al 80101cb1: 0f 84 ac 00 00 00 je 80101d63 <namex+0x113> 80101cb7: 3c 2f cmp $0x2f,%al 80101cb9: 75 09 jne 80101cc4 <namex+0x74> 80101cbb: e9 a3 00 00 00 jmp 80101d63 <namex+0x113> 80101cc0: 84 c0 test %al,%al 80101cc2: 74 0a je 80101cce <namex+0x7e> path++; 80101cc4: 83 c2 01 add $0x1,%edx while(*path == '/') path++; if(*path == 0) return 0; s = path; while(*path != '/' && *path != 0) 80101cc7: 0f b6 02 movzbl (%edx),%eax 80101cca: 3c 2f cmp $0x2f,%al 80101ccc: 75 f2 jne 80101cc0 <namex+0x70> 80101cce: 89 d1 mov %edx,%ecx 80101cd0: 29 d9 sub %ebx,%ecx path++; len = path - s; if(len >= DIRSIZ) 80101cd2: 83 f9 0d cmp $0xd,%ecx 80101cd5: 0f 8e 8d 00 00 00 jle 80101d68 <namex+0x118> memmove(name, s, DIRSIZ); 80101cdb: 83 ec 04 sub $0x4,%esp 80101cde: 89 55 e4 mov %edx,-0x1c(%ebp) 80101ce1: 6a 0e push $0xe 80101ce3: 53 push %ebx 80101ce4: 57 push %edi 80101ce5: e8 76 2d 00 00 call 80104a60 <memmove> path++; if(*path == 0) return 0; s = path; while(*path != '/' && *path != 0) path++; 80101cea: 8b 55 e4 mov -0x1c(%ebp),%edx len = path - s; if(len >= DIRSIZ) memmove(name, s, DIRSIZ); 80101ced: 83 c4 10 add $0x10,%esp path++; if(*path == 0) return 0; s = path; while(*path != '/' && *path != 0) path++; 80101cf0: 89 d3 mov %edx,%ebx memmove(name, s, DIRSIZ); else { memmove(name, s, len); name[len] = 0; } while(*path == '/') 80101cf2: 80 3a 2f cmpb $0x2f,(%edx) 80101cf5: 75 11 jne 80101d08 <namex+0xb8> 80101cf7: 89 f6 mov %esi,%esi 80101cf9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi path++; 80101d00: 83 c3 01 add $0x1,%ebx memmove(name, s, DIRSIZ); else { memmove(name, s, len); name[len] = 0; } while(*path == '/') 80101d03: 80 3b 2f cmpb $0x2f,(%ebx) 80101d06: 74 f8 je 80101d00 <namex+0xb0> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); while((path = skipelem(path, name)) != 0){ ilock(ip); 80101d08: 83 ec 0c sub $0xc,%esp 80101d0b: 56 push %esi 80101d0c: e8 5f f9 ff ff call 80101670 <ilock> if(ip->type != T_DIR){ 80101d11: 83 c4 10 add $0x10,%esp 80101d14: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80101d19: 0f 85 7f 00 00 00 jne 80101d9e <namex+0x14e> iunlockput(ip); return 0; } if(nameiparent && *path == '\0'){ 80101d1f: 8b 55 e0 mov -0x20(%ebp),%edx 80101d22: 85 d2 test %edx,%edx 80101d24: 74 09 je 80101d2f <namex+0xdf> 80101d26: 80 3b 00 cmpb $0x0,(%ebx) 80101d29: 0f 84 a3 00 00 00 je 80101dd2 <namex+0x182> // Stop one level early. iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ 80101d2f: 83 ec 04 sub $0x4,%esp 80101d32: 6a 00 push $0x0 80101d34: 57 push %edi 80101d35: 56 push %esi 80101d36: e8 65 fe ff ff call 80101ba0 <dirlookup> 80101d3b: 83 c4 10 add $0x10,%esp 80101d3e: 85 c0 test %eax,%eax 80101d40: 74 5c je 80101d9e <namex+0x14e> // Common idiom: unlock, then put. void iunlockput(struct inode *ip) { iunlock(ip); 80101d42: 83 ec 0c sub $0xc,%esp 80101d45: 89 45 e4 mov %eax,-0x1c(%ebp) 80101d48: 56 push %esi 80101d49: e8 02 fa ff ff call 80101750 <iunlock> iput(ip); 80101d4e: 89 34 24 mov %esi,(%esp) 80101d51: e8 4a fa ff ff call 801017a0 <iput> 80101d56: 8b 45 e4 mov -0x1c(%ebp),%eax 80101d59: 83 c4 10 add $0x10,%esp 80101d5c: 89 c6 mov %eax,%esi 80101d5e: e9 38 ff ff ff jmp 80101c9b <namex+0x4b> while(*path == '/') path++; if(*path == 0) return 0; s = path; while(*path != '/' && *path != 0) 80101d63: 31 c9 xor %ecx,%ecx 80101d65: 8d 76 00 lea 0x0(%esi),%esi path++; len = path - s; if(len >= DIRSIZ) memmove(name, s, DIRSIZ); else { memmove(name, s, len); 80101d68: 83 ec 04 sub $0x4,%esp 80101d6b: 89 55 dc mov %edx,-0x24(%ebp) 80101d6e: 89 4d e4 mov %ecx,-0x1c(%ebp) 80101d71: 51 push %ecx 80101d72: 53 push %ebx 80101d73: 57 push %edi 80101d74: e8 e7 2c 00 00 call 80104a60 <memmove> name[len] = 0; 80101d79: 8b 4d e4 mov -0x1c(%ebp),%ecx 80101d7c: 8b 55 dc mov -0x24(%ebp),%edx 80101d7f: 83 c4 10 add $0x10,%esp 80101d82: c6 04 0f 00 movb $0x0,(%edi,%ecx,1) 80101d86: 89 d3 mov %edx,%ebx 80101d88: e9 65 ff ff ff jmp 80101cf2 <namex+0xa2> return 0; } iunlockput(ip); ip = next; } if(nameiparent){ 80101d8d: 8b 45 e0 mov -0x20(%ebp),%eax 80101d90: 85 c0 test %eax,%eax 80101d92: 75 54 jne 80101de8 <namex+0x198> 80101d94: 89 f0 mov %esi,%eax iput(ip); return 0; } return ip; } 80101d96: 8d 65 f4 lea -0xc(%ebp),%esp 80101d99: 5b pop %ebx 80101d9a: 5e pop %esi 80101d9b: 5f pop %edi 80101d9c: 5d pop %ebp 80101d9d: c3 ret // Common idiom: unlock, then put. void iunlockput(struct inode *ip) { iunlock(ip); 80101d9e: 83 ec 0c sub $0xc,%esp 80101da1: 56 push %esi 80101da2: e8 a9 f9 ff ff call 80101750 <iunlock> iput(ip); 80101da7: 89 34 24 mov %esi,(%esp) 80101daa: e8 f1 f9 ff ff call 801017a0 <iput> iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ iunlockput(ip); return 0; 80101daf: 83 c4 10 add $0x10,%esp if(nameiparent){ iput(ip); return 0; } return ip; } 80101db2: 8d 65 f4 lea -0xc(%ebp),%esp iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ iunlockput(ip); return 0; 80101db5: 31 c0 xor %eax,%eax if(nameiparent){ iput(ip); return 0; } return ip; } 80101db7: 5b pop %ebx 80101db8: 5e pop %esi 80101db9: 5f pop %edi 80101dba: 5d pop %ebp 80101dbb: c3 ret namex(char *path, int nameiparent, char *name) { struct inode *ip, *next; if(*path == '/') ip = iget(ROOTDEV, ROOTINO); 80101dbc: ba 01 00 00 00 mov $0x1,%edx 80101dc1: b8 01 00 00 00 mov $0x1,%eax 80101dc6: e8 45 f4 ff ff call 80101210 <iget> 80101dcb: 89 c6 mov %eax,%esi 80101dcd: e9 c9 fe ff ff jmp 80101c9b <namex+0x4b> iunlockput(ip); return 0; } if(nameiparent && *path == '\0'){ // Stop one level early. iunlock(ip); 80101dd2: 83 ec 0c sub $0xc,%esp 80101dd5: 56 push %esi 80101dd6: e8 75 f9 ff ff call 80101750 <iunlock> return ip; 80101ddb: 83 c4 10 add $0x10,%esp if(nameiparent){ iput(ip); return 0; } return ip; } 80101dde: 8d 65 f4 lea -0xc(%ebp),%esp return 0; } if(nameiparent && *path == '\0'){ // Stop one level early. iunlock(ip); return ip; 80101de1: 89 f0 mov %esi,%eax if(nameiparent){ iput(ip); return 0; } return ip; } 80101de3: 5b pop %ebx 80101de4: 5e pop %esi 80101de5: 5f pop %edi 80101de6: 5d pop %ebp 80101de7: c3 ret } iunlockput(ip); ip = next; } if(nameiparent){ iput(ip); 80101de8: 83 ec 0c sub $0xc,%esp 80101deb: 56 push %esi 80101dec: e8 af f9 ff ff call 801017a0 <iput> return 0; 80101df1: 83 c4 10 add $0x10,%esp 80101df4: 31 c0 xor %eax,%eax 80101df6: eb 9e jmp 80101d96 <namex+0x146> 80101df8: 90 nop 80101df9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101e00 <dirlink>: } // Write a new directory entry (name, inum) into the directory dp. int dirlink(struct inode *dp, char *name, uint inum) { 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 20 sub $0x20,%esp 80101e09: 8b 5d 08 mov 0x8(%ebp),%ebx int off; struct dirent de; struct inode *ip; // Check that name is not present. if((ip = dirlookup(dp, name, 0)) != 0){ 80101e0c: 6a 00 push $0x0 80101e0e: ff 75 0c pushl 0xc(%ebp) 80101e11: 53 push %ebx 80101e12: e8 89 fd ff ff call 80101ba0 <dirlookup> 80101e17: 83 c4 10 add $0x10,%esp 80101e1a: 85 c0 test %eax,%eax 80101e1c: 75 67 jne 80101e85 <dirlink+0x85> iput(ip); return -1; } // Look for an empty dirent. for(off = 0; off < dp->size; off += sizeof(de)){ 80101e1e: 8b 7b 58 mov 0x58(%ebx),%edi 80101e21: 8d 75 d8 lea -0x28(%ebp),%esi 80101e24: 85 ff test %edi,%edi 80101e26: 74 29 je 80101e51 <dirlink+0x51> 80101e28: 31 ff xor %edi,%edi 80101e2a: 8d 75 d8 lea -0x28(%ebp),%esi 80101e2d: eb 09 jmp 80101e38 <dirlink+0x38> 80101e2f: 90 nop 80101e30: 83 c7 10 add $0x10,%edi 80101e33: 39 7b 58 cmp %edi,0x58(%ebx) 80101e36: 76 19 jbe 80101e51 <dirlink+0x51> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e38: 6a 10 push $0x10 80101e3a: 57 push %edi 80101e3b: 56 push %esi 80101e3c: 53 push %ebx 80101e3d: e8 0e fb ff ff call 80101950 <readi> 80101e42: 83 c4 10 add $0x10,%esp 80101e45: 83 f8 10 cmp $0x10,%eax 80101e48: 75 4e jne 80101e98 <dirlink+0x98> panic("dirlink read"); if(de.inum == 0) 80101e4a: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101e4f: 75 df jne 80101e30 <dirlink+0x30> break; } strncpy(de.name, name, DIRSIZ); 80101e51: 8d 45 da lea -0x26(%ebp),%eax 80101e54: 83 ec 04 sub $0x4,%esp 80101e57: 6a 0e push $0xe 80101e59: ff 75 0c pushl 0xc(%ebp) 80101e5c: 50 push %eax 80101e5d: e8 ee 2c 00 00 call 80104b50 <strncpy> de.inum = inum; 80101e62: 8b 45 10 mov 0x10(%ebp),%eax if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e65: 6a 10 push $0x10 80101e67: 57 push %edi 80101e68: 56 push %esi 80101e69: 53 push %ebx if(de.inum == 0) break; } strncpy(de.name, name, DIRSIZ); de.inum = inum; 80101e6a: 66 89 45 d8 mov %ax,-0x28(%ebp) if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e6e: e8 dd fb ff ff call 80101a50 <writei> 80101e73: 83 c4 20 add $0x20,%esp 80101e76: 83 f8 10 cmp $0x10,%eax 80101e79: 75 2a jne 80101ea5 <dirlink+0xa5> panic("dirlink"); return 0; 80101e7b: 31 c0 xor %eax,%eax } 80101e7d: 8d 65 f4 lea -0xc(%ebp),%esp 80101e80: 5b pop %ebx 80101e81: 5e pop %esi 80101e82: 5f pop %edi 80101e83: 5d pop %ebp 80101e84: c3 ret struct dirent de; struct inode *ip; // Check that name is not present. if((ip = dirlookup(dp, name, 0)) != 0){ iput(ip); 80101e85: 83 ec 0c sub $0xc,%esp 80101e88: 50 push %eax 80101e89: e8 12 f9 ff ff call 801017a0 <iput> return -1; 80101e8e: 83 c4 10 add $0x10,%esp 80101e91: b8 ff ff ff ff mov $0xffffffff,%eax 80101e96: eb e5 jmp 80101e7d <dirlink+0x7d> } // Look for an empty dirent. for(off = 0; off < dp->size; off += sizeof(de)){ if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("dirlink read"); 80101e98: 83 ec 0c sub $0xc,%esp 80101e9b: 68 08 77 10 80 push $0x80107708 80101ea0: e8 cb e4 ff ff call 80100370 <panic> } strncpy(de.name, name, DIRSIZ); de.inum = inum; if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("dirlink"); 80101ea5: 83 ec 0c sub $0xc,%esp 80101ea8: 68 f2 7d 10 80 push $0x80107df2 80101ead: e8 be e4 ff ff call 80100370 <panic> 80101eb2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101eb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ec0 <namei>: return ip; } struct inode* namei(char *path) { 80101ec0: 55 push %ebp char name[DIRSIZ]; return namex(path, 0, name); 80101ec1: 31 d2 xor %edx,%edx return ip; } struct inode* namei(char *path) { 80101ec3: 89 e5 mov %esp,%ebp 80101ec5: 83 ec 18 sub $0x18,%esp char name[DIRSIZ]; return namex(path, 0, name); 80101ec8: 8b 45 08 mov 0x8(%ebp),%eax 80101ecb: 8d 4d ea lea -0x16(%ebp),%ecx 80101ece: e8 7d fd ff ff call 80101c50 <namex> } 80101ed3: c9 leave 80101ed4: c3 ret 80101ed5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101ed9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ee0 <nameiparent>: struct inode* nameiparent(char *path, char *name) { 80101ee0: 55 push %ebp return namex(path, 1, name); 80101ee1: ba 01 00 00 00 mov $0x1,%edx return namex(path, 0, name); } struct inode* nameiparent(char *path, char *name) { 80101ee6: 89 e5 mov %esp,%ebp return namex(path, 1, name); 80101ee8: 8b 4d 0c mov 0xc(%ebp),%ecx 80101eeb: 8b 45 08 mov 0x8(%ebp),%eax } 80101eee: 5d pop %ebp } struct inode* nameiparent(char *path, char *name) { return namex(path, 1, name); 80101eef: e9 5c fd ff ff jmp 80101c50 <namex> 80101ef4: 66 90 xchg %ax,%ax 80101ef6: 66 90 xchg %ax,%ax 80101ef8: 66 90 xchg %ax,%ax 80101efa: 66 90 xchg %ax,%ax 80101efc: 66 90 xchg %ax,%ax 80101efe: 66 90 xchg %ax,%ax 80101f00 <idestart>: } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 80101f00: 55 push %ebp if(b == 0) 80101f01: 85 c0 test %eax,%eax } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 80101f03: 89 e5 mov %esp,%ebp 80101f05: 56 push %esi 80101f06: 53 push %ebx if(b == 0) 80101f07: 0f 84 ad 00 00 00 je 80101fba <idestart+0xba> panic("idestart"); if(b->blockno >= FSSIZE) 80101f0d: 8b 58 08 mov 0x8(%eax),%ebx 80101f10: 89 c1 mov %eax,%ecx 80101f12: 81 fb e7 03 00 00 cmp $0x3e7,%ebx 80101f18: 0f 87 8f 00 00 00 ja 80101fad <idestart+0xad> static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80101f1e: ba f7 01 00 00 mov $0x1f7,%edx 80101f23: 90 nop 80101f24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101f28: ec in (%dx),%al static int idewait(int checkerr) { int r; while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80101f29: 83 e0 c0 and $0xffffffc0,%eax 80101f2c: 3c 40 cmp $0x40,%al 80101f2e: 75 f8 jne 80101f28 <idestart+0x28> } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80101f30: 31 f6 xor %esi,%esi 80101f32: ba f6 03 00 00 mov $0x3f6,%edx 80101f37: 89 f0 mov %esi,%eax 80101f39: ee out %al,(%dx) 80101f3a: ba f2 01 00 00 mov $0x1f2,%edx 80101f3f: b8 01 00 00 00 mov $0x1,%eax 80101f44: ee out %al,(%dx) 80101f45: ba f3 01 00 00 mov $0x1f3,%edx 80101f4a: 89 d8 mov %ebx,%eax 80101f4c: ee out %al,(%dx) 80101f4d: 89 d8 mov %ebx,%eax 80101f4f: ba f4 01 00 00 mov $0x1f4,%edx 80101f54: c1 f8 08 sar $0x8,%eax 80101f57: ee out %al,(%dx) 80101f58: ba f5 01 00 00 mov $0x1f5,%edx 80101f5d: 89 f0 mov %esi,%eax 80101f5f: ee out %al,(%dx) 80101f60: 0f b6 41 04 movzbl 0x4(%ecx),%eax 80101f64: ba f6 01 00 00 mov $0x1f6,%edx 80101f69: 83 e0 01 and $0x1,%eax 80101f6c: c1 e0 04 shl $0x4,%eax 80101f6f: 83 c8 e0 or $0xffffffe0,%eax 80101f72: ee out %al,(%dx) outb(0x1f2, sector_per_block); // number of sectors outb(0x1f3, sector & 0xff); outb(0x1f4, (sector >> 8) & 0xff); outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f)); if(b->flags & B_DIRTY){ 80101f73: f6 01 04 testb $0x4,(%ecx) 80101f76: ba f7 01 00 00 mov $0x1f7,%edx 80101f7b: 75 13 jne 80101f90 <idestart+0x90> 80101f7d: b8 20 00 00 00 mov $0x20,%eax 80101f82: ee out %al,(%dx) outb(0x1f7, write_cmd); outsl(0x1f0, b->data, BSIZE/4); } else { outb(0x1f7, read_cmd); } } 80101f83: 8d 65 f8 lea -0x8(%ebp),%esp 80101f86: 5b pop %ebx 80101f87: 5e pop %esi 80101f88: 5d pop %ebp 80101f89: c3 ret 80101f8a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101f90: b8 30 00 00 00 mov $0x30,%eax 80101f95: ee out %al,(%dx) } static inline void outsl(int port, const void *addr, int cnt) { asm volatile("cld; rep outsl" : 80101f96: ba f0 01 00 00 mov $0x1f0,%edx outb(0x1f4, (sector >> 8) & 0xff); outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f)); if(b->flags & B_DIRTY){ outb(0x1f7, write_cmd); outsl(0x1f0, b->data, BSIZE/4); 80101f9b: 8d 71 5c lea 0x5c(%ecx),%esi 80101f9e: b9 80 00 00 00 mov $0x80,%ecx 80101fa3: fc cld 80101fa4: f3 6f rep outsl %ds:(%esi),(%dx) } else { outb(0x1f7, read_cmd); } } 80101fa6: 8d 65 f8 lea -0x8(%ebp),%esp 80101fa9: 5b pop %ebx 80101faa: 5e pop %esi 80101fab: 5d pop %ebp 80101fac: c3 ret idestart(struct buf *b) { if(b == 0) panic("idestart"); if(b->blockno >= FSSIZE) panic("incorrect blockno"); 80101fad: 83 ec 0c sub $0xc,%esp 80101fb0: 68 74 77 10 80 push $0x80107774 80101fb5: e8 b6 e3 ff ff call 80100370 <panic> // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { if(b == 0) panic("idestart"); 80101fba: 83 ec 0c sub $0xc,%esp 80101fbd: 68 6b 77 10 80 push $0x8010776b 80101fc2: e8 a9 e3 ff ff call 80100370 <panic> 80101fc7: 89 f6 mov %esi,%esi 80101fc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101fd0 <ideinit>: return 0; } void ideinit(void) { 80101fd0: 55 push %ebp 80101fd1: 89 e5 mov %esp,%ebp 80101fd3: 83 ec 10 sub $0x10,%esp int i; initlock(&idelock, "ide"); 80101fd6: 68 86 77 10 80 push $0x80107786 80101fdb: 68 80 b5 10 80 push $0x8010b580 80101fe0: e8 5b 27 00 00 call 80104740 <initlock> ioapicenable(IRQ_IDE, ncpu - 1); 80101fe5: 58 pop %eax 80101fe6: a1 00 3d 11 80 mov 0x80113d00,%eax 80101feb: 5a pop %edx 80101fec: 83 e8 01 sub $0x1,%eax 80101fef: 50 push %eax 80101ff0: 6a 0e push $0xe 80101ff2: e8 a9 02 00 00 call 801022a0 <ioapicenable> 80101ff7: 83 c4 10 add $0x10,%esp static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80101ffa: ba f7 01 00 00 mov $0x1f7,%edx 80101fff: 90 nop 80102000: ec in (%dx),%al static int idewait(int checkerr) { int r; while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80102001: 83 e0 c0 and $0xffffffc0,%eax 80102004: 3c 40 cmp $0x40,%al 80102006: 75 f8 jne 80102000 <ideinit+0x30> } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102008: ba f6 01 00 00 mov $0x1f6,%edx 8010200d: b8 f0 ff ff ff mov $0xfffffff0,%eax 80102012: ee out %al,(%dx) 80102013: b9 e8 03 00 00 mov $0x3e8,%ecx static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102018: ba f7 01 00 00 mov $0x1f7,%edx 8010201d: eb 06 jmp 80102025 <ideinit+0x55> 8010201f: 90 nop ioapicenable(IRQ_IDE, ncpu - 1); idewait(0); // Check if disk 1 is present outb(0x1f6, 0xe0 | (1<<4)); for(i=0; i<1000; i++){ 80102020: 83 e9 01 sub $0x1,%ecx 80102023: 74 0f je 80102034 <ideinit+0x64> 80102025: ec in (%dx),%al if(inb(0x1f7) != 0){ 80102026: 84 c0 test %al,%al 80102028: 74 f6 je 80102020 <ideinit+0x50> havedisk1 = 1; 8010202a: c7 05 60 b5 10 80 01 movl $0x1,0x8010b560 80102031: 00 00 00 } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102034: ba f6 01 00 00 mov $0x1f6,%edx 80102039: b8 e0 ff ff ff mov $0xffffffe0,%eax 8010203e: ee out %al,(%dx) } } // Switch back to disk 0. outb(0x1f6, 0xe0 | (0<<4)); } 8010203f: c9 leave 80102040: c3 ret 80102041: eb 0d jmp 80102050 <ideintr> 80102043: 90 nop 80102044: 90 nop 80102045: 90 nop 80102046: 90 nop 80102047: 90 nop 80102048: 90 nop 80102049: 90 nop 8010204a: 90 nop 8010204b: 90 nop 8010204c: 90 nop 8010204d: 90 nop 8010204e: 90 nop 8010204f: 90 nop 80102050 <ideintr>: } // Interrupt handler. void ideintr(void) { 80102050: 55 push %ebp 80102051: 89 e5 mov %esp,%ebp 80102053: 57 push %edi 80102054: 56 push %esi 80102055: 53 push %ebx 80102056: 83 ec 18 sub $0x18,%esp struct buf *b; // First queued buffer is the active request. acquire(&idelock); 80102059: 68 80 b5 10 80 push $0x8010b580 8010205e: e8 dd 27 00 00 call 80104840 <acquire> if((b = idequeue) == 0){ 80102063: 8b 1d 64 b5 10 80 mov 0x8010b564,%ebx 80102069: 83 c4 10 add $0x10,%esp 8010206c: 85 db test %ebx,%ebx 8010206e: 74 34 je 801020a4 <ideintr+0x54> release(&idelock); return; } idequeue = b->qnext; 80102070: 8b 43 58 mov 0x58(%ebx),%eax 80102073: a3 64 b5 10 80 mov %eax,0x8010b564 // Read data if needed. if(!(b->flags & B_DIRTY) && idewait(1) >= 0) 80102078: 8b 33 mov (%ebx),%esi 8010207a: f7 c6 04 00 00 00 test $0x4,%esi 80102080: 74 3e je 801020c0 <ideintr+0x70> insl(0x1f0, b->data, BSIZE/4); // Wake process waiting for this buf. b->flags |= B_VALID; b->flags &= ~B_DIRTY; 80102082: 83 e6 fb and $0xfffffffb,%esi wakeup(b); 80102085: 83 ec 0c sub $0xc,%esp if(!(b->flags & B_DIRTY) && idewait(1) >= 0) insl(0x1f0, b->data, BSIZE/4); // Wake process waiting for this buf. b->flags |= B_VALID; b->flags &= ~B_DIRTY; 80102088: 83 ce 02 or $0x2,%esi 8010208b: 89 33 mov %esi,(%ebx) wakeup(b); 8010208d: 53 push %ebx 8010208e: e8 4d 1e 00 00 call 80103ee0 <wakeup> // Start disk on next buf in queue. if(idequeue != 0) 80102093: a1 64 b5 10 80 mov 0x8010b564,%eax 80102098: 83 c4 10 add $0x10,%esp 8010209b: 85 c0 test %eax,%eax 8010209d: 74 05 je 801020a4 <ideintr+0x54> idestart(idequeue); 8010209f: e8 5c fe ff ff call 80101f00 <idestart> // First queued buffer is the active request. acquire(&idelock); if((b = idequeue) == 0){ release(&idelock); 801020a4: 83 ec 0c sub $0xc,%esp 801020a7: 68 80 b5 10 80 push $0x8010b580 801020ac: e8 af 28 00 00 call 80104960 <release> // Start disk on next buf in queue. if(idequeue != 0) idestart(idequeue); release(&idelock); } 801020b1: 8d 65 f4 lea -0xc(%ebp),%esp 801020b4: 5b pop %ebx 801020b5: 5e pop %esi 801020b6: 5f pop %edi 801020b7: 5d pop %ebp 801020b8: c3 ret 801020b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801020c0: ba f7 01 00 00 mov $0x1f7,%edx 801020c5: 8d 76 00 lea 0x0(%esi),%esi 801020c8: ec in (%dx),%al static int idewait(int checkerr) { int r; while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 801020c9: 89 c1 mov %eax,%ecx 801020cb: 83 e1 c0 and $0xffffffc0,%ecx 801020ce: 80 f9 40 cmp $0x40,%cl 801020d1: 75 f5 jne 801020c8 <ideintr+0x78> ; if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0) 801020d3: a8 21 test $0x21,%al 801020d5: 75 ab jne 80102082 <ideintr+0x32> } idequeue = b->qnext; // Read data if needed. if(!(b->flags & B_DIRTY) && idewait(1) >= 0) insl(0x1f0, b->data, BSIZE/4); 801020d7: 8d 7b 5c lea 0x5c(%ebx),%edi } static inline void insl(int port, void *addr, int cnt) { asm volatile("cld; rep insl" : 801020da: b9 80 00 00 00 mov $0x80,%ecx 801020df: ba f0 01 00 00 mov $0x1f0,%edx 801020e4: fc cld 801020e5: f3 6d rep insl (%dx),%es:(%edi) 801020e7: 8b 33 mov (%ebx),%esi 801020e9: eb 97 jmp 80102082 <ideintr+0x32> 801020eb: 90 nop 801020ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801020f0 <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) { 801020f0: 55 push %ebp 801020f1: 89 e5 mov %esp,%ebp 801020f3: 53 push %ebx 801020f4: 83 ec 10 sub $0x10,%esp 801020f7: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf **pp; if(!holdingsleep(&b->lock)) 801020fa: 8d 43 0c lea 0xc(%ebx),%eax 801020fd: 50 push %eax 801020fe: e8 0d 26 00 00 call 80104710 <holdingsleep> 80102103: 83 c4 10 add $0x10,%esp 80102106: 85 c0 test %eax,%eax 80102108: 0f 84 ad 00 00 00 je 801021bb <iderw+0xcb> panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) 8010210e: 8b 03 mov (%ebx),%eax 80102110: 83 e0 06 and $0x6,%eax 80102113: 83 f8 02 cmp $0x2,%eax 80102116: 0f 84 b9 00 00 00 je 801021d5 <iderw+0xe5> panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) 8010211c: 8b 53 04 mov 0x4(%ebx),%edx 8010211f: 85 d2 test %edx,%edx 80102121: 74 0d je 80102130 <iderw+0x40> 80102123: a1 60 b5 10 80 mov 0x8010b560,%eax 80102128: 85 c0 test %eax,%eax 8010212a: 0f 84 98 00 00 00 je 801021c8 <iderw+0xd8> panic("iderw: ide disk 1 not present"); acquire(&idelock); //DOC:acquire-lock 80102130: 83 ec 0c sub $0xc,%esp 80102133: 68 80 b5 10 80 push $0x8010b580 80102138: e8 03 27 00 00 call 80104840 <acquire> // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010213d: 8b 15 64 b5 10 80 mov 0x8010b564,%edx 80102143: 83 c4 10 add $0x10,%esp panic("iderw: ide disk 1 not present"); acquire(&idelock); //DOC:acquire-lock // Append b to idequeue. b->qnext = 0; 80102146: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010214d: 85 d2 test %edx,%edx 8010214f: 75 09 jne 8010215a <iderw+0x6a> 80102151: eb 58 jmp 801021ab <iderw+0xbb> 80102153: 90 nop 80102154: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102158: 89 c2 mov %eax,%edx 8010215a: 8b 42 58 mov 0x58(%edx),%eax 8010215d: 85 c0 test %eax,%eax 8010215f: 75 f7 jne 80102158 <iderw+0x68> 80102161: 83 c2 58 add $0x58,%edx ; *pp = b; 80102164: 89 1a mov %ebx,(%edx) // Start disk if necessary. if(idequeue == b) 80102166: 3b 1d 64 b5 10 80 cmp 0x8010b564,%ebx 8010216c: 74 44 je 801021b2 <iderw+0xc2> idestart(b); // Wait for request to finish. while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 8010216e: 8b 03 mov (%ebx),%eax 80102170: 83 e0 06 and $0x6,%eax 80102173: 83 f8 02 cmp $0x2,%eax 80102176: 74 23 je 8010219b <iderw+0xab> 80102178: 90 nop 80102179: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sleep(b, &idelock); 80102180: 83 ec 08 sub $0x8,%esp 80102183: 68 80 b5 10 80 push $0x8010b580 80102188: 53 push %ebx 80102189: e8 a2 1b 00 00 call 80103d30 <sleep> // Start disk if necessary. if(idequeue == b) idestart(b); // Wait for request to finish. while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 8010218e: 8b 03 mov (%ebx),%eax 80102190: 83 c4 10 add $0x10,%esp 80102193: 83 e0 06 and $0x6,%eax 80102196: 83 f8 02 cmp $0x2,%eax 80102199: 75 e5 jne 80102180 <iderw+0x90> sleep(b, &idelock); } release(&idelock); 8010219b: c7 45 08 80 b5 10 80 movl $0x8010b580,0x8(%ebp) } 801021a2: 8b 5d fc mov -0x4(%ebp),%ebx 801021a5: c9 leave while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ sleep(b, &idelock); } release(&idelock); 801021a6: e9 b5 27 00 00 jmp 80104960 <release> acquire(&idelock); //DOC:acquire-lock // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 801021ab: ba 64 b5 10 80 mov $0x8010b564,%edx 801021b0: eb b2 jmp 80102164 <iderw+0x74> ; *pp = b; // Start disk if necessary. if(idequeue == b) idestart(b); 801021b2: 89 d8 mov %ebx,%eax 801021b4: e8 47 fd ff ff call 80101f00 <idestart> 801021b9: eb b3 jmp 8010216e <iderw+0x7e> iderw(struct buf *b) { struct buf **pp; if(!holdingsleep(&b->lock)) panic("iderw: buf not locked"); 801021bb: 83 ec 0c sub $0xc,%esp 801021be: 68 8a 77 10 80 push $0x8010778a 801021c3: e8 a8 e1 ff ff call 80100370 <panic> if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) panic("iderw: ide disk 1 not present"); 801021c8: 83 ec 0c sub $0xc,%esp 801021cb: 68 b5 77 10 80 push $0x801077b5 801021d0: e8 9b e1 ff ff call 80100370 <panic> struct buf **pp; if(!holdingsleep(&b->lock)) panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) panic("iderw: nothing to do"); 801021d5: 83 ec 0c sub $0xc,%esp 801021d8: 68 a0 77 10 80 push $0x801077a0 801021dd: e8 8e e1 ff ff call 80100370 <panic> 801021e2: 66 90 xchg %ax,%ax 801021e4: 66 90 xchg %ax,%ax 801021e6: 66 90 xchg %ax,%ax 801021e8: 66 90 xchg %ax,%ax 801021ea: 66 90 xchg %ax,%ax 801021ec: 66 90 xchg %ax,%ax 801021ee: 66 90 xchg %ax,%ax 801021f0 <ioapicinit>: ioapic->data = data; } void ioapicinit(void) { 801021f0: 55 push %ebp int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; 801021f1: c7 05 34 36 11 80 00 movl $0xfec00000,0x80113634 801021f8: 00 c0 fe ioapic->data = data; } void ioapicinit(void) { 801021fb: 89 e5 mov %esp,%ebp 801021fd: 56 push %esi 801021fe: 53 push %ebx }; static uint ioapicread(int reg) { ioapic->reg = reg; 801021ff: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000 80102206: 00 00 00 return ioapic->data; 80102209: 8b 15 34 36 11 80 mov 0x80113634,%edx 8010220f: 8b 72 10 mov 0x10(%edx),%esi }; static uint ioapicread(int reg) { ioapic->reg = reg; 80102212: c7 02 00 00 00 00 movl $0x0,(%edx) return ioapic->data; 80102218: 8b 0d 34 36 11 80 mov 0x80113634,%ecx int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 8010221e: 0f b6 15 60 37 11 80 movzbl 0x80113760,%edx ioapicinit(void) { int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 80102225: 89 f0 mov %esi,%eax 80102227: c1 e8 10 shr $0x10,%eax 8010222a: 0f b6 f0 movzbl %al,%esi static uint ioapicread(int reg) { ioapic->reg = reg; return ioapic->data; 8010222d: 8b 41 10 mov 0x10(%ecx),%eax int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 80102230: c1 e8 18 shr $0x18,%eax 80102233: 39 d0 cmp %edx,%eax 80102235: 74 16 je 8010224d <ioapicinit+0x5d> cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); 80102237: 83 ec 0c sub $0xc,%esp 8010223a: 68 d4 77 10 80 push $0x801077d4 8010223f: e8 1c e4 ff ff call 80100660 <cprintf> 80102244: 8b 0d 34 36 11 80 mov 0x80113634,%ecx 8010224a: 83 c4 10 add $0x10,%esp 8010224d: 83 c6 21 add $0x21,%esi ioapic->data = data; } void ioapicinit(void) { 80102250: ba 10 00 00 00 mov $0x10,%edx 80102255: b8 20 00 00 00 mov $0x20,%eax 8010225a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 80102260: 89 11 mov %edx,(%ecx) ioapic->data = data; 80102262: 8b 0d 34 36 11 80 mov 0x80113634,%ecx cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); // Mark all interrupts edge-triggered, active high, disabled, // and not routed to any CPUs. for(i = 0; i <= maxintr; i++){ ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i)); 80102268: 89 c3 mov %eax,%ebx 8010226a: 81 cb 00 00 01 00 or $0x10000,%ebx 80102270: 83 c0 01 add $0x1,%eax static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; ioapic->data = data; 80102273: 89 59 10 mov %ebx,0x10(%ecx) 80102276: 8d 5a 01 lea 0x1(%edx),%ebx 80102279: 83 c2 02 add $0x2,%edx if(id != ioapicid) cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); // Mark all interrupts edge-triggered, active high, disabled, // and not routed to any CPUs. for(i = 0; i <= maxintr; i++){ 8010227c: 39 f0 cmp %esi,%eax } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 8010227e: 89 19 mov %ebx,(%ecx) ioapic->data = data; 80102280: 8b 0d 34 36 11 80 mov 0x80113634,%ecx 80102286: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) if(id != ioapicid) cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); // Mark all interrupts edge-triggered, active high, disabled, // and not routed to any CPUs. for(i = 0; i <= maxintr; i++){ 8010228d: 75 d1 jne 80102260 <ioapicinit+0x70> ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i)); ioapicwrite(REG_TABLE+2*i+1, 0); } } 8010228f: 8d 65 f8 lea -0x8(%ebp),%esp 80102292: 5b pop %ebx 80102293: 5e pop %esi 80102294: 5d pop %ebp 80102295: c3 ret 80102296: 8d 76 00 lea 0x0(%esi),%esi 80102299: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801022a0 <ioapicenable>: void ioapicenable(int irq, int cpunum) { 801022a0: 55 push %ebp } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 801022a1: 8b 0d 34 36 11 80 mov 0x80113634,%ecx } } void ioapicenable(int irq, int cpunum) { 801022a7: 89 e5 mov %esp,%ebp 801022a9: 8b 45 08 mov 0x8(%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); 801022ac: 8d 50 20 lea 0x20(%eax),%edx 801022af: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 801022b3: 89 01 mov %eax,(%ecx) ioapic->data = data; 801022b5: 8b 0d 34 36 11 80 mov 0x80113634,%ecx } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 801022bb: 83 c0 01 add $0x1,%eax ioapic->data = data; 801022be: 89 51 10 mov %edx,0x10(%ecx) { // Mark interrupt edge-triggered, active high, // enabled, and routed to the given cpunum, // which happens to be that cpu's APIC ID. ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq); ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022c1: 8b 55 0c mov 0xc(%ebp),%edx } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 801022c4: 89 01 mov %eax,(%ecx) ioapic->data = data; 801022c6: a1 34 36 11 80 mov 0x80113634,%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); ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022cb: c1 e2 18 shl $0x18,%edx static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; ioapic->data = data; 801022ce: 89 50 10 mov %edx,0x10(%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); ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); } 801022d1: 5d pop %ebp 801022d2: c3 ret 801022d3: 66 90 xchg %ax,%ax 801022d5: 66 90 xchg %ax,%ax 801022d7: 66 90 xchg %ax,%ax 801022d9: 66 90 xchg %ax,%ax 801022db: 66 90 xchg %ax,%ax 801022dd: 66 90 xchg %ax,%ax 801022df: 90 nop 801022e0 <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) { 801022e0: 55 push %ebp 801022e1: 89 e5 mov %esp,%ebp 801022e3: 53 push %ebx 801022e4: 83 ec 04 sub $0x4,%esp 801022e7: 8b 5d 08 mov 0x8(%ebp),%ebx struct run *r; if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP) 801022ea: f7 c3 ff 0f 00 00 test $0xfff,%ebx 801022f0: 75 70 jne 80102362 <kfree+0x82> 801022f2: 81 fb 48 6f 11 80 cmp $0x80116f48,%ebx 801022f8: 72 68 jb 80102362 <kfree+0x82> 801022fa: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80102300: 3d ff ff ff 0d cmp $0xdffffff,%eax 80102305: 77 5b ja 80102362 <kfree+0x82> panic("kfree"); // Fill with junk to catch dangling refs. memset(v, 1, PGSIZE); 80102307: 83 ec 04 sub $0x4,%esp 8010230a: 68 00 10 00 00 push $0x1000 8010230f: 6a 01 push $0x1 80102311: 53 push %ebx 80102312: e8 99 26 00 00 call 801049b0 <memset> if(kmem.use_lock) 80102317: 8b 15 74 36 11 80 mov 0x80113674,%edx 8010231d: 83 c4 10 add $0x10,%esp 80102320: 85 d2 test %edx,%edx 80102322: 75 2c jne 80102350 <kfree+0x70> acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; 80102324: a1 78 36 11 80 mov 0x80113678,%eax 80102329: 89 03 mov %eax,(%ebx) kmem.freelist = r; if(kmem.use_lock) 8010232b: a1 74 36 11 80 mov 0x80113674,%eax if(kmem.use_lock) acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; kmem.freelist = r; 80102330: 89 1d 78 36 11 80 mov %ebx,0x80113678 if(kmem.use_lock) 80102336: 85 c0 test %eax,%eax 80102338: 75 06 jne 80102340 <kfree+0x60> release(&kmem.lock); } 8010233a: 8b 5d fc mov -0x4(%ebp),%ebx 8010233d: c9 leave 8010233e: c3 ret 8010233f: 90 nop acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; kmem.freelist = r; if(kmem.use_lock) release(&kmem.lock); 80102340: c7 45 08 40 36 11 80 movl $0x80113640,0x8(%ebp) } 80102347: 8b 5d fc mov -0x4(%ebp),%ebx 8010234a: c9 leave acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; kmem.freelist = r; if(kmem.use_lock) release(&kmem.lock); 8010234b: e9 10 26 00 00 jmp 80104960 <release> // Fill with junk to catch dangling refs. memset(v, 1, PGSIZE); if(kmem.use_lock) acquire(&kmem.lock); 80102350: 83 ec 0c sub $0xc,%esp 80102353: 68 40 36 11 80 push $0x80113640 80102358: e8 e3 24 00 00 call 80104840 <acquire> 8010235d: 83 c4 10 add $0x10,%esp 80102360: eb c2 jmp 80102324 <kfree+0x44> kfree(char *v) { struct run *r; if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP) panic("kfree"); 80102362: 83 ec 0c sub $0xc,%esp 80102365: 68 06 78 10 80 push $0x80107806 8010236a: e8 01 e0 ff ff call 80100370 <panic> 8010236f: 90 nop 80102370 <freerange>: kmem.use_lock = 1; } void freerange(void *vstart, void *vend) { 80102370: 55 push %ebp 80102371: 89 e5 mov %esp,%ebp 80102373: 56 push %esi 80102374: 53 push %ebx char *p; p = (char*)PGROUNDUP((uint)vstart); 80102375: 8b 45 08 mov 0x8(%ebp),%eax kmem.use_lock = 1; } void freerange(void *vstart, void *vend) { 80102378: 8b 75 0c mov 0xc(%ebp),%esi char *p; p = (char*)PGROUNDUP((uint)vstart); 8010237b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102381: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102387: 81 c3 00 10 00 00 add $0x1000,%ebx 8010238d: 39 de cmp %ebx,%esi 8010238f: 72 23 jb 801023b4 <freerange+0x44> 80102391: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 80102398: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 8010239e: 83 ec 0c sub $0xc,%esp void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023a1: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 801023a7: 50 push %eax 801023a8: e8 33 ff ff ff call 801022e0 <kfree> void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023ad: 83 c4 10 add $0x10,%esp 801023b0: 39 f3 cmp %esi,%ebx 801023b2: 76 e4 jbe 80102398 <freerange+0x28> kfree(p); } 801023b4: 8d 65 f8 lea -0x8(%ebp),%esp 801023b7: 5b pop %ebx 801023b8: 5e pop %esi 801023b9: 5d pop %ebp 801023ba: c3 ret 801023bb: 90 nop 801023bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801023c0 <kinit1>: // the pages mapped by entrypgdir on free list. // 2. main() calls kinit2() with the rest of the physical pages // after installing a full page table that maps them on all cores. void kinit1(void *vstart, void *vend) { 801023c0: 55 push %ebp 801023c1: 89 e5 mov %esp,%ebp 801023c3: 56 push %esi 801023c4: 53 push %ebx 801023c5: 8b 75 0c mov 0xc(%ebp),%esi initlock(&kmem.lock, "kmem"); 801023c8: 83 ec 08 sub $0x8,%esp 801023cb: 68 0c 78 10 80 push $0x8010780c 801023d0: 68 40 36 11 80 push $0x80113640 801023d5: e8 66 23 00 00 call 80104740 <initlock> void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); 801023da: 8b 45 08 mov 0x8(%ebp),%eax for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023dd: 83 c4 10 add $0x10,%esp // after installing a full page table that maps them on all cores. void kinit1(void *vstart, void *vend) { initlock(&kmem.lock, "kmem"); kmem.use_lock = 0; 801023e0: c7 05 74 36 11 80 00 movl $0x0,0x80113674 801023e7: 00 00 00 void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); 801023ea: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 801023f0: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023f6: 81 c3 00 10 00 00 add $0x1000,%ebx 801023fc: 39 de cmp %ebx,%esi 801023fe: 72 1c jb 8010241c <kinit1+0x5c> kfree(p); 80102400: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 80102406: 83 ec 0c sub $0xc,%esp void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102409: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 8010240f: 50 push %eax 80102410: e8 cb fe ff ff call 801022e0 <kfree> void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102415: 83 c4 10 add $0x10,%esp 80102418: 39 de cmp %ebx,%esi 8010241a: 73 e4 jae 80102400 <kinit1+0x40> kinit1(void *vstart, void *vend) { initlock(&kmem.lock, "kmem"); kmem.use_lock = 0; freerange(vstart, vend); } 8010241c: 8d 65 f8 lea -0x8(%ebp),%esp 8010241f: 5b pop %ebx 80102420: 5e pop %esi 80102421: 5d pop %ebp 80102422: c3 ret 80102423: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102429: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102430 <kinit2>: void kinit2(void *vstart, void *vend) { 80102430: 55 push %ebp 80102431: 89 e5 mov %esp,%ebp 80102433: 56 push %esi 80102434: 53 push %ebx void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); 80102435: 8b 45 08 mov 0x8(%ebp),%eax freerange(vstart, vend); } void kinit2(void *vstart, void *vend) { 80102438: 8b 75 0c mov 0xc(%ebp),%esi void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); 8010243b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102441: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102447: 81 c3 00 10 00 00 add $0x1000,%ebx 8010244d: 39 de cmp %ebx,%esi 8010244f: 72 23 jb 80102474 <kinit2+0x44> 80102451: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 80102458: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 8010245e: 83 ec 0c sub $0xc,%esp void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102461: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 80102467: 50 push %eax 80102468: e8 73 fe ff ff call 801022e0 <kfree> void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 8010246d: 83 c4 10 add $0x10,%esp 80102470: 39 de cmp %ebx,%esi 80102472: 73 e4 jae 80102458 <kinit2+0x28> void kinit2(void *vstart, void *vend) { freerange(vstart, vend); kmem.use_lock = 1; 80102474: c7 05 74 36 11 80 01 movl $0x1,0x80113674 8010247b: 00 00 00 } 8010247e: 8d 65 f8 lea -0x8(%ebp),%esp 80102481: 5b pop %ebx 80102482: 5e pop %esi 80102483: 5d pop %ebp 80102484: c3 ret 80102485: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102489: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102490 <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) { 80102490: 55 push %ebp 80102491: 89 e5 mov %esp,%ebp 80102493: 53 push %ebx 80102494: 83 ec 04 sub $0x4,%esp struct run *r; if(kmem.use_lock) 80102497: a1 74 36 11 80 mov 0x80113674,%eax 8010249c: 85 c0 test %eax,%eax 8010249e: 75 30 jne 801024d0 <kalloc+0x40> acquire(&kmem.lock); r = kmem.freelist; 801024a0: 8b 1d 78 36 11 80 mov 0x80113678,%ebx if(r) 801024a6: 85 db test %ebx,%ebx 801024a8: 74 1c je 801024c6 <kalloc+0x36> kmem.freelist = r->next; 801024aa: 8b 13 mov (%ebx),%edx 801024ac: 89 15 78 36 11 80 mov %edx,0x80113678 if(kmem.use_lock) 801024b2: 85 c0 test %eax,%eax 801024b4: 74 10 je 801024c6 <kalloc+0x36> release(&kmem.lock); 801024b6: 83 ec 0c sub $0xc,%esp 801024b9: 68 40 36 11 80 push $0x80113640 801024be: e8 9d 24 00 00 call 80104960 <release> 801024c3: 83 c4 10 add $0x10,%esp return (char*)r; } 801024c6: 89 d8 mov %ebx,%eax 801024c8: 8b 5d fc mov -0x4(%ebp),%ebx 801024cb: c9 leave 801024cc: c3 ret 801024cd: 8d 76 00 lea 0x0(%esi),%esi kalloc(void) { struct run *r; if(kmem.use_lock) acquire(&kmem.lock); 801024d0: 83 ec 0c sub $0xc,%esp 801024d3: 68 40 36 11 80 push $0x80113640 801024d8: e8 63 23 00 00 call 80104840 <acquire> r = kmem.freelist; 801024dd: 8b 1d 78 36 11 80 mov 0x80113678,%ebx if(r) 801024e3: 83 c4 10 add $0x10,%esp 801024e6: a1 74 36 11 80 mov 0x80113674,%eax 801024eb: 85 db test %ebx,%ebx 801024ed: 75 bb jne 801024aa <kalloc+0x1a> 801024ef: eb c1 jmp 801024b2 <kalloc+0x22> 801024f1: 66 90 xchg %ax,%ax 801024f3: 66 90 xchg %ax,%ax 801024f5: 66 90 xchg %ax,%ax 801024f7: 66 90 xchg %ax,%ax 801024f9: 66 90 xchg %ax,%ax 801024fb: 66 90 xchg %ax,%ax 801024fd: 66 90 xchg %ax,%ax 801024ff: 90 nop 80102500 <kbdgetc>: #include "defs.h" #include "kbd.h" int kbdgetc(void) { 80102500: 55 push %ebp static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102501: ba 64 00 00 00 mov $0x64,%edx 80102506: 89 e5 mov %esp,%ebp 80102508: ec in (%dx),%al normalmap, shiftmap, ctlmap, ctlmap }; uint st, data, c; st = inb(KBSTATP); if((st & KBS_DIB) == 0) 80102509: a8 01 test $0x1,%al 8010250b: 0f 84 af 00 00 00 je 801025c0 <kbdgetc+0xc0> 80102511: ba 60 00 00 00 mov $0x60,%edx 80102516: ec in (%dx),%al return -1; data = inb(KBDATAP); 80102517: 0f b6 d0 movzbl %al,%edx if(data == 0xE0){ 8010251a: 81 fa e0 00 00 00 cmp $0xe0,%edx 80102520: 74 7e je 801025a0 <kbdgetc+0xa0> shift |= E0ESC; return 0; } else if(data & 0x80){ 80102522: 84 c0 test %al,%al // Key released data = (shift & E0ESC ? data : data & 0x7F); 80102524: 8b 0d b4 b5 10 80 mov 0x8010b5b4,%ecx data = inb(KBDATAP); if(data == 0xE0){ shift |= E0ESC; return 0; } else if(data & 0x80){ 8010252a: 79 24 jns 80102550 <kbdgetc+0x50> // Key released data = (shift & E0ESC ? data : data & 0x7F); 8010252c: f6 c1 40 test $0x40,%cl 8010252f: 75 05 jne 80102536 <kbdgetc+0x36> 80102531: 89 c2 mov %eax,%edx 80102533: 83 e2 7f and $0x7f,%edx shift &= ~(shiftcode[data] | E0ESC); 80102536: 0f b6 82 40 79 10 80 movzbl -0x7fef86c0(%edx),%eax 8010253d: 83 c8 40 or $0x40,%eax 80102540: 0f b6 c0 movzbl %al,%eax 80102543: f7 d0 not %eax 80102545: 21 c8 and %ecx,%eax 80102547: a3 b4 b5 10 80 mov %eax,0x8010b5b4 return 0; 8010254c: 31 c0 xor %eax,%eax c += 'A' - 'a'; else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 8010254e: 5d pop %ebp 8010254f: c3 ret } else if(data & 0x80){ // Key released data = (shift & E0ESC ? data : data & 0x7F); shift &= ~(shiftcode[data] | E0ESC); return 0; } else if(shift & E0ESC){ 80102550: f6 c1 40 test $0x40,%cl 80102553: 74 09 je 8010255e <kbdgetc+0x5e> // Last character was an E0 escape; or with 0x80 data |= 0x80; 80102555: 83 c8 80 or $0xffffff80,%eax shift &= ~E0ESC; 80102558: 83 e1 bf and $0xffffffbf,%ecx data = (shift & E0ESC ? data : data & 0x7F); shift &= ~(shiftcode[data] | E0ESC); return 0; } else if(shift & E0ESC){ // Last character was an E0 escape; or with 0x80 data |= 0x80; 8010255b: 0f b6 d0 movzbl %al,%edx shift &= ~E0ESC; } shift |= shiftcode[data]; shift ^= togglecode[data]; 8010255e: 0f b6 82 40 79 10 80 movzbl -0x7fef86c0(%edx),%eax 80102565: 09 c1 or %eax,%ecx 80102567: 0f b6 82 40 78 10 80 movzbl -0x7fef87c0(%edx),%eax 8010256e: 31 c1 xor %eax,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 80102570: 89 c8 mov %ecx,%eax data |= 0x80; shift &= ~E0ESC; } shift |= shiftcode[data]; shift ^= togglecode[data]; 80102572: 89 0d b4 b5 10 80 mov %ecx,0x8010b5b4 c = charcode[shift & (CTL | SHIFT)][data]; 80102578: 83 e0 03 and $0x3,%eax if(shift & CAPSLOCK){ 8010257b: 83 e1 08 and $0x8,%ecx shift &= ~E0ESC; } shift |= shiftcode[data]; shift ^= togglecode[data]; c = charcode[shift & (CTL | SHIFT)][data]; 8010257e: 8b 04 85 20 78 10 80 mov -0x7fef87e0(,%eax,4),%eax 80102585: 0f b6 04 10 movzbl (%eax,%edx,1),%eax if(shift & CAPSLOCK){ 80102589: 74 c3 je 8010254e <kbdgetc+0x4e> if('a' <= c && c <= 'z') 8010258b: 8d 50 9f lea -0x61(%eax),%edx 8010258e: 83 fa 19 cmp $0x19,%edx 80102591: 77 1d ja 801025b0 <kbdgetc+0xb0> c += 'A' - 'a'; 80102593: 83 e8 20 sub $0x20,%eax else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 80102596: 5d pop %ebp 80102597: c3 ret 80102598: 90 nop 80102599: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; data = inb(KBDATAP); if(data == 0xE0){ shift |= E0ESC; return 0; 801025a0: 31 c0 xor %eax,%eax if((st & KBS_DIB) == 0) return -1; data = inb(KBDATAP); if(data == 0xE0){ shift |= E0ESC; 801025a2: 83 0d b4 b5 10 80 40 orl $0x40,0x8010b5b4 c += 'A' - 'a'; else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 801025a9: 5d pop %ebp 801025aa: c3 ret 801025ab: 90 nop 801025ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi shift ^= togglecode[data]; c = charcode[shift & (CTL | SHIFT)][data]; if(shift & CAPSLOCK){ if('a' <= c && c <= 'z') c += 'A' - 'a'; else if('A' <= c && c <= 'Z') 801025b0: 8d 48 bf lea -0x41(%eax),%ecx c += 'a' - 'A'; 801025b3: 8d 50 20 lea 0x20(%eax),%edx } return c; } 801025b6: 5d pop %ebp c = charcode[shift & (CTL | SHIFT)][data]; if(shift & CAPSLOCK){ if('a' <= c && c <= 'z') c += 'A' - 'a'; else if('A' <= c && c <= 'Z') c += 'a' - 'A'; 801025b7: 83 f9 19 cmp $0x19,%ecx 801025ba: 0f 46 c2 cmovbe %edx,%eax } return c; } 801025bd: c3 ret 801025be: 66 90 xchg %ax,%ax }; uint st, data, c; st = inb(KBSTATP); if((st & KBS_DIB) == 0) return -1; 801025c0: b8 ff ff ff ff mov $0xffffffff,%eax c += 'A' - 'a'; else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 801025c5: 5d pop %ebp 801025c6: c3 ret 801025c7: 89 f6 mov %esi,%esi 801025c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801025d0 <kbdintr>: void kbdintr(void) { 801025d0: 55 push %ebp 801025d1: 89 e5 mov %esp,%ebp 801025d3: 83 ec 14 sub $0x14,%esp consoleintr(kbdgetc); 801025d6: 68 00 25 10 80 push $0x80102500 801025db: e8 10 e2 ff ff call 801007f0 <consoleintr> } 801025e0: 83 c4 10 add $0x10,%esp 801025e3: c9 leave 801025e4: c3 ret 801025e5: 66 90 xchg %ax,%ax 801025e7: 66 90 xchg %ax,%ax 801025e9: 66 90 xchg %ax,%ax 801025eb: 66 90 xchg %ax,%ax 801025ed: 66 90 xchg %ax,%ax 801025ef: 90 nop 801025f0 <lapicinit>: } void lapicinit(void) { if(!lapic) 801025f0: a1 7c 36 11 80 mov 0x8011367c,%eax lapic[ID]; // wait for write to finish, by reading } void lapicinit(void) { 801025f5: 55 push %ebp 801025f6: 89 e5 mov %esp,%ebp if(!lapic) 801025f8: 85 c0 test %eax,%eax 801025fa: 0f 84 c8 00 00 00 je 801026c8 <lapicinit+0xd8> //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 80102600: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax) 80102607: 01 00 00 lapic[ID]; // wait for write to finish, by reading 8010260a: 8b 50 20 mov 0x20(%eax),%edx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 8010260d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax) 80102614: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102617: 8b 50 20 mov 0x20(%eax),%edx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 8010261a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax) 80102621: 00 02 00 lapic[ID]; // wait for write to finish, by reading 80102624: 8b 50 20 mov 0x20(%eax),%edx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 80102627: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax) 8010262e: 96 98 00 lapic[ID]; // wait for write to finish, by reading 80102631: 8b 50 20 mov 0x20(%eax),%edx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 80102634: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax) 8010263b: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010263e: 8b 50 20 mov 0x20(%eax),%edx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 80102641: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax) 80102648: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010264b: 8b 50 20 mov 0x20(%eax),%edx lapicw(LINT0, MASKED); lapicw(LINT1, MASKED); // Disable performance counter overflow interrupts // on machines that provide that interrupt entry. if(((lapic[VER]>>16) & 0xFF) >= 4) 8010264e: 8b 50 30 mov 0x30(%eax),%edx 80102651: c1 ea 10 shr $0x10,%edx 80102654: 80 fa 03 cmp $0x3,%dl 80102657: 77 77 ja 801026d0 <lapicinit+0xe0> //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 80102659: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax) 80102660: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102663: 8b 50 20 mov 0x20(%eax),%edx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 80102666: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 8010266d: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102670: 8b 50 20 mov 0x20(%eax),%edx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 80102673: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 8010267a: 00 00 00 lapic[ID]; // wait for write to finish, by reading 8010267d: 8b 50 20 mov 0x20(%eax),%edx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 80102680: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80102687: 00 00 00 lapic[ID]; // wait for write to finish, by reading 8010268a: 8b 50 20 mov 0x20(%eax),%edx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 8010268d: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax) 80102694: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102697: 8b 50 20 mov 0x20(%eax),%edx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 8010269a: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax) 801026a1: 85 08 00 lapic[ID]; // wait for write to finish, by reading 801026a4: 8b 50 20 mov 0x20(%eax),%edx 801026a7: 89 f6 mov %esi,%esi 801026a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi lapicw(EOI, 0); // Send an Init Level De-Assert to synchronise arbitration ID's. lapicw(ICRHI, 0); lapicw(ICRLO, BCAST | INIT | LEVEL); while(lapic[ICRLO] & DELIVS) 801026b0: 8b 90 00 03 00 00 mov 0x300(%eax),%edx 801026b6: 80 e6 10 and $0x10,%dh 801026b9: 75 f5 jne 801026b0 <lapicinit+0xc0> //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 801026bb: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax) 801026c2: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026c5: 8b 40 20 mov 0x20(%eax),%eax while(lapic[ICRLO] & DELIVS) ; // Enable interrupts on the APIC (but not on the processor). lapicw(TPR, 0); } 801026c8: 5d pop %ebp 801026c9: c3 ret 801026ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 801026d0: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax) 801026d7: 00 01 00 lapic[ID]; // wait for write to finish, by reading 801026da: 8b 50 20 mov 0x20(%eax),%edx 801026dd: e9 77 ff ff ff jmp 80102659 <lapicinit+0x69> 801026e2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801026e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801026f0 <lapicid>: } int lapicid(void) { if (!lapic) 801026f0: a1 7c 36 11 80 mov 0x8011367c,%eax lapicw(TPR, 0); } int lapicid(void) { 801026f5: 55 push %ebp 801026f6: 89 e5 mov %esp,%ebp if (!lapic) 801026f8: 85 c0 test %eax,%eax 801026fa: 74 0c je 80102708 <lapicid+0x18> return 0; return lapic[ID] >> 24; 801026fc: 8b 40 20 mov 0x20(%eax),%eax } 801026ff: 5d pop %ebp int lapicid(void) { if (!lapic) return 0; return lapic[ID] >> 24; 80102700: c1 e8 18 shr $0x18,%eax } 80102703: c3 ret 80102704: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi int lapicid(void) { if (!lapic) return 0; 80102708: 31 c0 xor %eax,%eax return lapic[ID] >> 24; } 8010270a: 5d pop %ebp 8010270b: c3 ret 8010270c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102710 <lapiceoi>: // Acknowledge interrupt. void lapiceoi(void) { if(lapic) 80102710: a1 7c 36 11 80 mov 0x8011367c,%eax } // Acknowledge interrupt. void lapiceoi(void) { 80102715: 55 push %ebp 80102716: 89 e5 mov %esp,%ebp if(lapic) 80102718: 85 c0 test %eax,%eax 8010271a: 74 0d je 80102729 <lapiceoi+0x19> //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 8010271c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80102723: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102726: 8b 40 20 mov 0x20(%eax),%eax void lapiceoi(void) { if(lapic) lapicw(EOI, 0); } 80102729: 5d pop %ebp 8010272a: c3 ret 8010272b: 90 nop 8010272c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102730 <microdelay>: // Spin for a given number of microseconds. // On real hardware would want to tune this dynamically. void microdelay(int us) { 80102730: 55 push %ebp 80102731: 89 e5 mov %esp,%ebp } 80102733: 5d pop %ebp 80102734: c3 ret 80102735: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102739: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102740 <lapicstartap>: // Start additional processor running entry code at addr. // See Appendix B of MultiProcessor Specification. void lapicstartap(uchar apicid, uint addr) { 80102740: 55 push %ebp } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102741: ba 70 00 00 00 mov $0x70,%edx 80102746: b8 0f 00 00 00 mov $0xf,%eax 8010274b: 89 e5 mov %esp,%ebp 8010274d: 53 push %ebx 8010274e: 8b 4d 0c mov 0xc(%ebp),%ecx 80102751: 8b 5d 08 mov 0x8(%ebp),%ebx 80102754: ee out %al,(%dx) 80102755: ba 71 00 00 00 mov $0x71,%edx 8010275a: b8 0a 00 00 00 mov $0xa,%eax 8010275f: ee out %al,(%dx) // and the warm reset vector (DWORD based at 40:67) to point at // the AP startup code prior to the [universal startup algorithm]." outb(CMOS_PORT, 0xF); // offset 0xF is shutdown code outb(CMOS_PORT+1, 0x0A); wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector wrv[0] = 0; 80102760: 31 c0 xor %eax,%eax //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 80102762: c1 e3 18 shl $0x18,%ebx // and the warm reset vector (DWORD based at 40:67) to point at // the AP startup code prior to the [universal startup algorithm]." outb(CMOS_PORT, 0xF); // offset 0xF is shutdown code outb(CMOS_PORT+1, 0x0A); wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector wrv[0] = 0; 80102765: 66 a3 67 04 00 80 mov %ax,0x80000467 wrv[1] = addr >> 4; 8010276b: 89 c8 mov %ecx,%eax // when it is in the halted state due to an INIT. So the second // should be ignored, but it is part of the official Intel algorithm. // Bochs complains about the second one. Too bad for Bochs. for(i = 0; i < 2; i++){ lapicw(ICRHI, apicid<<24); lapicw(ICRLO, STARTUP | (addr>>12)); 8010276d: c1 e9 0c shr $0xc,%ecx // the AP startup code prior to the [universal startup algorithm]." outb(CMOS_PORT, 0xF); // offset 0xF is shutdown code outb(CMOS_PORT+1, 0x0A); wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector wrv[0] = 0; wrv[1] = addr >> 4; 80102770: c1 e8 04 shr $0x4,%eax //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 80102773: 89 da mov %ebx,%edx // when it is in the halted state due to an INIT. So the second // should be ignored, but it is part of the official Intel algorithm. // Bochs complains about the second one. Too bad for Bochs. for(i = 0; i < 2; i++){ lapicw(ICRHI, apicid<<24); lapicw(ICRLO, STARTUP | (addr>>12)); 80102775: 80 cd 06 or $0x6,%ch // the AP startup code prior to the [universal startup algorithm]." outb(CMOS_PORT, 0xF); // offset 0xF is shutdown code outb(CMOS_PORT+1, 0x0A); wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector wrv[0] = 0; wrv[1] = addr >> 4; 80102778: 66 a3 69 04 00 80 mov %ax,0x80000469 //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 8010277e: a1 7c 36 11 80 mov 0x8011367c,%eax 80102783: 89 98 10 03 00 00 mov %ebx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 80102789: 8b 58 20 mov 0x20(%eax),%ebx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 8010278c: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax) 80102793: c5 00 00 lapic[ID]; // wait for write to finish, by reading 80102796: 8b 58 20 mov 0x20(%eax),%ebx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 80102799: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax) 801027a0: 85 00 00 lapic[ID]; // wait for write to finish, by reading 801027a3: 8b 58 20 mov 0x20(%eax),%ebx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 801027a6: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027ac: 8b 58 20 mov 0x20(%eax),%ebx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 801027af: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801027b5: 8b 58 20 mov 0x20(%eax),%ebx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 801027b8: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027be: 8b 50 20 mov 0x20(%eax),%edx //PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; 801027c1: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801027c7: 8b 40 20 mov 0x20(%eax),%eax for(i = 0; i < 2; i++){ lapicw(ICRHI, apicid<<24); lapicw(ICRLO, STARTUP | (addr>>12)); microdelay(200); } } 801027ca: 5b pop %ebx 801027cb: 5d pop %ebp 801027cc: c3 ret 801027cd: 8d 76 00 lea 0x0(%esi),%esi 801027d0 <cmostime>: r->year = cmos_read(YEAR); } // qemu seems to use 24-hour GWT and the values are BCD encoded void cmostime(struct rtcdate *r) { 801027d0: 55 push %ebp 801027d1: ba 70 00 00 00 mov $0x70,%edx 801027d6: b8 0b 00 00 00 mov $0xb,%eax 801027db: 89 e5 mov %esp,%ebp 801027dd: 57 push %edi 801027de: 56 push %esi 801027df: 53 push %ebx 801027e0: 83 ec 4c sub $0x4c,%esp 801027e3: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801027e4: ba 71 00 00 00 mov $0x71,%edx 801027e9: ec in (%dx),%al 801027ea: 83 e0 04 and $0x4,%eax 801027ed: 8d 75 d0 lea -0x30(%ebp),%esi } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801027f0: 31 db xor %ebx,%ebx 801027f2: 88 45 b7 mov %al,-0x49(%ebp) 801027f5: bf 70 00 00 00 mov $0x70,%edi 801027fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102800: 89 d8 mov %ebx,%eax 80102802: 89 fa mov %edi,%edx 80102804: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102805: b9 71 00 00 00 mov $0x71,%ecx 8010280a: 89 ca mov %ecx,%edx 8010280c: ec in (%dx),%al return inb(CMOS_RETURN); } static void fill_rtcdate(struct rtcdate *r) { r->second = cmos_read(SECS); 8010280d: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102810: 89 fa mov %edi,%edx 80102812: 89 45 b8 mov %eax,-0x48(%ebp) 80102815: b8 02 00 00 00 mov $0x2,%eax 8010281a: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010281b: 89 ca mov %ecx,%edx 8010281d: ec in (%dx),%al r->minute = cmos_read(MINS); 8010281e: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102821: 89 fa mov %edi,%edx 80102823: 89 45 bc mov %eax,-0x44(%ebp) 80102826: b8 04 00 00 00 mov $0x4,%eax 8010282b: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010282c: 89 ca mov %ecx,%edx 8010282e: ec in (%dx),%al r->hour = cmos_read(HOURS); 8010282f: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102832: 89 fa mov %edi,%edx 80102834: 89 45 c0 mov %eax,-0x40(%ebp) 80102837: b8 07 00 00 00 mov $0x7,%eax 8010283c: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010283d: 89 ca mov %ecx,%edx 8010283f: ec in (%dx),%al r->day = cmos_read(DAY); 80102840: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102843: 89 fa mov %edi,%edx 80102845: 89 45 c4 mov %eax,-0x3c(%ebp) 80102848: b8 08 00 00 00 mov $0x8,%eax 8010284d: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010284e: 89 ca mov %ecx,%edx 80102850: ec in (%dx),%al r->month = cmos_read(MONTH); 80102851: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102854: 89 fa mov %edi,%edx 80102856: 89 45 c8 mov %eax,-0x38(%ebp) 80102859: b8 09 00 00 00 mov $0x9,%eax 8010285e: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010285f: 89 ca mov %ecx,%edx 80102861: ec in (%dx),%al r->year = cmos_read(YEAR); 80102862: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102865: 89 fa mov %edi,%edx 80102867: 89 45 cc mov %eax,-0x34(%ebp) 8010286a: b8 0a 00 00 00 mov $0xa,%eax 8010286f: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102870: 89 ca mov %ecx,%edx 80102872: ec in (%dx),%al bcd = (sb & (1 << 2)) == 0; // make sure CMOS doesn't modify time while we read it for(;;) { fill_rtcdate(&t1); if(cmos_read(CMOS_STATA) & CMOS_UIP) 80102873: 84 c0 test %al,%al 80102875: 78 89 js 80102800 <cmostime+0x30> } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102877: 89 d8 mov %ebx,%eax 80102879: 89 fa mov %edi,%edx 8010287b: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010287c: 89 ca mov %ecx,%edx 8010287e: ec in (%dx),%al return inb(CMOS_RETURN); } static void fill_rtcdate(struct rtcdate *r) { r->second = cmos_read(SECS); 8010287f: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102882: 89 fa mov %edi,%edx 80102884: 89 45 d0 mov %eax,-0x30(%ebp) 80102887: b8 02 00 00 00 mov $0x2,%eax 8010288c: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010288d: 89 ca mov %ecx,%edx 8010288f: ec in (%dx),%al r->minute = cmos_read(MINS); 80102890: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102893: 89 fa mov %edi,%edx 80102895: 89 45 d4 mov %eax,-0x2c(%ebp) 80102898: b8 04 00 00 00 mov $0x4,%eax 8010289d: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010289e: 89 ca mov %ecx,%edx 801028a0: ec in (%dx),%al r->hour = cmos_read(HOURS); 801028a1: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028a4: 89 fa mov %edi,%edx 801028a6: 89 45 d8 mov %eax,-0x28(%ebp) 801028a9: b8 07 00 00 00 mov $0x7,%eax 801028ae: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028af: 89 ca mov %ecx,%edx 801028b1: ec in (%dx),%al r->day = cmos_read(DAY); 801028b2: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028b5: 89 fa mov %edi,%edx 801028b7: 89 45 dc mov %eax,-0x24(%ebp) 801028ba: b8 08 00 00 00 mov $0x8,%eax 801028bf: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028c0: 89 ca mov %ecx,%edx 801028c2: ec in (%dx),%al r->month = cmos_read(MONTH); 801028c3: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028c6: 89 fa mov %edi,%edx 801028c8: 89 45 e0 mov %eax,-0x20(%ebp) 801028cb: b8 09 00 00 00 mov $0x9,%eax 801028d0: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028d1: 89 ca mov %ecx,%edx 801028d3: ec in (%dx),%al r->year = cmos_read(YEAR); 801028d4: 0f b6 c0 movzbl %al,%eax for(;;) { fill_rtcdate(&t1); if(cmos_read(CMOS_STATA) & CMOS_UIP) continue; fill_rtcdate(&t2); if(memcmp(&t1, &t2, sizeof(t1)) == 0) 801028d7: 83 ec 04 sub $0x4,%esp r->second = cmos_read(SECS); 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); 801028da: 89 45 e4 mov %eax,-0x1c(%ebp) for(;;) { fill_rtcdate(&t1); if(cmos_read(CMOS_STATA) & CMOS_UIP) continue; fill_rtcdate(&t2); if(memcmp(&t1, &t2, sizeof(t1)) == 0) 801028dd: 8d 45 b8 lea -0x48(%ebp),%eax 801028e0: 6a 18 push $0x18 801028e2: 56 push %esi 801028e3: 50 push %eax 801028e4: e8 17 21 00 00 call 80104a00 <memcmp> 801028e9: 83 c4 10 add $0x10,%esp 801028ec: 85 c0 test %eax,%eax 801028ee: 0f 85 0c ff ff ff jne 80102800 <cmostime+0x30> break; } // convert if(bcd) { 801028f4: 80 7d b7 00 cmpb $0x0,-0x49(%ebp) 801028f8: 75 78 jne 80102972 <cmostime+0x1a2> #define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf)) CONV(second); 801028fa: 8b 45 b8 mov -0x48(%ebp),%eax 801028fd: 89 c2 mov %eax,%edx 801028ff: 83 e0 0f and $0xf,%eax 80102902: c1 ea 04 shr $0x4,%edx 80102905: 8d 14 92 lea (%edx,%edx,4),%edx 80102908: 8d 04 50 lea (%eax,%edx,2),%eax 8010290b: 89 45 b8 mov %eax,-0x48(%ebp) CONV(minute); 8010290e: 8b 45 bc mov -0x44(%ebp),%eax 80102911: 89 c2 mov %eax,%edx 80102913: 83 e0 0f and $0xf,%eax 80102916: c1 ea 04 shr $0x4,%edx 80102919: 8d 14 92 lea (%edx,%edx,4),%edx 8010291c: 8d 04 50 lea (%eax,%edx,2),%eax 8010291f: 89 45 bc mov %eax,-0x44(%ebp) CONV(hour ); 80102922: 8b 45 c0 mov -0x40(%ebp),%eax 80102925: 89 c2 mov %eax,%edx 80102927: 83 e0 0f and $0xf,%eax 8010292a: c1 ea 04 shr $0x4,%edx 8010292d: 8d 14 92 lea (%edx,%edx,4),%edx 80102930: 8d 04 50 lea (%eax,%edx,2),%eax 80102933: 89 45 c0 mov %eax,-0x40(%ebp) CONV(day ); 80102936: 8b 45 c4 mov -0x3c(%ebp),%eax 80102939: 89 c2 mov %eax,%edx 8010293b: 83 e0 0f and $0xf,%eax 8010293e: c1 ea 04 shr $0x4,%edx 80102941: 8d 14 92 lea (%edx,%edx,4),%edx 80102944: 8d 04 50 lea (%eax,%edx,2),%eax 80102947: 89 45 c4 mov %eax,-0x3c(%ebp) CONV(month ); 8010294a: 8b 45 c8 mov -0x38(%ebp),%eax 8010294d: 89 c2 mov %eax,%edx 8010294f: 83 e0 0f and $0xf,%eax 80102952: c1 ea 04 shr $0x4,%edx 80102955: 8d 14 92 lea (%edx,%edx,4),%edx 80102958: 8d 04 50 lea (%eax,%edx,2),%eax 8010295b: 89 45 c8 mov %eax,-0x38(%ebp) CONV(year ); 8010295e: 8b 45 cc mov -0x34(%ebp),%eax 80102961: 89 c2 mov %eax,%edx 80102963: 83 e0 0f and $0xf,%eax 80102966: c1 ea 04 shr $0x4,%edx 80102969: 8d 14 92 lea (%edx,%edx,4),%edx 8010296c: 8d 04 50 lea (%eax,%edx,2),%eax 8010296f: 89 45 cc mov %eax,-0x34(%ebp) #undef CONV } *r = t1; 80102972: 8b 75 08 mov 0x8(%ebp),%esi 80102975: 8b 45 b8 mov -0x48(%ebp),%eax 80102978: 89 06 mov %eax,(%esi) 8010297a: 8b 45 bc mov -0x44(%ebp),%eax 8010297d: 89 46 04 mov %eax,0x4(%esi) 80102980: 8b 45 c0 mov -0x40(%ebp),%eax 80102983: 89 46 08 mov %eax,0x8(%esi) 80102986: 8b 45 c4 mov -0x3c(%ebp),%eax 80102989: 89 46 0c mov %eax,0xc(%esi) 8010298c: 8b 45 c8 mov -0x38(%ebp),%eax 8010298f: 89 46 10 mov %eax,0x10(%esi) 80102992: 8b 45 cc mov -0x34(%ebp),%eax 80102995: 89 46 14 mov %eax,0x14(%esi) r->year += 2000; 80102998: 81 46 14 d0 07 00 00 addl $0x7d0,0x14(%esi) } 8010299f: 8d 65 f4 lea -0xc(%ebp),%esp 801029a2: 5b pop %ebx 801029a3: 5e pop %esi 801029a4: 5f pop %edi 801029a5: 5d pop %ebp 801029a6: c3 ret 801029a7: 66 90 xchg %ax,%ax 801029a9: 66 90 xchg %ax,%ax 801029ab: 66 90 xchg %ax,%ax 801029ad: 66 90 xchg %ax,%ax 801029af: 90 nop 801029b0 <install_trans>: static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 801029b0: 8b 0d c8 36 11 80 mov 0x801136c8,%ecx 801029b6: 85 c9 test %ecx,%ecx 801029b8: 0f 8e 85 00 00 00 jle 80102a43 <install_trans+0x93> } // Copy committed blocks from log to their home location static void install_trans(void) { 801029be: 55 push %ebp 801029bf: 89 e5 mov %esp,%ebp 801029c1: 57 push %edi 801029c2: 56 push %esi 801029c3: 53 push %ebx 801029c4: 31 db xor %ebx,%ebx 801029c6: 83 ec 0c sub $0xc,%esp 801029c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi int tail; for (tail = 0; tail < log.lh.n; tail++) { struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 801029d0: a1 b4 36 11 80 mov 0x801136b4,%eax 801029d5: 83 ec 08 sub $0x8,%esp 801029d8: 01 d8 add %ebx,%eax 801029da: 83 c0 01 add $0x1,%eax 801029dd: 50 push %eax 801029de: ff 35 c4 36 11 80 pushl 0x801136c4 801029e4: e8 e7 d6 ff ff call 801000d0 <bread> 801029e9: 89 c7 mov %eax,%edi struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 801029eb: 58 pop %eax 801029ec: 5a pop %edx 801029ed: ff 34 9d cc 36 11 80 pushl -0x7feec934(,%ebx,4) 801029f4: ff 35 c4 36 11 80 pushl 0x801136c4 static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 801029fa: 83 c3 01 add $0x1,%ebx struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 801029fd: e8 ce d6 ff ff call 801000d0 <bread> 80102a02: 89 c6 mov %eax,%esi memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 80102a04: 8d 47 5c lea 0x5c(%edi),%eax 80102a07: 83 c4 0c add $0xc,%esp 80102a0a: 68 00 02 00 00 push $0x200 80102a0f: 50 push %eax 80102a10: 8d 46 5c lea 0x5c(%esi),%eax 80102a13: 50 push %eax 80102a14: e8 47 20 00 00 call 80104a60 <memmove> bwrite(dbuf); // write dst to disk 80102a19: 89 34 24 mov %esi,(%esp) 80102a1c: e8 7f d7 ff ff call 801001a0 <bwrite> brelse(lbuf); 80102a21: 89 3c 24 mov %edi,(%esp) 80102a24: e8 b7 d7 ff ff call 801001e0 <brelse> brelse(dbuf); 80102a29: 89 34 24 mov %esi,(%esp) 80102a2c: e8 af d7 ff ff call 801001e0 <brelse> static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102a31: 83 c4 10 add $0x10,%esp 80102a34: 39 1d c8 36 11 80 cmp %ebx,0x801136c8 80102a3a: 7f 94 jg 801029d0 <install_trans+0x20> memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst bwrite(dbuf); // write dst to disk brelse(lbuf); brelse(dbuf); } } 80102a3c: 8d 65 f4 lea -0xc(%ebp),%esp 80102a3f: 5b pop %ebx 80102a40: 5e pop %esi 80102a41: 5f pop %edi 80102a42: 5d pop %ebp 80102a43: f3 c3 repz ret 80102a45: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102a49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102a50 <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) { 80102a50: 55 push %ebp 80102a51: 89 e5 mov %esp,%ebp 80102a53: 53 push %ebx 80102a54: 83 ec 0c sub $0xc,%esp struct buf *buf = bread(log.dev, log.start); 80102a57: ff 35 b4 36 11 80 pushl 0x801136b4 80102a5d: ff 35 c4 36 11 80 pushl 0x801136c4 80102a63: e8 68 d6 ff ff call 801000d0 <bread> struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80102a68: 8b 0d c8 36 11 80 mov 0x801136c8,%ecx for (i = 0; i < log.lh.n; i++) { 80102a6e: 83 c4 10 add $0x10,%esp // This is the true point at which the // current transaction commits. static void write_head(void) { struct buf *buf = bread(log.dev, log.start); 80102a71: 89 c3 mov %eax,%ebx struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; for (i = 0; i < log.lh.n; i++) { 80102a73: 85 c9 test %ecx,%ecx write_head(void) { struct buf *buf = bread(log.dev, log.start); struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80102a75: 89 48 5c mov %ecx,0x5c(%eax) for (i = 0; i < log.lh.n; i++) { 80102a78: 7e 1f jle 80102a99 <write_head+0x49> 80102a7a: 8d 04 8d 00 00 00 00 lea 0x0(,%ecx,4),%eax 80102a81: 31 d2 xor %edx,%edx 80102a83: 90 nop 80102a84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi hb->block[i] = log.lh.block[i]; 80102a88: 8b 8a cc 36 11 80 mov -0x7feec934(%edx),%ecx 80102a8e: 89 4c 13 60 mov %ecx,0x60(%ebx,%edx,1) 80102a92: 83 c2 04 add $0x4,%edx { struct buf *buf = bread(log.dev, log.start); struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; for (i = 0; i < log.lh.n; i++) { 80102a95: 39 c2 cmp %eax,%edx 80102a97: 75 ef jne 80102a88 <write_head+0x38> hb->block[i] = log.lh.block[i]; } bwrite(buf); 80102a99: 83 ec 0c sub $0xc,%esp 80102a9c: 53 push %ebx 80102a9d: e8 fe d6 ff ff call 801001a0 <bwrite> brelse(buf); 80102aa2: 89 1c 24 mov %ebx,(%esp) 80102aa5: e8 36 d7 ff ff call 801001e0 <brelse> } 80102aaa: 8b 5d fc mov -0x4(%ebp),%ebx 80102aad: c9 leave 80102aae: c3 ret 80102aaf: 90 nop 80102ab0 <initlog>: static void recover_from_log(void); static void commit(); void initlog(int dev) { 80102ab0: 55 push %ebp 80102ab1: 89 e5 mov %esp,%ebp 80102ab3: 53 push %ebx 80102ab4: 83 ec 2c sub $0x2c,%esp 80102ab7: 8b 5d 08 mov 0x8(%ebp),%ebx if (sizeof(struct logheader) >= BSIZE) panic("initlog: too big logheader"); struct superblock sb; initlock(&log.lock, "log"); 80102aba: 68 40 7a 10 80 push $0x80107a40 80102abf: 68 80 36 11 80 push $0x80113680 80102ac4: e8 77 1c 00 00 call 80104740 <initlock> readsb(dev, &sb); 80102ac9: 58 pop %eax 80102aca: 8d 45 dc lea -0x24(%ebp),%eax 80102acd: 5a pop %edx 80102ace: 50 push %eax 80102acf: 53 push %ebx 80102ad0: e8 db e8 ff ff call 801013b0 <readsb> log.start = sb.logstart; log.size = sb.nlog; 80102ad5: 8b 55 e8 mov -0x18(%ebp),%edx panic("initlog: too big logheader"); struct superblock sb; initlock(&log.lock, "log"); readsb(dev, &sb); log.start = sb.logstart; 80102ad8: 8b 45 ec mov -0x14(%ebp),%eax // Read the log header from disk into the in-memory log header static void read_head(void) { struct buf *buf = bread(log.dev, log.start); 80102adb: 59 pop %ecx struct superblock sb; initlock(&log.lock, "log"); readsb(dev, &sb); log.start = sb.logstart; log.size = sb.nlog; log.dev = dev; 80102adc: 89 1d c4 36 11 80 mov %ebx,0x801136c4 struct superblock sb; initlock(&log.lock, "log"); readsb(dev, &sb); log.start = sb.logstart; log.size = sb.nlog; 80102ae2: 89 15 b8 36 11 80 mov %edx,0x801136b8 panic("initlog: too big logheader"); struct superblock sb; initlock(&log.lock, "log"); readsb(dev, &sb); log.start = sb.logstart; 80102ae8: a3 b4 36 11 80 mov %eax,0x801136b4 // Read the log header from disk into the in-memory log header static void read_head(void) { struct buf *buf = bread(log.dev, log.start); 80102aed: 5a pop %edx 80102aee: 50 push %eax 80102aef: 53 push %ebx 80102af0: e8 db d5 ff ff call 801000d0 <bread> struct logheader *lh = (struct logheader *) (buf->data); int i; log.lh.n = lh->n; 80102af5: 8b 48 5c mov 0x5c(%eax),%ecx for (i = 0; i < log.lh.n; i++) { 80102af8: 83 c4 10 add $0x10,%esp 80102afb: 85 c9 test %ecx,%ecx read_head(void) { struct buf *buf = bread(log.dev, log.start); struct logheader *lh = (struct logheader *) (buf->data); int i; log.lh.n = lh->n; 80102afd: 89 0d c8 36 11 80 mov %ecx,0x801136c8 for (i = 0; i < log.lh.n; i++) { 80102b03: 7e 1c jle 80102b21 <initlog+0x71> 80102b05: 8d 1c 8d 00 00 00 00 lea 0x0(,%ecx,4),%ebx 80102b0c: 31 d2 xor %edx,%edx 80102b0e: 66 90 xchg %ax,%ax log.lh.block[i] = lh->block[i]; 80102b10: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx 80102b14: 83 c2 04 add $0x4,%edx 80102b17: 89 8a c8 36 11 80 mov %ecx,-0x7feec938(%edx) { struct buf *buf = bread(log.dev, log.start); struct logheader *lh = (struct logheader *) (buf->data); int i; log.lh.n = lh->n; for (i = 0; i < log.lh.n; i++) { 80102b1d: 39 da cmp %ebx,%edx 80102b1f: 75 ef jne 80102b10 <initlog+0x60> log.lh.block[i] = lh->block[i]; } brelse(buf); 80102b21: 83 ec 0c sub $0xc,%esp 80102b24: 50 push %eax 80102b25: e8 b6 d6 ff ff call 801001e0 <brelse> static void recover_from_log(void) { read_head(); install_trans(); // if committed, copy from log to disk 80102b2a: e8 81 fe ff ff call 801029b0 <install_trans> log.lh.n = 0; 80102b2f: c7 05 c8 36 11 80 00 movl $0x0,0x801136c8 80102b36: 00 00 00 write_head(); // clear the log 80102b39: e8 12 ff ff ff call 80102a50 <write_head> readsb(dev, &sb); log.start = sb.logstart; log.size = sb.nlog; log.dev = dev; recover_from_log(); } 80102b3e: 8b 5d fc mov -0x4(%ebp),%ebx 80102b41: c9 leave 80102b42: c3 ret 80102b43: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102b49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102b50 <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 80102b50: 55 push %ebp 80102b51: 89 e5 mov %esp,%ebp 80102b53: 83 ec 14 sub $0x14,%esp acquire(&log.lock); 80102b56: 68 80 36 11 80 push $0x80113680 80102b5b: e8 e0 1c 00 00 call 80104840 <acquire> 80102b60: 83 c4 10 add $0x10,%esp 80102b63: eb 18 jmp 80102b7d <begin_op+0x2d> 80102b65: 8d 76 00 lea 0x0(%esi),%esi while(1){ if(log.committing){ sleep(&log, &log.lock); 80102b68: 83 ec 08 sub $0x8,%esp 80102b6b: 68 80 36 11 80 push $0x80113680 80102b70: 68 80 36 11 80 push $0x80113680 80102b75: e8 b6 11 00 00 call 80103d30 <sleep> 80102b7a: 83 c4 10 add $0x10,%esp void begin_op(void) { acquire(&log.lock); while(1){ if(log.committing){ 80102b7d: a1 c0 36 11 80 mov 0x801136c0,%eax 80102b82: 85 c0 test %eax,%eax 80102b84: 75 e2 jne 80102b68 <begin_op+0x18> sleep(&log, &log.lock); } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 80102b86: a1 bc 36 11 80 mov 0x801136bc,%eax 80102b8b: 8b 15 c8 36 11 80 mov 0x801136c8,%edx 80102b91: 83 c0 01 add $0x1,%eax 80102b94: 8d 0c 80 lea (%eax,%eax,4),%ecx 80102b97: 8d 14 4a lea (%edx,%ecx,2),%edx 80102b9a: 83 fa 1e cmp $0x1e,%edx 80102b9d: 7f c9 jg 80102b68 <begin_op+0x18> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; release(&log.lock); 80102b9f: 83 ec 0c sub $0xc,%esp sleep(&log, &log.lock); } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; 80102ba2: a3 bc 36 11 80 mov %eax,0x801136bc release(&log.lock); 80102ba7: 68 80 36 11 80 push $0x80113680 80102bac: e8 af 1d 00 00 call 80104960 <release> break; } } } 80102bb1: 83 c4 10 add $0x10,%esp 80102bb4: c9 leave 80102bb5: c3 ret 80102bb6: 8d 76 00 lea 0x0(%esi),%esi 80102bb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102bc0 <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 80102bc0: 55 push %ebp 80102bc1: 89 e5 mov %esp,%ebp 80102bc3: 57 push %edi 80102bc4: 56 push %esi 80102bc5: 53 push %ebx 80102bc6: 83 ec 18 sub $0x18,%esp int do_commit = 0; acquire(&log.lock); 80102bc9: 68 80 36 11 80 push $0x80113680 80102bce: e8 6d 1c 00 00 call 80104840 <acquire> log.outstanding -= 1; 80102bd3: a1 bc 36 11 80 mov 0x801136bc,%eax if(log.committing) 80102bd8: 8b 1d c0 36 11 80 mov 0x801136c0,%ebx 80102bde: 83 c4 10 add $0x10,%esp end_op(void) { int do_commit = 0; acquire(&log.lock); log.outstanding -= 1; 80102be1: 83 e8 01 sub $0x1,%eax if(log.committing) 80102be4: 85 db test %ebx,%ebx end_op(void) { int do_commit = 0; acquire(&log.lock); log.outstanding -= 1; 80102be6: a3 bc 36 11 80 mov %eax,0x801136bc if(log.committing) 80102beb: 0f 85 23 01 00 00 jne 80102d14 <end_op+0x154> panic("log.committing"); if(log.outstanding == 0){ 80102bf1: 85 c0 test %eax,%eax 80102bf3: 0f 85 f7 00 00 00 jne 80102cf0 <end_op+0x130> // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 80102bf9: 83 ec 0c sub $0xc,%esp log.outstanding -= 1; if(log.committing) panic("log.committing"); if(log.outstanding == 0){ do_commit = 1; log.committing = 1; 80102bfc: c7 05 c0 36 11 80 01 movl $0x1,0x801136c0 80102c03: 00 00 00 } static void commit() { if (log.lh.n > 0) { 80102c06: 31 db xor %ebx,%ebx // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 80102c08: 68 80 36 11 80 push $0x80113680 80102c0d: e8 4e 1d 00 00 call 80104960 <release> } static void commit() { if (log.lh.n > 0) { 80102c12: 8b 0d c8 36 11 80 mov 0x801136c8,%ecx 80102c18: 83 c4 10 add $0x10,%esp 80102c1b: 85 c9 test %ecx,%ecx 80102c1d: 0f 8e 8a 00 00 00 jle 80102cad <end_op+0xed> 80102c23: 90 nop 80102c24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi write_log(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { struct buf *to = bread(log.dev, log.start+tail+1); // log block 80102c28: a1 b4 36 11 80 mov 0x801136b4,%eax 80102c2d: 83 ec 08 sub $0x8,%esp 80102c30: 01 d8 add %ebx,%eax 80102c32: 83 c0 01 add $0x1,%eax 80102c35: 50 push %eax 80102c36: ff 35 c4 36 11 80 pushl 0x801136c4 80102c3c: e8 8f d4 ff ff call 801000d0 <bread> 80102c41: 89 c6 mov %eax,%esi struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102c43: 58 pop %eax 80102c44: 5a pop %edx 80102c45: ff 34 9d cc 36 11 80 pushl -0x7feec934(,%ebx,4) 80102c4c: ff 35 c4 36 11 80 pushl 0x801136c4 static void write_log(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102c52: 83 c3 01 add $0x1,%ebx struct buf *to = bread(log.dev, log.start+tail+1); // log block struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102c55: e8 76 d4 ff ff call 801000d0 <bread> 80102c5a: 89 c7 mov %eax,%edi memmove(to->data, from->data, BSIZE); 80102c5c: 8d 40 5c lea 0x5c(%eax),%eax 80102c5f: 83 c4 0c add $0xc,%esp 80102c62: 68 00 02 00 00 push $0x200 80102c67: 50 push %eax 80102c68: 8d 46 5c lea 0x5c(%esi),%eax 80102c6b: 50 push %eax 80102c6c: e8 ef 1d 00 00 call 80104a60 <memmove> bwrite(to); // write the log 80102c71: 89 34 24 mov %esi,(%esp) 80102c74: e8 27 d5 ff ff call 801001a0 <bwrite> brelse(from); 80102c79: 89 3c 24 mov %edi,(%esp) 80102c7c: e8 5f d5 ff ff call 801001e0 <brelse> brelse(to); 80102c81: 89 34 24 mov %esi,(%esp) 80102c84: e8 57 d5 ff ff call 801001e0 <brelse> static void write_log(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102c89: 83 c4 10 add $0x10,%esp 80102c8c: 3b 1d c8 36 11 80 cmp 0x801136c8,%ebx 80102c92: 7c 94 jl 80102c28 <end_op+0x68> static void commit() { if (log.lh.n > 0) { write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 80102c94: e8 b7 fd ff ff call 80102a50 <write_head> install_trans(); // Now install writes to home locations 80102c99: e8 12 fd ff ff call 801029b0 <install_trans> log.lh.n = 0; 80102c9e: c7 05 c8 36 11 80 00 movl $0x0,0x801136c8 80102ca5: 00 00 00 write_head(); // Erase the transaction from the log 80102ca8: e8 a3 fd ff ff call 80102a50 <write_head> if(do_commit){ // call commit w/o holding locks, since not allowed // to sleep with locks. commit(); acquire(&log.lock); 80102cad: 83 ec 0c sub $0xc,%esp 80102cb0: 68 80 36 11 80 push $0x80113680 80102cb5: e8 86 1b 00 00 call 80104840 <acquire> log.committing = 0; wakeup(&log); 80102cba: c7 04 24 80 36 11 80 movl $0x80113680,(%esp) if(do_commit){ // call commit w/o holding locks, since not allowed // to sleep with locks. commit(); acquire(&log.lock); log.committing = 0; 80102cc1: c7 05 c0 36 11 80 00 movl $0x0,0x801136c0 80102cc8: 00 00 00 wakeup(&log); 80102ccb: e8 10 12 00 00 call 80103ee0 <wakeup> release(&log.lock); 80102cd0: c7 04 24 80 36 11 80 movl $0x80113680,(%esp) 80102cd7: e8 84 1c 00 00 call 80104960 <release> 80102cdc: 83 c4 10 add $0x10,%esp } } 80102cdf: 8d 65 f4 lea -0xc(%ebp),%esp 80102ce2: 5b pop %ebx 80102ce3: 5e pop %esi 80102ce4: 5f pop %edi 80102ce5: 5d pop %ebp 80102ce6: c3 ret 80102ce7: 89 f6 mov %esi,%esi 80102ce9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi log.committing = 1; } else { // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); 80102cf0: 83 ec 0c sub $0xc,%esp 80102cf3: 68 80 36 11 80 push $0x80113680 80102cf8: e8 e3 11 00 00 call 80103ee0 <wakeup> } release(&log.lock); 80102cfd: c7 04 24 80 36 11 80 movl $0x80113680,(%esp) 80102d04: e8 57 1c 00 00 call 80104960 <release> 80102d09: 83 c4 10 add $0x10,%esp acquire(&log.lock); log.committing = 0; wakeup(&log); release(&log.lock); } } 80102d0c: 8d 65 f4 lea -0xc(%ebp),%esp 80102d0f: 5b pop %ebx 80102d10: 5e pop %esi 80102d11: 5f pop %edi 80102d12: 5d pop %ebp 80102d13: c3 ret int do_commit = 0; acquire(&log.lock); log.outstanding -= 1; if(log.committing) panic("log.committing"); 80102d14: 83 ec 0c sub $0xc,%esp 80102d17: 68 44 7a 10 80 push $0x80107a44 80102d1c: e8 4f d6 ff ff call 80100370 <panic> 80102d21: eb 0d jmp 80102d30 <log_write> 80102d23: 90 nop 80102d24: 90 nop 80102d25: 90 nop 80102d26: 90 nop 80102d27: 90 nop 80102d28: 90 nop 80102d29: 90 nop 80102d2a: 90 nop 80102d2b: 90 nop 80102d2c: 90 nop 80102d2d: 90 nop 80102d2e: 90 nop 80102d2f: 90 nop 80102d30 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80102d30: 55 push %ebp 80102d31: 89 e5 mov %esp,%ebp 80102d33: 53 push %ebx 80102d34: 83 ec 04 sub $0x4,%esp int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102d37: 8b 15 c8 36 11 80 mov 0x801136c8,%edx // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80102d3d: 8b 5d 08 mov 0x8(%ebp),%ebx int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102d40: 83 fa 1d cmp $0x1d,%edx 80102d43: 0f 8f 97 00 00 00 jg 80102de0 <log_write+0xb0> 80102d49: a1 b8 36 11 80 mov 0x801136b8,%eax 80102d4e: 83 e8 01 sub $0x1,%eax 80102d51: 39 c2 cmp %eax,%edx 80102d53: 0f 8d 87 00 00 00 jge 80102de0 <log_write+0xb0> panic("too big a transaction"); if (log.outstanding < 1) 80102d59: a1 bc 36 11 80 mov 0x801136bc,%eax 80102d5e: 85 c0 test %eax,%eax 80102d60: 0f 8e 87 00 00 00 jle 80102ded <log_write+0xbd> panic("log_write outside of trans"); acquire(&log.lock); 80102d66: 83 ec 0c sub $0xc,%esp 80102d69: 68 80 36 11 80 push $0x80113680 80102d6e: e8 cd 1a 00 00 call 80104840 <acquire> for (i = 0; i < log.lh.n; i++) { 80102d73: 8b 15 c8 36 11 80 mov 0x801136c8,%edx 80102d79: 83 c4 10 add $0x10,%esp 80102d7c: 83 fa 00 cmp $0x0,%edx 80102d7f: 7e 50 jle 80102dd1 <log_write+0xa1> if (log.lh.block[i] == b->blockno) // log absorbtion 80102d81: 8b 4b 08 mov 0x8(%ebx),%ecx panic("too big a transaction"); if (log.outstanding < 1) panic("log_write outside of trans"); acquire(&log.lock); for (i = 0; i < log.lh.n; i++) { 80102d84: 31 c0 xor %eax,%eax if (log.lh.block[i] == b->blockno) // log absorbtion 80102d86: 3b 0d cc 36 11 80 cmp 0x801136cc,%ecx 80102d8c: 75 0b jne 80102d99 <log_write+0x69> 80102d8e: eb 38 jmp 80102dc8 <log_write+0x98> 80102d90: 39 0c 85 cc 36 11 80 cmp %ecx,-0x7feec934(,%eax,4) 80102d97: 74 2f je 80102dc8 <log_write+0x98> panic("too big a transaction"); if (log.outstanding < 1) panic("log_write outside of trans"); acquire(&log.lock); for (i = 0; i < log.lh.n; i++) { 80102d99: 83 c0 01 add $0x1,%eax 80102d9c: 39 d0 cmp %edx,%eax 80102d9e: 75 f0 jne 80102d90 <log_write+0x60> if (log.lh.block[i] == b->blockno) // log absorbtion break; } log.lh.block[i] = b->blockno; 80102da0: 89 0c 95 cc 36 11 80 mov %ecx,-0x7feec934(,%edx,4) if (i == log.lh.n) log.lh.n++; 80102da7: 83 c2 01 add $0x1,%edx 80102daa: 89 15 c8 36 11 80 mov %edx,0x801136c8 b->flags |= B_DIRTY; // prevent eviction 80102db0: 83 0b 04 orl $0x4,(%ebx) release(&log.lock); 80102db3: c7 45 08 80 36 11 80 movl $0x80113680,0x8(%ebp) } 80102dba: 8b 5d fc mov -0x4(%ebp),%ebx 80102dbd: c9 leave } log.lh.block[i] = b->blockno; if (i == log.lh.n) log.lh.n++; b->flags |= B_DIRTY; // prevent eviction release(&log.lock); 80102dbe: e9 9d 1b 00 00 jmp 80104960 <release> 80102dc3: 90 nop 80102dc4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi acquire(&log.lock); for (i = 0; i < log.lh.n; i++) { if (log.lh.block[i] == b->blockno) // log absorbtion break; } log.lh.block[i] = b->blockno; 80102dc8: 89 0c 85 cc 36 11 80 mov %ecx,-0x7feec934(,%eax,4) 80102dcf: eb df jmp 80102db0 <log_write+0x80> 80102dd1: 8b 43 08 mov 0x8(%ebx),%eax 80102dd4: a3 cc 36 11 80 mov %eax,0x801136cc if (i == log.lh.n) 80102dd9: 75 d5 jne 80102db0 <log_write+0x80> 80102ddb: eb ca jmp 80102da7 <log_write+0x77> 80102ddd: 8d 76 00 lea 0x0(%esi),%esi log_write(struct buf *b) { int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) panic("too big a transaction"); 80102de0: 83 ec 0c sub $0xc,%esp 80102de3: 68 53 7a 10 80 push $0x80107a53 80102de8: e8 83 d5 ff ff call 80100370 <panic> if (log.outstanding < 1) panic("log_write outside of trans"); 80102ded: 83 ec 0c sub $0xc,%esp 80102df0: 68 69 7a 10 80 push $0x80107a69 80102df5: e8 76 d5 ff ff call 80100370 <panic> 80102dfa: 66 90 xchg %ax,%ax 80102dfc: 66 90 xchg %ax,%ax 80102dfe: 66 90 xchg %ax,%ax 80102e00 <mpmain>: } // Common CPU setup code. static void mpmain(void) { 80102e00: 55 push %ebp 80102e01: 89 e5 mov %esp,%ebp 80102e03: 53 push %ebx 80102e04: 83 ec 04 sub $0x4,%esp cprintf("cpu%d: starting %d\n", cpuid(), cpuid()); 80102e07: e8 54 09 00 00 call 80103760 <cpuid> 80102e0c: 89 c3 mov %eax,%ebx 80102e0e: e8 4d 09 00 00 call 80103760 <cpuid> 80102e13: 83 ec 04 sub $0x4,%esp 80102e16: 53 push %ebx 80102e17: 50 push %eax 80102e18: 68 84 7a 10 80 push $0x80107a84 80102e1d: e8 3e d8 ff ff call 80100660 <cprintf> idtinit(); // load idt register 80102e22: e8 89 2f 00 00 call 80105db0 <idtinit> xchg(&(mycpu()->started), 1); // tell startothers() we're up 80102e27: e8 b4 08 00 00 call 801036e0 <mycpu> 80102e2c: 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" : 80102e2e: b8 01 00 00 00 mov $0x1,%eax 80102e33: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx) scheduler(); // start running processes 80102e3a: e8 01 0c 00 00 call 80103a40 <scheduler> 80102e3f: 90 nop 80102e40 <mpenter>: } // Other CPUs jump here from entryother.S. static void mpenter(void) { 80102e40: 55 push %ebp 80102e41: 89 e5 mov %esp,%ebp 80102e43: 83 ec 08 sub $0x8,%esp switchkvm(); 80102e46: e8 85 40 00 00 call 80106ed0 <switchkvm> seginit(); 80102e4b: e8 80 3f 00 00 call 80106dd0 <seginit> lapicinit(); 80102e50: e8 9b f7 ff ff call 801025f0 <lapicinit> mpmain(); 80102e55: e8 a6 ff ff ff call 80102e00 <mpmain> 80102e5a: 66 90 xchg %ax,%ax 80102e5c: 66 90 xchg %ax,%ax 80102e5e: 66 90 xchg %ax,%ax 80102e60 <main>: // Bootstrap processor starts running C code here. // Allocate a real stack and switch to it, first // doing some setup required for memory allocator to work. int main(void) { 80102e60: 8d 4c 24 04 lea 0x4(%esp),%ecx 80102e64: 83 e4 f0 and $0xfffffff0,%esp 80102e67: ff 71 fc pushl -0x4(%ecx) 80102e6a: 55 push %ebp 80102e6b: 89 e5 mov %esp,%ebp 80102e6d: 53 push %ebx 80102e6e: 51 push %ecx // 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++){ 80102e6f: bb 80 37 11 80 mov $0x80113780,%ebx // Allocate a real stack and switch to it, first // doing some setup required for memory allocator to work. int main(void) { kinit1(end, P2V(4*1024*1024)); // phys page allocator 80102e74: 83 ec 08 sub $0x8,%esp 80102e77: 68 00 00 40 80 push $0x80400000 80102e7c: 68 48 6f 11 80 push $0x80116f48 80102e81: e8 3a f5 ff ff call 801023c0 <kinit1> kvmalloc(); // kernel page table 80102e86: e8 e5 44 00 00 call 80107370 <kvmalloc> mpinit(); // detect other processors 80102e8b: e8 70 01 00 00 call 80103000 <mpinit> lapicinit(); // interrupt controller 80102e90: e8 5b f7 ff ff call 801025f0 <lapicinit> seginit(); // segment descriptors 80102e95: e8 36 3f 00 00 call 80106dd0 <seginit> picinit(); // disable pic 80102e9a: e8 31 03 00 00 call 801031d0 <picinit> ioapicinit(); // another interrupt controller 80102e9f: e8 4c f3 ff ff call 801021f0 <ioapicinit> consoleinit(); // console hardware 80102ea4: e8 f7 da ff ff call 801009a0 <consoleinit> uartinit(); // serial port 80102ea9: e8 f2 31 00 00 call 801060a0 <uartinit> pinit(); // process table 80102eae: e8 0d 08 00 00 call 801036c0 <pinit> tvinit(); // trap vectors 80102eb3: e8 58 2e 00 00 call 80105d10 <tvinit> binit(); // buffer cache 80102eb8: e8 83 d1 ff ff call 80100040 <binit> fileinit(); // file table 80102ebd: e8 8e de ff ff call 80100d50 <fileinit> ideinit(); // disk 80102ec2: e8 09 f1 ff ff call 80101fd0 <ideinit> // Write entry code to unused memory at 0x7000. // 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); 80102ec7: 83 c4 0c add $0xc,%esp 80102eca: 68 8a 00 00 00 push $0x8a 80102ecf: 68 8c b4 10 80 push $0x8010b48c 80102ed4: 68 00 70 00 80 push $0x80007000 80102ed9: e8 82 1b 00 00 call 80104a60 <memmove> for(c = cpus; c < cpus+ncpu; c++){ 80102ede: 69 05 00 3d 11 80 b0 imul $0xb0,0x80113d00,%eax 80102ee5: 00 00 00 80102ee8: 83 c4 10 add $0x10,%esp 80102eeb: 05 80 37 11 80 add $0x80113780,%eax 80102ef0: 39 d8 cmp %ebx,%eax 80102ef2: 76 6f jbe 80102f63 <main+0x103> 80102ef4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(c == mycpu()) // We've started already. 80102ef8: e8 e3 07 00 00 call 801036e0 <mycpu> 80102efd: 39 d8 cmp %ebx,%eax 80102eff: 74 49 je 80102f4a <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(); 80102f01: e8 8a f5 ff ff call 80102490 <kalloc> *(void**)(code-4) = stack + KSTACKSIZE; 80102f06: 05 00 10 00 00 add $0x1000,%eax *(void**)(code-8) = mpenter; 80102f0b: c7 05 f8 6f 00 80 40 movl $0x80102e40,0x80006ff8 80102f12: 2e 10 80 *(int**)(code-12) = (void *) V2P(entrypgdir); 80102f15: c7 05 f4 6f 00 80 00 movl $0x10a000,0x80006ff4 80102f1c: a0 10 00 // 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(); *(void**)(code-4) = stack + KSTACKSIZE; 80102f1f: a3 fc 6f 00 80 mov %eax,0x80006ffc *(void**)(code-8) = mpenter; *(int**)(code-12) = (void *) V2P(entrypgdir); lapicstartap(c->apicid, V2P(code)); 80102f24: 0f b6 03 movzbl (%ebx),%eax 80102f27: 83 ec 08 sub $0x8,%esp 80102f2a: 68 00 70 00 00 push $0x7000 80102f2f: 50 push %eax 80102f30: e8 0b f8 ff ff call 80102740 <lapicstartap> 80102f35: 83 c4 10 add $0x10,%esp 80102f38: 90 nop 80102f39: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi // wait for cpu to finish mpmain() while(c->started == 0) 80102f40: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 80102f46: 85 c0 test %eax,%eax 80102f48: 74 f6 je 80102f40 <main+0xe0> // 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++){ 80102f4a: 69 05 00 3d 11 80 b0 imul $0xb0,0x80113d00,%eax 80102f51: 00 00 00 80102f54: 81 c3 b0 00 00 00 add $0xb0,%ebx 80102f5a: 05 80 37 11 80 add $0x80113780,%eax 80102f5f: 39 c3 cmp %eax,%ebx 80102f61: 72 95 jb 80102ef8 <main+0x98> tvinit(); // trap vectors binit(); // buffer cache fileinit(); // file table ideinit(); // disk startothers(); // start other processors kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() 80102f63: 83 ec 08 sub $0x8,%esp 80102f66: 68 00 00 00 8e push $0x8e000000 80102f6b: 68 00 00 40 80 push $0x80400000 80102f70: e8 bb f4 ff ff call 80102430 <kinit2> userinit(); // first user process 80102f75: e8 36 08 00 00 call 801037b0 <userinit> mpmain(); // finish this processor's setup 80102f7a: e8 81 fe ff ff call 80102e00 <mpmain> 80102f7f: 90 nop 80102f80 <mpsearch1>: } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80102f80: 55 push %ebp 80102f81: 89 e5 mov %esp,%ebp 80102f83: 57 push %edi 80102f84: 56 push %esi uchar *e, *p, *addr; addr = P2V(a); 80102f85: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80102f8b: 53 push %ebx uchar *e, *p, *addr; addr = P2V(a); e = addr+len; 80102f8c: 8d 1c 16 lea (%esi,%edx,1),%ebx } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80102f8f: 83 ec 0c sub $0xc,%esp uchar *e, *p, *addr; addr = P2V(a); e = addr+len; for(p = addr; p < e; p += sizeof(struct mp)) 80102f92: 39 de cmp %ebx,%esi 80102f94: 73 48 jae 80102fde <mpsearch1+0x5e> 80102f96: 8d 76 00 lea 0x0(%esi),%esi 80102f99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80102fa0: 83 ec 04 sub $0x4,%esp 80102fa3: 8d 7e 10 lea 0x10(%esi),%edi 80102fa6: 6a 04 push $0x4 80102fa8: 68 98 7a 10 80 push $0x80107a98 80102fad: 56 push %esi 80102fae: e8 4d 1a 00 00 call 80104a00 <memcmp> 80102fb3: 83 c4 10 add $0x10,%esp 80102fb6: 85 c0 test %eax,%eax 80102fb8: 75 1e jne 80102fd8 <mpsearch1+0x58> 80102fba: 8d 7e 10 lea 0x10(%esi),%edi 80102fbd: 89 f2 mov %esi,%edx 80102fbf: 31 c9 xor %ecx,%ecx 80102fc1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi { int i, sum; sum = 0; for(i=0; i<len; i++) sum += addr[i]; 80102fc8: 0f b6 02 movzbl (%edx),%eax 80102fcb: 83 c2 01 add $0x1,%edx 80102fce: 01 c1 add %eax,%ecx sum(uchar *addr, int len) { int i, sum; sum = 0; for(i=0; i<len; i++) 80102fd0: 39 fa cmp %edi,%edx 80102fd2: 75 f4 jne 80102fc8 <mpsearch1+0x48> uchar *e, *p, *addr; addr = P2V(a); e = addr+len; for(p = addr; p < e; p += sizeof(struct mp)) if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80102fd4: 84 c9 test %cl,%cl 80102fd6: 74 10 je 80102fe8 <mpsearch1+0x68> { uchar *e, *p, *addr; addr = P2V(a); e = addr+len; for(p = addr; p < e; p += sizeof(struct mp)) 80102fd8: 39 fb cmp %edi,%ebx 80102fda: 89 fe mov %edi,%esi 80102fdc: 77 c2 ja 80102fa0 <mpsearch1+0x20> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) return (struct mp*)p; return 0; } 80102fde: 8d 65 f4 lea -0xc(%ebp),%esp addr = P2V(a); e = addr+len; for(p = addr; p < e; p += sizeof(struct mp)) if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) return (struct mp*)p; return 0; 80102fe1: 31 c0 xor %eax,%eax } 80102fe3: 5b pop %ebx 80102fe4: 5e pop %esi 80102fe5: 5f pop %edi 80102fe6: 5d pop %ebp 80102fe7: c3 ret 80102fe8: 8d 65 f4 lea -0xc(%ebp),%esp 80102feb: 89 f0 mov %esi,%eax 80102fed: 5b pop %ebx 80102fee: 5e pop %esi 80102fef: 5f pop %edi 80102ff0: 5d pop %ebp 80102ff1: c3 ret 80102ff2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102ff9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103000 <mpinit>: return conf; } void mpinit(void) { 80103000: 55 push %ebp 80103001: 89 e5 mov %esp,%ebp 80103003: 57 push %edi 80103004: 56 push %esi 80103005: 53 push %ebx 80103006: 83 ec 1c sub $0x1c,%esp uchar *bda; uint p; struct mp *mp; bda = (uchar *) P2V(0x400); if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ 80103009: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax 80103010: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx 80103017: c1 e0 08 shl $0x8,%eax 8010301a: 09 d0 or %edx,%eax 8010301c: c1 e0 04 shl $0x4,%eax 8010301f: 85 c0 test %eax,%eax 80103021: 75 1b jne 8010303e <mpinit+0x3e> if((mp = mpsearch1(p, 1024))) return mp; } else { p = ((bda[0x14]<<8)|bda[0x13])*1024; if((mp = mpsearch1(p-1024, 1024))) 80103023: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax 8010302a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx 80103031: c1 e0 08 shl $0x8,%eax 80103034: 09 d0 or %edx,%eax 80103036: c1 e0 0a shl $0xa,%eax 80103039: 2d 00 04 00 00 sub $0x400,%eax uint p; struct mp *mp; bda = (uchar *) P2V(0x400); if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ if((mp = mpsearch1(p, 1024))) 8010303e: ba 00 04 00 00 mov $0x400,%edx 80103043: e8 38 ff ff ff call 80102f80 <mpsearch1> 80103048: 85 c0 test %eax,%eax 8010304a: 89 45 e4 mov %eax,-0x1c(%ebp) 8010304d: 0f 84 37 01 00 00 je 8010318a <mpinit+0x18a> mpconfig(struct mp **pmp) { struct mpconf *conf; struct mp *mp; if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103053: 8b 45 e4 mov -0x1c(%ebp),%eax 80103056: 8b 58 04 mov 0x4(%eax),%ebx 80103059: 85 db test %ebx,%ebx 8010305b: 0f 84 43 01 00 00 je 801031a4 <mpinit+0x1a4> return 0; conf = (struct mpconf*) P2V((uint) mp->physaddr); 80103061: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi if(memcmp(conf, "PCMP", 4) != 0) 80103067: 83 ec 04 sub $0x4,%esp 8010306a: 6a 04 push $0x4 8010306c: 68 9d 7a 10 80 push $0x80107a9d 80103071: 56 push %esi 80103072: e8 89 19 00 00 call 80104a00 <memcmp> 80103077: 83 c4 10 add $0x10,%esp 8010307a: 85 c0 test %eax,%eax 8010307c: 0f 85 22 01 00 00 jne 801031a4 <mpinit+0x1a4> return 0; if(conf->version != 1 && conf->version != 4) 80103082: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax 80103089: 3c 01 cmp $0x1,%al 8010308b: 74 08 je 80103095 <mpinit+0x95> 8010308d: 3c 04 cmp $0x4,%al 8010308f: 0f 85 0f 01 00 00 jne 801031a4 <mpinit+0x1a4> return 0; if(sum((uchar*)conf, conf->length) != 0) 80103095: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi sum(uchar *addr, int len) { int i, sum; sum = 0; for(i=0; i<len; i++) 8010309c: 85 ff test %edi,%edi 8010309e: 74 21 je 801030c1 <mpinit+0xc1> 801030a0: 31 d2 xor %edx,%edx 801030a2: 31 c0 xor %eax,%eax 801030a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi sum += addr[i]; 801030a8: 0f b6 8c 03 00 00 00 movzbl -0x80000000(%ebx,%eax,1),%ecx 801030af: 80 sum(uchar *addr, int len) { int i, sum; sum = 0; for(i=0; i<len; i++) 801030b0: 83 c0 01 add $0x1,%eax sum += addr[i]; 801030b3: 01 ca add %ecx,%edx sum(uchar *addr, int len) { int i, sum; sum = 0; for(i=0; i<len; i++) 801030b5: 39 c7 cmp %eax,%edi 801030b7: 75 ef jne 801030a8 <mpinit+0xa8> conf = (struct mpconf*) P2V((uint) mp->physaddr); if(memcmp(conf, "PCMP", 4) != 0) return 0; if(conf->version != 1 && conf->version != 4) return 0; if(sum((uchar*)conf, conf->length) != 0) 801030b9: 84 d2 test %dl,%dl 801030bb: 0f 85 e3 00 00 00 jne 801031a4 <mpinit+0x1a4> struct mp *mp; struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) 801030c1: 85 f6 test %esi,%esi 801030c3: 0f 84 db 00 00 00 je 801031a4 <mpinit+0x1a4> panic("Expect to run on an SMP"); ismp = 1; lapic = (uint*)conf->lapicaddr; 801030c9: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax 801030cf: a3 7c 36 11 80 mov %eax,0x8011367c for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 801030d4: 0f b7 93 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edx 801030db: 8d 83 2c 00 00 80 lea -0x7fffffd4(%ebx),%eax struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) panic("Expect to run on an SMP"); ismp = 1; 801030e1: bb 01 00 00 00 mov $0x1,%ebx lapic = (uint*)conf->lapicaddr; for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 801030e6: 01 d6 add %edx,%esi 801030e8: 90 nop 801030e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801030f0: 39 c6 cmp %eax,%esi 801030f2: 76 23 jbe 80103117 <mpinit+0x117> 801030f4: 0f b6 10 movzbl (%eax),%edx switch(*p){ 801030f7: 80 fa 04 cmp $0x4,%dl 801030fa: 0f 87 c0 00 00 00 ja 801031c0 <mpinit+0x1c0> 80103100: ff 24 95 dc 7a 10 80 jmp *-0x7fef8524(,%edx,4) 80103107: 89 f6 mov %esi,%esi 80103109: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p += sizeof(struct mpioapic); continue; case MPBUS: case MPIOINTR: case MPLINTR: p += 8; 80103110: 83 c0 08 add $0x8,%eax if((conf = mpconfig(&mp)) == 0) panic("Expect to run on an SMP"); ismp = 1; lapic = (uint*)conf->lapicaddr; for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 80103113: 39 c6 cmp %eax,%esi 80103115: 77 dd ja 801030f4 <mpinit+0xf4> default: ismp = 0; break; } } if(!ismp) 80103117: 85 db test %ebx,%ebx 80103119: 0f 84 92 00 00 00 je 801031b1 <mpinit+0x1b1> panic("Didn't find a suitable machine"); if(mp->imcrp){ 8010311f: 8b 45 e4 mov -0x1c(%ebp),%eax 80103122: 80 78 0c 00 cmpb $0x0,0xc(%eax) 80103126: 74 15 je 8010313d <mpinit+0x13d> } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80103128: ba 22 00 00 00 mov $0x22,%edx 8010312d: b8 70 00 00 00 mov $0x70,%eax 80103132: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80103133: ba 23 00 00 00 mov $0x23,%edx 80103138: ec in (%dx),%al } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80103139: 83 c8 01 or $0x1,%eax 8010313c: ee out %al,(%dx) // 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. } } 8010313d: 8d 65 f4 lea -0xc(%ebp),%esp 80103140: 5b pop %ebx 80103141: 5e pop %esi 80103142: 5f pop %edi 80103143: 5d pop %ebp 80103144: c3 ret 80103145: 8d 76 00 lea 0x0(%esi),%esi lapic = (uint*)conf->lapicaddr; for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ switch(*p){ case MPPROC: proc = (struct mpproc*)p; if(ncpu < NCPU) { 80103148: 8b 0d 00 3d 11 80 mov 0x80113d00,%ecx 8010314e: 83 f9 07 cmp $0x7,%ecx 80103151: 7f 19 jg 8010316c <mpinit+0x16c> cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 80103153: 0f b6 50 01 movzbl 0x1(%eax),%edx 80103157: 69 f9 b0 00 00 00 imul $0xb0,%ecx,%edi ncpu++; 8010315d: 83 c1 01 add $0x1,%ecx 80103160: 89 0d 00 3d 11 80 mov %ecx,0x80113d00 for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ switch(*p){ case MPPROC: proc = (struct mpproc*)p; if(ncpu < NCPU) { cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 80103166: 88 97 80 37 11 80 mov %dl,-0x7feec880(%edi) ncpu++; } p += sizeof(struct mpproc); 8010316c: 83 c0 14 add $0x14,%eax continue; 8010316f: e9 7c ff ff ff jmp 801030f0 <mpinit+0xf0> 80103174: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi case MPIOAPIC: ioapic = (struct mpioapic*)p; ioapicid = ioapic->apicno; 80103178: 0f b6 50 01 movzbl 0x1(%eax),%edx p += sizeof(struct mpioapic); 8010317c: 83 c0 08 add $0x8,%eax } p += sizeof(struct mpproc); continue; case MPIOAPIC: ioapic = (struct mpioapic*)p; ioapicid = ioapic->apicno; 8010317f: 88 15 60 37 11 80 mov %dl,0x80113760 p += sizeof(struct mpioapic); continue; 80103185: e9 66 ff ff ff jmp 801030f0 <mpinit+0xf0> } else { p = ((bda[0x14]<<8)|bda[0x13])*1024; if((mp = mpsearch1(p-1024, 1024))) return mp; } return mpsearch1(0xF0000, 0x10000); 8010318a: ba 00 00 01 00 mov $0x10000,%edx 8010318f: b8 00 00 0f 00 mov $0xf0000,%eax 80103194: e8 e7 fd ff ff call 80102f80 <mpsearch1> mpconfig(struct mp **pmp) { struct mpconf *conf; struct mp *mp; if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103199: 85 c0 test %eax,%eax } else { p = ((bda[0x14]<<8)|bda[0x13])*1024; if((mp = mpsearch1(p-1024, 1024))) return mp; } return mpsearch1(0xF0000, 0x10000); 8010319b: 89 45 e4 mov %eax,-0x1c(%ebp) mpconfig(struct mp **pmp) { struct mpconf *conf; struct mp *mp; if((mp = mpsearch()) == 0 || mp->physaddr == 0) 8010319e: 0f 85 af fe ff ff jne 80103053 <mpinit+0x53> struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) panic("Expect to run on an SMP"); 801031a4: 83 ec 0c sub $0xc,%esp 801031a7: 68 a2 7a 10 80 push $0x80107aa2 801031ac: e8 bf d1 ff ff call 80100370 <panic> ismp = 0; break; } } if(!ismp) panic("Didn't find a suitable machine"); 801031b1: 83 ec 0c sub $0xc,%esp 801031b4: 68 bc 7a 10 80 push $0x80107abc 801031b9: e8 b2 d1 ff ff call 80100370 <panic> 801031be: 66 90 xchg %ax,%ax case MPIOINTR: case MPLINTR: p += 8; continue; default: ismp = 0; 801031c0: 31 db xor %ebx,%ebx 801031c2: e9 30 ff ff ff jmp 801030f7 <mpinit+0xf7> 801031c7: 66 90 xchg %ax,%ax 801031c9: 66 90 xchg %ax,%ax 801031cb: 66 90 xchg %ax,%ax 801031cd: 66 90 xchg %ax,%ax 801031cf: 90 nop 801031d0 <picinit>: #define IO_PIC2 0xA0 // Slave (IRQs 8-15) // Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware. void picinit(void) { 801031d0: 55 push %ebp 801031d1: ba 21 00 00 00 mov $0x21,%edx 801031d6: b8 ff ff ff ff mov $0xffffffff,%eax 801031db: 89 e5 mov %esp,%ebp 801031dd: ee out %al,(%dx) 801031de: ba a1 00 00 00 mov $0xa1,%edx 801031e3: ee out %al,(%dx) // mask all interrupts outb(IO_PIC1+1, 0xFF); outb(IO_PIC2+1, 0xFF); } 801031e4: 5d pop %ebp 801031e5: c3 ret 801031e6: 66 90 xchg %ax,%ax 801031e8: 66 90 xchg %ax,%ax 801031ea: 66 90 xchg %ax,%ax 801031ec: 66 90 xchg %ax,%ax 801031ee: 66 90 xchg %ax,%ax 801031f0 <pipealloc>: int writeopen; // write fd is still open }; int pipealloc(struct file **f0, struct file **f1) { 801031f0: 55 push %ebp 801031f1: 89 e5 mov %esp,%ebp 801031f3: 57 push %edi 801031f4: 56 push %esi 801031f5: 53 push %ebx 801031f6: 83 ec 0c sub $0xc,%esp 801031f9: 8b 75 08 mov 0x8(%ebp),%esi 801031fc: 8b 5d 0c mov 0xc(%ebp),%ebx struct pipe *p; p = 0; *f0 = *f1 = 0; 801031ff: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103205: c7 06 00 00 00 00 movl $0x0,(%esi) if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) 8010320b: e8 60 db ff ff call 80100d70 <filealloc> 80103210: 85 c0 test %eax,%eax 80103212: 89 06 mov %eax,(%esi) 80103214: 0f 84 a8 00 00 00 je 801032c2 <pipealloc+0xd2> 8010321a: e8 51 db ff ff call 80100d70 <filealloc> 8010321f: 85 c0 test %eax,%eax 80103221: 89 03 mov %eax,(%ebx) 80103223: 0f 84 87 00 00 00 je 801032b0 <pipealloc+0xc0> goto bad; if((p = (struct pipe*)kalloc()) == 0) 80103229: e8 62 f2 ff ff call 80102490 <kalloc> 8010322e: 85 c0 test %eax,%eax 80103230: 89 c7 mov %eax,%edi 80103232: 0f 84 b0 00 00 00 je 801032e8 <pipealloc+0xf8> goto bad; p->readopen = 1; p->writeopen = 1; p->nwrite = 0; p->nread = 0; initlock(&p->lock, "pipe"); 80103238: 83 ec 08 sub $0x8,%esp *f0 = *f1 = 0; if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) goto bad; if((p = (struct pipe*)kalloc()) == 0) goto bad; p->readopen = 1; 8010323b: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax) 80103242: 00 00 00 p->writeopen = 1; 80103245: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax) 8010324c: 00 00 00 p->nwrite = 0; 8010324f: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax) 80103256: 00 00 00 p->nread = 0; 80103259: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax) 80103260: 00 00 00 initlock(&p->lock, "pipe"); 80103263: 68 f0 7a 10 80 push $0x80107af0 80103268: 50 push %eax 80103269: e8 d2 14 00 00 call 80104740 <initlock> (*f0)->type = FD_PIPE; 8010326e: 8b 06 mov (%esi),%eax (*f0)->pipe = p; (*f1)->type = FD_PIPE; (*f1)->readable = 0; (*f1)->writable = 1; (*f1)->pipe = p; return 0; 80103270: 83 c4 10 add $0x10,%esp p->readopen = 1; p->writeopen = 1; p->nwrite = 0; p->nread = 0; initlock(&p->lock, "pipe"); (*f0)->type = FD_PIPE; 80103273: c7 00 01 00 00 00 movl $0x1,(%eax) (*f0)->readable = 1; 80103279: 8b 06 mov (%esi),%eax 8010327b: c6 40 08 01 movb $0x1,0x8(%eax) (*f0)->writable = 0; 8010327f: 8b 06 mov (%esi),%eax 80103281: c6 40 09 00 movb $0x0,0x9(%eax) (*f0)->pipe = p; 80103285: 8b 06 mov (%esi),%eax 80103287: 89 78 0c mov %edi,0xc(%eax) (*f1)->type = FD_PIPE; 8010328a: 8b 03 mov (%ebx),%eax 8010328c: c7 00 01 00 00 00 movl $0x1,(%eax) (*f1)->readable = 0; 80103292: 8b 03 mov (%ebx),%eax 80103294: c6 40 08 00 movb $0x0,0x8(%eax) (*f1)->writable = 1; 80103298: 8b 03 mov (%ebx),%eax 8010329a: c6 40 09 01 movb $0x1,0x9(%eax) (*f1)->pipe = p; 8010329e: 8b 03 mov (%ebx),%eax 801032a0: 89 78 0c mov %edi,0xc(%eax) if(*f0) fileclose(*f0); if(*f1) fileclose(*f1); return -1; } 801032a3: 8d 65 f4 lea -0xc(%ebp),%esp (*f0)->pipe = p; (*f1)->type = FD_PIPE; (*f1)->readable = 0; (*f1)->writable = 1; (*f1)->pipe = p; return 0; 801032a6: 31 c0 xor %eax,%eax if(*f0) fileclose(*f0); if(*f1) fileclose(*f1); return -1; } 801032a8: 5b pop %ebx 801032a9: 5e pop %esi 801032aa: 5f pop %edi 801032ab: 5d pop %ebp 801032ac: c3 ret 801032ad: 8d 76 00 lea 0x0(%esi),%esi //PAGEBREAK: 20 bad: if(p) kfree((char*)p); if(*f0) 801032b0: 8b 06 mov (%esi),%eax 801032b2: 85 c0 test %eax,%eax 801032b4: 74 1e je 801032d4 <pipealloc+0xe4> fileclose(*f0); 801032b6: 83 ec 0c sub $0xc,%esp 801032b9: 50 push %eax 801032ba: e8 71 db ff ff call 80100e30 <fileclose> 801032bf: 83 c4 10 add $0x10,%esp if(*f1) 801032c2: 8b 03 mov (%ebx),%eax 801032c4: 85 c0 test %eax,%eax 801032c6: 74 0c je 801032d4 <pipealloc+0xe4> fileclose(*f1); 801032c8: 83 ec 0c sub $0xc,%esp 801032cb: 50 push %eax 801032cc: e8 5f db ff ff call 80100e30 <fileclose> 801032d1: 83 c4 10 add $0x10,%esp return -1; } 801032d4: 8d 65 f4 lea -0xc(%ebp),%esp kfree((char*)p); if(*f0) fileclose(*f0); if(*f1) fileclose(*f1); return -1; 801032d7: b8 ff ff ff ff mov $0xffffffff,%eax } 801032dc: 5b pop %ebx 801032dd: 5e pop %esi 801032de: 5f pop %edi 801032df: 5d pop %ebp 801032e0: c3 ret 801032e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi //PAGEBREAK: 20 bad: if(p) kfree((char*)p); if(*f0) 801032e8: 8b 06 mov (%esi),%eax 801032ea: 85 c0 test %eax,%eax 801032ec: 75 c8 jne 801032b6 <pipealloc+0xc6> 801032ee: eb d2 jmp 801032c2 <pipealloc+0xd2> 801032f0 <pipeclose>: return -1; } void pipeclose(struct pipe *p, int writable) { 801032f0: 55 push %ebp 801032f1: 89 e5 mov %esp,%ebp 801032f3: 56 push %esi 801032f4: 53 push %ebx 801032f5: 8b 5d 08 mov 0x8(%ebp),%ebx 801032f8: 8b 75 0c mov 0xc(%ebp),%esi acquire(&p->lock); 801032fb: 83 ec 0c sub $0xc,%esp 801032fe: 53 push %ebx 801032ff: e8 3c 15 00 00 call 80104840 <acquire> if(writable){ 80103304: 83 c4 10 add $0x10,%esp 80103307: 85 f6 test %esi,%esi 80103309: 74 45 je 80103350 <pipeclose+0x60> p->writeopen = 0; wakeup(&p->nread); 8010330b: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 80103311: 83 ec 0c sub $0xc,%esp void pipeclose(struct pipe *p, int writable) { acquire(&p->lock); if(writable){ p->writeopen = 0; 80103314: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx) 8010331b: 00 00 00 wakeup(&p->nread); 8010331e: 50 push %eax 8010331f: e8 bc 0b 00 00 call 80103ee0 <wakeup> 80103324: 83 c4 10 add $0x10,%esp } else { p->readopen = 0; wakeup(&p->nwrite); } if(p->readopen == 0 && p->writeopen == 0){ 80103327: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx 8010332d: 85 d2 test %edx,%edx 8010332f: 75 0a jne 8010333b <pipeclose+0x4b> 80103331: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax 80103337: 85 c0 test %eax,%eax 80103339: 74 35 je 80103370 <pipeclose+0x80> release(&p->lock); kfree((char*)p); } else release(&p->lock); 8010333b: 89 5d 08 mov %ebx,0x8(%ebp) } 8010333e: 8d 65 f8 lea -0x8(%ebp),%esp 80103341: 5b pop %ebx 80103342: 5e pop %esi 80103343: 5d pop %ebp } if(p->readopen == 0 && p->writeopen == 0){ release(&p->lock); kfree((char*)p); } else release(&p->lock); 80103344: e9 17 16 00 00 jmp 80104960 <release> 80103349: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(writable){ p->writeopen = 0; wakeup(&p->nread); } else { p->readopen = 0; wakeup(&p->nwrite); 80103350: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax 80103356: 83 ec 0c sub $0xc,%esp acquire(&p->lock); if(writable){ p->writeopen = 0; wakeup(&p->nread); } else { p->readopen = 0; 80103359: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx) 80103360: 00 00 00 wakeup(&p->nwrite); 80103363: 50 push %eax 80103364: e8 77 0b 00 00 call 80103ee0 <wakeup> 80103369: 83 c4 10 add $0x10,%esp 8010336c: eb b9 jmp 80103327 <pipeclose+0x37> 8010336e: 66 90 xchg %ax,%ax } if(p->readopen == 0 && p->writeopen == 0){ release(&p->lock); 80103370: 83 ec 0c sub $0xc,%esp 80103373: 53 push %ebx 80103374: e8 e7 15 00 00 call 80104960 <release> kfree((char*)p); 80103379: 89 5d 08 mov %ebx,0x8(%ebp) 8010337c: 83 c4 10 add $0x10,%esp } else release(&p->lock); } 8010337f: 8d 65 f8 lea -0x8(%ebp),%esp 80103382: 5b pop %ebx 80103383: 5e pop %esi 80103384: 5d pop %ebp p->readopen = 0; wakeup(&p->nwrite); } if(p->readopen == 0 && p->writeopen == 0){ release(&p->lock); kfree((char*)p); 80103385: e9 56 ef ff ff jmp 801022e0 <kfree> 8010338a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103390 <pipewrite>: } //PAGEBREAK: 40 int pipewrite(struct pipe *p, char *addr, int n) { 80103390: 55 push %ebp 80103391: 89 e5 mov %esp,%ebp 80103393: 57 push %edi 80103394: 56 push %esi 80103395: 53 push %ebx 80103396: 83 ec 28 sub $0x28,%esp 80103399: 8b 5d 08 mov 0x8(%ebp),%ebx int i; acquire(&p->lock); 8010339c: 53 push %ebx 8010339d: e8 9e 14 00 00 call 80104840 <acquire> for(i = 0; i < n; i++){ 801033a2: 8b 45 10 mov 0x10(%ebp),%eax 801033a5: 83 c4 10 add $0x10,%esp 801033a8: 85 c0 test %eax,%eax 801033aa: 0f 8e b9 00 00 00 jle 80103469 <pipewrite+0xd9> 801033b0: 8b 4d 0c mov 0xc(%ebp),%ecx 801033b3: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full if(p->readopen == 0 || myproc()->killed){ release(&p->lock); return -1; } wakeup(&p->nread); 801033b9: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 801033bf: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi 801033c5: 89 4d e4 mov %ecx,-0x1c(%ebp) 801033c8: 03 4d 10 add 0x10(%ebp),%ecx 801033cb: 89 4d e0 mov %ecx,-0x20(%ebp) { int i; acquire(&p->lock); for(i = 0; i < n; i++){ while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 801033ce: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx 801033d4: 8d 91 00 02 00 00 lea 0x200(%ecx),%edx 801033da: 39 d0 cmp %edx,%eax 801033dc: 74 38 je 80103416 <pipewrite+0x86> 801033de: eb 59 jmp 80103439 <pipewrite+0xa9> if(p->readopen == 0 || myproc()->killed){ 801033e0: e8 9b 03 00 00 call 80103780 <myproc> 801033e5: 8b 48 24 mov 0x24(%eax),%ecx 801033e8: 85 c9 test %ecx,%ecx 801033ea: 75 34 jne 80103420 <pipewrite+0x90> release(&p->lock); return -1; } wakeup(&p->nread); 801033ec: 83 ec 0c sub $0xc,%esp 801033ef: 57 push %edi 801033f0: e8 eb 0a 00 00 call 80103ee0 <wakeup> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 801033f5: 58 pop %eax 801033f6: 5a pop %edx 801033f7: 53 push %ebx 801033f8: 56 push %esi 801033f9: e8 32 09 00 00 call 80103d30 <sleep> { int i; acquire(&p->lock); for(i = 0; i < n; i++){ while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 801033fe: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 80103404: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx 8010340a: 83 c4 10 add $0x10,%esp 8010340d: 05 00 02 00 00 add $0x200,%eax 80103412: 39 c2 cmp %eax,%edx 80103414: 75 2a jne 80103440 <pipewrite+0xb0> if(p->readopen == 0 || myproc()->killed){ 80103416: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 8010341c: 85 c0 test %eax,%eax 8010341e: 75 c0 jne 801033e0 <pipewrite+0x50> release(&p->lock); 80103420: 83 ec 0c sub $0xc,%esp 80103423: 53 push %ebx 80103424: e8 37 15 00 00 call 80104960 <release> return -1; 80103429: 83 c4 10 add $0x10,%esp 8010342c: 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; } 80103431: 8d 65 f4 lea -0xc(%ebp),%esp 80103434: 5b pop %ebx 80103435: 5e pop %esi 80103436: 5f pop %edi 80103437: 5d pop %ebp 80103438: c3 ret { int i; acquire(&p->lock); for(i = 0; i < n; i++){ while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103439: 89 c2 mov %eax,%edx 8010343b: 90 nop 8010343c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; } wakeup(&p->nread); sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep } p->data[p->nwrite++ % PIPESIZE] = addr[i]; 80103440: 8b 4d e4 mov -0x1c(%ebp),%ecx 80103443: 8d 42 01 lea 0x1(%edx),%eax 80103446: 83 45 e4 01 addl $0x1,-0x1c(%ebp) 8010344a: 81 e2 ff 01 00 00 and $0x1ff,%edx 80103450: 89 83 38 02 00 00 mov %eax,0x238(%ebx) 80103456: 0f b6 09 movzbl (%ecx),%ecx 80103459: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1) 8010345d: 8b 4d e4 mov -0x1c(%ebp),%ecx pipewrite(struct pipe *p, char *addr, int n) { int i; acquire(&p->lock); for(i = 0; i < n; i++){ 80103460: 3b 4d e0 cmp -0x20(%ebp),%ecx 80103463: 0f 85 65 ff ff ff jne 801033ce <pipewrite+0x3e> wakeup(&p->nread); sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep } p->data[p->nwrite++ % PIPESIZE] = addr[i]; } wakeup(&p->nread); //DOC: pipewrite-wakeup1 80103469: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 8010346f: 83 ec 0c sub $0xc,%esp 80103472: 50 push %eax 80103473: e8 68 0a 00 00 call 80103ee0 <wakeup> release(&p->lock); 80103478: 89 1c 24 mov %ebx,(%esp) 8010347b: e8 e0 14 00 00 call 80104960 <release> return n; 80103480: 83 c4 10 add $0x10,%esp 80103483: 8b 45 10 mov 0x10(%ebp),%eax 80103486: eb a9 jmp 80103431 <pipewrite+0xa1> 80103488: 90 nop 80103489: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103490 <piperead>: } int piperead(struct pipe *p, char *addr, int n) { 80103490: 55 push %ebp 80103491: 89 e5 mov %esp,%ebp 80103493: 57 push %edi 80103494: 56 push %esi 80103495: 53 push %ebx 80103496: 83 ec 18 sub $0x18,%esp 80103499: 8b 5d 08 mov 0x8(%ebp),%ebx 8010349c: 8b 7d 0c mov 0xc(%ebp),%edi int i; acquire(&p->lock); 8010349f: 53 push %ebx 801034a0: e8 9b 13 00 00 call 80104840 <acquire> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 801034a5: 83 c4 10 add $0x10,%esp 801034a8: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 801034ae: 39 83 38 02 00 00 cmp %eax,0x238(%ebx) 801034b4: 75 6a jne 80103520 <piperead+0x90> 801034b6: 8b b3 40 02 00 00 mov 0x240(%ebx),%esi 801034bc: 85 f6 test %esi,%esi 801034be: 0f 84 cc 00 00 00 je 80103590 <piperead+0x100> if(myproc()->killed){ release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep 801034c4: 8d b3 34 02 00 00 lea 0x234(%ebx),%esi 801034ca: eb 2d jmp 801034f9 <piperead+0x69> 801034cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801034d0: 83 ec 08 sub $0x8,%esp 801034d3: 53 push %ebx 801034d4: 56 push %esi 801034d5: e8 56 08 00 00 call 80103d30 <sleep> piperead(struct pipe *p, char *addr, int n) { int i; acquire(&p->lock); while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 801034da: 83 c4 10 add $0x10,%esp 801034dd: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax 801034e3: 39 83 34 02 00 00 cmp %eax,0x234(%ebx) 801034e9: 75 35 jne 80103520 <piperead+0x90> 801034eb: 8b 93 40 02 00 00 mov 0x240(%ebx),%edx 801034f1: 85 d2 test %edx,%edx 801034f3: 0f 84 97 00 00 00 je 80103590 <piperead+0x100> if(myproc()->killed){ 801034f9: e8 82 02 00 00 call 80103780 <myproc> 801034fe: 8b 48 24 mov 0x24(%eax),%ecx 80103501: 85 c9 test %ecx,%ecx 80103503: 74 cb je 801034d0 <piperead+0x40> release(&p->lock); 80103505: 83 ec 0c sub $0xc,%esp 80103508: 53 push %ebx 80103509: e8 52 14 00 00 call 80104960 <release> return -1; 8010350e: 83 c4 10 add $0x10,%esp addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 80103511: 8d 65 f4 lea -0xc(%ebp),%esp acquire(&p->lock); while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty if(myproc()->killed){ release(&p->lock); return -1; 80103514: b8 ff ff ff ff mov $0xffffffff,%eax addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 80103519: 5b pop %ebx 8010351a: 5e pop %esi 8010351b: 5f pop %edi 8010351c: 5d pop %ebp 8010351d: c3 ret 8010351e: 66 90 xchg %ax,%ax release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep } for(i = 0; i < n; i++){ //DOC: piperead-copy 80103520: 8b 45 10 mov 0x10(%ebp),%eax 80103523: 85 c0 test %eax,%eax 80103525: 7e 69 jle 80103590 <piperead+0x100> if(p->nread == p->nwrite) 80103527: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 8010352d: 31 c9 xor %ecx,%ecx 8010352f: eb 15 jmp 80103546 <piperead+0xb6> 80103531: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103538: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 8010353e: 3b 83 38 02 00 00 cmp 0x238(%ebx),%eax 80103544: 74 5a je 801035a0 <piperead+0x110> break; addr[i] = p->data[p->nread++ % PIPESIZE]; 80103546: 8d 70 01 lea 0x1(%eax),%esi 80103549: 25 ff 01 00 00 and $0x1ff,%eax 8010354e: 89 b3 34 02 00 00 mov %esi,0x234(%ebx) 80103554: 0f b6 44 03 34 movzbl 0x34(%ebx,%eax,1),%eax 80103559: 88 04 0f mov %al,(%edi,%ecx,1) release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep } for(i = 0; i < n; i++){ //DOC: piperead-copy 8010355c: 83 c1 01 add $0x1,%ecx 8010355f: 39 4d 10 cmp %ecx,0x10(%ebp) 80103562: 75 d4 jne 80103538 <piperead+0xa8> if(p->nread == p->nwrite) break; addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup 80103564: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax 8010356a: 83 ec 0c sub $0xc,%esp 8010356d: 50 push %eax 8010356e: e8 6d 09 00 00 call 80103ee0 <wakeup> release(&p->lock); 80103573: 89 1c 24 mov %ebx,(%esp) 80103576: e8 e5 13 00 00 call 80104960 <release> return i; 8010357b: 8b 45 10 mov 0x10(%ebp),%eax 8010357e: 83 c4 10 add $0x10,%esp } 80103581: 8d 65 f4 lea -0xc(%ebp),%esp 80103584: 5b pop %ebx 80103585: 5e pop %esi 80103586: 5f pop %edi 80103587: 5d pop %ebp 80103588: c3 ret 80103589: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep } for(i = 0; i < n; i++){ //DOC: piperead-copy 80103590: c7 45 10 00 00 00 00 movl $0x0,0x10(%ebp) 80103597: eb cb jmp 80103564 <piperead+0xd4> 80103599: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801035a0: 89 4d 10 mov %ecx,0x10(%ebp) 801035a3: eb bf jmp 80103564 <piperead+0xd4> 801035a5: 66 90 xchg %ax,%ax 801035a7: 66 90 xchg %ax,%ax 801035a9: 66 90 xchg %ax,%ax 801035ab: 66 90 xchg %ax,%ax 801035ad: 66 90 xchg %ax,%ax 801035af: 90 nop 801035b0 <allocproc>: // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 801035b0: 55 push %ebp 801035b1: 89 e5 mov %esp,%ebp 801035b3: 53 push %ebx struct proc *p; char *sp; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801035b4: bb 54 3d 11 80 mov $0x80113d54,%ebx // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 801035b9: 83 ec 10 sub $0x10,%esp struct proc *p; char *sp; acquire(&ptable.lock); 801035bc: 68 20 3d 11 80 push $0x80113d20 801035c1: e8 7a 12 00 00 call 80104840 <acquire> 801035c6: 83 c4 10 add $0x10,%esp 801035c9: eb 10 jmp 801035db <allocproc+0x2b> 801035cb: 90 nop 801035cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801035d0: 83 eb 80 sub $0xffffff80,%ebx 801035d3: 81 fb 54 5d 11 80 cmp $0x80115d54,%ebx 801035d9: 74 75 je 80103650 <allocproc+0xa0> if(p->state == UNUSED) 801035db: 8b 43 0c mov 0xc(%ebx),%eax 801035de: 85 c0 test %eax,%eax 801035e0: 75 ee jne 801035d0 <allocproc+0x20> release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 801035e2: a1 04 b0 10 80 mov 0x8010b004,%eax release(&ptable.lock); 801035e7: 83 ec 0c sub $0xc,%esp release(&ptable.lock); return 0; found: p->state = EMBRYO; 801035ea: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx) p->pid = nextpid++; release(&ptable.lock); 801035f1: 68 20 3d 11 80 push $0x80113d20 release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 801035f6: 8d 50 01 lea 0x1(%eax),%edx 801035f9: 89 43 10 mov %eax,0x10(%ebx) 801035fc: 89 15 04 b0 10 80 mov %edx,0x8010b004 release(&ptable.lock); 80103602: e8 59 13 00 00 call 80104960 <release> // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ 80103607: e8 84 ee ff ff call 80102490 <kalloc> 8010360c: 83 c4 10 add $0x10,%esp 8010360f: 85 c0 test %eax,%eax 80103611: 89 43 08 mov %eax,0x8(%ebx) 80103614: 74 51 je 80103667 <allocproc+0xb7> return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 80103616: 8d 90 b4 0f 00 00 lea 0xfb4(%eax),%edx sp -= 4; *(uint*)sp = (uint)trapret; sp -= sizeof *p->context; p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); 8010361c: 83 ec 04 sub $0x4,%esp // Set up new context to start executing at forkret, // which returns to trapret. sp -= 4; *(uint*)sp = (uint)trapret; sp -= sizeof *p->context; 8010361f: 05 9c 0f 00 00 add $0xf9c,%eax return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 80103624: 89 53 18 mov %edx,0x18(%ebx) p->tf = (struct trapframe*)sp; // Set up new context to start executing at forkret, // which returns to trapret. sp -= 4; *(uint*)sp = (uint)trapret; 80103627: c7 40 14 ff 5c 10 80 movl $0x80105cff,0x14(%eax) sp -= sizeof *p->context; p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); 8010362e: 6a 14 push $0x14 80103630: 6a 00 push $0x0 80103632: 50 push %eax // which returns to trapret. sp -= 4; *(uint*)sp = (uint)trapret; sp -= sizeof *p->context; p->context = (struct context*)sp; 80103633: 89 43 1c mov %eax,0x1c(%ebx) memset(p->context, 0, sizeof *p->context); 80103636: e8 75 13 00 00 call 801049b0 <memset> p->context->eip = (uint)forkret; 8010363b: 8b 43 1c mov 0x1c(%ebx),%eax return p; 8010363e: 83 c4 10 add $0x10,%esp *(uint*)sp = (uint)trapret; sp -= sizeof *p->context; p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); p->context->eip = (uint)forkret; 80103641: c7 40 10 70 36 10 80 movl $0x80103670,0x10(%eax) return p; 80103648: 89 d8 mov %ebx,%eax } 8010364a: 8b 5d fc mov -0x4(%ebp),%ebx 8010364d: c9 leave 8010364e: c3 ret 8010364f: 90 nop for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) if(p->state == UNUSED) goto found; release(&ptable.lock); 80103650: 83 ec 0c sub $0xc,%esp 80103653: 68 20 3d 11 80 push $0x80113d20 80103658: e8 03 13 00 00 call 80104960 <release> return 0; 8010365d: 83 c4 10 add $0x10,%esp 80103660: 31 c0 xor %eax,%eax p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); p->context->eip = (uint)forkret; return p; } 80103662: 8b 5d fc mov -0x4(%ebp),%ebx 80103665: c9 leave 80103666: c3 ret release(&ptable.lock); // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ p->state = UNUSED; 80103667: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return 0; 8010366e: eb da jmp 8010364a <allocproc+0x9a> 80103670 <forkret>: // A fork child's very first scheduling by scheduler() // will swtch here. "Return" to user space. void forkret(void) { 80103670: 55 push %ebp 80103671: 89 e5 mov %esp,%ebp 80103673: 83 ec 14 sub $0x14,%esp static int first = 1; // Still holding ptable.lock from scheduler. release(&ptable.lock); 80103676: 68 20 3d 11 80 push $0x80113d20 8010367b: e8 e0 12 00 00 call 80104960 <release> if (first) { 80103680: a1 00 b0 10 80 mov 0x8010b000,%eax 80103685: 83 c4 10 add $0x10,%esp 80103688: 85 c0 test %eax,%eax 8010368a: 75 04 jne 80103690 <forkret+0x20> iinit(ROOTDEV); initlog(ROOTDEV); } // Return to "caller", actually trapret (see allocproc). } 8010368c: c9 leave 8010368d: c3 ret 8010368e: 66 90 xchg %ax,%ax if (first) { // Some initialization functions must be run in the context // of a regular process (e.g., they call sleep), and thus cannot // be run from main(). first = 0; iinit(ROOTDEV); 80103690: 83 ec 0c sub $0xc,%esp if (first) { // Some initialization functions must be run in the context // of a regular process (e.g., they call sleep), and thus cannot // be run from main(). first = 0; 80103693: c7 05 00 b0 10 80 00 movl $0x0,0x8010b000 8010369a: 00 00 00 iinit(ROOTDEV); 8010369d: 6a 01 push $0x1 8010369f: e8 cc dd ff ff call 80101470 <iinit> initlog(ROOTDEV); 801036a4: c7 04 24 01 00 00 00 movl $0x1,(%esp) 801036ab: e8 00 f4 ff ff call 80102ab0 <initlog> 801036b0: 83 c4 10 add $0x10,%esp } // Return to "caller", actually trapret (see allocproc). } 801036b3: c9 leave 801036b4: c3 ret 801036b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801036b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801036c0 <pinit>: static void wakeup1(void *chan); void pinit(void) { 801036c0: 55 push %ebp 801036c1: 89 e5 mov %esp,%ebp 801036c3: 83 ec 10 sub $0x10,%esp initlock(&ptable.lock, "ptable"); 801036c6: 68 f5 7a 10 80 push $0x80107af5 801036cb: 68 20 3d 11 80 push $0x80113d20 801036d0: e8 6b 10 00 00 call 80104740 <initlock> } 801036d5: 83 c4 10 add $0x10,%esp 801036d8: c9 leave 801036d9: c3 ret 801036da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801036e0 <mycpu>: // Must be called with interrupts disabled to avoid the caller being // rescheduled between reading lapicid and running through the loop. struct cpu* mycpu(void) { 801036e0: 55 push %ebp 801036e1: 89 e5 mov %esp,%ebp 801036e3: 56 push %esi 801036e4: 53 push %ebx static inline uint readeflags(void) { uint eflags; asm volatile("pushfl; popl %0" : "=r" (eflags)); 801036e5: 9c pushf 801036e6: 58 pop %eax int apicid, i; if(readeflags()&FL_IF) 801036e7: f6 c4 02 test $0x2,%ah 801036ea: 75 5b jne 80103747 <mycpu+0x67> panic("mycpu called with interrupts enabled\n"); apicid = lapicid(); 801036ec: e8 ff ef ff ff call 801026f0 <lapicid> // APIC IDs are not guaranteed to be contiguous. Maybe we should have // a reverse map, or reserve a register to store &cpus[i]. for (i = 0; i < ncpu; ++i) { 801036f1: 8b 35 00 3d 11 80 mov 0x80113d00,%esi 801036f7: 85 f6 test %esi,%esi 801036f9: 7e 3f jle 8010373a <mycpu+0x5a> if (cpus[i].apicid == apicid) 801036fb: 0f b6 15 80 37 11 80 movzbl 0x80113780,%edx 80103702: 39 d0 cmp %edx,%eax 80103704: 74 30 je 80103736 <mycpu+0x56> 80103706: b9 30 38 11 80 mov $0x80113830,%ecx 8010370b: 31 d2 xor %edx,%edx 8010370d: 8d 76 00 lea 0x0(%esi),%esi panic("mycpu called with interrupts enabled\n"); apicid = lapicid(); // APIC IDs are not guaranteed to be contiguous. Maybe we should have // a reverse map, or reserve a register to store &cpus[i]. for (i = 0; i < ncpu; ++i) { 80103710: 83 c2 01 add $0x1,%edx 80103713: 39 f2 cmp %esi,%edx 80103715: 74 23 je 8010373a <mycpu+0x5a> if (cpus[i].apicid == apicid) 80103717: 0f b6 19 movzbl (%ecx),%ebx 8010371a: 81 c1 b0 00 00 00 add $0xb0,%ecx 80103720: 39 d8 cmp %ebx,%eax 80103722: 75 ec jne 80103710 <mycpu+0x30> return &cpus[i]; 80103724: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax } panic("unknown apicid\n"); } 8010372a: 8d 65 f8 lea -0x8(%ebp),%esp 8010372d: 5b pop %ebx apicid = lapicid(); // APIC IDs are not guaranteed to be contiguous. Maybe we should have // a reverse map, or reserve a register to store &cpus[i]. for (i = 0; i < ncpu; ++i) { if (cpus[i].apicid == apicid) return &cpus[i]; 8010372e: 05 80 37 11 80 add $0x80113780,%eax } panic("unknown apicid\n"); } 80103733: 5e pop %esi 80103734: 5d pop %ebp 80103735: c3 ret panic("mycpu called with interrupts enabled\n"); apicid = lapicid(); // APIC IDs are not guaranteed to be contiguous. Maybe we should have // a reverse map, or reserve a register to store &cpus[i]. for (i = 0; i < ncpu; ++i) { 80103736: 31 d2 xor %edx,%edx 80103738: eb ea jmp 80103724 <mycpu+0x44> if (cpus[i].apicid == apicid) return &cpus[i]; } panic("unknown apicid\n"); 8010373a: 83 ec 0c sub $0xc,%esp 8010373d: 68 fc 7a 10 80 push $0x80107afc 80103742: e8 29 cc ff ff call 80100370 <panic> mycpu(void) { int apicid, i; if(readeflags()&FL_IF) panic("mycpu called with interrupts enabled\n"); 80103747: 83 ec 0c sub $0xc,%esp 8010374a: 68 dc 7b 10 80 push $0x80107bdc 8010374f: e8 1c cc ff ff call 80100370 <panic> 80103754: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010375a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103760 <cpuid>: initlock(&ptable.lock, "ptable"); } // Must be called with interrupts disabled int cpuid() { 80103760: 55 push %ebp 80103761: 89 e5 mov %esp,%ebp 80103763: 83 ec 08 sub $0x8,%esp return mycpu()-cpus; 80103766: e8 75 ff ff ff call 801036e0 <mycpu> 8010376b: 2d 80 37 11 80 sub $0x80113780,%eax } 80103770: c9 leave } // Must be called with interrupts disabled int cpuid() { return mycpu()-cpus; 80103771: c1 f8 04 sar $0x4,%eax 80103774: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax } 8010377a: c3 ret 8010377b: 90 nop 8010377c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103780 <myproc>: } // Disable interrupts so that we are not rescheduled // while reading proc from the cpu structure struct proc* myproc(void) { 80103780: 55 push %ebp 80103781: 89 e5 mov %esp,%ebp 80103783: 53 push %ebx 80103784: 83 ec 04 sub $0x4,%esp struct cpu *c; struct proc *p; pushcli(); 80103787: e8 74 10 00 00 call 80104800 <pushcli> c = mycpu(); 8010378c: e8 4f ff ff ff call 801036e0 <mycpu> p = c->proc; 80103791: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103797: e8 54 11 00 00 call 801048f0 <popcli> return p; } 8010379c: 83 c4 04 add $0x4,%esp 8010379f: 89 d8 mov %ebx,%eax 801037a1: 5b pop %ebx 801037a2: 5d pop %ebp 801037a3: c3 ret 801037a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801037aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801037b0 <userinit>: //PAGEBREAK: 32 // Set up first user process. void userinit(void) { 801037b0: 55 push %ebp 801037b1: 89 e5 mov %esp,%ebp 801037b3: 53 push %ebx 801037b4: 83 ec 04 sub $0x4,%esp struct proc *p; extern char _binary_initcode_start[], _binary_initcode_size[]; p = allocproc(); 801037b7: e8 f4 fd ff ff call 801035b0 <allocproc> 801037bc: 89 c3 mov %eax,%ebx initproc = p; 801037be: a3 b8 b5 10 80 mov %eax,0x8010b5b8 if((p->pgdir = setupkvm()) == 0) 801037c3: e8 28 3b 00 00 call 801072f0 <setupkvm> 801037c8: 85 c0 test %eax,%eax 801037ca: 89 43 04 mov %eax,0x4(%ebx) 801037cd: 0f 84 bd 00 00 00 je 80103890 <userinit+0xe0> panic("userinit: out of memory?"); inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); 801037d3: 83 ec 04 sub $0x4,%esp 801037d6: 68 2c 00 00 00 push $0x2c 801037db: 68 60 b4 10 80 push $0x8010b460 801037e0: 50 push %eax 801037e1: e8 1a 38 00 00 call 80107000 <inituvm> p->sz = PGSIZE; memset(p->tf, 0, sizeof(*p->tf)); 801037e6: 83 c4 0c add $0xc,%esp initproc = p; if((p->pgdir = setupkvm()) == 0) panic("userinit: out of memory?"); inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); p->sz = PGSIZE; 801037e9: c7 03 00 10 00 00 movl $0x1000,(%ebx) memset(p->tf, 0, sizeof(*p->tf)); 801037ef: 6a 4c push $0x4c 801037f1: 6a 00 push $0x0 801037f3: ff 73 18 pushl 0x18(%ebx) 801037f6: e8 b5 11 00 00 call 801049b0 <memset> p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 801037fb: 8b 43 18 mov 0x18(%ebx),%eax 801037fe: ba 1b 00 00 00 mov $0x1b,%edx p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 80103803: b9 23 00 00 00 mov $0x23,%ecx p->tf->ss = p->tf->ds; p->tf->eflags = FL_IF; p->tf->esp = PGSIZE; p->tf->eip = 0; // beginning of initcode.S safestrcpy(p->name, "initcode", sizeof(p->name)); 80103808: 83 c4 0c add $0xc,%esp if((p->pgdir = setupkvm()) == 0) panic("userinit: out of memory?"); inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); p->sz = PGSIZE; memset(p->tf, 0, sizeof(*p->tf)); p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010380b: 66 89 50 3c mov %dx,0x3c(%eax) p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 8010380f: 8b 43 18 mov 0x18(%ebx),%eax 80103812: 66 89 48 2c mov %cx,0x2c(%eax) p->tf->es = p->tf->ds; 80103816: 8b 43 18 mov 0x18(%ebx),%eax 80103819: 0f b7 50 2c movzwl 0x2c(%eax),%edx 8010381d: 66 89 50 28 mov %dx,0x28(%eax) p->tf->ss = p->tf->ds; 80103821: 8b 43 18 mov 0x18(%ebx),%eax 80103824: 0f b7 50 2c movzwl 0x2c(%eax),%edx 80103828: 66 89 50 48 mov %dx,0x48(%eax) p->tf->eflags = FL_IF; 8010382c: 8b 43 18 mov 0x18(%ebx),%eax 8010382f: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax) p->tf->esp = PGSIZE; 80103836: 8b 43 18 mov 0x18(%ebx),%eax 80103839: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax) p->tf->eip = 0; // beginning of initcode.S 80103840: 8b 43 18 mov 0x18(%ebx),%eax 80103843: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax) safestrcpy(p->name, "initcode", sizeof(p->name)); 8010384a: 8d 43 6c lea 0x6c(%ebx),%eax 8010384d: 6a 10 push $0x10 8010384f: 68 25 7b 10 80 push $0x80107b25 80103854: 50 push %eax 80103855: e8 56 13 00 00 call 80104bb0 <safestrcpy> p->cwd = namei("/"); 8010385a: c7 04 24 2e 7b 10 80 movl $0x80107b2e,(%esp) 80103861: e8 5a e6 ff ff call 80101ec0 <namei> 80103866: 89 43 68 mov %eax,0x68(%ebx) // this assignment to p->state lets other cores // run this process. the acquire forces the above // writes to be visible, and the lock is also needed // because the assignment might not be atomic. acquire(&ptable.lock); 80103869: c7 04 24 20 3d 11 80 movl $0x80113d20,(%esp) 80103870: e8 cb 0f 00 00 call 80104840 <acquire> p->state = RUNNABLE; 80103875: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) release(&ptable.lock); 8010387c: c7 04 24 20 3d 11 80 movl $0x80113d20,(%esp) 80103883: e8 d8 10 00 00 call 80104960 <release> } 80103888: 83 c4 10 add $0x10,%esp 8010388b: 8b 5d fc mov -0x4(%ebp),%ebx 8010388e: c9 leave 8010388f: c3 ret p = allocproc(); initproc = p; if((p->pgdir = setupkvm()) == 0) panic("userinit: out of memory?"); 80103890: 83 ec 0c sub $0xc,%esp 80103893: 68 0c 7b 10 80 push $0x80107b0c 80103898: e8 d3 ca ff ff call 80100370 <panic> 8010389d: 8d 76 00 lea 0x0(%esi),%esi 801038a0 <growproc>: // Grow current process's memory by n bytes. // Return 0 on success, -1 on failure. int growproc(int n) { 801038a0: 55 push %ebp 801038a1: 89 e5 mov %esp,%ebp 801038a3: 56 push %esi 801038a4: 53 push %ebx 801038a5: 8b 75 08 mov 0x8(%ebp),%esi // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 801038a8: e8 53 0f 00 00 call 80104800 <pushcli> c = mycpu(); 801038ad: e8 2e fe ff ff call 801036e0 <mycpu> p = c->proc; 801038b2: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 801038b8: e8 33 10 00 00 call 801048f0 <popcli> { uint sz; struct proc *curproc = myproc(); sz = curproc->sz; if(n > 0){ 801038bd: 83 fe 00 cmp $0x0,%esi growproc(int n) { uint sz; struct proc *curproc = myproc(); sz = curproc->sz; 801038c0: 8b 03 mov (%ebx),%eax if(n > 0){ 801038c2: 7e 34 jle 801038f8 <growproc+0x58> if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) 801038c4: 83 ec 04 sub $0x4,%esp 801038c7: 01 c6 add %eax,%esi 801038c9: 56 push %esi 801038ca: 50 push %eax 801038cb: ff 73 04 pushl 0x4(%ebx) 801038ce: e8 6d 38 00 00 call 80107140 <allocuvm> 801038d3: 83 c4 10 add $0x10,%esp 801038d6: 85 c0 test %eax,%eax 801038d8: 74 36 je 80103910 <growproc+0x70> } else if(n < 0){ if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) return -1; } curproc->sz = sz; switchuvm(curproc); 801038da: 83 ec 0c sub $0xc,%esp return -1; } else if(n < 0){ if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) return -1; } curproc->sz = sz; 801038dd: 89 03 mov %eax,(%ebx) switchuvm(curproc); 801038df: 53 push %ebx 801038e0: e8 0b 36 00 00 call 80106ef0 <switchuvm> return 0; 801038e5: 83 c4 10 add $0x10,%esp 801038e8: 31 c0 xor %eax,%eax } 801038ea: 8d 65 f8 lea -0x8(%ebp),%esp 801038ed: 5b pop %ebx 801038ee: 5e pop %esi 801038ef: 5d pop %ebp 801038f0: c3 ret 801038f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sz = curproc->sz; if(n > 0){ if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) return -1; } else if(n < 0){ 801038f8: 74 e0 je 801038da <growproc+0x3a> if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) 801038fa: 83 ec 04 sub $0x4,%esp 801038fd: 01 c6 add %eax,%esi 801038ff: 56 push %esi 80103900: 50 push %eax 80103901: ff 73 04 pushl 0x4(%ebx) 80103904: e8 37 39 00 00 call 80107240 <deallocuvm> 80103909: 83 c4 10 add $0x10,%esp 8010390c: 85 c0 test %eax,%eax 8010390e: 75 ca jne 801038da <growproc+0x3a> struct proc *curproc = myproc(); sz = curproc->sz; if(n > 0){ if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) return -1; 80103910: b8 ff ff ff ff mov $0xffffffff,%eax 80103915: eb d3 jmp 801038ea <growproc+0x4a> 80103917: 89 f6 mov %esi,%esi 80103919: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103920 <fork>: // Create a new process copying p as the parent. // Sets up stack to return as if from system call. // Caller must set state of returned proc to RUNNABLE. int fork(void) { 80103920: 55 push %ebp 80103921: 89 e5 mov %esp,%ebp 80103923: 57 push %edi 80103924: 56 push %esi 80103925: 53 push %ebx 80103926: 83 ec 1c sub $0x1c,%esp // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103929: e8 d2 0e 00 00 call 80104800 <pushcli> c = mycpu(); 8010392e: e8 ad fd ff ff call 801036e0 <mycpu> p = c->proc; 80103933: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103939: e8 b2 0f 00 00 call 801048f0 <popcli> int i, pid; struct proc *np; struct proc *curproc = myproc(); // Allocate process. if((np = allocproc()) == 0){ 8010393e: e8 6d fc ff ff call 801035b0 <allocproc> 80103943: 85 c0 test %eax,%eax 80103945: 89 c7 mov %eax,%edi 80103947: 89 45 e4 mov %eax,-0x1c(%ebp) 8010394a: 0f 84 b5 00 00 00 je 80103a05 <fork+0xe5> return -1; } // Copy process state from proc. if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){ 80103950: 83 ec 08 sub $0x8,%esp 80103953: ff 33 pushl (%ebx) 80103955: ff 73 04 pushl 0x4(%ebx) 80103958: e8 63 3a 00 00 call 801073c0 <copyuvm> 8010395d: 83 c4 10 add $0x10,%esp 80103960: 85 c0 test %eax,%eax 80103962: 89 47 04 mov %eax,0x4(%edi) 80103965: 0f 84 a1 00 00 00 je 80103a0c <fork+0xec> kfree(np->kstack); np->kstack = 0; np->state = UNUSED; return -1; } np->sz = curproc->sz; 8010396b: 8b 03 mov (%ebx),%eax 8010396d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80103970: 89 01 mov %eax,(%ecx) np->parent = curproc; 80103972: 89 59 14 mov %ebx,0x14(%ecx) *np->tf = *curproc->tf; 80103975: 89 c8 mov %ecx,%eax 80103977: 8b 79 18 mov 0x18(%ecx),%edi 8010397a: 8b 73 18 mov 0x18(%ebx),%esi 8010397d: b9 13 00 00 00 mov $0x13,%ecx 80103982: f3 a5 rep movsl %ds:(%esi),%es:(%edi) // Clear %eax so that fork returns 0 in the child. np->tf->eax = 0; for(i = 0; i < NOFILE; i++) 80103984: 31 f6 xor %esi,%esi np->sz = curproc->sz; np->parent = curproc; *np->tf = *curproc->tf; // Clear %eax so that fork returns 0 in the child. np->tf->eax = 0; 80103986: 8b 40 18 mov 0x18(%eax),%eax 80103989: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) for(i = 0; i < NOFILE; i++) if(curproc->ofile[i]) 80103990: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax 80103994: 85 c0 test %eax,%eax 80103996: 74 13 je 801039ab <fork+0x8b> np->ofile[i] = filedup(curproc->ofile[i]); 80103998: 83 ec 0c sub $0xc,%esp 8010399b: 50 push %eax 8010399c: e8 3f d4 ff ff call 80100de0 <filedup> 801039a1: 8b 55 e4 mov -0x1c(%ebp),%edx 801039a4: 83 c4 10 add $0x10,%esp 801039a7: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4) *np->tf = *curproc->tf; // Clear %eax so that fork returns 0 in the child. np->tf->eax = 0; for(i = 0; i < NOFILE; i++) 801039ab: 83 c6 01 add $0x1,%esi 801039ae: 83 fe 10 cmp $0x10,%esi 801039b1: 75 dd jne 80103990 <fork+0x70> if(curproc->ofile[i]) np->ofile[i] = filedup(curproc->ofile[i]); np->cwd = idup(curproc->cwd); 801039b3: 83 ec 0c sub $0xc,%esp 801039b6: ff 73 68 pushl 0x68(%ebx) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 801039b9: 83 c3 6c add $0x6c,%ebx np->tf->eax = 0; for(i = 0; i < NOFILE; i++) if(curproc->ofile[i]) np->ofile[i] = filedup(curproc->ofile[i]); np->cwd = idup(curproc->cwd); 801039bc: e8 7f dc ff ff call 80101640 <idup> 801039c1: 8b 7d e4 mov -0x1c(%ebp),%edi safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 801039c4: 83 c4 0c add $0xc,%esp np->tf->eax = 0; for(i = 0; i < NOFILE; i++) if(curproc->ofile[i]) np->ofile[i] = filedup(curproc->ofile[i]); np->cwd = idup(curproc->cwd); 801039c7: 89 47 68 mov %eax,0x68(%edi) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 801039ca: 8d 47 6c lea 0x6c(%edi),%eax 801039cd: 6a 10 push $0x10 801039cf: 53 push %ebx 801039d0: 50 push %eax 801039d1: e8 da 11 00 00 call 80104bb0 <safestrcpy> pid = np->pid; 801039d6: 8b 5f 10 mov 0x10(%edi),%ebx acquire(&ptable.lock); 801039d9: c7 04 24 20 3d 11 80 movl $0x80113d20,(%esp) 801039e0: e8 5b 0e 00 00 call 80104840 <acquire> np->state = RUNNABLE; 801039e5: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi) release(&ptable.lock); 801039ec: c7 04 24 20 3d 11 80 movl $0x80113d20,(%esp) 801039f3: e8 68 0f 00 00 call 80104960 <release> return pid; 801039f8: 83 c4 10 add $0x10,%esp 801039fb: 89 d8 mov %ebx,%eax } 801039fd: 8d 65 f4 lea -0xc(%ebp),%esp 80103a00: 5b pop %ebx 80103a01: 5e pop %esi 80103a02: 5f pop %edi 80103a03: 5d pop %ebp 80103a04: c3 ret struct proc *np; struct proc *curproc = myproc(); // Allocate process. if((np = allocproc()) == 0){ return -1; 80103a05: b8 ff ff ff ff mov $0xffffffff,%eax 80103a0a: eb f1 jmp 801039fd <fork+0xdd> } // Copy process state from proc. if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){ kfree(np->kstack); 80103a0c: 8b 7d e4 mov -0x1c(%ebp),%edi 80103a0f: 83 ec 0c sub $0xc,%esp 80103a12: ff 77 08 pushl 0x8(%edi) 80103a15: e8 c6 e8 ff ff call 801022e0 <kfree> np->kstack = 0; 80103a1a: c7 47 08 00 00 00 00 movl $0x0,0x8(%edi) np->state = UNUSED; 80103a21: c7 47 0c 00 00 00 00 movl $0x0,0xc(%edi) return -1; 80103a28: 83 c4 10 add $0x10,%esp 80103a2b: b8 ff ff ff ff mov $0xffffffff,%eax 80103a30: eb cb jmp 801039fd <fork+0xdd> 80103a32: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103a40 <scheduler>: // - swtch to start running that process // - eventually that process transfers control // via swtch back to the scheduler. void scheduler(void) { 80103a40: 55 push %ebp 80103a41: 89 e5 mov %esp,%ebp 80103a43: 57 push %edi 80103a44: 56 push %esi 80103a45: 53 push %ebx 80103a46: 83 ec 0c sub $0xc,%esp struct proc *p; struct cpu *c = mycpu(); 80103a49: e8 92 fc ff ff call 801036e0 <mycpu> 80103a4e: 8d 78 04 lea 0x4(%eax),%edi 80103a51: 89 c6 mov %eax,%esi c->proc = 0; 80103a53: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax) 80103a5a: 00 00 00 80103a5d: 8d 76 00 lea 0x0(%esi),%esi } static inline void sti(void) { asm volatile("sti"); 80103a60: fb sti for(;;){ // Enable interrupts on this processor. sti(); // Loop over process table looking for process to run. acquire(&ptable.lock); 80103a61: 83 ec 0c sub $0xc,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103a64: bb 54 3d 11 80 mov $0x80113d54,%ebx for(;;){ // Enable interrupts on this processor. sti(); // Loop over process table looking for process to run. acquire(&ptable.lock); 80103a69: 68 20 3d 11 80 push $0x80113d20 80103a6e: e8 cd 0d 00 00 call 80104840 <acquire> 80103a73: 83 c4 10 add $0x10,%esp 80103a76: eb 13 jmp 80103a8b <scheduler+0x4b> 80103a78: 90 nop 80103a79: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103a80: 83 eb 80 sub $0xffffff80,%ebx 80103a83: 81 fb 54 5d 11 80 cmp $0x80115d54,%ebx 80103a89: 74 45 je 80103ad0 <scheduler+0x90> if(p->state != RUNNABLE) 80103a8b: 83 7b 0c 03 cmpl $0x3,0xc(%ebx) 80103a8f: 75 ef jne 80103a80 <scheduler+0x40> // Switch to chosen process. It is the process's job // to release ptable.lock and then reacquire it // before jumping back to us. c->proc = p; switchuvm(p); 80103a91: 83 ec 0c sub $0xc,%esp continue; // Switch to chosen process. It is the process's job // to release ptable.lock and then reacquire it // before jumping back to us. c->proc = p; 80103a94: 89 9e ac 00 00 00 mov %ebx,0xac(%esi) switchuvm(p); 80103a9a: 53 push %ebx // Enable interrupts on this processor. sti(); // Loop over process table looking for process to run. acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103a9b: 83 eb 80 sub $0xffffff80,%ebx // Switch to chosen process. It is the process's job // to release ptable.lock and then reacquire it // before jumping back to us. c->proc = p; switchuvm(p); 80103a9e: e8 4d 34 00 00 call 80106ef0 <switchuvm> p->state = RUNNING; swtch(&(c->scheduler), p->context); 80103aa3: 58 pop %eax 80103aa4: 5a pop %edx 80103aa5: ff 73 9c pushl -0x64(%ebx) 80103aa8: 57 push %edi // Switch to chosen process. It is the process's job // to release ptable.lock and then reacquire it // before jumping back to us. c->proc = p; switchuvm(p); p->state = RUNNING; 80103aa9: c7 43 8c 04 00 00 00 movl $0x4,-0x74(%ebx) swtch(&(c->scheduler), p->context); 80103ab0: e8 56 11 00 00 call 80104c0b <swtch> switchkvm(); 80103ab5: e8 16 34 00 00 call 80106ed0 <switchkvm> // Process is done running for now. // It should have changed its p->state before coming back. c->proc = 0; 80103aba: 83 c4 10 add $0x10,%esp // Enable interrupts on this processor. sti(); // Loop over process table looking for process to run. acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103abd: 81 fb 54 5d 11 80 cmp $0x80115d54,%ebx swtch(&(c->scheduler), p->context); switchkvm(); // Process is done running for now. // It should have changed its p->state before coming back. c->proc = 0; 80103ac3: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi) 80103aca: 00 00 00 // Enable interrupts on this processor. sti(); // Loop over process table looking for process to run. acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103acd: 75 bc jne 80103a8b <scheduler+0x4b> 80103acf: 90 nop // Process is done running for now. // It should have changed its p->state before coming back. c->proc = 0; } release(&ptable.lock); 80103ad0: 83 ec 0c sub $0xc,%esp 80103ad3: 68 20 3d 11 80 push $0x80113d20 80103ad8: e8 83 0e 00 00 call 80104960 <release> } 80103add: 83 c4 10 add $0x10,%esp 80103ae0: e9 7b ff ff ff jmp 80103a60 <scheduler+0x20> 80103ae5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103ae9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103af0 <sched>: // be proc->intena and proc->ncli, but that would // break in the few places where a lock is held but // there's no process. void sched(void) { 80103af0: 55 push %ebp 80103af1: 89 e5 mov %esp,%ebp 80103af3: 56 push %esi 80103af4: 53 push %ebx // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103af5: e8 06 0d 00 00 call 80104800 <pushcli> c = mycpu(); 80103afa: e8 e1 fb ff ff call 801036e0 <mycpu> p = c->proc; 80103aff: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103b05: e8 e6 0d 00 00 call 801048f0 <popcli> sched(void) { int intena; struct proc *p = myproc(); if(!holding(&ptable.lock)) 80103b0a: 83 ec 0c sub $0xc,%esp 80103b0d: 68 20 3d 11 80 push $0x80113d20 80103b12: e8 a9 0c 00 00 call 801047c0 <holding> 80103b17: 83 c4 10 add $0x10,%esp 80103b1a: 85 c0 test %eax,%eax 80103b1c: 74 4f je 80103b6d <sched+0x7d> panic("sched ptable.lock"); if(mycpu()->ncli != 1) 80103b1e: e8 bd fb ff ff call 801036e0 <mycpu> 80103b23: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax) 80103b2a: 75 68 jne 80103b94 <sched+0xa4> panic("sched locks"); if(p->state == RUNNING) 80103b2c: 83 7b 0c 04 cmpl $0x4,0xc(%ebx) 80103b30: 74 55 je 80103b87 <sched+0x97> static inline uint readeflags(void) { uint eflags; asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103b32: 9c pushf 80103b33: 58 pop %eax panic("sched running"); if(readeflags()&FL_IF) 80103b34: f6 c4 02 test $0x2,%ah 80103b37: 75 41 jne 80103b7a <sched+0x8a> panic("sched interruptible"); intena = mycpu()->intena; 80103b39: e8 a2 fb ff ff call 801036e0 <mycpu> swtch(&p->context, mycpu()->scheduler); 80103b3e: 83 c3 1c add $0x1c,%ebx panic("sched locks"); if(p->state == RUNNING) panic("sched running"); if(readeflags()&FL_IF) panic("sched interruptible"); intena = mycpu()->intena; 80103b41: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi swtch(&p->context, mycpu()->scheduler); 80103b47: e8 94 fb ff ff call 801036e0 <mycpu> 80103b4c: 83 ec 08 sub $0x8,%esp 80103b4f: ff 70 04 pushl 0x4(%eax) 80103b52: 53 push %ebx 80103b53: e8 b3 10 00 00 call 80104c0b <swtch> mycpu()->intena = intena; 80103b58: e8 83 fb ff ff call 801036e0 <mycpu> } 80103b5d: 83 c4 10 add $0x10,%esp panic("sched running"); if(readeflags()&FL_IF) panic("sched interruptible"); intena = mycpu()->intena; swtch(&p->context, mycpu()->scheduler); mycpu()->intena = intena; 80103b60: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax) } 80103b66: 8d 65 f8 lea -0x8(%ebp),%esp 80103b69: 5b pop %ebx 80103b6a: 5e pop %esi 80103b6b: 5d pop %ebp 80103b6c: c3 ret { int intena; struct proc *p = myproc(); if(!holding(&ptable.lock)) panic("sched ptable.lock"); 80103b6d: 83 ec 0c sub $0xc,%esp 80103b70: 68 30 7b 10 80 push $0x80107b30 80103b75: e8 f6 c7 ff ff call 80100370 <panic> if(mycpu()->ncli != 1) panic("sched locks"); if(p->state == RUNNING) panic("sched running"); if(readeflags()&FL_IF) panic("sched interruptible"); 80103b7a: 83 ec 0c sub $0xc,%esp 80103b7d: 68 5c 7b 10 80 push $0x80107b5c 80103b82: e8 e9 c7 ff ff call 80100370 <panic> if(!holding(&ptable.lock)) panic("sched ptable.lock"); if(mycpu()->ncli != 1) panic("sched locks"); if(p->state == RUNNING) panic("sched running"); 80103b87: 83 ec 0c sub $0xc,%esp 80103b8a: 68 4e 7b 10 80 push $0x80107b4e 80103b8f: e8 dc c7 ff ff call 80100370 <panic> struct proc *p = myproc(); if(!holding(&ptable.lock)) panic("sched ptable.lock"); if(mycpu()->ncli != 1) panic("sched locks"); 80103b94: 83 ec 0c sub $0xc,%esp 80103b97: 68 42 7b 10 80 push $0x80107b42 80103b9c: e8 cf c7 ff ff call 80100370 <panic> 80103ba1: eb 0d jmp 80103bb0 <exit> 80103ba3: 90 nop 80103ba4: 90 nop 80103ba5: 90 nop 80103ba6: 90 nop 80103ba7: 90 nop 80103ba8: 90 nop 80103ba9: 90 nop 80103baa: 90 nop 80103bab: 90 nop 80103bac: 90 nop 80103bad: 90 nop 80103bae: 90 nop 80103baf: 90 nop 80103bb0 <exit>: // Exit the current process. Does not return. // An exited process remains in the zombie state // until its parent calls wait() to find out it exited. void exit(void) { 80103bb0: 55 push %ebp 80103bb1: 89 e5 mov %esp,%ebp 80103bb3: 57 push %edi 80103bb4: 56 push %esi 80103bb5: 53 push %ebx 80103bb6: 83 ec 0c sub $0xc,%esp // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103bb9: e8 42 0c 00 00 call 80104800 <pushcli> c = mycpu(); 80103bbe: e8 1d fb ff ff call 801036e0 <mycpu> p = c->proc; 80103bc3: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103bc9: e8 22 0d 00 00 call 801048f0 <popcli> { struct proc *curproc = myproc(); struct proc *p; int fd; if(curproc == initproc) 80103bce: 39 35 b8 b5 10 80 cmp %esi,0x8010b5b8 80103bd4: 8d 5e 28 lea 0x28(%esi),%ebx 80103bd7: 8d 7e 68 lea 0x68(%esi),%edi 80103bda: 0f 84 e7 00 00 00 je 80103cc7 <exit+0x117> panic("init exiting"); // Close all open files. for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd]){ 80103be0: 8b 03 mov (%ebx),%eax 80103be2: 85 c0 test %eax,%eax 80103be4: 74 12 je 80103bf8 <exit+0x48> fileclose(curproc->ofile[fd]); 80103be6: 83 ec 0c sub $0xc,%esp 80103be9: 50 push %eax 80103bea: e8 41 d2 ff ff call 80100e30 <fileclose> curproc->ofile[fd] = 0; 80103bef: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103bf5: 83 c4 10 add $0x10,%esp 80103bf8: 83 c3 04 add $0x4,%ebx if(curproc == initproc) panic("init exiting"); // Close all open files. for(fd = 0; fd < NOFILE; fd++){ 80103bfb: 39 df cmp %ebx,%edi 80103bfd: 75 e1 jne 80103be0 <exit+0x30> fileclose(curproc->ofile[fd]); curproc->ofile[fd] = 0; } } begin_op(); 80103bff: e8 4c ef ff ff call 80102b50 <begin_op> iput(curproc->cwd); 80103c04: 83 ec 0c sub $0xc,%esp 80103c07: ff 76 68 pushl 0x68(%esi) 80103c0a: e8 91 db ff ff call 801017a0 <iput> end_op(); 80103c0f: e8 ac ef ff ff call 80102bc0 <end_op> curproc->cwd = 0; 80103c14: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi) acquire(&ptable.lock); 80103c1b: c7 04 24 20 3d 11 80 movl $0x80113d20,(%esp) 80103c22: e8 19 0c 00 00 call 80104840 <acquire> // Parent might be sleeping in wait(). wakeup1(curproc->parent); 80103c27: 8b 56 14 mov 0x14(%esi),%edx 80103c2a: 83 c4 10 add $0x10,%esp static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103c2d: b8 54 3d 11 80 mov $0x80113d54,%eax 80103c32: eb 0e jmp 80103c42 <exit+0x92> 80103c34: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103c38: 83 e8 80 sub $0xffffff80,%eax 80103c3b: 3d 54 5d 11 80 cmp $0x80115d54,%eax 80103c40: 74 1c je 80103c5e <exit+0xae> if(p->state == SLEEPING && p->chan == chan) 80103c42: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103c46: 75 f0 jne 80103c38 <exit+0x88> 80103c48: 3b 50 20 cmp 0x20(%eax),%edx 80103c4b: 75 eb jne 80103c38 <exit+0x88> p->state = RUNNABLE; 80103c4d: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103c54: 83 e8 80 sub $0xffffff80,%eax 80103c57: 3d 54 5d 11 80 cmp $0x80115d54,%eax 80103c5c: 75 e4 jne 80103c42 <exit+0x92> wakeup1(curproc->parent); // Pass abandoned children to init. for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->parent == curproc){ p->parent = initproc; 80103c5e: 8b 0d b8 b5 10 80 mov 0x8010b5b8,%ecx 80103c64: ba 54 3d 11 80 mov $0x80113d54,%edx 80103c69: eb 10 jmp 80103c7b <exit+0xcb> 80103c6b: 90 nop 80103c6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi // Parent might be sleeping in wait(). wakeup1(curproc->parent); // Pass abandoned children to init. for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c70: 83 ea 80 sub $0xffffff80,%edx 80103c73: 81 fa 54 5d 11 80 cmp $0x80115d54,%edx 80103c79: 74 33 je 80103cae <exit+0xfe> if(p->parent == curproc){ 80103c7b: 39 72 14 cmp %esi,0x14(%edx) 80103c7e: 75 f0 jne 80103c70 <exit+0xc0> p->parent = initproc; if(p->state == ZOMBIE) 80103c80: 83 7a 0c 05 cmpl $0x5,0xc(%edx) wakeup1(curproc->parent); // Pass abandoned children to init. for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->parent == curproc){ p->parent = initproc; 80103c84: 89 4a 14 mov %ecx,0x14(%edx) if(p->state == ZOMBIE) 80103c87: 75 e7 jne 80103c70 <exit+0xc0> 80103c89: b8 54 3d 11 80 mov $0x80113d54,%eax 80103c8e: eb 0a jmp 80103c9a <exit+0xea> static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103c90: 83 e8 80 sub $0xffffff80,%eax 80103c93: 3d 54 5d 11 80 cmp $0x80115d54,%eax 80103c98: 74 d6 je 80103c70 <exit+0xc0> if(p->state == SLEEPING && p->chan == chan) 80103c9a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103c9e: 75 f0 jne 80103c90 <exit+0xe0> 80103ca0: 3b 48 20 cmp 0x20(%eax),%ecx 80103ca3: 75 eb jne 80103c90 <exit+0xe0> p->state = RUNNABLE; 80103ca5: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) 80103cac: eb e2 jmp 80103c90 <exit+0xe0> wakeup1(initproc); } } // Jump into the scheduler, never to return. curproc->state = ZOMBIE; 80103cae: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi) sched(); 80103cb5: e8 36 fe ff ff call 80103af0 <sched> panic("zombie exit"); 80103cba: 83 ec 0c sub $0xc,%esp 80103cbd: 68 7d 7b 10 80 push $0x80107b7d 80103cc2: e8 a9 c6 ff ff call 80100370 <panic> struct proc *curproc = myproc(); struct proc *p; int fd; if(curproc == initproc) panic("init exiting"); 80103cc7: 83 ec 0c sub $0xc,%esp 80103cca: 68 70 7b 10 80 push $0x80107b70 80103ccf: e8 9c c6 ff ff call 80100370 <panic> 80103cd4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103cda: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103ce0 <yield>: } // Give up the CPU for one scheduling round. void yield(void) { 80103ce0: 55 push %ebp 80103ce1: 89 e5 mov %esp,%ebp 80103ce3: 53 push %ebx 80103ce4: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); //DOC: yieldlock 80103ce7: 68 20 3d 11 80 push $0x80113d20 80103cec: e8 4f 0b 00 00 call 80104840 <acquire> // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103cf1: e8 0a 0b 00 00 call 80104800 <pushcli> c = mycpu(); 80103cf6: e8 e5 f9 ff ff call 801036e0 <mycpu> p = c->proc; 80103cfb: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103d01: e8 ea 0b 00 00 call 801048f0 <popcli> // Give up the CPU for one scheduling round. void yield(void) { acquire(&ptable.lock); //DOC: yieldlock myproc()->state = RUNNABLE; 80103d06: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) sched(); 80103d0d: e8 de fd ff ff call 80103af0 <sched> release(&ptable.lock); 80103d12: c7 04 24 20 3d 11 80 movl $0x80113d20,(%esp) 80103d19: e8 42 0c 00 00 call 80104960 <release> } 80103d1e: 83 c4 10 add $0x10,%esp 80103d21: 8b 5d fc mov -0x4(%ebp),%ebx 80103d24: c9 leave 80103d25: c3 ret 80103d26: 8d 76 00 lea 0x0(%esi),%esi 80103d29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103d30 <sleep>: // Atomically release lock and sleep on chan. // Reacquires lock when awakened. void sleep(void *chan, struct spinlock *lk) { 80103d30: 55 push %ebp 80103d31: 89 e5 mov %esp,%ebp 80103d33: 57 push %edi 80103d34: 56 push %esi 80103d35: 53 push %ebx 80103d36: 83 ec 0c sub $0xc,%esp 80103d39: 8b 7d 08 mov 0x8(%ebp),%edi 80103d3c: 8b 75 0c mov 0xc(%ebp),%esi // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103d3f: e8 bc 0a 00 00 call 80104800 <pushcli> c = mycpu(); 80103d44: e8 97 f9 ff ff call 801036e0 <mycpu> p = c->proc; 80103d49: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103d4f: e8 9c 0b 00 00 call 801048f0 <popcli> void sleep(void *chan, struct spinlock *lk) { struct proc *p = myproc(); if(p == 0) 80103d54: 85 db test %ebx,%ebx 80103d56: 0f 84 87 00 00 00 je 80103de3 <sleep+0xb3> panic("sleep"); if(lk == 0) 80103d5c: 85 f6 test %esi,%esi 80103d5e: 74 76 je 80103dd6 <sleep+0xa6> // change p->state and then call sched. // Once we hold ptable.lock, we can be // guaranteed that we won't miss any wakeup // (wakeup runs with ptable.lock locked), // so it's okay to release lk. if(lk != &ptable.lock){ //DOC: sleeplock0 80103d60: 81 fe 20 3d 11 80 cmp $0x80113d20,%esi 80103d66: 74 50 je 80103db8 <sleep+0x88> acquire(&ptable.lock); //DOC: sleeplock1 80103d68: 83 ec 0c sub $0xc,%esp 80103d6b: 68 20 3d 11 80 push $0x80113d20 80103d70: e8 cb 0a 00 00 call 80104840 <acquire> release(lk); 80103d75: 89 34 24 mov %esi,(%esp) 80103d78: e8 e3 0b 00 00 call 80104960 <release> } // Go to sleep. p->chan = chan; 80103d7d: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103d80: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103d87: e8 64 fd ff ff call 80103af0 <sched> // Tidy up. p->chan = 0; 80103d8c: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) // Reacquire original lock. if(lk != &ptable.lock){ //DOC: sleeplock2 release(&ptable.lock); 80103d93: c7 04 24 20 3d 11 80 movl $0x80113d20,(%esp) 80103d9a: e8 c1 0b 00 00 call 80104960 <release> acquire(lk); 80103d9f: 89 75 08 mov %esi,0x8(%ebp) 80103da2: 83 c4 10 add $0x10,%esp } } 80103da5: 8d 65 f4 lea -0xc(%ebp),%esp 80103da8: 5b pop %ebx 80103da9: 5e pop %esi 80103daa: 5f pop %edi 80103dab: 5d pop %ebp p->chan = 0; // Reacquire original lock. if(lk != &ptable.lock){ //DOC: sleeplock2 release(&ptable.lock); acquire(lk); 80103dac: e9 8f 0a 00 00 jmp 80104840 <acquire> 80103db1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(lk != &ptable.lock){ //DOC: sleeplock0 acquire(&ptable.lock); //DOC: sleeplock1 release(lk); } // Go to sleep. p->chan = chan; 80103db8: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103dbb: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103dc2: e8 29 fd ff ff call 80103af0 <sched> // Tidy up. p->chan = 0; 80103dc7: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) // Reacquire original lock. if(lk != &ptable.lock){ //DOC: sleeplock2 release(&ptable.lock); acquire(lk); } } 80103dce: 8d 65 f4 lea -0xc(%ebp),%esp 80103dd1: 5b pop %ebx 80103dd2: 5e pop %esi 80103dd3: 5f pop %edi 80103dd4: 5d pop %ebp 80103dd5: c3 ret if(p == 0) panic("sleep"); if(lk == 0) panic("sleep without lk"); 80103dd6: 83 ec 0c sub $0xc,%esp 80103dd9: 68 8f 7b 10 80 push $0x80107b8f 80103dde: e8 8d c5 ff ff call 80100370 <panic> sleep(void *chan, struct spinlock *lk) { struct proc *p = myproc(); if(p == 0) panic("sleep"); 80103de3: 83 ec 0c sub $0xc,%esp 80103de6: 68 89 7b 10 80 push $0x80107b89 80103deb: e8 80 c5 ff ff call 80100370 <panic> 80103df0 <wait>: // Wait for a child process to exit and return its pid. // Return -1 if this process has no children. int wait(void) { 80103df0: 55 push %ebp 80103df1: 89 e5 mov %esp,%ebp 80103df3: 56 push %esi 80103df4: 53 push %ebx // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103df5: e8 06 0a 00 00 call 80104800 <pushcli> c = mycpu(); 80103dfa: e8 e1 f8 ff ff call 801036e0 <mycpu> p = c->proc; 80103dff: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103e05: e8 e6 0a 00 00 call 801048f0 <popcli> { struct proc *p; int havekids, pid; struct proc *curproc = myproc(); acquire(&ptable.lock); 80103e0a: 83 ec 0c sub $0xc,%esp 80103e0d: 68 20 3d 11 80 push $0x80113d20 80103e12: e8 29 0a 00 00 call 80104840 <acquire> 80103e17: 83 c4 10 add $0x10,%esp for(;;){ // Scan through table looking for exited children. havekids = 0; 80103e1a: 31 c0 xor %eax,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e1c: bb 54 3d 11 80 mov $0x80113d54,%ebx 80103e21: eb 10 jmp 80103e33 <wait+0x43> 80103e23: 90 nop 80103e24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103e28: 83 eb 80 sub $0xffffff80,%ebx 80103e2b: 81 fb 54 5d 11 80 cmp $0x80115d54,%ebx 80103e31: 74 1d je 80103e50 <wait+0x60> if(p->parent != curproc) 80103e33: 39 73 14 cmp %esi,0x14(%ebx) 80103e36: 75 f0 jne 80103e28 <wait+0x38> continue; havekids = 1; if(p->state == ZOMBIE){ 80103e38: 83 7b 0c 05 cmpl $0x5,0xc(%ebx) 80103e3c: 74 30 je 80103e6e <wait+0x7e> acquire(&ptable.lock); for(;;){ // Scan through table looking for exited children. havekids = 0; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e3e: 83 eb 80 sub $0xffffff80,%ebx if(p->parent != curproc) continue; havekids = 1; 80103e41: b8 01 00 00 00 mov $0x1,%eax acquire(&ptable.lock); for(;;){ // Scan through table looking for exited children. havekids = 0; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e46: 81 fb 54 5d 11 80 cmp $0x80115d54,%ebx 80103e4c: 75 e5 jne 80103e33 <wait+0x43> 80103e4e: 66 90 xchg %ax,%ax return pid; } } // No point waiting if we don't have any children. if(!havekids || curproc->killed){ 80103e50: 85 c0 test %eax,%eax 80103e52: 74 70 je 80103ec4 <wait+0xd4> 80103e54: 8b 46 24 mov 0x24(%esi),%eax 80103e57: 85 c0 test %eax,%eax 80103e59: 75 69 jne 80103ec4 <wait+0xd4> release(&ptable.lock); return -1; } // Wait for children to exit. (See wakeup1 call in proc_exit.) sleep(curproc, &ptable.lock); //DOC: wait-sleep 80103e5b: 83 ec 08 sub $0x8,%esp 80103e5e: 68 20 3d 11 80 push $0x80113d20 80103e63: 56 push %esi 80103e64: e8 c7 fe ff ff call 80103d30 <sleep> } 80103e69: 83 c4 10 add $0x10,%esp 80103e6c: eb ac jmp 80103e1a <wait+0x2a> continue; havekids = 1; if(p->state == ZOMBIE){ // Found one. pid = p->pid; kfree(p->kstack); 80103e6e: 83 ec 0c sub $0xc,%esp 80103e71: ff 73 08 pushl 0x8(%ebx) if(p->parent != curproc) continue; havekids = 1; if(p->state == ZOMBIE){ // Found one. pid = p->pid; 80103e74: 8b 73 10 mov 0x10(%ebx),%esi kfree(p->kstack); 80103e77: e8 64 e4 ff ff call 801022e0 <kfree> p->kstack = 0; freevm(p->pgdir); 80103e7c: 5a pop %edx 80103e7d: ff 73 04 pushl 0x4(%ebx) havekids = 1; if(p->state == ZOMBIE){ // Found one. pid = p->pid; kfree(p->kstack); p->kstack = 0; 80103e80: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) freevm(p->pgdir); 80103e87: e8 e4 33 00 00 call 80107270 <freevm> p->pid = 0; 80103e8c: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) p->parent = 0; 80103e93: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) p->name[0] = 0; 80103e9a: c6 43 6c 00 movb $0x0,0x6c(%ebx) p->killed = 0; 80103e9e: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) p->state = UNUSED; 80103ea5: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) release(&ptable.lock); 80103eac: c7 04 24 20 3d 11 80 movl $0x80113d20,(%esp) 80103eb3: e8 a8 0a 00 00 call 80104960 <release> return pid; 80103eb8: 83 c4 10 add $0x10,%esp } // Wait for children to exit. (See wakeup1 call in proc_exit.) sleep(curproc, &ptable.lock); //DOC: wait-sleep } } 80103ebb: 8d 65 f8 lea -0x8(%ebp),%esp p->parent = 0; p->name[0] = 0; p->killed = 0; p->state = UNUSED; release(&ptable.lock); return pid; 80103ebe: 89 f0 mov %esi,%eax } // Wait for children to exit. (See wakeup1 call in proc_exit.) sleep(curproc, &ptable.lock); //DOC: wait-sleep } } 80103ec0: 5b pop %ebx 80103ec1: 5e pop %esi 80103ec2: 5d pop %ebp 80103ec3: c3 ret } } // No point waiting if we don't have any children. if(!havekids || curproc->killed){ release(&ptable.lock); 80103ec4: 83 ec 0c sub $0xc,%esp 80103ec7: 68 20 3d 11 80 push $0x80113d20 80103ecc: e8 8f 0a 00 00 call 80104960 <release> return -1; 80103ed1: 83 c4 10 add $0x10,%esp } // Wait for children to exit. (See wakeup1 call in proc_exit.) sleep(curproc, &ptable.lock); //DOC: wait-sleep } } 80103ed4: 8d 65 f8 lea -0x8(%ebp),%esp } // No point waiting if we don't have any children. if(!havekids || curproc->killed){ release(&ptable.lock); return -1; 80103ed7: b8 ff ff ff ff mov $0xffffffff,%eax } // Wait for children to exit. (See wakeup1 call in proc_exit.) sleep(curproc, &ptable.lock); //DOC: wait-sleep } } 80103edc: 5b pop %ebx 80103edd: 5e pop %esi 80103ede: 5d pop %ebp 80103edf: c3 ret 80103ee0 <wakeup>: } // Wake up all processes sleeping on chan. void wakeup(void *chan) { 80103ee0: 55 push %ebp 80103ee1: 89 e5 mov %esp,%ebp 80103ee3: 53 push %ebx 80103ee4: 83 ec 10 sub $0x10,%esp 80103ee7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ptable.lock); 80103eea: 68 20 3d 11 80 push $0x80113d20 80103eef: e8 4c 09 00 00 call 80104840 <acquire> 80103ef4: 83 c4 10 add $0x10,%esp static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103ef7: b8 54 3d 11 80 mov $0x80113d54,%eax 80103efc: eb 0c jmp 80103f0a <wakeup+0x2a> 80103efe: 66 90 xchg %ax,%ax 80103f00: 83 e8 80 sub $0xffffff80,%eax 80103f03: 3d 54 5d 11 80 cmp $0x80115d54,%eax 80103f08: 74 1c je 80103f26 <wakeup+0x46> if(p->state == SLEEPING && p->chan == chan) 80103f0a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103f0e: 75 f0 jne 80103f00 <wakeup+0x20> 80103f10: 3b 58 20 cmp 0x20(%eax),%ebx 80103f13: 75 eb jne 80103f00 <wakeup+0x20> p->state = RUNNABLE; 80103f15: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103f1c: 83 e8 80 sub $0xffffff80,%eax 80103f1f: 3d 54 5d 11 80 cmp $0x80115d54,%eax 80103f24: 75 e4 jne 80103f0a <wakeup+0x2a> void wakeup(void *chan) { acquire(&ptable.lock); wakeup1(chan); release(&ptable.lock); 80103f26: c7 45 08 20 3d 11 80 movl $0x80113d20,0x8(%ebp) } 80103f2d: 8b 5d fc mov -0x4(%ebp),%ebx 80103f30: c9 leave void wakeup(void *chan) { acquire(&ptable.lock); wakeup1(chan); release(&ptable.lock); 80103f31: e9 2a 0a 00 00 jmp 80104960 <release> 80103f36: 8d 76 00 lea 0x0(%esi),%esi 80103f39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103f40 <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) { 80103f40: 55 push %ebp 80103f41: 89 e5 mov %esp,%ebp 80103f43: 53 push %ebx 80103f44: 83 ec 10 sub $0x10,%esp 80103f47: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *p; acquire(&ptable.lock); 80103f4a: 68 20 3d 11 80 push $0x80113d20 80103f4f: e8 ec 08 00 00 call 80104840 <acquire> 80103f54: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103f57: b8 54 3d 11 80 mov $0x80113d54,%eax 80103f5c: eb 0c jmp 80103f6a <kill+0x2a> 80103f5e: 66 90 xchg %ax,%ax 80103f60: 83 e8 80 sub $0xffffff80,%eax 80103f63: 3d 54 5d 11 80 cmp $0x80115d54,%eax 80103f68: 74 3e je 80103fa8 <kill+0x68> if(p->pid == pid){ 80103f6a: 39 58 10 cmp %ebx,0x10(%eax) 80103f6d: 75 f1 jne 80103f60 <kill+0x20> p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) 80103f6f: 83 78 0c 02 cmpl $0x2,0xc(%eax) struct proc *p; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->pid == pid){ p->killed = 1; 80103f73: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) // Wake process from sleep if necessary. if(p->state == SLEEPING) 80103f7a: 74 1c je 80103f98 <kill+0x58> p->state = RUNNABLE; release(&ptable.lock); 80103f7c: 83 ec 0c sub $0xc,%esp 80103f7f: 68 20 3d 11 80 push $0x80113d20 80103f84: e8 d7 09 00 00 call 80104960 <release> return 0; 80103f89: 83 c4 10 add $0x10,%esp 80103f8c: 31 c0 xor %eax,%eax } } release(&ptable.lock); return -1; } 80103f8e: 8b 5d fc mov -0x4(%ebp),%ebx 80103f91: c9 leave 80103f92: c3 ret 80103f93: 90 nop 80103f94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->pid == pid){ p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) p->state = RUNNABLE; 80103f98: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) 80103f9f: eb db jmp 80103f7c <kill+0x3c> 80103fa1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&ptable.lock); return 0; } } release(&ptable.lock); 80103fa8: 83 ec 0c sub $0xc,%esp 80103fab: 68 20 3d 11 80 push $0x80113d20 80103fb0: e8 ab 09 00 00 call 80104960 <release> return -1; 80103fb5: 83 c4 10 add $0x10,%esp 80103fb8: b8 ff ff ff ff mov $0xffffffff,%eax } 80103fbd: 8b 5d fc mov -0x4(%ebp),%ebx 80103fc0: c9 leave 80103fc1: c3 ret 80103fc2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103fc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103fd0 <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) { 80103fd0: 55 push %ebp 80103fd1: 89 e5 mov %esp,%ebp 80103fd3: 57 push %edi 80103fd4: 56 push %esi 80103fd5: 53 push %ebx 80103fd6: 8d 75 e8 lea -0x18(%ebp),%esi 80103fd9: bb c0 3d 11 80 mov $0x80113dc0,%ebx 80103fde: 83 ec 3c sub $0x3c,%esp 80103fe1: eb 24 jmp 80104007 <procdump+0x37> 80103fe3: 90 nop 80103fe4: 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"); 80103fe8: 83 ec 0c sub $0xc,%esp 80103feb: 68 0b 80 10 80 push $0x8010800b 80103ff0: e8 6b c6 ff ff call 80100660 <cprintf> 80103ff5: 83 c4 10 add $0x10,%esp 80103ff8: 83 eb 80 sub $0xffffff80,%ebx int i; struct proc *p; char *state; uint pc[10]; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103ffb: 81 fb c0 5d 11 80 cmp $0x80115dc0,%ebx 80104001: 0f 84 81 00 00 00 je 80104088 <procdump+0xb8> if(p->state == UNUSED) 80104007: 8b 43 a0 mov -0x60(%ebx),%eax 8010400a: 85 c0 test %eax,%eax 8010400c: 74 ea je 80103ff8 <procdump+0x28> continue; if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 8010400e: 83 f8 05 cmp $0x5,%eax state = states[p->state]; else state = "???"; 80104011: ba a0 7b 10 80 mov $0x80107ba0,%edx uint pc[10]; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->state == UNUSED) continue; if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 80104016: 77 11 ja 80104029 <procdump+0x59> 80104018: 8b 14 85 e8 7c 10 80 mov -0x7fef8318(,%eax,4),%edx state = states[p->state]; else state = "???"; 8010401f: b8 a0 7b 10 80 mov $0x80107ba0,%eax 80104024: 85 d2 test %edx,%edx 80104026: 0f 44 d0 cmove %eax,%edx cprintf("%d %s %s", p->pid, state, p->name); 80104029: 53 push %ebx 8010402a: 52 push %edx 8010402b: ff 73 a4 pushl -0x5c(%ebx) 8010402e: 68 a4 7b 10 80 push $0x80107ba4 80104033: e8 28 c6 ff ff call 80100660 <cprintf> if(p->state == SLEEPING){ 80104038: 83 c4 10 add $0x10,%esp 8010403b: 83 7b a0 02 cmpl $0x2,-0x60(%ebx) 8010403f: 75 a7 jne 80103fe8 <procdump+0x18> getcallerpcs((uint*)p->context->ebp+2, pc); 80104041: 8d 45 c0 lea -0x40(%ebp),%eax 80104044: 83 ec 08 sub $0x8,%esp 80104047: 8d 7d c0 lea -0x40(%ebp),%edi 8010404a: 50 push %eax 8010404b: 8b 43 b0 mov -0x50(%ebx),%eax 8010404e: 8b 40 0c mov 0xc(%eax),%eax 80104051: 83 c0 08 add $0x8,%eax 80104054: 50 push %eax 80104055: e8 06 07 00 00 call 80104760 <getcallerpcs> 8010405a: 83 c4 10 add $0x10,%esp 8010405d: 8d 76 00 lea 0x0(%esi),%esi for(i=0; i<10 && pc[i] != 0; i++) 80104060: 8b 17 mov (%edi),%edx 80104062: 85 d2 test %edx,%edx 80104064: 74 82 je 80103fe8 <procdump+0x18> cprintf(" %p", pc[i]); 80104066: 83 ec 08 sub $0x8,%esp 80104069: 83 c7 04 add $0x4,%edi 8010406c: 52 push %edx 8010406d: 68 e1 75 10 80 push $0x801075e1 80104072: e8 e9 c5 ff ff call 80100660 <cprintf> else state = "???"; cprintf("%d %s %s", p->pid, state, p->name); if(p->state == SLEEPING){ getcallerpcs((uint*)p->context->ebp+2, pc); for(i=0; i<10 && pc[i] != 0; i++) 80104077: 83 c4 10 add $0x10,%esp 8010407a: 39 f7 cmp %esi,%edi 8010407c: 75 e2 jne 80104060 <procdump+0x90> 8010407e: e9 65 ff ff ff jmp 80103fe8 <procdump+0x18> 80104083: 90 nop 80104084: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf(" %p", pc[i]); } cprintf("\n"); } } 80104088: 8d 65 f4 lea -0xc(%ebp),%esp 8010408b: 5b pop %ebx 8010408c: 5e pop %esi 8010408d: 5f pop %edi 8010408e: 5d pop %ebp 8010408f: c3 ret 80104090 <cond_init>: // LAB QUIZ 4 void cond_init(int *cv, int val) { 80104090: 55 push %ebp 80104091: 89 e5 mov %esp,%ebp *cv = val; 80104093: 8b 55 0c mov 0xc(%ebp),%edx 80104096: 8b 45 08 mov 0x8(%ebp),%eax 80104099: 89 10 mov %edx,(%eax) } 8010409b: 5d pop %ebp 8010409c: c3 ret 8010409d: 8d 76 00 lea 0x0(%esi),%esi 801040a0 <cond_wait>: void cond_wait(int *cv, struct spinlock *lock, int val) { 801040a0: 55 push %ebp 801040a1: 89 e5 mov %esp,%ebp sleep((void *) val, lock); 801040a3: 8b 45 10 mov 0x10(%ebp),%eax 801040a6: 89 45 08 mov %eax,0x8(%ebp) } 801040a9: 5d pop %ebp void cond_init(int *cv, int val) { *cv = val; } void cond_wait(int *cv, struct spinlock *lock, int val) { sleep((void *) val, lock); 801040aa: e9 81 fc ff ff jmp 80103d30 <sleep> 801040af: 90 nop 801040b0 <cond_signal>: } void cond_signal(int *cv, int val) { 801040b0: 55 push %ebp static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801040b1: b8 54 3d 11 80 mov $0x80113d54,%eax void cond_wait(int *cv, struct spinlock *lock, int val) { sleep((void *) val, lock); } void cond_signal(int *cv, int val) { 801040b6: 89 e5 mov %esp,%ebp 801040b8: 8b 55 0c mov 0xc(%ebp),%edx 801040bb: eb 0d jmp 801040ca <cond_signal+0x1a> 801040bd: 8d 76 00 lea 0x0(%esi),%esi static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801040c0: 83 e8 80 sub $0xffffff80,%eax 801040c3: 3d 54 5d 11 80 cmp $0x80115d54,%eax 801040c8: 74 1c je 801040e6 <cond_signal+0x36> if(p->state == SLEEPING && p->chan == chan) 801040ca: 83 78 0c 02 cmpl $0x2,0xc(%eax) 801040ce: 75 f0 jne 801040c0 <cond_signal+0x10> 801040d0: 3b 50 20 cmp 0x20(%eax),%edx 801040d3: 75 eb jne 801040c0 <cond_signal+0x10> p->state = RUNNABLE; 801040d5: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801040dc: 83 e8 80 sub $0xffffff80,%eax 801040df: 3d 54 5d 11 80 cmp $0x80115d54,%eax 801040e4: 75 e4 jne 801040ca <cond_signal+0x1a> sleep((void *) val, lock); } void cond_signal(int *cv, int val) { wakeup1((void *) val); } 801040e6: 5d pop %ebp 801040e7: c3 ret 801040e8: 90 nop 801040e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801040f0 <help_init_taskmaster>: int help_init_taskmaster(void) { 801040f0: 55 push %ebp 801040f1: 89 e5 mov %esp,%ebp 801040f3: 83 ec 10 sub $0x10,%esp initlock(&taskmaster.lock, "temp"); 801040f6: 68 ad 7b 10 80 push $0x80107bad 801040fb: 68 68 5d 11 80 push $0x80115d68 80104100: e8 3b 06 00 00 call 80104740 <initlock> cond_init(&taskmaster.cv1, -2); cond_init(&taskmaster.cv2, -2); acquire(&taskmaster.lock); 80104105: c7 04 24 68 5d 11 80 movl $0x80115d68,(%esp) } // LAB QUIZ 4 void cond_init(int *cv, int val) { *cv = val; 8010410c: c7 05 60 5d 11 80 fe movl $0xfffffffe,0x80115d60 80104113: ff ff ff 80104116: c7 05 64 5d 11 80 fe movl $0xfffffffe,0x80115d64 8010411d: ff ff ff int help_init_taskmaster(void) { initlock(&taskmaster.lock, "temp"); cond_init(&taskmaster.cv1, -2); cond_init(&taskmaster.cv2, -2); acquire(&taskmaster.lock); 80104120: e8 1b 07 00 00 call 80104840 <acquire> 80104125: b8 9c 5d 11 80 mov $0x80115d9c,%eax 8010412a: 83 c4 10 add $0x10,%esp 8010412d: 8d 76 00 lea 0x0(%esi),%esi for (int i=0; i<MAX_TASKS; i++) { taskmaster.tasks[i].status = FREE; 80104130: c7 00 00 00 00 00 movl $0x0,(%eax) 80104136: 83 c0 18 add $0x18,%eax initlock(&taskmaster.lock, "temp"); cond_init(&taskmaster.cv1, -2); cond_init(&taskmaster.cv2, -2); acquire(&taskmaster.lock); for (int i=0; i<MAX_TASKS; i++) { 80104139: 3d fc 66 11 80 cmp $0x801166fc,%eax 8010413e: 75 f0 jne 80104130 <help_init_taskmaster+0x40> taskmaster.tasks[i].status = FREE; } release(&taskmaster.lock); 80104140: 83 ec 0c sub $0xc,%esp 80104143: 68 68 5d 11 80 push $0x80115d68 80104148: e8 13 08 00 00 call 80104960 <release> return 1; } 8010414d: b8 01 00 00 00 mov $0x1,%eax 80104152: c9 leave 80104153: c3 ret 80104154: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010415a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104160 <help_do_task>: int help_do_task(char *fptr, int task_id, int arg1, int arg2) { 80104160: 55 push %ebp 80104161: 89 e5 mov %esp,%ebp 80104163: 53 push %ebx 80104164: 83 ec 10 sub $0x10,%esp 80104167: 8b 5d 0c mov 0xc(%ebp),%ebx acquire(&taskmaster.lock); 8010416a: 68 68 5d 11 80 push $0x80115d68 8010416f: e8 cc 06 00 00 call 80104840 <acquire> 80104174: b8 9c 5d 11 80 mov $0x80115d9c,%eax 80104179: 83 c4 10 add $0x10,%esp int free_task_index = -1; struct task_t *task; for (int i=0; i<MAX_TASKS; i++) { 8010417c: 31 d2 xor %edx,%edx } int help_do_task(char *fptr, int task_id, int arg1, int arg2) { acquire(&taskmaster.lock); int free_task_index = -1; 8010417e: b9 ff ff ff ff mov $0xffffffff,%ecx 80104183: eb 14 jmp 80104199 <help_do_task+0x39> 80104185: 8d 76 00 lea 0x0(%esi),%esi struct task_t *task; for (int i=0; i<MAX_TASKS; i++) { task = &taskmaster.tasks[i]; if (task->status == FREE) { if (free_task_index == -1) free_task_index = i; 80104188: 83 f9 ff cmp $0xffffffff,%ecx 8010418b: 0f 44 ca cmove %edx,%ecx acquire(&taskmaster.lock); int free_task_index = -1; struct task_t *task; for (int i=0; i<MAX_TASKS; i++) { 8010418e: 83 c2 01 add $0x1,%edx 80104191: 83 c0 18 add $0x18,%eax 80104194: 83 fa 64 cmp $0x64,%edx 80104197: 74 37 je 801041d0 <help_do_task+0x70> task = &taskmaster.tasks[i]; if (task->status == FREE) { 80104199: 83 38 00 cmpl $0x0,(%eax) 8010419c: 74 ea je 80104188 <help_do_task+0x28> if (free_task_index == -1) free_task_index = i; } else if (task->task_id == task_id) { 8010419e: 39 58 04 cmp %ebx,0x4(%eax) 801041a1: 75 eb jne 8010418e <help_do_task+0x2e> cprintf("[ERROR][do_task] task with id %d is already being used for work\n", task_id); 801041a3: 83 ec 08 sub $0x8,%esp 801041a6: 53 push %ebx 801041a7: 68 04 7c 10 80 push $0x80107c04 release(&taskmaster.lock); return -1; } } if (free_task_index == -1) { cprintf("[ERROR][do_task] task array is full\n"); 801041ac: e8 af c4 ff ff call 80100660 <cprintf> release(&taskmaster.lock); 801041b1: c7 04 24 68 5d 11 80 movl $0x80115d68,(%esp) 801041b8: e8 a3 07 00 00 call 80104960 <release> return -1; 801041bd: 83 c4 10 add $0x10,%esp 801041c0: b8 ff ff ff ff mov $0xffffffff,%eax cond_signal(&taskmaster.cv2, -1); release(&taskmaster.lock); return 1; } 801041c5: 8b 5d fc mov -0x4(%ebp),%ebx 801041c8: c9 leave 801041c9: c3 ret 801041ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi cprintf("[ERROR][do_task] task with id %d is already being used for work\n", task_id); release(&taskmaster.lock); return -1; } } if (free_task_index == -1) { 801041d0: 83 f9 ff cmp $0xffffffff,%ecx 801041d3: 74 74 je 80104249 <help_do_task+0xe9> release(&taskmaster.lock); return -1; } task = &taskmaster.tasks[free_task_index]; task->status = PENDING; 801041d5: 8d 04 49 lea (%ecx,%ecx,2),%eax task->task_id = task_id; task->arg1 = arg1; 801041d8: 8b 55 10 mov 0x10(%ebp),%edx release(&taskmaster.lock); return -1; } task = &taskmaster.tasks[free_task_index]; task->status = PENDING; 801041db: 8d 04 c5 60 5d 11 80 lea -0x7feea2a0(,%eax,8),%eax task->task_id = task_id; task->arg1 = arg1; 801041e2: 89 50 44 mov %edx,0x44(%eax) task->arg2 = arg2; 801041e5: 8b 55 14 mov 0x14(%ebp),%edx release(&taskmaster.lock); return -1; } task = &taskmaster.tasks[free_task_index]; task->status = PENDING; 801041e8: c7 40 3c 01 00 00 00 movl $0x1,0x3c(%eax) task->task_id = task_id; 801041ef: 89 58 40 mov %ebx,0x40(%eax) task->arg1 = arg1; task->arg2 = arg2; 801041f2: 89 50 48 mov %edx,0x48(%eax) task->fptr = fptr; 801041f5: 8b 55 08 mov 0x8(%ebp),%edx 801041f8: 89 50 50 mov %edx,0x50(%eax) static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801041fb: b8 54 3d 11 80 mov $0x80113d54,%eax 80104200: eb 10 jmp 80104212 <help_do_task+0xb2> 80104202: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104208: 83 e8 80 sub $0xffffff80,%eax 8010420b: 3d 54 5d 11 80 cmp $0x80115d54,%eax 80104210: 74 1d je 8010422f <help_do_task+0xcf> if(p->state == SLEEPING && p->chan == chan) 80104212: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80104216: 75 f0 jne 80104208 <help_do_task+0xa8> 80104218: 83 78 20 ff cmpl $0xffffffff,0x20(%eax) 8010421c: 75 ea jne 80104208 <help_do_task+0xa8> p->state = RUNNABLE; 8010421e: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80104225: 83 e8 80 sub $0xffffff80,%eax 80104228: 3d 54 5d 11 80 cmp $0x80115d54,%eax 8010422d: 75 e3 jne 80104212 <help_do_task+0xb2> task->arg2 = arg2; task->fptr = fptr; cond_signal(&taskmaster.cv2, -1); release(&taskmaster.lock); 8010422f: 83 ec 0c sub $0xc,%esp 80104232: 68 68 5d 11 80 push $0x80115d68 80104237: e8 24 07 00 00 call 80104960 <release> return 1; 8010423c: 83 c4 10 add $0x10,%esp 8010423f: b8 01 00 00 00 mov $0x1,%eax } 80104244: 8b 5d fc mov -0x4(%ebp),%ebx 80104247: c9 leave 80104248: c3 ret release(&taskmaster.lock); return -1; } } if (free_task_index == -1) { cprintf("[ERROR][do_task] task array is full\n"); 80104249: 83 ec 0c sub $0xc,%esp 8010424c: 68 48 7c 10 80 push $0x80107c48 80104251: e9 56 ff ff ff jmp 801041ac <help_do_task+0x4c> 80104256: 8d 76 00 lea 0x0(%esi),%esi 80104259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104260 <help_wait_for_task_to_complete>: release(&taskmaster.lock); return 1; } int help_wait_for_task_to_complete(int task_id, int *result) { 80104260: 55 push %ebp 80104261: 89 e5 mov %esp,%ebp 80104263: 57 push %edi 80104264: 56 push %esi 80104265: 53 push %ebx acquire(&taskmaster.lock); int task_index = -1; struct task_t *task; for (int i=0; i<MAX_TASKS; i++) { 80104266: 31 db xor %ebx,%ebx release(&taskmaster.lock); return 1; } int help_wait_for_task_to_complete(int task_id, int *result) { 80104268: 83 ec 18 sub $0x18,%esp 8010426b: 8b 7d 08 mov 0x8(%ebp),%edi acquire(&taskmaster.lock); 8010426e: 68 68 5d 11 80 push $0x80115d68 80104273: e8 c8 05 00 00 call 80104840 <acquire> 80104278: b8 9c 5d 11 80 mov $0x80115d9c,%eax 8010427d: 83 c4 10 add $0x10,%esp 80104280: eb 11 jmp 80104293 <help_wait_for_task_to_complete+0x33> 80104282: 8d b6 00 00 00 00 lea 0x0(%esi),%esi int task_index = -1; struct task_t *task; for (int i=0; i<MAX_TASKS; i++) { 80104288: 83 c3 01 add $0x1,%ebx 8010428b: 83 c0 18 add $0x18,%eax 8010428e: 83 fb 64 cmp $0x64,%ebx 80104291: 74 6d je 80104300 <help_wait_for_task_to_complete+0xa0> task = &taskmaster.tasks[i]; if (task->status != FREE && task->task_id == task_id) { 80104293: 8b 10 mov (%eax),%edx 80104295: 85 d2 test %edx,%edx 80104297: 74 ef je 80104288 <help_wait_for_task_to_complete+0x28> 80104299: 39 78 04 cmp %edi,0x4(%eax) 8010429c: 75 ea jne 80104288 <help_wait_for_task_to_complete+0x28> release(&taskmaster.lock); return -1; } task = &taskmaster.tasks[task_index]; while (task->status != COMPLETED) { 8010429e: 8d 04 5b lea (%ebx,%ebx,2),%eax 801042a1: 83 fa 03 cmp $0x3,%edx 801042a4: 8d 34 c5 60 5d 11 80 lea -0x7feea2a0(,%eax,8),%esi 801042ab: 74 1a je 801042c7 <help_wait_for_task_to_complete+0x67> 801042ad: 8d 76 00 lea 0x0(%esi),%esi void cond_init(int *cv, int val) { *cv = val; } void cond_wait(int *cv, struct spinlock *lock, int val) { sleep((void *) val, lock); 801042b0: 83 ec 08 sub $0x8,%esp 801042b3: 68 68 5d 11 80 push $0x80115d68 801042b8: 57 push %edi 801042b9: e8 72 fa ff ff call 80103d30 <sleep> release(&taskmaster.lock); return -1; } task = &taskmaster.tasks[task_index]; while (task->status != COMPLETED) { 801042be: 83 c4 10 add $0x10,%esp 801042c1: 83 7e 3c 03 cmpl $0x3,0x3c(%esi) 801042c5: 75 e9 jne 801042b0 <help_wait_for_task_to_complete+0x50> cond_wait(&taskmaster.cv1, &taskmaster.lock, task_id); } *result = task->result; 801042c7: 8d 04 5b lea (%ebx,%ebx,2),%eax 801042ca: 8b 55 0c mov 0xc(%ebp),%edx task->status = FREE; release(&taskmaster.lock); 801042cd: 83 ec 0c sub $0xc,%esp while (task->status != COMPLETED) { cond_wait(&taskmaster.cv1, &taskmaster.lock, task_id); } *result = task->result; 801042d0: 8d 04 c5 60 5d 11 80 lea -0x7feea2a0(,%eax,8),%eax 801042d7: 8b 48 4c mov 0x4c(%eax),%ecx 801042da: 89 0a mov %ecx,(%edx) task->status = FREE; 801042dc: c7 40 3c 00 00 00 00 movl $0x0,0x3c(%eax) release(&taskmaster.lock); 801042e3: 68 68 5d 11 80 push $0x80115d68 801042e8: e8 73 06 00 00 call 80104960 <release> return 1; 801042ed: 83 c4 10 add $0x10,%esp } 801042f0: 8d 65 f4 lea -0xc(%ebp),%esp *result = task->result; task->status = FREE; release(&taskmaster.lock); return 1; 801042f3: b8 01 00 00 00 mov $0x1,%eax } 801042f8: 5b pop %ebx 801042f9: 5e pop %esi 801042fa: 5f pop %edi 801042fb: 5d pop %ebp 801042fc: c3 ret 801042fd: 8d 76 00 lea 0x0(%esi),%esi task_index = i; break; } } if (task_index == -1) { cprintf("[ERROR][wait_for_task_to_complete] task with id %d does not exist\n", task_id); 80104300: 83 ec 08 sub $0x8,%esp 80104303: 57 push %edi 80104304: 68 70 7c 10 80 push $0x80107c70 80104309: e8 52 c3 ff ff call 80100660 <cprintf> release(&taskmaster.lock); 8010430e: c7 04 24 68 5d 11 80 movl $0x80115d68,(%esp) 80104315: e8 46 06 00 00 call 80104960 <release> return -1; 8010431a: 83 c4 10 add $0x10,%esp *result = task->result; task->status = FREE; release(&taskmaster.lock); return 1; } 8010431d: 8d 65 f4 lea -0xc(%ebp),%esp } } if (task_index == -1) { cprintf("[ERROR][wait_for_task_to_complete] task with id %d does not exist\n", task_id); release(&taskmaster.lock); return -1; 80104320: b8 ff ff ff ff mov $0xffffffff,%eax *result = task->result; task->status = FREE; release(&taskmaster.lock); return 1; } 80104325: 5b pop %ebx 80104326: 5e pop %esi 80104327: 5f pop %edi 80104328: 5d pop %ebp 80104329: c3 ret 8010432a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104330 <help_wait_for_task>: int help_wait_for_task(void) { 80104330: 55 push %ebp 80104331: 89 e5 mov %esp,%ebp 80104333: 57 push %edi 80104334: 56 push %esi 80104335: 53 push %ebx 80104336: 83 ec 18 sub $0x18,%esp acquire(&taskmaster.lock); 80104339: 68 68 5d 11 80 push $0x80115d68 8010433e: e8 fd 04 00 00 call 80104840 <acquire> 80104343: 83 c4 10 add $0x10,%esp 80104346: 8d 76 00 lea 0x0(%esi),%esi 80104349: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104350: ba 9c 5d 11 80 mov $0x80115d9c,%edx int pending_task_index = -1; struct task_t *task; while (1) { for (int i=0; i<MAX_TASKS; i++) { 80104355: 31 c0 xor %eax,%eax 80104357: eb 16 jmp 8010436f <help_wait_for_task+0x3f> 80104359: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104360: 83 c0 01 add $0x1,%eax 80104363: 83 c2 18 add $0x18,%edx 80104366: 83 f8 64 cmp $0x64,%eax 80104369: 0f 84 79 01 00 00 je 801044e8 <help_wait_for_task+0x1b8> task = &taskmaster.tasks[i]; if (task->status == PENDING) { 8010436f: 83 3a 01 cmpl $0x1,(%edx) 80104372: 75 ec jne 80104360 <help_wait_for_task+0x30> pending_task_index = i; task->status = ALLOCATED; 80104374: 8d 04 40 lea (%eax,%eax,2),%eax else break; } task = &taskmaster.tasks[pending_task_index]; release(&taskmaster.lock); 80104377: 83 ec 0c sub $0xc,%esp while (1) { for (int i=0; i<MAX_TASKS; i++) { task = &taskmaster.tasks[i]; if (task->status == PENDING) { pending_task_index = i; task->status = ALLOCATED; 8010437a: 8d 1c c5 60 5d 11 80 lea -0x7feea2a0(,%eax,8),%ebx 80104381: c7 43 3c 02 00 00 00 movl $0x2,0x3c(%ebx) else break; } task = &taskmaster.tasks[pending_task_index]; release(&taskmaster.lock); 80104388: 68 68 5d 11 80 push $0x80115d68 8010438d: e8 ce 05 00 00 call 80104960 <release> // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80104392: e8 69 04 00 00 call 80104800 <pushcli> c = mycpu(); 80104397: e8 44 f3 ff ff call 801036e0 <mycpu> p = c->proc; 8010439c: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 801043a2: e8 49 05 00 00 call 801048f0 <popcli> task = &taskmaster.tasks[pending_task_index]; release(&taskmaster.lock); myproc()->original_tf = (struct trapframe *) kalloc(); 801043a7: e8 e4 e0 ff ff call 80102490 <kalloc> 801043ac: 89 46 7c mov %eax,0x7c(%esi) // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 801043af: e8 4c 04 00 00 call 80104800 <pushcli> c = mycpu(); 801043b4: e8 27 f3 ff ff call 801036e0 <mycpu> p = c->proc; 801043b9: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 801043bf: e8 2c 05 00 00 call 801048f0 <popcli> task = &taskmaster.tasks[pending_task_index]; release(&taskmaster.lock); myproc()->original_tf = (struct trapframe *) kalloc(); *(myproc()->original_tf) = *(myproc()->tf); 801043c4: 8b 7e 7c mov 0x7c(%esi),%edi // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 801043c7: e8 34 04 00 00 call 80104800 <pushcli> c = mycpu(); 801043cc: e8 0f f3 ff ff call 801036e0 <mycpu> p = c->proc; 801043d1: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 801043d7: e8 14 05 00 00 call 801048f0 <popcli> task = &taskmaster.tasks[pending_task_index]; release(&taskmaster.lock); myproc()->original_tf = (struct trapframe *) kalloc(); *(myproc()->original_tf) = *(myproc()->tf); 801043dc: b9 13 00 00 00 mov $0x13,%ecx 801043e1: 8b 76 18 mov 0x18(%esi),%esi 801043e4: f3 a5 rep movsl %ds:(%esi),%es:(%edi) // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 801043e6: e8 15 04 00 00 call 80104800 <pushcli> c = mycpu(); 801043eb: e8 f0 f2 ff ff call 801036e0 <mycpu> p = c->proc; 801043f0: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 801043f6: e8 f5 04 00 00 call 801048f0 <popcli> release(&taskmaster.lock); myproc()->original_tf = (struct trapframe *) kalloc(); *(myproc()->original_tf) = *(myproc()->tf); myproc()->tf->eip = (int) task->fptr; 801043fb: 8b 53 50 mov 0x50(%ebx),%edx 801043fe: 8b 46 18 mov 0x18(%esi),%eax 80104401: 89 50 38 mov %edx,0x38(%eax) // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80104404: e8 f7 03 00 00 call 80104800 <pushcli> c = mycpu(); 80104409: e8 d2 f2 ff ff call 801036e0 <mycpu> p = c->proc; 8010440e: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80104414: e8 d7 04 00 00 call 801048f0 <popcli> release(&taskmaster.lock); myproc()->original_tf = (struct trapframe *) kalloc(); *(myproc()->original_tf) = *(myproc()->tf); myproc()->tf->eip = (int) task->fptr; myproc()->tf->esp -= 4; 80104419: 8b 46 18 mov 0x18(%esi),%eax 8010441c: 83 68 44 04 subl $0x4,0x44(%eax) // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80104420: e8 db 03 00 00 call 80104800 <pushcli> c = mycpu(); 80104425: e8 b6 f2 ff ff call 801036e0 <mycpu> p = c->proc; 8010442a: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80104430: e8 bb 04 00 00 call 801048f0 <popcli> myproc()->original_tf = (struct trapframe *) kalloc(); *(myproc()->original_tf) = *(myproc()->tf); myproc()->tf->eip = (int) task->fptr; myproc()->tf->esp -= 4; *((int *) myproc()->tf->esp) = task->arg2; 80104435: 8b 53 48 mov 0x48(%ebx),%edx 80104438: 8b 46 18 mov 0x18(%esi),%eax 8010443b: 8b 40 44 mov 0x44(%eax),%eax 8010443e: 89 10 mov %edx,(%eax) // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80104440: e8 bb 03 00 00 call 80104800 <pushcli> c = mycpu(); 80104445: e8 96 f2 ff ff call 801036e0 <mycpu> p = c->proc; 8010444a: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80104450: e8 9b 04 00 00 call 801048f0 <popcli> myproc()->original_tf = (struct trapframe *) kalloc(); *(myproc()->original_tf) = *(myproc()->tf); myproc()->tf->eip = (int) task->fptr; myproc()->tf->esp -= 4; *((int *) myproc()->tf->esp) = task->arg2; myproc()->tf->esp -= 4; 80104455: 8b 46 18 mov 0x18(%esi),%eax 80104458: 83 68 44 04 subl $0x4,0x44(%eax) // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 8010445c: e8 9f 03 00 00 call 80104800 <pushcli> c = mycpu(); 80104461: e8 7a f2 ff ff call 801036e0 <mycpu> p = c->proc; 80104466: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 8010446c: e8 7f 04 00 00 call 801048f0 <popcli> *(myproc()->original_tf) = *(myproc()->tf); myproc()->tf->eip = (int) task->fptr; myproc()->tf->esp -= 4; *((int *) myproc()->tf->esp) = task->arg2; myproc()->tf->esp -= 4; *((int *) myproc()->tf->esp) = task->arg1; 80104471: 8b 53 44 mov 0x44(%ebx),%edx 80104474: 8b 46 18 mov 0x18(%esi),%eax 80104477: 8b 40 44 mov 0x44(%eax),%eax 8010447a: 89 10 mov %edx,(%eax) // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 8010447c: e8 7f 03 00 00 call 80104800 <pushcli> c = mycpu(); 80104481: e8 5a f2 ff ff call 801036e0 <mycpu> p = c->proc; 80104486: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 8010448c: e8 5f 04 00 00 call 801048f0 <popcli> myproc()->tf->eip = (int) task->fptr; myproc()->tf->esp -= 4; *((int *) myproc()->tf->esp) = task->arg2; myproc()->tf->esp -= 4; *((int *) myproc()->tf->esp) = task->arg1; myproc()->tf->esp -= 4; 80104491: 8b 46 18 mov 0x18(%esi),%eax 80104494: 83 68 44 04 subl $0x4,0x44(%eax) // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80104498: e8 63 03 00 00 call 80104800 <pushcli> c = mycpu(); 8010449d: e8 3e f2 ff ff call 801036e0 <mycpu> p = c->proc; 801044a2: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 801044a8: e8 43 04 00 00 call 801048f0 <popcli> myproc()->tf->esp -= 4; *((int *) myproc()->tf->esp) = task->arg2; myproc()->tf->esp -= 4; *((int *) myproc()->tf->esp) = task->arg1; myproc()->tf->esp -= 4; *((int *) myproc()->tf->esp) = task->task_id; 801044ad: 8b 53 40 mov 0x40(%ebx),%edx 801044b0: 8b 46 18 mov 0x18(%esi),%eax 801044b3: 8b 40 44 mov 0x44(%eax),%eax 801044b6: 89 10 mov %edx,(%eax) // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 801044b8: e8 43 03 00 00 call 80104800 <pushcli> c = mycpu(); 801044bd: e8 1e f2 ff ff call 801036e0 <mycpu> p = c->proc; 801044c2: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 801044c8: e8 23 04 00 00 call 801048f0 <popcli> *((int *) myproc()->tf->esp) = task->arg2; myproc()->tf->esp -= 4; *((int *) myproc()->tf->esp) = task->arg1; myproc()->tf->esp -= 4; *((int *) myproc()->tf->esp) = task->task_id; myproc()->tf->esp -= 4; 801044cd: 8b 43 18 mov 0x18(%ebx),%eax 801044d0: 83 68 44 04 subl $0x4,0x44(%eax) return 1; } 801044d4: 8d 65 f4 lea -0xc(%ebp),%esp 801044d7: b8 01 00 00 00 mov $0x1,%eax 801044dc: 5b pop %ebx 801044dd: 5e pop %esi 801044de: 5f pop %edi 801044df: 5d pop %ebp 801044e0: c3 ret 801044e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi void cond_init(int *cv, int val) { *cv = val; } void cond_wait(int *cv, struct spinlock *lock, int val) { sleep((void *) val, lock); 801044e8: 83 ec 08 sub $0x8,%esp 801044eb: 68 68 5d 11 80 push $0x80115d68 801044f0: 6a ff push $0xffffffff 801044f2: e8 39 f8 ff ff call 80103d30 <sleep> 801044f7: 83 c4 10 add $0x10,%esp 801044fa: e9 51 fe ff ff jmp 80104350 <help_wait_for_task+0x20> 801044ff: 90 nop 80104500 <help_task_ret>: myproc()->tf->esp -= 4; return 1; } int help_task_ret(int task_id, int result) { 80104500: 55 push %ebp 80104501: 89 e5 mov %esp,%ebp 80104503: 57 push %edi 80104504: 56 push %esi 80104505: 53 push %ebx 80104506: 83 ec 0c sub $0xc,%esp 80104509: 8b 5d 08 mov 0x8(%ebp),%ebx // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 8010450c: e8 ef 02 00 00 call 80104800 <pushcli> c = mycpu(); 80104511: e8 ca f1 ff ff call 801036e0 <mycpu> p = c->proc; 80104516: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 8010451c: e8 cf 03 00 00 call 801048f0 <popcli> return 1; } int help_task_ret(int task_id, int result) { *(myproc()->tf) = *(myproc()->original_tf); 80104521: 8b 7e 18 mov 0x18(%esi),%edi // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80104524: e8 d7 02 00 00 call 80104800 <pushcli> c = mycpu(); 80104529: e8 b2 f1 ff ff call 801036e0 <mycpu> p = c->proc; 8010452e: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80104534: e8 b7 03 00 00 call 801048f0 <popcli> return 1; } int help_task_ret(int task_id, int result) { *(myproc()->tf) = *(myproc()->original_tf); 80104539: b9 13 00 00 00 mov $0x13,%ecx 8010453e: 8b 76 7c mov 0x7c(%esi),%esi 80104541: f3 a5 rep movsl %ds:(%esi),%es:(%edi) // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80104543: e8 b8 02 00 00 call 80104800 <pushcli> c = mycpu(); 80104548: e8 93 f1 ff ff call 801036e0 <mycpu> p = c->proc; 8010454d: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80104553: e8 98 03 00 00 call 801048f0 <popcli> return 1; } int help_task_ret(int task_id, int result) { *(myproc()->tf) = *(myproc()->original_tf); kfree((char *) myproc()->original_tf); 80104558: 83 ec 0c sub $0xc,%esp 8010455b: ff 76 7c pushl 0x7c(%esi) 8010455e: e8 7d dd ff ff call 801022e0 <kfree> acquire(&taskmaster.lock); 80104563: c7 04 24 68 5d 11 80 movl $0x80115d68,(%esp) 8010456a: e8 d1 02 00 00 call 80104840 <acquire> 8010456f: ba 9c 5d 11 80 mov $0x80115d9c,%edx 80104574: 83 c4 10 add $0x10,%esp int task_index = -1; struct task_t *task; for (int i=0; i<MAX_TASKS; i++) { 80104577: 31 c9 xor %ecx,%ecx 80104579: eb 10 jmp 8010458b <help_task_ret+0x8b> 8010457b: 90 nop 8010457c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104580: 83 c1 01 add $0x1,%ecx 80104583: 83 c2 18 add $0x18,%edx 80104586: 83 f9 64 cmp $0x64,%ecx 80104589: 74 77 je 80104602 <help_task_ret+0x102> task = &taskmaster.tasks[i]; if (task->status != FREE && task->task_id == task_id) { 8010458b: 8b 02 mov (%edx),%eax 8010458d: 85 c0 test %eax,%eax 8010458f: 74 ef je 80104580 <help_task_ret+0x80> 80104591: 8b 72 04 mov 0x4(%edx),%esi 80104594: 39 de cmp %ebx,%esi 80104596: 75 e8 jne 80104580 <help_task_ret+0x80> release(&taskmaster.lock); return -1; } task = &taskmaster.tasks[task_index]; task->result = result; 80104598: 8d 04 49 lea (%ecx,%ecx,2),%eax 8010459b: 8b 55 0c mov 0xc(%ebp),%edx 8010459e: 8d 04 c5 60 5d 11 80 lea -0x7feea2a0(,%eax,8),%eax 801045a5: 89 50 4c mov %edx,0x4c(%eax) task->status = COMPLETED; 801045a8: c7 40 3c 03 00 00 00 movl $0x3,0x3c(%eax) static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801045af: ba 54 3d 11 80 mov $0x80113d54,%edx 801045b4: eb 15 jmp 801045cb <help_task_ret+0xcb> 801045b6: 8d 76 00 lea 0x0(%esi),%esi 801045b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801045c0: 83 ea 80 sub $0xffffff80,%edx 801045c3: 81 fa 54 5d 11 80 cmp $0x80115d54,%edx 801045c9: 74 1d je 801045e8 <help_task_ret+0xe8> if(p->state == SLEEPING && p->chan == chan) 801045cb: 83 7a 0c 02 cmpl $0x2,0xc(%edx) 801045cf: 75 ef jne 801045c0 <help_task_ret+0xc0> 801045d1: 3b 5a 20 cmp 0x20(%edx),%ebx 801045d4: 75 ea jne 801045c0 <help_task_ret+0xc0> p->state = RUNNABLE; 801045d6: c7 42 0c 03 00 00 00 movl $0x3,0xc(%edx) static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801045dd: 83 ea 80 sub $0xffffff80,%edx 801045e0: 81 fa 54 5d 11 80 cmp $0x80115d54,%edx 801045e6: 75 e3 jne 801045cb <help_task_ret+0xcb> task->result = result; task->status = COMPLETED; cond_signal(&taskmaster.cv1, task_id); release(&taskmaster.lock); 801045e8: 83 ec 0c sub $0xc,%esp 801045eb: 68 68 5d 11 80 push $0x80115d68 801045f0: e8 6b 03 00 00 call 80104960 <release> return task_id; 801045f5: 83 c4 10 add $0x10,%esp } 801045f8: 8d 65 f4 lea -0xc(%ebp),%esp 801045fb: 89 f0 mov %esi,%eax 801045fd: 5b pop %ebx 801045fe: 5e pop %esi 801045ff: 5f pop %edi 80104600: 5d pop %ebp 80104601: c3 ret break; } } if (task_index == -1) { // this should not happen logically, but a check does no bad. cprintf("[ERROR][task_ret] task with id %d does not exist\n", task_id); 80104602: 83 ec 08 sub $0x8,%esp release(&taskmaster.lock); return -1; 80104605: be ff ff ff ff mov $0xffffffff,%esi break; } } if (task_index == -1) { // this should not happen logically, but a check does no bad. cprintf("[ERROR][task_ret] task with id %d does not exist\n", task_id); 8010460a: 53 push %ebx 8010460b: 68 b4 7c 10 80 push $0x80107cb4 80104610: e8 4b c0 ff ff call 80100660 <cprintf> release(&taskmaster.lock); 80104615: c7 04 24 68 5d 11 80 movl $0x80115d68,(%esp) 8010461c: e8 3f 03 00 00 call 80104960 <release> return -1; 80104621: 83 c4 10 add $0x10,%esp cond_signal(&taskmaster.cv1, task_id); release(&taskmaster.lock); return task_id; } 80104624: 8d 65 f4 lea -0xc(%ebp),%esp 80104627: 89 f0 mov %esi,%eax 80104629: 5b pop %ebx 8010462a: 5e pop %esi 8010462b: 5f pop %edi 8010462c: 5d pop %ebp 8010462d: c3 ret 8010462e: 66 90 xchg %ax,%ax 80104630 <initsleeplock>: #include "spinlock.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 80104630: 55 push %ebp 80104631: 89 e5 mov %esp,%ebp 80104633: 53 push %ebx 80104634: 83 ec 0c sub $0xc,%esp 80104637: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&lk->lk, "sleep lock"); 8010463a: 68 00 7d 10 80 push $0x80107d00 8010463f: 8d 43 04 lea 0x4(%ebx),%eax 80104642: 50 push %eax 80104643: e8 f8 00 00 00 call 80104740 <initlock> lk->name = name; 80104648: 8b 45 0c mov 0xc(%ebp),%eax lk->locked = 0; 8010464b: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; } 80104651: 83 c4 10 add $0x10,%esp initsleeplock(struct sleeplock *lk, char *name) { initlock(&lk->lk, "sleep lock"); lk->name = name; lk->locked = 0; lk->pid = 0; 80104654: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) void initsleeplock(struct sleeplock *lk, char *name) { initlock(&lk->lk, "sleep lock"); lk->name = name; 8010465b: 89 43 38 mov %eax,0x38(%ebx) lk->locked = 0; lk->pid = 0; } 8010465e: 8b 5d fc mov -0x4(%ebp),%ebx 80104661: c9 leave 80104662: c3 ret 80104663: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104669: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104670 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 80104670: 55 push %ebp 80104671: 89 e5 mov %esp,%ebp 80104673: 56 push %esi 80104674: 53 push %ebx 80104675: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104678: 83 ec 0c sub $0xc,%esp 8010467b: 8d 73 04 lea 0x4(%ebx),%esi 8010467e: 56 push %esi 8010467f: e8 bc 01 00 00 call 80104840 <acquire> while (lk->locked) { 80104684: 8b 13 mov (%ebx),%edx 80104686: 83 c4 10 add $0x10,%esp 80104689: 85 d2 test %edx,%edx 8010468b: 74 16 je 801046a3 <acquiresleep+0x33> 8010468d: 8d 76 00 lea 0x0(%esi),%esi sleep(lk, &lk->lk); 80104690: 83 ec 08 sub $0x8,%esp 80104693: 56 push %esi 80104694: 53 push %ebx 80104695: e8 96 f6 ff ff call 80103d30 <sleep> void acquiresleep(struct sleeplock *lk) { acquire(&lk->lk); while (lk->locked) { 8010469a: 8b 03 mov (%ebx),%eax 8010469c: 83 c4 10 add $0x10,%esp 8010469f: 85 c0 test %eax,%eax 801046a1: 75 ed jne 80104690 <acquiresleep+0x20> sleep(lk, &lk->lk); } lk->locked = 1; 801046a3: c7 03 01 00 00 00 movl $0x1,(%ebx) lk->pid = myproc()->pid; 801046a9: e8 d2 f0 ff ff call 80103780 <myproc> 801046ae: 8b 40 10 mov 0x10(%eax),%eax 801046b1: 89 43 3c mov %eax,0x3c(%ebx) release(&lk->lk); 801046b4: 89 75 08 mov %esi,0x8(%ebp) } 801046b7: 8d 65 f8 lea -0x8(%ebp),%esp 801046ba: 5b pop %ebx 801046bb: 5e pop %esi 801046bc: 5d pop %ebp while (lk->locked) { sleep(lk, &lk->lk); } lk->locked = 1; lk->pid = myproc()->pid; release(&lk->lk); 801046bd: e9 9e 02 00 00 jmp 80104960 <release> 801046c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801046c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801046d0 <releasesleep>: } void releasesleep(struct sleeplock *lk) { 801046d0: 55 push %ebp 801046d1: 89 e5 mov %esp,%ebp 801046d3: 56 push %esi 801046d4: 53 push %ebx 801046d5: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 801046d8: 83 ec 0c sub $0xc,%esp 801046db: 8d 73 04 lea 0x4(%ebx),%esi 801046de: 56 push %esi 801046df: e8 5c 01 00 00 call 80104840 <acquire> lk->locked = 0; 801046e4: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 801046ea: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) wakeup(lk); 801046f1: 89 1c 24 mov %ebx,(%esp) 801046f4: e8 e7 f7 ff ff call 80103ee0 <wakeup> release(&lk->lk); 801046f9: 89 75 08 mov %esi,0x8(%ebp) 801046fc: 83 c4 10 add $0x10,%esp } 801046ff: 8d 65 f8 lea -0x8(%ebp),%esp 80104702: 5b pop %ebx 80104703: 5e pop %esi 80104704: 5d pop %ebp { acquire(&lk->lk); lk->locked = 0; lk->pid = 0; wakeup(lk); release(&lk->lk); 80104705: e9 56 02 00 00 jmp 80104960 <release> 8010470a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104710 <holdingsleep>: } int holdingsleep(struct sleeplock *lk) { 80104710: 55 push %ebp 80104711: 89 e5 mov %esp,%ebp 80104713: 56 push %esi 80104714: 53 push %ebx 80104715: 8b 75 08 mov 0x8(%ebp),%esi int r; acquire(&lk->lk); 80104718: 83 ec 0c sub $0xc,%esp 8010471b: 8d 5e 04 lea 0x4(%esi),%ebx 8010471e: 53 push %ebx 8010471f: e8 1c 01 00 00 call 80104840 <acquire> r = lk->locked; 80104724: 8b 36 mov (%esi),%esi release(&lk->lk); 80104726: 89 1c 24 mov %ebx,(%esp) 80104729: e8 32 02 00 00 call 80104960 <release> return r; } 8010472e: 8d 65 f8 lea -0x8(%ebp),%esp 80104731: 89 f0 mov %esi,%eax 80104733: 5b pop %ebx 80104734: 5e pop %esi 80104735: 5d pop %ebp 80104736: c3 ret 80104737: 66 90 xchg %ax,%ax 80104739: 66 90 xchg %ax,%ax 8010473b: 66 90 xchg %ax,%ax 8010473d: 66 90 xchg %ax,%ax 8010473f: 90 nop 80104740 <initlock>: #include "proc.h" #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { 80104740: 55 push %ebp 80104741: 89 e5 mov %esp,%ebp 80104743: 8b 45 08 mov 0x8(%ebp),%eax lk->name = name; 80104746: 8b 55 0c mov 0xc(%ebp),%edx lk->locked = 0; 80104749: c7 00 00 00 00 00 movl $0x0,(%eax) #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { lk->name = name; 8010474f: 89 50 04 mov %edx,0x4(%eax) lk->locked = 0; lk->cpu = 0; 80104752: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 80104759: 5d pop %ebp 8010475a: c3 ret 8010475b: 90 nop 8010475c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104760 <getcallerpcs>: } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 80104760: 55 push %ebp 80104761: 89 e5 mov %esp,%ebp 80104763: 53 push %ebx uint *ebp; int i; ebp = (uint*)v - 2; 80104764: 8b 45 08 mov 0x8(%ebp),%eax } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 80104767: 8b 4d 0c mov 0xc(%ebp),%ecx uint *ebp; int i; ebp = (uint*)v - 2; 8010476a: 8d 50 f8 lea -0x8(%eax),%edx for(i = 0; i < 10; i++){ 8010476d: 31 c0 xor %eax,%eax 8010476f: 90 nop if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104770: 8d 9a 00 00 00 80 lea -0x80000000(%edx),%ebx 80104776: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 8010477c: 77 1a ja 80104798 <getcallerpcs+0x38> break; pcs[i] = ebp[1]; // saved %eip 8010477e: 8b 5a 04 mov 0x4(%edx),%ebx 80104781: 89 1c 81 mov %ebx,(%ecx,%eax,4) { uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 80104784: 83 c0 01 add $0x1,%eax if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp 80104787: 8b 12 mov (%edx),%edx { uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 80104789: 83 f8 0a cmp $0xa,%eax 8010478c: 75 e2 jne 80104770 <getcallerpcs+0x10> pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) pcs[i] = 0; } 8010478e: 5b pop %ebx 8010478f: 5d pop %ebp 80104790: c3 ret 80104791: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) pcs[i] = 0; 80104798: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) 8010479f: 83 c0 01 add $0x1,%eax 801047a2: 83 f8 0a cmp $0xa,%eax 801047a5: 74 e7 je 8010478e <getcallerpcs+0x2e> pcs[i] = 0; 801047a7: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) 801047ae: 83 c0 01 add $0x1,%eax 801047b1: 83 f8 0a cmp $0xa,%eax 801047b4: 75 e2 jne 80104798 <getcallerpcs+0x38> 801047b6: eb d6 jmp 8010478e <getcallerpcs+0x2e> 801047b8: 90 nop 801047b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801047c0 <holding>: } // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { 801047c0: 55 push %ebp 801047c1: 89 e5 mov %esp,%ebp 801047c3: 53 push %ebx 801047c4: 83 ec 04 sub $0x4,%esp 801047c7: 8b 55 08 mov 0x8(%ebp),%edx return lock->locked && lock->cpu == mycpu(); 801047ca: 8b 02 mov (%edx),%eax 801047cc: 85 c0 test %eax,%eax 801047ce: 75 10 jne 801047e0 <holding+0x20> } 801047d0: 83 c4 04 add $0x4,%esp 801047d3: 31 c0 xor %eax,%eax 801047d5: 5b pop %ebx 801047d6: 5d pop %ebp 801047d7: c3 ret 801047d8: 90 nop 801047d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 801047e0: 8b 5a 08 mov 0x8(%edx),%ebx 801047e3: e8 f8 ee ff ff call 801036e0 <mycpu> 801047e8: 39 c3 cmp %eax,%ebx 801047ea: 0f 94 c0 sete %al } 801047ed: 83 c4 04 add $0x4,%esp // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 801047f0: 0f b6 c0 movzbl %al,%eax } 801047f3: 5b pop %ebx 801047f4: 5d pop %ebp 801047f5: c3 ret 801047f6: 8d 76 00 lea 0x0(%esi),%esi 801047f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104800 <pushcli>: // it takes two popcli to undo two pushcli. Also, if interrupts // are off, then pushcli, popcli leaves them off. void pushcli(void) { 80104800: 55 push %ebp 80104801: 89 e5 mov %esp,%ebp 80104803: 53 push %ebx 80104804: 83 ec 04 sub $0x4,%esp 80104807: 9c pushf 80104808: 5b pop %ebx } static inline void cli(void) { asm volatile("cli"); 80104809: fa cli int eflags; eflags = readeflags(); cli(); if(mycpu()->ncli == 0) 8010480a: e8 d1 ee ff ff call 801036e0 <mycpu> 8010480f: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax 80104815: 85 c0 test %eax,%eax 80104817: 75 11 jne 8010482a <pushcli+0x2a> mycpu()->intena = eflags & FL_IF; 80104819: 81 e3 00 02 00 00 and $0x200,%ebx 8010481f: e8 bc ee ff ff call 801036e0 <mycpu> 80104824: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax) mycpu()->ncli += 1; 8010482a: e8 b1 ee ff ff call 801036e0 <mycpu> 8010482f: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax) } 80104836: 83 c4 04 add $0x4,%esp 80104839: 5b pop %ebx 8010483a: 5d pop %ebp 8010483b: c3 ret 8010483c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104840 <acquire>: // Loops (spins) until the lock is acquired. // Holding a lock for a long time may cause // other CPUs to waste time spinning to acquire it. void acquire(struct spinlock *lk) { 80104840: 55 push %ebp 80104841: 89 e5 mov %esp,%ebp 80104843: 56 push %esi 80104844: 53 push %ebx pushcli(); // disable interrupts to avoid deadlock. 80104845: e8 b6 ff ff ff call 80104800 <pushcli> if(holding(lk)) 8010484a: 8b 5d 08 mov 0x8(%ebp),%ebx // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 8010484d: 8b 03 mov (%ebx),%eax 8010484f: 85 c0 test %eax,%eax 80104851: 75 7d jne 801048d0 <acquire+0x90> xchg(volatile uint *addr, uint newval) { uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 80104853: ba 01 00 00 00 mov $0x1,%edx 80104858: eb 09 jmp 80104863 <acquire+0x23> 8010485a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104860: 8b 5d 08 mov 0x8(%ebp),%ebx 80104863: 89 d0 mov %edx,%eax 80104865: f0 87 03 lock xchg %eax,(%ebx) pushcli(); // disable interrupts to avoid deadlock. if(holding(lk)) panic("acquire"); // The xchg is atomic. while(xchg(&lk->locked, 1) != 0) 80104868: 85 c0 test %eax,%eax 8010486a: 75 f4 jne 80104860 <acquire+0x20> ; // Tell the C compiler and the processor to not move loads or stores // past this point, to ensure that the critical section's memory // references happen after the lock is acquired. __sync_synchronize(); 8010486c: f0 83 0c 24 00 lock orl $0x0,(%esp) // Record info about lock acquisition for debugging. lk->cpu = mycpu(); 80104871: 8b 5d 08 mov 0x8(%ebp),%ebx 80104874: e8 67 ee ff ff call 801036e0 <mycpu> getcallerpcs(void *v, uint pcs[]) { uint *ebp; int i; ebp = (uint*)v - 2; 80104879: 89 ea mov %ebp,%edx // references happen after the lock is acquired. __sync_synchronize(); // Record info about lock acquisition for debugging. lk->cpu = mycpu(); getcallerpcs(&lk, lk->pcs); 8010487b: 8d 4b 0c lea 0xc(%ebx),%ecx // past this point, to ensure that the critical section's memory // references happen after the lock is acquired. __sync_synchronize(); // Record info about lock acquisition for debugging. lk->cpu = mycpu(); 8010487e: 89 43 08 mov %eax,0x8(%ebx) { uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 80104881: 31 c0 xor %eax,%eax 80104883: 90 nop 80104884: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104888: 8d 9a 00 00 00 80 lea -0x80000000(%edx),%ebx 8010488e: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 80104894: 77 1a ja 801048b0 <acquire+0x70> break; pcs[i] = ebp[1]; // saved %eip 80104896: 8b 5a 04 mov 0x4(%edx),%ebx 80104899: 89 1c 81 mov %ebx,(%ecx,%eax,4) { uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 8010489c: 83 c0 01 add $0x1,%eax if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp 8010489f: 8b 12 mov (%edx),%edx { uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 801048a1: 83 f8 0a cmp $0xa,%eax 801048a4: 75 e2 jne 80104888 <acquire+0x48> __sync_synchronize(); // Record info about lock acquisition for debugging. lk->cpu = mycpu(); getcallerpcs(&lk, lk->pcs); } 801048a6: 8d 65 f8 lea -0x8(%ebp),%esp 801048a9: 5b pop %ebx 801048aa: 5e pop %esi 801048ab: 5d pop %ebp 801048ac: c3 ret 801048ad: 8d 76 00 lea 0x0(%esi),%esi break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) pcs[i] = 0; 801048b0: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) 801048b7: 83 c0 01 add $0x1,%eax 801048ba: 83 f8 0a cmp $0xa,%eax 801048bd: 74 e7 je 801048a6 <acquire+0x66> pcs[i] = 0; 801048bf: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) 801048c6: 83 c0 01 add $0x1,%eax 801048c9: 83 f8 0a cmp $0xa,%eax 801048cc: 75 e2 jne 801048b0 <acquire+0x70> 801048ce: eb d6 jmp 801048a6 <acquire+0x66> // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 801048d0: 8b 73 08 mov 0x8(%ebx),%esi 801048d3: e8 08 ee ff ff call 801036e0 <mycpu> 801048d8: 39 c6 cmp %eax,%esi 801048da: 0f 85 73 ff ff ff jne 80104853 <acquire+0x13> void acquire(struct spinlock *lk) { pushcli(); // disable interrupts to avoid deadlock. if(holding(lk)) panic("acquire"); 801048e0: 83 ec 0c sub $0xc,%esp 801048e3: 68 0b 7d 10 80 push $0x80107d0b 801048e8: e8 83 ba ff ff call 80100370 <panic> 801048ed: 8d 76 00 lea 0x0(%esi),%esi 801048f0 <popcli>: mycpu()->ncli += 1; } void popcli(void) { 801048f0: 55 push %ebp 801048f1: 89 e5 mov %esp,%ebp 801048f3: 83 ec 08 sub $0x8,%esp static inline uint readeflags(void) { uint eflags; asm volatile("pushfl; popl %0" : "=r" (eflags)); 801048f6: 9c pushf 801048f7: 58 pop %eax if(readeflags()&FL_IF) 801048f8: f6 c4 02 test $0x2,%ah 801048fb: 75 52 jne 8010494f <popcli+0x5f> panic("popcli - interruptible"); if(--mycpu()->ncli < 0) 801048fd: e8 de ed ff ff call 801036e0 <mycpu> 80104902: 8b 88 a4 00 00 00 mov 0xa4(%eax),%ecx 80104908: 8d 51 ff lea -0x1(%ecx),%edx 8010490b: 85 d2 test %edx,%edx 8010490d: 89 90 a4 00 00 00 mov %edx,0xa4(%eax) 80104913: 78 2d js 80104942 <popcli+0x52> panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 80104915: e8 c6 ed ff ff call 801036e0 <mycpu> 8010491a: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 80104920: 85 d2 test %edx,%edx 80104922: 74 0c je 80104930 <popcli+0x40> sti(); } 80104924: c9 leave 80104925: c3 ret 80104926: 8d 76 00 lea 0x0(%esi),%esi 80104929: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi { if(readeflags()&FL_IF) panic("popcli - interruptible"); if(--mycpu()->ncli < 0) panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 80104930: e8 ab ed ff ff call 801036e0 <mycpu> 80104935: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax 8010493b: 85 c0 test %eax,%eax 8010493d: 74 e5 je 80104924 <popcli+0x34> } static inline void sti(void) { asm volatile("sti"); 8010493f: fb sti sti(); } 80104940: c9 leave 80104941: c3 ret popcli(void) { if(readeflags()&FL_IF) panic("popcli - interruptible"); if(--mycpu()->ncli < 0) panic("popcli"); 80104942: 83 ec 0c sub $0xc,%esp 80104945: 68 2a 7d 10 80 push $0x80107d2a 8010494a: e8 21 ba ff ff call 80100370 <panic> void popcli(void) { if(readeflags()&FL_IF) panic("popcli - interruptible"); 8010494f: 83 ec 0c sub $0xc,%esp 80104952: 68 13 7d 10 80 push $0x80107d13 80104957: e8 14 ba ff ff call 80100370 <panic> 8010495c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104960 <release>: } // Release the lock. void release(struct spinlock *lk) { 80104960: 55 push %ebp 80104961: 89 e5 mov %esp,%ebp 80104963: 56 push %esi 80104964: 53 push %ebx 80104965: 8b 5d 08 mov 0x8(%ebp),%ebx // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 80104968: 8b 03 mov (%ebx),%eax 8010496a: 85 c0 test %eax,%eax 8010496c: 75 12 jne 80104980 <release+0x20> // Release the lock. void release(struct spinlock *lk) { if(!holding(lk)) panic("release"); 8010496e: 83 ec 0c sub $0xc,%esp 80104971: 68 31 7d 10 80 push $0x80107d31 80104976: e8 f5 b9 ff ff call 80100370 <panic> 8010497b: 90 nop 8010497c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 80104980: 8b 73 08 mov 0x8(%ebx),%esi 80104983: e8 58 ed ff ff call 801036e0 <mycpu> 80104988: 39 c6 cmp %eax,%esi 8010498a: 75 e2 jne 8010496e <release+0xe> release(struct spinlock *lk) { if(!holding(lk)) panic("release"); lk->pcs[0] = 0; 8010498c: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) lk->cpu = 0; 80104993: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) // Tell the C compiler and the processor to not move loads or stores // past this point, to ensure that all the stores in the critical // section are visible to other cores before the lock is released. // Both the C compiler and the hardware may re-order loads and // stores; __sync_synchronize() tells them both not to. __sync_synchronize(); 8010499a: f0 83 0c 24 00 lock orl $0x0,(%esp) // Release the lock, equivalent to lk->locked = 0. // This code can't use a C assignment, since it might // not be atomic. A real OS would use C atomics here. asm volatile("movl $0, %0" : "+m" (lk->locked) : ); 8010499f: c7 03 00 00 00 00 movl $0x0,(%ebx) popcli(); } 801049a5: 8d 65 f8 lea -0x8(%ebp),%esp 801049a8: 5b pop %ebx 801049a9: 5e pop %esi 801049aa: 5d pop %ebp // Release the lock, equivalent to lk->locked = 0. // This code can't use a C assignment, since it might // not be atomic. A real OS would use C atomics here. asm volatile("movl $0, %0" : "+m" (lk->locked) : ); popcli(); 801049ab: e9 40 ff ff ff jmp 801048f0 <popcli> 801049b0 <memset>: #include "types.h" #include "x86.h" void* memset(void *dst, int c, uint n) { 801049b0: 55 push %ebp 801049b1: 89 e5 mov %esp,%ebp 801049b3: 57 push %edi 801049b4: 53 push %ebx 801049b5: 8b 55 08 mov 0x8(%ebp),%edx 801049b8: 8b 4d 10 mov 0x10(%ebp),%ecx if ((int)dst%4 == 0 && n%4 == 0){ 801049bb: f6 c2 03 test $0x3,%dl 801049be: 75 05 jne 801049c5 <memset+0x15> 801049c0: f6 c1 03 test $0x3,%cl 801049c3: 74 13 je 801049d8 <memset+0x28> } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 801049c5: 89 d7 mov %edx,%edi 801049c7: 8b 45 0c mov 0xc(%ebp),%eax 801049ca: fc cld 801049cb: 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; } 801049cd: 5b pop %ebx 801049ce: 89 d0 mov %edx,%eax 801049d0: 5f pop %edi 801049d1: 5d pop %ebp 801049d2: c3 ret 801049d3: 90 nop 801049d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi void* memset(void *dst, int c, uint n) { if ((int)dst%4 == 0 && n%4 == 0){ c &= 0xFF; 801049d8: 0f b6 7d 0c movzbl 0xc(%ebp),%edi } static inline void stosl(void *addr, int data, int cnt) { asm volatile("cld; rep stosl" : 801049dc: c1 e9 02 shr $0x2,%ecx 801049df: 89 fb mov %edi,%ebx 801049e1: 89 f8 mov %edi,%eax 801049e3: c1 e3 18 shl $0x18,%ebx 801049e6: c1 e0 10 shl $0x10,%eax 801049e9: 09 d8 or %ebx,%eax 801049eb: 09 f8 or %edi,%eax 801049ed: c1 e7 08 shl $0x8,%edi 801049f0: 09 f8 or %edi,%eax 801049f2: 89 d7 mov %edx,%edi 801049f4: fc cld 801049f5: f3 ab rep stos %eax,%es:(%edi) stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); } else stosb(dst, c, n); return dst; } 801049f7: 5b pop %ebx 801049f8: 89 d0 mov %edx,%eax 801049fa: 5f pop %edi 801049fb: 5d pop %ebp 801049fc: c3 ret 801049fd: 8d 76 00 lea 0x0(%esi),%esi 80104a00 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 80104a00: 55 push %ebp 80104a01: 89 e5 mov %esp,%ebp 80104a03: 57 push %edi 80104a04: 56 push %esi 80104a05: 8b 45 10 mov 0x10(%ebp),%eax 80104a08: 53 push %ebx 80104a09: 8b 75 0c mov 0xc(%ebp),%esi 80104a0c: 8b 5d 08 mov 0x8(%ebp),%ebx const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 80104a0f: 85 c0 test %eax,%eax 80104a11: 74 29 je 80104a3c <memcmp+0x3c> if(*s1 != *s2) 80104a13: 0f b6 13 movzbl (%ebx),%edx 80104a16: 0f b6 0e movzbl (%esi),%ecx 80104a19: 38 d1 cmp %dl,%cl 80104a1b: 75 2b jne 80104a48 <memcmp+0x48> 80104a1d: 8d 78 ff lea -0x1(%eax),%edi 80104a20: 31 c0 xor %eax,%eax 80104a22: eb 14 jmp 80104a38 <memcmp+0x38> 80104a24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104a28: 0f b6 54 03 01 movzbl 0x1(%ebx,%eax,1),%edx 80104a2d: 83 c0 01 add $0x1,%eax 80104a30: 0f b6 0c 06 movzbl (%esi,%eax,1),%ecx 80104a34: 38 ca cmp %cl,%dl 80104a36: 75 10 jne 80104a48 <memcmp+0x48> { const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 80104a38: 39 f8 cmp %edi,%eax 80104a3a: 75 ec jne 80104a28 <memcmp+0x28> return *s1 - *s2; s1++, s2++; } return 0; } 80104a3c: 5b pop %ebx if(*s1 != *s2) return *s1 - *s2; s1++, s2++; } return 0; 80104a3d: 31 c0 xor %eax,%eax } 80104a3f: 5e pop %esi 80104a40: 5f pop %edi 80104a41: 5d pop %ebp 80104a42: c3 ret 80104a43: 90 nop 80104a44: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi s1 = v1; s2 = v2; while(n-- > 0){ if(*s1 != *s2) return *s1 - *s2; 80104a48: 0f b6 c2 movzbl %dl,%eax s1++, s2++; } return 0; } 80104a4b: 5b pop %ebx s1 = v1; s2 = v2; while(n-- > 0){ if(*s1 != *s2) return *s1 - *s2; 80104a4c: 29 c8 sub %ecx,%eax s1++, s2++; } return 0; } 80104a4e: 5e pop %esi 80104a4f: 5f pop %edi 80104a50: 5d pop %ebp 80104a51: c3 ret 80104a52: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104a59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104a60 <memmove>: void* memmove(void *dst, const void *src, uint n) { 80104a60: 55 push %ebp 80104a61: 89 e5 mov %esp,%ebp 80104a63: 56 push %esi 80104a64: 53 push %ebx 80104a65: 8b 45 08 mov 0x8(%ebp),%eax 80104a68: 8b 75 0c mov 0xc(%ebp),%esi 80104a6b: 8b 5d 10 mov 0x10(%ebp),%ebx const char *s; char *d; s = src; d = dst; if(s < d && s + n > d){ 80104a6e: 39 c6 cmp %eax,%esi 80104a70: 73 2e jae 80104aa0 <memmove+0x40> 80104a72: 8d 0c 1e lea (%esi,%ebx,1),%ecx 80104a75: 39 c8 cmp %ecx,%eax 80104a77: 73 27 jae 80104aa0 <memmove+0x40> s += n; d += n; while(n-- > 0) 80104a79: 85 db test %ebx,%ebx 80104a7b: 8d 53 ff lea -0x1(%ebx),%edx 80104a7e: 74 17 je 80104a97 <memmove+0x37> *--d = *--s; 80104a80: 29 d9 sub %ebx,%ecx 80104a82: 89 cb mov %ecx,%ebx 80104a84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104a88: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104a8c: 88 0c 10 mov %cl,(%eax,%edx,1) s = src; d = dst; if(s < d && s + n > d){ s += n; d += n; while(n-- > 0) 80104a8f: 83 ea 01 sub $0x1,%edx 80104a92: 83 fa ff cmp $0xffffffff,%edx 80104a95: 75 f1 jne 80104a88 <memmove+0x28> } else while(n-- > 0) *d++ = *s++; return dst; } 80104a97: 5b pop %ebx 80104a98: 5e pop %esi 80104a99: 5d pop %ebp 80104a9a: c3 ret 80104a9b: 90 nop 80104a9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi s += n; d += n; while(n-- > 0) *--d = *--s; } else while(n-- > 0) 80104aa0: 31 d2 xor %edx,%edx 80104aa2: 85 db test %ebx,%ebx 80104aa4: 74 f1 je 80104a97 <memmove+0x37> 80104aa6: 8d 76 00 lea 0x0(%esi),%esi 80104aa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi *d++ = *s++; 80104ab0: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 80104ab4: 88 0c 10 mov %cl,(%eax,%edx,1) 80104ab7: 83 c2 01 add $0x1,%edx s += n; d += n; while(n-- > 0) *--d = *--s; } else while(n-- > 0) 80104aba: 39 d3 cmp %edx,%ebx 80104abc: 75 f2 jne 80104ab0 <memmove+0x50> *d++ = *s++; return dst; } 80104abe: 5b pop %ebx 80104abf: 5e pop %esi 80104ac0: 5d pop %ebp 80104ac1: c3 ret 80104ac2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104ac9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104ad0 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 80104ad0: 55 push %ebp 80104ad1: 89 e5 mov %esp,%ebp return memmove(dst, src, n); } 80104ad3: 5d pop %ebp // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { return memmove(dst, src, n); 80104ad4: eb 8a jmp 80104a60 <memmove> 80104ad6: 8d 76 00 lea 0x0(%esi),%esi 80104ad9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104ae0 <strncmp>: } int strncmp(const char *p, const char *q, uint n) { 80104ae0: 55 push %ebp 80104ae1: 89 e5 mov %esp,%ebp 80104ae3: 57 push %edi 80104ae4: 56 push %esi 80104ae5: 8b 4d 10 mov 0x10(%ebp),%ecx 80104ae8: 53 push %ebx 80104ae9: 8b 7d 08 mov 0x8(%ebp),%edi 80104aec: 8b 75 0c mov 0xc(%ebp),%esi while(n > 0 && *p && *p == *q) 80104aef: 85 c9 test %ecx,%ecx 80104af1: 74 37 je 80104b2a <strncmp+0x4a> 80104af3: 0f b6 17 movzbl (%edi),%edx 80104af6: 0f b6 1e movzbl (%esi),%ebx 80104af9: 84 d2 test %dl,%dl 80104afb: 74 3f je 80104b3c <strncmp+0x5c> 80104afd: 38 d3 cmp %dl,%bl 80104aff: 75 3b jne 80104b3c <strncmp+0x5c> 80104b01: 8d 47 01 lea 0x1(%edi),%eax 80104b04: 01 cf add %ecx,%edi 80104b06: eb 1b jmp 80104b23 <strncmp+0x43> 80104b08: 90 nop 80104b09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104b10: 0f b6 10 movzbl (%eax),%edx 80104b13: 84 d2 test %dl,%dl 80104b15: 74 21 je 80104b38 <strncmp+0x58> 80104b17: 0f b6 19 movzbl (%ecx),%ebx 80104b1a: 83 c0 01 add $0x1,%eax 80104b1d: 89 ce mov %ecx,%esi 80104b1f: 38 da cmp %bl,%dl 80104b21: 75 19 jne 80104b3c <strncmp+0x5c> 80104b23: 39 c7 cmp %eax,%edi n--, p++, q++; 80104b25: 8d 4e 01 lea 0x1(%esi),%ecx } int strncmp(const char *p, const char *q, uint n) { while(n > 0 && *p && *p == *q) 80104b28: 75 e6 jne 80104b10 <strncmp+0x30> n--, p++, q++; if(n == 0) return 0; return (uchar)*p - (uchar)*q; } 80104b2a: 5b pop %ebx strncmp(const char *p, const char *q, uint n) { while(n > 0 && *p && *p == *q) n--, p++, q++; if(n == 0) return 0; 80104b2b: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; } 80104b2d: 5e pop %esi 80104b2e: 5f pop %edi 80104b2f: 5d pop %ebp 80104b30: c3 ret 80104b31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104b38: 0f b6 5e 01 movzbl 0x1(%esi),%ebx { while(n > 0 && *p && *p == *q) n--, p++, q++; if(n == 0) return 0; return (uchar)*p - (uchar)*q; 80104b3c: 0f b6 c2 movzbl %dl,%eax 80104b3f: 29 d8 sub %ebx,%eax } 80104b41: 5b pop %ebx 80104b42: 5e pop %esi 80104b43: 5f pop %edi 80104b44: 5d pop %ebp 80104b45: c3 ret 80104b46: 8d 76 00 lea 0x0(%esi),%esi 80104b49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104b50 <strncpy>: char* strncpy(char *s, const char *t, int n) { 80104b50: 55 push %ebp 80104b51: 89 e5 mov %esp,%ebp 80104b53: 56 push %esi 80104b54: 53 push %ebx 80104b55: 8b 45 08 mov 0x8(%ebp),%eax 80104b58: 8b 5d 0c mov 0xc(%ebp),%ebx 80104b5b: 8b 4d 10 mov 0x10(%ebp),%ecx char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 80104b5e: 89 c2 mov %eax,%edx 80104b60: eb 19 jmp 80104b7b <strncpy+0x2b> 80104b62: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104b68: 83 c3 01 add $0x1,%ebx 80104b6b: 0f b6 4b ff movzbl -0x1(%ebx),%ecx 80104b6f: 83 c2 01 add $0x1,%edx 80104b72: 84 c9 test %cl,%cl 80104b74: 88 4a ff mov %cl,-0x1(%edx) 80104b77: 74 09 je 80104b82 <strncpy+0x32> 80104b79: 89 f1 mov %esi,%ecx 80104b7b: 85 c9 test %ecx,%ecx 80104b7d: 8d 71 ff lea -0x1(%ecx),%esi 80104b80: 7f e6 jg 80104b68 <strncpy+0x18> ; while(n-- > 0) 80104b82: 31 c9 xor %ecx,%ecx 80104b84: 85 f6 test %esi,%esi 80104b86: 7e 17 jle 80104b9f <strncpy+0x4f> 80104b88: 90 nop 80104b89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi *s++ = 0; 80104b90: c6 04 0a 00 movb $0x0,(%edx,%ecx,1) 80104b94: 89 f3 mov %esi,%ebx 80104b96: 83 c1 01 add $0x1,%ecx 80104b99: 29 cb sub %ecx,%ebx char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) ; while(n-- > 0) 80104b9b: 85 db test %ebx,%ebx 80104b9d: 7f f1 jg 80104b90 <strncpy+0x40> *s++ = 0; return os; } 80104b9f: 5b pop %ebx 80104ba0: 5e pop %esi 80104ba1: 5d pop %ebp 80104ba2: c3 ret 80104ba3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104ba9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104bb0 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 80104bb0: 55 push %ebp 80104bb1: 89 e5 mov %esp,%ebp 80104bb3: 56 push %esi 80104bb4: 53 push %ebx 80104bb5: 8b 4d 10 mov 0x10(%ebp),%ecx 80104bb8: 8b 45 08 mov 0x8(%ebp),%eax 80104bbb: 8b 55 0c mov 0xc(%ebp),%edx char *os; os = s; if(n <= 0) 80104bbe: 85 c9 test %ecx,%ecx 80104bc0: 7e 26 jle 80104be8 <safestrcpy+0x38> 80104bc2: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi 80104bc6: 89 c1 mov %eax,%ecx 80104bc8: eb 17 jmp 80104be1 <safestrcpy+0x31> 80104bca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return os; while(--n > 0 && (*s++ = *t++) != 0) 80104bd0: 83 c2 01 add $0x1,%edx 80104bd3: 0f b6 5a ff movzbl -0x1(%edx),%ebx 80104bd7: 83 c1 01 add $0x1,%ecx 80104bda: 84 db test %bl,%bl 80104bdc: 88 59 ff mov %bl,-0x1(%ecx) 80104bdf: 74 04 je 80104be5 <safestrcpy+0x35> 80104be1: 39 f2 cmp %esi,%edx 80104be3: 75 eb jne 80104bd0 <safestrcpy+0x20> ; *s = 0; 80104be5: c6 01 00 movb $0x0,(%ecx) return os; } 80104be8: 5b pop %ebx 80104be9: 5e pop %esi 80104bea: 5d pop %ebp 80104beb: c3 ret 80104bec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104bf0 <strlen>: int strlen(const char *s) { 80104bf0: 55 push %ebp int n; for(n = 0; s[n]; n++) 80104bf1: 31 c0 xor %eax,%eax return os; } int strlen(const char *s) { 80104bf3: 89 e5 mov %esp,%ebp 80104bf5: 8b 55 08 mov 0x8(%ebp),%edx int n; for(n = 0; s[n]; n++) 80104bf8: 80 3a 00 cmpb $0x0,(%edx) 80104bfb: 74 0c je 80104c09 <strlen+0x19> 80104bfd: 8d 76 00 lea 0x0(%esi),%esi 80104c00: 83 c0 01 add $0x1,%eax 80104c03: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 80104c07: 75 f7 jne 80104c00 <strlen+0x10> ; return n; } 80104c09: 5d pop %ebp 80104c0a: c3 ret 80104c0b <swtch>: # a struct context, and save its address in *old. # Switch stacks to new and pop previously-saved registers. .globl swtch swtch: movl 4(%esp), %eax 80104c0b: 8b 44 24 04 mov 0x4(%esp),%eax movl 8(%esp), %edx 80104c0f: 8b 54 24 08 mov 0x8(%esp),%edx # Save old callee-save registers pushl %ebp 80104c13: 55 push %ebp pushl %ebx 80104c14: 53 push %ebx pushl %esi 80104c15: 56 push %esi pushl %edi 80104c16: 57 push %edi # Switch stacks movl %esp, (%eax) 80104c17: 89 20 mov %esp,(%eax) movl %edx, %esp 80104c19: 89 d4 mov %edx,%esp # Load new callee-save registers popl %edi 80104c1b: 5f pop %edi popl %esi 80104c1c: 5e pop %esi popl %ebx 80104c1d: 5b pop %ebx popl %ebp 80104c1e: 5d pop %ebp ret 80104c1f: c3 ret 80104c20 <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) { 80104c20: 55 push %ebp 80104c21: 89 e5 mov %esp,%ebp 80104c23: 53 push %ebx 80104c24: 83 ec 04 sub $0x4,%esp 80104c27: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *curproc = myproc(); 80104c2a: e8 51 eb ff ff call 80103780 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 80104c2f: 8b 00 mov (%eax),%eax 80104c31: 39 d8 cmp %ebx,%eax 80104c33: 76 1b jbe 80104c50 <fetchint+0x30> 80104c35: 8d 53 04 lea 0x4(%ebx),%edx 80104c38: 39 d0 cmp %edx,%eax 80104c3a: 72 14 jb 80104c50 <fetchint+0x30> return -1; *ip = *(int*)(addr); 80104c3c: 8b 45 0c mov 0xc(%ebp),%eax 80104c3f: 8b 13 mov (%ebx),%edx 80104c41: 89 10 mov %edx,(%eax) return 0; 80104c43: 31 c0 xor %eax,%eax } 80104c45: 83 c4 04 add $0x4,%esp 80104c48: 5b pop %ebx 80104c49: 5d pop %ebp 80104c4a: c3 ret 80104c4b: 90 nop 80104c4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi fetchint(uint addr, int *ip) { struct proc *curproc = myproc(); if(addr >= curproc->sz || addr+4 > curproc->sz) return -1; 80104c50: b8 ff ff ff ff mov $0xffffffff,%eax 80104c55: eb ee jmp 80104c45 <fetchint+0x25> 80104c57: 89 f6 mov %esi,%esi 80104c59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c60 <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) { 80104c60: 55 push %ebp 80104c61: 89 e5 mov %esp,%ebp 80104c63: 53 push %ebx 80104c64: 83 ec 04 sub $0x4,%esp 80104c67: 8b 5d 08 mov 0x8(%ebp),%ebx char *s, *ep; struct proc *curproc = myproc(); 80104c6a: e8 11 eb ff ff call 80103780 <myproc> if(addr >= curproc->sz) 80104c6f: 39 18 cmp %ebx,(%eax) 80104c71: 76 29 jbe 80104c9c <fetchstr+0x3c> return -1; *pp = (char*)addr; 80104c73: 8b 4d 0c mov 0xc(%ebp),%ecx 80104c76: 89 da mov %ebx,%edx 80104c78: 89 19 mov %ebx,(%ecx) ep = (char*)curproc->sz; 80104c7a: 8b 00 mov (%eax),%eax for(s = *pp; s < ep; s++){ 80104c7c: 39 c3 cmp %eax,%ebx 80104c7e: 73 1c jae 80104c9c <fetchstr+0x3c> if(*s == 0) 80104c80: 80 3b 00 cmpb $0x0,(%ebx) 80104c83: 75 10 jne 80104c95 <fetchstr+0x35> 80104c85: eb 29 jmp 80104cb0 <fetchstr+0x50> 80104c87: 89 f6 mov %esi,%esi 80104c89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c90: 80 3a 00 cmpb $0x0,(%edx) 80104c93: 74 1b je 80104cb0 <fetchstr+0x50> if(addr >= curproc->sz) return -1; *pp = (char*)addr; ep = (char*)curproc->sz; for(s = *pp; s < ep; s++){ 80104c95: 83 c2 01 add $0x1,%edx 80104c98: 39 d0 cmp %edx,%eax 80104c9a: 77 f4 ja 80104c90 <fetchstr+0x30> if(*s == 0) return s - *pp; } return -1; } 80104c9c: 83 c4 04 add $0x4,%esp { char *s, *ep; struct proc *curproc = myproc(); if(addr >= curproc->sz) return -1; 80104c9f: b8 ff ff ff ff mov $0xffffffff,%eax for(s = *pp; s < ep; s++){ if(*s == 0) return s - *pp; } return -1; } 80104ca4: 5b pop %ebx 80104ca5: 5d pop %ebp 80104ca6: c3 ret 80104ca7: 89 f6 mov %esi,%esi 80104ca9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104cb0: 83 c4 04 add $0x4,%esp return -1; *pp = (char*)addr; ep = (char*)curproc->sz; for(s = *pp; s < ep; s++){ if(*s == 0) return s - *pp; 80104cb3: 89 d0 mov %edx,%eax 80104cb5: 29 d8 sub %ebx,%eax } return -1; } 80104cb7: 5b pop %ebx 80104cb8: 5d pop %ebp 80104cb9: c3 ret 80104cba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104cc0 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 80104cc0: 55 push %ebp 80104cc1: 89 e5 mov %esp,%ebp 80104cc3: 56 push %esi 80104cc4: 53 push %ebx return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104cc5: e8 b6 ea ff ff call 80103780 <myproc> 80104cca: 8b 40 18 mov 0x18(%eax),%eax 80104ccd: 8b 55 08 mov 0x8(%ebp),%edx 80104cd0: 8b 40 44 mov 0x44(%eax),%eax 80104cd3: 8d 1c 90 lea (%eax,%edx,4),%ebx // Fetch the int at addr from the current process. int fetchint(uint addr, int *ip) { struct proc *curproc = myproc(); 80104cd6: e8 a5 ea ff ff call 80103780 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 80104cdb: 8b 00 mov (%eax),%eax // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104cdd: 8d 73 04 lea 0x4(%ebx),%esi int fetchint(uint addr, int *ip) { struct proc *curproc = myproc(); if(addr >= curproc->sz || addr+4 > curproc->sz) 80104ce0: 39 c6 cmp %eax,%esi 80104ce2: 73 1c jae 80104d00 <argint+0x40> 80104ce4: 8d 53 08 lea 0x8(%ebx),%edx 80104ce7: 39 d0 cmp %edx,%eax 80104ce9: 72 15 jb 80104d00 <argint+0x40> return -1; *ip = *(int*)(addr); 80104ceb: 8b 45 0c mov 0xc(%ebp),%eax 80104cee: 8b 53 04 mov 0x4(%ebx),%edx 80104cf1: 89 10 mov %edx,(%eax) return 0; 80104cf3: 31 c0 xor %eax,%eax // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); } 80104cf5: 5b pop %ebx 80104cf6: 5e pop %esi 80104cf7: 5d pop %ebp 80104cf8: c3 ret 80104cf9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi fetchint(uint addr, int *ip) { struct proc *curproc = myproc(); if(addr >= curproc->sz || addr+4 > curproc->sz) return -1; 80104d00: b8 ff ff ff ff mov $0xffffffff,%eax 80104d05: eb ee jmp 80104cf5 <argint+0x35> 80104d07: 89 f6 mov %esi,%esi 80104d09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104d10 <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) { 80104d10: 55 push %ebp 80104d11: 89 e5 mov %esp,%ebp 80104d13: 56 push %esi 80104d14: 53 push %ebx 80104d15: 83 ec 10 sub $0x10,%esp 80104d18: 8b 5d 10 mov 0x10(%ebp),%ebx int i; struct proc *curproc = myproc(); 80104d1b: e8 60 ea ff ff call 80103780 <myproc> 80104d20: 89 c6 mov %eax,%esi if(argint(n, &i) < 0) 80104d22: 8d 45 f4 lea -0xc(%ebp),%eax 80104d25: 83 ec 08 sub $0x8,%esp 80104d28: 50 push %eax 80104d29: ff 75 08 pushl 0x8(%ebp) 80104d2c: e8 8f ff ff ff call 80104cc0 <argint> return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) 80104d31: c1 e8 1f shr $0x1f,%eax 80104d34: 83 c4 10 add $0x10,%esp 80104d37: 84 c0 test %al,%al 80104d39: 75 2d jne 80104d68 <argptr+0x58> 80104d3b: 89 d8 mov %ebx,%eax 80104d3d: c1 e8 1f shr $0x1f,%eax 80104d40: 84 c0 test %al,%al 80104d42: 75 24 jne 80104d68 <argptr+0x58> 80104d44: 8b 16 mov (%esi),%edx 80104d46: 8b 45 f4 mov -0xc(%ebp),%eax 80104d49: 39 c2 cmp %eax,%edx 80104d4b: 76 1b jbe 80104d68 <argptr+0x58> 80104d4d: 01 c3 add %eax,%ebx 80104d4f: 39 da cmp %ebx,%edx 80104d51: 72 15 jb 80104d68 <argptr+0x58> return -1; *pp = (char*)i; 80104d53: 8b 55 0c mov 0xc(%ebp),%edx 80104d56: 89 02 mov %eax,(%edx) return 0; 80104d58: 31 c0 xor %eax,%eax } 80104d5a: 8d 65 f8 lea -0x8(%ebp),%esp 80104d5d: 5b pop %ebx 80104d5e: 5e pop %esi 80104d5f: 5d pop %ebp 80104d60: c3 ret 80104d61: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi struct proc *curproc = myproc(); if(argint(n, &i) < 0) return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) return -1; 80104d68: b8 ff ff ff ff mov $0xffffffff,%eax 80104d6d: eb eb jmp 80104d5a <argptr+0x4a> 80104d6f: 90 nop 80104d70 <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) { 80104d70: 55 push %ebp 80104d71: 89 e5 mov %esp,%ebp 80104d73: 83 ec 20 sub $0x20,%esp int addr; if(argint(n, &addr) < 0) 80104d76: 8d 45 f4 lea -0xc(%ebp),%eax 80104d79: 50 push %eax 80104d7a: ff 75 08 pushl 0x8(%ebp) 80104d7d: e8 3e ff ff ff call 80104cc0 <argint> 80104d82: 83 c4 10 add $0x10,%esp 80104d85: 85 c0 test %eax,%eax 80104d87: 78 17 js 80104da0 <argstr+0x30> return -1; return fetchstr(addr, pp); 80104d89: 83 ec 08 sub $0x8,%esp 80104d8c: ff 75 0c pushl 0xc(%ebp) 80104d8f: ff 75 f4 pushl -0xc(%ebp) 80104d92: e8 c9 fe ff ff call 80104c60 <fetchstr> 80104d97: 83 c4 10 add $0x10,%esp } 80104d9a: c9 leave 80104d9b: c3 ret 80104d9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi int argstr(int n, char **pp) { int addr; if(argint(n, &addr) < 0) return -1; 80104da0: b8 ff ff ff ff mov $0xffffffff,%eax return fetchstr(addr, pp); } 80104da5: c9 leave 80104da6: c3 ret 80104da7: 89 f6 mov %esi,%esi 80104da9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104db0 <syscall>: /***************** LAB QUIZ 4 *****************/ }; void syscall(void) { 80104db0: 55 push %ebp 80104db1: 89 e5 mov %esp,%ebp 80104db3: 56 push %esi 80104db4: 53 push %ebx int num; struct proc *curproc = myproc(); 80104db5: e8 c6 e9 ff ff call 80103780 <myproc> num = curproc->tf->eax; 80104dba: 8b 70 18 mov 0x18(%eax),%esi void syscall(void) { int num; struct proc *curproc = myproc(); 80104dbd: 89 c3 mov %eax,%ebx num = curproc->tf->eax; 80104dbf: 8b 46 1c mov 0x1c(%esi),%eax if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 80104dc2: 8d 50 ff lea -0x1(%eax),%edx 80104dc5: 83 fa 19 cmp $0x19,%edx 80104dc8: 77 1e ja 80104de8 <syscall+0x38> 80104dca: 8b 14 85 60 7d 10 80 mov -0x7fef82a0(,%eax,4),%edx 80104dd1: 85 d2 test %edx,%edx 80104dd3: 74 13 je 80104de8 <syscall+0x38> curproc->tf->eax = syscalls[num](); 80104dd5: ff d2 call *%edx 80104dd7: 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; } } 80104dda: 8d 65 f8 lea -0x8(%ebp),%esp 80104ddd: 5b pop %ebx 80104dde: 5e pop %esi 80104ddf: 5d pop %ebp 80104de0: c3 ret 80104de1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi num = curproc->tf->eax; if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { curproc->tf->eax = syscalls[num](); } else { cprintf("%d %s: unknown sys call %d\n", 80104de8: 50 push %eax curproc->pid, curproc->name, num); 80104de9: 8d 43 6c lea 0x6c(%ebx),%eax num = curproc->tf->eax; if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { curproc->tf->eax = syscalls[num](); } else { cprintf("%d %s: unknown sys call %d\n", 80104dec: 50 push %eax 80104ded: ff 73 10 pushl 0x10(%ebx) 80104df0: 68 39 7d 10 80 push $0x80107d39 80104df5: e8 66 b8 ff ff call 80100660 <cprintf> curproc->pid, curproc->name, num); curproc->tf->eax = -1; 80104dfa: 8b 43 18 mov 0x18(%ebx),%eax 80104dfd: 83 c4 10 add $0x10,%esp 80104e00: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax) } } 80104e07: 8d 65 f8 lea -0x8(%ebp),%esp 80104e0a: 5b pop %ebx 80104e0b: 5e pop %esi 80104e0c: 5d pop %ebp 80104e0d: c3 ret 80104e0e: 66 90 xchg %ax,%ax 80104e10 <create>: return -1; } static struct inode* create(char *path, short type, short major, short minor) { 80104e10: 55 push %ebp 80104e11: 89 e5 mov %esp,%ebp 80104e13: 57 push %edi 80104e14: 56 push %esi 80104e15: 53 push %ebx uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 80104e16: 8d 75 da lea -0x26(%ebp),%esi return -1; } static struct inode* create(char *path, short type, short major, short minor) { 80104e19: 83 ec 44 sub $0x44,%esp 80104e1c: 89 4d c0 mov %ecx,-0x40(%ebp) 80104e1f: 8b 4d 08 mov 0x8(%ebp),%ecx uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 80104e22: 56 push %esi 80104e23: 50 push %eax return -1; } static struct inode* create(char *path, short type, short major, short minor) { 80104e24: 89 55 c4 mov %edx,-0x3c(%ebp) 80104e27: 89 4d bc mov %ecx,-0x44(%ebp) uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 80104e2a: e8 b1 d0 ff ff call 80101ee0 <nameiparent> 80104e2f: 83 c4 10 add $0x10,%esp 80104e32: 85 c0 test %eax,%eax 80104e34: 0f 84 f6 00 00 00 je 80104f30 <create+0x120> return 0; ilock(dp); 80104e3a: 83 ec 0c sub $0xc,%esp 80104e3d: 89 c7 mov %eax,%edi 80104e3f: 50 push %eax 80104e40: e8 2b c8 ff ff call 80101670 <ilock> if((ip = dirlookup(dp, name, &off)) != 0){ 80104e45: 8d 45 d4 lea -0x2c(%ebp),%eax 80104e48: 83 c4 0c add $0xc,%esp 80104e4b: 50 push %eax 80104e4c: 56 push %esi 80104e4d: 57 push %edi 80104e4e: e8 4d cd ff ff call 80101ba0 <dirlookup> 80104e53: 83 c4 10 add $0x10,%esp 80104e56: 85 c0 test %eax,%eax 80104e58: 89 c3 mov %eax,%ebx 80104e5a: 74 54 je 80104eb0 <create+0xa0> iunlockput(dp); 80104e5c: 83 ec 0c sub $0xc,%esp 80104e5f: 57 push %edi 80104e60: e8 9b ca ff ff call 80101900 <iunlockput> ilock(ip); 80104e65: 89 1c 24 mov %ebx,(%esp) 80104e68: e8 03 c8 ff ff call 80101670 <ilock> if(type == T_FILE && ip->type == T_FILE) 80104e6d: 83 c4 10 add $0x10,%esp 80104e70: 66 83 7d c4 02 cmpw $0x2,-0x3c(%ebp) 80104e75: 75 19 jne 80104e90 <create+0x80> 80104e77: 66 83 7b 50 02 cmpw $0x2,0x50(%ebx) 80104e7c: 89 d8 mov %ebx,%eax 80104e7e: 75 10 jne 80104e90 <create+0x80> panic("create: dirlink"); iunlockput(dp); return ip; } 80104e80: 8d 65 f4 lea -0xc(%ebp),%esp 80104e83: 5b pop %ebx 80104e84: 5e pop %esi 80104e85: 5f pop %edi 80104e86: 5d pop %ebp 80104e87: c3 ret 80104e88: 90 nop 80104e89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if((ip = dirlookup(dp, name, &off)) != 0){ iunlockput(dp); ilock(ip); if(type == T_FILE && ip->type == T_FILE) return ip; iunlockput(ip); 80104e90: 83 ec 0c sub $0xc,%esp 80104e93: 53 push %ebx 80104e94: e8 67 ca ff ff call 80101900 <iunlockput> return 0; 80104e99: 83 c4 10 add $0x10,%esp panic("create: dirlink"); iunlockput(dp); return ip; } 80104e9c: 8d 65 f4 lea -0xc(%ebp),%esp iunlockput(dp); ilock(ip); if(type == T_FILE && ip->type == T_FILE) return ip; iunlockput(ip); return 0; 80104e9f: 31 c0 xor %eax,%eax panic("create: dirlink"); iunlockput(dp); return ip; } 80104ea1: 5b pop %ebx 80104ea2: 5e pop %esi 80104ea3: 5f pop %edi 80104ea4: 5d pop %ebp 80104ea5: c3 ret 80104ea6: 8d 76 00 lea 0x0(%esi),%esi 80104ea9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return ip; iunlockput(ip); return 0; } if((ip = ialloc(dp->dev, type)) == 0) 80104eb0: 0f bf 45 c4 movswl -0x3c(%ebp),%eax 80104eb4: 83 ec 08 sub $0x8,%esp 80104eb7: 50 push %eax 80104eb8: ff 37 pushl (%edi) 80104eba: e8 41 c6 ff ff call 80101500 <ialloc> 80104ebf: 83 c4 10 add $0x10,%esp 80104ec2: 85 c0 test %eax,%eax 80104ec4: 89 c3 mov %eax,%ebx 80104ec6: 0f 84 cc 00 00 00 je 80104f98 <create+0x188> panic("create: ialloc"); ilock(ip); 80104ecc: 83 ec 0c sub $0xc,%esp 80104ecf: 50 push %eax 80104ed0: e8 9b c7 ff ff call 80101670 <ilock> ip->major = major; 80104ed5: 0f b7 45 c0 movzwl -0x40(%ebp),%eax 80104ed9: 66 89 43 52 mov %ax,0x52(%ebx) ip->minor = minor; 80104edd: 0f b7 45 bc movzwl -0x44(%ebp),%eax 80104ee1: 66 89 43 54 mov %ax,0x54(%ebx) ip->nlink = 1; 80104ee5: b8 01 00 00 00 mov $0x1,%eax 80104eea: 66 89 43 56 mov %ax,0x56(%ebx) iupdate(ip); 80104eee: 89 1c 24 mov %ebx,(%esp) 80104ef1: e8 ca c6 ff ff call 801015c0 <iupdate> if(type == T_DIR){ // Create . and .. entries. 80104ef6: 83 c4 10 add $0x10,%esp 80104ef9: 66 83 7d c4 01 cmpw $0x1,-0x3c(%ebp) 80104efe: 74 40 je 80104f40 <create+0x130> // No ip->nlink++ for ".": avoid cyclic ref count. if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) panic("create dots"); } if(dirlink(dp, name, ip->inum) < 0) 80104f00: 83 ec 04 sub $0x4,%esp 80104f03: ff 73 04 pushl 0x4(%ebx) 80104f06: 56 push %esi 80104f07: 57 push %edi 80104f08: e8 f3 ce ff ff call 80101e00 <dirlink> 80104f0d: 83 c4 10 add $0x10,%esp 80104f10: 85 c0 test %eax,%eax 80104f12: 78 77 js 80104f8b <create+0x17b> panic("create: dirlink"); iunlockput(dp); 80104f14: 83 ec 0c sub $0xc,%esp 80104f17: 57 push %edi 80104f18: e8 e3 c9 ff ff call 80101900 <iunlockput> return ip; 80104f1d: 83 c4 10 add $0x10,%esp } 80104f20: 8d 65 f4 lea -0xc(%ebp),%esp if(dirlink(dp, name, ip->inum) < 0) panic("create: dirlink"); iunlockput(dp); return ip; 80104f23: 89 d8 mov %ebx,%eax } 80104f25: 5b pop %ebx 80104f26: 5e pop %esi 80104f27: 5f pop %edi 80104f28: 5d pop %ebp 80104f29: c3 ret 80104f2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) return 0; 80104f30: 31 c0 xor %eax,%eax 80104f32: e9 49 ff ff ff jmp 80104e80 <create+0x70> 80104f37: 89 f6 mov %esi,%esi 80104f39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip->minor = minor; ip->nlink = 1; iupdate(ip); if(type == T_DIR){ // Create . and .. entries. dp->nlink++; // for ".." 80104f40: 66 83 47 56 01 addw $0x1,0x56(%edi) iupdate(dp); 80104f45: 83 ec 0c sub $0xc,%esp 80104f48: 57 push %edi 80104f49: e8 72 c6 ff ff call 801015c0 <iupdate> // No ip->nlink++ for ".": avoid cyclic ref count. if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) 80104f4e: 83 c4 0c add $0xc,%esp 80104f51: ff 73 04 pushl 0x4(%ebx) 80104f54: 68 e8 7d 10 80 push $0x80107de8 80104f59: 53 push %ebx 80104f5a: e8 a1 ce ff ff call 80101e00 <dirlink> 80104f5f: 83 c4 10 add $0x10,%esp 80104f62: 85 c0 test %eax,%eax 80104f64: 78 18 js 80104f7e <create+0x16e> 80104f66: 83 ec 04 sub $0x4,%esp 80104f69: ff 77 04 pushl 0x4(%edi) 80104f6c: 68 e7 7d 10 80 push $0x80107de7 80104f71: 53 push %ebx 80104f72: e8 89 ce ff ff call 80101e00 <dirlink> 80104f77: 83 c4 10 add $0x10,%esp 80104f7a: 85 c0 test %eax,%eax 80104f7c: 79 82 jns 80104f00 <create+0xf0> panic("create dots"); 80104f7e: 83 ec 0c sub $0xc,%esp 80104f81: 68 db 7d 10 80 push $0x80107ddb 80104f86: e8 e5 b3 ff ff call 80100370 <panic> } if(dirlink(dp, name, ip->inum) < 0) panic("create: dirlink"); 80104f8b: 83 ec 0c sub $0xc,%esp 80104f8e: 68 ea 7d 10 80 push $0x80107dea 80104f93: e8 d8 b3 ff ff call 80100370 <panic> iunlockput(ip); return 0; } if((ip = ialloc(dp->dev, type)) == 0) panic("create: ialloc"); 80104f98: 83 ec 0c sub $0xc,%esp 80104f9b: 68 cc 7d 10 80 push $0x80107dcc 80104fa0: e8 cb b3 ff ff call 80100370 <panic> 80104fa5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104fa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104fb0 <argfd.constprop.0>: #include "fcntl.h" // Fetch the nth word-sized system call argument as a file descriptor // and return both the descriptor and the corresponding struct file. static int argfd(int n, int *pfd, struct file **pf) 80104fb0: 55 push %ebp 80104fb1: 89 e5 mov %esp,%ebp 80104fb3: 56 push %esi 80104fb4: 53 push %ebx 80104fb5: 89 c6 mov %eax,%esi { int fd; struct file *f; if(argint(n, &fd) < 0) 80104fb7: 8d 45 f4 lea -0xc(%ebp),%eax #include "fcntl.h" // Fetch the nth word-sized system call argument as a file descriptor // and return both the descriptor and the corresponding struct file. static int argfd(int n, int *pfd, struct file **pf) 80104fba: 89 d3 mov %edx,%ebx 80104fbc: 83 ec 18 sub $0x18,%esp { int fd; struct file *f; if(argint(n, &fd) < 0) 80104fbf: 50 push %eax 80104fc0: 6a 00 push $0x0 80104fc2: e8 f9 fc ff ff call 80104cc0 <argint> 80104fc7: 83 c4 10 add $0x10,%esp 80104fca: 85 c0 test %eax,%eax 80104fcc: 78 32 js 80105000 <argfd.constprop.0+0x50> return -1; if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0) 80104fce: 83 7d f4 0f cmpl $0xf,-0xc(%ebp) 80104fd2: 77 2c ja 80105000 <argfd.constprop.0+0x50> 80104fd4: e8 a7 e7 ff ff call 80103780 <myproc> 80104fd9: 8b 55 f4 mov -0xc(%ebp),%edx 80104fdc: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax 80104fe0: 85 c0 test %eax,%eax 80104fe2: 74 1c je 80105000 <argfd.constprop.0+0x50> return -1; if(pfd) 80104fe4: 85 f6 test %esi,%esi 80104fe6: 74 02 je 80104fea <argfd.constprop.0+0x3a> *pfd = fd; 80104fe8: 89 16 mov %edx,(%esi) if(pf) 80104fea: 85 db test %ebx,%ebx 80104fec: 74 22 je 80105010 <argfd.constprop.0+0x60> *pf = f; 80104fee: 89 03 mov %eax,(%ebx) return 0; 80104ff0: 31 c0 xor %eax,%eax } 80104ff2: 8d 65 f8 lea -0x8(%ebp),%esp 80104ff5: 5b pop %ebx 80104ff6: 5e pop %esi 80104ff7: 5d pop %ebp 80104ff8: c3 ret 80104ff9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105000: 8d 65 f8 lea -0x8(%ebp),%esp { int fd; struct file *f; if(argint(n, &fd) < 0) return -1; 80105003: b8 ff ff ff ff mov $0xffffffff,%eax if(pfd) *pfd = fd; if(pf) *pf = f; return 0; } 80105008: 5b pop %ebx 80105009: 5e pop %esi 8010500a: 5d pop %ebp 8010500b: c3 ret 8010500c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; if(pfd) *pfd = fd; if(pf) *pf = f; return 0; 80105010: 31 c0 xor %eax,%eax 80105012: eb de jmp 80104ff2 <argfd.constprop.0+0x42> 80105014: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010501a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80105020 <sys_dup>: return -1; } int sys_dup(void) { 80105020: 55 push %ebp struct file *f; int fd; if(argfd(0, 0, &f) < 0) 80105021: 31 c0 xor %eax,%eax return -1; } int sys_dup(void) { 80105023: 89 e5 mov %esp,%ebp 80105025: 56 push %esi 80105026: 53 push %ebx struct file *f; int fd; if(argfd(0, 0, &f) < 0) 80105027: 8d 55 f4 lea -0xc(%ebp),%edx return -1; } int sys_dup(void) { 8010502a: 83 ec 10 sub $0x10,%esp struct file *f; int fd; if(argfd(0, 0, &f) < 0) 8010502d: e8 7e ff ff ff call 80104fb0 <argfd.constprop.0> 80105032: 85 c0 test %eax,%eax 80105034: 78 1a js 80105050 <sys_dup+0x30> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 80105036: 31 db xor %ebx,%ebx struct file *f; int fd; if(argfd(0, 0, &f) < 0) return -1; if((fd=fdalloc(f)) < 0) 80105038: 8b 75 f4 mov -0xc(%ebp),%esi // Takes over file reference from caller on success. static int fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); 8010503b: e8 40 e7 ff ff call 80103780 <myproc> for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ 80105040: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80105044: 85 d2 test %edx,%edx 80105046: 74 18 je 80105060 <sys_dup+0x40> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 80105048: 83 c3 01 add $0x1,%ebx 8010504b: 83 fb 10 cmp $0x10,%ebx 8010504e: 75 f0 jne 80105040 <sys_dup+0x20> return -1; if((fd=fdalloc(f)) < 0) return -1; filedup(f); return fd; } 80105050: 8d 65 f8 lea -0x8(%ebp),%esp { struct file *f; int fd; if(argfd(0, 0, &f) < 0) return -1; 80105053: b8 ff ff ff ff mov $0xffffffff,%eax if((fd=fdalloc(f)) < 0) return -1; filedup(f); return fd; } 80105058: 5b pop %ebx 80105059: 5e pop %esi 8010505a: 5d pop %ebp 8010505b: c3 ret 8010505c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ curproc->ofile[fd] = f; 80105060: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4) if(argfd(0, 0, &f) < 0) return -1; if((fd=fdalloc(f)) < 0) return -1; filedup(f); 80105064: 83 ec 0c sub $0xc,%esp 80105067: ff 75 f4 pushl -0xc(%ebp) 8010506a: e8 71 bd ff ff call 80100de0 <filedup> return fd; 8010506f: 83 c4 10 add $0x10,%esp } 80105072: 8d 65 f8 lea -0x8(%ebp),%esp if(argfd(0, 0, &f) < 0) return -1; if((fd=fdalloc(f)) < 0) return -1; filedup(f); return fd; 80105075: 89 d8 mov %ebx,%eax } 80105077: 5b pop %ebx 80105078: 5e pop %esi 80105079: 5d pop %ebp 8010507a: c3 ret 8010507b: 90 nop 8010507c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105080 <sys_read>: int sys_read(void) { 80105080: 55 push %ebp struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80105081: 31 c0 xor %eax,%eax return fd; } int sys_read(void) { 80105083: 89 e5 mov %esp,%ebp 80105085: 83 ec 18 sub $0x18,%esp struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80105088: 8d 55 ec lea -0x14(%ebp),%edx 8010508b: e8 20 ff ff ff call 80104fb0 <argfd.constprop.0> 80105090: 85 c0 test %eax,%eax 80105092: 78 4c js 801050e0 <sys_read+0x60> 80105094: 8d 45 f0 lea -0x10(%ebp),%eax 80105097: 83 ec 08 sub $0x8,%esp 8010509a: 50 push %eax 8010509b: 6a 02 push $0x2 8010509d: e8 1e fc ff ff call 80104cc0 <argint> 801050a2: 83 c4 10 add $0x10,%esp 801050a5: 85 c0 test %eax,%eax 801050a7: 78 37 js 801050e0 <sys_read+0x60> 801050a9: 8d 45 f4 lea -0xc(%ebp),%eax 801050ac: 83 ec 04 sub $0x4,%esp 801050af: ff 75 f0 pushl -0x10(%ebp) 801050b2: 50 push %eax 801050b3: 6a 01 push $0x1 801050b5: e8 56 fc ff ff call 80104d10 <argptr> 801050ba: 83 c4 10 add $0x10,%esp 801050bd: 85 c0 test %eax,%eax 801050bf: 78 1f js 801050e0 <sys_read+0x60> return -1; return fileread(f, p, n); 801050c1: 83 ec 04 sub $0x4,%esp 801050c4: ff 75 f0 pushl -0x10(%ebp) 801050c7: ff 75 f4 pushl -0xc(%ebp) 801050ca: ff 75 ec pushl -0x14(%ebp) 801050cd: e8 7e be ff ff call 80100f50 <fileread> 801050d2: 83 c4 10 add $0x10,%esp } 801050d5: c9 leave 801050d6: c3 ret 801050d7: 89 f6 mov %esi,%esi 801050d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) return -1; 801050e0: b8 ff ff ff ff mov $0xffffffff,%eax return fileread(f, p, n); } 801050e5: c9 leave 801050e6: c3 ret 801050e7: 89 f6 mov %esi,%esi 801050e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801050f0 <sys_write>: int sys_write(void) { 801050f0: 55 push %ebp struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 801050f1: 31 c0 xor %eax,%eax return fileread(f, p, n); } int sys_write(void) { 801050f3: 89 e5 mov %esp,%ebp 801050f5: 83 ec 18 sub $0x18,%esp struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 801050f8: 8d 55 ec lea -0x14(%ebp),%edx 801050fb: e8 b0 fe ff ff call 80104fb0 <argfd.constprop.0> 80105100: 85 c0 test %eax,%eax 80105102: 78 4c js 80105150 <sys_write+0x60> 80105104: 8d 45 f0 lea -0x10(%ebp),%eax 80105107: 83 ec 08 sub $0x8,%esp 8010510a: 50 push %eax 8010510b: 6a 02 push $0x2 8010510d: e8 ae fb ff ff call 80104cc0 <argint> 80105112: 83 c4 10 add $0x10,%esp 80105115: 85 c0 test %eax,%eax 80105117: 78 37 js 80105150 <sys_write+0x60> 80105119: 8d 45 f4 lea -0xc(%ebp),%eax 8010511c: 83 ec 04 sub $0x4,%esp 8010511f: ff 75 f0 pushl -0x10(%ebp) 80105122: 50 push %eax 80105123: 6a 01 push $0x1 80105125: e8 e6 fb ff ff call 80104d10 <argptr> 8010512a: 83 c4 10 add $0x10,%esp 8010512d: 85 c0 test %eax,%eax 8010512f: 78 1f js 80105150 <sys_write+0x60> return -1; return filewrite(f, p, n); 80105131: 83 ec 04 sub $0x4,%esp 80105134: ff 75 f0 pushl -0x10(%ebp) 80105137: ff 75 f4 pushl -0xc(%ebp) 8010513a: ff 75 ec pushl -0x14(%ebp) 8010513d: e8 9e be ff ff call 80100fe0 <filewrite> 80105142: 83 c4 10 add $0x10,%esp } 80105145: c9 leave 80105146: c3 ret 80105147: 89 f6 mov %esi,%esi 80105149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) return -1; 80105150: b8 ff ff ff ff mov $0xffffffff,%eax return filewrite(f, p, n); } 80105155: c9 leave 80105156: c3 ret 80105157: 89 f6 mov %esi,%esi 80105159: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105160 <sys_close>: int sys_close(void) { 80105160: 55 push %ebp 80105161: 89 e5 mov %esp,%ebp 80105163: 83 ec 18 sub $0x18,%esp int fd; struct file *f; if(argfd(0, &fd, &f) < 0) 80105166: 8d 55 f4 lea -0xc(%ebp),%edx 80105169: 8d 45 f0 lea -0x10(%ebp),%eax 8010516c: e8 3f fe ff ff call 80104fb0 <argfd.constprop.0> 80105171: 85 c0 test %eax,%eax 80105173: 78 2b js 801051a0 <sys_close+0x40> return -1; myproc()->ofile[fd] = 0; 80105175: e8 06 e6 ff ff call 80103780 <myproc> 8010517a: 8b 55 f0 mov -0x10(%ebp),%edx fileclose(f); 8010517d: 83 ec 0c sub $0xc,%esp int fd; struct file *f; if(argfd(0, &fd, &f) < 0) return -1; myproc()->ofile[fd] = 0; 80105180: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4) 80105187: 00 fileclose(f); 80105188: ff 75 f4 pushl -0xc(%ebp) 8010518b: e8 a0 bc ff ff call 80100e30 <fileclose> return 0; 80105190: 83 c4 10 add $0x10,%esp 80105193: 31 c0 xor %eax,%eax } 80105195: c9 leave 80105196: c3 ret 80105197: 89 f6 mov %esi,%esi 80105199: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi { int fd; struct file *f; if(argfd(0, &fd, &f) < 0) return -1; 801051a0: b8 ff ff ff ff mov $0xffffffff,%eax myproc()->ofile[fd] = 0; fileclose(f); return 0; } 801051a5: c9 leave 801051a6: c3 ret 801051a7: 89 f6 mov %esi,%esi 801051a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801051b0 <sys_fstat>: int sys_fstat(void) { 801051b0: 55 push %ebp struct file *f; struct stat *st; if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 801051b1: 31 c0 xor %eax,%eax return 0; } int sys_fstat(void) { 801051b3: 89 e5 mov %esp,%ebp 801051b5: 83 ec 18 sub $0x18,%esp struct file *f; struct stat *st; if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 801051b8: 8d 55 f0 lea -0x10(%ebp),%edx 801051bb: e8 f0 fd ff ff call 80104fb0 <argfd.constprop.0> 801051c0: 85 c0 test %eax,%eax 801051c2: 78 2c js 801051f0 <sys_fstat+0x40> 801051c4: 8d 45 f4 lea -0xc(%ebp),%eax 801051c7: 83 ec 04 sub $0x4,%esp 801051ca: 6a 14 push $0x14 801051cc: 50 push %eax 801051cd: 6a 01 push $0x1 801051cf: e8 3c fb ff ff call 80104d10 <argptr> 801051d4: 83 c4 10 add $0x10,%esp 801051d7: 85 c0 test %eax,%eax 801051d9: 78 15 js 801051f0 <sys_fstat+0x40> return -1; return filestat(f, st); 801051db: 83 ec 08 sub $0x8,%esp 801051de: ff 75 f4 pushl -0xc(%ebp) 801051e1: ff 75 f0 pushl -0x10(%ebp) 801051e4: e8 17 bd ff ff call 80100f00 <filestat> 801051e9: 83 c4 10 add $0x10,%esp } 801051ec: c9 leave 801051ed: c3 ret 801051ee: 66 90 xchg %ax,%ax { struct file *f; struct stat *st; if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) return -1; 801051f0: b8 ff ff ff ff mov $0xffffffff,%eax return filestat(f, st); } 801051f5: c9 leave 801051f6: c3 ret 801051f7: 89 f6 mov %esi,%esi 801051f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105200 <sys_link>: // Create the path new as a link to the same inode as old. int sys_link(void) { 80105200: 55 push %ebp 80105201: 89 e5 mov %esp,%ebp 80105203: 57 push %edi 80105204: 56 push %esi 80105205: 53 push %ebx char name[DIRSIZ], *new, *old; struct inode *dp, *ip; if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80105206: 8d 45 d4 lea -0x2c(%ebp),%eax } // Create the path new as a link to the same inode as old. int sys_link(void) { 80105209: 83 ec 34 sub $0x34,%esp char name[DIRSIZ], *new, *old; struct inode *dp, *ip; if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 8010520c: 50 push %eax 8010520d: 6a 00 push $0x0 8010520f: e8 5c fb ff ff call 80104d70 <argstr> 80105214: 83 c4 10 add $0x10,%esp 80105217: 85 c0 test %eax,%eax 80105219: 0f 88 fb 00 00 00 js 8010531a <sys_link+0x11a> 8010521f: 8d 45 d0 lea -0x30(%ebp),%eax 80105222: 83 ec 08 sub $0x8,%esp 80105225: 50 push %eax 80105226: 6a 01 push $0x1 80105228: e8 43 fb ff ff call 80104d70 <argstr> 8010522d: 83 c4 10 add $0x10,%esp 80105230: 85 c0 test %eax,%eax 80105232: 0f 88 e2 00 00 00 js 8010531a <sys_link+0x11a> return -1; begin_op(); 80105238: e8 13 d9 ff ff call 80102b50 <begin_op> if((ip = namei(old)) == 0){ 8010523d: 83 ec 0c sub $0xc,%esp 80105240: ff 75 d4 pushl -0x2c(%ebp) 80105243: e8 78 cc ff ff call 80101ec0 <namei> 80105248: 83 c4 10 add $0x10,%esp 8010524b: 85 c0 test %eax,%eax 8010524d: 89 c3 mov %eax,%ebx 8010524f: 0f 84 f3 00 00 00 je 80105348 <sys_link+0x148> end_op(); return -1; } ilock(ip); 80105255: 83 ec 0c sub $0xc,%esp 80105258: 50 push %eax 80105259: e8 12 c4 ff ff call 80101670 <ilock> if(ip->type == T_DIR){ 8010525e: 83 c4 10 add $0x10,%esp 80105261: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80105266: 0f 84 c4 00 00 00 je 80105330 <sys_link+0x130> iunlockput(ip); end_op(); return -1; } ip->nlink++; 8010526c: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(ip); 80105271: 83 ec 0c sub $0xc,%esp iunlock(ip); if((dp = nameiparent(new, name)) == 0) 80105274: 8d 7d da lea -0x26(%ebp),%edi end_op(); return -1; } ip->nlink++; iupdate(ip); 80105277: 53 push %ebx 80105278: e8 43 c3 ff ff call 801015c0 <iupdate> iunlock(ip); 8010527d: 89 1c 24 mov %ebx,(%esp) 80105280: e8 cb c4 ff ff call 80101750 <iunlock> if((dp = nameiparent(new, name)) == 0) 80105285: 58 pop %eax 80105286: 5a pop %edx 80105287: 57 push %edi 80105288: ff 75 d0 pushl -0x30(%ebp) 8010528b: e8 50 cc ff ff call 80101ee0 <nameiparent> 80105290: 83 c4 10 add $0x10,%esp 80105293: 85 c0 test %eax,%eax 80105295: 89 c6 mov %eax,%esi 80105297: 74 5b je 801052f4 <sys_link+0xf4> goto bad; ilock(dp); 80105299: 83 ec 0c sub $0xc,%esp 8010529c: 50 push %eax 8010529d: e8 ce c3 ff ff call 80101670 <ilock> if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ 801052a2: 83 c4 10 add $0x10,%esp 801052a5: 8b 03 mov (%ebx),%eax 801052a7: 39 06 cmp %eax,(%esi) 801052a9: 75 3d jne 801052e8 <sys_link+0xe8> 801052ab: 83 ec 04 sub $0x4,%esp 801052ae: ff 73 04 pushl 0x4(%ebx) 801052b1: 57 push %edi 801052b2: 56 push %esi 801052b3: e8 48 cb ff ff call 80101e00 <dirlink> 801052b8: 83 c4 10 add $0x10,%esp 801052bb: 85 c0 test %eax,%eax 801052bd: 78 29 js 801052e8 <sys_link+0xe8> iunlockput(dp); goto bad; } iunlockput(dp); 801052bf: 83 ec 0c sub $0xc,%esp 801052c2: 56 push %esi 801052c3: e8 38 c6 ff ff call 80101900 <iunlockput> iput(ip); 801052c8: 89 1c 24 mov %ebx,(%esp) 801052cb: e8 d0 c4 ff ff call 801017a0 <iput> end_op(); 801052d0: e8 eb d8 ff ff call 80102bc0 <end_op> return 0; 801052d5: 83 c4 10 add $0x10,%esp 801052d8: 31 c0 xor %eax,%eax ip->nlink--; iupdate(ip); iunlockput(ip); end_op(); return -1; } 801052da: 8d 65 f4 lea -0xc(%ebp),%esp 801052dd: 5b pop %ebx 801052de: 5e pop %esi 801052df: 5f pop %edi 801052e0: 5d pop %ebp 801052e1: c3 ret 801052e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if((dp = nameiparent(new, name)) == 0) goto bad; ilock(dp); if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ iunlockput(dp); 801052e8: 83 ec 0c sub $0xc,%esp 801052eb: 56 push %esi 801052ec: e8 0f c6 ff ff call 80101900 <iunlockput> goto bad; 801052f1: 83 c4 10 add $0x10,%esp end_op(); return 0; bad: ilock(ip); 801052f4: 83 ec 0c sub $0xc,%esp 801052f7: 53 push %ebx 801052f8: e8 73 c3 ff ff call 80101670 <ilock> ip->nlink--; 801052fd: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80105302: 89 1c 24 mov %ebx,(%esp) 80105305: e8 b6 c2 ff ff call 801015c0 <iupdate> iunlockput(ip); 8010530a: 89 1c 24 mov %ebx,(%esp) 8010530d: e8 ee c5 ff ff call 80101900 <iunlockput> end_op(); 80105312: e8 a9 d8 ff ff call 80102bc0 <end_op> return -1; 80105317: 83 c4 10 add $0x10,%esp } 8010531a: 8d 65 f4 lea -0xc(%ebp),%esp ilock(ip); ip->nlink--; iupdate(ip); iunlockput(ip); end_op(); return -1; 8010531d: b8 ff ff ff ff mov $0xffffffff,%eax } 80105322: 5b pop %ebx 80105323: 5e pop %esi 80105324: 5f pop %edi 80105325: 5d pop %ebp 80105326: c3 ret 80105327: 89 f6 mov %esi,%esi 80105329: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; } ilock(ip); if(ip->type == T_DIR){ iunlockput(ip); 80105330: 83 ec 0c sub $0xc,%esp 80105333: 53 push %ebx 80105334: e8 c7 c5 ff ff call 80101900 <iunlockput> end_op(); 80105339: e8 82 d8 ff ff call 80102bc0 <end_op> return -1; 8010533e: 83 c4 10 add $0x10,%esp 80105341: b8 ff ff ff ff mov $0xffffffff,%eax 80105346: eb 92 jmp 801052da <sys_link+0xda> if(argstr(0, &old) < 0 || argstr(1, &new) < 0) return -1; begin_op(); if((ip = namei(old)) == 0){ end_op(); 80105348: e8 73 d8 ff ff call 80102bc0 <end_op> return -1; 8010534d: b8 ff ff ff ff mov $0xffffffff,%eax 80105352: eb 86 jmp 801052da <sys_link+0xda> 80105354: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010535a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80105360 <sys_unlink>: } //PAGEBREAK! int sys_unlink(void) { 80105360: 55 push %ebp 80105361: 89 e5 mov %esp,%ebp 80105363: 57 push %edi 80105364: 56 push %esi 80105365: 53 push %ebx struct inode *ip, *dp; struct dirent de; char name[DIRSIZ], *path; uint off; if(argstr(0, &path) < 0) 80105366: 8d 45 c0 lea -0x40(%ebp),%eax } //PAGEBREAK! int sys_unlink(void) { 80105369: 83 ec 54 sub $0x54,%esp struct inode *ip, *dp; struct dirent de; char name[DIRSIZ], *path; uint off; if(argstr(0, &path) < 0) 8010536c: 50 push %eax 8010536d: 6a 00 push $0x0 8010536f: e8 fc f9 ff ff call 80104d70 <argstr> 80105374: 83 c4 10 add $0x10,%esp 80105377: 85 c0 test %eax,%eax 80105379: 0f 88 82 01 00 00 js 80105501 <sys_unlink+0x1a1> return -1; begin_op(); if((dp = nameiparent(path, name)) == 0){ 8010537f: 8d 5d ca lea -0x36(%ebp),%ebx uint off; if(argstr(0, &path) < 0) return -1; begin_op(); 80105382: e8 c9 d7 ff ff call 80102b50 <begin_op> if((dp = nameiparent(path, name)) == 0){ 80105387: 83 ec 08 sub $0x8,%esp 8010538a: 53 push %ebx 8010538b: ff 75 c0 pushl -0x40(%ebp) 8010538e: e8 4d cb ff ff call 80101ee0 <nameiparent> 80105393: 83 c4 10 add $0x10,%esp 80105396: 85 c0 test %eax,%eax 80105398: 89 45 b4 mov %eax,-0x4c(%ebp) 8010539b: 0f 84 6a 01 00 00 je 8010550b <sys_unlink+0x1ab> end_op(); return -1; } ilock(dp); 801053a1: 8b 75 b4 mov -0x4c(%ebp),%esi 801053a4: 83 ec 0c sub $0xc,%esp 801053a7: 56 push %esi 801053a8: e8 c3 c2 ff ff call 80101670 <ilock> // Cannot unlink "." or "..". if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0) 801053ad: 58 pop %eax 801053ae: 5a pop %edx 801053af: 68 e8 7d 10 80 push $0x80107de8 801053b4: 53 push %ebx 801053b5: e8 c6 c7 ff ff call 80101b80 <namecmp> 801053ba: 83 c4 10 add $0x10,%esp 801053bd: 85 c0 test %eax,%eax 801053bf: 0f 84 fc 00 00 00 je 801054c1 <sys_unlink+0x161> 801053c5: 83 ec 08 sub $0x8,%esp 801053c8: 68 e7 7d 10 80 push $0x80107de7 801053cd: 53 push %ebx 801053ce: e8 ad c7 ff ff call 80101b80 <namecmp> 801053d3: 83 c4 10 add $0x10,%esp 801053d6: 85 c0 test %eax,%eax 801053d8: 0f 84 e3 00 00 00 je 801054c1 <sys_unlink+0x161> goto bad; if((ip = dirlookup(dp, name, &off)) == 0) 801053de: 8d 45 c4 lea -0x3c(%ebp),%eax 801053e1: 83 ec 04 sub $0x4,%esp 801053e4: 50 push %eax 801053e5: 53 push %ebx 801053e6: 56 push %esi 801053e7: e8 b4 c7 ff ff call 80101ba0 <dirlookup> 801053ec: 83 c4 10 add $0x10,%esp 801053ef: 85 c0 test %eax,%eax 801053f1: 89 c3 mov %eax,%ebx 801053f3: 0f 84 c8 00 00 00 je 801054c1 <sys_unlink+0x161> goto bad; ilock(ip); 801053f9: 83 ec 0c sub $0xc,%esp 801053fc: 50 push %eax 801053fd: e8 6e c2 ff ff call 80101670 <ilock> if(ip->nlink < 1) 80105402: 83 c4 10 add $0x10,%esp 80105405: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 8010540a: 0f 8e 24 01 00 00 jle 80105534 <sys_unlink+0x1d4> panic("unlink: nlink < 1"); if(ip->type == T_DIR && !isdirempty(ip)){ 80105410: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80105415: 8d 75 d8 lea -0x28(%ebp),%esi 80105418: 74 66 je 80105480 <sys_unlink+0x120> iunlockput(ip); goto bad; } memset(&de, 0, sizeof(de)); 8010541a: 83 ec 04 sub $0x4,%esp 8010541d: 6a 10 push $0x10 8010541f: 6a 00 push $0x0 80105421: 56 push %esi 80105422: e8 89 f5 ff ff call 801049b0 <memset> if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80105427: 6a 10 push $0x10 80105429: ff 75 c4 pushl -0x3c(%ebp) 8010542c: 56 push %esi 8010542d: ff 75 b4 pushl -0x4c(%ebp) 80105430: e8 1b c6 ff ff call 80101a50 <writei> 80105435: 83 c4 20 add $0x20,%esp 80105438: 83 f8 10 cmp $0x10,%eax 8010543b: 0f 85 e6 00 00 00 jne 80105527 <sys_unlink+0x1c7> panic("unlink: writei"); if(ip->type == T_DIR){ 80105441: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80105446: 0f 84 9c 00 00 00 je 801054e8 <sys_unlink+0x188> dp->nlink--; iupdate(dp); } iunlockput(dp); 8010544c: 83 ec 0c sub $0xc,%esp 8010544f: ff 75 b4 pushl -0x4c(%ebp) 80105452: e8 a9 c4 ff ff call 80101900 <iunlockput> ip->nlink--; 80105457: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 8010545c: 89 1c 24 mov %ebx,(%esp) 8010545f: e8 5c c1 ff ff call 801015c0 <iupdate> iunlockput(ip); 80105464: 89 1c 24 mov %ebx,(%esp) 80105467: e8 94 c4 ff ff call 80101900 <iunlockput> end_op(); 8010546c: e8 4f d7 ff ff call 80102bc0 <end_op> return 0; 80105471: 83 c4 10 add $0x10,%esp 80105474: 31 c0 xor %eax,%eax bad: iunlockput(dp); end_op(); return -1; } 80105476: 8d 65 f4 lea -0xc(%ebp),%esp 80105479: 5b pop %ebx 8010547a: 5e pop %esi 8010547b: 5f pop %edi 8010547c: 5d pop %ebp 8010547d: c3 ret 8010547e: 66 90 xchg %ax,%ax isdirempty(struct inode *dp) { int off; struct dirent de; for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 80105480: 83 7b 58 20 cmpl $0x20,0x58(%ebx) 80105484: 76 94 jbe 8010541a <sys_unlink+0xba> 80105486: bf 20 00 00 00 mov $0x20,%edi 8010548b: eb 0f jmp 8010549c <sys_unlink+0x13c> 8010548d: 8d 76 00 lea 0x0(%esi),%esi 80105490: 83 c7 10 add $0x10,%edi 80105493: 3b 7b 58 cmp 0x58(%ebx),%edi 80105496: 0f 83 7e ff ff ff jae 8010541a <sys_unlink+0xba> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 8010549c: 6a 10 push $0x10 8010549e: 57 push %edi 8010549f: 56 push %esi 801054a0: 53 push %ebx 801054a1: e8 aa c4 ff ff call 80101950 <readi> 801054a6: 83 c4 10 add $0x10,%esp 801054a9: 83 f8 10 cmp $0x10,%eax 801054ac: 75 6c jne 8010551a <sys_unlink+0x1ba> panic("isdirempty: readi"); if(de.inum != 0) 801054ae: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 801054b3: 74 db je 80105490 <sys_unlink+0x130> ilock(ip); if(ip->nlink < 1) panic("unlink: nlink < 1"); if(ip->type == T_DIR && !isdirempty(ip)){ iunlockput(ip); 801054b5: 83 ec 0c sub $0xc,%esp 801054b8: 53 push %ebx 801054b9: e8 42 c4 ff ff call 80101900 <iunlockput> goto bad; 801054be: 83 c4 10 add $0x10,%esp end_op(); return 0; bad: iunlockput(dp); 801054c1: 83 ec 0c sub $0xc,%esp 801054c4: ff 75 b4 pushl -0x4c(%ebp) 801054c7: e8 34 c4 ff ff call 80101900 <iunlockput> end_op(); 801054cc: e8 ef d6 ff ff call 80102bc0 <end_op> return -1; 801054d1: 83 c4 10 add $0x10,%esp } 801054d4: 8d 65 f4 lea -0xc(%ebp),%esp return 0; bad: iunlockput(dp); end_op(); return -1; 801054d7: b8 ff ff ff ff mov $0xffffffff,%eax } 801054dc: 5b pop %ebx 801054dd: 5e pop %esi 801054de: 5f pop %edi 801054df: 5d pop %ebp 801054e0: c3 ret 801054e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi memset(&de, 0, sizeof(de)); if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("unlink: writei"); if(ip->type == T_DIR){ dp->nlink--; 801054e8: 8b 45 b4 mov -0x4c(%ebp),%eax iupdate(dp); 801054eb: 83 ec 0c sub $0xc,%esp memset(&de, 0, sizeof(de)); if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("unlink: writei"); if(ip->type == T_DIR){ dp->nlink--; 801054ee: 66 83 68 56 01 subw $0x1,0x56(%eax) iupdate(dp); 801054f3: 50 push %eax 801054f4: e8 c7 c0 ff ff call 801015c0 <iupdate> 801054f9: 83 c4 10 add $0x10,%esp 801054fc: e9 4b ff ff ff jmp 8010544c <sys_unlink+0xec> struct dirent de; char name[DIRSIZ], *path; uint off; if(argstr(0, &path) < 0) return -1; 80105501: b8 ff ff ff ff mov $0xffffffff,%eax 80105506: e9 6b ff ff ff jmp 80105476 <sys_unlink+0x116> begin_op(); if((dp = nameiparent(path, name)) == 0){ end_op(); 8010550b: e8 b0 d6 ff ff call 80102bc0 <end_op> return -1; 80105510: b8 ff ff ff ff mov $0xffffffff,%eax 80105515: e9 5c ff ff ff jmp 80105476 <sys_unlink+0x116> int off; struct dirent de; for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("isdirempty: readi"); 8010551a: 83 ec 0c sub $0xc,%esp 8010551d: 68 0c 7e 10 80 push $0x80107e0c 80105522: e8 49 ae ff ff call 80100370 <panic> goto bad; } memset(&de, 0, sizeof(de)); if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("unlink: writei"); 80105527: 83 ec 0c sub $0xc,%esp 8010552a: 68 1e 7e 10 80 push $0x80107e1e 8010552f: e8 3c ae ff ff call 80100370 <panic> if((ip = dirlookup(dp, name, &off)) == 0) goto bad; ilock(ip); if(ip->nlink < 1) panic("unlink: nlink < 1"); 80105534: 83 ec 0c sub $0xc,%esp 80105537: 68 fa 7d 10 80 push $0x80107dfa 8010553c: e8 2f ae ff ff call 80100370 <panic> 80105541: eb 0d jmp 80105550 <sys_open> 80105543: 90 nop 80105544: 90 nop 80105545: 90 nop 80105546: 90 nop 80105547: 90 nop 80105548: 90 nop 80105549: 90 nop 8010554a: 90 nop 8010554b: 90 nop 8010554c: 90 nop 8010554d: 90 nop 8010554e: 90 nop 8010554f: 90 nop 80105550 <sys_open>: return ip; } int sys_open(void) { 80105550: 55 push %ebp 80105551: 89 e5 mov %esp,%ebp 80105553: 57 push %edi 80105554: 56 push %esi 80105555: 53 push %ebx char *path; int fd, omode; struct file *f; struct inode *ip; if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 80105556: 8d 45 e0 lea -0x20(%ebp),%eax return ip; } int sys_open(void) { 80105559: 83 ec 24 sub $0x24,%esp char *path; int fd, omode; struct file *f; struct inode *ip; if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 8010555c: 50 push %eax 8010555d: 6a 00 push $0x0 8010555f: e8 0c f8 ff ff call 80104d70 <argstr> 80105564: 83 c4 10 add $0x10,%esp 80105567: 85 c0 test %eax,%eax 80105569: 0f 88 9e 00 00 00 js 8010560d <sys_open+0xbd> 8010556f: 8d 45 e4 lea -0x1c(%ebp),%eax 80105572: 83 ec 08 sub $0x8,%esp 80105575: 50 push %eax 80105576: 6a 01 push $0x1 80105578: e8 43 f7 ff ff call 80104cc0 <argint> 8010557d: 83 c4 10 add $0x10,%esp 80105580: 85 c0 test %eax,%eax 80105582: 0f 88 85 00 00 00 js 8010560d <sys_open+0xbd> return -1; begin_op(); 80105588: e8 c3 d5 ff ff call 80102b50 <begin_op> if(omode & O_CREATE){ 8010558d: f6 45 e5 02 testb $0x2,-0x1b(%ebp) 80105591: 0f 85 89 00 00 00 jne 80105620 <sys_open+0xd0> if(ip == 0){ end_op(); return -1; } } else { if((ip = namei(path)) == 0){ 80105597: 83 ec 0c sub $0xc,%esp 8010559a: ff 75 e0 pushl -0x20(%ebp) 8010559d: e8 1e c9 ff ff call 80101ec0 <namei> 801055a2: 83 c4 10 add $0x10,%esp 801055a5: 85 c0 test %eax,%eax 801055a7: 89 c6 mov %eax,%esi 801055a9: 0f 84 8e 00 00 00 je 8010563d <sys_open+0xed> end_op(); return -1; } ilock(ip); 801055af: 83 ec 0c sub $0xc,%esp 801055b2: 50 push %eax 801055b3: e8 b8 c0 ff ff call 80101670 <ilock> if(ip->type == T_DIR && omode != O_RDONLY){ 801055b8: 83 c4 10 add $0x10,%esp 801055bb: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 801055c0: 0f 84 d2 00 00 00 je 80105698 <sys_open+0x148> end_op(); return -1; } } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ 801055c6: e8 a5 b7 ff ff call 80100d70 <filealloc> 801055cb: 85 c0 test %eax,%eax 801055cd: 89 c7 mov %eax,%edi 801055cf: 74 2b je 801055fc <sys_open+0xac> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 801055d1: 31 db xor %ebx,%ebx // Takes over file reference from caller on success. static int fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); 801055d3: e8 a8 e1 ff ff call 80103780 <myproc> 801055d8: 90 nop 801055d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ 801055e0: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 801055e4: 85 d2 test %edx,%edx 801055e6: 74 68 je 80105650 <sys_open+0x100> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 801055e8: 83 c3 01 add $0x1,%ebx 801055eb: 83 fb 10 cmp $0x10,%ebx 801055ee: 75 f0 jne 801055e0 <sys_open+0x90> } } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ if(f) fileclose(f); 801055f0: 83 ec 0c sub $0xc,%esp 801055f3: 57 push %edi 801055f4: e8 37 b8 ff ff call 80100e30 <fileclose> 801055f9: 83 c4 10 add $0x10,%esp iunlockput(ip); 801055fc: 83 ec 0c sub $0xc,%esp 801055ff: 56 push %esi 80105600: e8 fb c2 ff ff call 80101900 <iunlockput> end_op(); 80105605: e8 b6 d5 ff ff call 80102bc0 <end_op> return -1; 8010560a: 83 c4 10 add $0x10,%esp f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); f->writable = (omode & O_WRONLY) || (omode & O_RDWR); return fd; } 8010560d: 8d 65 f4 lea -0xc(%ebp),%esp if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ if(f) fileclose(f); iunlockput(ip); end_op(); return -1; 80105610: b8 ff ff ff ff mov $0xffffffff,%eax f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); f->writable = (omode & O_WRONLY) || (omode & O_RDWR); return fd; } 80105615: 5b pop %ebx 80105616: 5e pop %esi 80105617: 5f pop %edi 80105618: 5d pop %ebp 80105619: c3 ret 8010561a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; begin_op(); if(omode & O_CREATE){ ip = create(path, T_FILE, 0, 0); 80105620: 83 ec 0c sub $0xc,%esp 80105623: 8b 45 e0 mov -0x20(%ebp),%eax 80105626: 31 c9 xor %ecx,%ecx 80105628: 6a 00 push $0x0 8010562a: ba 02 00 00 00 mov $0x2,%edx 8010562f: e8 dc f7 ff ff call 80104e10 <create> if(ip == 0){ 80105634: 83 c4 10 add $0x10,%esp 80105637: 85 c0 test %eax,%eax return -1; begin_op(); if(omode & O_CREATE){ ip = create(path, T_FILE, 0, 0); 80105639: 89 c6 mov %eax,%esi if(ip == 0){ 8010563b: 75 89 jne 801055c6 <sys_open+0x76> end_op(); 8010563d: e8 7e d5 ff ff call 80102bc0 <end_op> return -1; 80105642: b8 ff ff ff ff mov $0xffffffff,%eax 80105647: eb 43 jmp 8010568c <sys_open+0x13c> 80105649: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi fileclose(f); iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105650: 83 ec 0c sub $0xc,%esp int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ curproc->ofile[fd] = f; 80105653: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4) fileclose(f); iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105657: 56 push %esi 80105658: e8 f3 c0 ff ff call 80101750 <iunlock> end_op(); 8010565d: e8 5e d5 ff ff call 80102bc0 <end_op> f->type = FD_INODE; 80105662: c7 07 02 00 00 00 movl $0x2,(%edi) f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 80105668: 8b 55 e4 mov -0x1c(%ebp),%edx f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 8010566b: 83 c4 10 add $0x10,%esp } iunlock(ip); end_op(); f->type = FD_INODE; f->ip = ip; 8010566e: 89 77 10 mov %esi,0x10(%edi) f->off = 0; 80105671: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi) f->readable = !(omode & O_WRONLY); 80105678: 89 d0 mov %edx,%eax 8010567a: 83 e0 01 and $0x1,%eax 8010567d: 83 f0 01 xor $0x1,%eax f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80105680: 83 e2 03 and $0x3,%edx end_op(); f->type = FD_INODE; f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 80105683: 88 47 08 mov %al,0x8(%edi) f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80105686: 0f 95 47 09 setne 0x9(%edi) return fd; 8010568a: 89 d8 mov %ebx,%eax } 8010568c: 8d 65 f4 lea -0xc(%ebp),%esp 8010568f: 5b pop %ebx 80105690: 5e pop %esi 80105691: 5f pop %edi 80105692: 5d pop %ebp 80105693: c3 ret 80105694: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if((ip = namei(path)) == 0){ end_op(); return -1; } ilock(ip); if(ip->type == T_DIR && omode != O_RDONLY){ 80105698: 8b 4d e4 mov -0x1c(%ebp),%ecx 8010569b: 85 c9 test %ecx,%ecx 8010569d: 0f 84 23 ff ff ff je 801055c6 <sys_open+0x76> 801056a3: e9 54 ff ff ff jmp 801055fc <sys_open+0xac> 801056a8: 90 nop 801056a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801056b0 <sys_mkdir>: return fd; } int sys_mkdir(void) { 801056b0: 55 push %ebp 801056b1: 89 e5 mov %esp,%ebp 801056b3: 83 ec 18 sub $0x18,%esp char *path; struct inode *ip; begin_op(); 801056b6: e8 95 d4 ff ff call 80102b50 <begin_op> if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ 801056bb: 8d 45 f4 lea -0xc(%ebp),%eax 801056be: 83 ec 08 sub $0x8,%esp 801056c1: 50 push %eax 801056c2: 6a 00 push $0x0 801056c4: e8 a7 f6 ff ff call 80104d70 <argstr> 801056c9: 83 c4 10 add $0x10,%esp 801056cc: 85 c0 test %eax,%eax 801056ce: 78 30 js 80105700 <sys_mkdir+0x50> 801056d0: 83 ec 0c sub $0xc,%esp 801056d3: 8b 45 f4 mov -0xc(%ebp),%eax 801056d6: 31 c9 xor %ecx,%ecx 801056d8: 6a 00 push $0x0 801056da: ba 01 00 00 00 mov $0x1,%edx 801056df: e8 2c f7 ff ff call 80104e10 <create> 801056e4: 83 c4 10 add $0x10,%esp 801056e7: 85 c0 test %eax,%eax 801056e9: 74 15 je 80105700 <sys_mkdir+0x50> end_op(); return -1; } iunlockput(ip); 801056eb: 83 ec 0c sub $0xc,%esp 801056ee: 50 push %eax 801056ef: e8 0c c2 ff ff call 80101900 <iunlockput> end_op(); 801056f4: e8 c7 d4 ff ff call 80102bc0 <end_op> return 0; 801056f9: 83 c4 10 add $0x10,%esp 801056fc: 31 c0 xor %eax,%eax } 801056fe: c9 leave 801056ff: c3 ret char *path; struct inode *ip; begin_op(); if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ end_op(); 80105700: e8 bb d4 ff ff call 80102bc0 <end_op> return -1; 80105705: b8 ff ff ff ff mov $0xffffffff,%eax } iunlockput(ip); end_op(); return 0; } 8010570a: c9 leave 8010570b: c3 ret 8010570c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105710 <sys_mknod>: int sys_mknod(void) { 80105710: 55 push %ebp 80105711: 89 e5 mov %esp,%ebp 80105713: 83 ec 18 sub $0x18,%esp struct inode *ip; char *path; int major, minor; begin_op(); 80105716: e8 35 d4 ff ff call 80102b50 <begin_op> if((argstr(0, &path)) < 0 || 8010571b: 8d 45 ec lea -0x14(%ebp),%eax 8010571e: 83 ec 08 sub $0x8,%esp 80105721: 50 push %eax 80105722: 6a 00 push $0x0 80105724: e8 47 f6 ff ff call 80104d70 <argstr> 80105729: 83 c4 10 add $0x10,%esp 8010572c: 85 c0 test %eax,%eax 8010572e: 78 60 js 80105790 <sys_mknod+0x80> argint(1, &major) < 0 || 80105730: 8d 45 f0 lea -0x10(%ebp),%eax 80105733: 83 ec 08 sub $0x8,%esp 80105736: 50 push %eax 80105737: 6a 01 push $0x1 80105739: e8 82 f5 ff ff call 80104cc0 <argint> struct inode *ip; char *path; int major, minor; begin_op(); if((argstr(0, &path)) < 0 || 8010573e: 83 c4 10 add $0x10,%esp 80105741: 85 c0 test %eax,%eax 80105743: 78 4b js 80105790 <sys_mknod+0x80> argint(1, &major) < 0 || argint(2, &minor) < 0 || 80105745: 8d 45 f4 lea -0xc(%ebp),%eax 80105748: 83 ec 08 sub $0x8,%esp 8010574b: 50 push %eax 8010574c: 6a 02 push $0x2 8010574e: e8 6d f5 ff ff call 80104cc0 <argint> char *path; int major, minor; begin_op(); if((argstr(0, &path)) < 0 || argint(1, &major) < 0 || 80105753: 83 c4 10 add $0x10,%esp 80105756: 85 c0 test %eax,%eax 80105758: 78 36 js 80105790 <sys_mknod+0x80> argint(2, &minor) < 0 || 8010575a: 0f bf 45 f4 movswl -0xc(%ebp),%eax 8010575e: 83 ec 0c sub $0xc,%esp 80105761: 0f bf 4d f0 movswl -0x10(%ebp),%ecx 80105765: ba 03 00 00 00 mov $0x3,%edx 8010576a: 50 push %eax 8010576b: 8b 45 ec mov -0x14(%ebp),%eax 8010576e: e8 9d f6 ff ff call 80104e10 <create> 80105773: 83 c4 10 add $0x10,%esp 80105776: 85 c0 test %eax,%eax 80105778: 74 16 je 80105790 <sys_mknod+0x80> (ip = create(path, T_DEV, major, minor)) == 0){ end_op(); return -1; } iunlockput(ip); 8010577a: 83 ec 0c sub $0xc,%esp 8010577d: 50 push %eax 8010577e: e8 7d c1 ff ff call 80101900 <iunlockput> end_op(); 80105783: e8 38 d4 ff ff call 80102bc0 <end_op> return 0; 80105788: 83 c4 10 add $0x10,%esp 8010578b: 31 c0 xor %eax,%eax } 8010578d: c9 leave 8010578e: c3 ret 8010578f: 90 nop begin_op(); if((argstr(0, &path)) < 0 || argint(1, &major) < 0 || argint(2, &minor) < 0 || (ip = create(path, T_DEV, major, minor)) == 0){ end_op(); 80105790: e8 2b d4 ff ff call 80102bc0 <end_op> return -1; 80105795: b8 ff ff ff ff mov $0xffffffff,%eax } iunlockput(ip); end_op(); return 0; } 8010579a: c9 leave 8010579b: c3 ret 8010579c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801057a0 <sys_chdir>: int sys_chdir(void) { 801057a0: 55 push %ebp 801057a1: 89 e5 mov %esp,%ebp 801057a3: 56 push %esi 801057a4: 53 push %ebx 801057a5: 83 ec 10 sub $0x10,%esp char *path; struct inode *ip; struct proc *curproc = myproc(); 801057a8: e8 d3 df ff ff call 80103780 <myproc> 801057ad: 89 c6 mov %eax,%esi begin_op(); 801057af: e8 9c d3 ff ff call 80102b50 <begin_op> if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ 801057b4: 8d 45 f4 lea -0xc(%ebp),%eax 801057b7: 83 ec 08 sub $0x8,%esp 801057ba: 50 push %eax 801057bb: 6a 00 push $0x0 801057bd: e8 ae f5 ff ff call 80104d70 <argstr> 801057c2: 83 c4 10 add $0x10,%esp 801057c5: 85 c0 test %eax,%eax 801057c7: 78 77 js 80105840 <sys_chdir+0xa0> 801057c9: 83 ec 0c sub $0xc,%esp 801057cc: ff 75 f4 pushl -0xc(%ebp) 801057cf: e8 ec c6 ff ff call 80101ec0 <namei> 801057d4: 83 c4 10 add $0x10,%esp 801057d7: 85 c0 test %eax,%eax 801057d9: 89 c3 mov %eax,%ebx 801057db: 74 63 je 80105840 <sys_chdir+0xa0> end_op(); return -1; } ilock(ip); 801057dd: 83 ec 0c sub $0xc,%esp 801057e0: 50 push %eax 801057e1: e8 8a be ff ff call 80101670 <ilock> if(ip->type != T_DIR){ 801057e6: 83 c4 10 add $0x10,%esp 801057e9: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 801057ee: 75 30 jne 80105820 <sys_chdir+0x80> iunlockput(ip); end_op(); return -1; } iunlock(ip); 801057f0: 83 ec 0c sub $0xc,%esp 801057f3: 53 push %ebx 801057f4: e8 57 bf ff ff call 80101750 <iunlock> iput(curproc->cwd); 801057f9: 58 pop %eax 801057fa: ff 76 68 pushl 0x68(%esi) 801057fd: e8 9e bf ff ff call 801017a0 <iput> end_op(); 80105802: e8 b9 d3 ff ff call 80102bc0 <end_op> curproc->cwd = ip; 80105807: 89 5e 68 mov %ebx,0x68(%esi) return 0; 8010580a: 83 c4 10 add $0x10,%esp 8010580d: 31 c0 xor %eax,%eax } 8010580f: 8d 65 f8 lea -0x8(%ebp),%esp 80105812: 5b pop %ebx 80105813: 5e pop %esi 80105814: 5d pop %ebp 80105815: c3 ret 80105816: 8d 76 00 lea 0x0(%esi),%esi 80105819: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi end_op(); return -1; } ilock(ip); if(ip->type != T_DIR){ iunlockput(ip); 80105820: 83 ec 0c sub $0xc,%esp 80105823: 53 push %ebx 80105824: e8 d7 c0 ff ff call 80101900 <iunlockput> end_op(); 80105829: e8 92 d3 ff ff call 80102bc0 <end_op> return -1; 8010582e: 83 c4 10 add $0x10,%esp 80105831: b8 ff ff ff ff mov $0xffffffff,%eax 80105836: eb d7 jmp 8010580f <sys_chdir+0x6f> 80105838: 90 nop 80105839: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi struct inode *ip; struct proc *curproc = myproc(); begin_op(); if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ end_op(); 80105840: e8 7b d3 ff ff call 80102bc0 <end_op> return -1; 80105845: b8 ff ff ff ff mov $0xffffffff,%eax 8010584a: eb c3 jmp 8010580f <sys_chdir+0x6f> 8010584c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105850 <sys_exec>: return 0; } int sys_exec(void) { 80105850: 55 push %ebp 80105851: 89 e5 mov %esp,%ebp 80105853: 57 push %edi 80105854: 56 push %esi 80105855: 53 push %ebx char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 80105856: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax return 0; } int sys_exec(void) { 8010585c: 81 ec a4 00 00 00 sub $0xa4,%esp char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 80105862: 50 push %eax 80105863: 6a 00 push $0x0 80105865: e8 06 f5 ff ff call 80104d70 <argstr> 8010586a: 83 c4 10 add $0x10,%esp 8010586d: 85 c0 test %eax,%eax 8010586f: 78 7f js 801058f0 <sys_exec+0xa0> 80105871: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax 80105877: 83 ec 08 sub $0x8,%esp 8010587a: 50 push %eax 8010587b: 6a 01 push $0x1 8010587d: e8 3e f4 ff ff call 80104cc0 <argint> 80105882: 83 c4 10 add $0x10,%esp 80105885: 85 c0 test %eax,%eax 80105887: 78 67 js 801058f0 <sys_exec+0xa0> return -1; } memset(argv, 0, sizeof(argv)); 80105889: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 8010588f: 83 ec 04 sub $0x4,%esp 80105892: 8d b5 68 ff ff ff lea -0x98(%ebp),%esi 80105898: 68 80 00 00 00 push $0x80 8010589d: 6a 00 push $0x0 8010589f: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi 801058a5: 50 push %eax 801058a6: 31 db xor %ebx,%ebx 801058a8: e8 03 f1 ff ff call 801049b0 <memset> 801058ad: 83 c4 10 add $0x10,%esp for(i=0;; i++){ if(i >= NELEM(argv)) return -1; if(fetchint(uargv+4*i, (int*)&uarg) < 0) 801058b0: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax 801058b6: 83 ec 08 sub $0x8,%esp 801058b9: 57 push %edi 801058ba: 8d 04 98 lea (%eax,%ebx,4),%eax 801058bd: 50 push %eax 801058be: e8 5d f3 ff ff call 80104c20 <fetchint> 801058c3: 83 c4 10 add $0x10,%esp 801058c6: 85 c0 test %eax,%eax 801058c8: 78 26 js 801058f0 <sys_exec+0xa0> return -1; if(uarg == 0){ 801058ca: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax 801058d0: 85 c0 test %eax,%eax 801058d2: 74 2c je 80105900 <sys_exec+0xb0> argv[i] = 0; break; } if(fetchstr(uarg, &argv[i]) < 0) 801058d4: 83 ec 08 sub $0x8,%esp 801058d7: 56 push %esi 801058d8: 50 push %eax 801058d9: e8 82 f3 ff ff call 80104c60 <fetchstr> 801058de: 83 c4 10 add $0x10,%esp 801058e1: 85 c0 test %eax,%eax 801058e3: 78 0b js 801058f0 <sys_exec+0xa0> if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ return -1; } memset(argv, 0, sizeof(argv)); for(i=0;; i++){ 801058e5: 83 c3 01 add $0x1,%ebx 801058e8: 83 c6 04 add $0x4,%esi if(i >= NELEM(argv)) 801058eb: 83 fb 20 cmp $0x20,%ebx 801058ee: 75 c0 jne 801058b0 <sys_exec+0x60> } if(fetchstr(uarg, &argv[i]) < 0) return -1; } return exec(path, argv); } 801058f0: 8d 65 f4 lea -0xc(%ebp),%esp char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ return -1; 801058f3: b8 ff ff ff ff mov $0xffffffff,%eax } if(fetchstr(uarg, &argv[i]) < 0) return -1; } return exec(path, argv); } 801058f8: 5b pop %ebx 801058f9: 5e pop %esi 801058fa: 5f pop %edi 801058fb: 5d pop %ebp 801058fc: c3 ret 801058fd: 8d 76 00 lea 0x0(%esi),%esi break; } if(fetchstr(uarg, &argv[i]) < 0) return -1; } return exec(path, argv); 80105900: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105906: 83 ec 08 sub $0x8,%esp if(i >= NELEM(argv)) return -1; if(fetchint(uargv+4*i, (int*)&uarg) < 0) return -1; if(uarg == 0){ argv[i] = 0; 80105909: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4) 80105910: 00 00 00 00 break; } if(fetchstr(uarg, &argv[i]) < 0) return -1; } return exec(path, argv); 80105914: 50 push %eax 80105915: ff b5 5c ff ff ff pushl -0xa4(%ebp) 8010591b: e8 d0 b0 ff ff call 801009f0 <exec> 80105920: 83 c4 10 add $0x10,%esp } 80105923: 8d 65 f4 lea -0xc(%ebp),%esp 80105926: 5b pop %ebx 80105927: 5e pop %esi 80105928: 5f pop %edi 80105929: 5d pop %ebp 8010592a: c3 ret 8010592b: 90 nop 8010592c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105930 <sys_pipe>: int sys_pipe(void) { 80105930: 55 push %ebp 80105931: 89 e5 mov %esp,%ebp 80105933: 57 push %edi 80105934: 56 push %esi 80105935: 53 push %ebx int *fd; struct file *rf, *wf; int fd0, fd1; if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 80105936: 8d 45 dc lea -0x24(%ebp),%eax return exec(path, argv); } int sys_pipe(void) { 80105939: 83 ec 20 sub $0x20,%esp int *fd; struct file *rf, *wf; int fd0, fd1; if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 8010593c: 6a 08 push $0x8 8010593e: 50 push %eax 8010593f: 6a 00 push $0x0 80105941: e8 ca f3 ff ff call 80104d10 <argptr> 80105946: 83 c4 10 add $0x10,%esp 80105949: 85 c0 test %eax,%eax 8010594b: 78 4a js 80105997 <sys_pipe+0x67> return -1; if(pipealloc(&rf, &wf) < 0) 8010594d: 8d 45 e4 lea -0x1c(%ebp),%eax 80105950: 83 ec 08 sub $0x8,%esp 80105953: 50 push %eax 80105954: 8d 45 e0 lea -0x20(%ebp),%eax 80105957: 50 push %eax 80105958: e8 93 d8 ff ff call 801031f0 <pipealloc> 8010595d: 83 c4 10 add $0x10,%esp 80105960: 85 c0 test %eax,%eax 80105962: 78 33 js 80105997 <sys_pipe+0x67> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 80105964: 31 db xor %ebx,%ebx if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) return -1; if(pipealloc(&rf, &wf) < 0) return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 80105966: 8b 7d e0 mov -0x20(%ebp),%edi // Takes over file reference from caller on success. static int fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); 80105969: e8 12 de ff ff call 80103780 <myproc> 8010596e: 66 90 xchg %ax,%ax for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ 80105970: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi 80105974: 85 f6 test %esi,%esi 80105976: 74 30 je 801059a8 <sys_pipe+0x78> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 80105978: 83 c3 01 add $0x1,%ebx 8010597b: 83 fb 10 cmp $0x10,%ebx 8010597e: 75 f0 jne 80105970 <sys_pipe+0x40> return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ if(fd0 >= 0) myproc()->ofile[fd0] = 0; fileclose(rf); 80105980: 83 ec 0c sub $0xc,%esp 80105983: ff 75 e0 pushl -0x20(%ebp) 80105986: e8 a5 b4 ff ff call 80100e30 <fileclose> fileclose(wf); 8010598b: 58 pop %eax 8010598c: ff 75 e4 pushl -0x1c(%ebp) 8010598f: e8 9c b4 ff ff call 80100e30 <fileclose> return -1; 80105994: 83 c4 10 add $0x10,%esp } fd[0] = fd0; fd[1] = fd1; return 0; } 80105997: 8d 65 f4 lea -0xc(%ebp),%esp if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ if(fd0 >= 0) myproc()->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; 8010599a: b8 ff ff ff ff mov $0xffffffff,%eax } fd[0] = fd0; fd[1] = fd1; return 0; } 8010599f: 5b pop %ebx 801059a0: 5e pop %esi 801059a1: 5f pop %edi 801059a2: 5d pop %ebp 801059a3: c3 ret 801059a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ curproc->ofile[fd] = f; 801059a8: 8d 73 08 lea 0x8(%ebx),%esi 801059ab: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4) if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) return -1; if(pipealloc(&rf, &wf) < 0) return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 801059af: 8b 7d e4 mov -0x1c(%ebp),%edi // Takes over file reference from caller on success. static int fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); 801059b2: e8 c9 dd ff ff call 80103780 <myproc> for(fd = 0; fd < NOFILE; fd++){ 801059b7: 31 d2 xor %edx,%edx 801059b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(curproc->ofile[fd] == 0){ 801059c0: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx 801059c4: 85 c9 test %ecx,%ecx 801059c6: 74 18 je 801059e0 <sys_pipe+0xb0> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 801059c8: 83 c2 01 add $0x1,%edx 801059cb: 83 fa 10 cmp $0x10,%edx 801059ce: 75 f0 jne 801059c0 <sys_pipe+0x90> if(pipealloc(&rf, &wf) < 0) return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ if(fd0 >= 0) myproc()->ofile[fd0] = 0; 801059d0: e8 ab dd ff ff call 80103780 <myproc> 801059d5: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4) 801059dc: 00 801059dd: eb a1 jmp 80105980 <sys_pipe+0x50> 801059df: 90 nop int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ curproc->ofile[fd] = f; 801059e0: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4) myproc()->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; } fd[0] = fd0; 801059e4: 8b 45 dc mov -0x24(%ebp),%eax 801059e7: 89 18 mov %ebx,(%eax) fd[1] = fd1; 801059e9: 8b 45 dc mov -0x24(%ebp),%eax 801059ec: 89 50 04 mov %edx,0x4(%eax) return 0; } 801059ef: 8d 65 f4 lea -0xc(%ebp),%esp fileclose(wf); return -1; } fd[0] = fd0; fd[1] = fd1; return 0; 801059f2: 31 c0 xor %eax,%eax } 801059f4: 5b pop %ebx 801059f5: 5e pop %esi 801059f6: 5f pop %edi 801059f7: 5d pop %ebp 801059f8: c3 ret 801059f9: 66 90 xchg %ax,%ax 801059fb: 66 90 xchg %ax,%ax 801059fd: 66 90 xchg %ax,%ax 801059ff: 90 nop 80105a00 <sys_fork>: #include "mmu.h" #include "proc.h" int sys_fork(void) { 80105a00: 55 push %ebp 80105a01: 89 e5 mov %esp,%ebp return fork(); } 80105a03: 5d pop %ebp #include "proc.h" int sys_fork(void) { return fork(); 80105a04: e9 17 df ff ff jmp 80103920 <fork> 80105a09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105a10 <sys_exit>: } int sys_exit(void) { 80105a10: 55 push %ebp 80105a11: 89 e5 mov %esp,%ebp 80105a13: 83 ec 08 sub $0x8,%esp exit(); 80105a16: e8 95 e1 ff ff call 80103bb0 <exit> return 0; // not reached } 80105a1b: 31 c0 xor %eax,%eax 80105a1d: c9 leave 80105a1e: c3 ret 80105a1f: 90 nop 80105a20 <sys_wait>: int sys_wait(void) { 80105a20: 55 push %ebp 80105a21: 89 e5 mov %esp,%ebp return wait(); } 80105a23: 5d pop %ebp } int sys_wait(void) { return wait(); 80105a24: e9 c7 e3 ff ff jmp 80103df0 <wait> 80105a29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105a30 <sys_kill>: } int sys_kill(void) { 80105a30: 55 push %ebp 80105a31: 89 e5 mov %esp,%ebp 80105a33: 83 ec 20 sub $0x20,%esp int pid; if(argint(0, &pid) < 0) 80105a36: 8d 45 f4 lea -0xc(%ebp),%eax 80105a39: 50 push %eax 80105a3a: 6a 00 push $0x0 80105a3c: e8 7f f2 ff ff call 80104cc0 <argint> 80105a41: 83 c4 10 add $0x10,%esp 80105a44: 85 c0 test %eax,%eax 80105a46: 78 18 js 80105a60 <sys_kill+0x30> return -1; return kill(pid); 80105a48: 83 ec 0c sub $0xc,%esp 80105a4b: ff 75 f4 pushl -0xc(%ebp) 80105a4e: e8 ed e4 ff ff call 80103f40 <kill> 80105a53: 83 c4 10 add $0x10,%esp } 80105a56: c9 leave 80105a57: c3 ret 80105a58: 90 nop 80105a59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sys_kill(void) { int pid; if(argint(0, &pid) < 0) return -1; 80105a60: b8 ff ff ff ff mov $0xffffffff,%eax return kill(pid); } 80105a65: c9 leave 80105a66: c3 ret 80105a67: 89 f6 mov %esi,%esi 80105a69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105a70 <sys_getpid>: int sys_getpid(void) { 80105a70: 55 push %ebp 80105a71: 89 e5 mov %esp,%ebp 80105a73: 83 ec 08 sub $0x8,%esp return myproc()->pid; 80105a76: e8 05 dd ff ff call 80103780 <myproc> 80105a7b: 8b 40 10 mov 0x10(%eax),%eax } 80105a7e: c9 leave 80105a7f: c3 ret 80105a80 <sys_sbrk>: int sys_sbrk(void) { 80105a80: 55 push %ebp 80105a81: 89 e5 mov %esp,%ebp 80105a83: 53 push %ebx int addr; int n; if(argint(0, &n) < 0) 80105a84: 8d 45 f4 lea -0xc(%ebp),%eax return myproc()->pid; } int sys_sbrk(void) { 80105a87: 83 ec 1c sub $0x1c,%esp int addr; int n; if(argint(0, &n) < 0) 80105a8a: 50 push %eax 80105a8b: 6a 00 push $0x0 80105a8d: e8 2e f2 ff ff call 80104cc0 <argint> 80105a92: 83 c4 10 add $0x10,%esp 80105a95: 85 c0 test %eax,%eax 80105a97: 78 27 js 80105ac0 <sys_sbrk+0x40> return -1; addr = myproc()->sz; 80105a99: e8 e2 dc ff ff call 80103780 <myproc> if(growproc(n) < 0) 80105a9e: 83 ec 0c sub $0xc,%esp int addr; int n; if(argint(0, &n) < 0) return -1; addr = myproc()->sz; 80105aa1: 8b 18 mov (%eax),%ebx if(growproc(n) < 0) 80105aa3: ff 75 f4 pushl -0xc(%ebp) 80105aa6: e8 f5 dd ff ff call 801038a0 <growproc> 80105aab: 83 c4 10 add $0x10,%esp 80105aae: 85 c0 test %eax,%eax 80105ab0: 78 0e js 80105ac0 <sys_sbrk+0x40> return -1; return addr; 80105ab2: 89 d8 mov %ebx,%eax } 80105ab4: 8b 5d fc mov -0x4(%ebp),%ebx 80105ab7: c9 leave 80105ab8: c3 ret 80105ab9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi { int addr; int n; if(argint(0, &n) < 0) return -1; 80105ac0: b8 ff ff ff ff mov $0xffffffff,%eax 80105ac5: eb ed jmp 80105ab4 <sys_sbrk+0x34> 80105ac7: 89 f6 mov %esi,%esi 80105ac9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105ad0 <sys_sleep>: return addr; } int sys_sleep(void) { 80105ad0: 55 push %ebp 80105ad1: 89 e5 mov %esp,%ebp 80105ad3: 53 push %ebx int n; uint ticks0; if(argint(0, &n) < 0) 80105ad4: 8d 45 f4 lea -0xc(%ebp),%eax return addr; } int sys_sleep(void) { 80105ad7: 83 ec 1c sub $0x1c,%esp int n; uint ticks0; if(argint(0, &n) < 0) 80105ada: 50 push %eax 80105adb: 6a 00 push $0x0 80105add: e8 de f1 ff ff call 80104cc0 <argint> 80105ae2: 83 c4 10 add $0x10,%esp 80105ae5: 85 c0 test %eax,%eax 80105ae7: 0f 88 8a 00 00 00 js 80105b77 <sys_sleep+0xa7> return -1; acquire(&tickslock); 80105aed: 83 ec 0c sub $0xc,%esp 80105af0: 68 00 67 11 80 push $0x80116700 80105af5: e8 46 ed ff ff call 80104840 <acquire> ticks0 = ticks; while(ticks - ticks0 < n){ 80105afa: 8b 55 f4 mov -0xc(%ebp),%edx 80105afd: 83 c4 10 add $0x10,%esp uint ticks0; if(argint(0, &n) < 0) return -1; acquire(&tickslock); ticks0 = ticks; 80105b00: 8b 1d 40 6f 11 80 mov 0x80116f40,%ebx while(ticks - ticks0 < n){ 80105b06: 85 d2 test %edx,%edx 80105b08: 75 27 jne 80105b31 <sys_sleep+0x61> 80105b0a: eb 54 jmp 80105b60 <sys_sleep+0x90> 80105b0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&tickslock); return -1; } sleep(&ticks, &tickslock); 80105b10: 83 ec 08 sub $0x8,%esp 80105b13: 68 00 67 11 80 push $0x80116700 80105b18: 68 40 6f 11 80 push $0x80116f40 80105b1d: e8 0e e2 ff ff call 80103d30 <sleep> if(argint(0, &n) < 0) return -1; acquire(&tickslock); ticks0 = ticks; while(ticks - ticks0 < n){ 80105b22: a1 40 6f 11 80 mov 0x80116f40,%eax 80105b27: 83 c4 10 add $0x10,%esp 80105b2a: 29 d8 sub %ebx,%eax 80105b2c: 3b 45 f4 cmp -0xc(%ebp),%eax 80105b2f: 73 2f jae 80105b60 <sys_sleep+0x90> if(myproc()->killed){ 80105b31: e8 4a dc ff ff call 80103780 <myproc> 80105b36: 8b 40 24 mov 0x24(%eax),%eax 80105b39: 85 c0 test %eax,%eax 80105b3b: 74 d3 je 80105b10 <sys_sleep+0x40> release(&tickslock); 80105b3d: 83 ec 0c sub $0xc,%esp 80105b40: 68 00 67 11 80 push $0x80116700 80105b45: e8 16 ee ff ff call 80104960 <release> return -1; 80105b4a: 83 c4 10 add $0x10,%esp 80105b4d: b8 ff ff ff ff mov $0xffffffff,%eax } sleep(&ticks, &tickslock); } release(&tickslock); return 0; } 80105b52: 8b 5d fc mov -0x4(%ebp),%ebx 80105b55: c9 leave 80105b56: c3 ret 80105b57: 89 f6 mov %esi,%esi 80105b59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi release(&tickslock); return -1; } sleep(&ticks, &tickslock); } release(&tickslock); 80105b60: 83 ec 0c sub $0xc,%esp 80105b63: 68 00 67 11 80 push $0x80116700 80105b68: e8 f3 ed ff ff call 80104960 <release> return 0; 80105b6d: 83 c4 10 add $0x10,%esp 80105b70: 31 c0 xor %eax,%eax } 80105b72: 8b 5d fc mov -0x4(%ebp),%ebx 80105b75: c9 leave 80105b76: c3 ret { int n; uint ticks0; if(argint(0, &n) < 0) return -1; 80105b77: b8 ff ff ff ff mov $0xffffffff,%eax 80105b7c: eb d4 jmp 80105b52 <sys_sleep+0x82> 80105b7e: 66 90 xchg %ax,%ax 80105b80 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. int sys_uptime(void) { 80105b80: 55 push %ebp 80105b81: 89 e5 mov %esp,%ebp 80105b83: 53 push %ebx 80105b84: 83 ec 10 sub $0x10,%esp uint xticks; acquire(&tickslock); 80105b87: 68 00 67 11 80 push $0x80116700 80105b8c: e8 af ec ff ff call 80104840 <acquire> xticks = ticks; 80105b91: 8b 1d 40 6f 11 80 mov 0x80116f40,%ebx release(&tickslock); 80105b97: c7 04 24 00 67 11 80 movl $0x80116700,(%esp) 80105b9e: e8 bd ed ff ff call 80104960 <release> return xticks; } 80105ba3: 89 d8 mov %ebx,%eax 80105ba5: 8b 5d fc mov -0x4(%ebp),%ebx 80105ba8: c9 leave 80105ba9: c3 ret 80105baa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105bb0 <sys_init_taskmaster>: /***************** LAB QUIZ 4 *****************/ int sys_init_taskmaster(void) { 80105bb0: 55 push %ebp 80105bb1: 89 e5 mov %esp,%ebp return help_init_taskmaster(); } 80105bb3: 5d pop %ebp } /***************** LAB QUIZ 4 *****************/ int sys_init_taskmaster(void) { return help_init_taskmaster(); 80105bb4: e9 37 e5 ff ff jmp 801040f0 <help_init_taskmaster> 80105bb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105bc0 <sys_do_task>: } int sys_do_task(void) { 80105bc0: 55 push %ebp 80105bc1: 89 e5 mov %esp,%ebp 80105bc3: 83 ec 20 sub $0x20,%esp char *fptr; int task_id, arg1, arg2; if (argint(0, (int *) &fptr) < 0) return -1; 80105bc6: 8d 45 e8 lea -0x18(%ebp),%eax 80105bc9: 50 push %eax 80105bca: 6a 00 push $0x0 80105bcc: e8 ef f0 ff ff call 80104cc0 <argint> 80105bd1: 83 c4 10 add $0x10,%esp 80105bd4: 85 c0 test %eax,%eax 80105bd6: 78 58 js 80105c30 <sys_do_task+0x70> if (argint(1, &task_id) < 0) return -1; 80105bd8: 8d 45 ec lea -0x14(%ebp),%eax 80105bdb: 83 ec 08 sub $0x8,%esp 80105bde: 50 push %eax 80105bdf: 6a 01 push $0x1 80105be1: e8 da f0 ff ff call 80104cc0 <argint> 80105be6: 83 c4 10 add $0x10,%esp 80105be9: 85 c0 test %eax,%eax 80105beb: 78 43 js 80105c30 <sys_do_task+0x70> if (argint(2, &arg1) < 0) return -1; 80105bed: 8d 45 f0 lea -0x10(%ebp),%eax 80105bf0: 83 ec 08 sub $0x8,%esp 80105bf3: 50 push %eax 80105bf4: 6a 02 push $0x2 80105bf6: e8 c5 f0 ff ff call 80104cc0 <argint> 80105bfb: 83 c4 10 add $0x10,%esp 80105bfe: 85 c0 test %eax,%eax 80105c00: 78 2e js 80105c30 <sys_do_task+0x70> if (argint(3, &arg2) < 0) return -1; 80105c02: 8d 45 f4 lea -0xc(%ebp),%eax 80105c05: 83 ec 08 sub $0x8,%esp 80105c08: 50 push %eax 80105c09: 6a 03 push $0x3 80105c0b: e8 b0 f0 ff ff call 80104cc0 <argint> 80105c10: 83 c4 10 add $0x10,%esp 80105c13: 85 c0 test %eax,%eax 80105c15: 78 19 js 80105c30 <sys_do_task+0x70> return help_do_task(fptr, task_id, arg1, arg2); 80105c17: ff 75 f4 pushl -0xc(%ebp) 80105c1a: ff 75 f0 pushl -0x10(%ebp) 80105c1d: ff 75 ec pushl -0x14(%ebp) 80105c20: ff 75 e8 pushl -0x18(%ebp) 80105c23: e8 38 e5 ff ff call 80104160 <help_do_task> 80105c28: 83 c4 10 add $0x10,%esp } 80105c2b: c9 leave 80105c2c: c3 ret 80105c2d: 8d 76 00 lea 0x0(%esi),%esi int sys_do_task(void) { char *fptr; int task_id, arg1, arg2; if (argint(0, (int *) &fptr) < 0) return -1; 80105c30: b8 ff ff ff ff mov $0xffffffff,%eax if (argint(1, &task_id) < 0) return -1; if (argint(2, &arg1) < 0) return -1; if (argint(3, &arg2) < 0) return -1; return help_do_task(fptr, task_id, arg1, arg2); } 80105c35: c9 leave 80105c36: c3 ret 80105c37: 89 f6 mov %esi,%esi 80105c39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105c40 <sys_wait_for_task_to_complete>: int sys_wait_for_task_to_complete(void) { 80105c40: 55 push %ebp 80105c41: 89 e5 mov %esp,%ebp 80105c43: 83 ec 20 sub $0x20,%esp int task_id; int *result; if (argint(0, &task_id) < 0) return -1; 80105c46: 8d 45 f0 lea -0x10(%ebp),%eax 80105c49: 50 push %eax 80105c4a: 6a 00 push $0x0 80105c4c: e8 6f f0 ff ff call 80104cc0 <argint> 80105c51: 83 c4 10 add $0x10,%esp 80105c54: 85 c0 test %eax,%eax 80105c56: 78 28 js 80105c80 <sys_wait_for_task_to_complete+0x40> if (argint(1, (int *) &result) < 0) return -1; 80105c58: 8d 45 f4 lea -0xc(%ebp),%eax 80105c5b: 83 ec 08 sub $0x8,%esp 80105c5e: 50 push %eax 80105c5f: 6a 01 push $0x1 80105c61: e8 5a f0 ff ff call 80104cc0 <argint> 80105c66: 83 c4 10 add $0x10,%esp 80105c69: 85 c0 test %eax,%eax 80105c6b: 78 13 js 80105c80 <sys_wait_for_task_to_complete+0x40> return help_wait_for_task_to_complete(task_id, result); 80105c6d: 83 ec 08 sub $0x8,%esp 80105c70: ff 75 f4 pushl -0xc(%ebp) 80105c73: ff 75 f0 pushl -0x10(%ebp) 80105c76: e8 e5 e5 ff ff call 80104260 <help_wait_for_task_to_complete> 80105c7b: 83 c4 10 add $0x10,%esp } 80105c7e: c9 leave 80105c7f: c3 ret int sys_wait_for_task_to_complete(void) { int task_id; int *result; if (argint(0, &task_id) < 0) return -1; 80105c80: b8 ff ff ff ff mov $0xffffffff,%eax if (argint(1, (int *) &result) < 0) return -1; return help_wait_for_task_to_complete(task_id, result); } 80105c85: c9 leave 80105c86: c3 ret 80105c87: 89 f6 mov %esi,%esi 80105c89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105c90 <sys_wait_for_task>: int sys_wait_for_task(void) { 80105c90: 55 push %ebp 80105c91: 89 e5 mov %esp,%ebp return help_wait_for_task(); } 80105c93: 5d pop %ebp return help_wait_for_task_to_complete(task_id, result); } int sys_wait_for_task(void) { return help_wait_for_task(); 80105c94: e9 97 e6 ff ff jmp 80104330 <help_wait_for_task> 80105c99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105ca0 <sys_task_ret>: } int sys_task_ret(void) { 80105ca0: 55 push %ebp 80105ca1: 89 e5 mov %esp,%ebp 80105ca3: 83 ec 20 sub $0x20,%esp int task_id, result; if (argint(0, &task_id) < 0) return -1; 80105ca6: 8d 45 f0 lea -0x10(%ebp),%eax 80105ca9: 50 push %eax 80105caa: 6a 00 push $0x0 80105cac: e8 0f f0 ff ff call 80104cc0 <argint> 80105cb1: 83 c4 10 add $0x10,%esp 80105cb4: 85 c0 test %eax,%eax 80105cb6: 78 28 js 80105ce0 <sys_task_ret+0x40> if (argint(1, &result) < 0) return -1; 80105cb8: 8d 45 f4 lea -0xc(%ebp),%eax 80105cbb: 83 ec 08 sub $0x8,%esp 80105cbe: 50 push %eax 80105cbf: 6a 01 push $0x1 80105cc1: e8 fa ef ff ff call 80104cc0 <argint> 80105cc6: 83 c4 10 add $0x10,%esp 80105cc9: 85 c0 test %eax,%eax 80105ccb: 78 13 js 80105ce0 <sys_task_ret+0x40> return help_task_ret(task_id, result); 80105ccd: 83 ec 08 sub $0x8,%esp 80105cd0: ff 75 f4 pushl -0xc(%ebp) 80105cd3: ff 75 f0 pushl -0x10(%ebp) 80105cd6: e8 25 e8 ff ff call 80104500 <help_task_ret> 80105cdb: 83 c4 10 add $0x10,%esp } 80105cde: c9 leave 80105cdf: c3 ret int sys_task_ret(void) { int task_id, result; if (argint(0, &task_id) < 0) return -1; 80105ce0: b8 ff ff ff ff mov $0xffffffff,%eax if (argint(1, &result) < 0) return -1; return help_task_ret(task_id, result); } 80105ce5: c9 leave 80105ce6: c3 ret 80105ce7 <alltraps>: # vectors.S sends all traps here. .globl alltraps alltraps: # Build trap frame. pushl %ds 80105ce7: 1e push %ds pushl %es 80105ce8: 06 push %es pushl %fs 80105ce9: 0f a0 push %fs pushl %gs 80105ceb: 0f a8 push %gs pushal 80105ced: 60 pusha # Set up data segments. movw $(SEG_KDATA<<3), %ax 80105cee: 66 b8 10 00 mov $0x10,%ax movw %ax, %ds 80105cf2: 8e d8 mov %eax,%ds movw %ax, %es 80105cf4: 8e c0 mov %eax,%es # Call trap(tf), where tf=%esp pushl %esp 80105cf6: 54 push %esp call trap 80105cf7: e8 e4 00 00 00 call 80105de0 <trap> addl $4, %esp 80105cfc: 83 c4 04 add $0x4,%esp 80105cff <trapret>: # Return falls through to trapret... .globl trapret trapret: popal 80105cff: 61 popa popl %gs 80105d00: 0f a9 pop %gs popl %fs 80105d02: 0f a1 pop %fs popl %es 80105d04: 07 pop %es popl %ds 80105d05: 1f pop %ds addl $0x8, %esp # trapno and errcode 80105d06: 83 c4 08 add $0x8,%esp iret 80105d09: cf iret 80105d0a: 66 90 xchg %ax,%ax 80105d0c: 66 90 xchg %ax,%ax 80105d0e: 66 90 xchg %ax,%ax 80105d10 <tvinit>: void tvinit(void) { int i; for(i = 0; i < 256; i++) 80105d10: 31 c0 xor %eax,%eax 80105d12: 8d b6 00 00 00 00 lea 0x0(%esi),%esi SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); 80105d18: 8b 14 85 08 b0 10 80 mov -0x7fef4ff8(,%eax,4),%edx 80105d1f: b9 08 00 00 00 mov $0x8,%ecx 80105d24: c6 04 c5 44 67 11 80 movb $0x0,-0x7fee98bc(,%eax,8) 80105d2b: 00 80105d2c: 66 89 0c c5 42 67 11 mov %cx,-0x7fee98be(,%eax,8) 80105d33: 80 80105d34: c6 04 c5 45 67 11 80 movb $0x8e,-0x7fee98bb(,%eax,8) 80105d3b: 8e 80105d3c: 66 89 14 c5 40 67 11 mov %dx,-0x7fee98c0(,%eax,8) 80105d43: 80 80105d44: c1 ea 10 shr $0x10,%edx 80105d47: 66 89 14 c5 46 67 11 mov %dx,-0x7fee98ba(,%eax,8) 80105d4e: 80 void tvinit(void) { int i; for(i = 0; i < 256; i++) 80105d4f: 83 c0 01 add $0x1,%eax 80105d52: 3d 00 01 00 00 cmp $0x100,%eax 80105d57: 75 bf jne 80105d18 <tvinit+0x8> struct spinlock tickslock; uint ticks; void tvinit(void) { 80105d59: 55 push %ebp int i; for(i = 0; i < 256; i++) SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80105d5a: ba 08 00 00 00 mov $0x8,%edx struct spinlock tickslock; uint ticks; void tvinit(void) { 80105d5f: 89 e5 mov %esp,%ebp 80105d61: 83 ec 10 sub $0x10,%esp int i; for(i = 0; i < 256; i++) SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80105d64: a1 08 b1 10 80 mov 0x8010b108,%eax initlock(&tickslock, "time"); 80105d69: 68 2d 7e 10 80 push $0x80107e2d 80105d6e: 68 00 67 11 80 push $0x80116700 { int i; for(i = 0; i < 256; i++) SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80105d73: 66 89 15 42 69 11 80 mov %dx,0x80116942 80105d7a: c6 05 44 69 11 80 00 movb $0x0,0x80116944 80105d81: 66 a3 40 69 11 80 mov %ax,0x80116940 80105d87: c1 e8 10 shr $0x10,%eax 80105d8a: c6 05 45 69 11 80 ef movb $0xef,0x80116945 80105d91: 66 a3 46 69 11 80 mov %ax,0x80116946 initlock(&tickslock, "time"); 80105d97: e8 a4 e9 ff ff call 80104740 <initlock> } 80105d9c: 83 c4 10 add $0x10,%esp 80105d9f: c9 leave 80105da0: c3 ret 80105da1: eb 0d jmp 80105db0 <idtinit> 80105da3: 90 nop 80105da4: 90 nop 80105da5: 90 nop 80105da6: 90 nop 80105da7: 90 nop 80105da8: 90 nop 80105da9: 90 nop 80105daa: 90 nop 80105dab: 90 nop 80105dac: 90 nop 80105dad: 90 nop 80105dae: 90 nop 80105daf: 90 nop 80105db0 <idtinit>: void idtinit(void) { 80105db0: 55 push %ebp static inline void lidt(struct gatedesc *p, int size) { volatile ushort pd[3]; pd[0] = size-1; 80105db1: b8 ff 07 00 00 mov $0x7ff,%eax 80105db6: 89 e5 mov %esp,%ebp 80105db8: 83 ec 10 sub $0x10,%esp 80105dbb: 66 89 45 fa mov %ax,-0x6(%ebp) pd[1] = (uint)p; 80105dbf: b8 40 67 11 80 mov $0x80116740,%eax 80105dc4: 66 89 45 fc mov %ax,-0x4(%ebp) pd[2] = (uint)p >> 16; 80105dc8: c1 e8 10 shr $0x10,%eax 80105dcb: 66 89 45 fe mov %ax,-0x2(%ebp) asm volatile("lidt (%0)" : : "r" (pd)); 80105dcf: 8d 45 fa lea -0x6(%ebp),%eax 80105dd2: 0f 01 18 lidtl (%eax) lidt(idt, sizeof(idt)); } 80105dd5: c9 leave 80105dd6: c3 ret 80105dd7: 89 f6 mov %esi,%esi 80105dd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105de0 <trap>: //PAGEBREAK: 41 void trap(struct trapframe *tf) { 80105de0: 55 push %ebp 80105de1: 89 e5 mov %esp,%ebp 80105de3: 57 push %edi 80105de4: 56 push %esi 80105de5: 53 push %ebx 80105de6: 83 ec 1c sub $0x1c,%esp 80105de9: 8b 7d 08 mov 0x8(%ebp),%edi if(tf->trapno == T_SYSCALL){ 80105dec: 8b 47 30 mov 0x30(%edi),%eax 80105def: 83 f8 40 cmp $0x40,%eax 80105df2: 0f 84 88 01 00 00 je 80105f80 <trap+0x1a0> if(myproc()->killed) exit(); return; } switch(tf->trapno){ 80105df8: 83 e8 20 sub $0x20,%eax 80105dfb: 83 f8 1f cmp $0x1f,%eax 80105dfe: 77 10 ja 80105e10 <trap+0x30> 80105e00: ff 24 85 d4 7e 10 80 jmp *-0x7fef812c(,%eax,4) 80105e07: 89 f6 mov %esi,%esi 80105e09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi lapiceoi(); break; //PAGEBREAK: 13 default: if(myproc() == 0 || (tf->cs&3) == 0){ 80105e10: e8 6b d9 ff ff call 80103780 <myproc> 80105e15: 85 c0 test %eax,%eax 80105e17: 0f 84 d7 01 00 00 je 80105ff4 <trap+0x214> 80105e1d: f6 47 3c 03 testb $0x3,0x3c(%edi) 80105e21: 0f 84 cd 01 00 00 je 80105ff4 <trap+0x214> static inline uint rcr2(void) { uint val; asm volatile("movl %%cr2,%0" : "=r" (val)); 80105e27: 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 " 80105e2a: 8b 57 38 mov 0x38(%edi),%edx 80105e2d: 89 4d d8 mov %ecx,-0x28(%ebp) 80105e30: 89 55 dc mov %edx,-0x24(%ebp) 80105e33: e8 28 d9 ff ff call 80103760 <cpuid> 80105e38: 8b 77 34 mov 0x34(%edi),%esi 80105e3b: 8b 5f 30 mov 0x30(%edi),%ebx 80105e3e: 89 45 e4 mov %eax,-0x1c(%ebp) "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 80105e41: e8 3a d9 ff ff call 80103780 <myproc> 80105e46: 89 45 e0 mov %eax,-0x20(%ebp) 80105e49: e8 32 d9 ff ff call 80103780 <myproc> 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 " 80105e4e: 8b 4d d8 mov -0x28(%ebp),%ecx 80105e51: 8b 55 dc mov -0x24(%ebp),%edx 80105e54: 51 push %ecx 80105e55: 52 push %edx "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 80105e56: 8b 55 e0 mov -0x20(%ebp),%edx 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 " 80105e59: ff 75 e4 pushl -0x1c(%ebp) 80105e5c: 56 push %esi 80105e5d: 53 push %ebx "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 80105e5e: 83 c2 6c add $0x6c,%edx 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 " 80105e61: 52 push %edx 80105e62: ff 70 10 pushl 0x10(%eax) 80105e65: 68 90 7e 10 80 push $0x80107e90 80105e6a: e8 f1 a7 ff ff call 80100660 <cprintf> "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, tf->err, cpuid(), tf->eip, rcr2()); myproc()->killed = 1; 80105e6f: 83 c4 20 add $0x20,%esp 80105e72: e8 09 d9 ff ff call 80103780 <myproc> 80105e77: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) 80105e7e: 66 90 xchg %ax,%ax } // 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) 80105e80: e8 fb d8 ff ff call 80103780 <myproc> 80105e85: 85 c0 test %eax,%eax 80105e87: 74 0c je 80105e95 <trap+0xb5> 80105e89: e8 f2 d8 ff ff call 80103780 <myproc> 80105e8e: 8b 50 24 mov 0x24(%eax),%edx 80105e91: 85 d2 test %edx,%edx 80105e93: 75 4b jne 80105ee0 <trap+0x100> 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 && 80105e95: e8 e6 d8 ff ff call 80103780 <myproc> 80105e9a: 85 c0 test %eax,%eax 80105e9c: 74 0b je 80105ea9 <trap+0xc9> 80105e9e: e8 dd d8 ff ff call 80103780 <myproc> 80105ea3: 83 78 0c 04 cmpl $0x4,0xc(%eax) 80105ea7: 74 4f je 80105ef8 <trap+0x118> 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) 80105ea9: e8 d2 d8 ff ff call 80103780 <myproc> 80105eae: 85 c0 test %eax,%eax 80105eb0: 74 1d je 80105ecf <trap+0xef> 80105eb2: e8 c9 d8 ff ff call 80103780 <myproc> 80105eb7: 8b 40 24 mov 0x24(%eax),%eax 80105eba: 85 c0 test %eax,%eax 80105ebc: 74 11 je 80105ecf <trap+0xef> 80105ebe: 0f b7 47 3c movzwl 0x3c(%edi),%eax 80105ec2: 83 e0 03 and $0x3,%eax 80105ec5: 66 83 f8 03 cmp $0x3,%ax 80105ec9: 0f 84 da 00 00 00 je 80105fa9 <trap+0x1c9> exit(); } 80105ecf: 8d 65 f4 lea -0xc(%ebp),%esp 80105ed2: 5b pop %ebx 80105ed3: 5e pop %esi 80105ed4: 5f pop %edi 80105ed5: 5d pop %ebp 80105ed6: c3 ret 80105ed7: 89 f6 mov %esi,%esi 80105ed9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi } // 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) 80105ee0: 0f b7 47 3c movzwl 0x3c(%edi),%eax 80105ee4: 83 e0 03 and $0x3,%eax 80105ee7: 66 83 f8 03 cmp $0x3,%ax 80105eeb: 75 a8 jne 80105e95 <trap+0xb5> exit(); 80105eed: e8 be dc ff ff call 80103bb0 <exit> 80105ef2: eb a1 jmp 80105e95 <trap+0xb5> 80105ef4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi // 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 && 80105ef8: 83 7f 30 20 cmpl $0x20,0x30(%edi) 80105efc: 75 ab jne 80105ea9 <trap+0xc9> tf->trapno == T_IRQ0+IRQ_TIMER) yield(); 80105efe: e8 dd dd ff ff call 80103ce0 <yield> 80105f03: eb a4 jmp 80105ea9 <trap+0xc9> 80105f05: 8d 76 00 lea 0x0(%esi),%esi return; } switch(tf->trapno){ case T_IRQ0 + IRQ_TIMER: if(cpuid() == 0){ 80105f08: e8 53 d8 ff ff call 80103760 <cpuid> 80105f0d: 85 c0 test %eax,%eax 80105f0f: 0f 84 ab 00 00 00 je 80105fc0 <trap+0x1e0> } lapiceoi(); break; case T_IRQ0 + IRQ_IDE: ideintr(); lapiceoi(); 80105f15: e8 f6 c7 ff ff call 80102710 <lapiceoi> break; 80105f1a: e9 61 ff ff ff jmp 80105e80 <trap+0xa0> 80105f1f: 90 nop case T_IRQ0 + IRQ_IDE+1: // Bochs generates spurious IDE1 interrupts. break; case T_IRQ0 + IRQ_KBD: kbdintr(); 80105f20: e8 ab c6 ff ff call 801025d0 <kbdintr> lapiceoi(); 80105f25: e8 e6 c7 ff ff call 80102710 <lapiceoi> break; 80105f2a: e9 51 ff ff ff jmp 80105e80 <trap+0xa0> 80105f2f: 90 nop case T_IRQ0 + IRQ_COM1: uartintr(); 80105f30: e8 5b 02 00 00 call 80106190 <uartintr> lapiceoi(); 80105f35: e8 d6 c7 ff ff call 80102710 <lapiceoi> break; 80105f3a: e9 41 ff ff ff jmp 80105e80 <trap+0xa0> 80105f3f: 90 nop case T_IRQ0 + 7: case T_IRQ0 + IRQ_SPURIOUS: cprintf("cpu%d: spurious interrupt at %x:%x\n", 80105f40: 0f b7 5f 3c movzwl 0x3c(%edi),%ebx 80105f44: 8b 77 38 mov 0x38(%edi),%esi 80105f47: e8 14 d8 ff ff call 80103760 <cpuid> 80105f4c: 56 push %esi 80105f4d: 53 push %ebx 80105f4e: 50 push %eax 80105f4f: 68 38 7e 10 80 push $0x80107e38 80105f54: e8 07 a7 ff ff call 80100660 <cprintf> cpuid(), tf->cs, tf->eip); lapiceoi(); 80105f59: e8 b2 c7 ff ff call 80102710 <lapiceoi> break; 80105f5e: 83 c4 10 add $0x10,%esp 80105f61: e9 1a ff ff ff jmp 80105e80 <trap+0xa0> 80105f66: 8d 76 00 lea 0x0(%esi),%esi 80105f69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi release(&tickslock); } lapiceoi(); break; case T_IRQ0 + IRQ_IDE: ideintr(); 80105f70: e8 db c0 ff ff call 80102050 <ideintr> 80105f75: eb 9e jmp 80105f15 <trap+0x135> 80105f77: 89 f6 mov %esi,%esi 80105f79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi //PAGEBREAK: 41 void trap(struct trapframe *tf) { if(tf->trapno == T_SYSCALL){ if(myproc()->killed) 80105f80: e8 fb d7 ff ff call 80103780 <myproc> 80105f85: 8b 58 24 mov 0x24(%eax),%ebx 80105f88: 85 db test %ebx,%ebx 80105f8a: 75 2c jne 80105fb8 <trap+0x1d8> exit(); myproc()->tf = tf; 80105f8c: e8 ef d7 ff ff call 80103780 <myproc> 80105f91: 89 78 18 mov %edi,0x18(%eax) syscall(); 80105f94: e8 17 ee ff ff call 80104db0 <syscall> if(myproc()->killed) 80105f99: e8 e2 d7 ff ff call 80103780 <myproc> 80105f9e: 8b 48 24 mov 0x24(%eax),%ecx 80105fa1: 85 c9 test %ecx,%ecx 80105fa3: 0f 84 26 ff ff ff je 80105ecf <trap+0xef> yield(); // Check if the process has been killed since we yielded if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) exit(); } 80105fa9: 8d 65 f4 lea -0xc(%ebp),%esp 80105fac: 5b pop %ebx 80105fad: 5e pop %esi 80105fae: 5f pop %edi 80105faf: 5d pop %ebp if(myproc()->killed) exit(); myproc()->tf = tf; syscall(); if(myproc()->killed) exit(); 80105fb0: e9 fb db ff ff jmp 80103bb0 <exit> 80105fb5: 8d 76 00 lea 0x0(%esi),%esi void trap(struct trapframe *tf) { if(tf->trapno == T_SYSCALL){ if(myproc()->killed) exit(); 80105fb8: e8 f3 db ff ff call 80103bb0 <exit> 80105fbd: eb cd jmp 80105f8c <trap+0x1ac> 80105fbf: 90 nop } switch(tf->trapno){ case T_IRQ0 + IRQ_TIMER: if(cpuid() == 0){ acquire(&tickslock); 80105fc0: 83 ec 0c sub $0xc,%esp 80105fc3: 68 00 67 11 80 push $0x80116700 80105fc8: e8 73 e8 ff ff call 80104840 <acquire> ticks++; wakeup(&ticks); 80105fcd: c7 04 24 40 6f 11 80 movl $0x80116f40,(%esp) switch(tf->trapno){ case T_IRQ0 + IRQ_TIMER: if(cpuid() == 0){ acquire(&tickslock); ticks++; 80105fd4: 83 05 40 6f 11 80 01 addl $0x1,0x80116f40 wakeup(&ticks); 80105fdb: e8 00 df ff ff call 80103ee0 <wakeup> release(&tickslock); 80105fe0: c7 04 24 00 67 11 80 movl $0x80116700,(%esp) 80105fe7: e8 74 e9 ff ff call 80104960 <release> 80105fec: 83 c4 10 add $0x10,%esp 80105fef: e9 21 ff ff ff jmp 80105f15 <trap+0x135> 80105ff4: 0f 20 d6 mov %cr2,%esi //PAGEBREAK: 13 default: if(myproc() == 0 || (tf->cs&3) == 0){ // In kernel, it must be our mistake. cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", 80105ff7: 8b 5f 38 mov 0x38(%edi),%ebx 80105ffa: e8 61 d7 ff ff call 80103760 <cpuid> 80105fff: 83 ec 0c sub $0xc,%esp 80106002: 56 push %esi 80106003: 53 push %ebx 80106004: 50 push %eax 80106005: ff 77 30 pushl 0x30(%edi) 80106008: 68 5c 7e 10 80 push $0x80107e5c 8010600d: e8 4e a6 ff ff call 80100660 <cprintf> tf->trapno, cpuid(), tf->eip, rcr2()); panic("trap"); 80106012: 83 c4 14 add $0x14,%esp 80106015: 68 32 7e 10 80 push $0x80107e32 8010601a: e8 51 a3 ff ff call 80100370 <panic> 8010601f: 90 nop 80106020 <uartgetc>: } static int uartgetc(void) { if(!uart) 80106020: a1 bc b5 10 80 mov 0x8010b5bc,%eax outb(COM1+0, c); } static int uartgetc(void) { 80106025: 55 push %ebp 80106026: 89 e5 mov %esp,%ebp if(!uart) 80106028: 85 c0 test %eax,%eax 8010602a: 74 1c je 80106048 <uartgetc+0x28> static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010602c: ba fd 03 00 00 mov $0x3fd,%edx 80106031: ec in (%dx),%al return -1; if(!(inb(COM1+5) & 0x01)) 80106032: a8 01 test $0x1,%al 80106034: 74 12 je 80106048 <uartgetc+0x28> 80106036: ba f8 03 00 00 mov $0x3f8,%edx 8010603b: ec in (%dx),%al return -1; return inb(COM1+0); 8010603c: 0f b6 c0 movzbl %al,%eax } 8010603f: 5d pop %ebp 80106040: c3 ret 80106041: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi static int uartgetc(void) { if(!uart) return -1; 80106048: b8 ff ff ff ff mov $0xffffffff,%eax if(!(inb(COM1+5) & 0x01)) return -1; return inb(COM1+0); } 8010604d: 5d pop %ebp 8010604e: c3 ret 8010604f: 90 nop 80106050 <uartputc.part.0>: for(p="xv6...\n"; *p; p++) uartputc(*p); } void uartputc(int c) 80106050: 55 push %ebp 80106051: 89 e5 mov %esp,%ebp 80106053: 57 push %edi 80106054: 56 push %esi 80106055: 53 push %ebx 80106056: 89 c7 mov %eax,%edi 80106058: bb 80 00 00 00 mov $0x80,%ebx 8010605d: be fd 03 00 00 mov $0x3fd,%esi 80106062: 83 ec 0c sub $0xc,%esp 80106065: eb 1b jmp 80106082 <uartputc.part.0+0x32> 80106067: 89 f6 mov %esi,%esi 80106069: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi int i; if(!uart) return; for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) microdelay(10); 80106070: 83 ec 0c sub $0xc,%esp 80106073: 6a 0a push $0xa 80106075: e8 b6 c6 ff ff call 80102730 <microdelay> { int i; if(!uart) return; for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) 8010607a: 83 c4 10 add $0x10,%esp 8010607d: 83 eb 01 sub $0x1,%ebx 80106080: 74 07 je 80106089 <uartputc.part.0+0x39> 80106082: 89 f2 mov %esi,%edx 80106084: ec in (%dx),%al 80106085: a8 20 test $0x20,%al 80106087: 74 e7 je 80106070 <uartputc.part.0+0x20> } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80106089: ba f8 03 00 00 mov $0x3f8,%edx 8010608e: 89 f8 mov %edi,%eax 80106090: ee out %al,(%dx) microdelay(10); outb(COM1+0, c); } 80106091: 8d 65 f4 lea -0xc(%ebp),%esp 80106094: 5b pop %ebx 80106095: 5e pop %esi 80106096: 5f pop %edi 80106097: 5d pop %ebp 80106098: c3 ret 80106099: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801060a0 <uartinit>: static int uart; // is there a uart? void uartinit(void) { 801060a0: 55 push %ebp 801060a1: 31 c9 xor %ecx,%ecx 801060a3: 89 c8 mov %ecx,%eax 801060a5: 89 e5 mov %esp,%ebp 801060a7: 57 push %edi 801060a8: 56 push %esi 801060a9: 53 push %ebx 801060aa: bb fa 03 00 00 mov $0x3fa,%ebx 801060af: 89 da mov %ebx,%edx 801060b1: 83 ec 0c sub $0xc,%esp 801060b4: ee out %al,(%dx) 801060b5: bf fb 03 00 00 mov $0x3fb,%edi 801060ba: b8 80 ff ff ff mov $0xffffff80,%eax 801060bf: 89 fa mov %edi,%edx 801060c1: ee out %al,(%dx) 801060c2: b8 0c 00 00 00 mov $0xc,%eax 801060c7: ba f8 03 00 00 mov $0x3f8,%edx 801060cc: ee out %al,(%dx) 801060cd: be f9 03 00 00 mov $0x3f9,%esi 801060d2: 89 c8 mov %ecx,%eax 801060d4: 89 f2 mov %esi,%edx 801060d6: ee out %al,(%dx) 801060d7: b8 03 00 00 00 mov $0x3,%eax 801060dc: 89 fa mov %edi,%edx 801060de: ee out %al,(%dx) 801060df: ba fc 03 00 00 mov $0x3fc,%edx 801060e4: 89 c8 mov %ecx,%eax 801060e6: ee out %al,(%dx) 801060e7: b8 01 00 00 00 mov $0x1,%eax 801060ec: 89 f2 mov %esi,%edx 801060ee: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801060ef: ba fd 03 00 00 mov $0x3fd,%edx 801060f4: ec in (%dx),%al outb(COM1+3, 0x03); // Lock divisor, 8 data bits. outb(COM1+4, 0); outb(COM1+1, 0x01); // Enable receive interrupts. // If status is 0xFF, no serial port. if(inb(COM1+5) == 0xFF) 801060f5: 3c ff cmp $0xff,%al 801060f7: 74 5a je 80106153 <uartinit+0xb3> return; uart = 1; 801060f9: c7 05 bc b5 10 80 01 movl $0x1,0x8010b5bc 80106100: 00 00 00 80106103: 89 da mov %ebx,%edx 80106105: ec in (%dx),%al 80106106: ba f8 03 00 00 mov $0x3f8,%edx 8010610b: ec in (%dx),%al // Acknowledge pre-existing interrupt conditions; // enable interrupts. inb(COM1+2); inb(COM1+0); ioapicenable(IRQ_COM1, 0); 8010610c: 83 ec 08 sub $0x8,%esp 8010610f: bb 54 7f 10 80 mov $0x80107f54,%ebx 80106114: 6a 00 push $0x0 80106116: 6a 04 push $0x4 80106118: e8 83 c1 ff ff call 801022a0 <ioapicenable> 8010611d: 83 c4 10 add $0x10,%esp 80106120: b8 78 00 00 00 mov $0x78,%eax 80106125: eb 13 jmp 8010613a <uartinit+0x9a> 80106127: 89 f6 mov %esi,%esi 80106129: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi // Announce that we're here. for(p="xv6...\n"; *p; p++) 80106130: 83 c3 01 add $0x1,%ebx 80106133: 0f be 03 movsbl (%ebx),%eax 80106136: 84 c0 test %al,%al 80106138: 74 19 je 80106153 <uartinit+0xb3> void uartputc(int c) { int i; if(!uart) 8010613a: 8b 15 bc b5 10 80 mov 0x8010b5bc,%edx 80106140: 85 d2 test %edx,%edx 80106142: 74 ec je 80106130 <uartinit+0x90> inb(COM1+2); inb(COM1+0); ioapicenable(IRQ_COM1, 0); // Announce that we're here. for(p="xv6...\n"; *p; p++) 80106144: 83 c3 01 add $0x1,%ebx 80106147: e8 04 ff ff ff call 80106050 <uartputc.part.0> 8010614c: 0f be 03 movsbl (%ebx),%eax 8010614f: 84 c0 test %al,%al 80106151: 75 e7 jne 8010613a <uartinit+0x9a> uartputc(*p); } 80106153: 8d 65 f4 lea -0xc(%ebp),%esp 80106156: 5b pop %ebx 80106157: 5e pop %esi 80106158: 5f pop %edi 80106159: 5d pop %ebp 8010615a: c3 ret 8010615b: 90 nop 8010615c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106160 <uartputc>: void uartputc(int c) { int i; if(!uart) 80106160: 8b 15 bc b5 10 80 mov 0x8010b5bc,%edx uartputc(*p); } void uartputc(int c) { 80106166: 55 push %ebp 80106167: 89 e5 mov %esp,%ebp int i; if(!uart) 80106169: 85 d2 test %edx,%edx uartputc(*p); } void uartputc(int c) { 8010616b: 8b 45 08 mov 0x8(%ebp),%eax int i; if(!uart) 8010616e: 74 10 je 80106180 <uartputc+0x20> return; for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) microdelay(10); outb(COM1+0, c); } 80106170: 5d pop %ebp 80106171: e9 da fe ff ff jmp 80106050 <uartputc.part.0> 80106176: 8d 76 00 lea 0x0(%esi),%esi 80106179: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106180: 5d pop %ebp 80106181: c3 ret 80106182: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106189: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106190 <uartintr>: return inb(COM1+0); } void uartintr(void) { 80106190: 55 push %ebp 80106191: 89 e5 mov %esp,%ebp 80106193: 83 ec 14 sub $0x14,%esp consoleintr(uartgetc); 80106196: 68 20 60 10 80 push $0x80106020 8010619b: e8 50 a6 ff ff call 801007f0 <consoleintr> } 801061a0: 83 c4 10 add $0x10,%esp 801061a3: c9 leave 801061a4: c3 ret 801061a5 <vector0>: # generated by vectors.pl - do not edit # handlers .globl alltraps .globl vector0 vector0: pushl $0 801061a5: 6a 00 push $0x0 pushl $0 801061a7: 6a 00 push $0x0 jmp alltraps 801061a9: e9 39 fb ff ff jmp 80105ce7 <alltraps> 801061ae <vector1>: .globl vector1 vector1: pushl $0 801061ae: 6a 00 push $0x0 pushl $1 801061b0: 6a 01 push $0x1 jmp alltraps 801061b2: e9 30 fb ff ff jmp 80105ce7 <alltraps> 801061b7 <vector2>: .globl vector2 vector2: pushl $0 801061b7: 6a 00 push $0x0 pushl $2 801061b9: 6a 02 push $0x2 jmp alltraps 801061bb: e9 27 fb ff ff jmp 80105ce7 <alltraps> 801061c0 <vector3>: .globl vector3 vector3: pushl $0 801061c0: 6a 00 push $0x0 pushl $3 801061c2: 6a 03 push $0x3 jmp alltraps 801061c4: e9 1e fb ff ff jmp 80105ce7 <alltraps> 801061c9 <vector4>: .globl vector4 vector4: pushl $0 801061c9: 6a 00 push $0x0 pushl $4 801061cb: 6a 04 push $0x4 jmp alltraps 801061cd: e9 15 fb ff ff jmp 80105ce7 <alltraps> 801061d2 <vector5>: .globl vector5 vector5: pushl $0 801061d2: 6a 00 push $0x0 pushl $5 801061d4: 6a 05 push $0x5 jmp alltraps 801061d6: e9 0c fb ff ff jmp 80105ce7 <alltraps> 801061db <vector6>: .globl vector6 vector6: pushl $0 801061db: 6a 00 push $0x0 pushl $6 801061dd: 6a 06 push $0x6 jmp alltraps 801061df: e9 03 fb ff ff jmp 80105ce7 <alltraps> 801061e4 <vector7>: .globl vector7 vector7: pushl $0 801061e4: 6a 00 push $0x0 pushl $7 801061e6: 6a 07 push $0x7 jmp alltraps 801061e8: e9 fa fa ff ff jmp 80105ce7 <alltraps> 801061ed <vector8>: .globl vector8 vector8: pushl $8 801061ed: 6a 08 push $0x8 jmp alltraps 801061ef: e9 f3 fa ff ff jmp 80105ce7 <alltraps> 801061f4 <vector9>: .globl vector9 vector9: pushl $0 801061f4: 6a 00 push $0x0 pushl $9 801061f6: 6a 09 push $0x9 jmp alltraps 801061f8: e9 ea fa ff ff jmp 80105ce7 <alltraps> 801061fd <vector10>: .globl vector10 vector10: pushl $10 801061fd: 6a 0a push $0xa jmp alltraps 801061ff: e9 e3 fa ff ff jmp 80105ce7 <alltraps> 80106204 <vector11>: .globl vector11 vector11: pushl $11 80106204: 6a 0b push $0xb jmp alltraps 80106206: e9 dc fa ff ff jmp 80105ce7 <alltraps> 8010620b <vector12>: .globl vector12 vector12: pushl $12 8010620b: 6a 0c push $0xc jmp alltraps 8010620d: e9 d5 fa ff ff jmp 80105ce7 <alltraps> 80106212 <vector13>: .globl vector13 vector13: pushl $13 80106212: 6a 0d push $0xd jmp alltraps 80106214: e9 ce fa ff ff jmp 80105ce7 <alltraps> 80106219 <vector14>: .globl vector14 vector14: pushl $14 80106219: 6a 0e push $0xe jmp alltraps 8010621b: e9 c7 fa ff ff jmp 80105ce7 <alltraps> 80106220 <vector15>: .globl vector15 vector15: pushl $0 80106220: 6a 00 push $0x0 pushl $15 80106222: 6a 0f push $0xf jmp alltraps 80106224: e9 be fa ff ff jmp 80105ce7 <alltraps> 80106229 <vector16>: .globl vector16 vector16: pushl $0 80106229: 6a 00 push $0x0 pushl $16 8010622b: 6a 10 push $0x10 jmp alltraps 8010622d: e9 b5 fa ff ff jmp 80105ce7 <alltraps> 80106232 <vector17>: .globl vector17 vector17: pushl $17 80106232: 6a 11 push $0x11 jmp alltraps 80106234: e9 ae fa ff ff jmp 80105ce7 <alltraps> 80106239 <vector18>: .globl vector18 vector18: pushl $0 80106239: 6a 00 push $0x0 pushl $18 8010623b: 6a 12 push $0x12 jmp alltraps 8010623d: e9 a5 fa ff ff jmp 80105ce7 <alltraps> 80106242 <vector19>: .globl vector19 vector19: pushl $0 80106242: 6a 00 push $0x0 pushl $19 80106244: 6a 13 push $0x13 jmp alltraps 80106246: e9 9c fa ff ff jmp 80105ce7 <alltraps> 8010624b <vector20>: .globl vector20 vector20: pushl $0 8010624b: 6a 00 push $0x0 pushl $20 8010624d: 6a 14 push $0x14 jmp alltraps 8010624f: e9 93 fa ff ff jmp 80105ce7 <alltraps> 80106254 <vector21>: .globl vector21 vector21: pushl $0 80106254: 6a 00 push $0x0 pushl $21 80106256: 6a 15 push $0x15 jmp alltraps 80106258: e9 8a fa ff ff jmp 80105ce7 <alltraps> 8010625d <vector22>: .globl vector22 vector22: pushl $0 8010625d: 6a 00 push $0x0 pushl $22 8010625f: 6a 16 push $0x16 jmp alltraps 80106261: e9 81 fa ff ff jmp 80105ce7 <alltraps> 80106266 <vector23>: .globl vector23 vector23: pushl $0 80106266: 6a 00 push $0x0 pushl $23 80106268: 6a 17 push $0x17 jmp alltraps 8010626a: e9 78 fa ff ff jmp 80105ce7 <alltraps> 8010626f <vector24>: .globl vector24 vector24: pushl $0 8010626f: 6a 00 push $0x0 pushl $24 80106271: 6a 18 push $0x18 jmp alltraps 80106273: e9 6f fa ff ff jmp 80105ce7 <alltraps> 80106278 <vector25>: .globl vector25 vector25: pushl $0 80106278: 6a 00 push $0x0 pushl $25 8010627a: 6a 19 push $0x19 jmp alltraps 8010627c: e9 66 fa ff ff jmp 80105ce7 <alltraps> 80106281 <vector26>: .globl vector26 vector26: pushl $0 80106281: 6a 00 push $0x0 pushl $26 80106283: 6a 1a push $0x1a jmp alltraps 80106285: e9 5d fa ff ff jmp 80105ce7 <alltraps> 8010628a <vector27>: .globl vector27 vector27: pushl $0 8010628a: 6a 00 push $0x0 pushl $27 8010628c: 6a 1b push $0x1b jmp alltraps 8010628e: e9 54 fa ff ff jmp 80105ce7 <alltraps> 80106293 <vector28>: .globl vector28 vector28: pushl $0 80106293: 6a 00 push $0x0 pushl $28 80106295: 6a 1c push $0x1c jmp alltraps 80106297: e9 4b fa ff ff jmp 80105ce7 <alltraps> 8010629c <vector29>: .globl vector29 vector29: pushl $0 8010629c: 6a 00 push $0x0 pushl $29 8010629e: 6a 1d push $0x1d jmp alltraps 801062a0: e9 42 fa ff ff jmp 80105ce7 <alltraps> 801062a5 <vector30>: .globl vector30 vector30: pushl $0 801062a5: 6a 00 push $0x0 pushl $30 801062a7: 6a 1e push $0x1e jmp alltraps 801062a9: e9 39 fa ff ff jmp 80105ce7 <alltraps> 801062ae <vector31>: .globl vector31 vector31: pushl $0 801062ae: 6a 00 push $0x0 pushl $31 801062b0: 6a 1f push $0x1f jmp alltraps 801062b2: e9 30 fa ff ff jmp 80105ce7 <alltraps> 801062b7 <vector32>: .globl vector32 vector32: pushl $0 801062b7: 6a 00 push $0x0 pushl $32 801062b9: 6a 20 push $0x20 jmp alltraps 801062bb: e9 27 fa ff ff jmp 80105ce7 <alltraps> 801062c0 <vector33>: .globl vector33 vector33: pushl $0 801062c0: 6a 00 push $0x0 pushl $33 801062c2: 6a 21 push $0x21 jmp alltraps 801062c4: e9 1e fa ff ff jmp 80105ce7 <alltraps> 801062c9 <vector34>: .globl vector34 vector34: pushl $0 801062c9: 6a 00 push $0x0 pushl $34 801062cb: 6a 22 push $0x22 jmp alltraps 801062cd: e9 15 fa ff ff jmp 80105ce7 <alltraps> 801062d2 <vector35>: .globl vector35 vector35: pushl $0 801062d2: 6a 00 push $0x0 pushl $35 801062d4: 6a 23 push $0x23 jmp alltraps 801062d6: e9 0c fa ff ff jmp 80105ce7 <alltraps> 801062db <vector36>: .globl vector36 vector36: pushl $0 801062db: 6a 00 push $0x0 pushl $36 801062dd: 6a 24 push $0x24 jmp alltraps 801062df: e9 03 fa ff ff jmp 80105ce7 <alltraps> 801062e4 <vector37>: .globl vector37 vector37: pushl $0 801062e4: 6a 00 push $0x0 pushl $37 801062e6: 6a 25 push $0x25 jmp alltraps 801062e8: e9 fa f9 ff ff jmp 80105ce7 <alltraps> 801062ed <vector38>: .globl vector38 vector38: pushl $0 801062ed: 6a 00 push $0x0 pushl $38 801062ef: 6a 26 push $0x26 jmp alltraps 801062f1: e9 f1 f9 ff ff jmp 80105ce7 <alltraps> 801062f6 <vector39>: .globl vector39 vector39: pushl $0 801062f6: 6a 00 push $0x0 pushl $39 801062f8: 6a 27 push $0x27 jmp alltraps 801062fa: e9 e8 f9 ff ff jmp 80105ce7 <alltraps> 801062ff <vector40>: .globl vector40 vector40: pushl $0 801062ff: 6a 00 push $0x0 pushl $40 80106301: 6a 28 push $0x28 jmp alltraps 80106303: e9 df f9 ff ff jmp 80105ce7 <alltraps> 80106308 <vector41>: .globl vector41 vector41: pushl $0 80106308: 6a 00 push $0x0 pushl $41 8010630a: 6a 29 push $0x29 jmp alltraps 8010630c: e9 d6 f9 ff ff jmp 80105ce7 <alltraps> 80106311 <vector42>: .globl vector42 vector42: pushl $0 80106311: 6a 00 push $0x0 pushl $42 80106313: 6a 2a push $0x2a jmp alltraps 80106315: e9 cd f9 ff ff jmp 80105ce7 <alltraps> 8010631a <vector43>: .globl vector43 vector43: pushl $0 8010631a: 6a 00 push $0x0 pushl $43 8010631c: 6a 2b push $0x2b jmp alltraps 8010631e: e9 c4 f9 ff ff jmp 80105ce7 <alltraps> 80106323 <vector44>: .globl vector44 vector44: pushl $0 80106323: 6a 00 push $0x0 pushl $44 80106325: 6a 2c push $0x2c jmp alltraps 80106327: e9 bb f9 ff ff jmp 80105ce7 <alltraps> 8010632c <vector45>: .globl vector45 vector45: pushl $0 8010632c: 6a 00 push $0x0 pushl $45 8010632e: 6a 2d push $0x2d jmp alltraps 80106330: e9 b2 f9 ff ff jmp 80105ce7 <alltraps> 80106335 <vector46>: .globl vector46 vector46: pushl $0 80106335: 6a 00 push $0x0 pushl $46 80106337: 6a 2e push $0x2e jmp alltraps 80106339: e9 a9 f9 ff ff jmp 80105ce7 <alltraps> 8010633e <vector47>: .globl vector47 vector47: pushl $0 8010633e: 6a 00 push $0x0 pushl $47 80106340: 6a 2f push $0x2f jmp alltraps 80106342: e9 a0 f9 ff ff jmp 80105ce7 <alltraps> 80106347 <vector48>: .globl vector48 vector48: pushl $0 80106347: 6a 00 push $0x0 pushl $48 80106349: 6a 30 push $0x30 jmp alltraps 8010634b: e9 97 f9 ff ff jmp 80105ce7 <alltraps> 80106350 <vector49>: .globl vector49 vector49: pushl $0 80106350: 6a 00 push $0x0 pushl $49 80106352: 6a 31 push $0x31 jmp alltraps 80106354: e9 8e f9 ff ff jmp 80105ce7 <alltraps> 80106359 <vector50>: .globl vector50 vector50: pushl $0 80106359: 6a 00 push $0x0 pushl $50 8010635b: 6a 32 push $0x32 jmp alltraps 8010635d: e9 85 f9 ff ff jmp 80105ce7 <alltraps> 80106362 <vector51>: .globl vector51 vector51: pushl $0 80106362: 6a 00 push $0x0 pushl $51 80106364: 6a 33 push $0x33 jmp alltraps 80106366: e9 7c f9 ff ff jmp 80105ce7 <alltraps> 8010636b <vector52>: .globl vector52 vector52: pushl $0 8010636b: 6a 00 push $0x0 pushl $52 8010636d: 6a 34 push $0x34 jmp alltraps 8010636f: e9 73 f9 ff ff jmp 80105ce7 <alltraps> 80106374 <vector53>: .globl vector53 vector53: pushl $0 80106374: 6a 00 push $0x0 pushl $53 80106376: 6a 35 push $0x35 jmp alltraps 80106378: e9 6a f9 ff ff jmp 80105ce7 <alltraps> 8010637d <vector54>: .globl vector54 vector54: pushl $0 8010637d: 6a 00 push $0x0 pushl $54 8010637f: 6a 36 push $0x36 jmp alltraps 80106381: e9 61 f9 ff ff jmp 80105ce7 <alltraps> 80106386 <vector55>: .globl vector55 vector55: pushl $0 80106386: 6a 00 push $0x0 pushl $55 80106388: 6a 37 push $0x37 jmp alltraps 8010638a: e9 58 f9 ff ff jmp 80105ce7 <alltraps> 8010638f <vector56>: .globl vector56 vector56: pushl $0 8010638f: 6a 00 push $0x0 pushl $56 80106391: 6a 38 push $0x38 jmp alltraps 80106393: e9 4f f9 ff ff jmp 80105ce7 <alltraps> 80106398 <vector57>: .globl vector57 vector57: pushl $0 80106398: 6a 00 push $0x0 pushl $57 8010639a: 6a 39 push $0x39 jmp alltraps 8010639c: e9 46 f9 ff ff jmp 80105ce7 <alltraps> 801063a1 <vector58>: .globl vector58 vector58: pushl $0 801063a1: 6a 00 push $0x0 pushl $58 801063a3: 6a 3a push $0x3a jmp alltraps 801063a5: e9 3d f9 ff ff jmp 80105ce7 <alltraps> 801063aa <vector59>: .globl vector59 vector59: pushl $0 801063aa: 6a 00 push $0x0 pushl $59 801063ac: 6a 3b push $0x3b jmp alltraps 801063ae: e9 34 f9 ff ff jmp 80105ce7 <alltraps> 801063b3 <vector60>: .globl vector60 vector60: pushl $0 801063b3: 6a 00 push $0x0 pushl $60 801063b5: 6a 3c push $0x3c jmp alltraps 801063b7: e9 2b f9 ff ff jmp 80105ce7 <alltraps> 801063bc <vector61>: .globl vector61 vector61: pushl $0 801063bc: 6a 00 push $0x0 pushl $61 801063be: 6a 3d push $0x3d jmp alltraps 801063c0: e9 22 f9 ff ff jmp 80105ce7 <alltraps> 801063c5 <vector62>: .globl vector62 vector62: pushl $0 801063c5: 6a 00 push $0x0 pushl $62 801063c7: 6a 3e push $0x3e jmp alltraps 801063c9: e9 19 f9 ff ff jmp 80105ce7 <alltraps> 801063ce <vector63>: .globl vector63 vector63: pushl $0 801063ce: 6a 00 push $0x0 pushl $63 801063d0: 6a 3f push $0x3f jmp alltraps 801063d2: e9 10 f9 ff ff jmp 80105ce7 <alltraps> 801063d7 <vector64>: .globl vector64 vector64: pushl $0 801063d7: 6a 00 push $0x0 pushl $64 801063d9: 6a 40 push $0x40 jmp alltraps 801063db: e9 07 f9 ff ff jmp 80105ce7 <alltraps> 801063e0 <vector65>: .globl vector65 vector65: pushl $0 801063e0: 6a 00 push $0x0 pushl $65 801063e2: 6a 41 push $0x41 jmp alltraps 801063e4: e9 fe f8 ff ff jmp 80105ce7 <alltraps> 801063e9 <vector66>: .globl vector66 vector66: pushl $0 801063e9: 6a 00 push $0x0 pushl $66 801063eb: 6a 42 push $0x42 jmp alltraps 801063ed: e9 f5 f8 ff ff jmp 80105ce7 <alltraps> 801063f2 <vector67>: .globl vector67 vector67: pushl $0 801063f2: 6a 00 push $0x0 pushl $67 801063f4: 6a 43 push $0x43 jmp alltraps 801063f6: e9 ec f8 ff ff jmp 80105ce7 <alltraps> 801063fb <vector68>: .globl vector68 vector68: pushl $0 801063fb: 6a 00 push $0x0 pushl $68 801063fd: 6a 44 push $0x44 jmp alltraps 801063ff: e9 e3 f8 ff ff jmp 80105ce7 <alltraps> 80106404 <vector69>: .globl vector69 vector69: pushl $0 80106404: 6a 00 push $0x0 pushl $69 80106406: 6a 45 push $0x45 jmp alltraps 80106408: e9 da f8 ff ff jmp 80105ce7 <alltraps> 8010640d <vector70>: .globl vector70 vector70: pushl $0 8010640d: 6a 00 push $0x0 pushl $70 8010640f: 6a 46 push $0x46 jmp alltraps 80106411: e9 d1 f8 ff ff jmp 80105ce7 <alltraps> 80106416 <vector71>: .globl vector71 vector71: pushl $0 80106416: 6a 00 push $0x0 pushl $71 80106418: 6a 47 push $0x47 jmp alltraps 8010641a: e9 c8 f8 ff ff jmp 80105ce7 <alltraps> 8010641f <vector72>: .globl vector72 vector72: pushl $0 8010641f: 6a 00 push $0x0 pushl $72 80106421: 6a 48 push $0x48 jmp alltraps 80106423: e9 bf f8 ff ff jmp 80105ce7 <alltraps> 80106428 <vector73>: .globl vector73 vector73: pushl $0 80106428: 6a 00 push $0x0 pushl $73 8010642a: 6a 49 push $0x49 jmp alltraps 8010642c: e9 b6 f8 ff ff jmp 80105ce7 <alltraps> 80106431 <vector74>: .globl vector74 vector74: pushl $0 80106431: 6a 00 push $0x0 pushl $74 80106433: 6a 4a push $0x4a jmp alltraps 80106435: e9 ad f8 ff ff jmp 80105ce7 <alltraps> 8010643a <vector75>: .globl vector75 vector75: pushl $0 8010643a: 6a 00 push $0x0 pushl $75 8010643c: 6a 4b push $0x4b jmp alltraps 8010643e: e9 a4 f8 ff ff jmp 80105ce7 <alltraps> 80106443 <vector76>: .globl vector76 vector76: pushl $0 80106443: 6a 00 push $0x0 pushl $76 80106445: 6a 4c push $0x4c jmp alltraps 80106447: e9 9b f8 ff ff jmp 80105ce7 <alltraps> 8010644c <vector77>: .globl vector77 vector77: pushl $0 8010644c: 6a 00 push $0x0 pushl $77 8010644e: 6a 4d push $0x4d jmp alltraps 80106450: e9 92 f8 ff ff jmp 80105ce7 <alltraps> 80106455 <vector78>: .globl vector78 vector78: pushl $0 80106455: 6a 00 push $0x0 pushl $78 80106457: 6a 4e push $0x4e jmp alltraps 80106459: e9 89 f8 ff ff jmp 80105ce7 <alltraps> 8010645e <vector79>: .globl vector79 vector79: pushl $0 8010645e: 6a 00 push $0x0 pushl $79 80106460: 6a 4f push $0x4f jmp alltraps 80106462: e9 80 f8 ff ff jmp 80105ce7 <alltraps> 80106467 <vector80>: .globl vector80 vector80: pushl $0 80106467: 6a 00 push $0x0 pushl $80 80106469: 6a 50 push $0x50 jmp alltraps 8010646b: e9 77 f8 ff ff jmp 80105ce7 <alltraps> 80106470 <vector81>: .globl vector81 vector81: pushl $0 80106470: 6a 00 push $0x0 pushl $81 80106472: 6a 51 push $0x51 jmp alltraps 80106474: e9 6e f8 ff ff jmp 80105ce7 <alltraps> 80106479 <vector82>: .globl vector82 vector82: pushl $0 80106479: 6a 00 push $0x0 pushl $82 8010647b: 6a 52 push $0x52 jmp alltraps 8010647d: e9 65 f8 ff ff jmp 80105ce7 <alltraps> 80106482 <vector83>: .globl vector83 vector83: pushl $0 80106482: 6a 00 push $0x0 pushl $83 80106484: 6a 53 push $0x53 jmp alltraps 80106486: e9 5c f8 ff ff jmp 80105ce7 <alltraps> 8010648b <vector84>: .globl vector84 vector84: pushl $0 8010648b: 6a 00 push $0x0 pushl $84 8010648d: 6a 54 push $0x54 jmp alltraps 8010648f: e9 53 f8 ff ff jmp 80105ce7 <alltraps> 80106494 <vector85>: .globl vector85 vector85: pushl $0 80106494: 6a 00 push $0x0 pushl $85 80106496: 6a 55 push $0x55 jmp alltraps 80106498: e9 4a f8 ff ff jmp 80105ce7 <alltraps> 8010649d <vector86>: .globl vector86 vector86: pushl $0 8010649d: 6a 00 push $0x0 pushl $86 8010649f: 6a 56 push $0x56 jmp alltraps 801064a1: e9 41 f8 ff ff jmp 80105ce7 <alltraps> 801064a6 <vector87>: .globl vector87 vector87: pushl $0 801064a6: 6a 00 push $0x0 pushl $87 801064a8: 6a 57 push $0x57 jmp alltraps 801064aa: e9 38 f8 ff ff jmp 80105ce7 <alltraps> 801064af <vector88>: .globl vector88 vector88: pushl $0 801064af: 6a 00 push $0x0 pushl $88 801064b1: 6a 58 push $0x58 jmp alltraps 801064b3: e9 2f f8 ff ff jmp 80105ce7 <alltraps> 801064b8 <vector89>: .globl vector89 vector89: pushl $0 801064b8: 6a 00 push $0x0 pushl $89 801064ba: 6a 59 push $0x59 jmp alltraps 801064bc: e9 26 f8 ff ff jmp 80105ce7 <alltraps> 801064c1 <vector90>: .globl vector90 vector90: pushl $0 801064c1: 6a 00 push $0x0 pushl $90 801064c3: 6a 5a push $0x5a jmp alltraps 801064c5: e9 1d f8 ff ff jmp 80105ce7 <alltraps> 801064ca <vector91>: .globl vector91 vector91: pushl $0 801064ca: 6a 00 push $0x0 pushl $91 801064cc: 6a 5b push $0x5b jmp alltraps 801064ce: e9 14 f8 ff ff jmp 80105ce7 <alltraps> 801064d3 <vector92>: .globl vector92 vector92: pushl $0 801064d3: 6a 00 push $0x0 pushl $92 801064d5: 6a 5c push $0x5c jmp alltraps 801064d7: e9 0b f8 ff ff jmp 80105ce7 <alltraps> 801064dc <vector93>: .globl vector93 vector93: pushl $0 801064dc: 6a 00 push $0x0 pushl $93 801064de: 6a 5d push $0x5d jmp alltraps 801064e0: e9 02 f8 ff ff jmp 80105ce7 <alltraps> 801064e5 <vector94>: .globl vector94 vector94: pushl $0 801064e5: 6a 00 push $0x0 pushl $94 801064e7: 6a 5e push $0x5e jmp alltraps 801064e9: e9 f9 f7 ff ff jmp 80105ce7 <alltraps> 801064ee <vector95>: .globl vector95 vector95: pushl $0 801064ee: 6a 00 push $0x0 pushl $95 801064f0: 6a 5f push $0x5f jmp alltraps 801064f2: e9 f0 f7 ff ff jmp 80105ce7 <alltraps> 801064f7 <vector96>: .globl vector96 vector96: pushl $0 801064f7: 6a 00 push $0x0 pushl $96 801064f9: 6a 60 push $0x60 jmp alltraps 801064fb: e9 e7 f7 ff ff jmp 80105ce7 <alltraps> 80106500 <vector97>: .globl vector97 vector97: pushl $0 80106500: 6a 00 push $0x0 pushl $97 80106502: 6a 61 push $0x61 jmp alltraps 80106504: e9 de f7 ff ff jmp 80105ce7 <alltraps> 80106509 <vector98>: .globl vector98 vector98: pushl $0 80106509: 6a 00 push $0x0 pushl $98 8010650b: 6a 62 push $0x62 jmp alltraps 8010650d: e9 d5 f7 ff ff jmp 80105ce7 <alltraps> 80106512 <vector99>: .globl vector99 vector99: pushl $0 80106512: 6a 00 push $0x0 pushl $99 80106514: 6a 63 push $0x63 jmp alltraps 80106516: e9 cc f7 ff ff jmp 80105ce7 <alltraps> 8010651b <vector100>: .globl vector100 vector100: pushl $0 8010651b: 6a 00 push $0x0 pushl $100 8010651d: 6a 64 push $0x64 jmp alltraps 8010651f: e9 c3 f7 ff ff jmp 80105ce7 <alltraps> 80106524 <vector101>: .globl vector101 vector101: pushl $0 80106524: 6a 00 push $0x0 pushl $101 80106526: 6a 65 push $0x65 jmp alltraps 80106528: e9 ba f7 ff ff jmp 80105ce7 <alltraps> 8010652d <vector102>: .globl vector102 vector102: pushl $0 8010652d: 6a 00 push $0x0 pushl $102 8010652f: 6a 66 push $0x66 jmp alltraps 80106531: e9 b1 f7 ff ff jmp 80105ce7 <alltraps> 80106536 <vector103>: .globl vector103 vector103: pushl $0 80106536: 6a 00 push $0x0 pushl $103 80106538: 6a 67 push $0x67 jmp alltraps 8010653a: e9 a8 f7 ff ff jmp 80105ce7 <alltraps> 8010653f <vector104>: .globl vector104 vector104: pushl $0 8010653f: 6a 00 push $0x0 pushl $104 80106541: 6a 68 push $0x68 jmp alltraps 80106543: e9 9f f7 ff ff jmp 80105ce7 <alltraps> 80106548 <vector105>: .globl vector105 vector105: pushl $0 80106548: 6a 00 push $0x0 pushl $105 8010654a: 6a 69 push $0x69 jmp alltraps 8010654c: e9 96 f7 ff ff jmp 80105ce7 <alltraps> 80106551 <vector106>: .globl vector106 vector106: pushl $0 80106551: 6a 00 push $0x0 pushl $106 80106553: 6a 6a push $0x6a jmp alltraps 80106555: e9 8d f7 ff ff jmp 80105ce7 <alltraps> 8010655a <vector107>: .globl vector107 vector107: pushl $0 8010655a: 6a 00 push $0x0 pushl $107 8010655c: 6a 6b push $0x6b jmp alltraps 8010655e: e9 84 f7 ff ff jmp 80105ce7 <alltraps> 80106563 <vector108>: .globl vector108 vector108: pushl $0 80106563: 6a 00 push $0x0 pushl $108 80106565: 6a 6c push $0x6c jmp alltraps 80106567: e9 7b f7 ff ff jmp 80105ce7 <alltraps> 8010656c <vector109>: .globl vector109 vector109: pushl $0 8010656c: 6a 00 push $0x0 pushl $109 8010656e: 6a 6d push $0x6d jmp alltraps 80106570: e9 72 f7 ff ff jmp 80105ce7 <alltraps> 80106575 <vector110>: .globl vector110 vector110: pushl $0 80106575: 6a 00 push $0x0 pushl $110 80106577: 6a 6e push $0x6e jmp alltraps 80106579: e9 69 f7 ff ff jmp 80105ce7 <alltraps> 8010657e <vector111>: .globl vector111 vector111: pushl $0 8010657e: 6a 00 push $0x0 pushl $111 80106580: 6a 6f push $0x6f jmp alltraps 80106582: e9 60 f7 ff ff jmp 80105ce7 <alltraps> 80106587 <vector112>: .globl vector112 vector112: pushl $0 80106587: 6a 00 push $0x0 pushl $112 80106589: 6a 70 push $0x70 jmp alltraps 8010658b: e9 57 f7 ff ff jmp 80105ce7 <alltraps> 80106590 <vector113>: .globl vector113 vector113: pushl $0 80106590: 6a 00 push $0x0 pushl $113 80106592: 6a 71 push $0x71 jmp alltraps 80106594: e9 4e f7 ff ff jmp 80105ce7 <alltraps> 80106599 <vector114>: .globl vector114 vector114: pushl $0 80106599: 6a 00 push $0x0 pushl $114 8010659b: 6a 72 push $0x72 jmp alltraps 8010659d: e9 45 f7 ff ff jmp 80105ce7 <alltraps> 801065a2 <vector115>: .globl vector115 vector115: pushl $0 801065a2: 6a 00 push $0x0 pushl $115 801065a4: 6a 73 push $0x73 jmp alltraps 801065a6: e9 3c f7 ff ff jmp 80105ce7 <alltraps> 801065ab <vector116>: .globl vector116 vector116: pushl $0 801065ab: 6a 00 push $0x0 pushl $116 801065ad: 6a 74 push $0x74 jmp alltraps 801065af: e9 33 f7 ff ff jmp 80105ce7 <alltraps> 801065b4 <vector117>: .globl vector117 vector117: pushl $0 801065b4: 6a 00 push $0x0 pushl $117 801065b6: 6a 75 push $0x75 jmp alltraps 801065b8: e9 2a f7 ff ff jmp 80105ce7 <alltraps> 801065bd <vector118>: .globl vector118 vector118: pushl $0 801065bd: 6a 00 push $0x0 pushl $118 801065bf: 6a 76 push $0x76 jmp alltraps 801065c1: e9 21 f7 ff ff jmp 80105ce7 <alltraps> 801065c6 <vector119>: .globl vector119 vector119: pushl $0 801065c6: 6a 00 push $0x0 pushl $119 801065c8: 6a 77 push $0x77 jmp alltraps 801065ca: e9 18 f7 ff ff jmp 80105ce7 <alltraps> 801065cf <vector120>: .globl vector120 vector120: pushl $0 801065cf: 6a 00 push $0x0 pushl $120 801065d1: 6a 78 push $0x78 jmp alltraps 801065d3: e9 0f f7 ff ff jmp 80105ce7 <alltraps> 801065d8 <vector121>: .globl vector121 vector121: pushl $0 801065d8: 6a 00 push $0x0 pushl $121 801065da: 6a 79 push $0x79 jmp alltraps 801065dc: e9 06 f7 ff ff jmp 80105ce7 <alltraps> 801065e1 <vector122>: .globl vector122 vector122: pushl $0 801065e1: 6a 00 push $0x0 pushl $122 801065e3: 6a 7a push $0x7a jmp alltraps 801065e5: e9 fd f6 ff ff jmp 80105ce7 <alltraps> 801065ea <vector123>: .globl vector123 vector123: pushl $0 801065ea: 6a 00 push $0x0 pushl $123 801065ec: 6a 7b push $0x7b jmp alltraps 801065ee: e9 f4 f6 ff ff jmp 80105ce7 <alltraps> 801065f3 <vector124>: .globl vector124 vector124: pushl $0 801065f3: 6a 00 push $0x0 pushl $124 801065f5: 6a 7c push $0x7c jmp alltraps 801065f7: e9 eb f6 ff ff jmp 80105ce7 <alltraps> 801065fc <vector125>: .globl vector125 vector125: pushl $0 801065fc: 6a 00 push $0x0 pushl $125 801065fe: 6a 7d push $0x7d jmp alltraps 80106600: e9 e2 f6 ff ff jmp 80105ce7 <alltraps> 80106605 <vector126>: .globl vector126 vector126: pushl $0 80106605: 6a 00 push $0x0 pushl $126 80106607: 6a 7e push $0x7e jmp alltraps 80106609: e9 d9 f6 ff ff jmp 80105ce7 <alltraps> 8010660e <vector127>: .globl vector127 vector127: pushl $0 8010660e: 6a 00 push $0x0 pushl $127 80106610: 6a 7f push $0x7f jmp alltraps 80106612: e9 d0 f6 ff ff jmp 80105ce7 <alltraps> 80106617 <vector128>: .globl vector128 vector128: pushl $0 80106617: 6a 00 push $0x0 pushl $128 80106619: 68 80 00 00 00 push $0x80 jmp alltraps 8010661e: e9 c4 f6 ff ff jmp 80105ce7 <alltraps> 80106623 <vector129>: .globl vector129 vector129: pushl $0 80106623: 6a 00 push $0x0 pushl $129 80106625: 68 81 00 00 00 push $0x81 jmp alltraps 8010662a: e9 b8 f6 ff ff jmp 80105ce7 <alltraps> 8010662f <vector130>: .globl vector130 vector130: pushl $0 8010662f: 6a 00 push $0x0 pushl $130 80106631: 68 82 00 00 00 push $0x82 jmp alltraps 80106636: e9 ac f6 ff ff jmp 80105ce7 <alltraps> 8010663b <vector131>: .globl vector131 vector131: pushl $0 8010663b: 6a 00 push $0x0 pushl $131 8010663d: 68 83 00 00 00 push $0x83 jmp alltraps 80106642: e9 a0 f6 ff ff jmp 80105ce7 <alltraps> 80106647 <vector132>: .globl vector132 vector132: pushl $0 80106647: 6a 00 push $0x0 pushl $132 80106649: 68 84 00 00 00 push $0x84 jmp alltraps 8010664e: e9 94 f6 ff ff jmp 80105ce7 <alltraps> 80106653 <vector133>: .globl vector133 vector133: pushl $0 80106653: 6a 00 push $0x0 pushl $133 80106655: 68 85 00 00 00 push $0x85 jmp alltraps 8010665a: e9 88 f6 ff ff jmp 80105ce7 <alltraps> 8010665f <vector134>: .globl vector134 vector134: pushl $0 8010665f: 6a 00 push $0x0 pushl $134 80106661: 68 86 00 00 00 push $0x86 jmp alltraps 80106666: e9 7c f6 ff ff jmp 80105ce7 <alltraps> 8010666b <vector135>: .globl vector135 vector135: pushl $0 8010666b: 6a 00 push $0x0 pushl $135 8010666d: 68 87 00 00 00 push $0x87 jmp alltraps 80106672: e9 70 f6 ff ff jmp 80105ce7 <alltraps> 80106677 <vector136>: .globl vector136 vector136: pushl $0 80106677: 6a 00 push $0x0 pushl $136 80106679: 68 88 00 00 00 push $0x88 jmp alltraps 8010667e: e9 64 f6 ff ff jmp 80105ce7 <alltraps> 80106683 <vector137>: .globl vector137 vector137: pushl $0 80106683: 6a 00 push $0x0 pushl $137 80106685: 68 89 00 00 00 push $0x89 jmp alltraps 8010668a: e9 58 f6 ff ff jmp 80105ce7 <alltraps> 8010668f <vector138>: .globl vector138 vector138: pushl $0 8010668f: 6a 00 push $0x0 pushl $138 80106691: 68 8a 00 00 00 push $0x8a jmp alltraps 80106696: e9 4c f6 ff ff jmp 80105ce7 <alltraps> 8010669b <vector139>: .globl vector139 vector139: pushl $0 8010669b: 6a 00 push $0x0 pushl $139 8010669d: 68 8b 00 00 00 push $0x8b jmp alltraps 801066a2: e9 40 f6 ff ff jmp 80105ce7 <alltraps> 801066a7 <vector140>: .globl vector140 vector140: pushl $0 801066a7: 6a 00 push $0x0 pushl $140 801066a9: 68 8c 00 00 00 push $0x8c jmp alltraps 801066ae: e9 34 f6 ff ff jmp 80105ce7 <alltraps> 801066b3 <vector141>: .globl vector141 vector141: pushl $0 801066b3: 6a 00 push $0x0 pushl $141 801066b5: 68 8d 00 00 00 push $0x8d jmp alltraps 801066ba: e9 28 f6 ff ff jmp 80105ce7 <alltraps> 801066bf <vector142>: .globl vector142 vector142: pushl $0 801066bf: 6a 00 push $0x0 pushl $142 801066c1: 68 8e 00 00 00 push $0x8e jmp alltraps 801066c6: e9 1c f6 ff ff jmp 80105ce7 <alltraps> 801066cb <vector143>: .globl vector143 vector143: pushl $0 801066cb: 6a 00 push $0x0 pushl $143 801066cd: 68 8f 00 00 00 push $0x8f jmp alltraps 801066d2: e9 10 f6 ff ff jmp 80105ce7 <alltraps> 801066d7 <vector144>: .globl vector144 vector144: pushl $0 801066d7: 6a 00 push $0x0 pushl $144 801066d9: 68 90 00 00 00 push $0x90 jmp alltraps 801066de: e9 04 f6 ff ff jmp 80105ce7 <alltraps> 801066e3 <vector145>: .globl vector145 vector145: pushl $0 801066e3: 6a 00 push $0x0 pushl $145 801066e5: 68 91 00 00 00 push $0x91 jmp alltraps 801066ea: e9 f8 f5 ff ff jmp 80105ce7 <alltraps> 801066ef <vector146>: .globl vector146 vector146: pushl $0 801066ef: 6a 00 push $0x0 pushl $146 801066f1: 68 92 00 00 00 push $0x92 jmp alltraps 801066f6: e9 ec f5 ff ff jmp 80105ce7 <alltraps> 801066fb <vector147>: .globl vector147 vector147: pushl $0 801066fb: 6a 00 push $0x0 pushl $147 801066fd: 68 93 00 00 00 push $0x93 jmp alltraps 80106702: e9 e0 f5 ff ff jmp 80105ce7 <alltraps> 80106707 <vector148>: .globl vector148 vector148: pushl $0 80106707: 6a 00 push $0x0 pushl $148 80106709: 68 94 00 00 00 push $0x94 jmp alltraps 8010670e: e9 d4 f5 ff ff jmp 80105ce7 <alltraps> 80106713 <vector149>: .globl vector149 vector149: pushl $0 80106713: 6a 00 push $0x0 pushl $149 80106715: 68 95 00 00 00 push $0x95 jmp alltraps 8010671a: e9 c8 f5 ff ff jmp 80105ce7 <alltraps> 8010671f <vector150>: .globl vector150 vector150: pushl $0 8010671f: 6a 00 push $0x0 pushl $150 80106721: 68 96 00 00 00 push $0x96 jmp alltraps 80106726: e9 bc f5 ff ff jmp 80105ce7 <alltraps> 8010672b <vector151>: .globl vector151 vector151: pushl $0 8010672b: 6a 00 push $0x0 pushl $151 8010672d: 68 97 00 00 00 push $0x97 jmp alltraps 80106732: e9 b0 f5 ff ff jmp 80105ce7 <alltraps> 80106737 <vector152>: .globl vector152 vector152: pushl $0 80106737: 6a 00 push $0x0 pushl $152 80106739: 68 98 00 00 00 push $0x98 jmp alltraps 8010673e: e9 a4 f5 ff ff jmp 80105ce7 <alltraps> 80106743 <vector153>: .globl vector153 vector153: pushl $0 80106743: 6a 00 push $0x0 pushl $153 80106745: 68 99 00 00 00 push $0x99 jmp alltraps 8010674a: e9 98 f5 ff ff jmp 80105ce7 <alltraps> 8010674f <vector154>: .globl vector154 vector154: pushl $0 8010674f: 6a 00 push $0x0 pushl $154 80106751: 68 9a 00 00 00 push $0x9a jmp alltraps 80106756: e9 8c f5 ff ff jmp 80105ce7 <alltraps> 8010675b <vector155>: .globl vector155 vector155: pushl $0 8010675b: 6a 00 push $0x0 pushl $155 8010675d: 68 9b 00 00 00 push $0x9b jmp alltraps 80106762: e9 80 f5 ff ff jmp 80105ce7 <alltraps> 80106767 <vector156>: .globl vector156 vector156: pushl $0 80106767: 6a 00 push $0x0 pushl $156 80106769: 68 9c 00 00 00 push $0x9c jmp alltraps 8010676e: e9 74 f5 ff ff jmp 80105ce7 <alltraps> 80106773 <vector157>: .globl vector157 vector157: pushl $0 80106773: 6a 00 push $0x0 pushl $157 80106775: 68 9d 00 00 00 push $0x9d jmp alltraps 8010677a: e9 68 f5 ff ff jmp 80105ce7 <alltraps> 8010677f <vector158>: .globl vector158 vector158: pushl $0 8010677f: 6a 00 push $0x0 pushl $158 80106781: 68 9e 00 00 00 push $0x9e jmp alltraps 80106786: e9 5c f5 ff ff jmp 80105ce7 <alltraps> 8010678b <vector159>: .globl vector159 vector159: pushl $0 8010678b: 6a 00 push $0x0 pushl $159 8010678d: 68 9f 00 00 00 push $0x9f jmp alltraps 80106792: e9 50 f5 ff ff jmp 80105ce7 <alltraps> 80106797 <vector160>: .globl vector160 vector160: pushl $0 80106797: 6a 00 push $0x0 pushl $160 80106799: 68 a0 00 00 00 push $0xa0 jmp alltraps 8010679e: e9 44 f5 ff ff jmp 80105ce7 <alltraps> 801067a3 <vector161>: .globl vector161 vector161: pushl $0 801067a3: 6a 00 push $0x0 pushl $161 801067a5: 68 a1 00 00 00 push $0xa1 jmp alltraps 801067aa: e9 38 f5 ff ff jmp 80105ce7 <alltraps> 801067af <vector162>: .globl vector162 vector162: pushl $0 801067af: 6a 00 push $0x0 pushl $162 801067b1: 68 a2 00 00 00 push $0xa2 jmp alltraps 801067b6: e9 2c f5 ff ff jmp 80105ce7 <alltraps> 801067bb <vector163>: .globl vector163 vector163: pushl $0 801067bb: 6a 00 push $0x0 pushl $163 801067bd: 68 a3 00 00 00 push $0xa3 jmp alltraps 801067c2: e9 20 f5 ff ff jmp 80105ce7 <alltraps> 801067c7 <vector164>: .globl vector164 vector164: pushl $0 801067c7: 6a 00 push $0x0 pushl $164 801067c9: 68 a4 00 00 00 push $0xa4 jmp alltraps 801067ce: e9 14 f5 ff ff jmp 80105ce7 <alltraps> 801067d3 <vector165>: .globl vector165 vector165: pushl $0 801067d3: 6a 00 push $0x0 pushl $165 801067d5: 68 a5 00 00 00 push $0xa5 jmp alltraps 801067da: e9 08 f5 ff ff jmp 80105ce7 <alltraps> 801067df <vector166>: .globl vector166 vector166: pushl $0 801067df: 6a 00 push $0x0 pushl $166 801067e1: 68 a6 00 00 00 push $0xa6 jmp alltraps 801067e6: e9 fc f4 ff ff jmp 80105ce7 <alltraps> 801067eb <vector167>: .globl vector167 vector167: pushl $0 801067eb: 6a 00 push $0x0 pushl $167 801067ed: 68 a7 00 00 00 push $0xa7 jmp alltraps 801067f2: e9 f0 f4 ff ff jmp 80105ce7 <alltraps> 801067f7 <vector168>: .globl vector168 vector168: pushl $0 801067f7: 6a 00 push $0x0 pushl $168 801067f9: 68 a8 00 00 00 push $0xa8 jmp alltraps 801067fe: e9 e4 f4 ff ff jmp 80105ce7 <alltraps> 80106803 <vector169>: .globl vector169 vector169: pushl $0 80106803: 6a 00 push $0x0 pushl $169 80106805: 68 a9 00 00 00 push $0xa9 jmp alltraps 8010680a: e9 d8 f4 ff ff jmp 80105ce7 <alltraps> 8010680f <vector170>: .globl vector170 vector170: pushl $0 8010680f: 6a 00 push $0x0 pushl $170 80106811: 68 aa 00 00 00 push $0xaa jmp alltraps 80106816: e9 cc f4 ff ff jmp 80105ce7 <alltraps> 8010681b <vector171>: .globl vector171 vector171: pushl $0 8010681b: 6a 00 push $0x0 pushl $171 8010681d: 68 ab 00 00 00 push $0xab jmp alltraps 80106822: e9 c0 f4 ff ff jmp 80105ce7 <alltraps> 80106827 <vector172>: .globl vector172 vector172: pushl $0 80106827: 6a 00 push $0x0 pushl $172 80106829: 68 ac 00 00 00 push $0xac jmp alltraps 8010682e: e9 b4 f4 ff ff jmp 80105ce7 <alltraps> 80106833 <vector173>: .globl vector173 vector173: pushl $0 80106833: 6a 00 push $0x0 pushl $173 80106835: 68 ad 00 00 00 push $0xad jmp alltraps 8010683a: e9 a8 f4 ff ff jmp 80105ce7 <alltraps> 8010683f <vector174>: .globl vector174 vector174: pushl $0 8010683f: 6a 00 push $0x0 pushl $174 80106841: 68 ae 00 00 00 push $0xae jmp alltraps 80106846: e9 9c f4 ff ff jmp 80105ce7 <alltraps> 8010684b <vector175>: .globl vector175 vector175: pushl $0 8010684b: 6a 00 push $0x0 pushl $175 8010684d: 68 af 00 00 00 push $0xaf jmp alltraps 80106852: e9 90 f4 ff ff jmp 80105ce7 <alltraps> 80106857 <vector176>: .globl vector176 vector176: pushl $0 80106857: 6a 00 push $0x0 pushl $176 80106859: 68 b0 00 00 00 push $0xb0 jmp alltraps 8010685e: e9 84 f4 ff ff jmp 80105ce7 <alltraps> 80106863 <vector177>: .globl vector177 vector177: pushl $0 80106863: 6a 00 push $0x0 pushl $177 80106865: 68 b1 00 00 00 push $0xb1 jmp alltraps 8010686a: e9 78 f4 ff ff jmp 80105ce7 <alltraps> 8010686f <vector178>: .globl vector178 vector178: pushl $0 8010686f: 6a 00 push $0x0 pushl $178 80106871: 68 b2 00 00 00 push $0xb2 jmp alltraps 80106876: e9 6c f4 ff ff jmp 80105ce7 <alltraps> 8010687b <vector179>: .globl vector179 vector179: pushl $0 8010687b: 6a 00 push $0x0 pushl $179 8010687d: 68 b3 00 00 00 push $0xb3 jmp alltraps 80106882: e9 60 f4 ff ff jmp 80105ce7 <alltraps> 80106887 <vector180>: .globl vector180 vector180: pushl $0 80106887: 6a 00 push $0x0 pushl $180 80106889: 68 b4 00 00 00 push $0xb4 jmp alltraps 8010688e: e9 54 f4 ff ff jmp 80105ce7 <alltraps> 80106893 <vector181>: .globl vector181 vector181: pushl $0 80106893: 6a 00 push $0x0 pushl $181 80106895: 68 b5 00 00 00 push $0xb5 jmp alltraps 8010689a: e9 48 f4 ff ff jmp 80105ce7 <alltraps> 8010689f <vector182>: .globl vector182 vector182: pushl $0 8010689f: 6a 00 push $0x0 pushl $182 801068a1: 68 b6 00 00 00 push $0xb6 jmp alltraps 801068a6: e9 3c f4 ff ff jmp 80105ce7 <alltraps> 801068ab <vector183>: .globl vector183 vector183: pushl $0 801068ab: 6a 00 push $0x0 pushl $183 801068ad: 68 b7 00 00 00 push $0xb7 jmp alltraps 801068b2: e9 30 f4 ff ff jmp 80105ce7 <alltraps> 801068b7 <vector184>: .globl vector184 vector184: pushl $0 801068b7: 6a 00 push $0x0 pushl $184 801068b9: 68 b8 00 00 00 push $0xb8 jmp alltraps 801068be: e9 24 f4 ff ff jmp 80105ce7 <alltraps> 801068c3 <vector185>: .globl vector185 vector185: pushl $0 801068c3: 6a 00 push $0x0 pushl $185 801068c5: 68 b9 00 00 00 push $0xb9 jmp alltraps 801068ca: e9 18 f4 ff ff jmp 80105ce7 <alltraps> 801068cf <vector186>: .globl vector186 vector186: pushl $0 801068cf: 6a 00 push $0x0 pushl $186 801068d1: 68 ba 00 00 00 push $0xba jmp alltraps 801068d6: e9 0c f4 ff ff jmp 80105ce7 <alltraps> 801068db <vector187>: .globl vector187 vector187: pushl $0 801068db: 6a 00 push $0x0 pushl $187 801068dd: 68 bb 00 00 00 push $0xbb jmp alltraps 801068e2: e9 00 f4 ff ff jmp 80105ce7 <alltraps> 801068e7 <vector188>: .globl vector188 vector188: pushl $0 801068e7: 6a 00 push $0x0 pushl $188 801068e9: 68 bc 00 00 00 push $0xbc jmp alltraps 801068ee: e9 f4 f3 ff ff jmp 80105ce7 <alltraps> 801068f3 <vector189>: .globl vector189 vector189: pushl $0 801068f3: 6a 00 push $0x0 pushl $189 801068f5: 68 bd 00 00 00 push $0xbd jmp alltraps 801068fa: e9 e8 f3 ff ff jmp 80105ce7 <alltraps> 801068ff <vector190>: .globl vector190 vector190: pushl $0 801068ff: 6a 00 push $0x0 pushl $190 80106901: 68 be 00 00 00 push $0xbe jmp alltraps 80106906: e9 dc f3 ff ff jmp 80105ce7 <alltraps> 8010690b <vector191>: .globl vector191 vector191: pushl $0 8010690b: 6a 00 push $0x0 pushl $191 8010690d: 68 bf 00 00 00 push $0xbf jmp alltraps 80106912: e9 d0 f3 ff ff jmp 80105ce7 <alltraps> 80106917 <vector192>: .globl vector192 vector192: pushl $0 80106917: 6a 00 push $0x0 pushl $192 80106919: 68 c0 00 00 00 push $0xc0 jmp alltraps 8010691e: e9 c4 f3 ff ff jmp 80105ce7 <alltraps> 80106923 <vector193>: .globl vector193 vector193: pushl $0 80106923: 6a 00 push $0x0 pushl $193 80106925: 68 c1 00 00 00 push $0xc1 jmp alltraps 8010692a: e9 b8 f3 ff ff jmp 80105ce7 <alltraps> 8010692f <vector194>: .globl vector194 vector194: pushl $0 8010692f: 6a 00 push $0x0 pushl $194 80106931: 68 c2 00 00 00 push $0xc2 jmp alltraps 80106936: e9 ac f3 ff ff jmp 80105ce7 <alltraps> 8010693b <vector195>: .globl vector195 vector195: pushl $0 8010693b: 6a 00 push $0x0 pushl $195 8010693d: 68 c3 00 00 00 push $0xc3 jmp alltraps 80106942: e9 a0 f3 ff ff jmp 80105ce7 <alltraps> 80106947 <vector196>: .globl vector196 vector196: pushl $0 80106947: 6a 00 push $0x0 pushl $196 80106949: 68 c4 00 00 00 push $0xc4 jmp alltraps 8010694e: e9 94 f3 ff ff jmp 80105ce7 <alltraps> 80106953 <vector197>: .globl vector197 vector197: pushl $0 80106953: 6a 00 push $0x0 pushl $197 80106955: 68 c5 00 00 00 push $0xc5 jmp alltraps 8010695a: e9 88 f3 ff ff jmp 80105ce7 <alltraps> 8010695f <vector198>: .globl vector198 vector198: pushl $0 8010695f: 6a 00 push $0x0 pushl $198 80106961: 68 c6 00 00 00 push $0xc6 jmp alltraps 80106966: e9 7c f3 ff ff jmp 80105ce7 <alltraps> 8010696b <vector199>: .globl vector199 vector199: pushl $0 8010696b: 6a 00 push $0x0 pushl $199 8010696d: 68 c7 00 00 00 push $0xc7 jmp alltraps 80106972: e9 70 f3 ff ff jmp 80105ce7 <alltraps> 80106977 <vector200>: .globl vector200 vector200: pushl $0 80106977: 6a 00 push $0x0 pushl $200 80106979: 68 c8 00 00 00 push $0xc8 jmp alltraps 8010697e: e9 64 f3 ff ff jmp 80105ce7 <alltraps> 80106983 <vector201>: .globl vector201 vector201: pushl $0 80106983: 6a 00 push $0x0 pushl $201 80106985: 68 c9 00 00 00 push $0xc9 jmp alltraps 8010698a: e9 58 f3 ff ff jmp 80105ce7 <alltraps> 8010698f <vector202>: .globl vector202 vector202: pushl $0 8010698f: 6a 00 push $0x0 pushl $202 80106991: 68 ca 00 00 00 push $0xca jmp alltraps 80106996: e9 4c f3 ff ff jmp 80105ce7 <alltraps> 8010699b <vector203>: .globl vector203 vector203: pushl $0 8010699b: 6a 00 push $0x0 pushl $203 8010699d: 68 cb 00 00 00 push $0xcb jmp alltraps 801069a2: e9 40 f3 ff ff jmp 80105ce7 <alltraps> 801069a7 <vector204>: .globl vector204 vector204: pushl $0 801069a7: 6a 00 push $0x0 pushl $204 801069a9: 68 cc 00 00 00 push $0xcc jmp alltraps 801069ae: e9 34 f3 ff ff jmp 80105ce7 <alltraps> 801069b3 <vector205>: .globl vector205 vector205: pushl $0 801069b3: 6a 00 push $0x0 pushl $205 801069b5: 68 cd 00 00 00 push $0xcd jmp alltraps 801069ba: e9 28 f3 ff ff jmp 80105ce7 <alltraps> 801069bf <vector206>: .globl vector206 vector206: pushl $0 801069bf: 6a 00 push $0x0 pushl $206 801069c1: 68 ce 00 00 00 push $0xce jmp alltraps 801069c6: e9 1c f3 ff ff jmp 80105ce7 <alltraps> 801069cb <vector207>: .globl vector207 vector207: pushl $0 801069cb: 6a 00 push $0x0 pushl $207 801069cd: 68 cf 00 00 00 push $0xcf jmp alltraps 801069d2: e9 10 f3 ff ff jmp 80105ce7 <alltraps> 801069d7 <vector208>: .globl vector208 vector208: pushl $0 801069d7: 6a 00 push $0x0 pushl $208 801069d9: 68 d0 00 00 00 push $0xd0 jmp alltraps 801069de: e9 04 f3 ff ff jmp 80105ce7 <alltraps> 801069e3 <vector209>: .globl vector209 vector209: pushl $0 801069e3: 6a 00 push $0x0 pushl $209 801069e5: 68 d1 00 00 00 push $0xd1 jmp alltraps 801069ea: e9 f8 f2 ff ff jmp 80105ce7 <alltraps> 801069ef <vector210>: .globl vector210 vector210: pushl $0 801069ef: 6a 00 push $0x0 pushl $210 801069f1: 68 d2 00 00 00 push $0xd2 jmp alltraps 801069f6: e9 ec f2 ff ff jmp 80105ce7 <alltraps> 801069fb <vector211>: .globl vector211 vector211: pushl $0 801069fb: 6a 00 push $0x0 pushl $211 801069fd: 68 d3 00 00 00 push $0xd3 jmp alltraps 80106a02: e9 e0 f2 ff ff jmp 80105ce7 <alltraps> 80106a07 <vector212>: .globl vector212 vector212: pushl $0 80106a07: 6a 00 push $0x0 pushl $212 80106a09: 68 d4 00 00 00 push $0xd4 jmp alltraps 80106a0e: e9 d4 f2 ff ff jmp 80105ce7 <alltraps> 80106a13 <vector213>: .globl vector213 vector213: pushl $0 80106a13: 6a 00 push $0x0 pushl $213 80106a15: 68 d5 00 00 00 push $0xd5 jmp alltraps 80106a1a: e9 c8 f2 ff ff jmp 80105ce7 <alltraps> 80106a1f <vector214>: .globl vector214 vector214: pushl $0 80106a1f: 6a 00 push $0x0 pushl $214 80106a21: 68 d6 00 00 00 push $0xd6 jmp alltraps 80106a26: e9 bc f2 ff ff jmp 80105ce7 <alltraps> 80106a2b <vector215>: .globl vector215 vector215: pushl $0 80106a2b: 6a 00 push $0x0 pushl $215 80106a2d: 68 d7 00 00 00 push $0xd7 jmp alltraps 80106a32: e9 b0 f2 ff ff jmp 80105ce7 <alltraps> 80106a37 <vector216>: .globl vector216 vector216: pushl $0 80106a37: 6a 00 push $0x0 pushl $216 80106a39: 68 d8 00 00 00 push $0xd8 jmp alltraps 80106a3e: e9 a4 f2 ff ff jmp 80105ce7 <alltraps> 80106a43 <vector217>: .globl vector217 vector217: pushl $0 80106a43: 6a 00 push $0x0 pushl $217 80106a45: 68 d9 00 00 00 push $0xd9 jmp alltraps 80106a4a: e9 98 f2 ff ff jmp 80105ce7 <alltraps> 80106a4f <vector218>: .globl vector218 vector218: pushl $0 80106a4f: 6a 00 push $0x0 pushl $218 80106a51: 68 da 00 00 00 push $0xda jmp alltraps 80106a56: e9 8c f2 ff ff jmp 80105ce7 <alltraps> 80106a5b <vector219>: .globl vector219 vector219: pushl $0 80106a5b: 6a 00 push $0x0 pushl $219 80106a5d: 68 db 00 00 00 push $0xdb jmp alltraps 80106a62: e9 80 f2 ff ff jmp 80105ce7 <alltraps> 80106a67 <vector220>: .globl vector220 vector220: pushl $0 80106a67: 6a 00 push $0x0 pushl $220 80106a69: 68 dc 00 00 00 push $0xdc jmp alltraps 80106a6e: e9 74 f2 ff ff jmp 80105ce7 <alltraps> 80106a73 <vector221>: .globl vector221 vector221: pushl $0 80106a73: 6a 00 push $0x0 pushl $221 80106a75: 68 dd 00 00 00 push $0xdd jmp alltraps 80106a7a: e9 68 f2 ff ff jmp 80105ce7 <alltraps> 80106a7f <vector222>: .globl vector222 vector222: pushl $0 80106a7f: 6a 00 push $0x0 pushl $222 80106a81: 68 de 00 00 00 push $0xde jmp alltraps 80106a86: e9 5c f2 ff ff jmp 80105ce7 <alltraps> 80106a8b <vector223>: .globl vector223 vector223: pushl $0 80106a8b: 6a 00 push $0x0 pushl $223 80106a8d: 68 df 00 00 00 push $0xdf jmp alltraps 80106a92: e9 50 f2 ff ff jmp 80105ce7 <alltraps> 80106a97 <vector224>: .globl vector224 vector224: pushl $0 80106a97: 6a 00 push $0x0 pushl $224 80106a99: 68 e0 00 00 00 push $0xe0 jmp alltraps 80106a9e: e9 44 f2 ff ff jmp 80105ce7 <alltraps> 80106aa3 <vector225>: .globl vector225 vector225: pushl $0 80106aa3: 6a 00 push $0x0 pushl $225 80106aa5: 68 e1 00 00 00 push $0xe1 jmp alltraps 80106aaa: e9 38 f2 ff ff jmp 80105ce7 <alltraps> 80106aaf <vector226>: .globl vector226 vector226: pushl $0 80106aaf: 6a 00 push $0x0 pushl $226 80106ab1: 68 e2 00 00 00 push $0xe2 jmp alltraps 80106ab6: e9 2c f2 ff ff jmp 80105ce7 <alltraps> 80106abb <vector227>: .globl vector227 vector227: pushl $0 80106abb: 6a 00 push $0x0 pushl $227 80106abd: 68 e3 00 00 00 push $0xe3 jmp alltraps 80106ac2: e9 20 f2 ff ff jmp 80105ce7 <alltraps> 80106ac7 <vector228>: .globl vector228 vector228: pushl $0 80106ac7: 6a 00 push $0x0 pushl $228 80106ac9: 68 e4 00 00 00 push $0xe4 jmp alltraps 80106ace: e9 14 f2 ff ff jmp 80105ce7 <alltraps> 80106ad3 <vector229>: .globl vector229 vector229: pushl $0 80106ad3: 6a 00 push $0x0 pushl $229 80106ad5: 68 e5 00 00 00 push $0xe5 jmp alltraps 80106ada: e9 08 f2 ff ff jmp 80105ce7 <alltraps> 80106adf <vector230>: .globl vector230 vector230: pushl $0 80106adf: 6a 00 push $0x0 pushl $230 80106ae1: 68 e6 00 00 00 push $0xe6 jmp alltraps 80106ae6: e9 fc f1 ff ff jmp 80105ce7 <alltraps> 80106aeb <vector231>: .globl vector231 vector231: pushl $0 80106aeb: 6a 00 push $0x0 pushl $231 80106aed: 68 e7 00 00 00 push $0xe7 jmp alltraps 80106af2: e9 f0 f1 ff ff jmp 80105ce7 <alltraps> 80106af7 <vector232>: .globl vector232 vector232: pushl $0 80106af7: 6a 00 push $0x0 pushl $232 80106af9: 68 e8 00 00 00 push $0xe8 jmp alltraps 80106afe: e9 e4 f1 ff ff jmp 80105ce7 <alltraps> 80106b03 <vector233>: .globl vector233 vector233: pushl $0 80106b03: 6a 00 push $0x0 pushl $233 80106b05: 68 e9 00 00 00 push $0xe9 jmp alltraps 80106b0a: e9 d8 f1 ff ff jmp 80105ce7 <alltraps> 80106b0f <vector234>: .globl vector234 vector234: pushl $0 80106b0f: 6a 00 push $0x0 pushl $234 80106b11: 68 ea 00 00 00 push $0xea jmp alltraps 80106b16: e9 cc f1 ff ff jmp 80105ce7 <alltraps> 80106b1b <vector235>: .globl vector235 vector235: pushl $0 80106b1b: 6a 00 push $0x0 pushl $235 80106b1d: 68 eb 00 00 00 push $0xeb jmp alltraps 80106b22: e9 c0 f1 ff ff jmp 80105ce7 <alltraps> 80106b27 <vector236>: .globl vector236 vector236: pushl $0 80106b27: 6a 00 push $0x0 pushl $236 80106b29: 68 ec 00 00 00 push $0xec jmp alltraps 80106b2e: e9 b4 f1 ff ff jmp 80105ce7 <alltraps> 80106b33 <vector237>: .globl vector237 vector237: pushl $0 80106b33: 6a 00 push $0x0 pushl $237 80106b35: 68 ed 00 00 00 push $0xed jmp alltraps 80106b3a: e9 a8 f1 ff ff jmp 80105ce7 <alltraps> 80106b3f <vector238>: .globl vector238 vector238: pushl $0 80106b3f: 6a 00 push $0x0 pushl $238 80106b41: 68 ee 00 00 00 push $0xee jmp alltraps 80106b46: e9 9c f1 ff ff jmp 80105ce7 <alltraps> 80106b4b <vector239>: .globl vector239 vector239: pushl $0 80106b4b: 6a 00 push $0x0 pushl $239 80106b4d: 68 ef 00 00 00 push $0xef jmp alltraps 80106b52: e9 90 f1 ff ff jmp 80105ce7 <alltraps> 80106b57 <vector240>: .globl vector240 vector240: pushl $0 80106b57: 6a 00 push $0x0 pushl $240 80106b59: 68 f0 00 00 00 push $0xf0 jmp alltraps 80106b5e: e9 84 f1 ff ff jmp 80105ce7 <alltraps> 80106b63 <vector241>: .globl vector241 vector241: pushl $0 80106b63: 6a 00 push $0x0 pushl $241 80106b65: 68 f1 00 00 00 push $0xf1 jmp alltraps 80106b6a: e9 78 f1 ff ff jmp 80105ce7 <alltraps> 80106b6f <vector242>: .globl vector242 vector242: pushl $0 80106b6f: 6a 00 push $0x0 pushl $242 80106b71: 68 f2 00 00 00 push $0xf2 jmp alltraps 80106b76: e9 6c f1 ff ff jmp 80105ce7 <alltraps> 80106b7b <vector243>: .globl vector243 vector243: pushl $0 80106b7b: 6a 00 push $0x0 pushl $243 80106b7d: 68 f3 00 00 00 push $0xf3 jmp alltraps 80106b82: e9 60 f1 ff ff jmp 80105ce7 <alltraps> 80106b87 <vector244>: .globl vector244 vector244: pushl $0 80106b87: 6a 00 push $0x0 pushl $244 80106b89: 68 f4 00 00 00 push $0xf4 jmp alltraps 80106b8e: e9 54 f1 ff ff jmp 80105ce7 <alltraps> 80106b93 <vector245>: .globl vector245 vector245: pushl $0 80106b93: 6a 00 push $0x0 pushl $245 80106b95: 68 f5 00 00 00 push $0xf5 jmp alltraps 80106b9a: e9 48 f1 ff ff jmp 80105ce7 <alltraps> 80106b9f <vector246>: .globl vector246 vector246: pushl $0 80106b9f: 6a 00 push $0x0 pushl $246 80106ba1: 68 f6 00 00 00 push $0xf6 jmp alltraps 80106ba6: e9 3c f1 ff ff jmp 80105ce7 <alltraps> 80106bab <vector247>: .globl vector247 vector247: pushl $0 80106bab: 6a 00 push $0x0 pushl $247 80106bad: 68 f7 00 00 00 push $0xf7 jmp alltraps 80106bb2: e9 30 f1 ff ff jmp 80105ce7 <alltraps> 80106bb7 <vector248>: .globl vector248 vector248: pushl $0 80106bb7: 6a 00 push $0x0 pushl $248 80106bb9: 68 f8 00 00 00 push $0xf8 jmp alltraps 80106bbe: e9 24 f1 ff ff jmp 80105ce7 <alltraps> 80106bc3 <vector249>: .globl vector249 vector249: pushl $0 80106bc3: 6a 00 push $0x0 pushl $249 80106bc5: 68 f9 00 00 00 push $0xf9 jmp alltraps 80106bca: e9 18 f1 ff ff jmp 80105ce7 <alltraps> 80106bcf <vector250>: .globl vector250 vector250: pushl $0 80106bcf: 6a 00 push $0x0 pushl $250 80106bd1: 68 fa 00 00 00 push $0xfa jmp alltraps 80106bd6: e9 0c f1 ff ff jmp 80105ce7 <alltraps> 80106bdb <vector251>: .globl vector251 vector251: pushl $0 80106bdb: 6a 00 push $0x0 pushl $251 80106bdd: 68 fb 00 00 00 push $0xfb jmp alltraps 80106be2: e9 00 f1 ff ff jmp 80105ce7 <alltraps> 80106be7 <vector252>: .globl vector252 vector252: pushl $0 80106be7: 6a 00 push $0x0 pushl $252 80106be9: 68 fc 00 00 00 push $0xfc jmp alltraps 80106bee: e9 f4 f0 ff ff jmp 80105ce7 <alltraps> 80106bf3 <vector253>: .globl vector253 vector253: pushl $0 80106bf3: 6a 00 push $0x0 pushl $253 80106bf5: 68 fd 00 00 00 push $0xfd jmp alltraps 80106bfa: e9 e8 f0 ff ff jmp 80105ce7 <alltraps> 80106bff <vector254>: .globl vector254 vector254: pushl $0 80106bff: 6a 00 push $0x0 pushl $254 80106c01: 68 fe 00 00 00 push $0xfe jmp alltraps 80106c06: e9 dc f0 ff ff jmp 80105ce7 <alltraps> 80106c0b <vector255>: .globl vector255 vector255: pushl $0 80106c0b: 6a 00 push $0x0 pushl $255 80106c0d: 68 ff 00 00 00 push $0xff jmp alltraps 80106c12: e9 d0 f0 ff ff jmp 80105ce7 <alltraps> 80106c17: 66 90 xchg %ax,%ax 80106c19: 66 90 xchg %ax,%ax 80106c1b: 66 90 xchg %ax,%ax 80106c1d: 66 90 xchg %ax,%ax 80106c1f: 90 nop 80106c20 <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) { 80106c20: 55 push %ebp 80106c21: 89 e5 mov %esp,%ebp 80106c23: 57 push %edi 80106c24: 56 push %esi 80106c25: 53 push %ebx 80106c26: 89 d3 mov %edx,%ebx pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; 80106c28: c1 ea 16 shr $0x16,%edx 80106c2b: 8d 3c 90 lea (%eax,%edx,4),%edi // 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) { 80106c2e: 83 ec 0c sub $0xc,%esp pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; if(*pde & PTE_P){ 80106c31: 8b 07 mov (%edi),%eax 80106c33: a8 01 test $0x1,%al 80106c35: 74 29 je 80106c60 <walkpgdir+0x40> pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); 80106c37: 25 00 f0 ff ff and $0xfffff000,%eax 80106c3c: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi // 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)]; } 80106c42: 8d 65 f4 lea -0xc(%ebp),%esp // 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)]; 80106c45: c1 eb 0a shr $0xa,%ebx 80106c48: 81 e3 fc 0f 00 00 and $0xffc,%ebx 80106c4e: 8d 04 1e lea (%esi,%ebx,1),%eax } 80106c51: 5b pop %ebx 80106c52: 5e pop %esi 80106c53: 5f pop %edi 80106c54: 5d pop %ebp 80106c55: c3 ret 80106c56: 8d 76 00 lea 0x0(%esi),%esi 80106c59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi pde = &pgdir[PDX(va)]; if(*pde & PTE_P){ pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); } else { if(!alloc || (pgtab = (pte_t*)kalloc()) == 0) 80106c60: 85 c9 test %ecx,%ecx 80106c62: 74 2c je 80106c90 <walkpgdir+0x70> 80106c64: e8 27 b8 ff ff call 80102490 <kalloc> 80106c69: 85 c0 test %eax,%eax 80106c6b: 89 c6 mov %eax,%esi 80106c6d: 74 21 je 80106c90 <walkpgdir+0x70> return 0; // Make sure all those PTE_P bits are zero. memset(pgtab, 0, PGSIZE); 80106c6f: 83 ec 04 sub $0x4,%esp 80106c72: 68 00 10 00 00 push $0x1000 80106c77: 6a 00 push $0x0 80106c79: 50 push %eax 80106c7a: e8 31 dd ff ff call 801049b0 <memset> // The permissions here are overly generous, but they can // be further restricted by the permissions in the page table // entries, if necessary. *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; 80106c7f: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106c85: 83 c4 10 add $0x10,%esp 80106c88: 83 c8 07 or $0x7,%eax 80106c8b: 89 07 mov %eax,(%edi) 80106c8d: eb b3 jmp 80106c42 <walkpgdir+0x22> 80106c8f: 90 nop } return &pgtab[PTX(va)]; } 80106c90: 8d 65 f4 lea -0xc(%ebp),%esp pde = &pgdir[PDX(va)]; if(*pde & PTE_P){ pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); } else { if(!alloc || (pgtab = (pte_t*)kalloc()) == 0) return 0; 80106c93: 31 c0 xor %eax,%eax // 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)]; } 80106c95: 5b pop %ebx 80106c96: 5e pop %esi 80106c97: 5f pop %edi 80106c98: 5d pop %ebp 80106c99: c3 ret 80106c9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106ca0 <mappages>: // Create PTEs for virtual addresses starting at va that refer to // physical addresses starting at pa. va and size might not // be page-aligned. static int mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm) { 80106ca0: 55 push %ebp 80106ca1: 89 e5 mov %esp,%ebp 80106ca3: 57 push %edi 80106ca4: 56 push %esi 80106ca5: 53 push %ebx char *a, *last; pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); 80106ca6: 89 d3 mov %edx,%ebx 80106ca8: 81 e3 00 f0 ff ff and $0xfffff000,%ebx // Create PTEs for virtual addresses starting at va that refer to // physical addresses starting at pa. va and size might not // be page-aligned. static int mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm) { 80106cae: 83 ec 1c sub $0x1c,%esp 80106cb1: 89 45 e4 mov %eax,-0x1c(%ebp) char *a, *last; pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); last = (char*)PGROUNDDOWN(((uint)va) + size - 1); 80106cb4: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax 80106cb8: 8b 7d 08 mov 0x8(%ebp),%edi 80106cbb: 25 00 f0 ff ff and $0xfffff000,%eax 80106cc0: 89 45 e0 mov %eax,-0x20(%ebp) for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; if(*pte & PTE_P) panic("remap"); *pte = pa | perm | PTE_P; 80106cc3: 8b 45 0c mov 0xc(%ebp),%eax 80106cc6: 29 df sub %ebx,%edi 80106cc8: 83 c8 01 or $0x1,%eax 80106ccb: 89 45 dc mov %eax,-0x24(%ebp) 80106cce: eb 15 jmp 80106ce5 <mappages+0x45> a = (char*)PGROUNDDOWN((uint)va); last = (char*)PGROUNDDOWN(((uint)va) + size - 1); for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; if(*pte & PTE_P) 80106cd0: f6 00 01 testb $0x1,(%eax) 80106cd3: 75 45 jne 80106d1a <mappages+0x7a> panic("remap"); *pte = pa | perm | PTE_P; 80106cd5: 0b 75 dc or -0x24(%ebp),%esi if(a == last) 80106cd8: 3b 5d e0 cmp -0x20(%ebp),%ebx for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; if(*pte & PTE_P) panic("remap"); *pte = pa | perm | PTE_P; 80106cdb: 89 30 mov %esi,(%eax) if(a == last) 80106cdd: 74 31 je 80106d10 <mappages+0x70> break; a += PGSIZE; 80106cdf: 81 c3 00 10 00 00 add $0x1000,%ebx pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); last = (char*)PGROUNDDOWN(((uint)va) + size - 1); for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) 80106ce5: 8b 45 e4 mov -0x1c(%ebp),%eax 80106ce8: b9 01 00 00 00 mov $0x1,%ecx 80106ced: 89 da mov %ebx,%edx 80106cef: 8d 34 3b lea (%ebx,%edi,1),%esi 80106cf2: e8 29 ff ff ff call 80106c20 <walkpgdir> 80106cf7: 85 c0 test %eax,%eax 80106cf9: 75 d5 jne 80106cd0 <mappages+0x30> break; a += PGSIZE; pa += PGSIZE; } return 0; } 80106cfb: 8d 65 f4 lea -0xc(%ebp),%esp a = (char*)PGROUNDDOWN((uint)va); last = (char*)PGROUNDDOWN(((uint)va) + size - 1); for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; 80106cfe: b8 ff ff ff ff mov $0xffffffff,%eax break; a += PGSIZE; pa += PGSIZE; } return 0; } 80106d03: 5b pop %ebx 80106d04: 5e pop %esi 80106d05: 5f pop %edi 80106d06: 5d pop %ebp 80106d07: c3 ret 80106d08: 90 nop 80106d09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106d10: 8d 65 f4 lea -0xc(%ebp),%esp if(a == last) break; a += PGSIZE; pa += PGSIZE; } return 0; 80106d13: 31 c0 xor %eax,%eax } 80106d15: 5b pop %ebx 80106d16: 5e pop %esi 80106d17: 5f pop %edi 80106d18: 5d pop %ebp 80106d19: c3 ret last = (char*)PGROUNDDOWN(((uint)va) + size - 1); for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; if(*pte & PTE_P) panic("remap"); 80106d1a: 83 ec 0c sub $0xc,%esp 80106d1d: 68 5c 7f 10 80 push $0x80107f5c 80106d22: e8 49 96 ff ff call 80100370 <panic> 80106d27: 89 f6 mov %esi,%esi 80106d29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106d30 <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) 80106d30: 55 push %ebp 80106d31: 89 e5 mov %esp,%ebp 80106d33: 57 push %edi 80106d34: 56 push %esi 80106d35: 53 push %ebx uint a, pa; if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); 80106d36: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx // 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) 80106d3c: 89 c7 mov %eax,%edi uint a, pa; if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); 80106d3e: 81 e3 00 f0 ff ff and $0xfffff000,%ebx // 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) 80106d44: 83 ec 1c sub $0x1c,%esp 80106d47: 89 4d e0 mov %ecx,-0x20(%ebp) if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); for(; a < oldsz; a += PGSIZE){ 80106d4a: 39 d3 cmp %edx,%ebx 80106d4c: 73 66 jae 80106db4 <deallocuvm.part.0+0x84> 80106d4e: 89 d6 mov %edx,%esi 80106d50: eb 3d jmp 80106d8f <deallocuvm.part.0+0x5f> 80106d52: 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){ 80106d58: 8b 10 mov (%eax),%edx 80106d5a: f6 c2 01 test $0x1,%dl 80106d5d: 74 26 je 80106d85 <deallocuvm.part.0+0x55> pa = PTE_ADDR(*pte); if(pa == 0) 80106d5f: 81 e2 00 f0 ff ff and $0xfffff000,%edx 80106d65: 74 58 je 80106dbf <deallocuvm.part.0+0x8f> panic("kfree"); char *v = P2V(pa); kfree(v); 80106d67: 83 ec 0c sub $0xc,%esp 80106d6a: 81 c2 00 00 00 80 add $0x80000000,%edx 80106d70: 89 45 e4 mov %eax,-0x1c(%ebp) 80106d73: 52 push %edx 80106d74: e8 67 b5 ff ff call 801022e0 <kfree> *pte = 0; 80106d79: 8b 45 e4 mov -0x1c(%ebp),%eax 80106d7c: 83 c4 10 add $0x10,%esp 80106d7f: c7 00 00 00 00 00 movl $0x0,(%eax) if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); for(; a < oldsz; a += PGSIZE){ 80106d85: 81 c3 00 10 00 00 add $0x1000,%ebx 80106d8b: 39 f3 cmp %esi,%ebx 80106d8d: 73 25 jae 80106db4 <deallocuvm.part.0+0x84> pte = walkpgdir(pgdir, (char*)a, 0); 80106d8f: 31 c9 xor %ecx,%ecx 80106d91: 89 da mov %ebx,%edx 80106d93: 89 f8 mov %edi,%eax 80106d95: e8 86 fe ff ff call 80106c20 <walkpgdir> if(!pte) 80106d9a: 85 c0 test %eax,%eax 80106d9c: 75 ba jne 80106d58 <deallocuvm.part.0+0x28> a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; 80106d9e: 81 e3 00 00 c0 ff and $0xffc00000,%ebx 80106da4: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); for(; a < oldsz; a += PGSIZE){ 80106daa: 81 c3 00 10 00 00 add $0x1000,%ebx 80106db0: 39 f3 cmp %esi,%ebx 80106db2: 72 db jb 80106d8f <deallocuvm.part.0+0x5f> kfree(v); *pte = 0; } } return newsz; } 80106db4: 8b 45 e0 mov -0x20(%ebp),%eax 80106db7: 8d 65 f4 lea -0xc(%ebp),%esp 80106dba: 5b pop %ebx 80106dbb: 5e pop %esi 80106dbc: 5f pop %edi 80106dbd: 5d pop %ebp 80106dbe: c3 ret if(!pte) a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; else if((*pte & PTE_P) != 0){ pa = PTE_ADDR(*pte); if(pa == 0) panic("kfree"); 80106dbf: 83 ec 0c sub $0xc,%esp 80106dc2: 68 06 78 10 80 push $0x80107806 80106dc7: e8 a4 95 ff ff call 80100370 <panic> 80106dcc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106dd0 <seginit>: // Set up CPU's kernel segment descriptors. // Run once on entry on each CPU. void seginit(void) { 80106dd0: 55 push %ebp 80106dd1: 89 e5 mov %esp,%ebp 80106dd3: 83 ec 18 sub $0x18,%esp // Map "logical" addresses to virtual addresses using identity map. // Cannot share a CODE descriptor for both kernel and user // because it would have to have DPL_USR, but the CPU forbids // an interrupt from CPL=0 to DPL=3. c = &cpus[cpuid()]; 80106dd6: e8 85 c9 ff ff call 80103760 <cpuid> c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 80106ddb: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax 80106de1: 31 c9 xor %ecx,%ecx 80106de3: ba ff ff ff ff mov $0xffffffff,%edx 80106de8: 66 89 90 f8 37 11 80 mov %dx,-0x7feec808(%eax) 80106def: 66 89 88 fa 37 11 80 mov %cx,-0x7feec806(%eax) c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 80106df6: ba ff ff ff ff mov $0xffffffff,%edx 80106dfb: 31 c9 xor %ecx,%ecx 80106dfd: 66 89 90 00 38 11 80 mov %dx,-0x7feec800(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 80106e04: ba ff ff ff ff mov $0xffffffff,%edx // Cannot share a CODE descriptor for both kernel and user // because it would have to have DPL_USR, but the CPU forbids // an interrupt from CPL=0 to DPL=3. c = &cpus[cpuid()]; c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 80106e09: 66 89 88 02 38 11 80 mov %cx,-0x7feec7fe(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 80106e10: 31 c9 xor %ecx,%ecx 80106e12: 66 89 90 08 38 11 80 mov %dx,-0x7feec7f8(%eax) 80106e19: 66 89 88 0a 38 11 80 mov %cx,-0x7feec7f6(%eax) c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 80106e20: ba ff ff ff ff mov $0xffffffff,%edx 80106e25: 31 c9 xor %ecx,%ecx 80106e27: 66 89 90 10 38 11 80 mov %dx,-0x7feec7f0(%eax) // Map "logical" addresses to virtual addresses using identity map. // Cannot share a CODE descriptor for both kernel and user // because it would have to have DPL_USR, but the CPU forbids // an interrupt from CPL=0 to DPL=3. c = &cpus[cpuid()]; c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 80106e2e: c6 80 fc 37 11 80 00 movb $0x0,-0x7feec804(%eax) static inline void lgdt(struct segdesc *p, int size) { volatile ushort pd[3]; pd[0] = size-1; 80106e35: ba 2f 00 00 00 mov $0x2f,%edx 80106e3a: c6 80 fd 37 11 80 9a movb $0x9a,-0x7feec803(%eax) 80106e41: c6 80 fe 37 11 80 cf movb $0xcf,-0x7feec802(%eax) 80106e48: c6 80 ff 37 11 80 00 movb $0x0,-0x7feec801(%eax) c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 80106e4f: c6 80 04 38 11 80 00 movb $0x0,-0x7feec7fc(%eax) 80106e56: c6 80 05 38 11 80 92 movb $0x92,-0x7feec7fb(%eax) 80106e5d: c6 80 06 38 11 80 cf movb $0xcf,-0x7feec7fa(%eax) 80106e64: c6 80 07 38 11 80 00 movb $0x0,-0x7feec7f9(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 80106e6b: c6 80 0c 38 11 80 00 movb $0x0,-0x7feec7f4(%eax) 80106e72: c6 80 0d 38 11 80 fa movb $0xfa,-0x7feec7f3(%eax) 80106e79: c6 80 0e 38 11 80 cf movb $0xcf,-0x7feec7f2(%eax) 80106e80: c6 80 0f 38 11 80 00 movb $0x0,-0x7feec7f1(%eax) c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 80106e87: 66 89 88 12 38 11 80 mov %cx,-0x7feec7ee(%eax) 80106e8e: c6 80 14 38 11 80 00 movb $0x0,-0x7feec7ec(%eax) 80106e95: c6 80 15 38 11 80 f2 movb $0xf2,-0x7feec7eb(%eax) 80106e9c: c6 80 16 38 11 80 cf movb $0xcf,-0x7feec7ea(%eax) 80106ea3: c6 80 17 38 11 80 00 movb $0x0,-0x7feec7e9(%eax) lgdt(c->gdt, sizeof(c->gdt)); 80106eaa: 05 f0 37 11 80 add $0x801137f0,%eax 80106eaf: 66 89 55 f2 mov %dx,-0xe(%ebp) pd[1] = (uint)p; 80106eb3: 66 89 45 f4 mov %ax,-0xc(%ebp) pd[2] = (uint)p >> 16; 80106eb7: c1 e8 10 shr $0x10,%eax 80106eba: 66 89 45 f6 mov %ax,-0xa(%ebp) asm volatile("lgdt (%0)" : : "r" (pd)); 80106ebe: 8d 45 f2 lea -0xe(%ebp),%eax 80106ec1: 0f 01 10 lgdtl (%eax) } 80106ec4: c9 leave 80106ec5: c3 ret 80106ec6: 8d 76 00 lea 0x0(%esi),%esi 80106ec9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106ed0 <switchkvm>: } static inline void lcr3(uint val) { asm volatile("movl %0,%%cr3" : : "r" (val)); 80106ed0: a1 44 6f 11 80 mov 0x80116f44,%eax // Switch h/w page table register to the kernel-only page table, // for when no process is running. void switchkvm(void) { 80106ed5: 55 push %ebp 80106ed6: 89 e5 mov %esp,%ebp 80106ed8: 05 00 00 00 80 add $0x80000000,%eax 80106edd: 0f 22 d8 mov %eax,%cr3 lcr3(V2P(kpgdir)); // switch to the kernel page table } 80106ee0: 5d pop %ebp 80106ee1: c3 ret 80106ee2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106ee9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106ef0 <switchuvm>: // Switch TSS and h/w page table to correspond to process p. void switchuvm(struct proc *p) { 80106ef0: 55 push %ebp 80106ef1: 89 e5 mov %esp,%ebp 80106ef3: 57 push %edi 80106ef4: 56 push %esi 80106ef5: 53 push %ebx 80106ef6: 83 ec 1c sub $0x1c,%esp 80106ef9: 8b 75 08 mov 0x8(%ebp),%esi if(p == 0) 80106efc: 85 f6 test %esi,%esi 80106efe: 0f 84 cd 00 00 00 je 80106fd1 <switchuvm+0xe1> panic("switchuvm: no process"); if(p->kstack == 0) 80106f04: 8b 46 08 mov 0x8(%esi),%eax 80106f07: 85 c0 test %eax,%eax 80106f09: 0f 84 dc 00 00 00 je 80106feb <switchuvm+0xfb> panic("switchuvm: no kstack"); if(p->pgdir == 0) 80106f0f: 8b 7e 04 mov 0x4(%esi),%edi 80106f12: 85 ff test %edi,%edi 80106f14: 0f 84 c4 00 00 00 je 80106fde <switchuvm+0xee> panic("switchuvm: no pgdir"); pushcli(); 80106f1a: e8 e1 d8 ff ff call 80104800 <pushcli> mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 80106f1f: e8 bc c7 ff ff call 801036e0 <mycpu> 80106f24: 89 c3 mov %eax,%ebx 80106f26: e8 b5 c7 ff ff call 801036e0 <mycpu> 80106f2b: 89 c7 mov %eax,%edi 80106f2d: e8 ae c7 ff ff call 801036e0 <mycpu> 80106f32: 89 45 e4 mov %eax,-0x1c(%ebp) 80106f35: 83 c7 08 add $0x8,%edi 80106f38: e8 a3 c7 ff ff call 801036e0 <mycpu> 80106f3d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80106f40: 83 c0 08 add $0x8,%eax 80106f43: ba 67 00 00 00 mov $0x67,%edx 80106f48: c1 e8 18 shr $0x18,%eax 80106f4b: 66 89 93 98 00 00 00 mov %dx,0x98(%ebx) 80106f52: 66 89 bb 9a 00 00 00 mov %di,0x9a(%ebx) 80106f59: c6 83 9d 00 00 00 99 movb $0x99,0x9d(%ebx) 80106f60: c6 83 9e 00 00 00 40 movb $0x40,0x9e(%ebx) 80106f67: 83 c1 08 add $0x8,%ecx 80106f6a: 88 83 9f 00 00 00 mov %al,0x9f(%ebx) 80106f70: c1 e9 10 shr $0x10,%ecx 80106f73: 88 8b 9c 00 00 00 mov %cl,0x9c(%ebx) mycpu()->gdt[SEG_TSS].s = 0; mycpu()->ts.ss0 = SEG_KDATA << 3; mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; // setting IOPL=0 in eflags *and* iomb beyond the tss segment limit // forbids I/O instructions (e.g., inb and outb) from user space mycpu()->ts.iomb = (ushort) 0xFFFF; 80106f79: bb ff ff ff ff mov $0xffffffff,%ebx panic("switchuvm: no pgdir"); pushcli(); mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, sizeof(mycpu()->ts)-1, 0); mycpu()->gdt[SEG_TSS].s = 0; 80106f7e: e8 5d c7 ff ff call 801036e0 <mycpu> 80106f83: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax) mycpu()->ts.ss0 = SEG_KDATA << 3; 80106f8a: e8 51 c7 ff ff call 801036e0 <mycpu> 80106f8f: b9 10 00 00 00 mov $0x10,%ecx 80106f94: 66 89 48 10 mov %cx,0x10(%eax) mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; 80106f98: e8 43 c7 ff ff call 801036e0 <mycpu> 80106f9d: 8b 56 08 mov 0x8(%esi),%edx 80106fa0: 8d 8a 00 10 00 00 lea 0x1000(%edx),%ecx 80106fa6: 89 48 0c mov %ecx,0xc(%eax) // setting IOPL=0 in eflags *and* iomb beyond the tss segment limit // forbids I/O instructions (e.g., inb and outb) from user space mycpu()->ts.iomb = (ushort) 0xFFFF; 80106fa9: e8 32 c7 ff ff call 801036e0 <mycpu> 80106fae: 66 89 58 6e mov %bx,0x6e(%eax) } static inline void ltr(ushort sel) { asm volatile("ltr %0" : : "r" (sel)); 80106fb2: b8 28 00 00 00 mov $0x28,%eax 80106fb7: 0f 00 d8 ltr %ax } static inline void lcr3(uint val) { asm volatile("movl %0,%%cr3" : : "r" (val)); 80106fba: 8b 46 04 mov 0x4(%esi),%eax 80106fbd: 05 00 00 00 80 add $0x80000000,%eax 80106fc2: 0f 22 d8 mov %eax,%cr3 ltr(SEG_TSS << 3); lcr3(V2P(p->pgdir)); // switch to process's address space popcli(); } 80106fc5: 8d 65 f4 lea -0xc(%ebp),%esp 80106fc8: 5b pop %ebx 80106fc9: 5e pop %esi 80106fca: 5f pop %edi 80106fcb: 5d pop %ebp // setting IOPL=0 in eflags *and* iomb beyond the tss segment limit // forbids I/O instructions (e.g., inb and outb) from user space mycpu()->ts.iomb = (ushort) 0xFFFF; ltr(SEG_TSS << 3); lcr3(V2P(p->pgdir)); // switch to process's address space popcli(); 80106fcc: e9 1f d9 ff ff jmp 801048f0 <popcli> // Switch TSS and h/w page table to correspond to process p. void switchuvm(struct proc *p) { if(p == 0) panic("switchuvm: no process"); 80106fd1: 83 ec 0c sub $0xc,%esp 80106fd4: 68 62 7f 10 80 push $0x80107f62 80106fd9: e8 92 93 ff ff call 80100370 <panic> if(p->kstack == 0) panic("switchuvm: no kstack"); if(p->pgdir == 0) panic("switchuvm: no pgdir"); 80106fde: 83 ec 0c sub $0xc,%esp 80106fe1: 68 8d 7f 10 80 push $0x80107f8d 80106fe6: e8 85 93 ff ff call 80100370 <panic> switchuvm(struct proc *p) { if(p == 0) panic("switchuvm: no process"); if(p->kstack == 0) panic("switchuvm: no kstack"); 80106feb: 83 ec 0c sub $0xc,%esp 80106fee: 68 78 7f 10 80 push $0x80107f78 80106ff3: e8 78 93 ff ff call 80100370 <panic> 80106ff8: 90 nop 80106ff9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107000 <inituvm>: // Load the initcode into address 0 of pgdir. // sz must be less than a page. void inituvm(pde_t *pgdir, char *init, uint sz) { 80107000: 55 push %ebp 80107001: 89 e5 mov %esp,%ebp 80107003: 57 push %edi 80107004: 56 push %esi 80107005: 53 push %ebx 80107006: 83 ec 1c sub $0x1c,%esp 80107009: 8b 75 10 mov 0x10(%ebp),%esi 8010700c: 8b 45 08 mov 0x8(%ebp),%eax 8010700f: 8b 7d 0c mov 0xc(%ebp),%edi char *mem; if(sz >= PGSIZE) 80107012: 81 fe ff 0f 00 00 cmp $0xfff,%esi // Load the initcode into address 0 of pgdir. // sz must be less than a page. void inituvm(pde_t *pgdir, char *init, uint sz) { 80107018: 89 45 e4 mov %eax,-0x1c(%ebp) char *mem; if(sz >= PGSIZE) 8010701b: 77 49 ja 80107066 <inituvm+0x66> panic("inituvm: more than a page"); mem = kalloc(); 8010701d: e8 6e b4 ff ff call 80102490 <kalloc> memset(mem, 0, PGSIZE); 80107022: 83 ec 04 sub $0x4,%esp { char *mem; if(sz >= PGSIZE) panic("inituvm: more than a page"); mem = kalloc(); 80107025: 89 c3 mov %eax,%ebx memset(mem, 0, PGSIZE); 80107027: 68 00 10 00 00 push $0x1000 8010702c: 6a 00 push $0x0 8010702e: 50 push %eax 8010702f: e8 7c d9 ff ff call 801049b0 <memset> mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U); 80107034: 58 pop %eax 80107035: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 8010703b: b9 00 10 00 00 mov $0x1000,%ecx 80107040: 5a pop %edx 80107041: 6a 06 push $0x6 80107043: 50 push %eax 80107044: 31 d2 xor %edx,%edx 80107046: 8b 45 e4 mov -0x1c(%ebp),%eax 80107049: e8 52 fc ff ff call 80106ca0 <mappages> memmove(mem, init, sz); 8010704e: 89 75 10 mov %esi,0x10(%ebp) 80107051: 89 7d 0c mov %edi,0xc(%ebp) 80107054: 83 c4 10 add $0x10,%esp 80107057: 89 5d 08 mov %ebx,0x8(%ebp) } 8010705a: 8d 65 f4 lea -0xc(%ebp),%esp 8010705d: 5b pop %ebx 8010705e: 5e pop %esi 8010705f: 5f pop %edi 80107060: 5d pop %ebp if(sz >= PGSIZE) panic("inituvm: more than a page"); mem = kalloc(); memset(mem, 0, PGSIZE); mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U); memmove(mem, init, sz); 80107061: e9 fa d9 ff ff jmp 80104a60 <memmove> inituvm(pde_t *pgdir, char *init, uint sz) { char *mem; if(sz >= PGSIZE) panic("inituvm: more than a page"); 80107066: 83 ec 0c sub $0xc,%esp 80107069: 68 a1 7f 10 80 push $0x80107fa1 8010706e: e8 fd 92 ff ff call 80100370 <panic> 80107073: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107079: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107080 <loaduvm>: // Load a program segment into pgdir. addr must be page-aligned // and the pages from addr to addr+sz must already be mapped. int loaduvm(pde_t *pgdir, char *addr, struct inode *ip, uint offset, uint sz) { 80107080: 55 push %ebp 80107081: 89 e5 mov %esp,%ebp 80107083: 57 push %edi 80107084: 56 push %esi 80107085: 53 push %ebx 80107086: 83 ec 0c sub $0xc,%esp uint i, pa, n; pte_t *pte; if((uint) addr % PGSIZE != 0) 80107089: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp) 80107090: 0f 85 91 00 00 00 jne 80107127 <loaduvm+0xa7> panic("loaduvm: addr must be page aligned"); for(i = 0; i < sz; i += PGSIZE){ 80107096: 8b 75 18 mov 0x18(%ebp),%esi 80107099: 31 db xor %ebx,%ebx 8010709b: 85 f6 test %esi,%esi 8010709d: 75 1a jne 801070b9 <loaduvm+0x39> 8010709f: eb 6f jmp 80107110 <loaduvm+0x90> 801070a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801070a8: 81 c3 00 10 00 00 add $0x1000,%ebx 801070ae: 81 ee 00 10 00 00 sub $0x1000,%esi 801070b4: 39 5d 18 cmp %ebx,0x18(%ebp) 801070b7: 76 57 jbe 80107110 <loaduvm+0x90> if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) 801070b9: 8b 55 0c mov 0xc(%ebp),%edx 801070bc: 8b 45 08 mov 0x8(%ebp),%eax 801070bf: 31 c9 xor %ecx,%ecx 801070c1: 01 da add %ebx,%edx 801070c3: e8 58 fb ff ff call 80106c20 <walkpgdir> 801070c8: 85 c0 test %eax,%eax 801070ca: 74 4e je 8010711a <loaduvm+0x9a> panic("loaduvm: address should exist"); pa = PTE_ADDR(*pte); 801070cc: 8b 00 mov (%eax),%eax if(sz - i < PGSIZE) n = sz - i; else n = PGSIZE; if(readi(ip, P2V(pa), offset+i, n) != n) 801070ce: 8b 4d 14 mov 0x14(%ebp),%ecx panic("loaduvm: addr must be page aligned"); for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) panic("loaduvm: address should exist"); pa = PTE_ADDR(*pte); if(sz - i < PGSIZE) 801070d1: bf 00 10 00 00 mov $0x1000,%edi if((uint) addr % PGSIZE != 0) panic("loaduvm: addr must be page aligned"); for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) panic("loaduvm: address should exist"); pa = PTE_ADDR(*pte); 801070d6: 25 00 f0 ff ff and $0xfffff000,%eax if(sz - i < PGSIZE) 801070db: 81 fe ff 0f 00 00 cmp $0xfff,%esi 801070e1: 0f 46 fe cmovbe %esi,%edi n = sz - i; else n = PGSIZE; if(readi(ip, P2V(pa), offset+i, n) != n) 801070e4: 01 d9 add %ebx,%ecx 801070e6: 05 00 00 00 80 add $0x80000000,%eax 801070eb: 57 push %edi 801070ec: 51 push %ecx 801070ed: 50 push %eax 801070ee: ff 75 10 pushl 0x10(%ebp) 801070f1: e8 5a a8 ff ff call 80101950 <readi> 801070f6: 83 c4 10 add $0x10,%esp 801070f9: 39 c7 cmp %eax,%edi 801070fb: 74 ab je 801070a8 <loaduvm+0x28> return -1; } return 0; } 801070fd: 8d 65 f4 lea -0xc(%ebp),%esp if(sz - i < PGSIZE) n = sz - i; else n = PGSIZE; if(readi(ip, P2V(pa), offset+i, n) != n) return -1; 80107100: b8 ff ff ff ff mov $0xffffffff,%eax } return 0; } 80107105: 5b pop %ebx 80107106: 5e pop %esi 80107107: 5f pop %edi 80107108: 5d pop %ebp 80107109: c3 ret 8010710a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107110: 8d 65 f4 lea -0xc(%ebp),%esp else n = PGSIZE; if(readi(ip, P2V(pa), offset+i, n) != n) return -1; } return 0; 80107113: 31 c0 xor %eax,%eax } 80107115: 5b pop %ebx 80107116: 5e pop %esi 80107117: 5f pop %edi 80107118: 5d pop %ebp 80107119: c3 ret if((uint) addr % PGSIZE != 0) panic("loaduvm: addr must be page aligned"); for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) panic("loaduvm: address should exist"); 8010711a: 83 ec 0c sub $0xc,%esp 8010711d: 68 bb 7f 10 80 push $0x80107fbb 80107122: e8 49 92 ff ff call 80100370 <panic> { uint i, pa, n; pte_t *pte; if((uint) addr % PGSIZE != 0) panic("loaduvm: addr must be page aligned"); 80107127: 83 ec 0c sub $0xc,%esp 8010712a: 68 5c 80 10 80 push $0x8010805c 8010712f: e8 3c 92 ff ff call 80100370 <panic> 80107134: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010713a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80107140 <allocuvm>: // Allocate page tables and physical memory to grow process from oldsz to // newsz, which need not be page aligned. Returns new size or 0 on error. int allocuvm(pde_t *pgdir, uint oldsz, uint newsz) { 80107140: 55 push %ebp 80107141: 89 e5 mov %esp,%ebp 80107143: 57 push %edi 80107144: 56 push %esi 80107145: 53 push %ebx 80107146: 83 ec 0c sub $0xc,%esp 80107149: 8b 7d 10 mov 0x10(%ebp),%edi char *mem; uint a; if(newsz >= KERNBASE) 8010714c: 85 ff test %edi,%edi 8010714e: 0f 88 ca 00 00 00 js 8010721e <allocuvm+0xde> return 0; if(newsz < oldsz) 80107154: 3b 7d 0c cmp 0xc(%ebp),%edi return oldsz; 80107157: 8b 45 0c mov 0xc(%ebp),%eax char *mem; uint a; if(newsz >= KERNBASE) return 0; if(newsz < oldsz) 8010715a: 0f 82 82 00 00 00 jb 801071e2 <allocuvm+0xa2> return oldsz; a = PGROUNDUP(oldsz); 80107160: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80107166: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; a < newsz; a += PGSIZE){ 8010716c: 39 df cmp %ebx,%edi 8010716e: 77 43 ja 801071b3 <allocuvm+0x73> 80107170: e9 bb 00 00 00 jmp 80107230 <allocuvm+0xf0> 80107175: 8d 76 00 lea 0x0(%esi),%esi if(mem == 0){ cprintf("allocuvm out of memory\n"); deallocuvm(pgdir, newsz, oldsz); return 0; } memset(mem, 0, PGSIZE); 80107178: 83 ec 04 sub $0x4,%esp 8010717b: 68 00 10 00 00 push $0x1000 80107180: 6a 00 push $0x0 80107182: 50 push %eax 80107183: e8 28 d8 ff ff call 801049b0 <memset> if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ 80107188: 58 pop %eax 80107189: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 8010718f: b9 00 10 00 00 mov $0x1000,%ecx 80107194: 5a pop %edx 80107195: 6a 06 push $0x6 80107197: 50 push %eax 80107198: 89 da mov %ebx,%edx 8010719a: 8b 45 08 mov 0x8(%ebp),%eax 8010719d: e8 fe fa ff ff call 80106ca0 <mappages> 801071a2: 83 c4 10 add $0x10,%esp 801071a5: 85 c0 test %eax,%eax 801071a7: 78 47 js 801071f0 <allocuvm+0xb0> return 0; if(newsz < oldsz) return oldsz; a = PGROUNDUP(oldsz); for(; a < newsz; a += PGSIZE){ 801071a9: 81 c3 00 10 00 00 add $0x1000,%ebx 801071af: 39 df cmp %ebx,%edi 801071b1: 76 7d jbe 80107230 <allocuvm+0xf0> mem = kalloc(); 801071b3: e8 d8 b2 ff ff call 80102490 <kalloc> if(mem == 0){ 801071b8: 85 c0 test %eax,%eax if(newsz < oldsz) return oldsz; a = PGROUNDUP(oldsz); for(; a < newsz; a += PGSIZE){ mem = kalloc(); 801071ba: 89 c6 mov %eax,%esi if(mem == 0){ 801071bc: 75 ba jne 80107178 <allocuvm+0x38> cprintf("allocuvm out of memory\n"); 801071be: 83 ec 0c sub $0xc,%esp 801071c1: 68 d9 7f 10 80 push $0x80107fd9 801071c6: e8 95 94 ff ff call 80100660 <cprintf> deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) { pte_t *pte; uint a, pa; if(newsz >= oldsz) 801071cb: 83 c4 10 add $0x10,%esp 801071ce: 3b 7d 0c cmp 0xc(%ebp),%edi 801071d1: 76 4b jbe 8010721e <allocuvm+0xde> 801071d3: 8b 4d 0c mov 0xc(%ebp),%ecx 801071d6: 8b 45 08 mov 0x8(%ebp),%eax 801071d9: 89 fa mov %edi,%edx 801071db: e8 50 fb ff ff call 80106d30 <deallocuvm.part.0> for(; a < newsz; a += PGSIZE){ mem = kalloc(); if(mem == 0){ cprintf("allocuvm out of memory\n"); deallocuvm(pgdir, newsz, oldsz); return 0; 801071e0: 31 c0 xor %eax,%eax kfree(mem); return 0; } } return newsz; } 801071e2: 8d 65 f4 lea -0xc(%ebp),%esp 801071e5: 5b pop %ebx 801071e6: 5e pop %esi 801071e7: 5f pop %edi 801071e8: 5d pop %ebp 801071e9: c3 ret 801071ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi deallocuvm(pgdir, newsz, oldsz); return 0; } memset(mem, 0, PGSIZE); if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ cprintf("allocuvm out of memory (2)\n"); 801071f0: 83 ec 0c sub $0xc,%esp 801071f3: 68 f1 7f 10 80 push $0x80107ff1 801071f8: e8 63 94 ff ff call 80100660 <cprintf> deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) { pte_t *pte; uint a, pa; if(newsz >= oldsz) 801071fd: 83 c4 10 add $0x10,%esp 80107200: 3b 7d 0c cmp 0xc(%ebp),%edi 80107203: 76 0d jbe 80107212 <allocuvm+0xd2> 80107205: 8b 4d 0c mov 0xc(%ebp),%ecx 80107208: 8b 45 08 mov 0x8(%ebp),%eax 8010720b: 89 fa mov %edi,%edx 8010720d: e8 1e fb ff ff call 80106d30 <deallocuvm.part.0> } memset(mem, 0, PGSIZE); if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ cprintf("allocuvm out of memory (2)\n"); deallocuvm(pgdir, newsz, oldsz); kfree(mem); 80107212: 83 ec 0c sub $0xc,%esp 80107215: 56 push %esi 80107216: e8 c5 b0 ff ff call 801022e0 <kfree> return 0; 8010721b: 83 c4 10 add $0x10,%esp } } return newsz; } 8010721e: 8d 65 f4 lea -0xc(%ebp),%esp memset(mem, 0, PGSIZE); if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ cprintf("allocuvm out of memory (2)\n"); deallocuvm(pgdir, newsz, oldsz); kfree(mem); return 0; 80107221: 31 c0 xor %eax,%eax } } return newsz; } 80107223: 5b pop %ebx 80107224: 5e pop %esi 80107225: 5f pop %edi 80107226: 5d pop %ebp 80107227: c3 ret 80107228: 90 nop 80107229: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107230: 8d 65 f4 lea -0xc(%ebp),%esp return 0; if(newsz < oldsz) return oldsz; a = PGROUNDUP(oldsz); for(; a < newsz; a += PGSIZE){ 80107233: 89 f8 mov %edi,%eax kfree(mem); return 0; } } return newsz; } 80107235: 5b pop %ebx 80107236: 5e pop %esi 80107237: 5f pop %edi 80107238: 5d pop %ebp 80107239: c3 ret 8010723a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107240 <deallocuvm>: // newsz. oldsz and newsz need not be page-aligned, nor does newsz // need to be less than oldsz. oldsz can be larger than the actual // process size. Returns the new process size. int deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) { 80107240: 55 push %ebp 80107241: 89 e5 mov %esp,%ebp 80107243: 8b 55 0c mov 0xc(%ebp),%edx 80107246: 8b 4d 10 mov 0x10(%ebp),%ecx 80107249: 8b 45 08 mov 0x8(%ebp),%eax pte_t *pte; uint a, pa; if(newsz >= oldsz) 8010724c: 39 d1 cmp %edx,%ecx 8010724e: 73 10 jae 80107260 <deallocuvm+0x20> kfree(v); *pte = 0; } } return newsz; } 80107250: 5d pop %ebp 80107251: e9 da fa ff ff jmp 80106d30 <deallocuvm.part.0> 80107256: 8d 76 00 lea 0x0(%esi),%esi 80107259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107260: 89 d0 mov %edx,%eax 80107262: 5d pop %ebp 80107263: c3 ret 80107264: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010726a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80107270 <freevm>: // Free a page table and all the physical memory pages // in the user part. void freevm(pde_t *pgdir) { 80107270: 55 push %ebp 80107271: 89 e5 mov %esp,%ebp 80107273: 57 push %edi 80107274: 56 push %esi 80107275: 53 push %ebx 80107276: 83 ec 0c sub $0xc,%esp 80107279: 8b 75 08 mov 0x8(%ebp),%esi uint i; if(pgdir == 0) 8010727c: 85 f6 test %esi,%esi 8010727e: 74 59 je 801072d9 <freevm+0x69> 80107280: 31 c9 xor %ecx,%ecx 80107282: ba 00 00 00 80 mov $0x80000000,%edx 80107287: 89 f0 mov %esi,%eax 80107289: e8 a2 fa ff ff call 80106d30 <deallocuvm.part.0> 8010728e: 89 f3 mov %esi,%ebx 80107290: 8d be 00 10 00 00 lea 0x1000(%esi),%edi 80107296: eb 0f jmp 801072a7 <freevm+0x37> 80107298: 90 nop 80107299: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801072a0: 83 c3 04 add $0x4,%ebx panic("freevm: no pgdir"); deallocuvm(pgdir, KERNBASE, 0); for(i = 0; i < NPDENTRIES; i++){ 801072a3: 39 fb cmp %edi,%ebx 801072a5: 74 23 je 801072ca <freevm+0x5a> if(pgdir[i] & PTE_P){ 801072a7: 8b 03 mov (%ebx),%eax 801072a9: a8 01 test $0x1,%al 801072ab: 74 f3 je 801072a0 <freevm+0x30> char * v = P2V(PTE_ADDR(pgdir[i])); kfree(v); 801072ad: 25 00 f0 ff ff and $0xfffff000,%eax 801072b2: 83 ec 0c sub $0xc,%esp 801072b5: 83 c3 04 add $0x4,%ebx 801072b8: 05 00 00 00 80 add $0x80000000,%eax 801072bd: 50 push %eax 801072be: e8 1d b0 ff ff call 801022e0 <kfree> 801072c3: 83 c4 10 add $0x10,%esp uint i; if(pgdir == 0) panic("freevm: no pgdir"); deallocuvm(pgdir, KERNBASE, 0); for(i = 0; i < NPDENTRIES; i++){ 801072c6: 39 fb cmp %edi,%ebx 801072c8: 75 dd jne 801072a7 <freevm+0x37> if(pgdir[i] & PTE_P){ char * v = P2V(PTE_ADDR(pgdir[i])); kfree(v); } } kfree((char*)pgdir); 801072ca: 89 75 08 mov %esi,0x8(%ebp) } 801072cd: 8d 65 f4 lea -0xc(%ebp),%esp 801072d0: 5b pop %ebx 801072d1: 5e pop %esi 801072d2: 5f pop %edi 801072d3: 5d pop %ebp if(pgdir[i] & PTE_P){ char * v = P2V(PTE_ADDR(pgdir[i])); kfree(v); } } kfree((char*)pgdir); 801072d4: e9 07 b0 ff ff jmp 801022e0 <kfree> freevm(pde_t *pgdir) { uint i; if(pgdir == 0) panic("freevm: no pgdir"); 801072d9: 83 ec 0c sub $0xc,%esp 801072dc: 68 0d 80 10 80 push $0x8010800d 801072e1: e8 8a 90 ff ff call 80100370 <panic> 801072e6: 8d 76 00 lea 0x0(%esi),%esi 801072e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801072f0 <setupkvm>: }; // Set up kernel part of a page table. pde_t* setupkvm(void) { 801072f0: 55 push %ebp 801072f1: 89 e5 mov %esp,%ebp 801072f3: 56 push %esi 801072f4: 53 push %ebx pde_t *pgdir; struct kmap *k; if((pgdir = (pde_t*)kalloc()) == 0) 801072f5: e8 96 b1 ff ff call 80102490 <kalloc> 801072fa: 85 c0 test %eax,%eax 801072fc: 74 6a je 80107368 <setupkvm+0x78> return 0; memset(pgdir, 0, PGSIZE); 801072fe: 83 ec 04 sub $0x4,%esp 80107301: 89 c6 mov %eax,%esi if (P2V(PHYSTOP) > (void*)DEVSPACE) panic("PHYSTOP too high"); for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80107303: bb 20 b4 10 80 mov $0x8010b420,%ebx pde_t *pgdir; struct kmap *k; if((pgdir = (pde_t*)kalloc()) == 0) return 0; memset(pgdir, 0, PGSIZE); 80107308: 68 00 10 00 00 push $0x1000 8010730d: 6a 00 push $0x0 8010730f: 50 push %eax 80107310: e8 9b d6 ff ff call 801049b0 <memset> 80107315: 83 c4 10 add $0x10,%esp if (P2V(PHYSTOP) > (void*)DEVSPACE) panic("PHYSTOP too high"); for(k = kmap; k < &kmap[NELEM(kmap)]; k++) if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, 80107318: 8b 43 04 mov 0x4(%ebx),%eax 8010731b: 8b 4b 08 mov 0x8(%ebx),%ecx 8010731e: 83 ec 08 sub $0x8,%esp 80107321: 8b 13 mov (%ebx),%edx 80107323: ff 73 0c pushl 0xc(%ebx) 80107326: 50 push %eax 80107327: 29 c1 sub %eax,%ecx 80107329: 89 f0 mov %esi,%eax 8010732b: e8 70 f9 ff ff call 80106ca0 <mappages> 80107330: 83 c4 10 add $0x10,%esp 80107333: 85 c0 test %eax,%eax 80107335: 78 19 js 80107350 <setupkvm+0x60> if((pgdir = (pde_t*)kalloc()) == 0) return 0; memset(pgdir, 0, PGSIZE); if (P2V(PHYSTOP) > (void*)DEVSPACE) panic("PHYSTOP too high"); for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80107337: 83 c3 10 add $0x10,%ebx 8010733a: 81 fb 60 b4 10 80 cmp $0x8010b460,%ebx 80107340: 75 d6 jne 80107318 <setupkvm+0x28> 80107342: 89 f0 mov %esi,%eax (uint)k->phys_start, k->perm) < 0) { freevm(pgdir); return 0; } return pgdir; } 80107344: 8d 65 f8 lea -0x8(%ebp),%esp 80107347: 5b pop %ebx 80107348: 5e pop %esi 80107349: 5d pop %ebp 8010734a: c3 ret 8010734b: 90 nop 8010734c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if (P2V(PHYSTOP) > (void*)DEVSPACE) panic("PHYSTOP too high"); for(k = kmap; k < &kmap[NELEM(kmap)]; k++) if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, (uint)k->phys_start, k->perm) < 0) { freevm(pgdir); 80107350: 83 ec 0c sub $0xc,%esp 80107353: 56 push %esi 80107354: e8 17 ff ff ff call 80107270 <freevm> return 0; 80107359: 83 c4 10 add $0x10,%esp } return pgdir; } 8010735c: 8d 65 f8 lea -0x8(%ebp),%esp panic("PHYSTOP too high"); for(k = kmap; k < &kmap[NELEM(kmap)]; k++) if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, (uint)k->phys_start, k->perm) < 0) { freevm(pgdir); return 0; 8010735f: 31 c0 xor %eax,%eax } return pgdir; } 80107361: 5b pop %ebx 80107362: 5e pop %esi 80107363: 5d pop %ebp 80107364: c3 ret 80107365: 8d 76 00 lea 0x0(%esi),%esi { pde_t *pgdir; struct kmap *k; if((pgdir = (pde_t*)kalloc()) == 0) return 0; 80107368: 31 c0 xor %eax,%eax 8010736a: eb d8 jmp 80107344 <setupkvm+0x54> 8010736c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80107370 <kvmalloc>: // Allocate one page table for the machine for the kernel address // space for scheduler processes. void kvmalloc(void) { 80107370: 55 push %ebp 80107371: 89 e5 mov %esp,%ebp 80107373: 83 ec 08 sub $0x8,%esp kpgdir = setupkvm(); 80107376: e8 75 ff ff ff call 801072f0 <setupkvm> 8010737b: a3 44 6f 11 80 mov %eax,0x80116f44 80107380: 05 00 00 00 80 add $0x80000000,%eax 80107385: 0f 22 d8 mov %eax,%cr3 switchkvm(); } 80107388: c9 leave 80107389: c3 ret 8010738a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107390 <clearpteu>: // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(pde_t *pgdir, char *uva) { 80107390: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80107391: 31 c9 xor %ecx,%ecx // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(pde_t *pgdir, char *uva) { 80107393: 89 e5 mov %esp,%ebp 80107395: 83 ec 08 sub $0x8,%esp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80107398: 8b 55 0c mov 0xc(%ebp),%edx 8010739b: 8b 45 08 mov 0x8(%ebp),%eax 8010739e: e8 7d f8 ff ff call 80106c20 <walkpgdir> if(pte == 0) 801073a3: 85 c0 test %eax,%eax 801073a5: 74 05 je 801073ac <clearpteu+0x1c> panic("clearpteu"); *pte &= ~PTE_U; 801073a7: 83 20 fb andl $0xfffffffb,(%eax) } 801073aa: c9 leave 801073ab: c3 ret { pte_t *pte; pte = walkpgdir(pgdir, uva, 0); if(pte == 0) panic("clearpteu"); 801073ac: 83 ec 0c sub $0xc,%esp 801073af: 68 1e 80 10 80 push $0x8010801e 801073b4: e8 b7 8f ff ff call 80100370 <panic> 801073b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801073c0 <copyuvm>: // Given a parent process's page table, create a copy // of it for a child. pde_t* copyuvm(pde_t *pgdir, uint sz) { 801073c0: 55 push %ebp 801073c1: 89 e5 mov %esp,%ebp 801073c3: 57 push %edi 801073c4: 56 push %esi 801073c5: 53 push %ebx 801073c6: 83 ec 1c sub $0x1c,%esp pde_t *d; pte_t *pte; uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) 801073c9: e8 22 ff ff ff call 801072f0 <setupkvm> 801073ce: 85 c0 test %eax,%eax 801073d0: 89 45 e0 mov %eax,-0x20(%ebp) 801073d3: 0f 84 b2 00 00 00 je 8010748b <copyuvm+0xcb> return 0; for(i = 0; i < sz; i += PGSIZE){ 801073d9: 8b 4d 0c mov 0xc(%ebp),%ecx 801073dc: 85 c9 test %ecx,%ecx 801073de: 0f 84 9c 00 00 00 je 80107480 <copyuvm+0xc0> 801073e4: 31 f6 xor %esi,%esi 801073e6: eb 4a jmp 80107432 <copyuvm+0x72> 801073e8: 90 nop 801073e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 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); 801073f0: 83 ec 04 sub $0x4,%esp 801073f3: 81 c7 00 00 00 80 add $0x80000000,%edi 801073f9: 68 00 10 00 00 push $0x1000 801073fe: 57 push %edi 801073ff: 50 push %eax 80107400: e8 5b d6 ff ff call 80104a60 <memmove> if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) 80107405: 58 pop %eax 80107406: 5a pop %edx 80107407: 8d 93 00 00 00 80 lea -0x80000000(%ebx),%edx 8010740d: 8b 45 e0 mov -0x20(%ebp),%eax 80107410: ff 75 e4 pushl -0x1c(%ebp) 80107413: b9 00 10 00 00 mov $0x1000,%ecx 80107418: 52 push %edx 80107419: 89 f2 mov %esi,%edx 8010741b: e8 80 f8 ff ff call 80106ca0 <mappages> 80107420: 83 c4 10 add $0x10,%esp 80107423: 85 c0 test %eax,%eax 80107425: 78 3e js 80107465 <copyuvm+0xa5> uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) return 0; for(i = 0; i < sz; i += PGSIZE){ 80107427: 81 c6 00 10 00 00 add $0x1000,%esi 8010742d: 39 75 0c cmp %esi,0xc(%ebp) 80107430: 76 4e jbe 80107480 <copyuvm+0xc0> if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) 80107432: 8b 45 08 mov 0x8(%ebp),%eax 80107435: 31 c9 xor %ecx,%ecx 80107437: 89 f2 mov %esi,%edx 80107439: e8 e2 f7 ff ff call 80106c20 <walkpgdir> 8010743e: 85 c0 test %eax,%eax 80107440: 74 5a je 8010749c <copyuvm+0xdc> panic("copyuvm: pte should exist"); if(!(*pte & PTE_P)) 80107442: 8b 18 mov (%eax),%ebx 80107444: f6 c3 01 test $0x1,%bl 80107447: 74 46 je 8010748f <copyuvm+0xcf> panic("copyuvm: page not present"); pa = PTE_ADDR(*pte); 80107449: 89 df mov %ebx,%edi flags = PTE_FLAGS(*pte); 8010744b: 81 e3 ff 0f 00 00 and $0xfff,%ebx 80107451: 89 5d e4 mov %ebx,-0x1c(%ebp) for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) panic("copyuvm: pte should exist"); if(!(*pte & PTE_P)) panic("copyuvm: page not present"); pa = PTE_ADDR(*pte); 80107454: 81 e7 00 f0 ff ff and $0xfffff000,%edi flags = PTE_FLAGS(*pte); if((mem = kalloc()) == 0) 8010745a: e8 31 b0 ff ff call 80102490 <kalloc> 8010745f: 85 c0 test %eax,%eax 80107461: 89 c3 mov %eax,%ebx 80107463: 75 8b jne 801073f0 <copyuvm+0x30> goto bad; } return d; bad: freevm(d); 80107465: 83 ec 0c sub $0xc,%esp 80107468: ff 75 e0 pushl -0x20(%ebp) 8010746b: e8 00 fe ff ff call 80107270 <freevm> return 0; 80107470: 83 c4 10 add $0x10,%esp 80107473: 31 c0 xor %eax,%eax } 80107475: 8d 65 f4 lea -0xc(%ebp),%esp 80107478: 5b pop %ebx 80107479: 5e pop %esi 8010747a: 5f pop %edi 8010747b: 5d pop %ebp 8010747c: c3 ret 8010747d: 8d 76 00 lea 0x0(%esi),%esi uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) return 0; for(i = 0; i < sz; i += PGSIZE){ 80107480: 8b 45 e0 mov -0x20(%ebp),%eax return d; bad: freevm(d); return 0; } 80107483: 8d 65 f4 lea -0xc(%ebp),%esp 80107486: 5b pop %ebx 80107487: 5e pop %esi 80107488: 5f pop %edi 80107489: 5d pop %ebp 8010748a: c3 ret pte_t *pte; uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) return 0; 8010748b: 31 c0 xor %eax,%eax 8010748d: eb e6 jmp 80107475 <copyuvm+0xb5> for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) panic("copyuvm: pte should exist"); if(!(*pte & PTE_P)) panic("copyuvm: page not present"); 8010748f: 83 ec 0c sub $0xc,%esp 80107492: 68 42 80 10 80 push $0x80108042 80107497: e8 d4 8e ff ff call 80100370 <panic> if((d = setupkvm()) == 0) return 0; for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) panic("copyuvm: pte should exist"); 8010749c: 83 ec 0c sub $0xc,%esp 8010749f: 68 28 80 10 80 push $0x80108028 801074a4: e8 c7 8e ff ff call 80100370 <panic> 801074a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801074b0 <uva2ka>: //PAGEBREAK! // Map user virtual address to kernel address. char* uva2ka(pde_t *pgdir, char *uva) { 801074b0: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 801074b1: 31 c9 xor %ecx,%ecx //PAGEBREAK! // Map user virtual address to kernel address. char* uva2ka(pde_t *pgdir, char *uva) { 801074b3: 89 e5 mov %esp,%ebp 801074b5: 83 ec 08 sub $0x8,%esp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 801074b8: 8b 55 0c mov 0xc(%ebp),%edx 801074bb: 8b 45 08 mov 0x8(%ebp),%eax 801074be: e8 5d f7 ff ff call 80106c20 <walkpgdir> if((*pte & PTE_P) == 0) 801074c3: 8b 00 mov (%eax),%eax return 0; if((*pte & PTE_U) == 0) 801074c5: 89 c2 mov %eax,%edx 801074c7: 83 e2 05 and $0x5,%edx 801074ca: 83 fa 05 cmp $0x5,%edx 801074cd: 75 11 jne 801074e0 <uva2ka+0x30> return 0; return (char*)P2V(PTE_ADDR(*pte)); 801074cf: 25 00 f0 ff ff and $0xfffff000,%eax } 801074d4: c9 leave pte = walkpgdir(pgdir, uva, 0); if((*pte & PTE_P) == 0) return 0; if((*pte & PTE_U) == 0) return 0; return (char*)P2V(PTE_ADDR(*pte)); 801074d5: 05 00 00 00 80 add $0x80000000,%eax } 801074da: c3 ret 801074db: 90 nop 801074dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi pte = walkpgdir(pgdir, uva, 0); if((*pte & PTE_P) == 0) return 0; if((*pte & PTE_U) == 0) return 0; 801074e0: 31 c0 xor %eax,%eax return (char*)P2V(PTE_ADDR(*pte)); } 801074e2: c9 leave 801074e3: c3 ret 801074e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801074ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801074f0 <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) { 801074f0: 55 push %ebp 801074f1: 89 e5 mov %esp,%ebp 801074f3: 57 push %edi 801074f4: 56 push %esi 801074f5: 53 push %ebx 801074f6: 83 ec 1c sub $0x1c,%esp 801074f9: 8b 5d 14 mov 0x14(%ebp),%ebx 801074fc: 8b 55 0c mov 0xc(%ebp),%edx 801074ff: 8b 7d 10 mov 0x10(%ebp),%edi char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80107502: 85 db test %ebx,%ebx 80107504: 75 40 jne 80107546 <copyout+0x56> 80107506: eb 70 jmp 80107578 <copyout+0x88> 80107508: 90 nop 80107509: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi va0 = (uint)PGROUNDDOWN(va); pa0 = uva2ka(pgdir, (char*)va0); if(pa0 == 0) return -1; n = PGSIZE - (va - va0); 80107510: 8b 55 e4 mov -0x1c(%ebp),%edx 80107513: 89 f1 mov %esi,%ecx 80107515: 29 d1 sub %edx,%ecx 80107517: 81 c1 00 10 00 00 add $0x1000,%ecx 8010751d: 39 d9 cmp %ebx,%ecx 8010751f: 0f 47 cb cmova %ebx,%ecx if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); 80107522: 29 f2 sub %esi,%edx 80107524: 83 ec 04 sub $0x4,%esp 80107527: 01 d0 add %edx,%eax 80107529: 51 push %ecx 8010752a: 57 push %edi 8010752b: 50 push %eax 8010752c: 89 4d e4 mov %ecx,-0x1c(%ebp) 8010752f: e8 2c d5 ff ff call 80104a60 <memmove> len -= n; buf += n; 80107534: 8b 4d e4 mov -0x1c(%ebp),%ecx { char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80107537: 83 c4 10 add $0x10,%esp if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); len -= n; buf += n; va = va0 + PGSIZE; 8010753a: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx n = PGSIZE - (va - va0); if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); len -= n; buf += n; 80107540: 01 cf add %ecx,%edi { char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80107542: 29 cb sub %ecx,%ebx 80107544: 74 32 je 80107578 <copyout+0x88> va0 = (uint)PGROUNDDOWN(va); 80107546: 89 d6 mov %edx,%esi pa0 = uva2ka(pgdir, (char*)va0); 80107548: 83 ec 08 sub $0x8,%esp char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ va0 = (uint)PGROUNDDOWN(va); 8010754b: 89 55 e4 mov %edx,-0x1c(%ebp) 8010754e: 81 e6 00 f0 ff ff and $0xfffff000,%esi pa0 = uva2ka(pgdir, (char*)va0); 80107554: 56 push %esi 80107555: ff 75 08 pushl 0x8(%ebp) 80107558: e8 53 ff ff ff call 801074b0 <uva2ka> if(pa0 == 0) 8010755d: 83 c4 10 add $0x10,%esp 80107560: 85 c0 test %eax,%eax 80107562: 75 ac jne 80107510 <copyout+0x20> len -= n; buf += n; va = va0 + PGSIZE; } return 0; } 80107564: 8d 65 f4 lea -0xc(%ebp),%esp buf = (char*)p; while(len > 0){ va0 = (uint)PGROUNDDOWN(va); pa0 = uva2ka(pgdir, (char*)va0); if(pa0 == 0) return -1; 80107567: b8 ff ff ff ff mov $0xffffffff,%eax len -= n; buf += n; va = va0 + PGSIZE; } return 0; } 8010756c: 5b pop %ebx 8010756d: 5e pop %esi 8010756e: 5f pop %edi 8010756f: 5d pop %ebp 80107570: c3 ret 80107571: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107578: 8d 65 f4 lea -0xc(%ebp),%esp memmove(pa0 + (va - va0), buf, n); len -= n; buf += n; va = va0 + PGSIZE; } return 0; 8010757b: 31 c0 xor %eax,%eax } 8010757d: 5b pop %ebx 8010757e: 5e pop %esi 8010757f: 5f pop %edi 80107580: 5d pop %ebp 80107581: c3 ret
33.1995
90
0.5349
4747fc20b4a229e10ac227cea8fa4ddcb0a3c6af
821
asm
Assembly
Bank_I/2_identity.asm
ndf-zz/fv1testing
1ea474b6d93e888f091de15bcaed0d5a57905f22
[ "CC0-1.0" ]
null
null
null
Bank_I/2_identity.asm
ndf-zz/fv1testing
1ea474b6d93e888f091de15bcaed0d5a57905f22
[ "CC0-1.0" ]
null
null
null
Bank_I/2_identity.asm
ndf-zz/fv1testing
1ea474b6d93e888f091de15bcaed0d5a57905f22
[ "CC0-1.0" ]
1
2019-11-26T12:02:28.000Z
2019-11-26T12:02:28.000Z
; FV-1 Testing ; ; Program: Cancellation ; ; Run a sin LFO and test exp/log cancellation: ; ; x = 2**log(x) ; ; POT0: Offset ; POT1: Level ; ; Prepare LFOs skp RUN,main wlds SIN0,100,32767 main: rdax POT0,-1.0 ; load POT0 inverted sof -2.0,-1.0 ; flip and invert wrax REG0,0.0 ; save DC offset and clear acc cho rdal,SIN0 ; read from sin LFO mulx POT1 ; scale test signal level rdax REG0,1.0 ; add the offset amount wrax REG0,1.0 ; save value for sign test wrax DACL,1.0 ; output x to left channel log 1.0,0.0 ; take log(x) exp 1.0,0.0 ; compute 2**(log(x)) wrax REG1,0.0 ; save result ldax REG0 ; load the original value skp NEG,negate ldax REG1 ; fetch positive result skp 0,output negate: ldax REG1 ; fetch positive result sof -1.0,0.0 ; invert output: wrax DACR,0.0 ; output to right channel
23.457143
47
0.685749
69aab3721021119c91789df6bcd59a281b6996f6
360
asm
Assembly
Engine Hacks/MSS/asm/New_Unit_Exp.asm
sme23/MekkahRestrictedHackComp1
1cc9d2fec557424f358b6bfa21f9f3bb6faf2978
[ "CC0-1.0" ]
3
2020-06-15T14:22:38.000Z
2020-06-28T19:44:52.000Z
Wizardry/Necessary/ModularStatScreen/asm/New_Unit_Exp.asm
sme23/WhatHeck
746a2be83358aaa4e855182176b47c4808f2587a
[ "CC0-1.0" ]
null
null
null
Wizardry/Necessary/ModularStatScreen/asm/New_Unit_Exp.asm
sme23/WhatHeck
746a2be83358aaa4e855182176b47c4808f2587a
[ "CC0-1.0" ]
null
null
null
.thumb .org 0x0 @bl'd to from 17E98 @r4=char data push {r14} mov r3,#0xFF ldrb r0,[r4,#0xB] mov r1,#0xC0 tst r0,r1 bne GoBack ldr r0,[r4,#0x4] ldrb r0,[r0,#0x4] @class number ldr r1,Class_Level_Cap_Table ldrb r1,[r1,r0] ldrb r0,[r4,#0x8] @level cmp r0,r1 bge GoBack mov r3,#0x0 GoBack: mov r0,r3 pop {r1} bx r1 .align Class_Level_Cap_Table: @
12.413793
32
0.675
3b1923db58e232601b35115a7f11845abfa4e79a
486
asm
Assembly
oeis/271/A271919.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/271/A271919.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/271/A271919.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A271919: Numerator of Product_{j=1..n-1} ((3*j+1)/(3*j+2)). ; Submitted by Christian Krause ; 1,4,7,7,13,104,494,988,190,5320,20615,589,1147,11470,246605,246605,2416729,62834954,4488211,4488211,8831641,10869712,182067676,2548947464,2514502228,27300309904,134795280151,269590560302,3134773957,25078191656,570528860174,60055669492,59442856538 mov $1,1 lpb $0 mov $2,$0 sub $0,1 mul $2,3 add $2,2 mul $3,$2 sub $2,1 add $3,$1 mul $1,$2 lpe gcd $3,$1 div $1,$3 mov $0,$1
25.578947
248
0.705761
1a8cd1129531f3b9b190d1d6ed6353f0259193de
7,374
asm
Assembly
45/qb/ir/exaryutl.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
45/qb/ir/exaryutl.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
45/qb/ir/exaryutl.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
page 49,132 TITLE exaryutl - Array Utilities ;*** ;exaryutl.asm - interpreter specific array support. ; ; Copyright <C> 1986, Microsoft Corporation ; ;Purpose: ; ; This module includes support routines for array related executors: ; - ResolveArray - a procedure that resolves indices and an array ; descriptor to a memory address. ; ; ; ;**************************************************************************** .xlist include version.inc EXARYUTL_ASM = ON IncludeOnce architec IncludeOnce array IncludeOnce context IncludeOnce exint IncludeOnce qbimsgs IncludeOnce rtinterp IncludeOnce variable .list assumes cs, CODE assumes es, NOTHING assumes ss, DATA assumes ds,DATA sBegin CODE page ;*** ;oVarToPAd - Find/Make array descriptor for a variable table entry ; ;Purpose: ; ; This routine returns address of the array descriptor. ; The space for the array descriptor will always be allocated. ; ;Input: ; ; bx = oVar of array ; ;Output: ; ; ax = SB of array descriptor if SizeD ; ds:bx = address of array descriptor. ; cDims and fFeatures (FADF_STATIC only) fields set from variable table ; ;Preserves: ; ; cx,dx ; ;*************************************************************************** public oVarToPAd oVarToPAd: push cx DbChk OVar,bx ;Verify that this is a variable mov cl,byte ptr [pVarBx-VAR_value].VAR_fStat; Get FV_STATIC flag mov ch,[pVarBx].ASTAT_cDims mov ax,[pVarBx-VAR_value].VAR_Flags ;Get flags TestX ax,FVVALUESTORED ;Static? jnz StaticDescr TestX ax,FVFORMAL ;Parameter? jnz ParamDescr TestX ax,FVCOMMON ;Common? jnz CommonDescr ;Array descriptor is local variable mov bx,[pVarBx].AFRAME_oFrame; oBP of array descriptor add bx,bp ;Point at array descriptor in stack jmp short SetupAD StaticDescr: lea bx,[pVarBx].ASTAT_ad ; Get address of array descriptor SetupAD: ;ch = dim count or ch,ch ; cDims unknown? jz SetStatic mov [bx].AD_cDims,ch ;Set the count of dimensions in AD SetStatic: test cl,FV_STATIC ;Is this a $STATIC array? jz ArrayDescr ;Not $STATIC or [bx].AD_fFeatures,FADF_STATIC ;Indicate $STATIC array ArrayDescr: pop cx ret ParamDescr: ;Array descriptor already set up - just point to it mov bx,[pVarBx].AFORMAL_oFrame ;oBP of pAd add bx,bp ;BX = Pointer to pAd mov bx,[pFrame] ;ds:bx = pAD ;Added with [10] cmp [bx].AD_cDims,ch ;cDims correct? jz ArrayDescr or ch,ch ;Unknown cDims? jz ArrayDescr jmp RangeErr ; cDims mismatch ;End of [10] CommonDescr: mov ax,[pVarBx].ACOM_oValue ;Offset into common block mov bx,[pVarBx].ACOM_oCommon;oCommon test cl,FV_STATIC ;Is the array $STATIC? jz GetComDesc ; brif not ;$STATIC array descr. is in COMMON type table add bx,COM_bdType - COM_bdValue ;Adjust to point to type table GetComDesc: add bx,[grs.GRS_bdtComBlk.BD_pb] ;pCommon mov bx,[bx].COM_bdValue.BD_pb ;Common block add bx,ax ;Offset in block jmp SetupAD subttl ResolveArray page ;*** ;ResolveArray - Resolve array reference to address ; ;Purpose: ; ; Resolve an array reference to an element address. ; ; NOTE: ; ; This algorithm requires that: ; 1. No more than 255 indices are allowed. ; 2. The number of indices is correct. This has been verified by SsScan. ; ;Input: ; ; ds:bx = address of array descriptor ; cx = index count ; stack contains cx ET_I2 index arguments ; ;Output: ; ; dx:bx = element address ; ax = address of array descriptor ; ds = base of module variable table if SizeD ; index parameters cleaned from stack ; ;Preserves: ; ; none ; ;Exceptions: ; ; $ERR_BS - error for bad subscript ; ;************************************************************************* public ResolveArray ResolveArray: cmp [bx].AD_fhd.FHD_hData,0 ;this field is 0 when array not DIMed jz UnDimmedErr ;Brif not allocated. Error. dec cx ;Special case single dimension array jnz ResolveMulDims ;Go resolve multiple dimension case pop cx ;Return address pop ax ;Get index push cx ;Return address back sub ax,[bx].AD_tDM.DM_iLbound ;Subtract lower bound jl RangeErr cmp ax,[bx].AD_tDM.DM_cElements ;Test for range jge RangeErr xor dx,dx ;Index in dx:ax mov cx,[bx].AD_cbElement ;Size of each element ;Need to multiply index in dx:ax by size of element in cx cmp cx,2 ;I2? jz TwoByte cmp cx,4 ;I4,R4,SD? jnz OddSize ;Handle 4-byte element shl ax,1 TwoByte: shl ax,1 rcl dx,1 HugeArray: ;dx:ax has 32-bit offset ;bx = pAD add ax,[bx].AD_fhd.FHD_oData;Add base offset adc dx,0 ;Ripple carry jz GetArraySeg ;Multiply dx by 64K/16 = 1000H to get relative segment ror dx,1 ror dx,1 ror dx,1 ror dx,1 GetArraySeg: add dx,[bx].AD_fhd.FHD_hData;Load segment from AD xchg bx,ax ;Offset to bx, pAD to ax ret OddSize: mul cx jmp HugeArray MulRangeErr: pop cx pop di pop si ;Restore location of error UnDimmedErr: RangeErr: mov al,ER_SOR ;Subscript out of range call RtErrorCODE ;generate error, don't return page ;ResolveMulDims ; ;Purpose: ; ; Handle the multiple dimension, R8 or user defined record type varients ; of array access. These varients can not be optimized in the same way as ; single dimension I2/I4/SD array resolution. ; ;Input: ; ; bx = address of AD ; cx = cDims minus one ResolveMulDims: push si mov si,sp add si,4 ;Point to first index push di lea di,[bx].AD_tDM ;Point to first dimension in descriptor push cx xor cx,cx ;Initialize byte offset value mov dx,cx jmp short IndexLoopEntry ;Start element offset comp with add ;Within this loop: ;ax = count of remaining indices ;dx:cx = current offset value (dx is high word). EB uses CX only! ;bx = pAD ;si points to next index ;di points into array descriptor IndexLoop: push ax add di,SIZE DM ;Move to next descriptor field ;[di] * dx:cx multiplication (current offset by dimension in array descriptor) mov ax,dx mul [di].DM_cElements xchg cx,ax ;High word has to be zero (DIM worked) mul [di].DM_cElements add dx,cx ;Can't be carry (DIM worked) mov cx,ax IndexLoopEntry: lods word ptr DGROUP:[si] ; get index argument sub ax,[di].DM_iLbound ;Account for TO or OPTION BASE jl MulRangeErr ;Index error cmp ax,[di].DM_cElements ;test for index out of bounds jge MulRangeErr ;error - index too high add cx,ax ;add index to offset value adc dx,0 ; with carry into high word ; Can't be overflow - DIM worked pop ax dec ax ;Decrement argument count jns IndexLoop ;Loop to process next argument ;DX:AX = DX:CX * cbElement. For EB: AX = CX * cbElement. mov ax,dx ;Prepare for mult mul [bx].AD_cbElement ;cbElement * high word xchg cx,ax ;Save low word (high word is zero, since ; there was no error during DIM) mul [bx].AD_cbElement ;cbElement * low word add dx,cx ;Add in result of cbType * high word dec si dec si ;New top of stack pop di pop cx ;Old si pop DGROUP:[si] ; Move return address to stack top mov sp,si ;Clean off arguments mov si,cx jmp HugeArray ;Exit through single dim code ; with: ; ax = data offset low word ; bx = AD address ; dx = data offset high word page sEnd CODE end
22.900621
79
0.67399
0351a99e15a0bf47540967aa3689b8da9196e1bc
43
asm
Assembly
libsrc/nc100/txtcuroff.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/nc100/txtcuroff.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/nc100/txtcuroff.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
PUBLIC textcurff .txtcuroff jp 0xb827
8.6
18
0.744186