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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b498247074359a19be968db95b93b952c581ae3e
| 7,183
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_st_/i7-7700_9_0xca.log_21829_252.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_st_/i7-7700_9_0xca.log_21829_252.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_st_/i7-7700_9_0xca.log_21829_252.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 %r12
push %r14
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x14470, %rbx
nop
nop
nop
xor $2161, %rdx
mov (%rbx), %r14d
nop
nop
nop
nop
nop
xor $16215, %r12
lea addresses_WT_ht+0xdc90, %r11
nop
nop
nop
nop
nop
cmp $10614, %r9
movl $0x61626364, (%r11)
nop
nop
nop
add $64418, %r14
lea addresses_A_ht+0x270, %r12
nop
nop
add $46169, %r14
mov $0x6162636465666768, %r8
movq %r8, %xmm5
movups %xmm5, (%r12)
nop
cmp %rbx, %rbx
lea addresses_normal_ht+0x19c0, %r14
nop
nop
nop
add %r12, %r12
mov (%r14), %ebx
nop
nop
nop
nop
cmp $29878, %rdx
lea addresses_WC_ht+0x16140, %r9
nop
nop
nop
sub %r8, %r8
mov (%r9), %dx
sub %r11, %r11
lea addresses_A_ht+0x10140, %rsi
lea addresses_WT_ht+0x15b40, %rdi
nop
nop
nop
xor $29933, %r9
mov $74, %rcx
rep movsl
nop
nop
nop
inc %rcx
lea addresses_WT_ht+0x1e140, %rsi
clflush (%rsi)
nop
nop
nop
nop
nop
xor $54591, %r9
mov (%rsi), %rbx
nop
nop
nop
nop
and %r8, %r8
lea addresses_WT_ht+0x6d90, %r11
nop
nop
cmp $53943, %r14
movw $0x6162, (%r11)
nop
nop
nop
xor %rbx, %rbx
lea addresses_A_ht+0x1d140, %r8
clflush (%r8)
nop
nop
xor %rbx, %rbx
movups (%r8), %xmm3
vpextrq $1, %xmm3, %rdi
nop
nop
nop
nop
inc %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %r8
push %rbx
push %rcx
// Store
lea addresses_WT+0xe140, %r8
nop
nop
nop
nop
sub $63588, %r12
mov $0x5152535455565758, %r11
movq %r11, %xmm7
vmovups %ymm7, (%r8)
nop
nop
nop
nop
nop
xor $44600, %r8
// Store
mov $0x24b0800000000400, %rcx
nop
nop
cmp %r10, %r10
movb $0x51, (%rcx)
nop
nop
nop
nop
add $47372, %r10
// Store
lea addresses_WC+0x1140, %r11
xor $48314, %r13
mov $0x5152535455565758, %r8
movq %r8, %xmm6
vmovups %ymm6, (%r11)
nop
and $49831, %rbx
// Store
lea addresses_UC+0x6e8a, %rbx
sub %rcx, %rcx
movw $0x5152, (%rbx)
nop
nop
nop
cmp %rbx, %rbx
// Faulty Load
lea addresses_UC+0x11140, %r8
nop
nop
nop
nop
nop
and %r13, %r13
movb (%r8), %bl
lea oracles, %r13
and $0xff, %rbx
shlq $12, %rbx
mov (%r13,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %r8
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_NC'}}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 3, 'AVXalign': True, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'AVXalign': False, 'same': True, 'size': 2, 'NT': True, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 31.924444
| 2,999
| 0.652652
|
8b70101e5bd3e0fa032330e91a185dd74c044779
| 399
|
asm
|
Assembly
|
programs/oeis/233/A233441.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/233/A233441.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/233/A233441.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A233441: Floor(2^n / n^3).
; 2,0,0,0,0,0,0,0,0,1,1,2,3,5,9,16,26,44,76,131,226,393,689,1213,2147,3818,6818,12228,22012,39768,72084,131072,239027,437102,801393,1472896,2713342,5009438,9267786,17179869,31906432,59362467,110632938,206519839,386111079
mov $2,$0
mov $3,2
mov $4,$0
add $4,1
pow $3,$4
add $4,2
lpb $3,2
mov $0,6
add $2,1
mov $4,2
lpe
lpb $0
sub $0,$4
div $3,$2
lpe
mov $1,$3
| 19.95
| 220
| 0.66416
|
66a07da1e588cb7e5b7df9fe6788a11cdabe87e8
| 23,006
|
asm
|
Assembly
|
data/text/common_2.asm
|
TastySnax12/pokecrystal16-493-plus
|
9de36c8803c9bdf4b8564ed547f988b0b66f0c41
|
[
"blessing"
] | 2
|
2021-07-31T07:05:06.000Z
|
2021-10-16T03:32:26.000Z
|
data/text/common_2.asm
|
TastySnax12/pokecrystal16-493-plus
|
9de36c8803c9bdf4b8564ed547f988b0b66f0c41
|
[
"blessing"
] | null | null | null |
data/text/common_2.asm
|
TastySnax12/pokecrystal16-493-plus
|
9de36c8803c9bdf4b8564ed547f988b0b66f0c41
|
[
"blessing"
] | 3
|
2021-01-15T18:45:40.000Z
|
2021-10-16T03:35:27.000Z
|
UnknownText_0x1c0000::
text "Oh, no picture?"
line "Come again, OK?"
done
UnknownText_0x1c0021::
text "An EGG? My talent"
line "is worth more…"
done
UnknownText_0x1c0043::
text "Hello, hello! I'm"
line "the NAME RATER."
para "I rate the names"
line "of #MON."
para "Would you like me"
line "to rate names?"
done
UnknownText_0x1c00a0::
text "Which #MON's"
line "nickname should I"
cont "rate for you?"
prompt
UnknownText_0x1c00cd::
text "Hm… @"
text_ram wStringBuffer1
text "…"
line "That's a fairly"
cont "decent name."
para "But, how about a"
line "slightly better"
cont "nickname?"
para "Want me to give it"
line "a better name?"
done
UnknownText_0x1c0142::
text "All right. What"
line "name should we"
cont "give it, then?"
prompt
UnknownText_0x1c0171::
text "That's a better"
line "name than before!"
para "Well done!"
done
UnknownText_0x1c019e::
text "OK, then. Come"
line "again sometime."
done
UnknownText_0x1c01be::
text "Hm… @"
text_ram wStringBuffer1
text "?"
line "What a great name!"
cont "It's perfect."
para "Treat @"
text_ram wStringBuffer1
text_start
line "with loving care."
done
UnknownText_0x1c0208::
text "Whoa… That's just"
line "an EGG."
done
UnknownText_0x1c0222::
text "It might look the"
line "same as before,"
para "but this new name"
line "is much better!"
para "Well done!"
done
UnknownText_0x1c0272::
text "All right. This"
line "#MON is now"
cont "named @"
text_ram wStringBuffer1
text "."
prompt
Text_Gained::
text_ram wStringBuffer1
text " gained@"
text_end
Text_ABoostedStringBuffer2ExpPoints::
text_start
line "a boosted"
cont "@"
text_decimal wStringBuffer2, 2, 4
text " EXP. Points!"
prompt
Text_StringBuffer2ExpPoints::
text_start
line "@"
text_decimal wStringBuffer2, 2, 4
text " EXP. Points!"
prompt
Text_GoMon::
text "Go! @"
text_end
Text_DoItMon::
text "Do it! @"
text_end
Text_GoForItMon::
text "Go for it,"
line "@"
text_end
Text_YourFoesWeakGetmMon::
text "Your foe's weak!"
line "Get'm, @"
text_end
Text_BattleMonNick01::
text_ram wBattleMonNick
text "!"
done
Text_BattleMonNickComma::
text_ram wBattleMonNick
text ",@"
text_end
Text_ThatsEnoughComeBack::
text " that's"
line "enough! Come back!@"
text_end
Text_OKComeBack::
text " OK!"
line "Come back!@"
text_end
Text_GoodComeBack::
text " good!"
line "Come back!@"
text_end
Text_ComeBack::
text " come"
line "back!"
done
UnknownText_0x1c0373::
text "Booted up a TM."
prompt
UnknownText_0x1c0384::
text "Booted up an HM."
prompt
UnknownText_0x1c0396::
text "It contained"
line "@"
text_ram wStringBuffer2
text "."
para "Teach @"
text_ram wStringBuffer2
text_start
line "to a #MON?"
done
UnknownText_0x1c03c2::
text_ram wStringBuffer2
text " is"
line "not compatible"
cont "with @"
text_ram wStringBuffer1
text "."
para "It can't learn"
line "@"
text_ram wStringBuffer2
text "."
prompt
UnknownText_0x1c03fa::
text "You have no room"
line "for any more"
cont "@"
text_ram wStringBuffer1
text "S."
prompt
UnknownText_0x1c0421::
text "You received"
line "@"
text_ram wStringBuffer1
text "!"
prompt
UnknownText_0x1c0436::
text "The link has been"
line "cancelled."
prompt
UnknownText_0x1c0454::
text "Communication"
line "error."
prompt
UnknownText_0x1c046a::
text "Must retrieve GIFT"
line "at #MON CENTER."
prompt
UnknownText_0x1c048e::
text "Your friend isn't"
line "ready."
prompt
UnknownText_0x1c04a7::
text "Sorry--only five"
line "GIFTS a day."
prompt
UnknownText_0x1c04c6::
text "Sorry. One GIFT"
line "a day per person."
prompt
UnknownText_0x1c04e9::
text_ram wMysteryGiftPartnerName
text " sent"
line "@"
text_ram wStringBuffer1
text "."
prompt
UnknownText_0x1c04fa::
text_ram wMysteryGiftPartnerName
text " sent"
line "@"
text_ram wStringBuffer1
text_start
cont "to @"
text_ram wMysteryGiftPlayerName
text "'s home."
prompt
UnknownText_0x1c051a::
text "Received"
line "@"
text_ram wc850
text "'s CARD."
prompt
UnknownText_0x1c0531::
text_ram wc850
text "'s CARD was"
line "listed as no.@"
text_decimal wDeciramBuffer, 1, 2
text "."
prompt
UnknownText_0x1c0555::
text "The CARD was not"
line "registered."
prompt
UnknownText_0x1c0573::
text "The link has been"
line "cancelled."
prompt
UnknownText_0x1c0591::
text "Communication"
line "error."
prompt
_BadgeRequiredText::
text "Sorry! A new BADGE"
line "is required."
prompt
UnknownText_0x1c05c8::
text "Can't use that"
line "here."
prompt
UnknownText_0x1c05dd::
text_ram wStringBuffer2
text " used"
line "CUT!"
prompt
UnknownText_0x1c05ec::
text "There's nothing to"
line "CUT here."
prompt
UnknownText_0x1c0609::
text "A blinding FLASH"
line "lights the area!@"
text_waitbutton
text_end
text_end ; unused
_UsedSurfText::
text_ram wStringBuffer2
text " used"
line "SURF!"
done
_CantSurfText::
text "You can't SURF"
line "here."
prompt
_AlreadySurfingText::
text "You're already"
line "SURFING."
prompt
_AskSurfText::
text "The water is calm."
line "Want to SURF?"
done
UnknownText_0x1c068e::
text_ram wStringBuffer2
text " used"
line "WATERFALL!"
done
UnknownText_0x1c06a3::
text "Wow, it's a huge"
line "waterfall."
done
UnknownText_0x1c06bf::
text "Do you want to use"
line "WATERFALL?"
done
UnknownText_0x1c06de::
text_ram wStringBuffer2
text " used"
line "DIG!"
done
UnknownText_0x1c06ed::
text "<PLAYER> used an"
line "ESCAPE ROPE."
done
UnknownText_0x1c0705::
text "Can't use that"
line "here."
done
UnknownText_0x1c071a::
text "Return to the last"
line "#MON CENTER."
done
UnknownText_0x1c073b::
text "Can't use that"
line "here."
para ""
done
UnknownText_0x1c0751::
text "A #MON is using"
line "STRENGTH already."
prompt
UnknownText_0x1c0774::
text_ram wStringBuffer2
text " used"
line "STRENGTH!"
done
UnknownText_0x1c0788::
text_ram wStringBuffer1
text " can"
line "move boulders."
prompt
UnknownText_0x1c07a0::
text "A #MON may be"
line "able to move this."
para "Want to use"
line "STRENGTH?"
done
UnknownText_0x1c07d8::
text "Boulders may now"
line "be moved!"
done
UnknownText_0x1c07f4::
text "A #MON may be"
line "able to move this."
done
UnknownText_0x1c0816::
text_ram wStringBuffer2
text " used"
line "WHIRLPOOL!"
prompt
UnknownText_0x1c082b::
text "It's a vicious"
line "whirlpool!"
para "A #MON may be"
line "able to pass it."
done
UnknownText_0x1c0864::
text "A whirlpool is in"
line "the way."
para "Want to use"
line "WHIRLPOOL?"
done
UnknownText_0x1c0897::
text_ram wStringBuffer2
text " did a"
line "HEADBUTT!"
prompt
UnknownText_0x1c08ac::
text "Nope. Nothing…"
done
UnknownText_0x1c08bc::
text "A #MON could be"
line "in this tree."
para "Want to HEADBUTT"
line "it?"
done
UnknownText_0x1c08f0::
text_ram wStringBuffer2
text " used"
line "ROCK SMASH!"
prompt
UnknownText_0x1c0906::
text "Maybe a #MON"
line "can break this."
done
UnknownText_0x1c0924::
text "This rock looks"
line "breakable."
para "Want to use ROCK"
line "SMASH?"
done
UnknownText_0x1c0958::
text "Oh!"
line "A bite!"
prompt
UnknownText_0x1c0965::
text "Not even a nibble!"
prompt
UnknownText_0x1c0979::
text "Looks like there's"
line "nothing here."
prompt
UnknownText_0x1c099a::
text "You can't get off"
line "here!"
done
UnknownText_0x1c09b2::
text "<PLAYER> got on the"
line "@"
text_ram wStringBuffer2
text "."
done
UnknownText_0x1c09c7::
text "<PLAYER> got off"
line "the @"
text_ram wStringBuffer2
text "."
done
UnknownText_0x1c09dd::
text "This tree can be"
line "CUT!"
para "Want to use CUT?"
done
UnknownText_0x1c0a05::
text "This tree can be"
line "CUT!"
done
TextFoundTMHM::
text "<PLAYER> found"
line "@"
text_ram wStringBuffer4
text " @"
text_ram wStringBuffer1
text "!"
done
UnknownText_0x1c0a1c::
text "<PLAYER> found"
line "@"
text_ram wStringBuffer3
text "!"
done
UnknownText_0x1c0a2c::
text "But <PLAYER> can't"
line "carry any more"
cont "items."
done
UnknownText_0x1c0a4e::
text "<PLAYER> is out of"
line "useable #MON!"
para "<PLAYER> whited"
line "out!"
done
UnknownText_0x1c0a77::
text "Yes! ITEMFINDER"
line "indicates there's"
cont "an item nearby."
prompt
UnknownText_0x1c0aa9::
text "Nope! ITEMFINDER"
line "isn't responding."
prompt
UnknownText_0x1c0acc::
text_ram wStringBuffer3
text_start
line "fainted!"
prompt
UnknownText_0x1c0ada::
text "<PLAYER> is out of"
line "useable #MON!"
para "<PLAYER> whited"
line "out!"
prompt
UnknownText_0x1c0b03::
text_ram wStringBuffer3
text " used"
line "SWEET SCENT!"
done
UnknownText_0x1c0b1a::
text "Looks like there's"
line "nothing here…"
done
UnknownText_0x1c0b3b::
text "<PLAYER> sprinkled"
line "water."
para "But nothing"
line "happened…"
done
UnknownText_0x1c0b65::
text "<PLAYER>'s #MON"
line "were all healed!"
done
Text_AnEGGCantHoldAnItem::
text "An EGG can't hold"
line "an item."
prompt
UnknownText_0x1c0b9a::
text "No items."
done
UnknownText_0x1c0ba5::
text "Throw away how"
line "many?"
done
UnknownText_0x1c0bbb::
text "Throw away @"
text_decimal wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
text_ram wStringBuffer2
text "(S)?"
done
UnknownText_0x1c0bd8::
text "Threw away"
line "@"
text_ram wStringBuffer2
text "(S)."
prompt
UnknownText_0x1c0bee::
text "OAK: <PLAYER>!"
line "This isn't the"
cont "time to use that!"
prompt
Text_YouDontHaveAMon::
text "You don't have a"
line "#MON!"
prompt
UnknownText_0x1c0c2e::
text "Registered the"
line "@"
text_ram wStringBuffer2
text "."
prompt
UnknownText_0x1c0c45::
text "You can't register"
line "that item."
prompt
UnknownText_0x1c0c63::
text "Where should this"
line "be moved to?"
done
UnknownText_0x1c0c83::
text_start
done
Text_YouCantUseItInABattle::
text "You can't use it"
line "in a battle."
prompt
Text_AreYouABoyOrAreYouAGirl::
text "Are you a boy?"
line "Or are you a girl?"
done
UnknownText_0x1c0d0e::
text "<USER>@"
text_end
UnknownText_0x1c0d12::
text_start
line "made a whirlwind!"
prompt
UnknownText_0x1c0d26::
text_start
line "took in sunlight!"
prompt
UnknownText_0x1c0d3a::
text_start
line "lowered its head!"
prompt
UnknownText_0x1c0d4e::
text_start
line "is glowing!"
prompt
UnknownText_0x1c0d5c::
text_start
line "flew up high!"
prompt
UnknownText_0x1c0d6c::
text_start
line "dug a hole!"
prompt
_SprangUpText::
text_start
line "sprang up!"
prompt
_HidUnderwaterText::
text_start
line "hid underwater!"
prompt
_ShadowForceText::
text_start
line "vanished!"
prompt
_ActorNameText::
text "<USER>@"
text_end
_UsedMoveText::
text_start
line "used @"
text_end
_UsedInsteadText::
text "instead,"
cont "@"
text_end
_MoveNameText::
text_ram wStringBuffer2
text "!"
done
UnknownText_0x1c0db0::
text "Huh?"
para "@"
text_end
UnknownText_0x1c0db8::
text_start
done
UnknownText_0x1c0dba::
text_ram wStringBuffer1
text " came"
line "out of its EGG!@"
sound_caught_mon
text_waitbutton
text_end
text_end ; unused
UnknownText_0x1c0dd8::
text "Give a nickname to"
line "@"
text_ram wStringBuffer1
text "?"
done
UnknownText_0x1c0df3::
text "It's @"
text_ram wBreedMon2Nick
text_start
line "that was left with"
cont "the DAY-CARE LADY."
done
UnknownText_0x1c0e24::
text "It's @"
text_ram wBreedMon1Nick
text_start
line "that was left with"
cont "the DAY-CARE MAN."
done
UnknownText_0x1c0e54::
text "It's brimming with"
line "energy."
prompt
UnknownText_0x1c0e6f::
text "It has no interest"
line "in @"
text_ram wStringBuffer1
text "."
prompt
UnknownText_0x1c0e8d::
text "It appears to care"
line "for @"
text_ram wStringBuffer1
text "."
prompt
UnknownText_0x1c0eac::
text "It's friendly with"
line "@"
text_ram wStringBuffer1
text "."
prompt
UnknownText_0x1c0ec6::
text "It shows interest"
line "in @"
text_ram wStringBuffer1
text "."
prompt
_EmptyMailboxText::
text "There's no MAIL"
line "here."
prompt
ClearedMailPutAwayText::
text "The cleared MAIL"
line "was put away."
prompt
MailPackFullText::
text "The PACK is full."
prompt
MailMessageLostText::
text "The MAIL's message"
line "will be lost. OK?"
done
MailAlreadyHoldingItemText::
text "It's already hold-"
line "ing an item."
prompt
MailEggText::
text "An EGG can't hold"
line "any MAIL."
prompt
MailMovedFromBoxText::
text "The MAIL was moved"
line "from the MAILBOX."
prompt
UnknownText_0x1c0fb3::
text "Yes"
prompt
UnknownText_0x1c0fb8::
text "No"
prompt
UnknownText_0x1c0fbc::
text_decimal wcf64, 1, 3
text " @"
text_ram wStringBuffer1
text_start
line "Animation type @"
text_ram wStringBuffer2
text_end
text_end ; unused
UnknownText_0x1c0fdd::
text "#MON number?"
done
Text_WasSentToBillsPC::
text_ram wStringBuffer1
text " was"
line "sent to BILL's PC."
prompt
UnknownText_0x1c1006::
text "You gotta have"
line "#MON to call!"
prompt
UnknownText_0x1c1024::
text "What?"
done
UnknownText_0x1c102b::
text "There is a #MON"
line "holding MAIL."
para "Please remove the"
line "MAIL."
prompt
UnknownText_0x1c1062::
text "You don't have a"
line "single #MON!"
prompt
UnknownText_0x1c1080::
text "You can't deposit"
line "your last #MON!"
prompt
UnknownText_0x1c10a2::
text "You can't take any"
line "more #MON."
prompt
UnknownText_0x1c10c0::
text "Caught @"
text_ram wStringBuffer1
text "!"
prompt
UnknownText_0x1c10cf::
text "Switch #MON?"
done
UnknownText_0x1c10dd::
text "You already caught"
line "a @"
text_ram wStringBuffer1
text "."
prompt
ContestJudging_FirstPlaceText::
text "This Bug-Catching"
line "Contest winner is@"
text_pause
text "…"
para "@"
text_ram wBugContestWinnerName
text ","
line "who caught a"
cont "@"
text_ram wStringBuffer1
text "!@"
text_end
ContestJudging_FirstPlaceScoreText::
text_start
para "The winning score"
line "was @"
text_decimal wBugContestFirstPlaceScore, 2, 3
text " points!"
prompt
ContestJudging_SecondPlaceText::
text "Placing second was"
line "@"
text_ram wBugContestWinnerName
text ","
para "who caught a"
line "@"
text_ram wStringBuffer1
text "!@"
text_end
ContestJudging_SecondPlaceScoreText::
text_start
para "The score was"
line "@"
text_decimal wBugContestSecondPlaceScore, 2, 3
text " points!"
prompt
ContestJudging_ThirdPlaceText::
text "Placing third was"
line "@"
text_ram wBugContestWinnerName
text ","
para "who caught a"
line "@"
text_ram wStringBuffer1
text "!@"
text_end
ContestJudging_ThirdPlaceScoreText::
text_start
para "The score was"
line "@"
text_decimal wBugContestThirdPlaceScore, 2, 3
text " points!"
prompt
UnknownText_0x1c1203::
text "Let me measure"
line "that MAGIKARP."
para "…Hm, it measures"
line "@"
text_ram wStringBuffer1
text "."
prompt
UnknownText_0x1c123a::
text "CURRENT RECORD"
para "@"
text_ram wStringBuffer1
text " caught by"
line "@"
text_ram wMagikarpRecordHoldersName
text_waitbutton
text_end
text_end ; unused
UnknownText_0x1c1261::
text "Congratulations!"
para "We have a match"
line "with the ID number"
para "of @"
text_ram wStringBuffer1
text " in"
line "your party."
prompt
UnknownText_0x1c12ae::
text "Congratulations!"
para "We have a match"
line "with the ID number"
para "of @"
text_ram wStringBuffer1
text " in"
line "your PC BOX."
prompt
UnknownText_0x1c12fc::
text "Give a nickname to"
line "the @"
text_ram wStringBuffer1
text " you"
cont "received?"
done
UnknownText_0x1c1328::
text "Bzzzzt! You must"
line "have a #MON to"
cont "use this!"
prompt
UnknownText_0x1c1353::
text "<PLAYER> turned on"
line "the PC."
prompt
UnknownText_0x1c1368::
text "What do you want"
line "to do?"
done
_PlayersPCHowManyWithdrawText::
text "How many do you"
line "want to withdraw?"
done
_PlayersPCWithdrewItemsText::
text "Withdrew @"
text_decimal wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
text_ram wStringBuffer2
text "(S)."
prompt
_PlayersPCNoRoomWithdrawText::
text "There's no room"
line "for more items."
prompt
UnknownText_0x1c13df::
text "No items here!"
prompt
_PlayersPCHowManyDepositText::
text "How many do you"
line "want to deposit?"
done
_PlayersPCDepositItemsText::
text "Deposited @"
text_decimal wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
text_ram wStringBuffer2
text "(S)."
prompt
_PlayersPCCantDepositText::
text "Can't deposit that"
line "item."
prompt
_PlayersPCNoRoomDepositText::
text "There's no room to"
line "store items."
prompt
UnknownText_0x1c144d::
text "<PLAYER> turned on"
line "the PC."
prompt
UnknownText_0x1c1462::
text "Access whose PC?"
done
UnknownText_0x1c1474::
text "BILL's PC"
line "accessed."
para "#MON Storage"
line "System opened."
prompt
UnknownText_0x1c14a4::
text "Accessed own PC."
para "Item Storage"
line "System opened."
prompt
UnknownText_0x1c14d2::
text "PROF.OAK's PC"
line "accessed."
para "#DEX Rating"
line "System opened."
prompt
UnknownText_0x1c1505::
text "…"
line "Link closed…"
done
_OakPCText1::
text "Want to get your"
line "#DEX rated?"
done
_OakPCText2::
text "Current #DEX"
line "completion level:"
prompt
_OakPCText3::
text_ram wStringBuffer3
text " #MON seen"
line "@"
text_ram wStringBuffer4
text " #MON owned"
para "PROF.OAK's"
line "Rating:"
done
_OakRating01::
text "Look for #MON"
line "in grassy areas!"
done
_OakRating02::
text "Good. I see you"
line "understand how to"
cont "use # BALLS."
done
_OakRating03::
text "You're getting"
line "good at this."
para "But you have a"
line "long way to go."
done
_OakRating04::
text "You need to fill"
line "up the #DEX."
para "Catch different"
line "kinds of #MON!"
done
_OakRating05::
text "You're trying--I"
line "can see that."
para "Your #DEX is"
line "coming together."
done
_OakRating06::
text "To evolve, some"
line "#MON grow,"
para "others use the"
line "effects of STONES."
done
_OakRating07::
text "Have you gotten a"
line "fishing ROD? You"
para "can catch #MON"
line "by fishing."
done
_OakRating08::
text "Excellent! You"
line "seem to like col-"
cont "lecting things!"
done
_OakRating09::
text "Some #MON only"
line "appear during"
para "certain times of"
line "the day."
done
_OakRating10::
text "Your #DEX is"
line "filling up. Keep"
cont "up the good work!"
done
_OakRating11::
text "I'm impressed."
line "You're evolving"
para "#MON, not just"
line "catching them."
done
_OakRating12::
text "Have you met KURT?"
line "His custom BALLS"
cont "should help."
done
_OakRating13::
text "Wow. You've found"
line "more #MON than"
para "the last #DEX"
line "research project."
done
_OakRating14::
text "Are you trading"
line "your #MON?"
para "It's tough to do"
line "this alone!"
done
_OakRating15::
text "Wow! You've hit"
line "200! Your #DEX"
cont "is looking great!"
done
_OakRating16::
text "You've found so"
line "many #MON!"
para "You've really"
line "helped my studies!"
done
_OakRating17::
text "Magnificent! You"
line "could become a"
para "#MON professor"
line "right now!"
done
_OakRating18::
text "Your #DEX is"
line "amazing! You're"
para "ready to turn"
line "professional!"
done
_OakRating19::
text "Whoa! A perfect"
line "#DEX! I've"
para "dreamt about this!"
line "Congratulations!"
done
_OakPCText4::
text "The link to PROF."
line "OAK's PC closed."
done
UnknownText_0x1c19cd::
text "Triple-theme"
line "trainer ranking!"
para "The SAVE file you"
line "just sent might"
cont "make the rankings!"
para ""
done
UnknownText_0x1c1a22::
text "There is no"
line "ranking data."
para "Link to obtain"
line "ranking data."
para ""
done
UnknownText_0x1c1a5b::
text " , yeah!"
done
UnknownText_0x1c1a65::
text "Darn…"
done
UnknownText_0x1c1a6c::
text "Would you like to"
line "end the Contest?"
done
UnknownText_0x1c1a90::
text "Toss out how many"
line "@"
text_ram wStringBuffer2
text "(S)?"
done
UnknownText_0x1c1aad::
text "Throw away @"
text_decimal wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
text_ram wStringBuffer2
text "(S)?"
done
UnknownText_0x1c1aca::
text "Discarded"
line "@"
text_ram wStringBuffer1
text "(S)."
prompt
UnknownText_0x1c1adf::
text "That's too impor-"
line "tant to toss out!"
prompt
UnknownText_0x1c1b03::
text "OAK: <PLAYER>!"
line "This isn't the"
cont "time to use that!"
done
UnknownText_0x1c1b2c::
text "Took @"
text_ram wMonOrItemNameBuffer
text "'s"
line "@"
text_ram wStringBuffer1
text " and"
para "made it hold"
line "@"
text_ram wStringBuffer2
text "."
prompt
UnknownText_0x1c1b57::
text "Made @"
text_ram wMonOrItemNameBuffer
text_start
line "hold @"
text_ram wStringBuffer2
text "."
prompt
UnknownText_0x1c1b6f::
text "Please remove the"
line "MAIL first."
prompt
UnknownText_0x1c1b8e::
text_ram wMonOrItemNameBuffer
text " isn't"
line "holding anything."
prompt
UnknownText_0x1c1baa::
text "Item storage space"
line "full."
prompt
UnknownText_0x1c1bc4::
text "Took @"
text_ram wStringBuffer1
text_start
line "from @"
text_ram wMonOrItemNameBuffer
text "."
prompt
UnknownText_0x1c1bdc::
text_ram wMonOrItemNameBuffer
text " is"
line "already holding"
para "@"
text_ram wStringBuffer1
text "."
line "Switch items?"
done
UnknownText_0x1c1c09::
text "This item can't be"
line "held."
prompt
UnknownText_0x1c1c22::
text "The MAIL will lose"
line "its message. OK?"
done
UnknownText_0x1c1c47::
text "MAIL detached from"
line "@"
text_ram wStringBuffer1
text "."
prompt
UnknownText_0x1c1c62::
text "There's no space"
line "for removing MAIL."
prompt
UnknownText_0x1c1c86::
text "Send the removed"
line "MAIL to your PC?"
done
UnknownText_0x1c1ca9::
text "Your PC's MAILBOX"
line "is full."
prompt
UnknownText_0x1c1cc4::
text "The MAIL was sent"
line "to your PC."
prompt
UnknownText_0x1c1ce3::
text "Not enough HP!"
prompt
UnknownText_0x1c1cf3::
text "An item in your"
line "PACK may be"
para "registered for use"
line "on SELECT Button."
done
_OakText1::
text "Hello! Sorry to"
line "keep you waiting!"
para "Welcome to the"
line "world of #MON!"
para "My name is OAK."
para "People call me the"
line "#MON PROF."
prompt
_OakText2::
text "This world is in-"
line "habited by crea-"
cont "tures that we call"
cont "#MON.@"
text_end
_OakText3::
text_waitbutton
text_end
text_end ; unused
_OakText4::
text "People and #MON"
line "live together by"
para "supporting each"
line "other."
para "Some people play"
line "with #MON, some"
cont "battle with them."
prompt
_OakText5::
text "But we don't know"
line "everything about"
cont "#MON yet."
para "There are still"
line "many mysteries to"
cont "solve."
para "That's why I study"
line "#MON every day."
prompt
| 14.890615
| 47
| 0.716335
|
7014972006dc1c2fcdbe9e76e5e615eb2e7d78a7
| 12,786
|
asm
|
Assembly
|
src/hooks.asm
|
Bryankaveen/cesium
|
b25d4b05573ea0be053e1a6ea25bd4e26ad599d0
|
[
"BSD-3-Clause"
] | null | null | null |
src/hooks.asm
|
Bryankaveen/cesium
|
b25d4b05573ea0be053e1a6ea25bd4e26ad599d0
|
[
"BSD-3-Clause"
] | null | null | null |
src/hooks.asm
|
Bryankaveen/cesium
|
b25d4b05573ea0be053e1a6ea25bd4e26ad599d0
|
[
"BSD-3-Clause"
] | null | null | null |
; Copyright 2015-2021 Matt "MateoConLechuga" Waltz
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; 1. Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
;
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
;
; 3. Neither the name of the copyright holder nor the names of its contributors
; may be used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
hook_token_stop := $d9 - $ce
hook_parser:
db $83 ; hook signifier
push af
cp a,2
jq z,.maybe_stop
.chain:
ld a,(ti.appErr2)
cp a,$7f
jq nz,.no_chain
pop af
ld ix,(ti.appErr2 + 1)
jp (ix)
.no_chain:
pop af
xor a,a
ret
.maybe_stop:
ld a,hook_token_stop ; check if stop token
cp a,b
jq nz,.chain
.stop:
pop af
ld a,ti.E_AppErr1
jq ti.JError
hook_app_change:
db $83
ld c,a
ld a,b
cp a,ti.cxPrgmEdit ; only allow when editing
ld b,a
ret nz
ld a,c
or a,a
jq z,.close_editor
cp a,ti.cxMode
ret z
cp a,ti.cxFormat
ret z
cp a,ti.cxTableSet
ret z
call .close_editor
ld a,return_prgm
ld (return_info),a
jp cesium_start
.close_editor:
push af, bc, hl
call ti.CursorOff
call ti.CloseEditEqu
call ti.PopOP1
call ti.ChkFindSym
jr c,.noarc
ld a,(edit_status)
or a,a
call nz,cesium.Arc_Unarc
.noarc:
pop hl, bc, af
ret
hook_get_key:
db $83
cp a,$1b
ret nz
ld a,b
push af
push hl
ld hl,$f0202c
ld (hl),l
ld l,h
bit 0,(hl)
pop hl
jr nz,.check_for_shortcut_key
pop af
cp a,ti.sk2nd
ret nz
ld a,ti.sk2nd - 1 ; maybe some other day
inc a
ret
.check_for_shortcut_key:
pop af
cp a,ti.skStat
jp z,hook_password
cp a,ti.skGraph
jq z,hook_show_labels
cp a,ti.skPrgm
jq z,hook_execute_cesium
cp a,ti.sk8
jq z,hook_backup_ram
cp a,ti.sk5
jq z,hook_clear_backup
cp a,ti.sk2
jq z,hook_restore_ram
cp a,ti.skStore
jq z,hook_invert_colors
cp a,ti.skLn
jq z,hook_uninvert_colors
ret
hook_invert_colors:
push hl,de,bc
call hook_port_code_copy
call hooks.lcd_spi_open
ld hl,$F80818
ld (hl),h
ld (hl),$44
ld (hl),$21
ld l,h
ld (hl),$01
pop bc,de,hl
xor a,a
inc a
ret
hook_uninvert_colors:
push hl,de,bc
call hook_port_code_copy
call hooks.lcd_spi_open
ld hl,$F80818
ld (hl),h
ld (hl),$44
ld (hl),$20
ld l,h
ld (hl),$01
pop bc,de,hl
xor a,a
inc a
ret
edit_cursor := ti.cursorImage + 3
edit_tail := edit_cursor + 3
label_number := edit_tail + 3
label_number_of_pages := label_number + 3
label_page := label_number_of_pages + 3
label_name := label_page + 3
hook_show_labels:
di
ld a,(ti.cxCurApp)
cp a,ti.cxPrgmEdit
jq nz,hook_get_key_none
hook_strings.copy
call ti.CursorOff
or a,a
sbc hl,hl
ld (label_page),hl
inc l
inc l
ld (label_number),hl
ld hl,(ti.editTail)
ld (edit_tail),hl
ld hl,(ti.editCursor)
ld (edit_cursor),hl
call ti.ClrTxtShd
call ti.BufToTop
call .countlabels
ld bc,0
.getlabelloop:
call ti.ClrScrn
call ti.BufToTop
call .drawlabels
ld hl,(label_page)
ld de,.current_page_string
inc hl
call helper_num_convert
ld hl,.page_string
call helper_vputs_toolbar
.getkey:
di
call ti.DisableAPD
call ti.GetCSC
or a,a
jq z,.getkey
ld bc,1
cp a,ti.sk0
jq z,.movetolabel
inc c
cp a,ti.sk1
jq z,.movetolabel
inc c
cp a,ti.sk2
jq z,.movetolabel
inc c
cp a,ti.sk3
jq z,.movetolabel
inc c
cp a,ti.sk4
jq z,.movetolabel
inc c
cp a,ti.sk5
jq z,.movetolabel
inc c
cp a,ti.sk6
jq z,.movetolabel
inc c
cp a,ti.sk7
jq z,.movetolabel
inc c
cp a,ti.sk8
jq z,.movetolabel
inc c
cp a,ti.sk9
jq z,.movetolabel
cp a,ti.skLeft
jq z,.prevpage
cp a,ti.skRight
jq z,.nextpage
cp a,ti.skClear
jq z,.return
cp a,ti.skMode
jq z,.return
jq .getkey
.movetolabel:
ld a,(ti.curRow)
cp a,c
jr z,.okay
jr c,.getkey
.okay:
ld hl,(label_page)
add hl,de
or a,a
sbc hl,de
jr nz,.normallabel
ld a,c
dec c
dec c
dec a
jq nz,.nottop
call ti.BufToTop
jq .gotoeditor
.nottop:
dec a
jq nz,.normallabel
call ti.BufToBtm
jq .gotoeditor
.normallabel:
call .computepageoffsethl
add hl,bc
push hl
call ti.BufToTop
pop bc
call .skiplabels
call ti.BufLeft
.gotoeditor:
call ti.ClrScrn
xor a,a
ld (ti.curCol),a
ld (ti.curRow),a
ld a,(ti.winTop)
or a,a
jr z,.incesiumeditor ; check if using cesium feature
ld hl,.program_string
call ti.PutS
ld hl,ti.progToEdit
call ti.PutS
call ti.NewLine
.incesiumeditor:
ld a,':'
call ti.PutMap
ld a,1
ld (ti.curCol),a
.backup:
call ti.BufLeft
jr z,.done
ld a,d
or a,a
jr nz,.backup
ld a,e
cp a,ti.tEnter
jr nz,.backup
call ti.BufRight
.done:
call ti.DispEOW
call ti.CursorOn
call ti.DrawStatusBar
jq hook_get_key_none
.return:
ld hl,(edit_tail)
ld (ti.editTail),hl
ld hl,(edit_cursor)
ld (ti.editCursor),hl
jq .gotoeditor
.nextpage:
ld hl,(label_page)
ld de,(label_number_of_pages)
or a,a
sbc hl,de
add hl,de
jr z,.firstpage
inc hl
jr .setpage
.firstpage:
or a,a
sbc hl,hl
.setpage:
ld (label_page),hl
jq .getlabelloop
.prevpage:
ld hl,(label_page)
add hl,de
or a,a
sbc hl,de
jr z,.lastpage
dec hl
jr .setpage
.lastpage:
ld hl,(label_number_of_pages)
jr .setpage
.countlabels:
call ti.BufToTop
.loop:
call ti.BufRight
jr z,.getnumpages
ld a,d
cp a,ti.t2ByteTok
jr z,.loop
ld a,e
cp a,ti.tLbl
jr nz,.loop
ld hl,(label_number)
inc hl
ld (label_number),hl
jr .loop
.getnumpages:
ld hl,(label_number)
dec hl
ld a,10
call ti.DivHLByA
ld (label_number_of_pages),hl
inc hl
ld de,.total_page_string
jp helper_num_convert
.skiplabelsloop:
push bc
call ti.BufRight
pop bc
ret z
ld a,d
cp a,ti.t2ByteTok
jr z,.skiplabelsloop
ld a,e
cp a,ti.tLbl
jr nz,.skiplabelsloop
dec bc
.skiplabels:
sbc hl,hl
adc hl,bc
jr nz,.skiplabelsloop
ret
.drawlabels:
xor a,a
ld (ti.curCol),a
ld (ti.curRow),a
ld hl,(label_page)
add hl,de
or a,a
sbc hl,de
jr nz,.normalpage
ld hl,.top_label
call ti.PutS
xor a,a
ld (ti.curCol),a
inc a
ld (ti.curRow),a
ld hl,.bottom_label
call ti.PutS
call ti.BufToTop
xor a,a
ld (ti.curCol),a
ld a,2
ld (ti.curRow),a
.normalpage:
call .computepageoffset
call .skiplabels
ld hl,label_name
.parse_labels:
push hl
call ti.BufRight
pop hl
ret z
ld a,d
or a,a
jr nz,.parse_labels
ld a,e
cp a,ti.tLbl
jr nz,.parse_labels
.add_label:
push hl
call ti.BufRight
pop hl
jr z,.added_label
ld a,e
cp a,ti.tColon
jr z,.added_label
cp a,ti.tEnter
jr z,.added_label
ld a,d
or a,a
jr z,.single
ld (hl),a
inc hl
.single:
ld (hl),e
inc hl
jr .add_label
.added_label:
xor a,a
ld (hl),a
ld (ti.curCol),a
ld a,(ti.curRow)
add a,'0'
call ti.PutC
ld a,':'
call ti.PutC
ld hl,label_name
push hl
.displayline:
ld a,(hl)
or a,a
jr z,.leftedge
inc hl
call ti.Isa2ByteTok
ld d,0
jr nz,.singlebyte
.multibyte:
ld d,a
ld e,(hl)
inc hl
jr .getstring
.singlebyte:
ld e,a
.getstring:
push hl
call ti.GetTokString
ld b,(hl)
inc hl
.loopdisplay:
ld a,(ti.curCol)
cp a,$19
jr z,.leftedgepop
ld a,(hl)
inc hl
call ti.PutC
djnz .loopdisplay
pop hl
jr .displayline
.leftedgepop:
pop hl
.leftedge:
ld a,(ti.curRow)
inc a
ld (ti.curRow),a
cp a,10
pop hl
jq nz,.parse_labels
ret
.computepageoffsethl:
push bc
call .computepageoffset
pop bc
ret
.computepageoffset:
ld hl,(label_page)
add hl,de
or a,a
sbc hl,de
push hl
pop bc
ret z
ld bc,10
call ti._imulu
dec hl
dec hl
push hl
pop bc
ret
relocate hook_strings, ti.plotSScreen
.program_string:
db "PROGRAM:",0
.page_string:
db "Use <> to switch page: <"
.current_page_string:
db "000"
db " of "
.total_page_string:
db "000"
db ">",0
.top_label:
db "0:PRGM TOP",0
.bottom_label:
db "1:PRGM BOTTOM",0
end relocate
hook_port_code_copy:
hooks_ports.copy
call hooks.port_setup
or a,a
ret z
pop hl
jq hook_get_key_none
hook_clear_backup:
call hook_port_code_copy
call hooks.flash_clear_backup
jr hook_get_key_none
hook_restore_ram:
push hl
push af
ld hl,$3c0001
ld a,$a5
cp a,(hl)
jr nz,.none
dec hl
ld a,$5a
cp a,(hl)
jp z,0
.none:
pop af
pop hl
inc a
dec a
ret
hook_get_key_none:
xor a,a
inc a
dec a
ret
hook_backup_ram:
call ti.os.ClearStatusBarLow
ld hl,string_ram_backup
call helper_vputs_toolbar
call hook_port_code_copy
call hooks.flash_backup_ram
call ti.DrawStatusBar
jr hook_get_key_none
hook_execute_cesium:
ld iy,ti.flags
call ti.CursorOff
call ti.RunIndicOff
di
call ti.ClrGetKeyHook
ld a,(ti.menuCurrent)
cp a,ti.kWindow
jr nz,.notinwindow
ld a,ti.kClear
call ti.PullDownChk ; exit from alpha + function menus
.notinwindow:
ld a,ti.kQuit
call ti.PullDownChk ; exit from randInt( and related menus
ld a,ti.kQuit
call ti.NewContext0 ; just attempt a cleanup now
call ti.CursorOff
call ti.RunIndicOff
xor a,a
ld (ti.menuCurrent),a ; make sure we aren't on a menu
ld hl,data_string_cesium_name ; execute app
ld de,$d0082e ; I have absolutely no idea what this is
push de
ld bc,8
push bc
ldir
pop bc
pop hl
ld de,ti.progToEdit ; copy it here just to be safe
ldir
ld a,ti.kExtApps
call ti.NewContext0
ld a,ti.kClear
jp ti.JForceCmd
hook_password:
ld hl,data_cesium_appvar
call ti.Mov9ToOP1
call ti.ChkFindSym
call ti.ChkInRam
push af
call z,cesium.Arc_Unarc ; archive it
pop af
jr z,hook_password ; find the settings appvar
ex de,hl
ld de,9
add hl,de
ld e,(hl)
add hl,de
inc hl
inc hl
inc hl
ld de,settings_data
ld bc,settings_size
ldir ; copy in the password
.wrong:
call ti.CursorOff
ld a,ti.cxCmd
call ti.NewContext0
call ti.CursorOff
call ti.ClrScrn
call ti.HomeUp
ld hl,data_string_password
call ti.PutS
di
call ti.EnableAPD
ld a,1
ld hl,ti.apdSubTimer
ld (hl),a
inc hl
ld (hl),a
set ti.apdRunning,(iy + ti.apdFlags)
ei
ld hl,setting_password
ld a,(hl) ; password length
or a,a
jr z,.correct
ld b,a
ld c,0
inc hl
.get_user_password:
call .get_key
cp a,(hl)
inc hl
jr z,.draw_character
inc c
.draw_character:
ld a,'*'
call ti.PutC
djnz .get_user_password
dec c
inc c
jr nz,.wrong
.correct:
ld a,ti.kClear
jp ti.SendKPress
.get_key:
push hl
call ti.GetCSC
pop hl
or a,a
jr z,.get_key
ret
hook_chain_parser:
xor a,a
ld (ti.appErr2),a
bit ti.parserHookActive,(iy + ti.hookflags4)
jq z,.no_chain
ld hl,(ti.parserHookPtr)
ld de,hook_parser
or a,a
sbc hl,de
add hl,de
jq z,.check_if_bad_exit
.chain_hooks:
ld a,(hl)
cp a,$83
jq nz,.no_chain
ex de,hl
inc de
ld hl,ti.appErr2
ld (hl),$7f
inc hl
ld (hl),de
jq .no_chain
.check_if_bad_exit:
ld hl,ti.appErr2
ld a,(hl)
cp a,$7f
jq nz,.no_chain
inc hl
ld hl,(hl)
dec hl
jq .chain_hooks
.no_chain:
ld hl,hook_parser
jq ti.SetParserHook
hook_restore_parser:
bit ti.parserHookActive,(iy + ti.hookflags4)
jq z,.clear_parser
ld hl,(ti.parserHookPtr)
ld de,hook_parser
or a,a
sbc hl,de
add hl,de
ret nz
ld hl,ti.appErr2
ld a,(hl)
cp a,$7f
jq nz,.clear_parser
inc hl
ld hl,(hl)
dec hl
xor a,a
ld (ti.appErr2),a
jq ti.SetParserHook
.clear_parser:
jq ti.ClrParserHook
helper_vputs_toolbar:
di
ld a,$d0
ld mb,a
ld de,$e71c
ld.sis (ti.drawFGColor and $ffff),de
ld.sis de,(ti.statusBarBGColor and $ffff)
ld.sis (ti.drawBGColor and $ffff),de
ld a,14
ld (ti.penRow),a
ld de,2
ld.sis (ti.penCol and $ffff), de
jp ti.VPutS
helper_num_convert:
ld a,4
.entry:
ld bc,-100
call .aqu
ld c,-10
call .aqu
ld c,b
.aqu:
ld a,'0' - 1
.under:
inc a
add hl,bc
jr c,.under
sbc hl,bc
ld (de),a
inc de
ret
relocate hooks_ports, ti.pixelShadow2
define hooks
namespace hooks
include 'ports.asm'
include 'flash.asm'
lcd_spi_open:
call port_unlock
ld bc,9
call port_read
res 4,a
call port_write
call port_lock
ld de,ti.mpSpiCtrl0
ld hl,.ports
ld bc,12
ldir
ret
.ports:
db $2B,$18,$00,$00,$0B,$00,$02,$00,$01,$01,$00,$00
end namespace
end relocate
| 15.9825
| 79
| 0.710856
|
5445cb3748cce0b533e9abfaf2482be08cd0cd4c
| 589
|
asm
|
Assembly
|
solutions/51 - Identify Yourselves/size-40_speed-6.asm
|
michaelgundlach/7billionhumans
|
02c6f3963364362c95cb516cbc6ef1efc073bb2e
|
[
"MIT"
] | 45
|
2018-09-05T04:56:59.000Z
|
2021-11-22T08:57:26.000Z
|
solutions/51 - Identify Yourselves/size-40_speed-6.asm
|
michaelgundlach/7billionhumans
|
02c6f3963364362c95cb516cbc6ef1efc073bb2e
|
[
"MIT"
] | 36
|
2018-09-01T11:34:26.000Z
|
2021-05-19T23:20:49.000Z
|
solutions/51 - Identify Yourselves/size-40_speed-6.asm
|
michaelgundlach/7billionhumans
|
02c6f3963364362c95cb516cbc6ef1efc073bb2e
|
[
"MIT"
] | 36
|
2018-09-01T07:44:19.000Z
|
2021-09-10T19:07:35.000Z
|
-- 7 Billion Humans (2145) --
-- 51: Identify Yourselves --
-- Author: landfillbaby
-- Size: 40
-- Speed: 6
pickup s
if w != worker:
step s
write 1
jump a
endif
if e != worker:
step s
write 10
jump b
endif
if w != worker:
step s
write 2
jump c
endif
if e != worker:
step s
write 9
jump d
endif
if w != worker:
step s
write 3
jump e
endif
if e != worker:
step s
write 8
jump f
endif
if w != worker:
step s
write 4
jump g
endif
if e != worker:
step s
write 7
jump h
endif
if w != worker:
step s
write 5
jump i
endif
step s
write 6
a:
b:
c:
d:
e:
f:
g:
h:
i:
drop
| 9.061538
| 29
| 0.628183
|
82e2c6891be19761735bd026d1ee492d2db1d71a
| 180
|
asm
|
Assembly
|
bddisasm_test/special/cr8_32.asm
|
andreaswimmer/bddisasm
|
960e9eaeee4f87d8269095031cd6cfb8aabb998b
|
[
"Apache-2.0"
] | 675
|
2020-07-09T12:57:49.000Z
|
2022-03-26T15:03:53.000Z
|
bddisasm_test/special/cr8_32.asm
|
andreaswimmer/bddisasm
|
960e9eaeee4f87d8269095031cd6cfb8aabb998b
|
[
"Apache-2.0"
] | 41
|
2020-07-22T07:15:07.000Z
|
2022-03-23T08:34:28.000Z
|
bddisasm_test/special/cr8_32.asm
|
andreaswimmer/bddisasm
|
960e9eaeee4f87d8269095031cd6cfb8aabb998b
|
[
"Apache-2.0"
] | 94
|
2020-07-09T14:39:02.000Z
|
2022-03-27T10:37:03.000Z
|
bits 32
; These should operate on CR8, as per AMD hack to make CR8 accessible outside long mode.
db 0xF0
mov eax, cr0
db 0xF0
mov cr0, eax
| 22.5
| 92
| 0.583333
|
53eb640c2ba745d28da2488c1689f190fa97a57c
| 689
|
asm
|
Assembly
|
oeis/033/A033279.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/033/A033279.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/033/A033279.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A033279: Number of diagonal dissections of an n-gon into 7 regions.
; Submitted by Christian Krause
; 0,429,5005,32032,148512,556920,1790712,5116320,13302432,32008977,72177105,153977824,313112800,610569960,1147334760,2086063200,3682355040,6329047725,10617908301,17424259776,28021470400,44233892560,68638798800,104830165440,157759842240,234174765825,343172475009,496901321280,711436494912,1007868367792,1413645753520,1964223573312,2705072166720,3694114177677,5004664661997,6728960890080,8982380350944,11908458798600,15684834922120,20530264474720,26712864578400,34559768548305,44468393079825
sub $0,1
mov $1,-3
mov $2,$0
add $2,6
sub $1,$2
bin $1,6
bin $2,$0
mul $1,$2
mov $0,$1
div $0,7
| 45.933333
| 489
| 0.834543
|
fd40db9cb61f1f3854fac6305c36374dd8362a19
| 6,219
|
asm
|
Assembly
|
engine/battle/bank3d_battle.asm
|
longlostsoul/EvoYellow
|
fe5d0d372c4e90d384c4005a93f19d7968f2ff13
|
[
"Unlicense"
] | 16
|
2018-08-28T21:47:01.000Z
|
2022-02-20T20:29:59.000Z
|
engine/battle/bank3d_battle.asm
|
longlostsoul/EvoYellow
|
fe5d0d372c4e90d384c4005a93f19d7968f2ff13
|
[
"Unlicense"
] | 5
|
2019-04-03T19:53:11.000Z
|
2022-03-11T22:49:34.000Z
|
engine/battle/bank3d_battle.asm
|
longlostsoul/EvoYellow
|
fe5d0d372c4e90d384c4005a93f19d7968f2ff13
|
[
"Unlicense"
] | 2
|
2019-12-09T19:46:02.000Z
|
2020-12-05T21:36:30.000Z
|
InitBattle:
ld a, [wCurOpponent]
and a
jr z, asm_f6003
InitOpponent:
ld a, [wCurOpponent]
ld [wcf91], a
ld [wEnemyMonSpecies2], a
jr asm_f601d
asm_f6003:
ld a, [wd732]
bit 1, a
jr z, .asm_f600f
ld a, [hJoyHeld]
bit 1, a ; B button pressed?
ret nz
.asm_f600f
ld a, [wNumberOfNoRandomBattleStepsLeft]
and a
ret nz
callab TryDoWildEncounter
ret nz
asm_f601d:
ld a, [wMapPalOffset]
push af
ld hl, wLetterPrintingDelayFlags
ld a, [hl]
push af
res 1, [hl]
call InitBattleVariables ; 3d:6236
ld a,[wTemp]
cp 10
jr z, InitWildBattle
ld a, [wEnemyMonSpecies2]
sub $c8 ;could do some over-ride here of species, or, diff over-ride to make wild pokemuns actually appear over this number?
jp c, InitWildBattle
ld [wTrainerClass], a
call GetTrainerInformation
callab ReadTrainer
callab DoBattleTransitionAndInitBattleVariables
call _LoadTrainerPic ; 3d:615a
xor a
ld [wEnemyMonSpecies2], a
ld [$ffe1], a
dec a
ld [wAICount], a
coord hl, 12, 0
predef CopyUncompressedPicToTilemap
ld a, $ff
ld [wEnemyMonPartyPos], a
ld a, $2
ld [wIsInBattle], a
; Is this a major story battle?
ld a,[wLoneAttackNo]
and a
jp z,InitBattle_Common
callabd_ModifyPikachuHappiness PIKAHAPPY_GYMLEADER ; useless since already in bank3d
jp InitBattle_Common
InitWildBattle:
ld a, $1
ld [wIsInBattle], a
callab LoadEnemyMonData
callab DoBattleTransitionAndInitBattleVariables
ld a, [wCurOpponent]
cp MAROWAK
jr z, .isGhost
callab IsGhostBattle
jr nz, .isNoGhost
.isGhost
ld hl, wMonHSpriteDim
ld a, $66
ld [hli], a ; write sprite dimensions
ld bc, GhostPic
ld a, c
ld [hli], a ; write front sprite pointer
ld [hl], b
ld hl, wEnemyMonNick ; set name to "GHOST"
ld a, "G"
ld [hli], a
ld a, "H"
ld [hli], a
ld a, "O"
ld [hli], a
ld a, "S"
ld [hli], a
ld a, "T"
ld [hli], a
ld [hl], "@"
ld a, [wcf91]
push af
ld a, MON_GHOST
ld [wcf91], a
ld de, vFrontPic
call LoadMonFrontSprite ; load ghost sprite
pop af
ld [wcf91], a
jr .spriteLoaded
.isNoGhost
ld de, vFrontPic
call LoadMonFrontSprite ; load mon sprite
.spriteLoaded
xor a
ld [wTrainerClass], a
ld [$ffe1], a
coord hl, 12, 0
predef CopyUncompressedPicToTilemap
; common code that executes after init battle code specific to trainer or wild battles
InitBattle_Common:
ld b, $0
call RunPaletteCommand
callab SlidePlayerAndEnemySilhouettesOnScreen
xor a
ld [H_AUTOBGTRANSFERENABLED], a
ld hl, .emptyString
call PrintText
call SaveScreenTilesToBuffer1
call ClearScreen
ld a, $98
ld [$ffbd], a
ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a
call Delay3
ld a, $9c
ld [$ffbd], a
call LoadScreenTilesFromBuffer1
coord hl, 9, 7
ld bc, $50a
call ClearScreenArea
coord hl, 1, 0
ld bc, $40a
call ClearScreenArea
call ClearSprites
ld a, [wIsInBattle]
dec a ; is it a wild battle?
ld hl, DrawEnemyHUDAndHPBar
ld b,BANK(DrawEnemyHUDAndHPBar)
call z, Bankswitch ; draw enemy HUD and HP bar if it's a wild battle
callab StartBattle
callab EndOfBattle
pop af
ld [wLetterPrintingDelayFlags], a
pop af
ld [wMapPalOffset], a
ld a, [wSavedTilesetType]
ld [hTilesetType], a
scf
ret
.emptyString
db "@"
_LoadTrainerPic:
; wd033-wd034 contain pointer to pic
ld a, [wTrainerPicPointer] ; wd033
ld e, a
ld a, [wTrainerPicPointer + 1] ; wd034
ld d, a ; de contains pointer to trainer pic
ld a, [wLinkState]
and a
ld a, Bank(TrainerPics) ; this is where all the trainer pics are (not counting Red's)
jr z, .loadSprite
ld a, Bank(RedPicFront)
.loadSprite
call UncompressSpriteFromDE
ld de, vFrontPic
ld a, $77
ld c, a
jp LoadUncompressedSpriteData
LoadMonBackPic:
; Assumes the monster's attributes have
; been loaded with GetMonHeader.
ld a, [wBattleMonSpecies2]
ld [wcf91], a
coord hl, 1, 5
ld bc,$708
call ClearScreenArea
ld a,[wTemp4]
cp BLASTOISE
jr z, .MegaLoad3
cp CHARIZARD
jr z, .MegaLoad
cp VENUSAUR
jr z, .MegaLoad2
ld hl, wMonHBackSprite - wMonHeader
call UncompressMonSprite
jp .Load
.MegaLoad
ld a, BANK(MegaCharizardPicBack)
ld de,MegaCharizardPicBack
call UncompressSpriteFromDE
jp .Load
.MegaLoad2
ld a, BANK(MegaVenusaurPicBack)
ld de,MegaVenusaurPicBack
call UncompressSpriteFromDE
jp .Load
.MegaLoad3
ld a, BANK(MegaBlastoisePicBack)
ld de,MegaBlastoisePicBack
call UncompressSpriteFromDE
.Load
callba LoadBackSpriteUnzoomed
ld hl, vSprites
ld de, vBackPic
ld c, (2*SPRITEBUFFERSIZE)/16 ; count of 16-byte chunks to be copied
ld a, [H_LOADEDROMBANK]
ld b, a
jp CopyVideoData
AnimateSendingOutMon:
ld a, [wPredefRegisters]
ld h, a
ld a, [wPredefRegisters + 1]
ld l, a
ld a, [$ffe1]
ld [H_DOWNARROWBLINKCNT1], a
ld b, $4c
ld a, [wIsInBattle]
and a
jr z, .asm_f61ef
add b
ld [hl], a
call Delay3
ld bc, -41
add hl, bc
ld a, $1
ld [wNumMovesMinusOne], a
ld bc, $303
predef CopyDownscaledMonTiles
ld c, $4
call DelayFrames
ld bc, -41
add hl, bc
xor a
ld [wNumMovesMinusOne], a
ld bc, $505
predef CopyDownscaledMonTiles
ld c, $5
call DelayFrames
ld bc, -41
jr .asm_f61f2
.asm_f61ef
ld bc, -123
.asm_f61f2
add hl, bc
ld a, [H_DOWNARROWBLINKCNT1]
add $31
jr CopyUncompressedPicToHL
CopyUncompressedPicToTilemap:
ld a, [wPredefRegisters]
ld h, a
ld a, [wPredefRegisters + 1]
ld l, a
ld a, [$ffe1]
CopyUncompressedPicToHL:
ld bc, $707
ld de, $14
push af
ld a, [wSpriteFlipped]
and a
jr nz, .asm_f6220
pop af
.asm_f6211
push bc
push hl
.asm_f6213
ld [hl], a
add hl, de
inc a
dec c
jr nz, .asm_f6213
pop hl
inc hl
pop bc
dec b
jr nz, .asm_f6211
ret
.asm_f6220
push bc
ld b, $0
dec c
add hl, bc
pop bc
pop af
.asm_f6227
push bc
push hl
.asm_f6229
ld [hl], a
add hl, de
inc a
dec c
jr nz, .asm_f6229
pop hl
dec hl
pop bc
dec b
jr nz, .asm_f6227
ret
INCLUDE "engine/battle/init_battle_variables.asm"
INCLUDE "engine/battle/moveEffects/focus_energy_effect.asm"
INCLUDE "engine/battle/moveEffects/heal_effect.asm"
INCLUDE "engine/battle/moveEffects/transform_effect.asm"
INCLUDE "engine/battle/moveEffects/reflect_light_screen_effect.asm"
INCLUDE "engine/battle/moveEffects/mist_effect.asm"
INCLUDE "engine/battle/moveEffects/one_hit_ko_effect.asm"
INCLUDE "engine/battle/moveEffects/pay_day_effect.asm"
INCLUDE "engine/battle/moveEffects/paralyze_effect.asm"
| 19.68038
| 125
| 0.732433
|
0f2972510ee02bd8e7d8dc580b17bfe307bfeafe
| 9,888
|
asm
|
Assembly
|
src/core/external/jpeg-6bx/jfdctint.asm
|
miahmie/krkrz
|
e4948f61393ca4a2acac0301a975165dd4efc643
|
[
"Unlicense",
"Apache-2.0",
"Libpng",
"FTL",
"IJG"
] | 4
|
2017-01-06T14:31:26.000Z
|
2019-08-15T04:47:11.000Z
|
src/core/external/jpeg-6bx/jfdctint.asm
|
miahmie/krkrz
|
e4948f61393ca4a2acac0301a975165dd4efc643
|
[
"Unlicense",
"Apache-2.0",
"Libpng",
"FTL",
"IJG"
] | null | null | null |
src/core/external/jpeg-6bx/jfdctint.asm
|
miahmie/krkrz
|
e4948f61393ca4a2acac0301a975165dd4efc643
|
[
"Unlicense",
"Apache-2.0",
"Libpng",
"FTL",
"IJG"
] | 2
|
2017-08-23T13:55:19.000Z
|
2021-02-13T11:39:54.000Z
|
;
; jfdctint.asm - accurate integer FDCT (non-SIMD)
;
; x86 SIMD extension for IJG JPEG library
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
;
; This file contains a slow-but-accurate integer implementation of the
; forward DCT (Discrete Cosine Transform). The following code is based
; directly on the IJG's original jfdctint.c; see the jfdctint.c for
; more details.
;
; Last Modified : October 17, 2004
;
; [TAB8]
%include "jsimdext.inc"
%include "jdct.inc"
%ifdef DCT_ISLOW_SUPPORTED
; This module is specialized to the case DCTSIZE = 8.
;
%if DCTSIZE != 8
%error "Sorry, this code only copes with 8x8 DCTs."
%endif
; --------------------------------------------------------------------------
; Descale and correctly round a DWORD value that's scaled by N bits.
;
%macro descale 2
%if (%2)<=7
add %1, byte (1<<((%2)-1)) ; add reg32,imm8
%else
add %1, (1<<((%2)-1)) ; add reg32,imm32
%endif
sar %1,%2
%endmacro
; --------------------------------------------------------------------------
%define CONST_BITS 13
%define PASS1_BITS 2
%if CONST_BITS == 13
F_0_298 equ 2446 ; FIX(0.298631336)
F_0_390 equ 3196 ; FIX(0.390180644)
F_0_541 equ 4433 ; FIX(0.541196100)
F_0_765 equ 6270 ; FIX(0.765366865)
F_0_899 equ 7373 ; FIX(0.899976223)
F_1_175 equ 9633 ; FIX(1.175875602)
F_1_501 equ 12299 ; FIX(1.501321110)
F_1_847 equ 15137 ; FIX(1.847759065)
F_1_961 equ 16069 ; FIX(1.961570560)
F_2_053 equ 16819 ; FIX(2.053119869)
F_2_562 equ 20995 ; FIX(2.562915447)
F_3_072 equ 25172 ; FIX(3.072711026)
%else
; NASM cannot do compile-time arithmetic on floating-point constants.
%define DESCALE(x,n) (((x)+(1<<((n)-1)))>>(n))
F_0_298 equ DESCALE( 320652955,30-CONST_BITS) ; FIX(0.298631336)
F_0_390 equ DESCALE( 418953276,30-CONST_BITS) ; FIX(0.390180644)
F_0_541 equ DESCALE( 581104887,30-CONST_BITS) ; FIX(0.541196100)
F_0_765 equ DESCALE( 821806413,30-CONST_BITS) ; FIX(0.765366865)
F_0_899 equ DESCALE( 966342111,30-CONST_BITS) ; FIX(0.899976223)
F_1_175 equ DESCALE(1262586813,30-CONST_BITS) ; FIX(1.175875602)
F_1_501 equ DESCALE(1612031267,30-CONST_BITS) ; FIX(1.501321110)
F_1_847 equ DESCALE(1984016188,30-CONST_BITS) ; FIX(1.847759065)
F_1_961 equ DESCALE(2106220350,30-CONST_BITS) ; FIX(1.961570560)
F_2_053 equ DESCALE(2204520673,30-CONST_BITS) ; FIX(2.053119869)
F_2_562 equ DESCALE(2751909506,30-CONST_BITS) ; FIX(2.562915447)
F_3_072 equ DESCALE(3299298341,30-CONST_BITS) ; FIX(3.072711026)
%endif
; --------------------------------------------------------------------------
SECTION SEG_TEXT
BITS 32
;
; Perform the forward DCT on one block of samples.
;
; GLOBAL(void)
; jpeg_fdct_islow (DCTELEM * data)
;
%define data(b) (b)+8 ; DCTELEM * data
align 16
global EXTN(jpeg_fdct_islow)
EXTN(jpeg_fdct_islow):
push ebp
mov ebp,esp
push ebx
; push ecx ; need not be preserved
; push edx ; need not be preserved
push esi
push edi
; ---- Pass 1: process rows.
mov edx, POINTER [data(ebp)] ; (DCTELEM *)
mov ecx, DCTSIZE
alignx 16,7
.rowloop:
movsx eax, DCTELEM [ROW(0,edx,SIZEOF_DCTELEM)]
movsx edi, DCTELEM [ROW(7,edx,SIZEOF_DCTELEM)]
lea esi,[eax+edi] ; esi=tmp0
sub eax,edi ; eax=tmp7
push ecx ; ctr
push eax
movsx ebx, DCTELEM [ROW(1,edx,SIZEOF_DCTELEM)]
movsx ecx, DCTELEM [ROW(6,edx,SIZEOF_DCTELEM)]
lea edi,[ebx+ecx] ; edi=tmp1
sub ebx,ecx ; ebx=tmp6
push ebx
movsx eax, DCTELEM [ROW(2,edx,SIZEOF_DCTELEM)]
movsx ecx, DCTELEM [ROW(5,edx,SIZEOF_DCTELEM)]
lea ebx,[eax+ecx] ; ebx=tmp2
sub eax,ecx ; eax=tmp5
push edx ; dataptr
push eax
movsx ecx, DCTELEM [ROW(3,edx,SIZEOF_DCTELEM)]
movsx eax, DCTELEM [ROW(4,edx,SIZEOF_DCTELEM)]
lea edx,[ecx+eax] ; edx=tmp3
sub ecx,eax ; ecx=tmp4
push ecx
; -- Even part
lea eax,[esi+edx] ; eax=tmp10
lea ecx,[edi+ebx] ; ecx=tmp11
sub esi,edx ; esi=tmp13
sub edi,ebx ; edi=tmp12
lea ebx,[eax+ecx] ; ebx=data0
sub eax,ecx ; eax=data4
mov edx, POINTER [esp+8] ; dataptr
sal ebx, PASS1_BITS
sal eax, PASS1_BITS
mov DCTELEM [ROW(0,edx,SIZEOF_DCTELEM)], bx
mov DCTELEM [ROW(4,edx,SIZEOF_DCTELEM)], ax
lea ecx,[edi+esi]
imul ecx,(F_0_541) ; ecx=z1
imul esi,(F_0_765) ; esi=MULTIPLY(tmp13,FIX_0_765366865)
imul edi,(-F_1_847) ; edi=MULTIPLY(tmp12,-FIX_1_847759065)
add esi,ecx ; esi=data2
add edi,ecx ; edi=data6
descale esi,(CONST_BITS-PASS1_BITS)
descale edi,(CONST_BITS-PASS1_BITS)
mov DCTELEM [ROW(2,edx,SIZEOF_DCTELEM)], si
mov DCTELEM [ROW(6,edx,SIZEOF_DCTELEM)], di
; -- Odd part
mov eax, INT32 [esp] ; eax=tmp4
mov ebx, INT32 [esp+4] ; ebx=tmp5
mov ecx, INT32 [esp+12] ; ecx=tmp6
mov esi, INT32 [esp+16] ; esi=tmp7
lea edx,[eax+ecx] ; edx=z3
lea edi,[ebx+esi] ; edi=z4
add eax,esi ; eax=z1
add ebx,ecx ; ebx=z2
lea esi,[edx+edi]
imul esi,(F_1_175) ; esi=z5
imul edx,(-F_1_961) ; edx=z3(=MULTIPLY(z3,-FIX_1_961570560))
imul edi,(-F_0_390) ; edi=z4(=MULTIPLY(z4,-FIX_0_390180644))
imul eax,(-F_0_899) ; eax=z1(=MULTIPLY(z1,-FIX_0_899976223))
imul ebx,(-F_2_562) ; ebx=z2(=MULTIPLY(z2,-FIX_2_562915447))
add edx,esi ; edx=z3(=z3+z5)
add edi,esi ; edi=z4(=z4+z5)
lea ecx,[eax+edx] ; ecx=z1+z3
lea esi,[ebx+edi] ; esi=z2+z4
add eax,edi ; eax=z1+z4
add ebx,edx ; ebx=z2+z3
pop edx ; edx=tmp4
pop edi ; edi=tmp5
imul edx,(F_0_298) ; edx=tmp4(=MULTIPLY(tmp4,FIX_0_298631336))
imul edi,(F_2_053) ; edi=tmp5(=MULTIPLY(tmp5,FIX_2_053119869))
add ecx,edx ; ecx=data7(=tmp4+z1+z3)
add esi,edi ; esi=data5(=tmp5+z2+z4)
pop edx ; dataptr
descale ecx,(CONST_BITS-PASS1_BITS)
descale esi,(CONST_BITS-PASS1_BITS)
mov DCTELEM [ROW(7,edx,SIZEOF_DCTELEM)], cx
mov DCTELEM [ROW(5,edx,SIZEOF_DCTELEM)], si
pop edi ; edi=tmp6
pop ecx ; ecx=tmp7
imul edi,(F_3_072) ; edi=tmp6(=MULTIPLY(tmp6,FIX_3_072711026))
imul ecx,(F_1_501) ; ecx=tmp7(=MULTIPLY(tmp7,FIX_1_501321110))
add ebx,edi ; ebx=data3(=tmp6+z2+z3)
add eax,ecx ; eax=data1(=tmp7+z1+z4)
pop ecx ; ctr
descale ebx,(CONST_BITS-PASS1_BITS)
descale eax,(CONST_BITS-PASS1_BITS)
mov DCTELEM [ROW(3,edx,SIZEOF_DCTELEM)], bx
mov DCTELEM [ROW(1,edx,SIZEOF_DCTELEM)], ax
add edx, byte DCTSIZE*SIZEOF_DCTELEM
dec ecx ; advance pointer to next row
jnz near .rowloop
; ---- Pass 2: process columns.
mov edx, POINTER [data(ebp)] ; (DCTELEM *)
mov ecx, DCTSIZE
alignx 16,7
.columnloop:
movsx eax, DCTELEM [COL(0,edx,SIZEOF_DCTELEM)]
movsx edi, DCTELEM [COL(7,edx,SIZEOF_DCTELEM)]
lea esi,[eax+edi] ; esi=tmp0
sub eax,edi ; eax=tmp7
push ecx ; ctr
push eax
movsx ebx, DCTELEM [COL(1,edx,SIZEOF_DCTELEM)]
movsx ecx, DCTELEM [COL(6,edx,SIZEOF_DCTELEM)]
lea edi,[ebx+ecx] ; edi=tmp1
sub ebx,ecx ; ebx=tmp6
push ebx
movsx eax, DCTELEM [COL(2,edx,SIZEOF_DCTELEM)]
movsx ecx, DCTELEM [COL(5,edx,SIZEOF_DCTELEM)]
lea ebx,[eax+ecx] ; ebx=tmp2
sub eax,ecx ; eax=tmp5
push edx ; dataptr
push eax
movsx ecx, DCTELEM [COL(3,edx,SIZEOF_DCTELEM)]
movsx eax, DCTELEM [COL(4,edx,SIZEOF_DCTELEM)]
lea edx,[ecx+eax] ; edx=tmp3
sub ecx,eax ; ecx=tmp4
push ecx
; -- Even part
lea eax,[esi+edx] ; eax=tmp10
lea ecx,[edi+ebx] ; ecx=tmp11
sub esi,edx ; esi=tmp13
sub edi,ebx ; edi=tmp12
lea ebx,[eax+ecx] ; ebx=data0
sub eax,ecx ; eax=data4
mov edx, POINTER [esp+8] ; dataptr
descale ebx, PASS1_BITS
descale eax, PASS1_BITS
mov DCTELEM [COL(0,edx,SIZEOF_DCTELEM)], bx
mov DCTELEM [COL(4,edx,SIZEOF_DCTELEM)], ax
lea ecx,[edi+esi]
imul ecx,(F_0_541) ; ecx=z1
imul esi,(F_0_765) ; esi=MULTIPLY(tmp13,FIX_0_765366865)
imul edi,(-F_1_847) ; edi=MULTIPLY(tmp12,-FIX_1_847759065)
add esi,ecx ; esi=data2
add edi,ecx ; edi=data6
descale esi,(CONST_BITS+PASS1_BITS)
descale edi,(CONST_BITS+PASS1_BITS)
mov DCTELEM [COL(2,edx,SIZEOF_DCTELEM)], si
mov DCTELEM [COL(6,edx,SIZEOF_DCTELEM)], di
; -- Odd part
mov eax, INT32 [esp] ; eax=tmp4
mov ebx, INT32 [esp+4] ; ebx=tmp5
mov ecx, INT32 [esp+12] ; ecx=tmp6
mov esi, INT32 [esp+16] ; esi=tmp7
lea edx,[eax+ecx] ; edx=z3
lea edi,[ebx+esi] ; edi=z4
add eax,esi ; eax=z1
add ebx,ecx ; ebx=z2
lea esi,[edx+edi]
imul esi,(F_1_175) ; esi=z5
imul edx,(-F_1_961) ; edx=z3(=MULTIPLY(z3,-FIX_1_961570560))
imul edi,(-F_0_390) ; edi=z4(=MULTIPLY(z4,-FIX_0_390180644))
imul eax,(-F_0_899) ; eax=z1(=MULTIPLY(z1,-FIX_0_899976223))
imul ebx,(-F_2_562) ; ebx=z2(=MULTIPLY(z2,-FIX_2_562915447))
add edx,esi ; edx=z3(=z3+z5)
add edi,esi ; edi=z4(=z4+z5)
lea ecx,[eax+edx] ; ecx=z1+z3
lea esi,[ebx+edi] ; esi=z2+z4
add eax,edi ; eax=z1+z4
add ebx,edx ; ebx=z2+z3
pop edx ; edx=tmp4
pop edi ; edi=tmp5
imul edx,(F_0_298) ; edx=tmp4(=MULTIPLY(tmp4,FIX_0_298631336))
imul edi,(F_2_053) ; edi=tmp5(=MULTIPLY(tmp5,FIX_2_053119869))
add ecx,edx ; ecx=data7(=tmp4+z1+z3)
add esi,edi ; esi=data5(=tmp5+z2+z4)
pop edx ; dataptr
descale ecx,(CONST_BITS+PASS1_BITS)
descale esi,(CONST_BITS+PASS1_BITS)
mov DCTELEM [COL(7,edx,SIZEOF_DCTELEM)], cx
mov DCTELEM [COL(5,edx,SIZEOF_DCTELEM)], si
pop edi ; edi=tmp6
pop ecx ; ecx=tmp7
imul edi,(F_3_072) ; edi=tmp6(=MULTIPLY(tmp6,FIX_3_072711026))
imul ecx,(F_1_501) ; ecx=tmp7(=MULTIPLY(tmp7,FIX_1_501321110))
add ebx,edi ; ebx=data3(=tmp6+z2+z3)
add eax,ecx ; eax=data1(=tmp7+z1+z4)
pop ecx ; ctr
descale ebx,(CONST_BITS+PASS1_BITS)
descale eax,(CONST_BITS+PASS1_BITS)
mov DCTELEM [COL(3,edx,SIZEOF_DCTELEM)], bx
mov DCTELEM [COL(1,edx,SIZEOF_DCTELEM)], ax
add edx, byte SIZEOF_DCTELEM ; advance pointer to next column
dec ecx
jnz near .columnloop
pop edi
pop esi
; pop edx ; need not be preserved
; pop ecx ; need not be preserved
pop ebx
pop ebp
ret
%endif ; DCT_ISLOW_SUPPORTED
| 28.827988
| 78
| 0.689219
|
ad0f09a7134676bb976300330a1cd6b0ceab7a4e
| 715
|
asm
|
Assembly
|
oeis/253/A253628.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/253/A253628.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/253/A253628.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A253628: Psi(n) mod n, where Psi is the Dedekind psi function (A001615).
; Submitted by Christian Krause
; 0,1,1,2,1,0,1,4,3,8,1,0,1,10,9,8,1,0,1,16,11,14,1,0,5,16,9,20,1,12,1,16,15,20,13,0,1,22,17,32,1,12,1,28,27,26,1,0,7,40,21,32,1,0,17,40,23,32,1,24,1,34,33,32,19,12,1,40,27,4,1,0,1,40,45,44,19,12,1,64,27,44,1,24,23,46,33,56,1,36,21,52,35,50,25,0,1,70,45,80
add $0,1
mov $1,1
mov $6,$0
lpb $0
mov $3,$0
lpb $3
mov $4,$0
mov $7,$2
cmp $7,0
add $2,$7
mod $4,$2
cmp $4,0
cmp $4,0
mov $5,$2
add $2,1
cmp $5,1
max $4,$5
sub $3,$4
lpe
mov $5,1
lpb $0
dif $0,$2
mul $5,$2
lpe
dif $5,$2
mul $1,$5
add $2,1
mul $1,$2
lpe
mod $1,$6
mov $0,$1
| 19.861111
| 256
| 0.532867
|
130455faa52518ff23989db0002ab83185006393
| 1,750
|
asm
|
Assembly
|
dpadinvert.asm
|
Catobat/z3randomizer
|
e82f01ae2f81cfcf2ddd334a93df4a8f953878fb
|
[
"MIT"
] | 2
|
2020-08-09T03:52:55.000Z
|
2020-10-29T23:30:23.000Z
|
dpadinvert.asm
|
Catobat/z3randomizer
|
e82f01ae2f81cfcf2ddd334a93df4a8f953878fb
|
[
"MIT"
] | 1
|
2021-11-01T14:20:30.000Z
|
2021-11-01T14:20:30.000Z
|
dpadinvert.asm
|
Catobat/z3randomizer
|
e82f01ae2f81cfcf2ddd334a93df4a8f953878fb
|
[
"MIT"
] | 7
|
2020-10-17T08:40:52.000Z
|
2022-01-14T01:39:47.000Z
|
;================================================================================
; D-Pad Invert
; runs in NMI, must use minimum possible # of cycles
;--------------------------------------------------------------------------------
; Filtered Joypad 1 Register: [AXLR | ????]
; Filtered Joypad 1 Register: [BYST | udlr] [AXLR | ????]
!INVERT_DPAD = "$7F50CB"
InvertDPad:
LDA !INVERT_DPAD : BNE + : BRL .normal : +
DEC : BEQ .dpadOnly
DEC : BEQ .buttonsOnly
DEC : BEQ .invertBoth
.swapSides
REP #$20 ; set 16-bit accumulator
LDA $4218
BIT.w #$0840 : BEQ + : EOR.w #$0840 : + ; swap X/up
BIT.w #$0180 : BEQ + : EOR.w #$0180 : + ; swap A/right
BIT.w #$4200 : BEQ + : EOR.w #$4200 : + ; swap Y/left
BIT.w #$8400 : BEQ + : EOR.w #$8400 : + ; swap B/down
STA $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.invertBoth
REP #$20 ; set 16-bit accumulator
LDA $4218
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
BIT.w #$0C00 : BEQ + : EOR.w #$0C00 : + ; swap up/down
BIT.w #$0300 : BEQ + : EOR.w #$0300 : + ; swap left/right
STA $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.buttonsOnly
REP #$20 ; set 16-bit accumulator
LDA $4218
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
STA $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.dpadOnly
LDA $4218 : STA $00
LDA $4219
BIT.b #$0C : BEQ + : EOR.b #$0C : + ; swap up/down
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA $01
JML.l InvertDPadReturn
.normal
LDA $4218 : STA $00
LDA $4219 : STA $01
JML.l InvertDPadReturn
;--------------------------------------------------------------------------------
| 33.653846
| 81
| 0.517143
|
6cadd8c52ccadf3ab169d2cf8e6cfb3f6dc66100
| 485
|
asm
|
Assembly
|
04/mult/Mult.asm
|
hsinewu/nand2tetris
|
989ad07649c50aca764863ae5509d31bdb93a085
|
[
"MIT"
] | null | null | null |
04/mult/Mult.asm
|
hsinewu/nand2tetris
|
989ad07649c50aca764863ae5509d31bdb93a085
|
[
"MIT"
] | null | null | null |
04/mult/Mult.asm
|
hsinewu/nand2tetris
|
989ad07649c50aca764863ae5509d31bdb93a085
|
[
"MIT"
] | null | null | null |
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/04/Mult.asm
// Multiplies R0 and R1 and stores the result in R2.
// (R0, R1, R2 refer to RAM[0], RAM[1], and RAM[2], respectively.)
// Put your code here.
// if R0=0
// goto EXIT
// R0--
// R2+=R1
// goto LOOP
@R2
M=0
(LOOP)
@R0
D=M
@EXIT
D; JEQ
@R0
M=M-1
@R1
D=M
@R2
M=M+D
@LOOP
0; JEQ
(EXIT)
@EXIT
0; JEQ
| 14.264706
| 66
| 0.614433
|
2e9da30c7599a4e5261668d5126baff5a3ea71b4
| 44
|
asm
|
Assembly
|
libsrc/fcntl/nc100/_findnext.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/fcntl/nc100/_findnext.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/fcntl/nc100/_findnext.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
PUBLIC _findnext
._findnext
jp 0xB89F
| 8.8
| 19
| 0.727273
|
ed1e65e17891027ec67fed2c076fea742469bc81
| 385
|
asm
|
Assembly
|
programs/oeis/141/A141135.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/141/A141135.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/141/A141135.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A141135: Minimal number of unit edges required to construct n regular pentagons when allowing edge-sharing.
; 5,9,13,17,21,24,28,32,36,39,43,47,50,54,58,61,65,69,72,76,80,83,87,90,94,98,101,105,109,112
mov $2,$0
mov $3,$0
mul $0,2
add $0,$2
trn $0,1
lpb $0
trn $2,$0
trn $0,$2
add $0,$2
sub $0,1
add $1,1
add $2,$1
lpe
add $1,1
lpb $3
add $1,2
sub $3,1
lpe
add $1,4
| 16.73913
| 109
| 0.625974
|
cf8326672e0cec5bc21d1f3266278bfae532fc37
| 488
|
asm
|
Assembly
|
programs/oeis/320/A320065.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/320/A320065.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/320/A320065.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A320065: a(n) is the smallest integer i such that binomial(2i,i) > n.
; 1,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
add $0,1
mul $0,2
trn $0,3
mov $3,3
lpb $0,1
sub $0,1
sub $0,$2
mov $1,$3
add $2,1
mov $3,1
add $3,$1
mul $1,2
sub $0,$1
trn $0,1
sub $3,1
mul $3,2
add $3,$1
mov $1,$2
lpe
add $1,1
| 20.333333
| 207
| 0.514344
|
242e630f7ceab1b3081dc57fb28dc6048cf8ca7a
| 209
|
asm
|
Assembly
|
Lista 1/Lista01 - Q-05.asm
|
AtilaAssuncao/MIPS-AP2
|
51bb07f4edc11c0dad1bda471db8e07b93cee2ad
|
[
"MIT"
] | null | null | null |
Lista 1/Lista01 - Q-05.asm
|
AtilaAssuncao/MIPS-AP2
|
51bb07f4edc11c0dad1bda471db8e07b93cee2ad
|
[
"MIT"
] | null | null | null |
Lista 1/Lista01 - Q-05.asm
|
AtilaAssuncao/MIPS-AP2
|
51bb07f4edc11c0dad1bda471db8e07b93cee2ad
|
[
"MIT"
] | null | null | null |
.data
gasolina: .float 4.20
litros: .float 20.0
msg: .asciiz "Valor a ser pago: "
.text
lwc1 $f1, gasolina
lwc1 $f2, litros
li $v0, 4
la $a0, msg
syscall
li $v0, 2
mul.s $f12, $f1, $f2
syscall
| 13.0625
| 34
| 0.61244
|
24c7c193e1284147fcc27bafb352a7e443720433
| 146
|
asm
|
Assembly
|
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/日本_Ver3/asm/zel_sut2.asm
|
prismotizm/gigaleak
|
d082854866186a05fec4e2fdf1def0199e7f3098
|
[
"MIT"
] | null | null | null |
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/日本_Ver3/asm/zel_sut2.asm
|
prismotizm/gigaleak
|
d082854866186a05fec4e2fdf1def0199e7f3098
|
[
"MIT"
] | null | null | null |
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/日本_Ver3/asm/zel_sut2.asm
|
prismotizm/gigaleak
|
d082854866186a05fec4e2fdf1def0199e7f3098
|
[
"MIT"
] | null | null | null |
Name: zel_sut2.asm
Type: file
Size: 67030
Last-Modified: '2016-05-13T04:36:32Z'
SHA-1: 8C192699ADEF5792559F437FD0000F5D925ACC5C
Description: null
| 20.857143
| 47
| 0.815068
|
537f18755c82ecc3aee4576a7c415a1e4eecead2
| 2,225
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_34_1688.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_34_1688.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_34_1688.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1ba61, %r13
nop
nop
nop
cmp %r9, %r9
mov (%r13), %ebp
add $5699, %r14
lea addresses_WT_ht+0x15c61, %rsi
lea addresses_WT_ht+0x14a21, %rdi
clflush (%rsi)
nop
nop
sub %rbp, %rbp
mov $83, %rcx
rep movsw
nop
nop
nop
nop
cmp %r13, %r13
lea addresses_A_ht+0x14f91, %rbp
nop
and $24313, %r9
and $0xffffffffffffffc0, %rbp
movaps (%rbp), %xmm6
vpextrq $0, %xmm6, %rcx
dec %r14
lea addresses_UC_ht+0x861, %rcx
nop
nop
nop
nop
and %rbp, %rbp
movw $0x6162, (%rcx)
and %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r8
push %r9
push %rcx
// Store
lea addresses_WC+0x3861, %r9
nop
nop
nop
nop
sub %r11, %r11
mov $0x5152535455565758, %r10
movq %r10, %xmm3
vmovups %ymm3, (%r9)
nop
nop
cmp %r11, %r11
// Faulty Load
lea addresses_WC+0x3861, %rcx
clflush (%rcx)
nop
nop
nop
add %r8, %r8
mov (%rcx), %r11
lea oracles, %r8
and $0xff, %r11
shlq $12, %r11
mov (%r8,%r11,1), %r11
pop %rcx
pop %r9
pop %r8
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 6, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': True, 'congruent': 3, 'size': 16, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': False, 'NT': True}}
{'58': 34}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 19.866071
| 149
| 0.646292
|
d220a99fe2ef484d3458b7df8e3c0d1410e4bc8c
| 1,898
|
asm
|
Assembly
|
programs/oeis/047/A047860.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/047/A047860.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/047/A047860.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A047860: a(n) = T(3,n), array T given by A047858.
; 1,5,14,34,78,174,382,830,1790,3838,8190,17406,36862,77822,163838,344062,720894,1507326,3145726,6553598,13631486,28311550,58720254,121634814,251658238,520093694,1073741822,2214592510,4563402750,9395240958,19327352830,39728447486,81604378622,167503724542,343597383678,704374636542,1443109011454,2954937499646,6047313952766,12369505812478,25288767438846,51677046505470,105553116266494,215504279044094,439804651110398,897201488265214,1829587348619262,3729543441416190,7599824371187710,15481123719086078,31525197391593470,64176294690029566,130604389193744382,265712378014859262,540431955284459518,1098878309078401022,2233785415175766014,4539628424389459966,9223372036854775806,18734974449861263358,38046409652025950206,77245740808658747390,156797324626531188734,318206335271489765374,645636042579834306558,1309718829233378164734,2656331146614175432702,5386449269523189071870,10920472491636054556670,22136092888451461939198,44862481587261629530110,90905554795240670363646,184172292831916163334142,373066952146701971881982,755578637259143234191358,1530046740449765049237502,3097872412762487260184574,6271302689250888843788286,12693721105953606334414846,25689673666810869962506238,51983810243429054512365566,105176546306472738199437310,212770944252174734748286974,430377591782807986195398654,870426590122533005788446718,1760195993358900078372192254,3559077612945468290334982142,7195526478346272847851159550,14545795461603218230064709630,29401075933027781528854200318,59421121885698253195157962750,120080183810681886665215049726,242636247699934533880228347902,490224255557010588860053192702,990352031428304219919299379198,2000511103485174524236984745982,4040636288227481217270741467134,8160500738969226772135026884606,16479457802966982219457141669886,33275828255991021789288459141118
add $0,6
mov $1,2
pow $1,$0
mul $1,$0
div $1,128
sub $1,2
mov $0,$1
| 172.545455
| 1,776
| 0.918862
|
61f748d68ce1a2b4afd9265aafdb19d8fc64de77
| 502
|
asm
|
Assembly
|
programs/oeis/103/A103214.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/103/A103214.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/103/A103214.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A103214: a(n) = 24*n + 1.
; 1,25,49,73,97,121,145,169,193,217,241,265,289,313,337,361,385,409,433,457,481,505,529,553,577,601,625,649,673,697,721,745,769,793,817,841,865,889,913,937,961,985,1009,1033,1057,1081,1105,1129,1153,1177,1201,1225,1249,1273,1297,1321,1345,1369,1393,1417,1441,1465,1489,1513,1537,1561,1585,1609,1633,1657,1681,1705,1729,1753,1777,1801,1825,1849,1873,1897,1921,1945,1969,1993,2017,2041,2065,2089,2113,2137,2161,2185,2209,2233,2257,2281,2305,2329,2353,2377
mul $0,24
add $0,1
| 83.666667
| 453
| 0.749004
|
faaf9e2dea9973305f1009006eae312dec657749
| 308
|
nasm
|
Assembly
|
Chapter03/loops/loop-final.nasm
|
firebitsbr/Penetration-Testing-with-Shellcode
|
2d756bccace6b727e050b2010ebf23e08d221fdc
|
[
"MIT"
] | 30
|
2018-05-15T21:45:09.000Z
|
2022-03-23T20:04:25.000Z
|
Chapter03/loops/loop-final.nasm
|
naveenselvan/Penetration-Testing-with-Shellcode
|
2d756bccace6b727e050b2010ebf23e08d221fdc
|
[
"MIT"
] | 1
|
2020-10-19T13:03:32.000Z
|
2020-11-24T05:50:17.000Z
|
Chapter03/loops/loop-final.nasm
|
naveenselvan/Penetration-Testing-with-Shellcode
|
2d756bccace6b727e050b2010ebf23e08d221fdc
|
[
"MIT"
] | 18
|
2018-02-20T21:21:23.000Z
|
2022-01-26T04:19:28.000Z
|
global _start
section .text
_start:
mov rcx, 0x5
increment:
push rcx
mov rax, 1
mov rdi, 1
mov rsi, hello
mov rdx, length
syscall
pop rcx
loop increment
mov rax, 60
mov rdi, 0
syscall
section .data
hello: db 'Hello There!',0xa
length: equ $-hello
| 11.846154
| 32
| 0.597403
|
e31f28eea476eebb09ee9ada500509fa49de747f
| 39,305
|
asm
|
Assembly
|
1-source-files/main-sources/elite-loader2.asm
|
markmoxon/disc-elite-beebasm
|
31e05c330a7cdc60d8aef7664f9425381940dcae
|
[
"Unlicense"
] | 14
|
2021-01-28T19:27:28.000Z
|
2022-01-07T16:36:02.000Z
|
1-source-files/main-sources/elite-loader2.asm
|
markmoxon/disc-elite-beebasm
|
31e05c330a7cdc60d8aef7664f9425381940dcae
|
[
"Unlicense"
] | null | null | null |
1-source-files/main-sources/elite-loader2.asm
|
markmoxon/disc-elite-beebasm
|
31e05c330a7cdc60d8aef7664f9425381940dcae
|
[
"Unlicense"
] | null | null | null |
\ ******************************************************************************
\
\ DISC ELITE LOADER (PART 2) SOURCE
\
\ Elite was written by Ian Bell and David Braben and is copyright Acornsoft 1984
\
\ The code on this site has been disassembled from the version released on Ian
\ Bell's personal website at http://www.elitehomepage.org/
\
\ The commentary is copyright Mark Moxon, and any misunderstandings or mistakes
\ in the documentation are entirely my fault
\
\ The terminology and notations used in this commentary are explained at
\ https://www.bbcelite.com/about_site/terminology_used_in_this_commentary.html
\
\ The deep dive articles referred to in this commentary can be found at
\ https://www.bbcelite.com/deep_dives
\
\ ------------------------------------------------------------------------------
\
\ This source file produces the following binary file:
\
\ * ELITE3.bin
\
\ ******************************************************************************
INCLUDE "1-source-files/main-sources/elite-header.h.asm"
_IB_DISC = (_RELEASE = 1)
_STH_DISC = (_RELEASE = 2)
GUARD &7C00 \ Guard against assembling over screen memory
\ ******************************************************************************
\
\ Configuration variables
\
\ ******************************************************************************
OSNEWL = &FFE7 \ The address for the OSNEWL routine
OSWRCH = &FFEE \ The address for the OSWRCH routine
OSBYTE = &FFF4 \ The address for the OSBYTE routine
OSWORD = &FFF1 \ The address for the OSWORD routine
OSCLI = &FFF7 \ The address for the OSCLI vector
CODE% = &5700
LOAD% = &5700
\ ******************************************************************************
\
\ Name: ZP
\ Type: Workspace
\ Address: &0004 to &0005 and &0070 to &0082
\ Category: Workspaces
\ Summary: Important variables used by the loader
\
\ ******************************************************************************
ORG &0004
.TRTB%
SKIP 2 \ Contains the address of the keyboard translation
\ table, which is used to translate internal key
\ numbers to ASCII
ORG &0070
.S
SKIP 1 \ Temporary storage, used in a number of places
.ZP
SKIP 2 \ Stores addresses used for moving content around
.P
SKIP 1 \ Temporary storage, used in a number of places
.Q
SKIP 1 \ Temporary storage, used in a number of places
.R
SKIP 1 \ Temporary storage, used in a number of places
.T
SKIP 1 \ Temporary storage, used in a number of places
ORG &0081
.SC
SKIP 1 \ Screen address (low byte)
\
\ Elite draws on-screen by poking bytes directly into
\ screen memory, and SC(1 0) is typically set to the
\ address of the character block containing the pixel
\ we want to draw (see the deep dives on "Drawing
\ monochrome pixels in mode 4" and "Drawing colour
\ pixels in mode 5" for more details)
.SCH
SKIP 1 \ Screen address (high byte)
\ ******************************************************************************
\
\ ELITE LOADER
\
\ ******************************************************************************
ORG CODE%
\ ******************************************************************************
\
\ Name: Elite loader (Part 1 of 2)
\ Type: Subroutine
\ Category: Loader
\ Summary: Various copy protection checks, and make sure there is no Tube
\
\ ******************************************************************************
.ENTRY
LDA #0 \ We start by deleting the first loader from memory, so
\ it doesn't leave any clues for the crackers, so set A
\ to 0 so we can zero the memory
TAY \ Set Y to 0 to act as an index in the following loop
.LOOP1
STA &2F00,Y \ Zero the Y-th byte of &2F00, which is where the first
\ loader was running before it loaded this one
INY \ Increment the loop counter
BNE LOOP1 \ Loop back until we have zeroed all 256 bytes from
\ &2F00 to &2FFF, leaving Y = 0
LDA #0 \ Set &3FFF = 0
STA &3FFF
LDA #64 \ Set &7FFF = 64
STA &7FFF
EOR &3FFF \ Set A = 64 EOR &3FFF
\ = 64 EOR 0
\ = 64
CLC \ Set A = A + 64
ADC #64 \ = 64 + 64
\ = 128
PHA \ Push 128 on the stack
TAX \ Set X = 128
LDA #254 \ Call OSBYTE with A = 254, X = 128 and Y = 0 to set
LDY #0 \ the available RAM to 32K
JSR OSBYTE
PLA \ Pull 128 from the stack into A
AND &5973 \ &5973 contains 128, so set A = 128 AND 128 = 128
IF _REMOVE_CHECKSUMS
NOP \ If we have disabled checksums, ignore the result in A
NOP
ELSE
BEQ P% \ If A = 0 then enter an infinite loop, which hangs the
\ computer
ENDIF
JSR PROT1 \ Call PROT1 to display the mode 7 loading screen and
\ perform lots of copy protection
LDA #172 \ Call OSBYTE 172 to read the address of the MOS
LDX #0 \ keyboard translation table into (Y X)
LDY #&FF
JSR OSBYTE
STX TRTB% \ Store the address of the keyboard translation table in
STY TRTB%+1 \ TRTB%(1 0)
LDA #234 \ Call OSBYTE with A = 234, X = 0 and Y = &FF, which
LDX #0 \ detects whether Tube hardware is present, returning
LDY #&FF \ X = 0 (not present) or X = &FF (present)
JSR OSBYTE
CPX #&FF \ If X is not &FF, i.e. we are not running this over the
BNE notube \ Tube, then jump to notube
LDA &5A00 \ &5A00 contains 0, so set A = 0
BEQ P% \ If A = 0 then enter an infinite loop, which hangs the
\ computer
JMP &5A00 \ Otherwise we jump to &5A00, though I have no idea why,
\ as we will only get here if the code has been altered
\ in some way
.notube
LDA MPL \ Set A = &A0, as MPL contains an LDY #0 instruction
NOP \ These bytes appear to be unused
NOP
NOP
JMP MPL \ Jump to MPL to copy 512 bytes to &0400 and jump to
\ ENTRY2
SKIP 8 \ These bytes appear to be unused
NOP
NOP
\ ******************************************************************************
\
\ Name: Elite loader (Part 2 of 2)
\ Type: Subroutine
\ Category: Loader
\ Summary: Load and run the ELITE4 loader
\
\ ******************************************************************************
.ENTRY2
LDA #15 \ Call OSBYTE with A = 15 and Y = 0 to flush the input
LDY #0 \ buffer
JSR OSBYTE
LDX #LO(MESS1) \ Set (Y X) to point to MESS1 ("LOAD Elite4")
LDY #HI(MESS1)
JSR OSCLI \ Call OSCLI to run the OS command in MESS1, which loads
\ the ELITE4 binary to its load address of &1900
LDA #21 \ Call OSBYTE with A = 21 and X = 0 to flush the
LDX #0 \ keyboard buffer
JSR OSBYTE
LDA #201 \ Call OSBYTE with A = 201, X = 1 and Y = 1 to re-enable
LDX #1 \ the keyboard, which we disabled in the first loader
LDY #1
JSR OSBYTE
JMP &197B \ Jump to the start of the ELITE4 loader code at &197B
SKIP 15 \ These bytes appear to be unused
\ ******************************************************************************
\
\ Name: MESS1
\ Type: Variable
\ Category: Loader
\ Summary: The OS command string for loading the ELITE4 loader
\
\ ******************************************************************************
.MESS1
EQUS "LOAD Elite4"
EQUB 13
SKIP 86 \ These bytes appear to be unused
EQUB &32
SKIP 13
\ ******************************************************************************
\
\ Name: MPL
\ Type: Subroutine
\ Category: Utility routines
\ Summary: Move two pages of memory from LOADcode to LOAD and jump to ENTRY2
\
\ ******************************************************************************
.MPL
LDY #0 \ Set Y = 0 to act as a byte counter
LDX #2 \ Set X = 2 to act as a page counter
.MVBL
LDA LOADcode,Y \ Copy the Y-th byte of LOADcode to the Y-th byte of
STA LOAD,Y \ LOAD (this instruction gets modified below, so this is
\ a single-use, self-modifying routine)
INY \ Increment the byte counter
BNE MVBL \ Loop back to MVBL to copy the next byte until we have
\ copied a whole page
INC MVBL+2 \ Increment the high byte of the LDA instruction above,
\ so it now points to the next page
INC MVBL+5 \ Increment the high byte of the STA instruction above,
\ so it now points to the next page
DEX \ Decrement the page counter in X
BNE MVBL \ Loop back to MVBL to copy the next page until we have
\ copied X pages
JMP ENTRY2 \ Jump to ENTRY2 to continue the loading process
\ ******************************************************************************
\
\ Name: LOADcode
\ Type: Subroutine
\ Category: Copy protection
\ Summary: LOAD routine, bundled up in the loader so it can be moved to &0400
\ to be run
\
\ ******************************************************************************
.LOADcode
ORG &0400
\ ******************************************************************************
\
\ Name: LOAD
\ Type: Subroutine
\ Category: Copy protection
\ Summary: This code accesses the disc directly (not used in this version as
\ disc protection is disabled)
\
\ ******************************************************************************
.LOAD
JSR LOAD10
PLA
STA L0509
PLA
STA L050A
PLA
CLC
ADC L0551
STA L0557
PLA
STA L0559
PLA
STA L0558
BEQ LOAD2
.LOAD1
JSR LOAD7
DEC L0558
BNE LOAD1
.LOAD2
LDA L0559
BEQ LOAD3
ORA #&20
STA L0511
JSR LOAD7
.LOAD3
LDA L051A
BEQ LOAD5
LDY #&00
.LOAD4
LDA &0700,Y
STA &1000,Y
INY
BNE LOAD4
.LOAD5
LDX L055B
BEQ LOAD6
LDX #&52
LDY #&05
JSR OSCLI
LDX #&02
.LOAD6
STX &76 \ Store the drive number in &76 for retrieval in ELITE4
LDA #&15
LDX #&00
JSR OSBYTE
LDA #&C9
LDX #&01
LDY #&01
JMP OSBYTE
.LOAD7
JSR LOAD11
LDA #&28
SEC
SBC L0557
STA L0545
STA L050F
LDA #&01
JSR LOAD13
LDA L050A
CMP #&0E
BNE LOAD8
LDA L050F
STA L051A
STA L0525
STA L0530
LDA #&04
JSR LOAD13
LDA #&05
JSR LOAD13
LDA #&06
JSR LOAD13
JMP LOAD9
.LOAD8
LDA #&03
JSR LOAD13
.LOAD9
LDA L053B
STA L0545
LDA #&01
JSR LOAD13
LDA L050A
CLC
ADC #&0A
STA L050A
INC L0557
RTS
.LOAD10
JSR LOAD11
LDA L053B
STA L054E
LDA #&02
JSR LOAD13
RTS
.LOAD11
LDA L0557
LDX L055B
BEQ LOAD12
ASL A
.LOAD12
STA L053B
LDA #&00
.LOAD13
STA R
.LOAD14
LDA R
ASL A
TAX
LDA L04FA,X
LDY L04FA+1,X
TAX
STX P
STY P+1
LDA #127
JSR OSWORD
LDA R
CMP #&03
BCC LOAD15
LDY #&0A
LDA (P),Y
AND #&DF
BNE LOAD14
.LOAD15
RTS
.L04FA
EQUB &34
EQUB &05, &3D, &05, &47, &05, &08, &05, &13
EQUB &05, &1E, &05, &29, &05, &FF
.L0509
EQUB &00
.L050A
EQUB &0A
EQUB &FF, &FF, &03, &57
.L050F
EQUB &00, &F6
.L0511
EQUB &2A, &00
EQUB &FF, &00, &0E, &FF, &FF, &03, &57
.L051A
EQUB &00
EQUB &F6, &22, &00, &FF, &00, &07, &FF, &FF
EQUB &03, &57
.L0525
EQUB &00, &F8, &21, &00, &FF, &00
EQUB &11, &FF, &FF, &03, &57
.L0530
EQUB &00, &F9, &27
EQUB &00, &FF, &FF, &FF, &FF, &FF, &01, &69
.L053B
EQUB &00, &00, &FF, &FF, &FF, &FF, &FF, &02
EQUB &7A, &12
.L0545
EQUB &00, &00, &FF, &00, &07, &FF
EQUB &FF, &03, &5B
.L054E
EQUB &00, &00, &0A
.L0551
EQUB &00, &44
EQUB &52, &2E, &32, &0D
.L0557
EQUB &03
.L0558
EQUB &00
.L0559
EQUB &00
EQUB &80 \ This is location &5973, as referenced by part 1
.L055B
EQUB &FF, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00 \ This is location &5A00, as referenced by part 1
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &00, &00
COPYBLOCK LOAD, P%, LOADcode
ORG LOADcode + P% - LOAD
SKIP 487 \ These bytes appear to be unused
\ ******************************************************************************
\
\ Name: ECHAR
\ Type: Variable
\ Category: Loader
\ Summary: Character definitions for the Electron to mimic the graphics
\ characters of the BBC Micro's mode 7 teletext screen
\
\ ******************************************************************************
.ECHAR
EQUB &00, &00, &00, &00, &00, &00, &00, &00
EQUB &E0, &E0, &00, &00, &00, &00, &00, &00
EQUB &0E, &0E, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &0E, &0E
EQUB &E0, &E0, &00, &E0, &E0, &00, &00, &00
EQUB &EE, &EE, &00, &E0, &E0, &00, &00, &00
EQUB &EE, &EE, &00, &0E, &0E, &00, &00, &00
EQUB &00, &00, &00, &00, &00, &00, &E0, &E0
EQUB &E0, &E0, &00, &00, &00, &00, &E0, &E0
EQUB &00, &00, &00, &E0, &E0, &00, &E0, &E0
EQUB &E0, &E0, &00, &E0, &E0, &00, &E0, &E0
EQUB &EE, &EE, &00, &E0, &E0, &00, &E0, &E0
EQUB &EE, &EE, &00, &EE, &EE, &00, &E0, &E0
EQUB &EE, &EE, &00, &00, &00, &00, &00, &00
EQUB &00, &00, &00, &0E, &0E, &00, &0E, &0E
EQUB &0E, &0E, &00, &0E, &0E, &00, &0E, &0E
EQUB &EE, &EE, &00, &0E, &0E, &00, &0E, &0E
EQUB &EE, &EE, &00, &EE, &EE, &00, &0E, &0E
EQUB &00, &00, &00, &00, &00, &00, &EE, &EE
EQUB &EE, &EE, &00, &00, &00, &00, &EE, &EE
EQUB &00, &00, &00, &E0, &E0, &00, &EE, &EE
EQUB &E0, &E0, &00, &E0, &E0, &00, &EE, &EE
EQUB &00, &00, &00, &0E, &0E, &00, &EE, &EE
EQUB &0E, &0E, &00, &0E, &0E, &00, &EE, &EE
EQUB &00, &00, &00, &EE, &EE, &00, &EE, &EE
EQUB &E0, &E0, &00, &EE, &EE, &00, &EE, &EE
EQUB &0E, &0E, &00, &EE, &EE, &00, &EE, &EE
EQUB &EE, &EE, &00, &EE, &EE, &00, &EE, &EE
\ ******************************************************************************
\
\ Name: LOGO
\ Type: Variable
\ Category: Loader
\ Summary: Tables containing the Acornsoft logo for the BBC Micro and Acorn
\ Electron
\
\ ******************************************************************************
.LOGO
EQUB &A0, &A1 \ For the BBC Micro, the tables below consist of offsets
EQUB &A2, &E0 \ into this top table, so the first three characters of
EQUB &A5, &A7 \ the Acornsoft logo are &A0 (the &00-th entry in this
EQUB &AB, &B0 \ table), then &FC (the &18-th entry in this table),
EQUB &B1, &B4 \ then &B4 (the &09-th entry in this table) and so on
EQUB &B5, &B7 \
EQUB &BF, &A3 \ The Electron ignores this top table and just uses the
EQUB &E8, &EA \ values below, adding &E0 to get the number of the
EQUB &EB, &EF \ relevant user-defined character (so the first three
EQUB &F0, &F3 \ characters are &E0, then &F8, then &E9 and so on)
EQUB &F4, &F5 \
EQUB &F8, &FA \ The Acornsoft logo is made up of 5 rows with 38
EQUB &FC, &FD \ graphics characters on each row, which corresponds
EQUB &FE, &FF \ with the tables below
EQUB &00, &00, &00, &18, &09, &03, &18, &18
EQUB &07, &00, &16, &18, &14, &00, &18, &18
EQUB &18, &07, &0E, &14, &00, &0E, &09, &16
EQUB &18, &18, &07, &00, &1A, &1B, &09, &00
EQUB &18, &18, &18, &18, &18, &18
EQUB &00, &00, &17, &1B, &0A, &1B, &05, &06
EQUB &1B, &0F, &0C, &0D, &11, &0A, &1B, &0D
EQUB &10, &0A, &0F, &1B, &09, &0F, &0A, &1B
EQUB &08, &06, &04, &0F, &1B, &1B, &1B, &00
EQUB &1B, &0D, &0D, &0D, &1B, &0D
EQUB &00, &0E, &0C, &10, &0A, &1B, &00, &00
EQUB &00, &0F, &0A, &00, &0F, &0A, &1B, &18
EQUB &1A, &04, &0F, &0C, &1B, &17, &0A, &06
EQUB &1B, &19, &07, &1B, &1B, &1B, &1B, &0A
EQUB &1B, &1B, &1B, &00, &1B, &00
EQUB &03, &1B, &19, &1A, &0A, &1B, &07, &03
EQUB &18, &0F, &15, &00, &17, &0A, &1B, &06
EQUB &19, &00, &0F, &0A, &10, &1B, &0A, &12
EQUB &00, &10, &1B, &13, &13, &13, &13, &08
EQUB &1B, &00, &00, &00, &1B, &00
EQUB &1A, &0B, &00, &0F, &0A, &06, &1B, &1B
EQUB &05, &02, &11, &1B, &0C, &01, &1B, &00
EQUB &10, &15, &0F, &0A, &00, &11, &0A, &11
EQUB &1B, &1B, &04, &11, &1B, &1B, &1B, &04
EQUB &1B, &00, &00, &00, &1B, &00
SKIP 28 \ These bytes appear to be unused
EQUB &02, &0D
SKIP 8
\ ******************************************************************************
\
\ Name: PROT1
\ Type: Subroutine
\ Category: Loader
\ Summary: Various copy protection shenanigans in preparation for showing
\ the Acornspft loading screen
\
\ ******************************************************************************
.PROT1
LDA #&68 \ Poke the following routine into &0100 to &0108:
STA &0100 \
STA &0103 \ 0100 : &68 PLA
LDA #&85 \ 0101 : &85 &71 STA ZP
STA &0101 \ 0103 : &68 PLA
STA &0104 \ 0104 : &85 &72 STA ZP+1
LDX #&71 \ 0106 : &6C &71 &00 JMP (ZP)
STX &0107 \
STX &0102 \ This routine pulls an address off the stack into a
INX \ location in zero page, and then jumps to that address
STX &0105
LDA #&6C
STA &0106
LDA #&00
STA &0108
.do
JSR &0100 \ Call the subroutine at &0100, which does the
EQUB 0 \ following:
\
\ * The JSR puts the address of the last byte of the
\ JSR instruction on the stack (i.e. the address of
\ the &01), pushing the high byte first
\
\ * It then jumps to &0100, which pulls the address
\ off the stack and puts it in ZP(1 0)
\
\ * The final instruction of the routine at &0100
\ jumps to the address in ZP(1 0), i.e. it jumps to
\ the &01 of the JSR instruction. The &01 byte is
\ followed by a &00 byte, and &01 &00 is the opcode
\ for ORA (&00,X), which doesn't do anything apart
\ from affect the value of the accumulator
\
\ In other words, this whole routine is a complicated
\ way of pointing ZP(1 0) to the &01 byte in the JSR
\ instruction above, i.e. to do + 2
LDA ZP \ Set ZP(1 0) = ZP(1 0) - (2 + do - PROT1)
SEC \ = do + 2 - 2 - do + PROT1
SBC #(2 + do - PROT1) \ = PROT1
STA ZP
LDA ZP+1
SBC #&00
STA ZP+1
LDY #(TABLE - PROT1) \ We're now going to loop through the words in TABLE, so
\ set Y as an index we can add to PROT1 (i.e. ZP) to
\ reach TABLE
.PROT1a
LDA (ZP),Y \ Set SC(1 0) = ZP(1 0) + Y-th word from TABLE
CLC \
ADC ZP \ so, for example, the first entry in TABLE does this:
STA SC \
INY \ SC(1 0) = ZP + first word from TABLE
LDA (ZP),Y \ = PROT1 + jsr1 + 1 - PROT1
ADC ZP+1 \ = jsr1 + 1
STA SC+1 \
\ which is the address of the destination adress in the
\ JSR instruction at jsr1
LDX #0 \ Add ZP(1 0), i.e. PROT1, to the word at SC(1 0),
LDA (SC,X) \ starting with the low bytes
CLC
ADC ZP
STA (SC,X)
INC SC \ And then adding the high bytes
BNE P%+4 \
INC SC+1 \ So, for example, the first entry in TABLE modifies the
LDA (SC,X) \ destination address of the JSR at jsr1 by adding PROT1
ADC ZP+1 \ to it, so the address now points to prstr
STA (SC,X)
INY \ Increment Y to point to the next word in TABLE
CPY #&7D \ Loop until we have done them all
BNE PROT1a
BEQ LOADSCR \ Jump to LOADSCR (this BEQ is effectively a JMP as we
\ didn't take the BNE branch)
.TABLE
EQUW jsr1 + 1 - PROT1 \ Offsets within PROT1 of JSR destination addresses that
EQUW jsr2 + 1 - PROT1 \ we modify with the code above
EQUW jsr3 + 1 - PROT1
EQUW jsr4 + 1 - PROT1
EQUW jsr5 + 1 - PROT1
EQUW jsr6 + 1 - PROT1
SKIP 14 \ These bytes appear to be unused
\ ******************************************************************************
\
\ Name: LOADSCR
\ Type: Subroutine
\ Category: Loader
\ Summary: Show the mode 7 Acornsoft loading screen
\
\ ******************************************************************************
.LOADSCR
LDA ZP \ Set ZP(1 0) = ZP(1 0) - (PROT1 - ECHAR)
SEC \ = PROT1 - PROT1 + ECHAR
SBC #LO(PROT1 - ECHAR) \ = ECHAR
STA ZP
LDA ZP+1
SBC #HI(PROT1 - ECHAR)
STA ZP+1
LDX #0 \ Set S = 0, to use as a flag denoting whether this is a
STX S \ BBC Micro (0) or an Electron (&FF)
LDY #&FF \ Call OSBYTE with A = 129, X = 0 and Y = &FF to detect
LDA #129 \ the machine type. This call is undocumented and is not
JSR OSBYTE \ the recommended way to determine the machine type
\ (OSBYTE 0 is the correct way), but this call returns
\ the following:
\
\ * X = Y = 0 if this is a BBC Micro with MOS 0.1
\ * X = Y = 1 if this is an Electron
\ * X = Y = &FF if this is a BBC Micro with MOS 1.20
CPX #1 \ If X is not 1, then this is not an Electron, so jump
BNE bbc \ to bbc
DEC S \ Decrement S to &FF, to denote that this is an Acorn
\ Electron
\ We now define a character set consisting of "fake"
\ mode 7 graphics characters so the Electron can print
\ its own version of the Acornsoft loading screen
\ despite not having the BBC Micro's teletext mode 7
\
\ The comand to define a character is as follows:
\
\ VDU 23, n, b0, b1, b2, b3, b4, b5, b6, b7
\
\ where n is the character number and b0 through b7 are
\ the bytes for each pixel row in the character (there
\ are 8 rows of 8 pixels in a character)
\
\ So in the following, we perform the above command
\ for each character using the values from the ECHAR
\ table
LDY #0 \ Set Y to act as an index into the table at ECHAR
.eloop
LDX #7 \ Set a counter in X for the 8 bytes we need to print
\ from the table for each character definition (one byte
\ per pixel row)
LDA #23 \ Print character 23 (i.e. VDU 23)
JSR OSWRCH
TYA \ We will increase Y by 8 for each character, so this
LSR A \ sets A = Y / 8 to give the character number, starting
LSR A \ from 0 and counting up by 1 for each new character
LSR A
ORA #&E0 \ This adds &E0 to A, so our new character set starts
\ with character number &E0, then character number &E1,
\ and so on
JSR OSWRCH \ Print the character number (so we have now done the
\ VDU 23, n part of the command)
.vloop
LDA (ZP),Y \ Print the Y-th byte from the ECHAR table (we set ZP to
JSR OSWRCH \ point to ECHAR above)
INY \ Increment the index to point to the next byte in the
\ table
DEX \ Decrement the byte counter
BPL vloop \ Loop back until we have printed 8 characters
CPY #224 \ Loop back to do the next VDU 23 command until we have
BNE eloop \ printed out the whole table
.bbc
\ We now print the Acornsoft loading screen background
\ using mode 7 graphics (for the BBC Micro) or the
\ "fake" characters we just defined (for the Electron
\ version)
LDA ZP \ Set ZP(1 0) = ZP(1 0) + LOGO - ECHAR
CLC \ = ECHAR + LOGO - ECHAR
ADC #(LOGO - ECHAR) \ = LOGO
STA ZP
BCC P%+4
INC ZP+1
LDA #22 \ Switch to mode 7 using a VDU 22, 7 command
JSR OSWRCH
LDA #7
JSR OSWRCH
.jsr1
JSR prstr - PROT1 \ Call prstr to print the following characters,
\ restarting from the NOP instruction (this destination
\ address is modified by the code above that adds PROT1
\ to the address)
EQUB 23, 0, 10, 32 \ Set 6845 register R10 = 32
EQUB 0, 0, 0 \
EQUB 0, 0, 0 \ This is the "cursor start" register, which sets the
\ cursor start line at 0, so it turns the cursor off
NOP \ Marks the end of the VDU block
LDA #145 \ Set T to teletext control code 145 (Red graphics) to
STA T \ specify that the first Acornsoft is red
.jsr2
JSR jsr5 - PROT1 \ Call jsr5, which calls jsr6, which calls LOGOS (this
\ destination address is modified by the code above that
\ adds PROT1 to the address)
BIT S \ If bit 7 of S is set (this is an Electron), jump to
BMI jsr4 \ jsr4
.jsr3
\ If we get here then this is a BBC Micro, so we can
\ show the game's name in the mode 7 screen
JSR prstr - PROT1 \ Call prstr to print the following characters,
\ restarting from the NOP instruction (this destination
\ address is modified by the code above that adds PROT1
\ to the address)
EQUB 28 \ Define a text window as follows:
EQUB 13, 13, 25, 10 \
\ * Left = 13
\ * Right = 25
\ * Top = 10
\ * Bottom = 13
\
\ i.e. 3 rows high, 12 columns wide at (13, 10)
EQUB 12 \ Clear the text area
EQUB 10 \ Move the cursor down one row
EQUB 135 \ Teletext control code 135 (Select white text)
EQUB 141 \ Teletext control code 141 (Double height)
EQUS "E L I T E" \ The top half of the game's name
EQUB 140 \ Teletext control code 140 (Turn off double height)
EQUB 146 \ Teletext control code 146 (Select green graphics)
EQUB 135 \ Teletext control code 135 (Select white text)
EQUB 141 \ Teletext control code 141 (Double height)
EQUS "E L I T E" \ The top half of the game's name
NOP \ Marks the end of the VDU block
RTS \ Return from the PROT1 subroutine
EQUS " " \ These bytes appear to be unused
EQUB 140, 146
EQUB 135, 141
EQUS " "
EQUS " "
EQUS " "
EQUS " "
EQUS " "
NOP
RTS
.jsr4
\ If we get here then this is an Electron
JSR prstr - PROT1 \ Call prstr to print the following characters,
\ restarting from the NOP instruction (this destination
\ address is modified by the code above that adds PROT1
\ to the address)
EQUB 28 \ Define a text window as follows:
EQUB 13, 12, 25, 10 \
\ * Left = 13
\ * Right = 25
\ * Top = 10
\ * Bottom = 12
\
\ i.e. 2 rows high, 12 columns wide at (13, 10)
EQUB 12 \ Clear the text area
EQUB 26 \ Restore default windows
EQUB 31, 15, 11 \ Move text cursor to 15, 11
EQUS "E L I T E" \ The name of the game
NOP \ Marks the end of the VDU block
RTS \ Return from the PROT1 subroutine
EQUS " " \ These bytes appear to be unused
EQUS " "
NOP
RTS
.jsr5
JSR jsr6 - PROT1 \ Call jsr6 (this destination address is modified by the
\ code above that adds PROT1 to the address). This calls
\ the LOGOS routine twice to print two Acornsoft logos,
\ with a newline between then
JSR OSNEWL \ Print two newlines
JSR OSNEWL
.jsr6
JSR LOGOS - PROT1 \ Call LOGOS (this destination address is modified by
\ the code above that adds PROT1 to the address). This
\ prints a third Acornsoft logo
JSR OSNEWL \ Print a newline
\ Fall through into LOGOS to print a fourth Acornsoft
\ logo and return from the subroutine using a tail call
\ ******************************************************************************
\
\ Name: LOGOS
\ Type: Subroutine
\ Category: Loader
\ Summary: Print a large Acornsoft logo as part of the loading screen
\
\ ------------------------------------------------------------------------------
\
\ Arguments:
\
\ T The logo colour as a teletext control code for graphics
\ colour
\
\ ZP(1 0) The address of the Acornsoft logo character table at
\ LOGO
\
\ ******************************************************************************
.LOGOS
LDY #28 \ Set Y = 28 as an index to the first row of logo
\ characters in the table at LOGO, after the 28 bytes of
\ lookup data in the first part of the table
.aloop
LDX #38 \ Each row of the Acornsoft logo consists of 38 teletext
\ graphics characters, so set a counter in X to count
\ through the characters
BIT S \ If bit 7 of S is set (this is an Electron), jump to
BMI eskip1 \ eskip1 to skip the teletext colour codes (as the
\ Electron loading screen is monochrome)
LDA T \ Print the character in T, which starts with teletext
JSR OSWRCH \ control code 145 (Red graphics) and increments through
\ the colours, so this sets the correct colour for the
\ current Acornsoft logo
LDA #154 \ Print teletext control code 154 (Separated graphics)
JSR OSWRCH
CLC \ Skip the next two instructions
BCC P%+7
.eskip1
LDA #' ' \ Print a space (on the Electron only)
JSR OSWRCH
.cloop
LDA (ZP),Y \ Fetch the Y-th character from ZP into A, so A contains
\ the next byte from LOGO, which is the user-defined
\ character we want to print (in the case of the
\ Electron), or the index into the first section of the
\ LOGO table for the teletext graphics character we want
\ to print (in the case of the BBC Micro)
BIT S \ If bit 7 of S is set (this is an Electron), jump to
BMI eskip2 \ eskip2
STY P \ Store Y so we can retrieve it below
TAY \ This is a BBC Micro, so the number in A is the index
LDA (ZP),Y \ into the first section of the LOGO table for the
\ teletext graphics character we want to print, so we
\ now fetch that character
LDY P \ Retrieve the value of Y we stored above
BNE P%+4 \ Skip the next instruction (this BNE is effectively a
\ JMP as Y is never zero)
.eskip2
ORA #&E0 \ Add &E0 to the character number (on the Electron only)
JSR OSWRCH \ Print the character in A
INY \ Increment Y to point to the next byte in the table
CPY #255 \ If Y = 255 then we are done printing all 5 rows of the
BEQ adone \ logo, so jump to adone to finish off
DEX \ Otherwise decrement the character counter in X
BNE cloop \ Loop back to print the next character until we have
\ done all 38 in this row
BIT S \ If bit 7 of S is clear (this is a BBC Micro), skip the
BPL P%+7 \ next two instructions
LDA #' ' \ Print a space (on the Electron only)
JSR OSWRCH
CLC \ Jump back to aloop to print the next row in the logo
BCC aloop
.adone
INC T \ Increment the colour in T, which started with teletext
\ control code 145 (Red graphics) and increments through
\ 146 (green), 147 (yellow) and 148 (blue) with each new
\ call to the LOGOS routine
RTS \ Return from the subroutine
\ ******************************************************************************
\
\ Name: prstr
\ Type: Subroutine
\ Category: Loader
\ Summary: Print the NOP-terminated string immediately following the JSR
\ instruction that called the routine
\
\ ******************************************************************************
.prstr
PLA \ We call prstr with a JSR, so pull the return address
STA Q \ off the stack into Q(1 0), which actually points to
PLA \ the last byte of the JSR prstr instruction
STA Q+1
.p1
INC Q \ Increment Q(1 0) to point to the next byte (so the
BNE P%+4 \ first time we call prstr, Q points to the first byte
INC Q+1 \ of the string we want to print)
LDY #0 \ Fetch the byte at Q(1 0) into A
LDA (Q),Y
CMP #&EA \ If we just fetched a NOP instruction (opcode &EA),
BEQ p2 \ then we have reached the end of the string, so jump to
\ p2 to return from the subroutine
JSR OSWRCH \ Print the byte we just fetched
CLC \ Loop back to p1 to fetch the next byte to print
BCC p1
.p2
JMP (Q) \ Jump to the address in Q(1 0) - i.e. to the NOP that
\ we just fetched, so execution continues from the end
\ of the string we just printed
\ ******************************************************************************
\
\ Name: Unused copy protection routine
\ Type: Subroutine
\ Category: Copy protection
\ Summary: This code doesn't appear to be run in this version
\
\ ******************************************************************************
SKIP 76 \ These bytes appear to be unused
EQUB &FF
SKIP 255
BNE LABEL1
LDA &50
CMP &4E
.LABEL1
BNE LABEL2
LDA #&00
STA &4E
LDA #&00
STA &4F
JMP &4953
.LABEL2
BIT &495C
BPL LABEL3
RTS
.LABEL3
LDA &4F
BNE LABEL4
JSR &4BBA
.LABEL4
LDA &4D
BNE LABEL5
JSR &4BC3
LDA #&00
STA &4E
LDA #&00
STA &4F
JMP &4953
.LABEL5
LDA &4D
CMP &4F
BCC LABEL6
BNE LABEL6
LDA &4C
CMP &4E
.LABEL6
BCC LABEL7
LDA &4C
STA &12
LDA &4D
STA &13
JSR &4BC3
LDA &12
STA &4E
LDA &13
STA &4F
.LABEL7
BIT &495C
BMI LABEL8
JSR &373D
.LABEL8
RTS
SKIP 1
.LABEL9
LDA &4F
BEQ LABEL11
LDA &4F
CMP &51
BCC LABEL10
BNE LABEL10
LDA &4E
CMP &50
.LABEL10
BCS LABEL11
JMP &49D6
.LABEL11
LDA &4D
BEQ LABEL13
LDA &4D
CMP &51
BCC LABEL12
BNE LABEL12
LDA &4C
CMP &50
.LABEL12
BCS LABEL13
JMP &499C
.LABEL13
RTS
LDA &4D
BEQ LABEL18
LDA &4D
CMP &51
BCC LABEL14
BNE LABEL14
LDA &4C
CMP &50
.LABEL14
BEQ LABEL18
BCC LABEL18
BIT &0AC1
BEQ LABEL17
LDA &4F
CMP &51
BCC LABEL15
BNE LABEL15
LDA &4E
CMP &50
.LABEL15
BEQ LABEL16
LDA &50
STA &4C
LDA &51
STA &4D
JSR &373D
.LABEL16
RTS
.LABEL17
JSR &4BCC
JSR &373D
RTS
.LABEL18
LDA &4F
BEQ LABEL23
LDA &4F
CMP &51
BCC LABEL19
BNE LABEL19
LDA &4E
CMP &50
.LABEL19
BEQ LABEL23
BCC LABEL23
BIT &0AC1
BEQ LABEL22
LDA &4D
CMP &51
BCC LABEL20
BNE LABEL20
LDA &4C
CMP &50
.LABEL20
BEQ LABEL21
JSR &4BBA
JSR &373D
.LABEL21
RTS
.LABEL22
LDA &4E
STA &50
LDA &4F
STA &51
JSR &373D
.LABEL23
RTS
LDA &44
STA &4C
\ ******************************************************************************
\
\ Save ELITE2.bin
\
\ ******************************************************************************
PRINT "S.ELITE3 ", ~CODE%, " ", ~P%, " ", ~LOAD%, " ", ~LOAD%
SAVE "3-assembled-output/ELITE3.bin", CODE%, P%, LOAD%
| 26.379195
| 80
| 0.483577
|
6b549e2a15e01423134eac977bb2fe2d48824151
| 1,485
|
asm
|
Assembly
|
programs/oeis/060/A060995.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/060/A060995.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/060/A060995.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A060995: Number of routes of length 2n on the sides of an octagon from a point to opposite point.
; 0,2,8,28,96,328,1120,3824,13056,44576,152192,519616,1774080,6057088,20680192,70606592,241065984,823050752,2810071040,9594182656,32756588544,111837988864,381838778368,1303679135744,4451038986240,15196797673472,51885112721408,177146855538688,604817196711936,2064975075770368,7050265909657600,24071113487089664,82183922129043456,280593461541994496,958006001909891072,3270837084555575296,11167336334402519040,38127671168498925568,130176012005190664192,444448705683764805632,1517442798724677894144,5180873783531181965312,17688609536675372072960,60392690579639124361216,206193543245205753298944,703988791821544764473344,2403568080795767551295488,8206294739539980676235264,28018042796568387602350080,95659581707193589056929792,326602241235637581023019008,1115089801528163145978216448,3807154723641377421866827776,12998439291509183395510878208,44379447718753978738309857280,151520912291997548162217672704,517324753730482235172250976256,1766257190337933844364568559616,6030379253890770907113772285952,20589002634887215939725952024576,70295252031767321944676263526400,240003002857294855899253150056448,819421507365644779707660073172992,2797680023747989407032133992579072,9551877080260668068713215823970304,32612148273546693460788595310723072,111344838933665437705727949594951680,380155059187568363901334607758360576
mov $2,1
lpb $0
sub $0,1
add $1,$2
add $2,$1
mul $1,2
lpe
mov $0,$1
| 123.75
| 1,307
| 0.910438
|
3d56cae5cd17326ae1a879e9f1c6ce13d596a2cd
| 367
|
asm
|
Assembly
|
programs/oeis/070/A070426.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/070/A070426.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/070/A070426.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A070426: a(n) = 7^n mod 44.
; 1,7,5,35,25,43,37,39,9,19,1,7,5,35,25,43,37,39,9,19,1,7,5,35,25,43,37,39,9,19,1,7,5,35,25,43,37,39,9,19,1,7,5,35,25,43,37,39,9,19,1,7,5,35,25,43,37,39,9,19,1,7,5,35,25,43,37,39,9,19,1,7,5,35,25,43,37,39,9,19,1,7,5,35,25,43,37,39,9,19,1,7,5,35,25,43,37,39,9,19
mov $1,1
mov $2,$0
lpb $2
mul $1,7
mod $1,44
sub $2,1
lpe
mov $0,$1
| 30.583333
| 261
| 0.583106
|
4452acc944909e22551a3d8c948ba15eeea5d29b
| 6,923
|
asm
|
Assembly
|
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0xca_notsx.log_21829_958.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0xca_notsx.log_21829_958.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0xca_notsx.log_21829_958.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 %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x11637, %rsi
lea addresses_WC_ht+0x72f7, %rdi
nop
nop
nop
nop
add %rax, %rax
mov $48, %rcx
rep movsl
nop
nop
nop
nop
and %r11, %r11
lea addresses_UC_ht+0x1c247, %rsi
lea addresses_WC_ht+0x730f, %rdi
nop
lfence
mov $17, %rcx
rep movsl
nop
nop
nop
dec %rax
lea addresses_A_ht+0x13dd7, %rsi
lea addresses_normal_ht+0xdf37, %rdi
clflush (%rsi)
xor $36906, %r15
mov $105, %rcx
rep movsq
nop
nop
and %rax, %rax
lea addresses_UC_ht+0x1d0b7, %rsi
lea addresses_UC_ht+0x16b37, %rdi
and %rax, %rax
mov $119, %rcx
rep movsb
nop
nop
nop
nop
nop
dec %rsi
lea addresses_WC_ht+0x1e2f7, %rcx
nop
nop
nop
nop
nop
add %rbx, %rbx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
vmovups %ymm6, (%rcx)
nop
nop
add $21093, %rsi
lea addresses_WT_ht+0x9337, %rsi
lea addresses_D_ht+0x1ddd7, %rdi
add $12702, %r15
mov $12, %rcx
rep movsw
nop
nop
nop
nop
add $54421, %r15
lea addresses_A_ht+0x17217, %rsi
nop
nop
nop
nop
sub %r11, %r11
mov $0x6162636465666768, %rbx
movq %rbx, %xmm0
vmovups %ymm0, (%rsi)
nop
nop
nop
nop
nop
inc %rcx
lea addresses_WT_ht+0xfddf, %rsi
nop
nop
inc %rax
and $0xffffffffffffffc0, %rsi
movntdqa (%rsi), %xmm0
vpextrq $0, %xmm0, %rdi
nop
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0x227, %rdi
nop
nop
nop
nop
cmp %rsi, %rsi
movl $0x61626364, (%rdi)
nop
nop
nop
nop
sub $19960, %r11
lea addresses_normal_ht+0x1d537, %rdi
nop
nop
nop
sub %rsi, %rsi
mov $0x6162636465666768, %rbx
movq %rbx, (%rdi)
sub %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r8
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
// Store
lea addresses_UC+0x7633, %rbx
clflush (%rbx)
nop
sub %rbp, %rbp
movl $0x51525354, (%rbx)
nop
nop
nop
nop
add $64238, %r10
// Faulty Load
mov $0x2f0f3e0000000737, %r8
nop
nop
nop
nop
add $17431, %rax
mov (%r8), %cx
lea oracles, %r8
and $0xff, %rcx
shlq $12, %rcx
mov (%r8,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 2, 'NT': False, 'type': 'addresses_UC', 'size': 4, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 3, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 2, 'NT': True, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': 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.964646
| 2,999
| 0.662574
|
fae76f520ad20cd43040648756bb396d89a020c4
| 424
|
asm
|
Assembly
|
projects/project08/src/translations/return.asm
|
lemmingapex/ElementsOfComputingSystems
|
649c19676141a92ffec4f52b28388ad59048ee04
|
[
"MIT"
] | 15
|
2015-05-03T10:35:44.000Z
|
2021-07-21T08:59:03.000Z
|
projects/project08/src/translations/return.asm
|
jigth/ElementsOfComputingSystems
|
649c19676141a92ffec4f52b28388ad59048ee04
|
[
"MIT"
] | null | null | null |
projects/project08/src/translations/return.asm
|
jigth/ElementsOfComputingSystems
|
649c19676141a92ffec4f52b28388ad59048ee04
|
[
"MIT"
] | 9
|
2017-02-18T02:29:20.000Z
|
2021-11-29T22:49:58.000Z
|
// return
@LCL
D=M
@R13
M=D // R13 = FRAME = *LCL
@R13
D=M
@5
A=D-A
D=M
@R14
M=D // store return address in R14
@SP
A=M-1
D=M
@ARG
A=M
M=D // *ARG = pop()
@ARG
D=M
@SP
M=D+1 // SP = ARG + 1
@R13
AM=M-1
D=M
@THAT
M=D // THAT = FRAME - 1
@R13
AM=M-1
D=M
@THIS
M=D // THIS = FRAME - 2
@R13
AM=M-1
D=M
@ARG
M=D // ARG = FRAME - 3
@R13
AM=M-1
D=M
@LCL
M=D // LCL = FRAME - 4
@R14
A=M // A = RET = R14
// GOTO RET
0;JMP
| 7.438596
| 34
| 0.521226
|
61515f191d699d1f0754ef8c2633b8cded8723c0
| 151
|
asm
|
Assembly
|
src/firmware-tests/Platform/Clock/PollAfterClockDummy.asm
|
pete-restall/Cluck2Sesame-Prototype
|
99119b6748847a7b6aeadc4bee42cbed726f7fdc
|
[
"MIT"
] | 1
|
2019-12-12T09:07:08.000Z
|
2019-12-12T09:07:08.000Z
|
src/firmware-tests/Platform/Clock/PollAfterClockDummy.asm
|
pete-restall/Cluck2Sesame-Prototype
|
99119b6748847a7b6aeadc4bee42cbed726f7fdc
|
[
"MIT"
] | null | null | null |
src/firmware-tests/Platform/Clock/PollAfterClockDummy.asm
|
pete-restall/Cluck2Sesame-Prototype
|
99119b6748847a7b6aeadc4bee42cbed726f7fdc
|
[
"MIT"
] | null | null | null |
#include "Platform.inc"
#include "PollChain.inc"
radix decimal
PollAfterClockDummy code
global POLL_AFTER_CLOCK
POLL_AFTER_CLOCK:
return
end
| 11.615385
| 25
| 0.788079
|
4c6f587be9af4230363614a7d410fa8028b3c7ff
| 420
|
asm
|
Assembly
|
src/third_party/nasm/rdoff/test/rdfseg.asm
|
Mr-Sheep/naiveproxy
|
9f6e9768295f6d1d41517a15a621d4756bd7d6be
|
[
"BSD-3-Clause"
] | 2,219
|
2018-03-26T02:57:34.000Z
|
2022-03-31T00:27:59.000Z
|
src/third_party/nasm/rdoff/test/rdfseg.asm
|
Mr-Sheep/naiveproxy
|
9f6e9768295f6d1d41517a15a621d4756bd7d6be
|
[
"BSD-3-Clause"
] | 395
|
2020-04-18T08:22:18.000Z
|
2021-12-08T13:04:49.000Z
|
src/third_party/nasm/rdoff/test/rdfseg.asm
|
Mr-Sheep/naiveproxy
|
9f6e9768295f6d1d41517a15a621d4756bd7d6be
|
[
"BSD-3-Clause"
] | 473
|
2019-03-24T16:34:23.000Z
|
2022-03-31T02:01:05.000Z
|
;; program to test inter-segment production and linkage of RDF objects
;; [1] should produce segment base ref
;; [2] should produce standard relocation
[GLOBAL _main]
[EXTERN _puts: far]
[BITS 16]
_main:
mov ax, seg _message ; 0000 [1]
mov ds, ax ; 0003
mov dx, _message ; 0005 [2]
call far _puts ; 0008 [2][1]
xor ax,ax ; 000D
int 21h ; 000F
[SECTION .data]
_message: db 'Hello, World', 10, 13, 0
| 21
| 71
| 0.661905
|
122ce5ba9b427daf59d3b926cfdfd8680faa553f
| 8,308
|
asm
|
Assembly
|
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0xca_notsx.log_21829_1952.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0xca_notsx.log_21829_1952.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0xca_notsx.log_21829_1952.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 %r12
push %r15
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1272d, %r12
nop
nop
xor %r15, %r15
mov (%r12), %rbx
nop
nop
nop
dec %rdx
lea addresses_WC_ht+0x90bb, %rsi
lea addresses_A_ht+0x1bf55, %rdi
nop
nop
inc %rbx
mov $5, %rcx
rep movsb
nop
sub %r12, %r12
lea addresses_normal_ht+0x16c61, %rsi
lea addresses_WT_ht+0x185c5, %rdi
nop
nop
nop
nop
nop
dec %rbx
mov $37, %rcx
rep movsq
nop
nop
nop
cmp %rsi, %rsi
lea addresses_UC_ht+0xeb35, %rdi
nop
nop
nop
nop
cmp $8143, %rdx
vmovups (%rdi), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %rsi
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_UC_ht+0x13635, %rsi
lea addresses_normal_ht+0x1c335, %rdi
nop
nop
nop
nop
nop
dec %r11
mov $64, %rcx
rep movsb
nop
nop
nop
mfence
lea addresses_normal_ht+0x1e935, %rsi
lea addresses_normal_ht+0x13465, %rdi
nop
nop
xor $18235, %rbx
mov $40, %rcx
rep movsb
nop
nop
nop
inc %rcx
lea addresses_D_ht+0x1af35, %r15
nop
nop
nop
nop
cmp %rdi, %rdi
mov $0x6162636465666768, %rbx
movq %rbx, (%r15)
dec %rcx
lea addresses_A_ht+0x8d35, %r11
nop
nop
sub $23118, %r15
mov (%r11), %dx
nop
add $37661, %rcx
lea addresses_WT_ht+0x1c843, %rsi
lea addresses_WT_ht+0x8f35, %rdi
nop
nop
nop
sub %r15, %r15
mov $16, %rcx
rep movsw
nop
nop
nop
sub %r15, %r15
lea addresses_normal_ht+0x8a15, %r11
sub $38576, %r12
mov (%r11), %bx
nop
nop
nop
cmp %r12, %r12
lea addresses_normal_ht+0x4f35, %rsi
lea addresses_D_ht+0xcb5, %rdi
nop
nop
and %r15, %r15
mov $89, %rcx
rep movsq
nop
sub $33036, %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
// Store
lea addresses_normal+0x1c144, %r9
nop
nop
xor %rsi, %rsi
mov $0x5152535455565758, %rcx
movq %rcx, %xmm0
vmovups %ymm0, (%r9)
nop
nop
nop
add %r12, %r12
// Store
lea addresses_PSE+0x7b35, %r12
xor $45304, %rdi
movb $0x51, (%r12)
nop
nop
nop
nop
dec %r12
// Store
lea addresses_A+0x2825, %rbp
xor $30563, %r10
movw $0x5152, (%rbp)
nop
cmp $18401, %r12
// Load
lea addresses_WC+0x1dd25, %rcx
nop
nop
add $60669, %rdi
mov (%rcx), %ebp
nop
nop
nop
nop
add $33821, %r12
// REPMOV
lea addresses_WC+0x17335, %rsi
lea addresses_PSE+0xedb5, %rdi
nop
add %r10, %r10
mov $112, %rcx
rep movsw
nop
nop
nop
nop
nop
add %r10, %r10
// Load
lea addresses_PSE+0x1b35, %r10
nop
nop
sub %rsi, %rsi
mov (%r10), %r9d
nop
xor %r12, %r12
// Faulty Load
lea addresses_WC+0x17335, %r9
nop
nop
sub $40348, %r10
mov (%r9), %di
lea oracles, %rsi
and $0xff, %rdi
shlq $12, %rdi
mov (%rsi,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': True, 'type': 'addresses_WC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_normal', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_PSE', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_A', 'size': 2, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 3, 'NT': True, 'type': 'addresses_WC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC', 'congruent': 0, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_PSE', 'congruent': 7, 'same': False}}
{'src': {'same': False, 'congruent': 10, 'NT': True, 'type': 'addresses_PSE', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 2, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': True}}
{'src': {'same': True, 'congruent': 11, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': True}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
| 32.326848
| 2,999
| 0.655994
|
eefce316ee3e18641427ffae543a8f1bfca36f60
| 514
|
asm
|
Assembly
|
programs/oeis/047/A047531.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/047/A047531.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/047/A047531.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A047531: Numbers that are congruent to {2, 3, 7} mod 8.
; 2,3,7,10,11,15,18,19,23,26,27,31,34,35,39,42,43,47,50,51,55,58,59,63,66,67,71,74,75,79,82,83,87,90,91,95,98,99,103,106,107,111,114,115,119,122,123,127,130,131,135,138,139,143,146,147,151,154,155,159,162,163,167,170,171,175,178,179,183,186,187,191,194,195,199,202,203,207,210,211,215,218,219,223,226,227,231,234,235,239,242,243,247,250,251,255,258,259,263,266
mul $0,2
add $0,1
mov $1,$0
lpb $1
add $0,1
trn $1,2
mov $2,$1
trn $1,1
lpe
sub $0,$2
| 36.714286
| 360
| 0.671206
|
86d66e182faf21ec34ef31c385b3422b24d275f2
| 3,891
|
asm
|
Assembly
|
Codes/Chapter06/P10/P06-10.asm
|
ar-ekt/Dandamudi-Assembly-Solutions
|
876097a20420b125b19ec9e71cc480cc08b47997
|
[
"MIT"
] | 8
|
2021-03-04T18:31:42.000Z
|
2021-11-03T04:41:25.000Z
|
Codes/Chapter06/P10/P06-10.asm
|
ar-ekt/Dandamudi-Assembly-Solutions
|
876097a20420b125b19ec9e71cc480cc08b47997
|
[
"MIT"
] | null | null | null |
Codes/Chapter06/P10/P06-10.asm
|
ar-ekt/Dandamudi-Assembly-Solutions
|
876097a20420b125b19ec9e71cc480cc08b47997
|
[
"MIT"
] | 1
|
2021-11-09T09:49:00.000Z
|
2021-11-09T09:49:00.000Z
|
global _start
extern ExitProcess
%INCLUDE "lib.h"
%macro geti 0
fgets buffer, 15
a2i 15, buffer
%endmacro
%macro puti 1
i2a DWORD %1, buffer
puts buffer
%endmacro
section .data
MAX_ROW EQU 12
MAX_COL EQU 15
NEWLINE db 10, 0
TAB db 9, 0
MSG_ROW_INPUT db "Enter matrix number of rows: ", 0
MSG_COL_INPUT db "Enter matrix number of columns: ", 0
MSG_CELL_INPUT1 db "matrix[", 0
MSG_CELL_INPUT2 db "][", 0
MSG_CELL_INPUT3 db "] = ", 0
MSG_CYCLEN_INPUT db "Enter number of cycles(0<=): ", 0
RESULT db "Result: ", 10, 0
section .bss
buffer resb 100
matrix resd (MAX_COL*MAX_ROW)+1
result resd (MAX_COL*MAX_ROW)+1
section .code
_start:
push DWORD 0
push DWORD 0
push matrix
call matrixInput
pop ECX
pop EBX
puts NEWLINE
cycleN_input_loop:
puts MSG_CYCLEN_INPUT
geti
cmp EAX, 0
jl cycleN_input_loop
push EAX
push EBX
push ECX
push result
push matrix
call matrixCyclicPermutation
push EBX
push ECX
push result
call matrixPrint
_end:
push DWORD 0
call ExitProcess
matrixInput:
%define matrix DWORD [EBP+8]
%define numCol DWORD [EBP+12]
%define numRow DWORD [EBP+16]
enter 0, 0
pushad
matRowInput:
puts MSG_ROW_INPUT
geti
cmp EAX, MAX_ROW
jg matRowInput
cmp EAX, 1
jl matRowInput
mov numRow, EAX
matColInput:
puts MSG_COL_INPUT
geti
cmp EAX, MAX_COL
jg matColInput
cmp EAX, 1
jl matColInput
mov numCol, EAX
cellsInput:
mov ESI, matrix
mov ECX, 0-1
rowsInput:
inc ECX
cmp ECX, numRow
jge matrixInput_done
mov EDX, 0-1
columnsInput:
inc EDX
cmp EDX, numCol
jge rowsInput
puts MSG_CELL_INPUT1
puti ECX
puts MSG_CELL_INPUT2
puti EDX
puts MSG_CELL_INPUT3
geti
mov [ESI], EAX
add ESI, 4
jmp columnsInput
matrixInput_done:
popad
leave
ret 12-8
matrixCyclicPermutation:
%define matrix DWORD [EBP+8]
%define result DWORD [EBP+12]
%define numCol DWORD [EBP+16]
%define numRow DWORD [EBP+20]
%define cycleN DWORD [EBP+24]
%define colMinusCycle DWORD [EBP-4]
enter 4, 0
pushad
mov EAX, cycleN
cmp EAX, numCol
jl permute
cycleLoop:
sub EAX, numCol
cmp EAX, numCol
jnl cycleLoop
permute:
mov cycleN, EAX
mov EAX, numCol
sub EAX, cycleN
mov colMinusCycle, EAX
mov ECX, 0-1
rowLoop:
inc ECX
cmp ECX, numRow
je matrixCyclicPermutation_end
mov EBX, cycleN
colLoop1:
mov EAX, ECX
mul numCol
add EAX, EBX
shl EAX, 2
add EAX, matrix
mov EDI, [EAX]
mov EAX, ECX
mul numCol
add EAX, EBX
sub EAX, cycleN
shl EAX, 2
add EAX, result
mov [EAX], EDI
inc EBX
cmp EBX, numCol
jne colLoop1
mov EBX, 0-1
colLoop2:
inc EBX
cmp EBX, cycleN
je rowLoop
mov EAX, ECX
mul numCol
add EAX, EBX
shl EAX, 2
add EAX, matrix
mov EDI, [EAX]
mov EAX, ECX
mul numCol
add EAX, EBX
add EAX, numCol
sub EAx, cycleN
shl EAX, 2
add EAX, result
mov [EAX], EDI
jmp colLoop2
matrixCyclicPermutation_end:
popad
leave
ret 20-0
matrixPrint:
%define matrix DWORD [EBP+8]
%define numCol DWORD [EBP+12]
%define numRow DWORD [EBP+16]
enter 0, 0
push ESI
push EDX
push ECX
puts NEWLINE
puts RESULT
mov ESI, matrix
mov ECX, numRow
rowsPrint:
mov EDX, numCol
colsPrint:
puti [ESI]
add ESI, 4
puts TAB
sub EDX, 1
ja colsPrint
cols_done:
puts NEWLINE
sub ECX, 1
ja rowsPrint
matrixPrint_end:
pop ECX
pop EDX
pop ESI
leave
ret 12
| 15.946721
| 58
| 0.60293
|
77e15eb3f4c75e3fcc368b2aa532f44f25c9704f
| 493
|
asm
|
Assembly
|
oeis/253/A253580.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/253/A253580.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/253/A253580.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A253580: A fractal tree, read by rows: for n > 1: T(n,0) = T(n-1,0)+2, T(n,2*n) = T(n-1,0)+3, and for k=1..2*n-1: T(n,k) = T(n-1,k-1).
; Submitted by Jamie Morken(s2.)
; 0,1,0,2,3,1,0,2,4,5,3,1,0,2,4,6,7,5,3,1,0,2,4,6,8,9,7,5,3,1,0,2,4,6,8,10,11,9,7,5,3,1,0,2,4,6,8,10,12,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18
mul $0,4
mov $1,5
lpb $0
sub $0,$1
sub $0,2
gcd $0,$2
sub $0,1
add $1,8
lpe
div $0,2
| 32.866667
| 226
| 0.539554
|
04619341aab367acae4393bdb8b639baf94def5f
| 7,386
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_1789.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_1789.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_1789.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x1e9bb, %rcx
nop
nop
nop
nop
nop
cmp $5761, %rdi
mov $0x6162636465666768, %r15
movq %r15, (%rcx)
nop
nop
nop
nop
nop
cmp $40312, %r14
lea addresses_D_ht+0x3e7b, %rcx
nop
nop
nop
nop
inc %rsi
mov $0x6162636465666768, %rdx
movq %rdx, %xmm0
movups %xmm0, (%rcx)
nop
nop
nop
nop
inc %r14
lea addresses_WT_ht+0x1007b, %r14
xor $11120, %rsi
mov (%r14), %rdx
nop
nop
nop
cmp $21588, %rcx
lea addresses_UC_ht+0xe7b, %r15
nop
nop
nop
nop
xor $11788, %r14
mov (%r15), %rdx
nop
nop
nop
nop
xor %rdx, %rdx
lea addresses_D_ht+0x511b, %rsi
lea addresses_WC_ht+0xfda8, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
xor %rbp, %rbp
mov $124, %rcx
rep movsw
nop
nop
sub $3441, %rcx
lea addresses_A_ht+0x1c87b, %rsi
lea addresses_WC_ht+0x50db, %rdi
sub %rdx, %rdx
mov $28, %rcx
rep movsq
xor $17136, %r14
lea addresses_WC_ht+0xcf6b, %rdi
nop
nop
nop
nop
xor $29904, %rcx
movups (%rdi), %xmm2
vpextrq $0, %xmm2, %r15
nop
sub %rdx, %rdx
lea addresses_normal_ht+0x277b, %rdi
nop
nop
nop
nop
sub %rbp, %rbp
movb $0x61, (%rdi)
nop
nop
add $29241, %rdi
lea addresses_WC_ht+0x13e7b, %rsi
lea addresses_A_ht+0x8cbb, %rdi
clflush (%rsi)
nop
nop
nop
nop
inc %r15
mov $109, %rcx
rep movsl
nop
nop
nop
nop
nop
xor %r15, %r15
lea addresses_WT_ht+0x3d7b, %rsi
lea addresses_WC_ht+0xc27b, %rdi
clflush (%rsi)
nop
nop
inc %r9
mov $10, %rcx
rep movsw
nop
nop
nop
nop
nop
xor %r9, %r9
lea addresses_WC_ht+0x8d6b, %rdi
and $17420, %rdx
mov $0x6162636465666768, %r15
movq %r15, %xmm5
and $0xffffffffffffffc0, %rdi
movntdq %xmm5, (%rdi)
nop
nop
nop
xor $64293, %r15
lea addresses_D_ht+0x10dc7, %r14
nop
nop
nop
add $13109, %rsi
movw $0x6162, (%r14)
nop
xor %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r8
push %rax
push %rbp
push %rcx
push %rdi
// Store
lea addresses_normal+0x1c87b, %r11
nop
nop
add $31862, %rcx
mov $0x5152535455565758, %r8
movq %r8, %xmm2
vmovups %ymm2, (%r11)
nop
nop
nop
nop
nop
lfence
// Faulty Load
lea addresses_RW+0x767b, %rdi
nop
nop
nop
dec %r10
mov (%rdi), %r11d
lea oracles, %rcx
and $0xff, %r11
shlq $12, %r11
mov (%rcx,%r11,1), %r11
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': True, 'NT': True, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, '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
*/
| 32.826667
| 2,999
| 0.659626
|
4423dd856d17582cc0a22fa8ec193855239a3c1b
| 9,734
|
asm
|
Assembly
|
45/runtime/crt/5crt0.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
45/runtime/crt/5crt0.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
45/runtime/crt/5crt0.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
page ,132
title crt0 - OS/2 C start up routine
;***
;crt0.asm - OS/2 C start up routine
;
; Copyright (c) 1986-1988, Microsoft Corporation, All Rights Reserved
;
;Purpose:
; How startup works in a few words -
;
; The startup and termination is performed by a few modules
;
; crt0.asm OS/2 specific init/term
; crt0msg.asm OS/2 error messages
; crt0dat.asm remainder of shared OS/2 init/term
;
; ************* IMPORTANT *****************************************
;
; The "DOSSEG" directive in this module must not be removed or else
; the user will have to link with the "/DOSSEG" linker switch in
; order to get proper segment ordering.
;
; See the C documentation for more information about the /DOSSEG switch.
;
; All assembler modules must be assembled with the /Mx switch, i.e.
;
; masm -Mx crt0,;
;
;*******************************************************************************
;*******************************;*
DOSSEG ;* specifies DOS SEGment ordering *
;*******************************;*
;*******************************;*
;*******************************;*
?DF= 1 ; this is special for c startup
.xlist
include version.inc
include cmacros.inc
include msdos.inc
include brkctl.inc
EI_QB = 0 ;[1] constants so include file works
OM_DOS5 = NOT 0 ;[1]
include stack2.inc ;[1] STACK_SIZE constant
assumesdata macro seg ;;[1] Newer versions of CMACROS reject
assumes seg,DGROUP ;;[1]
endm ;;[1]
.list
page
;===========================================================================
;
; Segment definitions
;
; The segment order is essentially the same as in XENIX.
; This module is edited after assembly to contain a dosseg comment
; record for the linker.
;
;===========================================================================
createSeg _TEXT, code, word, public, CODE, <>
createSeg C_ETEXT,etext, word, public, ENDCODE,<>
createSeg _DATA, data, word, public, DATA, DGROUP
createSeg STACK, stack, para, stack, STACK, DGROUP
defGrp DGROUP ; define DGROUP
codeOFFSET equ offset _TEXT:
dataOFFSET equ offset DGROUP:
page
public __acrtused ; trick to force in startup
__acrtused = 9876h ; funny value not easily matched in SYMDEB
extrn __acrtmsg:abs ; trick to pull in startup messages
sBegin stack
assumesdata ds ;[1]
db STACK_SIZE dup (?) ;[1] default stack size
sEnd
page
extrn B$amsg_exit:FAR ;[1]
extrn B$terminate:FAR ;[1]
extrn B$Init:FAR ;[1]
sBegin data
extrn _edata:byte ; end of data (start of bss)
extrn _end:byte ; end of bss (start of stack)
externB _osfile
externB _osmajor ; Major and Minor versions of OS/2
externB _osmode ; real/protected mode flag
;[1]
extrn b$nmalloc_start:word ;[1] start of BASIC near malloc buffer
externW _acmdln ;[1]
externW _aenvseg ;[1]
externW _asizds ;[1]
externW _atopsp ;[1]
externW _aexit_rtn ;[1] NEAR pointer
externW _abrktb ;[1]
externB _acfinfo ;[1] special C environment string
extrn b$cfilex:byte ;[1] end char of _acfinfo
extrn b$cfileln:abs ;[1] length
cfile EQU _acfinfo ;[1]
cfilex EQU b$cfilex ;[1]
cfileln EQU b$cfileln ;[1]
;[1] externW _abrktbe ;[1]
;[1] externW _abrkp ;[1]
;[1]
sEnd
page
externP _cinit ; run-time initializers
externP main ; C main program
externP exit ; exit ( code )
extrn __exit:far ; _exit ( code) (cmacros name conflict)
extrn DOSGETVERSION:far
extrn DOSGETMACHINEMODE:far
extrn DOSREALLOCSEG:far ;[1]
sBegin code
assumes cs,code
page
;***
;_astart - start of all C programs
;
;Purpose:
; Startup routine to initialize C run-time environment.
;
;Entry:
; OS/2 Start-Up Conditions:
;
; DS = Automatic Data Segment
; SS:SP = Stack Segment and Initial Stack Pointer
; ES = 0000
; AX = Selector of Environment Segment
; BX = Offset of Command Line in Environment Segment
; CX = Size of Automatic Data Segment (CX=0 means 65536 bytes)
; BP = 0000
;
;Exit:
; Exits to OS/2 via exit().
;
;Uses:
;
;Exceptions:
;
;*******************************************************************************
labelNP <PUBLIC,_astart> ; start address of all "C" programs
;
;
cld ; set direction flag (up)
mov [_atopsp],sp ; Top of Stack Region
mov [_aenvseg],ax ;[1] Handle of Environment Segment
mov [_acmdln],bx ;[1] Offset of Command Line String
mov [_aexit_rtn],codeoffset _exit ;[1] call high-level exit()
jcxz Got64kDS ;[1] brif got 64k DS
xor cx,cx ;[1] if not get 64K
push cx ;[1] push requested size
push ds ;[1] doit to DS
call DOSREALLOCSEG ;[1] realloc for 64K
xchg ax,cx ;[1] return code in cx
jcxz Got64kDS ;[1] brif successful
mov [_aexit_rtn],codeoffset B$terminate ;[1] die quickly
mov ax,9 ;[1] C error message (not enough space)
jmp short __amsg_exit ;[1] print message and die
Got64kDS:
dec cx
mov [_asizds],cx ; Size of Global Data Segment
; [1] Initialize C near heap to BASIC near malloc buffer
mov ax,[b$nmalloc_start] ;[1] get top of nmalloc buffer
mov [_abrktb].sz,ax ;[1] set near brk end of heap marker
mov [_abrktb].sg,ds ;[1] DGROUP segment
call B$Init ;[1] Do necessary BASIC init prior to XI
;[1] processing
;
; get OS/2 version
;
push ax
mov ax,sp
push ss
push ax ; address for version
call DOSGETVERSION
pop ax
xchg ah,al ; swap bytes
mov word ptr [_osmajor],ax
;
; Get real/protected mode flag
;
mov ax,dataOFFSET _osmode
push ds
push ax
call DOSGETMACHINEMODE
;****
;* C_FILE_INFO must be processed before _cinit() is called
;* because _cinit() checks handles 0-2 for device/pipe.
;****
; fix up files inherited from child using _C_FILE_INFO
call inherit
; do necessary initialization BEFORE command line processing!
call _cinit ; shared by OS/2 and Windows
; process command line and environment
call main ; main ( argc , argv , envp )
; use whatever is in ax after returning here from the main program
push ax
call exit ; exit (AX)
; _exit will call terminators
page
;***
;_amsg_exit, _cintDIV - Fast exit fatal errors
;
;Purpose:
; Exit the program with error code of 255 and appropriate error
; message. cintDIV is used for integer divide by zero, amsg_exit
; is for other run time errors.
;
;Entry:
; AX = error message number (amsg_exit only).
;
;Exit:
; calls exit() [cintDIV] or indirect through _aexit_rtn [amsg_exit].
;
;Uses:
;
;Exceptions:
;
;*******************************************************************************
labelNP <PUBLIC,_cintDIV>
assumes ds,nothing
assumesdata ss ;[1]
; _NMSG_WRITE will reestablish ds = DGROUP
mov ax,3 ; Integer divide by zero interrupt
mov [_aexit_rtn],codeoffset _exit ; call high-level exit()
; to cause file buffer flushing
labelNP <PUBLIC,_amsg_exit>
JMP B$amsg_exit ;[1] print error message and terminate
page
;***
;inherit - process C_FILE_INFO variable from the environment
;
;Purpose:
; locates and interprets the "C_FILE_INFO" environment variable.
; The value of this variable is written into the "_osfile" array.
; This routine recognizes both DOS and OS/2 formats:
;
; DOS: ";C_FILE_INFO" + count byte "N" + "N" data bytes + "\0"
;
; where each data byte is written directly into _osfile
; except that 0xFF represents 0
;
; OS/2: "_C_FILE_INFO=<AA><BB><CC><DD>" + "\0"
;
; In this case the variable is a null-terminated string
; (a well-formed environment variable) where each pair
; of successive letters form one byte in _osfile.
; The letters are in the range "A" through "P", representing
; 0 through 15. The first letter of each pair is the more
; significant 4 bits of the result.
;
;Entry:
;
;Exit:
;
;Uses:
; AX, BX, CX, DX, SI, DI, ES
;
;Exceptions:
;
;*******************************************************************************
inherit proc near
mov bx,cfileln
cmp [_osmode],0
jne not_fapi
;
; Set up real-mode version of ;C_FILE_INFO
;
mov [cfile],';' ; change _C_FILE_INFO= to ;C_FILE_INFO
mov [cfilex],0
dec bx ; length is one less
not_fapi:
xor di,di
mov es,[_aenvseg] ; ES:DI points to environment strings
mov cx,07FFFh ; environment max = 32K
cmp byte ptr es:[di],0
jne cfilp
inc di ; first environment string is null
cfilp:
cmp byte ptr es:[di],0 ; check for end of environment
je nocfi ; yes - not found
mov si,dataOFFSET cfile
mov dx,cx ; DX has count of bytes left in environment
mov cx,bx ; BX=cfileln
repe cmpsb ; compare for '_C_FILE_INFO='/';C_FILE_INFO'
mov cx,dx ; environment max = 32K
je gotcfi ; yes - now do something with it
xor ax,ax
repne scasb ; search for end of current string
je cfilp ; keep searching
;
jmp short nocfi ; no 00 !!! - assume end of env.
;
; found _C_FILE_INFO, so transfer handle info into _osfile
;
gotcfi:
push es
push ds
pop es ; es = DGROUP
mov si,di ; si = startup of _osfile info
pop ds ; ds = env. segment
assumesdata es ;[1]
assumes ds,nothing
mov di,dataOFFSET _osfile ; di = _osfile block
cmp bx,cfileln
jne real_cfi
;
; Prot-mode _C_FILE_INFO:
; Read in pairs of characters, expected to be ['A'..'P'].
; Each pair represents one byte in the _osfile array.
; A null is the normal terminator for the string.
;
mov cl,4
osfile_lp:
lodsb ; get next byte (more significant 4 bits)
sub al,'A'
jb nocfi ; string should terminate with a null
shl al,cl
xchg dx,ax ; save in DL
lodsb ; get next byte (less significant 4 bits)
sub al,'A'
jb nocfi
or al,dl ; this assumes that AL is in range
stosb
jmp short osfile_lp
;
; Real-mode C_FILE_INFO
;
real_cfi:
lodsb ; must be less than 20
cbw
xchg cx,ax ; cx = number of entries
osflp:
lodsb ; get next byte
inc al
jz saveit ; was FF - save as 00
dec ax ; restore al
saveit:
stosb
loop osflp ; transfer next character
;------
nocfi:
push ss
pop ds ; ds = DGROUP
assumesdata ds ;[1]
ret
inherit endp
sEnd
end _astart ; start address
| 23.399038
| 80
| 0.658927
|
82106867846dca2a68d82fc380797cf516c48526
| 12,799
|
asm
|
Assembly
|
stringsMacros.asm
|
b0k0n0n/String-Primitives-and-Macros---MASM
|
b3fd2f0ed03afac92d1513944d591a6ad86bc9fb
|
[
"MIT"
] | null | null | null |
stringsMacros.asm
|
b0k0n0n/String-Primitives-and-Macros---MASM
|
b3fd2f0ed03afac92d1513944d591a6ad86bc9fb
|
[
"MIT"
] | null | null | null |
stringsMacros.asm
|
b0k0n0n/String-Primitives-and-Macros---MASM
|
b3fd2f0ed03afac92d1513944d591a6ad86bc9fb
|
[
"MIT"
] | null | null | null |
TITLE Project 6 - String Primitives and Macros
; Author: Russ McCuen
;
; Description: Implements and tests two macros for string processing:
; mGetString - displays prompt & gets user's input into memory location
; mDisplayString - prints the string which is stored in specified memory location
; Implements and tests two procedures for signed integers which use string primitive instructions:
; ReadVal - invokes mGetString, converts string of ASCII to numeric value (SDWORD), validates user entry
; WriteVal - covnerts numeric SDWORD to string of ASCII to string of ASCII digits, invokes mDisplayString
; Gets 10 valid integers from user, stores ints in array, displays ints, their sum, and truncated average
INCLUDE Irvine32.inc
USER_NUMBERS = 10 ; constant - user should enter 10 numbers
;-----------------------------------------------------------------------------------------------
; Macro name: mGetString
;
; Prompts user to enter 10 signed decimal integers that must fit inside a 32-bit register
;
; Receives:
; promptUser = ask for number
; inputString = array address
; inputLength = array length
;
; Returns: string input by user and length of string input by user
;----------------------------------------------------------------------------------------------
mGetString MACRO promptUser, inputString, inputLength
push edx
push ecx
mov edx, promptUser
call WriteString
mov ecx, 15 ; I set the input string to max length of 15
mov edx, inputString
call ReadString
mov inputLength, eax
pop ecx
pop edx
ENDM
;----------------------------------------------------------------------------------------------------
; Macro name: mDisplayString
;
; Prints the string which is stored in a specified memory location
;
; Receives: address of string to display
;
; returns: None (but displays the output string to the console)
;-----------------------------------------------------------------------------------------------------
mDisplayString MACRO stringAddress
push edx
mov edx, stringAddress
call WriteString
pop edx
ENDM
.data
intro BYTE "Final 271 Project (OMG SO HAPPY!): Designing low-level I/O procedures, by Russ McCuen", 13, 10, 0
intro2 BYTE 13, 10, "Please input 10 signed decimal integers.", 13, 10, 0
intro3 BYTE "Each integer needs to be small enough to fit inside a 32-bit register.", 13, 10, 0
intro4 BYTE "After you have input 10 integers, a list of those integers, their sum, ", 13, 10, 0
intro5 BYTE "and their average value will be displayed.", 13, 10, 0
userPrompt BYTE "Please enter a signed integer: " ,0
userEntry BYTE 15 Dup(?) ; I think 13 would be fine but did 15 jsut in case
userError BYTE "DANGER!!! INVALID ENTRY! Please try again.", 13,10,0
userNums BYTE "You entered the following numbers: ", 13, 10, 0
comma BYTE ", ", 0
asciiString BYTE 15 Dup(?) ; although I don't think it matters because > 12 would be cut off
validNums SDWORD USER_NUMBERS Dup(?)
userNumSum BYTE 13, 10, "The sum of your numbers is: ", 0
userSum SDWORD ?
userNumAvg BYTE 13, 10, "The truncated average of your numbers is: ", 0
userAvg SDWORD ?
stringLength DWORD ?
validNum SDWORD ?
numberCount DWORD 0
negativeNum DWORD 0
doneWith271 BYTE "All projects for CS 271 are now complete! Thanks for taking part!", 13,10,0
.code
main PROC
push OFFSET intro
push OFFSET intro2
push OFFSET intro3
push OFFSET intro4
push OFFSET intro5
call introduction
mov edi, OFFSET validNums ; where we store valid user entries
mov ecx, USER_NUMBERS ; number of valid user entries we need
; user input loop must be in main (not paying attention to this meant I had to write this twice!)
getInput:
push USER_NUMBERS ; need 10 numbers
push numberCount ; how many numbers?
push stringLength ; length of each entry
push negativeNum ; to ensure negative numbers are printed as negative numbers
push OFFSET userPrompt ; prompt user to enter number
push OFFSET userEntry ; user entered string
push OFFSET userError ; try again
push OFFSET validNum ; actual number (not string)
push OFFSET asciiString ; ascii interpretation of string
call ReadVal
mov eax, validNum
stosd ; store string data
loop getInput ; loop that is IN MAIN!!!!!
call CrLf
mov ecx, USER_NUMBERS
mov esi, OFFSET validNums
mDisplayString OFFSET userNums
printNums:
push USER_NUMBERS ; user enters 10 numbers
push [esi]
push OFFSET asciiString ; ascii string to be printed
call WriteVal ; print ascii string currently pointed to
cmp ecx, 1 ; what is the counter at? (for commas)
jz getSum ; no more commas
mDisplayString OFFSET comma ; still need a comma
add esi, 4 ; go to the next ascii string to print
loop printNums ; keep printing!
getSum:
mov eax, 0
mov esi, OFFSET validNums ; valid numbers entered by user
mov ecx, USER_NUMBERS ; user entered 10 numbers
calculateSum:
add eax, [esi] ; add value to sum
add esi, 4 ; go to next value
loop calculateSum ; keep adding until all numbers iterated through
mov userSum, eax ; place sum value in userSum
mDisplayString OFFSET userNumSum ; print message of number sum
push USER_NUMBERS
push userSum
push OFFSET asciiString
call WriteVal ; print sum of user entered numbers
mov ebx, USER_NUMBERS ; 10 numbers entered so divide by this for average
mov eax, userSum ; sum of user numbers entered, divide by USER_NUMBERS to get average
cdq ; sign extend to ensure correct result obtained
idiv ebx ; divide by 10 to get average
mov userAvg, eax ; calculated truncated average
mDisplayString OFFSET userNumAvg ; print message of user numbers truncated average
push USER_NUMBERS
push userAvg ; truncated average of user numbers entered
push OFFSET asciiString ; ascii string to print (for user nums entered)
call WriteVal ; WRITE IT!
call CrLf ; for pretty
call CrLf
push OFFSET doneWith271 ; final 271 goodbye message!!!!!
call byeBye271 ; I know we still have the final . . . but PROJECTS ARE DONE!!!
call CrLf
Invoke ExitProcess,0 ; exit to operating system
main ENDP
; --introduction--
; Prints introduction and instructions using mDisplayString
; preconditions: intro and inst1-4 are strings that introduce the program and contain instructions
; postconditions: intro and instructions printed to screen
; receives: intro and instructions 1-4
; returns: intro and instructions printed to screen
introduction PROC
push ebp
mov ebp, esp
mDisplayString [ebp + 24] ; print intro
mDisplayString [ebp + 20] ; print instructions 1 - 4
mDisplayString [ebp + 16]
mDisplayString [ebp + 12]
mDisplayString [ebp + 8]
call CrLf
pop ebp
ret 20
introduction ENDP
; --ReadVal--
; Uses mGetString macro to get user input in the form of a string of digits.
; Converts string of ASCII digits to numbers, validating input as it goes.
; Stores each value in a memory variable, by reference.
; preconditions: userEntry, userPrompt, userError, and asciiString are all strings that have been created.
; numCount, negativeNum, and stringLength are variables that have been created.
; USER_NUMS has been created as a constant; validNums is an array that has been created.
; postconditions: none
; receives: USER_NUMS, stringLength, userEntry, userPrompt, validNums, numberCount, userError, negativeNum, and asciiString
; returns: array of numbers that have been validated
ReadVal PROC
push ebp
mov ebp, esp
pushad
promptUser:
mGetString [ebp + 24], [ebp + 20], [ebp + 32] ; MACRO call for prompt, enteredString, and stringLength
mov ecx, [ebp + 32] ; counter = stringLength
mov esi, [ebp + 20] ; source = entered string
mov edi, [ebp + 12] ; valid number
cld
checkIsValid:
lodsb
cmp ecx, 12 ; max length is 11 if there is a sign, so > 11 = invalid
jae notValid
mov ebx, [ebp + 32]
cmp ebx, ecx ; if stringLength is 11, is first char + or - ?
jne keepChecking
cmp al, 43 ; 43 = ASCII value for +
jz getNext
cmp al, 45 ; 45 = ASCII value for -
jz isNegative ; treat as negative number
jmp keepChecking
isNegative:
mov ebx, 1
mov [ebp + 28], ebx ; sets isNegative to 1
jmp getNext ; ready for next character
keepChecking:
cmp al, 57 ; 57 = ASCII value for 9
jg notValid ; if > 57, not valid
cmp al, 48 ; 48 = ASCII value for 0
jl notValid ; if < 0, not valid
sub al, 48 ; convert ASCII to number
movsx eax, al
push eax
mov ebx, 10
mov eax, [ebp + 36] ; counts numbers converted
imul ebx
pop ebx
jo notValid ; if overflow, then error
add eax, ebx
mov [ebp + 36], eax
jo notValid ; if overflow, then error
getNext:
loop checkIsValid ; keep checking
mov ebx, 1
cmp [ebp + 28], ebx ; is it negative?
jne isValid
neg eax ; if so, negate
isValid:
mov [edi], eax ; if valid, store number
jmp theEnd
notValid:
mDisplayString [ebp + 16] ; ERROR! ERROR!
mov ebx, 0
mov [ebp + 36], ebx ; integer conversion count reset for further checks
mov [ebp + 28], ebx ; isNegative reset for further checks
jmp promptUser
theEnd:
popad
pop ebp
ret 36
ReadVal ENDP
; --WriteVal--
; Converts numeric value into string of ASCII digits, then prints ASCII string using mDisplayString
; preconditions: USER_NUMS declared as constant, nums converted to ASCII, asciiString delcared as string
; postconditions: none
; receives: USER_NUMS, number to be converted, address of asciiString
; returns: asciiString to print (printed to display)
WriteVal PROC
push ebp
mov ebp, esp
pushad
mov ecx, 0 ; counter
mov edi, [ebp + 8] ; asciiString regardless of call
mov esi, [ebp + 12] ; either userSum or userNumAvg
mov eax, esi
cmp eax, 0
jge getASCII
push eax
mov al, 45 ; add '-' to the string for neg nums
stosb ; store string data
pop eax
neg eax ; makes positive because will be adding - if negative later
getASCII:
mov ebx, [ebp + 16] ; get ready to divide
cdq ; sign extend for correct answer
idiv ebx ; divide by USER_NUMS
add edx, 48 ; add ASCII value for 0 to get ASCII equivalent number (remainder + ASCII 0)
push edx ; remainder goes to stack
inc ecx ; increment counter
cmp eax, 0 ; are we done?
jz getReverse ; if yes, get ready to print
jmp getASCII ; if not, get next ASCII
getReverse:
pop eax
stosb ; store string data
loop getReverse ; keep reversing until full string complete
mov al, 0 ; 0 = null terminator, so string is done!
stosb ; store string data
mDisplayString [ebp + 8] ; asciiString finally ready for printing
popad
pop ebp
ret 12
WriteVal ENDP
; --byeBye271--
; Prints the final goodbye message of the final project of 271!!!!!
; preconditions: doneWith271 is a string that is totally ready for the end of this class
; postconditions: said goodbye to the class (at least the projects)
; receives: doneWith271 string
; returns: NONE (but says hasta la vista! via display!)
byeBye271 PROC
push ebp
mov ebp, esp
mDisplayString [ebp + 8] ;buh bye MASM
pop ebp
ret 4 ; did I mention I'm happy?
byeBye271 ENDP
END main
| 36.155367
| 124
| 0.608719
|
e7a0511ce85830281e984301153bc62bd20ea5ba
| 122
|
asm
|
Assembly
|
src/third_party/nasm/test/br3392442.asm
|
Mr-Sheep/naiveproxy
|
9f6e9768295f6d1d41517a15a621d4756bd7d6be
|
[
"BSD-3-Clause"
] | 2,219
|
2018-03-26T02:57:34.000Z
|
2022-03-31T00:27:59.000Z
|
src/third_party/nasm/test/br3392442.asm
|
Mr-Sheep/naiveproxy
|
9f6e9768295f6d1d41517a15a621d4756bd7d6be
|
[
"BSD-3-Clause"
] | 395
|
2020-04-18T08:22:18.000Z
|
2021-12-08T13:04:49.000Z
|
src/third_party/nasm/test/br3392442.asm
|
Mr-Sheep/naiveproxy
|
9f6e9768295f6d1d41517a15a621d4756bd7d6be
|
[
"BSD-3-Clause"
] | 473
|
2019-03-24T16:34:23.000Z
|
2022-03-31T02:01:05.000Z
|
;; Bug report 3392442: invalid warning
and byte [0], ~80h
and byte [0], 0xfff
and byte [0], -256
and byte [0], -257
| 17.428571
| 39
| 0.622951
|
4c06805753d3985fc4166b793e9d64727bce1ab4
| 193
|
asm
|
Assembly
|
src/string_charchange.asm
|
I8087/libm
|
47874572a2bc1356e1ab70f9c29b6fa50875f3c3
|
[
"BSD-2-Clause"
] | 13
|
2015-06-13T00:56:27.000Z
|
2022-01-25T16:55:26.000Z
|
src/string_charchange.asm
|
I8087/libm
|
47874572a2bc1356e1ab70f9c29b6fa50875f3c3
|
[
"BSD-2-Clause"
] | 10
|
2016-02-02T23:34:27.000Z
|
2019-06-11T22:41:23.000Z
|
src/string_charchange.asm
|
I8087/libm
|
47874572a2bc1356e1ab70f9c29b6fa50875f3c3
|
[
"BSD-2-Clause"
] | 1
|
2016-06-21T05:19:15.000Z
|
2016-06-21T05:19:15.000Z
|
global _string_charchange
_string_charchange:
push bp
mov bp, sp
mov si, [bp+4]
mov al, byte [bp+6]
mov bl, byte [bp+8]
call os_string_charchange
pop bp
ret
| 12.866667
| 29
| 0.61658
|
dcfd76f40ba1dacb3b011b08a814125b2d47af61
| 767
|
asm
|
Assembly
|
oeis/024/A024598.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/024/A024598.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/024/A024598.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A024598: a(n) = s(1)s(n) + s(2)s(n-1) + ... + s(k)s(n+1-k), where k = floor((n+1)/2), s = (odd natural numbers).
; 1,3,14,22,55,73,140,172,285,335,506,578,819,917,1240,1368,1785,1947,2470,2670,3311,3553,4324,4612,5525,5863,6930,7322,8555,9005,10416,10928,12529,13107,14910,15558,17575,18297,20540,21340,23821,24703,27434,28402,31395,32453,35720,36872,40425,41675,45526,46878,51039,52497,56980,58548,63365,65047,70210,72010,77531,79453,85344,87392,93665,95843,102510,104822,111895,114345,121836,124428,132349,135087,143450,146338,155155,158197,167480,170680,180441,183803,194054,197582,208335,212033,223300,227172
mul $0,2
add $0,1
seq $0,295286 ; Sum of the products of the smaller and larger parts of the partitions of n into two parts with the smaller part odd.
| 109.571429
| 499
| 0.754889
|
580f7883bdb377a8dd6970f5da10c5d09312fc99
| 6,326
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_4594_1473.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_4594_1473.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_4594_1473.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 %r9
push %rbp
push %rcx
push %rsi
lea addresses_normal_ht+0xadd0, %rbp
dec %r11
mov $0x6162636465666768, %rcx
movq %rcx, %xmm1
vmovups %ymm1, (%rbp)
nop
nop
add $10680, %rsi
lea addresses_WC_ht+0x64e8, %r12
nop
nop
nop
nop
add %r10, %r10
mov $0x6162636465666768, %r9
movq %r9, (%r12)
dec %r12
lea addresses_normal_ht+0x3e68, %r9
nop
nop
cmp $31629, %r11
mov $0x6162636465666768, %r10
movq %r10, %xmm7
and $0xffffffffffffffc0, %r9
vmovaps %ymm7, (%r9)
nop
nop
nop
nop
cmp $33961, %rsi
lea addresses_WC_ht+0x1e46a, %r9
nop
nop
sub $45277, %r12
mov (%r9), %r10
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_D_ht+0x16968, %r9
nop
nop
nop
add %r12, %r12
movw $0x6162, (%r9)
nop
nop
nop
xor %rbp, %rbp
lea addresses_D_ht+0x8ce8, %r11
and $28338, %r10
movups (%r11), %xmm7
vpextrq $0, %xmm7, %rsi
nop
nop
nop
cmp $39768, %r11
lea addresses_WT_ht+0x160e8, %r11
nop
nop
nop
nop
nop
dec %rcx
mov (%r11), %ebp
nop
nop
add $9766, %rsi
lea addresses_WT_ht+0x19ce8, %r10
nop
nop
cmp %rbp, %rbp
mov (%r10), %ecx
nop
nop
nop
nop
sub %r12, %r12
lea addresses_normal_ht+0x16edc, %r12
nop
cmp %r10, %r10
mov $0x6162636465666768, %r11
movq %r11, (%r12)
nop
nop
nop
nop
nop
add $53181, %rsi
pop %rsi
pop %rcx
pop %rbp
pop %r9
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r8
push %r9
push %rcx
push %rdx
// Store
mov $0x49c84500000008a8, %r9
nop
add $56075, %rdx
movw $0x5152, (%r9)
and %r10, %r10
// Faulty Load
lea addresses_normal+0x16ce8, %r8
clflush (%r8)
xor %rcx, %rcx
movb (%r8), %r9b
lea oracles, %r14
and $0xff, %r9
shlq $12, %r9
mov (%r14,%r9,1), %r9
pop %rdx
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'34': 4594}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 38.809816
| 2,999
| 0.656655
|
459b1dba8501d7f108b18cd8b79ae8525927f2d8
| 126
|
asm
|
Assembly
|
programs/eg5.asm
|
zac-garby/computer
|
a3f06a587c45d2d6c9b410d8771b85647aee47c1
|
[
"MIT"
] | null | null | null |
programs/eg5.asm
|
zac-garby/computer
|
a3f06a587c45d2d6c9b410d8771b85647aee47c1
|
[
"MIT"
] | 1
|
2021-11-08T10:47:44.000Z
|
2021-11-08T10:47:44.000Z
|
programs/eg5.asm
|
zac-garby/computer
|
a3f06a587c45d2d6c9b410d8771b85647aee47c1
|
[
"MIT"
] | 1
|
2021-11-08T10:33:34.000Z
|
2021-11-08T10:33:34.000Z
|
LDA 0xd0
CALL 0xf0
LDA 0xd1
CALL 0xf0
HALT
0xf0 ADDR 0xd2
OUT
RETURN
0xd0 DATA 0x01
0xd1 DATA 0x02
0xd2 DATA 0xa0
| 8.4
| 14
| 0.722222
|
13c4e6939266342e7dd5515b5316607c56ff0894
| 377
|
asm
|
Assembly
|
oeis/052/A052665.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/052/A052665.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/052/A052665.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A052665: a(0)=0, for n >= 1, a(n) = ((2^(n-1)-1)*n!.
; Submitted by Jamie Morken(s2)
; 0,0,2,18,168,1800,22320,317520,5120640,92534400,1854316800,40834886400,980516275200,25499650176000,714077383219200,21423629170944000,685577056260096000,23309975600271360000
sub $0,1
mov $1,1
mov $2,1
lpb $0
sub $0,1
add $2,1
mul $1,$2
mul $3,2
add $3,1
lpe
mul $1,$3
mov $0,$1
| 22.176471
| 174
| 0.68435
|
374e3cc99ab303e6515718f774ac8322fbf9458c
| 250,844
|
asm
|
Assembly
|
win32/VC10/Win32/libxml2_Debug/pattern.asm
|
txwizard/libxml2_x64_and_ARM
|
bc19a931370a09ee379d641a7c9a862fecebff3b
|
[
"MIT"
] | null | null | null |
win32/VC10/Win32/libxml2_Debug/pattern.asm
|
txwizard/libxml2_x64_and_ARM
|
bc19a931370a09ee379d641a7c9a862fecebff3b
|
[
"MIT"
] | null | null | null |
win32/VC10/Win32/libxml2_Debug/pattern.asm
|
txwizard/libxml2_x64_and_ARM
|
bc19a931370a09ee379d641a7c9a862fecebff3b
|
[
"MIT"
] | null | null | null |
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27027.1
TITLE C:\Users\DAG\Documents\_Clients\CodeProject Authors Group\Windows on ARM\libxml2\libxml2-2.9.9\pattern.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM _xmlMalloc:DWORD
COMM _xmlMallocAtomic:DWORD
COMM _xmlRealloc:DWORD
COMM _xmlFree:DWORD
COMM _xmlMemStrdup:DWORD
COMM _xmlIsBaseCharGroup:BYTE:010H
COMM _xmlIsCharGroup:BYTE:010H
COMM _xmlIsCombiningGroup:BYTE:010H
COMM _xmlIsDigitGroup:BYTE:010H
COMM _xmlIsExtenderGroup:BYTE:010H
COMM _xmlIsIdeographicGroup:BYTE:010H
COMM _xmlIsPubidChar_tab:BYTE:0100H
COMM _xmlParserMaxDepth:DWORD
COMM _forbiddenExp:DWORD
COMM _emptyExp:DWORD
_DATA ENDS
msvcjmc SEGMENT
__188180DA_corecrt_math@h DB 01H
__2CC6E67D_corecrt_stdio_config@h DB 01H
__05476D76_corecrt_wstdio@h DB 01H
__A452D4A0_stdio@h DB 01H
__4384A2D9_corecrt_memcpy_s@h DB 01H
__4E51A221_corecrt_wstring@h DB 01H
__2140C079_string@h DB 01H
__69230394_pattern@c DB 01H
msvcjmc ENDS
PUBLIC _xmlFreePattern
PUBLIC _xmlFreePatternList
PUBLIC _xmlPatterncompile
PUBLIC _xmlPatternMatch
PUBLIC _xmlPatternStreamable
PUBLIC _xmlPatternMaxDepth
PUBLIC _xmlPatternMinDepth
PUBLIC _xmlPatternFromRoot
PUBLIC _xmlPatternGetStreamCtxt
PUBLIC _xmlFreeStreamCtxt
PUBLIC _xmlStreamPushNode
PUBLIC _xmlStreamPush
PUBLIC _xmlStreamPushAttr
PUBLIC _xmlStreamPop
PUBLIC _xmlStreamWantsAnyNode
PUBLIC __JustMyCode_Default
PUBLIC ??_C@_0CF@GLDAAHFK@http?3?1?1www?4w3?4org?1XML?11998?1name@ ; `string'
PUBLIC ??_C@_05GPGNDLEK@child@ ; `string'
PUBLIC ??_C@_09HGIEBAJ@attribute@ ; `string'
EXTRN _xmlStrdup:PROC
EXTRN _xmlStrndup:PROC
EXTRN _xmlStrEqual:PROC
EXTRN _xmlDictReference:PROC
EXTRN _xmlDictFree:PROC
EXTRN _xmlDictLookup:PROC
EXTRN _xmlCharInRange:PROC
EXTRN _xmlStringCurrentChar:PROC
EXTRN @_RTC_CheckStackVars@8:PROC
EXTRN @__CheckForDebuggerJustMyCode@4:PROC
EXTRN __RTC_CheckEsp:PROC
EXTRN __RTC_InitBase:PROC
EXTRN __RTC_Shutdown:PROC
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
__RTC_Shutdown.rtc$TMZ DD FLAT:__RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
__RTC_InitBase.rtc$IMZ DD FLAT:__RTC_InitBase
rtc$IMZ ENDS
; COMDAT ??_C@_09HGIEBAJ@attribute@
CONST SEGMENT
??_C@_09HGIEBAJ@attribute@ DB 'attribute', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_05GPGNDLEK@child@
CONST SEGMENT
??_C@_05GPGNDLEK@child@ DB 'child', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0CF@GLDAAHFK@http?3?1?1www?4w3?4org?1XML?11998?1name@
CONST SEGMENT
??_C@_0CF@GLDAAHFK@http?3?1?1www?4w3?4org?1XML?11998?1name@ DB 'http://ww'
DB 'w.w3.org/XML/1998/namespace', 00H ; `string'
CONST ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
push ebp
mov ebp, esp
pop ebp
ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlStreamPushInternal
_TEXT SEGMENT
tv317 = -80 ; size = 4
tv318 = -76 ; size = 4
tv231 = -72 ; size = 4
tv232 = -68 ; size = 4
_step$ = -60 ; size = 16
_comp$ = -40 ; size = 4
_desc$ = -36 ; size = 4
_stepNr$ = -32 ; size = 4
_match$ = -28 ; size = 4
_m$ = -24 ; size = 4
_i$ = -20 ; size = 4
_tmp$ = -16 ; size = 4
_final$ = -12 ; size = 4
_err$ = -8 ; size = 4
_ret$ = -4 ; size = 4
_stream$ = 8 ; size = 4
_name$ = 12 ; size = 4
_ns$ = 16 ; size = 4
_nodeType$ = 20 ; size = 4
_xmlStreamPushInternal PROC ; COMDAT
; 1860 : int nodeType) {
push ebp
mov ebp, esp
sub esp, 80 ; 00000050H
push edi
lea edi, DWORD PTR [ebp-80]
mov ecx, 20 ; 00000014H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 1861 : int ret = 0, err = 0, final = 0, tmp, i, m, match, stepNr, desc;
mov DWORD PTR _ret$[ebp], 0
mov DWORD PTR _err$[ebp], 0
mov DWORD PTR _final$[ebp], 0
; 1862 : xmlStreamCompPtr comp;
; 1863 : xmlStreamStep step;
; 1864 : #ifdef DEBUG_STREAMING
; 1865 : xmlStreamCtxtPtr orig = stream;
; 1866 : #endif
; 1867 :
; 1868 : if ((stream == NULL) || (stream->nbState < 0))
cmp DWORD PTR _stream$[ebp], 0
je SHORT $LN7@xmlStreamP
mov eax, DWORD PTR _stream$[ebp]
cmp DWORD PTR [eax+8], 0
jge SHORT $LN2@xmlStreamP
$LN7@xmlStreamP:
; 1869 : return(-1);
or eax, -1
jmp $LN1@xmlStreamP
$LN2@xmlStreamP:
; 1870 :
; 1871 : while (stream != NULL) {
cmp DWORD PTR _stream$[ebp], 0
je $LN3@xmlStreamP
; 1872 : comp = stream->comp;
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+4]
mov DWORD PTR _comp$[ebp], edx
; 1873 :
; 1874 : if ((nodeType == XML_ELEMENT_NODE) &&
; 1875 : (name == NULL) && (ns == NULL)) {
cmp DWORD PTR _nodeType$[ebp], 1
jne $LN8@xmlStreamP
cmp DWORD PTR _name$[ebp], 0
jne $LN8@xmlStreamP
cmp DWORD PTR _ns$[ebp], 0
jne $LN8@xmlStreamP
; 1876 : /* We have a document node here (or a reset). */
; 1877 : stream->nbState = 0;
mov eax, DWORD PTR _stream$[ebp]
mov DWORD PTR [eax+8], 0
; 1878 : stream->level = 0;
mov ecx, DWORD PTR _stream$[ebp]
mov DWORD PTR [ecx+16], 0
; 1879 : stream->blockLevel = -1;
mov edx, DWORD PTR _stream$[ebp]
mov DWORD PTR [edx+28], -1
; 1880 : if (comp->flags & XML_STREAM_FROM_ROOT) {
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+16]
and ecx, 32768 ; 00008000H
je $LN9@xmlStreamP
; 1881 : if (comp->nbStep == 0) {
mov edx, DWORD PTR _comp$[ebp]
cmp DWORD PTR [edx+4], 0
jne SHORT $LN10@xmlStreamP
; 1882 : /* TODO: We have a "/." here? */
; 1883 : ret = 1;
mov DWORD PTR _ret$[ebp], 1
; 1884 : } else {
jmp SHORT $LN9@xmlStreamP
$LN10@xmlStreamP:
; 1885 : if ((comp->nbStep == 1) &&
; 1886 : (comp->steps[0].nodeType == XML_STREAM_ANY_NODE) &&
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+4], 1
jne SHORT $LN12@xmlStreamP
mov ecx, 16 ; 00000010H
imul edx, ecx, 0
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+12]
cmp DWORD PTR [ecx+edx+12], 100 ; 00000064H
jne SHORT $LN12@xmlStreamP
mov edx, 16 ; 00000010H
imul eax, edx, 0
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+12]
mov eax, DWORD PTR [edx+eax]
and eax, 1
je SHORT $LN12@xmlStreamP
; 1887 : (comp->steps[0].flags & XML_STREAM_STEP_DESC))
; 1888 : {
; 1889 : /*
; 1890 : * In the case of "//." the document node will match
; 1891 : * as well.
; 1892 : */
; 1893 : ret = 1;
mov DWORD PTR _ret$[ebp], 1
jmp SHORT $LN9@xmlStreamP
$LN12@xmlStreamP:
; 1894 : } else if (comp->steps[0].flags & XML_STREAM_STEP_ROOT) {
mov ecx, 16 ; 00000010H
imul edx, ecx, 0
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+12]
mov edx, DWORD PTR [ecx+edx]
and edx, 4
je SHORT $LN9@xmlStreamP
; 1895 : /* TODO: Do we need this ? */
; 1896 : tmp = xmlStreamCtxtAddState(stream, 0, 0);
push 0
push 0
mov eax, DWORD PTR _stream$[ebp]
push eax
call _xmlStreamCtxtAddState
add esp, 12 ; 0000000cH
mov DWORD PTR _tmp$[ebp], eax
; 1897 : if (tmp < 0)
cmp DWORD PTR _tmp$[ebp], 0
jge SHORT $LN9@xmlStreamP
; 1898 : err++;
mov ecx, DWORD PTR _err$[ebp]
add ecx, 1
mov DWORD PTR _err$[ebp], ecx
$LN9@xmlStreamP:
; 1899 : }
; 1900 : }
; 1901 : }
; 1902 : stream = stream->next;
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR _stream$[ebp], eax
; 1903 : continue; /* while */
jmp $LN2@xmlStreamP
$LN8@xmlStreamP:
; 1904 : }
; 1905 :
; 1906 : /*
; 1907 : * Fast check for ".".
; 1908 : */
; 1909 : if (comp->nbStep == 0) {
mov ecx, DWORD PTR _comp$[ebp]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN16@xmlStreamP
; 1910 : /*
; 1911 : * / and . are handled at the XPath node set creation
; 1912 : * level by checking min depth
; 1913 : */
; 1914 : if (stream->flags & XML_PATTERN_XPATH) {
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+24]
and eax, 1
je SHORT $LN17@xmlStreamP
; 1915 : stream = stream->next;
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR _stream$[ebp], edx
; 1916 : continue; /* while */
jmp $LN2@xmlStreamP
$LN17@xmlStreamP:
; 1917 : }
; 1918 : /*
; 1919 : * For non-pattern like evaluation like XML Schema IDCs
; 1920 : * or traditional XPath expressions, this will match if
; 1921 : * we are at the first level only, otherwise on every level.
; 1922 : */
; 1923 : if ((nodeType != XML_ATTRIBUTE_NODE) &&
cmp DWORD PTR _nodeType$[ebp], 2
je SHORT $LN18@xmlStreamP
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+24]
and ecx, 7
je SHORT $LN19@xmlStreamP
mov edx, DWORD PTR _stream$[ebp]
cmp DWORD PTR [edx+16], 0
jne SHORT $LN18@xmlStreamP
$LN19@xmlStreamP:
; 1924 : (((stream->flags & XML_PATTERN_NOTPATTERN) == 0) ||
; 1925 : (stream->level == 0))) {
; 1926 : ret = 1;
mov DWORD PTR _ret$[ebp], 1
$LN18@xmlStreamP:
; 1927 : }
; 1928 : stream->level++;
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+16]
add ecx, 1
mov edx, DWORD PTR _stream$[ebp]
mov DWORD PTR [edx+16], ecx
; 1929 : goto stream_next;
jmp $stream_next$93
$LN16@xmlStreamP:
; 1930 : }
; 1931 : if (stream->blockLevel != -1) {
mov eax, DWORD PTR _stream$[ebp]
cmp DWORD PTR [eax+28], -1
je SHORT $LN20@xmlStreamP
; 1932 : /*
; 1933 : * Skip blocked expressions.
; 1934 : */
; 1935 : stream->level++;
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+16]
add edx, 1
mov eax, DWORD PTR _stream$[ebp]
mov DWORD PTR [eax+16], edx
; 1936 : goto stream_next;
jmp $stream_next$93
$LN20@xmlStreamP:
; 1937 : }
; 1938 :
; 1939 : if ((nodeType != XML_ELEMENT_NODE) &&
; 1940 : (nodeType != XML_ATTRIBUTE_NODE) &&
cmp DWORD PTR _nodeType$[ebp], 1
je SHORT $LN21@xmlStreamP
cmp DWORD PTR _nodeType$[ebp], 2
je SHORT $LN21@xmlStreamP
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+16]
and edx, 16384 ; 00004000H
jne SHORT $LN21@xmlStreamP
; 1941 : ((comp->flags & XML_STREAM_FINAL_IS_ANY_NODE) == 0)) {
; 1942 : /*
; 1943 : * No need to process nodes of other types if we don't
; 1944 : * resolve to those types.
; 1945 : * TODO: Do we need to block the context here?
; 1946 : */
; 1947 : stream->level++;
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+16]
add ecx, 1
mov edx, DWORD PTR _stream$[ebp]
mov DWORD PTR [edx+16], ecx
; 1948 : goto stream_next;
jmp $stream_next$93
$LN21@xmlStreamP:
; 1949 : }
; 1950 :
; 1951 : /*
; 1952 : * Check evolution of existing states
; 1953 : */
; 1954 : i = 0;
mov DWORD PTR _i$[ebp], 0
; 1955 : m = stream->nbState;
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+8]
mov DWORD PTR _m$[ebp], ecx
$LN4@xmlStreamP:
; 1956 : while (i < m) {
mov edx, DWORD PTR _i$[ebp]
cmp edx, DWORD PTR _m$[ebp]
jge $LN5@xmlStreamP
; 1957 : if ((comp->flags & XML_STREAM_DESC) == 0) {
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+16]
and ecx, 65536 ; 00010000H
jne SHORT $LN22@xmlStreamP
; 1958 : /*
; 1959 : * If there is no "//", then only the last
; 1960 : * added state is of interest.
; 1961 : */
; 1962 : stepNr = stream->states[2 * (stream->nbState -1)];
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+8]
lea ecx, DWORD PTR [eax+eax-2]
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+20]
mov ecx, DWORD PTR [eax+ecx*4]
mov DWORD PTR _stepNr$[ebp], ecx
; 1963 : /*
; 1964 : * TODO: Security check, should not happen, remove it.
; 1965 : */
; 1966 : if (stream->states[(2 * (stream->nbState -1)) + 1] <
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+8]
lea ecx, DWORD PTR [eax+eax-2]
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+20]
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [eax+ecx*4+4]
cmp eax, DWORD PTR [edx+16]
jge SHORT $LN24@xmlStreamP
; 1967 : stream->level) {
; 1968 : return (-1);
or eax, -1
jmp $LN1@xmlStreamP
$LN24@xmlStreamP:
; 1969 : }
; 1970 : desc = 0;
mov DWORD PTR _desc$[ebp], 0
; 1971 : /* loop-stopper */
; 1972 : i = m;
mov ecx, DWORD PTR _m$[ebp]
mov DWORD PTR _i$[ebp], ecx
; 1973 : } else {
jmp SHORT $LN23@xmlStreamP
$LN22@xmlStreamP:
; 1974 : /*
; 1975 : * If there are "//", then we need to process every "//"
; 1976 : * occuring in the states, plus any other state for this
; 1977 : * level.
; 1978 : */
; 1979 : stepNr = stream->states[2 * i];
mov edx, DWORD PTR _i$[ebp]
shl edx, 1
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+20]
mov edx, DWORD PTR [ecx+edx*4]
mov DWORD PTR _stepNr$[ebp], edx
; 1980 :
; 1981 : /* TODO: should not happen anymore: dead states */
; 1982 : if (stepNr < 0)
cmp DWORD PTR _stepNr$[ebp], 0
jge SHORT $LN25@xmlStreamP
; 1983 : goto next_state;
jmp $next_state$94
$LN25@xmlStreamP:
; 1984 :
; 1985 : tmp = stream->states[(2 * i) + 1];
mov eax, DWORD PTR _i$[ebp]
shl eax, 1
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+20]
mov eax, DWORD PTR [edx+eax*4+4]
mov DWORD PTR _tmp$[ebp], eax
; 1986 :
; 1987 : /* skip new states just added */
; 1988 : if (tmp > stream->level)
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR _tmp$[ebp]
cmp edx, DWORD PTR [ecx+16]
jle SHORT $LN26@xmlStreamP
; 1989 : goto next_state;
jmp $next_state$94
$LN26@xmlStreamP:
; 1990 :
; 1991 : /* skip states at ancestor levels, except if "//" */
; 1992 : desc = comp->steps[stepNr].flags & XML_STREAM_STEP_DESC;
mov eax, DWORD PTR _stepNr$[ebp]
shl eax, 4
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+12]
mov eax, DWORD PTR [edx+eax]
and eax, 1
mov DWORD PTR _desc$[ebp], eax
; 1993 : if ((tmp < stream->level) && (!desc))
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR _tmp$[ebp]
cmp edx, DWORD PTR [ecx+16]
jge SHORT $LN23@xmlStreamP
cmp DWORD PTR _desc$[ebp], 0
jne SHORT $LN23@xmlStreamP
; 1994 : goto next_state;
jmp $next_state$94
$LN23@xmlStreamP:
; 1995 : }
; 1996 : /*
; 1997 : * Check for correct node-type.
; 1998 : */
; 1999 : step = comp->steps[stepNr];
mov eax, DWORD PTR _stepNr$[ebp]
shl eax, 4
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+12]
add edx, eax
mov eax, DWORD PTR [edx]
mov DWORD PTR _step$[ebp], eax
mov ecx, DWORD PTR [edx+4]
mov DWORD PTR _step$[ebp+4], ecx
mov eax, DWORD PTR [edx+8]
mov DWORD PTR _step$[ebp+8], eax
mov ecx, DWORD PTR [edx+12]
mov DWORD PTR _step$[ebp+12], ecx
; 2000 : if (step.nodeType != nodeType) {
mov edx, DWORD PTR _step$[ebp+12]
cmp edx, DWORD PTR _nodeType$[ebp]
je SHORT $LN28@xmlStreamP
; 2001 : if (step.nodeType == XML_ATTRIBUTE_NODE) {
cmp DWORD PTR _step$[ebp+12], 2
jne SHORT $LN29@xmlStreamP
; 2002 : /*
; 2003 : * Block this expression for deeper evaluation.
; 2004 : */
; 2005 : if ((comp->flags & XML_STREAM_DESC) == 0)
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+16]
and ecx, 65536 ; 00010000H
jne SHORT $LN31@xmlStreamP
; 2006 : stream->blockLevel = stream->level +1;
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+16]
add eax, 1
mov ecx, DWORD PTR _stream$[ebp]
mov DWORD PTR [ecx+28], eax
$LN31@xmlStreamP:
; 2007 : goto next_state;
jmp $next_state$94
jmp SHORT $LN28@xmlStreamP
$LN29@xmlStreamP:
; 2008 : } else if (step.nodeType != XML_STREAM_ANY_NODE)
cmp DWORD PTR _step$[ebp+12], 100 ; 00000064H
je SHORT $LN28@xmlStreamP
; 2009 : goto next_state;
jmp $next_state$94
$LN28@xmlStreamP:
; 2010 : }
; 2011 : /*
; 2012 : * Compare local/namespace-name.
; 2013 : */
; 2014 : match = 0;
mov DWORD PTR _match$[ebp], 0
; 2015 : if (step.nodeType == XML_STREAM_ANY_NODE) {
cmp DWORD PTR _step$[ebp+12], 100 ; 00000064H
jne SHORT $LN33@xmlStreamP
; 2016 : match = 1;
mov DWORD PTR _match$[ebp], 1
jmp $LN34@xmlStreamP
$LN33@xmlStreamP:
; 2017 : } else if (step.name == NULL) {
cmp DWORD PTR _step$[ebp+4], 0
jne SHORT $LN35@xmlStreamP
; 2018 : if (step.ns == NULL) {
cmp DWORD PTR _step$[ebp+8], 0
jne SHORT $LN37@xmlStreamP
; 2019 : /*
; 2020 : * This lets through all elements/attributes.
; 2021 : */
; 2022 : match = 1;
mov DWORD PTR _match$[ebp], 1
jmp SHORT $LN38@xmlStreamP
$LN37@xmlStreamP:
; 2023 : } else if (ns != NULL)
cmp DWORD PTR _ns$[ebp], 0
je SHORT $LN38@xmlStreamP
; 2024 : match = xmlStrEqual(step.ns, ns);
mov edx, DWORD PTR _ns$[ebp]
push edx
mov eax, DWORD PTR _step$[ebp+8]
push eax
call _xmlStrEqual
add esp, 8
mov DWORD PTR _match$[ebp], eax
$LN38@xmlStreamP:
; 2025 : } else if (((step.ns != NULL) == (ns != NULL)) &&
jmp $LN34@xmlStreamP
$LN35@xmlStreamP:
; 2026 : (name != NULL) &&
; 2027 : (step.name[0] == name[0]) &&
; 2028 : xmlStrEqual(step.name, name) &&
cmp DWORD PTR _step$[ebp+8], 0
je SHORT $LN82@xmlStreamP
mov DWORD PTR tv232[ebp], 1
jmp SHORT $LN83@xmlStreamP
$LN82@xmlStreamP:
mov DWORD PTR tv232[ebp], 0
$LN83@xmlStreamP:
cmp DWORD PTR _ns$[ebp], 0
je SHORT $LN80@xmlStreamP
mov DWORD PTR tv231[ebp], 1
jmp SHORT $LN81@xmlStreamP
$LN80@xmlStreamP:
mov DWORD PTR tv231[ebp], 0
$LN81@xmlStreamP:
mov ecx, DWORD PTR tv232[ebp]
cmp ecx, DWORD PTR tv231[ebp]
jne SHORT $LN34@xmlStreamP
cmp DWORD PTR _name$[ebp], 0
je SHORT $LN34@xmlStreamP
mov edx, 1
imul eax, edx, 0
mov ecx, DWORD PTR _step$[ebp+4]
movzx edx, BYTE PTR [ecx+eax]
mov eax, 1
imul ecx, eax, 0
mov eax, DWORD PTR _name$[ebp]
movzx ecx, BYTE PTR [eax+ecx]
cmp edx, ecx
jne SHORT $LN34@xmlStreamP
mov edx, DWORD PTR _name$[ebp]
push edx
mov eax, DWORD PTR _step$[ebp+4]
push eax
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN34@xmlStreamP
mov ecx, DWORD PTR _step$[ebp+8]
cmp ecx, DWORD PTR _ns$[ebp]
je SHORT $LN41@xmlStreamP
mov edx, DWORD PTR _ns$[ebp]
push edx
mov eax, DWORD PTR _step$[ebp+8]
push eax
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN34@xmlStreamP
$LN41@xmlStreamP:
; 2029 : ((step.ns == ns) || xmlStrEqual(step.ns, ns)))
; 2030 : {
; 2031 : match = 1;
mov DWORD PTR _match$[ebp], 1
$LN34@xmlStreamP:
; 2032 : }
; 2033 : #if 0
; 2034 : /*
; 2035 : * TODO: Pointer comparison won't work, since not guaranteed that the given
; 2036 : * values are in the same dict; especially if it's the namespace name,
; 2037 : * normally coming from ns->href. We need a namespace dict mechanism !
; 2038 : */
; 2039 : } else if (comp->dict) {
; 2040 : if (step.name == NULL) {
; 2041 : if (step.ns == NULL)
; 2042 : match = 1;
; 2043 : else
; 2044 : match = (step.ns == ns);
; 2045 : } else {
; 2046 : match = ((step.name == name) && (step.ns == ns));
; 2047 : }
; 2048 : #endif /* if 0 ------------------------------------------------------- */
; 2049 : if (match) {
cmp DWORD PTR _match$[ebp], 0
je SHORT $LN42@xmlStreamP
; 2050 : final = step.flags & XML_STREAM_STEP_FINAL;
mov ecx, DWORD PTR _step$[ebp]
and ecx, 2
mov DWORD PTR _final$[ebp], ecx
; 2051 : if (desc) {
cmp DWORD PTR _desc$[ebp], 0
je SHORT $LN43@xmlStreamP
; 2052 : if (final) {
cmp DWORD PTR _final$[ebp], 0
je SHORT $LN45@xmlStreamP
; 2053 : ret = 1;
mov DWORD PTR _ret$[ebp], 1
; 2054 : } else {
jmp SHORT $LN46@xmlStreamP
$LN45@xmlStreamP:
; 2055 : /* descending match create a new state */
; 2056 : xmlStreamCtxtAddState(stream, stepNr + 1,
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+16]
add eax, 1
push eax
mov ecx, DWORD PTR _stepNr$[ebp]
add ecx, 1
push ecx
mov edx, DWORD PTR _stream$[ebp]
push edx
call _xmlStreamCtxtAddState
add esp, 12 ; 0000000cH
$LN46@xmlStreamP:
; 2057 : stream->level + 1);
; 2058 : }
; 2059 : } else {
jmp SHORT $LN44@xmlStreamP
$LN43@xmlStreamP:
; 2060 : if (final) {
cmp DWORD PTR _final$[ebp], 0
je SHORT $LN47@xmlStreamP
; 2061 : ret = 1;
mov DWORD PTR _ret$[ebp], 1
; 2062 : } else {
jmp SHORT $LN44@xmlStreamP
$LN47@xmlStreamP:
; 2063 : xmlStreamCtxtAddState(stream, stepNr + 1,
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+16]
add ecx, 1
push ecx
mov edx, DWORD PTR _stepNr$[ebp]
add edx, 1
push edx
mov eax, DWORD PTR _stream$[ebp]
push eax
call _xmlStreamCtxtAddState
add esp, 12 ; 0000000cH
$LN44@xmlStreamP:
; 2064 : stream->level + 1);
; 2065 : }
; 2066 : }
; 2067 : if ((ret != 1) && (step.flags & XML_STREAM_STEP_IN_SET)) {
cmp DWORD PTR _ret$[ebp], 1
je SHORT $LN42@xmlStreamP
mov ecx, DWORD PTR _step$[ebp]
and ecx, 32 ; 00000020H
je SHORT $LN42@xmlStreamP
; 2068 : /*
; 2069 : * Check if we have a special case like "foo/bar//.", where
; 2070 : * "foo" is selected as well.
; 2071 : */
; 2072 : ret = 1;
mov DWORD PTR _ret$[ebp], 1
$LN42@xmlStreamP:
; 2073 : }
; 2074 : }
; 2075 : if (((comp->flags & XML_STREAM_DESC) == 0) &&
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 65536 ; 00010000H
jne SHORT $next_state$94
cmp DWORD PTR _match$[ebp], 0
je SHORT $LN51@xmlStreamP
cmp DWORD PTR _final$[ebp], 0
je SHORT $next_state$94
$LN51@xmlStreamP:
; 2076 : ((! match) || final)) {
; 2077 : /*
; 2078 : * Mark this expression as blocked for any evaluation at
; 2079 : * deeper levels. Note that this includes "/foo"
; 2080 : * expressions if the *pattern* behaviour is used.
; 2081 : */
; 2082 : stream->blockLevel = stream->level +1;
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+16]
add edx, 1
mov eax, DWORD PTR _stream$[ebp]
mov DWORD PTR [eax+28], edx
$next_state$94:
; 2083 : }
; 2084 : next_state:
; 2085 : i++;
mov ecx, DWORD PTR _i$[ebp]
add ecx, 1
mov DWORD PTR _i$[ebp], ecx
; 2086 : }
jmp $LN4@xmlStreamP
$LN5@xmlStreamP:
; 2087 :
; 2088 : stream->level++;
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+16]
add eax, 1
mov ecx, DWORD PTR _stream$[ebp]
mov DWORD PTR [ecx+16], eax
; 2089 :
; 2090 : /*
; 2091 : * Re/enter the expression.
; 2092 : * Don't reenter if it's an absolute expression like "/foo",
; 2093 : * except "//foo".
; 2094 : */
; 2095 : step = comp->steps[0];
mov edx, 16 ; 00000010H
imul eax, edx, 0
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+12]
add edx, eax
mov eax, DWORD PTR [edx]
mov DWORD PTR _step$[ebp], eax
mov ecx, DWORD PTR [edx+4]
mov DWORD PTR _step$[ebp+4], ecx
mov eax, DWORD PTR [edx+8]
mov DWORD PTR _step$[ebp+8], eax
mov ecx, DWORD PTR [edx+12]
mov DWORD PTR _step$[ebp+12], ecx
; 2096 : if (step.flags & XML_STREAM_STEP_ROOT)
mov edx, DWORD PTR _step$[ebp]
and edx, 4
je SHORT $LN52@xmlStreamP
; 2097 : goto stream_next;
jmp $stream_next$93
$LN52@xmlStreamP:
; 2098 :
; 2099 : desc = step.flags & XML_STREAM_STEP_DESC;
mov eax, DWORD PTR _step$[ebp]
and eax, 1
mov DWORD PTR _desc$[ebp], eax
; 2100 : if (stream->flags & XML_PATTERN_NOTPATTERN) {
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+24]
and edx, 7
je SHORT $compare$95
; 2101 : /*
; 2102 : * Re/enter the expression if it is a "descendant" one,
; 2103 : * or if we are at the 1st level of evaluation.
; 2104 : */
; 2105 :
; 2106 : if (stream->level == 1) {
mov eax, DWORD PTR _stream$[ebp]
cmp DWORD PTR [eax+16], 1
jne SHORT $LN54@xmlStreamP
; 2107 : if (XML_STREAM_XS_IDC(stream)) {
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+24]
and edx, 6
je SHORT $LN55@xmlStreamP
; 2108 : /*
; 2109 : * XS-IDC: The missing "self::node()" will always
; 2110 : * match the first given node.
; 2111 : */
; 2112 : goto stream_next;
jmp $stream_next$93
; 2113 : } else
jmp SHORT $LN54@xmlStreamP
$LN55@xmlStreamP:
; 2114 : goto compare;
jmp SHORT $compare$95
$LN54@xmlStreamP:
; 2115 : }
; 2116 : /*
; 2117 : * A "//" is always reentrant.
; 2118 : */
; 2119 : if (desc)
cmp DWORD PTR _desc$[ebp], 0
je SHORT $LN57@xmlStreamP
; 2120 : goto compare;
jmp SHORT $compare$95
$LN57@xmlStreamP:
; 2121 :
; 2122 : /*
; 2123 : * XS-IDC: Process the 2nd level, since the missing
; 2124 : * "self::node()" is responsible for the 2nd level being
; 2125 : * the real start level.
; 2126 : */
; 2127 : if ((stream->level == 2) && XML_STREAM_XS_IDC(stream))
mov eax, DWORD PTR _stream$[ebp]
cmp DWORD PTR [eax+16], 2
jne SHORT $LN58@xmlStreamP
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+24]
and edx, 6
je SHORT $LN58@xmlStreamP
; 2128 : goto compare;
jmp SHORT $compare$95
$LN58@xmlStreamP:
; 2129 :
; 2130 : goto stream_next;
jmp $stream_next$93
$compare$95:
; 2131 : }
; 2132 :
; 2133 : compare:
; 2134 : /*
; 2135 : * Check expected node-type.
; 2136 : */
; 2137 : if (step.nodeType != nodeType) {
mov eax, DWORD PTR _step$[ebp+12]
cmp eax, DWORD PTR _nodeType$[ebp]
je SHORT $LN59@xmlStreamP
; 2138 : if (nodeType == XML_ATTRIBUTE_NODE)
cmp DWORD PTR _nodeType$[ebp], 2
jne SHORT $LN60@xmlStreamP
; 2139 : goto stream_next;
jmp $stream_next$93
jmp SHORT $LN59@xmlStreamP
$LN60@xmlStreamP:
; 2140 : else if (step.nodeType != XML_STREAM_ANY_NODE)
cmp DWORD PTR _step$[ebp+12], 100 ; 00000064H
je SHORT $LN59@xmlStreamP
; 2141 : goto stream_next;
jmp $stream_next$93
$LN59@xmlStreamP:
; 2142 : }
; 2143 : /*
; 2144 : * Compare local/namespace-name.
; 2145 : */
; 2146 : match = 0;
mov DWORD PTR _match$[ebp], 0
; 2147 : if (step.nodeType == XML_STREAM_ANY_NODE) {
cmp DWORD PTR _step$[ebp+12], 100 ; 00000064H
jne SHORT $LN63@xmlStreamP
; 2148 : match = 1;
mov DWORD PTR _match$[ebp], 1
jmp $LN64@xmlStreamP
$LN63@xmlStreamP:
; 2149 : } else if (step.name == NULL) {
cmp DWORD PTR _step$[ebp+4], 0
jne SHORT $LN65@xmlStreamP
; 2150 : if (step.ns == NULL) {
cmp DWORD PTR _step$[ebp+8], 0
jne SHORT $LN67@xmlStreamP
; 2151 : /*
; 2152 : * This lets through all elements/attributes.
; 2153 : */
; 2154 : match = 1;
mov DWORD PTR _match$[ebp], 1
jmp SHORT $LN68@xmlStreamP
$LN67@xmlStreamP:
; 2155 : } else if (ns != NULL)
cmp DWORD PTR _ns$[ebp], 0
je SHORT $LN68@xmlStreamP
; 2156 : match = xmlStrEqual(step.ns, ns);
mov ecx, DWORD PTR _ns$[ebp]
push ecx
mov edx, DWORD PTR _step$[ebp+8]
push edx
call _xmlStrEqual
add esp, 8
mov DWORD PTR _match$[ebp], eax
$LN68@xmlStreamP:
; 2157 : } else if (((step.ns != NULL) == (ns != NULL)) &&
jmp $LN64@xmlStreamP
$LN65@xmlStreamP:
; 2158 : (name != NULL) &&
; 2159 : (step.name[0] == name[0]) &&
; 2160 : xmlStrEqual(step.name, name) &&
cmp DWORD PTR _step$[ebp+8], 0
je SHORT $LN86@xmlStreamP
mov DWORD PTR tv318[ebp], 1
jmp SHORT $LN87@xmlStreamP
$LN86@xmlStreamP:
mov DWORD PTR tv318[ebp], 0
$LN87@xmlStreamP:
cmp DWORD PTR _ns$[ebp], 0
je SHORT $LN84@xmlStreamP
mov DWORD PTR tv317[ebp], 1
jmp SHORT $LN85@xmlStreamP
$LN84@xmlStreamP:
mov DWORD PTR tv317[ebp], 0
$LN85@xmlStreamP:
mov eax, DWORD PTR tv318[ebp]
cmp eax, DWORD PTR tv317[ebp]
jne SHORT $LN64@xmlStreamP
cmp DWORD PTR _name$[ebp], 0
je SHORT $LN64@xmlStreamP
mov ecx, 1
imul edx, ecx, 0
mov eax, DWORD PTR _step$[ebp+4]
movzx ecx, BYTE PTR [eax+edx]
mov edx, 1
imul eax, edx, 0
mov edx, DWORD PTR _name$[ebp]
movzx eax, BYTE PTR [edx+eax]
cmp ecx, eax
jne SHORT $LN64@xmlStreamP
mov ecx, DWORD PTR _name$[ebp]
push ecx
mov edx, DWORD PTR _step$[ebp+4]
push edx
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN64@xmlStreamP
mov eax, DWORD PTR _step$[ebp+8]
cmp eax, DWORD PTR _ns$[ebp]
je SHORT $LN71@xmlStreamP
mov ecx, DWORD PTR _ns$[ebp]
push ecx
mov edx, DWORD PTR _step$[ebp+8]
push edx
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN64@xmlStreamP
$LN71@xmlStreamP:
; 2161 : ((step.ns == ns) || xmlStrEqual(step.ns, ns)))
; 2162 : {
; 2163 : match = 1;
mov DWORD PTR _match$[ebp], 1
$LN64@xmlStreamP:
; 2164 : }
; 2165 : final = step.flags & XML_STREAM_STEP_FINAL;
mov eax, DWORD PTR _step$[ebp]
and eax, 2
mov DWORD PTR _final$[ebp], eax
; 2166 : if (match) {
cmp DWORD PTR _match$[ebp], 0
je SHORT $LN72@xmlStreamP
; 2167 : if (final)
cmp DWORD PTR _final$[ebp], 0
je SHORT $LN73@xmlStreamP
; 2168 : ret = 1;
mov DWORD PTR _ret$[ebp], 1
jmp SHORT $LN74@xmlStreamP
$LN73@xmlStreamP:
; 2169 : else
; 2170 : xmlStreamCtxtAddState(stream, 1, stream->level);
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+16]
push edx
push 1
mov eax, DWORD PTR _stream$[ebp]
push eax
call _xmlStreamCtxtAddState
add esp, 12 ; 0000000cH
$LN74@xmlStreamP:
; 2171 : if ((ret != 1) && (step.flags & XML_STREAM_STEP_IN_SET)) {
cmp DWORD PTR _ret$[ebp], 1
je SHORT $LN72@xmlStreamP
mov ecx, DWORD PTR _step$[ebp]
and ecx, 32 ; 00000020H
je SHORT $LN72@xmlStreamP
; 2172 : /*
; 2173 : * Check if we have a special case like "foo//.", where
; 2174 : * "foo" is selected as well.
; 2175 : */
; 2176 : ret = 1;
mov DWORD PTR _ret$[ebp], 1
$LN72@xmlStreamP:
; 2177 : }
; 2178 : }
; 2179 : if (((comp->flags & XML_STREAM_DESC) == 0) &&
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 65536 ; 00010000H
jne SHORT $stream_next$93
cmp DWORD PTR _match$[ebp], 0
je SHORT $LN77@xmlStreamP
cmp DWORD PTR _final$[ebp], 0
je SHORT $stream_next$93
$LN77@xmlStreamP:
; 2180 : ((! match) || final)) {
; 2181 : /*
; 2182 : * Mark this expression as blocked for any evaluation at
; 2183 : * deeper levels.
; 2184 : */
; 2185 : stream->blockLevel = stream->level;
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+16]
mov DWORD PTR [ecx+28], eax
$stream_next$93:
; 2186 : }
; 2187 :
; 2188 : stream_next:
; 2189 : stream = stream->next;
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR _stream$[ebp], edx
; 2190 : } /* while stream != NULL */
jmp $LN2@xmlStreamP
$LN3@xmlStreamP:
; 2191 :
; 2192 : if (err > 0)
cmp DWORD PTR _err$[ebp], 0
jle SHORT $LN78@xmlStreamP
; 2193 : ret = -1;
mov DWORD PTR _ret$[ebp], -1
$LN78@xmlStreamP:
; 2194 : #ifdef DEBUG_STREAMING
; 2195 : xmlDebugStreamCtxt(orig, ret);
; 2196 : #endif
; 2197 : return(ret);
mov eax, DWORD PTR _ret$[ebp]
$LN1@xmlStreamP:
; 2198 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $LN92@xmlStreamP
call @_RTC_CheckStackVars@8
pop eax
pop edx
pop edi
add esp, 80 ; 00000050H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
npad 3
$LN92@xmlStreamP:
DD 1
DD $LN91@xmlStreamP
$LN91@xmlStreamP:
DD -60 ; ffffffc4H
DD 16 ; 00000010H
DD $LN90@xmlStreamP
$LN90@xmlStreamP:
DB 115 ; 00000073H
DB 116 ; 00000074H
DB 101 ; 00000065H
DB 112 ; 00000070H
DB 0
_xmlStreamPushInternal ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlStreamCtxtAddState
_TEXT SEGMENT
_cur$1 = -8 ; size = 4
_i$ = -4 ; size = 4
_comp$ = 8 ; size = 4
_idx$ = 12 ; size = 4
_level$ = 16 ; size = 4
_xmlStreamCtxtAddState PROC ; COMDAT
; 1814 : xmlStreamCtxtAddState(xmlStreamCtxtPtr comp, int idx, int level) {
push ebp
mov ebp, esp
sub esp, 8
push esi
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 1815 : int i;
; 1816 : for (i = 0;i < comp->nbState;i++) {
mov DWORD PTR _i$[ebp], 0
jmp SHORT $LN4@xmlStreamC
$LN2@xmlStreamC:
mov eax, DWORD PTR _i$[ebp]
add eax, 1
mov DWORD PTR _i$[ebp], eax
$LN4@xmlStreamC:
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR _i$[ebp]
cmp edx, DWORD PTR [ecx+8]
jge SHORT $LN3@xmlStreamC
; 1817 : if (comp->states[2 * i] < 0) {
mov eax, DWORD PTR _i$[ebp]
shl eax, 1
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+20]
cmp DWORD PTR [edx+eax*4], 0
jge SHORT $LN5@xmlStreamC
; 1818 : comp->states[2 * i] = idx;
mov eax, DWORD PTR _i$[ebp]
shl eax, 1
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+20]
mov ecx, DWORD PTR _idx$[ebp]
mov DWORD PTR [edx+eax*4], ecx
; 1819 : comp->states[2 * i + 1] = level;
mov edx, DWORD PTR _i$[ebp]
shl edx, 1
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+20]
mov eax, DWORD PTR _level$[ebp]
mov DWORD PTR [ecx+edx*4+4], eax
; 1820 : return(i);
mov eax, DWORD PTR _i$[ebp]
jmp $LN1@xmlStreamC
$LN5@xmlStreamC:
; 1821 : }
; 1822 : }
jmp SHORT $LN2@xmlStreamC
$LN3@xmlStreamC:
; 1823 : if (comp->nbState >= comp->maxState) {
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [ecx+8]
cmp eax, DWORD PTR [edx+12]
jl SHORT $LN6@xmlStreamC
; 1824 : int *cur;
; 1825 :
; 1826 : cur = (int *) xmlRealloc(comp->states,
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+12]
shl edx, 2
shl edx, 2
mov esi, esp
push edx
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+20]
push ecx
call DWORD PTR _xmlRealloc
add esp, 8
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _cur$1[ebp], eax
; 1827 : comp->maxState * 4 * sizeof(int));
; 1828 : if (cur == NULL) {
cmp DWORD PTR _cur$1[ebp], 0
jne SHORT $LN7@xmlStreamC
; 1829 : ERROR(NULL, NULL, NULL,
; 1830 : "xmlNewStreamCtxt: malloc failed\n");
; 1831 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlStreamC
$LN7@xmlStreamC:
; 1832 : }
; 1833 : comp->states = cur;
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR _cur$1[ebp]
mov DWORD PTR [edx+20], eax
; 1834 : comp->maxState *= 2;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+12]
shl edx, 1
mov eax, DWORD PTR _comp$[ebp]
mov DWORD PTR [eax+12], edx
$LN6@xmlStreamC:
; 1835 : }
; 1836 : comp->states[2 * comp->nbState] = idx;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+8]
shl edx, 1
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+20]
mov eax, DWORD PTR _idx$[ebp]
mov DWORD PTR [ecx+edx*4], eax
; 1837 : comp->states[2 * comp->nbState++ + 1] = level;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+8]
shl edx, 1
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+20]
mov eax, DWORD PTR _level$[ebp]
mov DWORD PTR [ecx+edx*4+4], eax
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+8]
add edx, 1
mov eax, DWORD PTR _comp$[ebp]
mov DWORD PTR [eax+8], edx
; 1838 : return(comp->nbState - 1);
mov ecx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [ecx+8]
sub eax, 1
$LN1@xmlStreamC:
; 1839 : }
pop esi
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlStreamCtxtAddState ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlNewStreamCtxt
_TEXT SEGMENT
_cur$ = -4 ; size = 4
_stream$ = 8 ; size = 4
_xmlNewStreamCtxt PROC ; COMDAT
; 1760 : xmlNewStreamCtxt(xmlStreamCompPtr stream) {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 1761 : xmlStreamCtxtPtr cur;
; 1762 :
; 1763 : cur = (xmlStreamCtxtPtr) xmlMalloc(sizeof(xmlStreamCtxt));
mov esi, esp
push 32 ; 00000020H
call DWORD PTR _xmlMalloc
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _cur$[ebp], eax
; 1764 : if (cur == NULL) {
cmp DWORD PTR _cur$[ebp], 0
jne SHORT $LN2@xmlNewStre
; 1765 : ERROR(NULL, NULL, NULL,
; 1766 : "xmlNewStreamCtxt: malloc failed\n");
; 1767 : return(NULL);
xor eax, eax
jmp $LN1@xmlNewStre
$LN2@xmlNewStre:
; 1768 : }
; 1769 : memset(cur, 0, sizeof(xmlStreamCtxt));
xor eax, eax
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [ecx], eax
mov DWORD PTR [ecx+4], eax
mov DWORD PTR [ecx+8], eax
mov DWORD PTR [ecx+12], eax
mov DWORD PTR [ecx+16], eax
mov DWORD PTR [ecx+20], eax
mov DWORD PTR [ecx+24], eax
mov DWORD PTR [ecx+28], eax
; 1770 : cur->states = (int *) xmlMalloc(4 * 2 * sizeof(int));
mov esi, esp
push 32 ; 00000020H
call DWORD PTR _xmlMalloc
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
mov edx, DWORD PTR _cur$[ebp]
mov DWORD PTR [edx+20], eax
; 1771 : if (cur->states == NULL) {
mov eax, DWORD PTR _cur$[ebp]
cmp DWORD PTR [eax+20], 0
jne SHORT $LN3@xmlNewStre
; 1772 : xmlFree(cur);
mov esi, esp
mov ecx, DWORD PTR _cur$[ebp]
push ecx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
; 1773 : ERROR(NULL, NULL, NULL,
; 1774 : "xmlNewStreamCtxt: malloc failed\n");
; 1775 : return(NULL);
xor eax, eax
jmp SHORT $LN1@xmlNewStre
$LN3@xmlNewStre:
; 1776 : }
; 1777 : cur->nbState = 0;
mov edx, DWORD PTR _cur$[ebp]
mov DWORD PTR [edx+8], 0
; 1778 : cur->maxState = 4;
mov eax, DWORD PTR _cur$[ebp]
mov DWORD PTR [eax+12], 4
; 1779 : cur->level = 0;
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [ecx+16], 0
; 1780 : cur->comp = stream;
mov edx, DWORD PTR _cur$[ebp]
mov eax, DWORD PTR _stream$[ebp]
mov DWORD PTR [edx+4], eax
; 1781 : cur->blockLevel = -1;
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [ecx+28], -1
; 1782 : return(cur);
mov eax, DWORD PTR _cur$[ebp]
$LN1@xmlNewStre:
; 1783 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlNewStreamCtxt ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlStreamCompile
_TEXT SEGMENT
tv148 = -48 ; size = 4
_step$ = -40 ; size = 12
_prevs$ = -24 ; size = 4
_flags$ = -20 ; size = 4
_root$ = -16 ; size = 4
_s$ = -12 ; size = 4
_i$ = -8 ; size = 4
_stream$ = -4 ; size = 4
_comp$ = 8 ; size = 4
_xmlStreamCompile PROC ; COMDAT
; 1578 : xmlStreamCompile(xmlPatternPtr comp) {
push ebp
mov ebp, esp
sub esp, 48 ; 00000030H
push edi
lea edi, DWORD PTR [ebp-48]
mov ecx, 12 ; 0000000cH
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 1579 : xmlStreamCompPtr stream;
; 1580 : int i, s = 0, root = 0, flags = 0, prevs = -1;
mov DWORD PTR _s$[ebp], 0
mov DWORD PTR _root$[ebp], 0
mov DWORD PTR _flags$[ebp], 0
mov DWORD PTR _prevs$[ebp], -1
; 1581 : xmlStepOp step;
; 1582 :
; 1583 : if ((comp == NULL) || (comp->steps == NULL))
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN8@xmlStreamC
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN7@xmlStreamC
$LN8@xmlStreamC:
; 1584 : return(-1);
or eax, -1
jmp $LN1@xmlStreamC
$LN7@xmlStreamC:
; 1585 : /*
; 1586 : * special case for .
; 1587 : */
; 1588 : if ((comp->nbStep == 1) &&
; 1589 : (comp->steps[0].op == XML_OP_ELEM) &&
; 1590 : (comp->steps[0].value == NULL) &&
mov ecx, DWORD PTR _comp$[ebp]
cmp DWORD PTR [ecx+20], 1
jne SHORT $LN9@xmlStreamC
mov edx, 12 ; 0000000cH
imul eax, edx, 0
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+28]
cmp DWORD PTR [edx+eax], 2
jne SHORT $LN9@xmlStreamC
mov eax, 12 ; 0000000cH
imul ecx, eax, 0
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+28]
cmp DWORD PTR [eax+ecx+4], 0
jne SHORT $LN9@xmlStreamC
mov ecx, 12 ; 0000000cH
imul edx, ecx, 0
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
cmp DWORD PTR [ecx+edx+8], 0
jne SHORT $LN9@xmlStreamC
; 1591 : (comp->steps[0].value2 == NULL)) {
; 1592 : stream = xmlNewStreamComp(0);
push 0
call _xmlNewStreamComp
add esp, 4
mov DWORD PTR _stream$[ebp], eax
; 1593 : if (stream == NULL)
cmp DWORD PTR _stream$[ebp], 0
jne SHORT $LN10@xmlStreamC
; 1594 : return(-1);
or eax, -1
jmp $LN1@xmlStreamC
$LN10@xmlStreamC:
; 1595 : /* Note that the stream will have no steps in this case. */
; 1596 : stream->flags |= XML_STREAM_FINAL_IS_ANY_NODE;
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+16]
or eax, 16384 ; 00004000H
mov ecx, DWORD PTR _stream$[ebp]
mov DWORD PTR [ecx+16], eax
; 1597 : comp->stream = stream;
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR _stream$[ebp]
mov DWORD PTR [edx+32], eax
; 1598 : return(0);
xor eax, eax
jmp $LN1@xmlStreamC
$LN9@xmlStreamC:
; 1599 : }
; 1600 :
; 1601 : stream = xmlNewStreamComp((comp->nbStep / 2) + 1);
mov ecx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [ecx+20]
cdq
sub eax, edx
sar eax, 1
add eax, 1
push eax
call _xmlNewStreamComp
add esp, 4
mov DWORD PTR _stream$[ebp], eax
; 1602 : if (stream == NULL)
cmp DWORD PTR _stream$[ebp], 0
jne SHORT $LN11@xmlStreamC
; 1603 : return(-1);
or eax, -1
jmp $LN1@xmlStreamC
$LN11@xmlStreamC:
; 1604 : if (comp->dict != NULL) {
mov edx, DWORD PTR _comp$[ebp]
cmp DWORD PTR [edx+4], 0
je SHORT $LN12@xmlStreamC
; 1605 : stream->dict = comp->dict;
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+4]
mov DWORD PTR [eax], edx
; 1606 : xmlDictReference(stream->dict);
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax]
push ecx
call _xmlDictReference
add esp, 4
$LN12@xmlStreamC:
; 1607 : }
; 1608 :
; 1609 : i = 0;
mov DWORD PTR _i$[ebp], 0
; 1610 : if (comp->flags & PAT_FROM_ROOT)
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 256 ; 00000100H
je SHORT $LN13@xmlStreamC
; 1611 : stream->flags |= XML_STREAM_FROM_ROOT;
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+16]
or edx, 32768 ; 00008000H
mov eax, DWORD PTR _stream$[ebp]
mov DWORD PTR [eax+16], edx
$LN13@xmlStreamC:
; 1612 :
; 1613 : for (;i < comp->nbStep;i++) {
jmp SHORT $LN4@xmlStreamC
$LN2@xmlStreamC:
mov ecx, DWORD PTR _i$[ebp]
add ecx, 1
mov DWORD PTR _i$[ebp], ecx
$LN4@xmlStreamC:
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR _i$[ebp]
cmp eax, DWORD PTR [edx+20]
jge $LN3@xmlStreamC
; 1614 : step = comp->steps[i];
imul ecx, DWORD PTR _i$[ebp], 12
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+28]
add eax, ecx
mov ecx, DWORD PTR [eax]
mov DWORD PTR _step$[ebp], ecx
mov edx, DWORD PTR [eax+4]
mov DWORD PTR _step$[ebp+4], edx
mov eax, DWORD PTR [eax+8]
mov DWORD PTR _step$[ebp+8], eax
; 1615 : switch (step.op) {
mov ecx, DWORD PTR _step$[ebp]
mov DWORD PTR tv148[ebp], ecx
mov edx, DWORD PTR tv148[ebp]
sub edx, 1
mov DWORD PTR tv148[ebp], edx
cmp DWORD PTR tv148[ebp], 7
ja $LN5@xmlStreamC
mov eax, DWORD PTR tv148[ebp]
jmp DWORD PTR $LN47@xmlStreamC[eax*4]
; 1616 : case XML_OP_END:
; 1617 : break;
jmp $LN5@xmlStreamC
$LN15@xmlStreamC:
; 1618 : case XML_OP_ROOT:
; 1619 : if (i != 0)
cmp DWORD PTR _i$[ebp], 0
je SHORT $LN16@xmlStreamC
; 1620 : goto error;
jmp $error$48
$LN16@xmlStreamC:
; 1621 : root = 1;
mov DWORD PTR _root$[ebp], 1
; 1622 : break;
jmp $LN5@xmlStreamC
$LN17@xmlStreamC:
; 1623 : case XML_OP_NS:
; 1624 : s = xmlStreamCompAddStep(stream, NULL, step.value,
mov ecx, DWORD PTR _flags$[ebp]
push ecx
push 1
mov edx, DWORD PTR _step$[ebp+4]
push edx
push 0
mov eax, DWORD PTR _stream$[ebp]
push eax
call _xmlStreamCompAddStep
add esp, 20 ; 00000014H
mov DWORD PTR _s$[ebp], eax
; 1625 : XML_ELEMENT_NODE, flags);
; 1626 : if (s < 0)
cmp DWORD PTR _s$[ebp], 0
jge SHORT $LN18@xmlStreamC
; 1627 : goto error;
jmp $error$48
$LN18@xmlStreamC:
; 1628 : prevs = s;
mov ecx, DWORD PTR _s$[ebp]
mov DWORD PTR _prevs$[ebp], ecx
; 1629 : flags = 0;
mov DWORD PTR _flags$[ebp], 0
; 1630 : break;
jmp $LN5@xmlStreamC
$LN19@xmlStreamC:
; 1631 : case XML_OP_ATTR:
; 1632 : flags |= XML_STREAM_STEP_ATTR;
mov edx, DWORD PTR _flags$[ebp]
or edx, 8
mov DWORD PTR _flags$[ebp], edx
; 1633 : prevs = -1;
mov DWORD PTR _prevs$[ebp], -1
; 1634 : s = xmlStreamCompAddStep(stream,
mov eax, DWORD PTR _flags$[ebp]
push eax
push 2
mov ecx, DWORD PTR _step$[ebp+8]
push ecx
mov edx, DWORD PTR _step$[ebp+4]
push edx
mov eax, DWORD PTR _stream$[ebp]
push eax
call _xmlStreamCompAddStep
add esp, 20 ; 00000014H
mov DWORD PTR _s$[ebp], eax
; 1635 : step.value, step.value2, XML_ATTRIBUTE_NODE, flags);
; 1636 : flags = 0;
mov DWORD PTR _flags$[ebp], 0
; 1637 : if (s < 0)
cmp DWORD PTR _s$[ebp], 0
jge SHORT $LN20@xmlStreamC
; 1638 : goto error;
jmp $error$48
$LN20@xmlStreamC:
; 1639 : break;
jmp $LN5@xmlStreamC
$LN21@xmlStreamC:
; 1640 : case XML_OP_ELEM:
; 1641 : if ((step.value == NULL) && (step.value2 == NULL)) {
cmp DWORD PTR _step$[ebp+4], 0
jne $LN22@xmlStreamC
cmp DWORD PTR _step$[ebp+8], 0
jne $LN22@xmlStreamC
; 1642 : /*
; 1643 : * We have a "." or "self::node()" here.
; 1644 : * Eliminate redundant self::node() tests like in "/./."
; 1645 : * or "//./"
; 1646 : * The only case we won't eliminate is "//.", i.e. if
; 1647 : * self::node() is the last node test and we had
; 1648 : * continuation somewhere beforehand.
; 1649 : */
; 1650 : if ((comp->nbStep == i + 1) &&
mov ecx, DWORD PTR _i$[ebp]
add ecx, 1
mov edx, DWORD PTR _comp$[ebp]
cmp DWORD PTR [edx+20], ecx
jne $LN23@xmlStreamC
mov eax, DWORD PTR _flags$[ebp]
and eax, 1
je $LN23@xmlStreamC
; 1651 : (flags & XML_STREAM_STEP_DESC)) {
; 1652 : /*
; 1653 : * Mark the special case where the expression resolves
; 1654 : * to any type of node.
; 1655 : */
; 1656 : if (comp->nbStep == i + 1) {
mov ecx, DWORD PTR _i$[ebp]
add ecx, 1
mov edx, DWORD PTR _comp$[ebp]
cmp DWORD PTR [edx+20], ecx
jne SHORT $LN25@xmlStreamC
; 1657 : stream->flags |= XML_STREAM_FINAL_IS_ANY_NODE;
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+16]
or ecx, 16384 ; 00004000H
mov edx, DWORD PTR _stream$[ebp]
mov DWORD PTR [edx+16], ecx
$LN25@xmlStreamC:
; 1658 : }
; 1659 : flags |= XML_STREAM_STEP_NODE;
mov eax, DWORD PTR _flags$[ebp]
or eax, 16 ; 00000010H
mov DWORD PTR _flags$[ebp], eax
; 1660 : s = xmlStreamCompAddStep(stream, NULL, NULL,
mov ecx, DWORD PTR _flags$[ebp]
push ecx
push 100 ; 00000064H
push 0
push 0
mov edx, DWORD PTR _stream$[ebp]
push edx
call _xmlStreamCompAddStep
add esp, 20 ; 00000014H
mov DWORD PTR _s$[ebp], eax
; 1661 : XML_STREAM_ANY_NODE, flags);
; 1662 : if (s < 0)
cmp DWORD PTR _s$[ebp], 0
jge SHORT $LN26@xmlStreamC
; 1663 : goto error;
jmp $error$48
$LN26@xmlStreamC:
; 1664 : flags = 0;
mov DWORD PTR _flags$[ebp], 0
; 1665 : /*
; 1666 : * If there was a previous step, mark it to be added to
; 1667 : * the result node-set; this is needed since only
; 1668 : * the last step will be marked as "final" and only
; 1669 : * "final" nodes are added to the resulting set.
; 1670 : */
; 1671 : if (prevs != -1) {
cmp DWORD PTR _prevs$[ebp], -1
je SHORT $LN27@xmlStreamC
; 1672 : stream->steps[prevs].flags |= XML_STREAM_STEP_IN_SET;
mov eax, DWORD PTR _prevs$[ebp]
shl eax, 4
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+12]
mov eax, DWORD PTR [edx+eax]
or eax, 32 ; 00000020H
mov ecx, DWORD PTR _prevs$[ebp]
shl ecx, 4
mov edx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [edx+12]
mov DWORD PTR [edx+ecx], eax
; 1673 : prevs = -1;
mov DWORD PTR _prevs$[ebp], -1
$LN27@xmlStreamC:
; 1674 : }
; 1675 : break;
jmp $LN5@xmlStreamC
; 1676 :
; 1677 : } else {
jmp SHORT $LN22@xmlStreamC
$LN23@xmlStreamC:
; 1678 : /* Just skip this one. */
; 1679 : continue;
jmp $LN2@xmlStreamC
$LN22@xmlStreamC:
; 1680 : }
; 1681 : }
; 1682 : /* An element node. */
; 1683 : s = xmlStreamCompAddStep(stream, step.value, step.value2,
mov eax, DWORD PTR _flags$[ebp]
push eax
push 1
mov ecx, DWORD PTR _step$[ebp+8]
push ecx
mov edx, DWORD PTR _step$[ebp+4]
push edx
mov eax, DWORD PTR _stream$[ebp]
push eax
call _xmlStreamCompAddStep
add esp, 20 ; 00000014H
mov DWORD PTR _s$[ebp], eax
; 1684 : XML_ELEMENT_NODE, flags);
; 1685 : if (s < 0)
cmp DWORD PTR _s$[ebp], 0
jge SHORT $LN28@xmlStreamC
; 1686 : goto error;
jmp $error$48
$LN28@xmlStreamC:
; 1687 : prevs = s;
mov ecx, DWORD PTR _s$[ebp]
mov DWORD PTR _prevs$[ebp], ecx
; 1688 : flags = 0;
mov DWORD PTR _flags$[ebp], 0
; 1689 : break;
jmp $LN5@xmlStreamC
$LN29@xmlStreamC:
; 1690 : case XML_OP_CHILD:
; 1691 : /* An element node child. */
; 1692 : s = xmlStreamCompAddStep(stream, step.value, step.value2,
mov edx, DWORD PTR _flags$[ebp]
push edx
push 1
mov eax, DWORD PTR _step$[ebp+8]
push eax
mov ecx, DWORD PTR _step$[ebp+4]
push ecx
mov edx, DWORD PTR _stream$[ebp]
push edx
call _xmlStreamCompAddStep
add esp, 20 ; 00000014H
mov DWORD PTR _s$[ebp], eax
; 1693 : XML_ELEMENT_NODE, flags);
; 1694 : if (s < 0)
cmp DWORD PTR _s$[ebp], 0
jge SHORT $LN30@xmlStreamC
; 1695 : goto error;
jmp $error$48
$LN30@xmlStreamC:
; 1696 : prevs = s;
mov eax, DWORD PTR _s$[ebp]
mov DWORD PTR _prevs$[ebp], eax
; 1697 : flags = 0;
mov DWORD PTR _flags$[ebp], 0
; 1698 : break;
jmp SHORT $LN5@xmlStreamC
$LN31@xmlStreamC:
; 1699 : case XML_OP_ALL:
; 1700 : s = xmlStreamCompAddStep(stream, NULL, NULL,
mov ecx, DWORD PTR _flags$[ebp]
push ecx
push 1
push 0
push 0
mov edx, DWORD PTR _stream$[ebp]
push edx
call _xmlStreamCompAddStep
add esp, 20 ; 00000014H
mov DWORD PTR _s$[ebp], eax
; 1701 : XML_ELEMENT_NODE, flags);
; 1702 : if (s < 0)
cmp DWORD PTR _s$[ebp], 0
jge SHORT $LN32@xmlStreamC
; 1703 : goto error;
jmp $error$48
$LN32@xmlStreamC:
; 1704 : prevs = s;
mov eax, DWORD PTR _s$[ebp]
mov DWORD PTR _prevs$[ebp], eax
; 1705 : flags = 0;
mov DWORD PTR _flags$[ebp], 0
; 1706 : break;
jmp SHORT $LN5@xmlStreamC
; 1707 : case XML_OP_PARENT:
; 1708 : break;
jmp SHORT $LN5@xmlStreamC
$LN34@xmlStreamC:
; 1709 : case XML_OP_ANCESTOR:
; 1710 : /* Skip redundant continuations. */
; 1711 : if (flags & XML_STREAM_STEP_DESC)
mov ecx, DWORD PTR _flags$[ebp]
and ecx, 1
je SHORT $LN35@xmlStreamC
; 1712 : break;
jmp SHORT $LN5@xmlStreamC
$LN35@xmlStreamC:
; 1713 : flags |= XML_STREAM_STEP_DESC;
mov edx, DWORD PTR _flags$[ebp]
or edx, 1
mov DWORD PTR _flags$[ebp], edx
; 1714 : /*
; 1715 : * Mark the expression as having "//".
; 1716 : */
; 1717 : if ((stream->flags & XML_STREAM_DESC) == 0)
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+16]
and ecx, 65536 ; 00010000H
jne SHORT $LN5@xmlStreamC
; 1718 : stream->flags |= XML_STREAM_DESC;
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+16]
or eax, 65536 ; 00010000H
mov ecx, DWORD PTR _stream$[ebp]
mov DWORD PTR [ecx+16], eax
$LN5@xmlStreamC:
; 1719 : break;
; 1720 : }
; 1721 : }
jmp $LN2@xmlStreamC
$LN3@xmlStreamC:
; 1722 : if ((! root) && (comp->flags & XML_PATTERN_NOTPATTERN) == 0) {
cmp DWORD PTR _root$[ebp], 0
jne SHORT $LN37@xmlStreamC
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 7
jne SHORT $LN37@xmlStreamC
; 1723 : /*
; 1724 : * If this should behave like a real pattern, we will mark
; 1725 : * the first step as having "//", to be reentrant on every
; 1726 : * tree level.
; 1727 : */
; 1728 : if ((stream->flags & XML_STREAM_DESC) == 0)
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+16]
and edx, 65536 ; 00010000H
jne SHORT $LN38@xmlStreamC
; 1729 : stream->flags |= XML_STREAM_DESC;
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+16]
or ecx, 65536 ; 00010000H
mov edx, DWORD PTR _stream$[ebp]
mov DWORD PTR [edx+16], ecx
$LN38@xmlStreamC:
; 1730 :
; 1731 : if (stream->nbStep > 0) {
mov eax, DWORD PTR _stream$[ebp]
cmp DWORD PTR [eax+4], 0
jle SHORT $LN37@xmlStreamC
; 1732 : if ((stream->steps[0].flags & XML_STREAM_STEP_DESC) == 0)
mov ecx, 16 ; 00000010H
imul edx, ecx, 0
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+12]
mov edx, DWORD PTR [ecx+edx]
and edx, 1
jne SHORT $LN37@xmlStreamC
; 1733 : stream->steps[0].flags |= XML_STREAM_STEP_DESC;
mov eax, 16 ; 00000010H
imul ecx, eax, 0
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+12]
mov ecx, DWORD PTR [eax+ecx]
or ecx, 1
mov edx, 16 ; 00000010H
imul eax, edx, 0
mov edx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [edx+12]
mov DWORD PTR [edx+eax], ecx
$LN37@xmlStreamC:
; 1734 : }
; 1735 : }
; 1736 : if (stream->nbStep <= s)
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+4]
cmp ecx, DWORD PTR _s$[ebp]
jg SHORT $LN41@xmlStreamC
; 1737 : goto error;
jmp SHORT $error$48
$LN41@xmlStreamC:
; 1738 : stream->steps[s].flags |= XML_STREAM_STEP_FINAL;
mov edx, DWORD PTR _s$[ebp]
shl edx, 4
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+12]
mov edx, DWORD PTR [ecx+edx]
or edx, 2
mov eax, DWORD PTR _s$[ebp]
shl eax, 4
mov ecx, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [ecx+12]
mov DWORD PTR [ecx+eax], edx
; 1739 : if (root)
cmp DWORD PTR _root$[ebp], 0
je SHORT $LN42@xmlStreamC
; 1740 : stream->steps[0].flags |= XML_STREAM_STEP_ROOT;
mov edx, 16 ; 00000010H
imul eax, edx, 0
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx+12]
mov eax, DWORD PTR [edx+eax]
or eax, 4
mov ecx, 16 ; 00000010H
imul edx, ecx, 0
mov ecx, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [ecx+12]
mov DWORD PTR [ecx+edx], eax
$LN42@xmlStreamC:
; 1741 : #ifdef DEBUG_STREAMING
; 1742 : xmlDebugStreamComp(stream);
; 1743 : #endif
; 1744 : comp->stream = stream;
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR _stream$[ebp]
mov DWORD PTR [edx+32], eax
; 1745 : return(0);
xor eax, eax
jmp SHORT $LN1@xmlStreamC
$error$48:
; 1746 : error:
; 1747 : xmlFreeStreamComp(stream);
mov ecx, DWORD PTR _stream$[ebp]
push ecx
call _xmlFreeStreamComp
add esp, 4
; 1748 : return(0);
xor eax, eax
$LN1@xmlStreamC:
; 1749 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $LN46@xmlStreamC
call @_RTC_CheckStackVars@8
pop eax
pop edx
pop edi
add esp, 48 ; 00000030H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
npad 2
$LN46@xmlStreamC:
DD 1
DD $LN45@xmlStreamC
$LN45@xmlStreamC:
DD -40 ; ffffffd8H
DD 12 ; 0000000cH
DD $LN44@xmlStreamC
$LN44@xmlStreamC:
DB 115 ; 00000073H
DB 116 ; 00000074H
DB 101 ; 00000065H
DB 112 ; 00000070H
DB 0
npad 3
$LN47@xmlStreamC:
DD $LN15@xmlStreamC
DD $LN21@xmlStreamC
DD $LN29@xmlStreamC
DD $LN19@xmlStreamC
DD $LN5@xmlStreamC
DD $LN34@xmlStreamC
DD $LN17@xmlStreamC
DD $LN31@xmlStreamC
_xmlStreamCompile ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlStreamCompAddStep
_TEXT SEGMENT
_cur$ = -4 ; size = 4
_comp$ = 8 ; size = 4
_name$ = 12 ; size = 4
_ns$ = 16 ; size = 4
_nodeType$ = 20 ; size = 4
_flags$ = 24 ; size = 4
_xmlStreamCompAddStep PROC ; COMDAT
; 1547 : const xmlChar *ns, int nodeType, int flags) {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 1548 : xmlStreamStepPtr cur;
; 1549 :
; 1550 : if (comp->nbStep >= comp->maxStep) {
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [eax+4]
cmp edx, DWORD PTR [ecx+8]
jl SHORT $LN2@xmlStreamC
; 1551 : cur = (xmlStreamStepPtr) xmlRealloc(comp->steps,
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+8]
shl ecx, 1
shl ecx, 4
mov esi, esp
push ecx
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+12]
push eax
call DWORD PTR _xmlRealloc
add esp, 8
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _cur$[ebp], eax
; 1552 : comp->maxStep * 2 * sizeof(xmlStreamStep));
; 1553 : if (cur == NULL) {
cmp DWORD PTR _cur$[ebp], 0
jne SHORT $LN3@xmlStreamC
; 1554 : ERROR(NULL, NULL, NULL,
; 1555 : "xmlNewStreamComp: malloc failed\n");
; 1556 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlStreamC
$LN3@xmlStreamC:
; 1557 : }
; 1558 : comp->steps = cur;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR _cur$[ebp]
mov DWORD PTR [ecx+12], edx
; 1559 : comp->maxStep *= 2;
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+8]
shl ecx, 1
mov edx, DWORD PTR _comp$[ebp]
mov DWORD PTR [edx+8], ecx
$LN2@xmlStreamC:
; 1560 : }
; 1561 : cur = &comp->steps[comp->nbStep++];
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+4]
shl ecx, 4
mov edx, DWORD PTR _comp$[ebp]
add ecx, DWORD PTR [edx+12]
mov DWORD PTR _cur$[ebp], ecx
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+4]
add ecx, 1
mov edx, DWORD PTR _comp$[ebp]
mov DWORD PTR [edx+4], ecx
; 1562 : cur->flags = flags;
mov eax, DWORD PTR _cur$[ebp]
mov ecx, DWORD PTR _flags$[ebp]
mov DWORD PTR [eax], ecx
; 1563 : cur->name = name;
mov edx, DWORD PTR _cur$[ebp]
mov eax, DWORD PTR _name$[ebp]
mov DWORD PTR [edx+4], eax
; 1564 : cur->ns = ns;
mov ecx, DWORD PTR _cur$[ebp]
mov edx, DWORD PTR _ns$[ebp]
mov DWORD PTR [ecx+8], edx
; 1565 : cur->nodeType = nodeType;
mov eax, DWORD PTR _cur$[ebp]
mov ecx, DWORD PTR _nodeType$[ebp]
mov DWORD PTR [eax+12], ecx
; 1566 : return(comp->nbStep - 1);
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+4]
sub eax, 1
$LN1@xmlStreamC:
; 1567 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlStreamCompAddStep ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlNewStreamComp
_TEXT SEGMENT
_cur$ = -4 ; size = 4
_size$ = 8 ; size = 4
_xmlNewStreamComp PROC ; COMDAT
; 1492 : xmlNewStreamComp(int size) {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 1493 : xmlStreamCompPtr cur;
; 1494 :
; 1495 : if (size < 4)
cmp DWORD PTR _size$[ebp], 4
jge SHORT $LN2@xmlNewStre
; 1496 : size = 4;
mov DWORD PTR _size$[ebp], 4
$LN2@xmlNewStre:
; 1497 :
; 1498 : cur = (xmlStreamCompPtr) xmlMalloc(sizeof(xmlStreamComp));
mov esi, esp
push 20 ; 00000014H
call DWORD PTR _xmlMalloc
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _cur$[ebp], eax
; 1499 : if (cur == NULL) {
cmp DWORD PTR _cur$[ebp], 0
jne SHORT $LN3@xmlNewStre
; 1500 : ERROR(NULL, NULL, NULL,
; 1501 : "xmlNewStreamComp: malloc failed\n");
; 1502 : return(NULL);
xor eax, eax
jmp SHORT $LN1@xmlNewStre
$LN3@xmlNewStre:
; 1503 : }
; 1504 : memset(cur, 0, sizeof(xmlStreamComp));
xor eax, eax
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [ecx], eax
mov DWORD PTR [ecx+4], eax
mov DWORD PTR [ecx+8], eax
mov DWORD PTR [ecx+12], eax
mov DWORD PTR [ecx+16], eax
; 1505 : cur->steps = (xmlStreamStepPtr) xmlMalloc(size * sizeof(xmlStreamStep));
mov edx, DWORD PTR _size$[ebp]
shl edx, 4
mov esi, esp
push edx
call DWORD PTR _xmlMalloc
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [ecx+12], eax
; 1506 : if (cur->steps == NULL) {
mov edx, DWORD PTR _cur$[ebp]
cmp DWORD PTR [edx+12], 0
jne SHORT $LN4@xmlNewStre
; 1507 : xmlFree(cur);
mov esi, esp
mov eax, DWORD PTR _cur$[ebp]
push eax
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
; 1508 : ERROR(NULL, NULL, NULL,
; 1509 : "xmlNewStreamComp: malloc failed\n");
; 1510 : return(NULL);
xor eax, eax
jmp SHORT $LN1@xmlNewStre
$LN4@xmlNewStre:
; 1511 : }
; 1512 : cur->nbStep = 0;
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [ecx+4], 0
; 1513 : cur->maxStep = size;
mov edx, DWORD PTR _cur$[ebp]
mov eax, DWORD PTR _size$[ebp]
mov DWORD PTR [edx+8], eax
; 1514 : return(cur);
mov eax, DWORD PTR _cur$[ebp]
$LN1@xmlNewStre:
; 1515 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlNewStreamComp ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlCompileIDCXPathPath
_TEXT SEGMENT
tv371 = -40 ; size = 4
tv345 = -36 ; size = 4
tv323 = -32 ; size = 4
tv290 = -28 ; size = 4
tv264 = -24 ; size = 4
tv222 = -20 ; size = 4
tv196 = -16 ; size = 4
tv170 = -12 ; size = 4
tv144 = -8 ; size = 4
tv89 = -4 ; size = 4
_ctxt$ = 8 ; size = 4
_xmlCompileIDCXPathPath PROC ; COMDAT
; 1330 : xmlCompileIDCXPathPath(xmlPatParserContextPtr ctxt) {
push ebp
mov ebp, esp
sub esp, 40 ; 00000028H
push edi
lea edi, DWORD PTR [ebp-40]
mov ecx, 10 ; 0000000aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
$LN2@xmlCompile:
; 1331 : SKIP_BLANKS;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN17@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN18@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN17@xmlCompile
$LN18@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN3@xmlCompile
$LN17@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN47@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv89[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN48@xmlCompile
$LN47@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv89[ebp], eax
$LN48@xmlCompile:
jmp SHORT $LN2@xmlCompile
$LN3@xmlCompile:
; 1332 : if (CUR == '/') {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 47 ; 0000002fH
jne SHORT $LN19@xmlCompile
; 1333 : ERROR5(NULL, NULL, NULL,
; 1334 : "Unexpected selection of the document root in '%s'.\n",
; 1335 : ctxt->base);
; 1336 : goto error;
jmp $error$67
$LN19@xmlCompile:
; 1337 : }
; 1338 : ctxt->comp->flags |= PAT_FROM_CUR;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx+16]
mov eax, DWORD PTR [edx+16]
or eax, 512 ; 00000200H
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx+16]
mov DWORD PTR [edx+16], eax
; 1339 :
; 1340 : if (CUR == '.') {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 46 ; 0000002eH
jne $LN12@xmlCompile
; 1341 : /* "." - "self::node()" */
; 1342 : NEXT;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN49@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv144[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN4@xmlCompile
$LN49@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv144[ebp], eax
$LN4@xmlCompile:
; 1343 : SKIP_BLANKS;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 32 ; 00000020H
je SHORT $LN21@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 9
jl SHORT $LN22@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 10 ; 0000000aH
jle SHORT $LN21@xmlCompile
$LN22@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 13 ; 0000000dH
jne SHORT $LN5@xmlCompile
$LN21@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN51@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv170[ebp], edx
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx], ecx
jmp SHORT $LN52@xmlCompile
$LN51@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv170[ebp], ecx
$LN52@xmlCompile:
jmp SHORT $LN4@xmlCompile
$LN5@xmlCompile:
; 1344 : if (CUR == 0) {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
jne SHORT $LN23@xmlCompile
; 1345 : /*
; 1346 : * Selection of the context node.
; 1347 : */
; 1348 : PUSH(XML_OP_ELEM, NULL, NULL);
push 0
push 0
push 2
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN24@xmlCompile
jmp $error$67
$LN24@xmlCompile:
; 1349 : return;
jmp $LN1@xmlCompile
$LN23@xmlCompile:
; 1350 : }
; 1351 : if (CUR != '/') {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 47 ; 0000002fH
je SHORT $LN25@xmlCompile
; 1352 : /* TODO: A more meaningful error message. */
; 1353 : ERROR5(NULL, NULL, NULL,
; 1354 : "Unexpected token after '.' in '%s'.\n", ctxt->base);
; 1355 : goto error;
jmp $error$67
$LN25@xmlCompile:
; 1356 : }
; 1357 : /* "./" - "self::node()/" */
; 1358 : NEXT;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN53@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv196[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN6@xmlCompile
$LN53@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv196[ebp], edx
$LN6@xmlCompile:
; 1359 : SKIP_BLANKS;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN26@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN27@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN26@xmlCompile
$LN27@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN7@xmlCompile
$LN26@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN55@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv222[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN56@xmlCompile
$LN55@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv222[ebp], eax
$LN56@xmlCompile:
jmp SHORT $LN6@xmlCompile
$LN7@xmlCompile:
; 1360 : if (CUR == '/') {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 47 ; 0000002fH
jne $LN28@xmlCompile
; 1361 : if (IS_BLANK_CH(PEEKPREV(1))) {
mov ecx, 1
imul edx, ecx, -1
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx+edx]
cmp edx, 32 ; 00000020H
je SHORT $LN30@xmlCompile
mov eax, 1
imul ecx, eax, -1
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax+ecx]
cmp ecx, 9
jl SHORT $LN31@xmlCompile
mov edx, 1
imul eax, edx, -1
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx+eax]
cmp eax, 10 ; 0000000aH
jle SHORT $LN30@xmlCompile
$LN31@xmlCompile:
mov ecx, 1
imul edx, ecx, -1
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx+edx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN29@xmlCompile
$LN30@xmlCompile:
; 1362 : /*
; 1363 : * Disallow "./ /"
; 1364 : */
; 1365 : ERROR5(NULL, NULL, NULL,
; 1366 : "Unexpected '/' token in '%s'.\n", ctxt->base);
; 1367 : goto error;
jmp $error$67
$LN29@xmlCompile:
; 1368 : }
; 1369 : /* ".//" - "self:node()/descendant-or-self::node()/" */
; 1370 : PUSH(XML_OP_ANCESTOR, NULL, NULL);
push 0
push 0
push 6
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN32@xmlCompile
jmp $error$67
$LN32@xmlCompile:
; 1371 : NEXT;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN57@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv264[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN8@xmlCompile
$LN57@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv264[ebp], eax
$LN8@xmlCompile:
; 1372 : SKIP_BLANKS;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 32 ; 00000020H
je SHORT $LN33@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 9
jl SHORT $LN34@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 10 ; 0000000aH
jle SHORT $LN33@xmlCompile
$LN34@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 13 ; 0000000dH
jne SHORT $LN28@xmlCompile
$LN33@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN59@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv290[ebp], edx
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx], ecx
jmp SHORT $LN60@xmlCompile
$LN59@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv290[ebp], ecx
$LN60@xmlCompile:
jmp SHORT $LN8@xmlCompile
$LN28@xmlCompile:
; 1373 : }
; 1374 : if (CUR == 0)
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
jne SHORT $LN12@xmlCompile
; 1375 : goto error_unfinished;
jmp $error_unfinished$68
$LN12@xmlCompile:
; 1376 : }
; 1377 : /*
; 1378 : * Process steps.
; 1379 : */
; 1380 : do {
; 1381 : xmlCompileStepPattern(ctxt);
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlCompileStepPattern
add esp, 4
; 1382 : if (ctxt->error != 0)
mov eax, DWORD PTR _ctxt$[ebp]
cmp DWORD PTR [eax+8], 0
je SHORT $LN13@xmlCompile
; 1383 : goto error;
jmp $error$67
$LN13@xmlCompile:
; 1384 : SKIP_BLANKS;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 32 ; 00000020H
je SHORT $LN37@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 9
jl SHORT $LN38@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 10 ; 0000000aH
jle SHORT $LN37@xmlCompile
$LN38@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 13 ; 0000000dH
jne SHORT $LN14@xmlCompile
$LN37@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN61@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv323[ebp], edx
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx], ecx
jmp SHORT $LN62@xmlCompile
$LN61@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv323[ebp], ecx
$LN62@xmlCompile:
jmp SHORT $LN13@xmlCompile
$LN14@xmlCompile:
; 1385 : if (CUR != '/')
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 47 ; 0000002fH
je SHORT $LN39@xmlCompile
; 1386 : break;
jmp $LN11@xmlCompile
$LN39@xmlCompile:
; 1387 : PUSH(XML_OP_PARENT, NULL, NULL);
push 0
push 0
push 5
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN40@xmlCompile
jmp $error$67
$LN40@xmlCompile:
; 1388 : NEXT;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN63@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv345[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN15@xmlCompile
$LN63@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv345[ebp], edx
$LN15@xmlCompile:
; 1389 : SKIP_BLANKS;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN41@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN42@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN41@xmlCompile
$LN42@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN16@xmlCompile
$LN41@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN65@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv371[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN66@xmlCompile
$LN65@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv371[ebp], eax
$LN66@xmlCompile:
jmp SHORT $LN15@xmlCompile
$LN16@xmlCompile:
; 1390 : if (CUR == '/') {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 47 ; 0000002fH
jne SHORT $LN43@xmlCompile
; 1391 : /*
; 1392 : * Disallow subsequent '//'.
; 1393 : */
; 1394 : ERROR5(NULL, NULL, NULL,
; 1395 : "Unexpected subsequent '//' in '%s'.\n",
; 1396 : ctxt->base);
; 1397 : goto error;
jmp SHORT $error$67
$LN43@xmlCompile:
; 1398 : }
; 1399 : if (CUR == 0)
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
jne SHORT $LN10@xmlCompile
; 1400 : goto error_unfinished;
jmp SHORT $error_unfinished$68
$LN10@xmlCompile:
; 1401 :
; 1402 : } while (CUR != 0);
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
jne $LN12@xmlCompile
$LN11@xmlCompile:
; 1403 :
; 1404 : if (CUR != 0) {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN45@xmlCompile
; 1405 : ERROR5(NULL, NULL, NULL,
; 1406 : "Failed to compile expression '%s'.\n", ctxt->base);
; 1407 : ctxt->error = 1;
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx+8], 1
$LN45@xmlCompile:
; 1408 : }
; 1409 : return;
jmp SHORT $LN1@xmlCompile
$error$67:
; 1410 : error:
; 1411 : ctxt->error = 1;
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx+8], 1
; 1412 : return;
jmp SHORT $LN1@xmlCompile
$error_unfinished$68:
; 1413 :
; 1414 : error_unfinished:
; 1415 : ctxt->error = 1;
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax+8], 1
$LN1@xmlCompile:
; 1416 : ERROR5(NULL, NULL, NULL,
; 1417 : "Unfinished expression '%s'.\n", ctxt->base);
; 1418 : return;
; 1419 : }
pop edi
add esp, 40 ; 00000028H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlCompileIDCXPathPath ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlCompilePathPattern
_TEXT SEGMENT
tv503 = -68 ; size = 4
tv477 = -64 ; size = 4
tv456 = -60 ; size = 4
tv430 = -56 ; size = 4
tv420 = -52 ; size = 4
tv393 = -48 ; size = 4
tv359 = -44 ; size = 4
tv333 = -40 ; size = 4
tv304 = -36 ; size = 4
tv277 = -32 ; size = 4
tv258 = -28 ; size = 4
tv232 = -24 ; size = 4
tv222 = -20 ; size = 4
tv212 = -16 ; size = 4
tv180 = -12 ; size = 4
tv170 = -8 ; size = 4
tv89 = -4 ; size = 4
_ctxt$ = 8 ; size = 4
_xmlCompilePathPattern PROC ; COMDAT
; 1233 : xmlCompilePathPattern(xmlPatParserContextPtr ctxt) {
push ebp
mov ebp, esp
sub esp, 68 ; 00000044H
push edi
lea edi, DWORD PTR [ebp-68]
mov ecx, 17 ; 00000011H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
$LN2@xmlCompile:
; 1234 : SKIP_BLANKS;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN18@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN19@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN18@xmlCompile
$LN19@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN3@xmlCompile
$LN18@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN59@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv89[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN60@xmlCompile
$LN59@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv89[ebp], eax
$LN60@xmlCompile:
jmp SHORT $LN2@xmlCompile
$LN3@xmlCompile:
; 1235 : if (CUR == '/') {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 47 ; 0000002fH
jne SHORT $LN20@xmlCompile
; 1236 : ctxt->comp->flags |= PAT_FROM_ROOT;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx+16]
mov eax, DWORD PTR [edx+16]
or eax, 256 ; 00000100H
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx+16]
mov DWORD PTR [edx+16], eax
jmp SHORT $LN21@xmlCompile
$LN20@xmlCompile:
; 1237 : } else if ((CUR == '.') || (ctxt->comp->flags & XML_PATTERN_NOTPATTERN)) {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 46 ; 0000002eH
je SHORT $LN23@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
mov edx, DWORD PTR [ecx+16]
and edx, 7
je SHORT $LN21@xmlCompile
$LN23@xmlCompile:
; 1238 : ctxt->comp->flags |= PAT_FROM_CUR;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
mov edx, DWORD PTR [ecx+16]
or edx, 512 ; 00000200H
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
mov DWORD PTR [ecx+16], edx
$LN21@xmlCompile:
; 1239 : }
; 1240 :
; 1241 : if ((CUR == '/') && (NXT(1) == '/')) {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 47 ; 0000002fH
jne $LN24@xmlCompile
mov edx, 1
shl edx, 0
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx+edx]
cmp edx, 47 ; 0000002fH
jne SHORT $LN24@xmlCompile
; 1242 : PUSH(XML_OP_ANCESTOR, NULL, NULL);
push 0
push 0
push 6
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN26@xmlCompile
jmp $error$93
$LN26@xmlCompile:
; 1243 : NEXT;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN61@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv170[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN62@xmlCompile
$LN61@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv170[ebp], eax
$LN62@xmlCompile:
; 1244 : NEXT;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN63@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv180[ebp], edx
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx], ecx
jmp SHORT $LN64@xmlCompile
$LN63@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv180[ebp], ecx
$LN64@xmlCompile:
; 1245 : } else if ((CUR == '.') && (NXT(1) == '/') && (NXT(2) == '/')) {
jmp $LN25@xmlCompile
$LN24@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 46 ; 0000002eH
jne $LN25@xmlCompile
mov edx, 1
shl edx, 0
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx+edx]
cmp edx, 47 ; 0000002fH
jne $LN25@xmlCompile
mov eax, 1
shl eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx+eax]
cmp eax, 47 ; 0000002fH
jne $LN25@xmlCompile
; 1246 : PUSH(XML_OP_ANCESTOR, NULL, NULL);
push 0
push 0
push 6
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx+16]
push edx
mov eax, DWORD PTR _ctxt$[ebp]
push eax
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN28@xmlCompile
jmp $error$93
$LN28@xmlCompile:
; 1247 : NEXT;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN65@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv212[ebp], edx
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx], ecx
jmp SHORT $LN66@xmlCompile
$LN65@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv212[ebp], ecx
$LN66@xmlCompile:
; 1248 : NEXT;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN67@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv222[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN68@xmlCompile
$LN67@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv222[ebp], edx
$LN68@xmlCompile:
; 1249 : NEXT;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN69@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv232[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN4@xmlCompile
$LN69@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv232[ebp], eax
$LN4@xmlCompile:
; 1250 : /* Check for incompleteness. */
; 1251 : SKIP_BLANKS;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 32 ; 00000020H
je SHORT $LN29@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 9
jl SHORT $LN30@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 10 ; 0000000aH
jle SHORT $LN29@xmlCompile
$LN30@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 13 ; 0000000dH
jne SHORT $LN5@xmlCompile
$LN29@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN71@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv258[ebp], edx
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx], ecx
jmp SHORT $LN72@xmlCompile
$LN71@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv258[ebp], ecx
$LN72@xmlCompile:
jmp SHORT $LN4@xmlCompile
$LN5@xmlCompile:
; 1252 : if (CUR == 0) {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
jne SHORT $LN25@xmlCompile
; 1253 : ERROR5(NULL, NULL, NULL,
; 1254 : "Incomplete expression '%s'.\n", ctxt->base);
; 1255 : ctxt->error = 1;
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx+8], 1
; 1256 : goto error;
jmp $error$93
$LN25@xmlCompile:
; 1257 : }
; 1258 : }
; 1259 : if (CUR == '@') {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 64 ; 00000040H
jne $LN32@xmlCompile
; 1260 : NEXT;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN73@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv277[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN74@xmlCompile
$LN73@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv277[ebp], eax
$LN74@xmlCompile:
; 1261 : xmlCompileAttributeTest(ctxt);
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlCompileAttributeTest
add esp, 4
$LN6@xmlCompile:
; 1262 : SKIP_BLANKS;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 32 ; 00000020H
je SHORT $LN34@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 9
jl SHORT $LN35@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 10 ; 0000000aH
jle SHORT $LN34@xmlCompile
$LN35@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 13 ; 0000000dH
jne SHORT $LN7@xmlCompile
$LN34@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN75@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv304[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN76@xmlCompile
$LN75@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv304[ebp], edx
$LN76@xmlCompile:
jmp SHORT $LN6@xmlCompile
$LN7@xmlCompile:
; 1263 : /* TODO: check for incompleteness */
; 1264 : if (CUR != 0) {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN36@xmlCompile
; 1265 : xmlCompileStepPattern(ctxt);
mov eax, DWORD PTR _ctxt$[ebp]
push eax
call _xmlCompileStepPattern
add esp, 4
; 1266 : if (ctxt->error != 0)
mov ecx, DWORD PTR _ctxt$[ebp]
cmp DWORD PTR [ecx+8], 0
je SHORT $LN36@xmlCompile
; 1267 : goto error;
jmp $error$93
$LN36@xmlCompile:
; 1268 : }
; 1269 : } else {
jmp $LN33@xmlCompile
$LN32@xmlCompile:
; 1270 : if (CUR == '/') {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 47 ; 0000002fH
jne $LN38@xmlCompile
; 1271 : PUSH(XML_OP_ROOT, NULL, NULL);
push 0
push 0
push 1
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN39@xmlCompile
jmp $error$93
$LN39@xmlCompile:
; 1272 : NEXT;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN77@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv333[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN8@xmlCompile
$LN77@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv333[ebp], edx
$LN8@xmlCompile:
; 1273 : /* Check for incompleteness. */
; 1274 : SKIP_BLANKS;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN40@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN41@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN40@xmlCompile
$LN41@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN9@xmlCompile
$LN40@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN79@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv359[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN80@xmlCompile
$LN79@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv359[ebp], eax
$LN80@xmlCompile:
jmp SHORT $LN8@xmlCompile
$LN9@xmlCompile:
; 1275 : if (CUR == 0) {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
jne SHORT $LN38@xmlCompile
; 1276 : ERROR5(NULL, NULL, NULL,
; 1277 : "Incomplete expression '%s'.\n", ctxt->base);
; 1278 : ctxt->error = 1;
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx+8], 1
; 1279 : goto error;
jmp $error$93
$LN38@xmlCompile:
; 1280 : }
; 1281 : }
; 1282 : xmlCompileStepPattern(ctxt);
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlCompileStepPattern
add esp, 4
; 1283 : if (ctxt->error != 0)
mov eax, DWORD PTR _ctxt$[ebp]
cmp DWORD PTR [eax+8], 0
je SHORT $LN10@xmlCompile
; 1284 : goto error;
jmp $error$93
$LN10@xmlCompile:
; 1285 : SKIP_BLANKS;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 32 ; 00000020H
je SHORT $LN44@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 9
jl SHORT $LN45@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 10 ; 0000000aH
jle SHORT $LN44@xmlCompile
$LN45@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 13 ; 0000000dH
jne SHORT $LN12@xmlCompile
$LN44@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN81@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv393[ebp], edx
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx], ecx
jmp SHORT $LN82@xmlCompile
$LN81@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv393[ebp], ecx
$LN82@xmlCompile:
jmp SHORT $LN10@xmlCompile
$LN12@xmlCompile:
; 1286 : while (CUR == '/') {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 47 ; 0000002fH
jne $LN33@xmlCompile
; 1287 : if (NXT(1) == '/') {
mov edx, 1
shl edx, 0
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx+edx]
cmp edx, 47 ; 0000002fH
jne $LN46@xmlCompile
; 1288 : PUSH(XML_OP_ANCESTOR, NULL, NULL);
push 0
push 0
push 6
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN48@xmlCompile
jmp $error$93
$LN48@xmlCompile:
; 1289 : NEXT;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN83@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv420[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN84@xmlCompile
$LN83@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv420[ebp], eax
$LN84@xmlCompile:
; 1290 : NEXT;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN85@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv430[ebp], edx
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx], ecx
jmp SHORT $LN14@xmlCompile
$LN85@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv430[ebp], ecx
$LN14@xmlCompile:
; 1291 : SKIP_BLANKS;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 32 ; 00000020H
je SHORT $LN49@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 9
jl SHORT $LN50@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 10 ; 0000000aH
jle SHORT $LN49@xmlCompile
$LN50@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 13 ; 0000000dH
jne SHORT $LN15@xmlCompile
$LN49@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN87@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv456[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN88@xmlCompile
$LN87@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv456[ebp], edx
$LN88@xmlCompile:
jmp SHORT $LN14@xmlCompile
$LN15@xmlCompile:
; 1292 : xmlCompileStepPattern(ctxt);
mov eax, DWORD PTR _ctxt$[ebp]
push eax
call _xmlCompileStepPattern
add esp, 4
; 1293 : if (ctxt->error != 0)
mov ecx, DWORD PTR _ctxt$[ebp]
cmp DWORD PTR [ecx+8], 0
je SHORT $LN51@xmlCompile
; 1294 : goto error;
jmp $error$93
$LN51@xmlCompile:
; 1295 : } else {
jmp $LN47@xmlCompile
$LN46@xmlCompile:
; 1296 : PUSH(XML_OP_PARENT, NULL, NULL);
push 0
push 0
push 5
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN52@xmlCompile
jmp $error$93
$LN52@xmlCompile:
; 1297 : NEXT;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN89@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv477[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN16@xmlCompile
$LN89@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv477[ebp], edx
$LN16@xmlCompile:
; 1298 : SKIP_BLANKS;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN53@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN54@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN53@xmlCompile
$LN54@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN17@xmlCompile
$LN53@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN91@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv503[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN92@xmlCompile
$LN91@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv503[ebp], eax
$LN92@xmlCompile:
jmp SHORT $LN16@xmlCompile
$LN17@xmlCompile:
; 1299 : if (CUR == 0) {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
jne SHORT $LN55@xmlCompile
; 1300 : ERROR5(NULL, NULL, NULL,
; 1301 : "Incomplete expression '%s'.\n", ctxt->base);
; 1302 : ctxt->error = 1;
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx+8], 1
; 1303 : goto error;
jmp SHORT $error$93
$LN55@xmlCompile:
; 1304 : }
; 1305 : xmlCompileStepPattern(ctxt);
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlCompileStepPattern
add esp, 4
; 1306 : if (ctxt->error != 0)
mov eax, DWORD PTR _ctxt$[ebp]
cmp DWORD PTR [eax+8], 0
je SHORT $LN47@xmlCompile
; 1307 : goto error;
jmp SHORT $error$93
$LN47@xmlCompile:
; 1308 : }
; 1309 : }
jmp $LN12@xmlCompile
$LN33@xmlCompile:
; 1310 : }
; 1311 : if (CUR != 0) {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $error$93
; 1312 : ERROR5(NULL, NULL, NULL,
; 1313 : "Failed to compile pattern %s\n", ctxt->base);
; 1314 : ctxt->error = 1;
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx+8], 1
$error$93:
; 1315 : }
; 1316 : error:
; 1317 : return;
; 1318 : }
pop edi
add esp, 68 ; 00000044H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlCompilePathPattern ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlCompileStepPattern
_TEXT SEGMENT
tv583 = -80 ; size = 4
tv525 = -76 ; size = 4
tv426 = -72 ; size = 4
tv403 = -68 ; size = 4
tv378 = -64 ; size = 4
tv351 = -60 ; size = 4
tv247 = -56 ; size = 4
tv233 = -52 ; size = 4
tv182 = -48 ; size = 4
tv162 = -44 ; size = 4
tv135 = -40 ; size = 4
tv89 = -36 ; size = 4
_i$1 = -32 ; size = 4
_prefix$2 = -28 ; size = 4
_i$3 = -24 ; size = 4
_prefix$4 = -20 ; size = 4
_hasBlanks$ = -16 ; size = 4
_URL$ = -12 ; size = 4
_name$ = -8 ; size = 4
_token$ = -4 ; size = 4
_ctxt$ = 8 ; size = 4
_xmlCompileStepPattern PROC ; COMDAT
; 1014 : xmlCompileStepPattern(xmlPatParserContextPtr ctxt) {
push ebp
mov ebp, esp
sub esp, 80 ; 00000050H
push esi
push edi
lea edi, DWORD PTR [ebp-80]
mov ecx, 20 ; 00000014H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 1015 : xmlChar *token = NULL;
mov DWORD PTR _token$[ebp], 0
; 1016 : xmlChar *name = NULL;
mov DWORD PTR _name$[ebp], 0
; 1017 : xmlChar *URL = NULL;
mov DWORD PTR _URL$[ebp], 0
; 1018 : int hasBlanks = 0;
mov DWORD PTR _hasBlanks$[ebp], 0
$LN2@xmlCompile:
; 1019 :
; 1020 : SKIP_BLANKS;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN12@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN13@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN12@xmlCompile
$LN13@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN3@xmlCompile
$LN12@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN96@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv89[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN97@xmlCompile
$LN96@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv89[ebp], eax
$LN97@xmlCompile:
jmp SHORT $LN2@xmlCompile
$LN3@xmlCompile:
; 1021 : if (CUR == '.') {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 46 ; 0000002eH
jne SHORT $LN14@xmlCompile
; 1022 : /*
; 1023 : * Context node.
; 1024 : */
; 1025 : NEXT;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN98@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv135[ebp], edx
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx], ecx
jmp SHORT $LN99@xmlCompile
$LN98@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv135[ebp], ecx
$LN99@xmlCompile:
; 1026 : PUSH(XML_OP_ELEM, NULL, NULL);
push 0
push 0
push 2
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN15@xmlCompile
jmp $error$120
$LN15@xmlCompile:
; 1027 : return;
jmp $LN1@xmlCompile
$LN14@xmlCompile:
; 1028 : }
; 1029 : if (CUR == '@') {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 64 ; 00000040H
jne SHORT $LN16@xmlCompile
; 1030 : /*
; 1031 : * Attribute test.
; 1032 : */
; 1033 : if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
mov ecx, DWORD PTR [eax+16]
and ecx, 2
je SHORT $LN17@xmlCompile
; 1034 : ERROR5(NULL, NULL, NULL,
; 1035 : "Unexpected attribute axis in '%s'.\n", ctxt->base);
; 1036 : ctxt->error = 1;
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx+8], 1
; 1037 : return;
jmp $LN1@xmlCompile
$LN17@xmlCompile:
; 1038 : }
; 1039 : NEXT;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN100@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv162[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN101@xmlCompile
$LN100@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv162[ebp], eax
$LN101@xmlCompile:
; 1040 : xmlCompileAttributeTest(ctxt);
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlCompileAttributeTest
add esp, 4
; 1041 : if (ctxt->error != 0)
mov edx, DWORD PTR _ctxt$[ebp]
cmp DWORD PTR [edx+8], 0
je SHORT $LN18@xmlCompile
; 1042 : goto error;
jmp $error$120
$LN18@xmlCompile:
; 1043 : return;
jmp $LN1@xmlCompile
$LN16@xmlCompile:
; 1044 : }
; 1045 : name = xmlPatScanNCName(ctxt);
mov eax, DWORD PTR _ctxt$[ebp]
push eax
call _xmlPatScanNCName
add esp, 4
mov DWORD PTR _name$[ebp], eax
; 1046 : if (name == NULL) {
cmp DWORD PTR _name$[ebp], 0
jne SHORT $LN19@xmlCompile
; 1047 : if (CUR == '*') {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 42 ; 0000002aH
jne SHORT $LN20@xmlCompile
; 1048 : NEXT;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN102@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv182[ebp], edx
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx], ecx
jmp SHORT $LN103@xmlCompile
$LN102@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv182[ebp], ecx
$LN103@xmlCompile:
; 1049 : PUSH(XML_OP_ALL, NULL, NULL);
push 0
push 0
push 8
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN22@xmlCompile
jmp $error$120
$LN22@xmlCompile:
; 1050 : return;
jmp $LN1@xmlCompile
; 1051 : } else {
jmp SHORT $LN19@xmlCompile
$LN20@xmlCompile:
; 1052 : ERROR(NULL, NULL, NULL,
; 1053 : "xmlCompileStepPattern : Name expected\n");
; 1054 : ctxt->error = 1;
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx+8], 1
; 1055 : return;
jmp $LN1@xmlCompile
$LN19@xmlCompile:
; 1056 : }
; 1057 : }
; 1058 : if (IS_BLANK_CH(CUR)) {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN24@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN25@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN24@xmlCompile
$LN25@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN23@xmlCompile
$LN24@xmlCompile:
; 1059 : hasBlanks = 1;
mov DWORD PTR _hasBlanks$[ebp], 1
$LN4@xmlCompile:
; 1060 : SKIP_BLANKS;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN26@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN27@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN26@xmlCompile
$LN27@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN23@xmlCompile
$LN26@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN104@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv233[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN105@xmlCompile
$LN104@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv233[ebp], eax
$LN105@xmlCompile:
jmp SHORT $LN4@xmlCompile
$LN23@xmlCompile:
; 1061 : }
; 1062 : if (CUR == ':') {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 58 ; 0000003aH
jne $LN28@xmlCompile
; 1063 : NEXT;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
test eax, eax
je SHORT $LN106@xmlCompile
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv247[ebp], edx
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx], ecx
jmp SHORT $LN107@xmlCompile
$LN106@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv247[ebp], ecx
$LN107@xmlCompile:
; 1064 : if (CUR != ':') {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 58 ; 0000003aH
je $LN30@xmlCompile
; 1065 : xmlChar *prefix = name;
mov edx, DWORD PTR _name$[ebp]
mov DWORD PTR _prefix$4[ebp], edx
; 1066 : int i;
; 1067 :
; 1068 : if (hasBlanks || IS_BLANK_CH(CUR)) {
cmp DWORD PTR _hasBlanks$[ebp], 0
jne SHORT $LN33@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN33@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN35@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN33@xmlCompile
$LN35@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN32@xmlCompile
$LN33@xmlCompile:
; 1069 : ERROR5(NULL, NULL, NULL, "Invalid QName.\n", NULL);
; 1070 : ctxt->error = 1;
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax+8], 1
; 1071 : goto error;
jmp $error$120
$LN32@xmlCompile:
; 1072 : }
; 1073 : /*
; 1074 : * This is a namespace match
; 1075 : */
; 1076 : token = xmlPatScanName(ctxt);
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatScanName
add esp, 4
mov DWORD PTR _token$[ebp], eax
; 1077 : if ((prefix[0] == 'x') &&
; 1078 : (prefix[1] == 'm') &&
; 1079 : (prefix[2] == 'l') &&
mov edx, 1
imul eax, edx, 0
mov ecx, DWORD PTR _prefix$4[ebp]
movzx edx, BYTE PTR [ecx+eax]
cmp edx, 120 ; 00000078H
jne SHORT $LN36@xmlCompile
mov eax, 1
shl eax, 0
mov ecx, DWORD PTR _prefix$4[ebp]
movzx edx, BYTE PTR [ecx+eax]
cmp edx, 109 ; 0000006dH
jne SHORT $LN36@xmlCompile
mov eax, 1
shl eax, 1
mov ecx, DWORD PTR _prefix$4[ebp]
movzx edx, BYTE PTR [ecx+eax]
cmp edx, 108 ; 0000006cH
jne SHORT $LN36@xmlCompile
mov eax, 1
imul ecx, eax, 3
mov edx, DWORD PTR _prefix$4[ebp]
movzx eax, BYTE PTR [edx+ecx]
test eax, eax
jne SHORT $LN36@xmlCompile
; 1080 : (prefix[3] == 0))
; 1081 : {
; 1082 : XML_PAT_COPY_NSNAME(ctxt, URL, XML_XML_NAMESPACE)
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx+16]
cmp DWORD PTR [edx+4], 0
je SHORT $LN38@xmlCompile
push -1
push OFFSET ??_C@_0CF@GLDAAHFK@http?3?1?1www?4w3?4org?1XML?11998?1name@
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
mov edx, DWORD PTR [ecx+4]
push edx
call _xmlDictLookup
add esp, 12 ; 0000000cH
mov DWORD PTR _URL$[ebp], eax
jmp SHORT $LN39@xmlCompile
$LN38@xmlCompile:
push OFFSET ??_C@_0CF@GLDAAHFK@http?3?1?1www?4w3?4org?1XML?11998?1name@
call _xmlStrdup
add esp, 4
mov DWORD PTR _URL$[ebp], eax
$LN39@xmlCompile:
; 1083 : } else {
jmp $LN37@xmlCompile
$LN36@xmlCompile:
; 1084 : for (i = 0;i < ctxt->nb_namespaces;i++) {
mov DWORD PTR _i$3[ebp], 0
jmp SHORT $LN8@xmlCompile
$LN6@xmlCompile:
mov eax, DWORD PTR _i$3[ebp]
add eax, 1
mov DWORD PTR _i$3[ebp], eax
$LN8@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR _i$3[ebp]
cmp edx, DWORD PTR [ecx+28]
jge SHORT $LN7@xmlCompile
; 1085 : if (xmlStrEqual(ctxt->namespaces[2 * i + 1], prefix)) {
mov eax, DWORD PTR _prefix$4[ebp]
push eax
mov ecx, DWORD PTR _i$3[ebp]
shl ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+24]
mov ecx, DWORD PTR [eax+ecx*4+4]
push ecx
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN40@xmlCompile
; 1086 : XML_PAT_COPY_NSNAME(ctxt, URL, ctxt->namespaces[2 * i])
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
cmp DWORD PTR [eax+4], 0
je SHORT $LN41@xmlCompile
push -1
mov ecx, DWORD PTR _i$3[ebp]
shl ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+24]
mov ecx, DWORD PTR [eax+ecx*4]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
mov ecx, DWORD PTR [eax+4]
push ecx
call _xmlDictLookup
add esp, 12 ; 0000000cH
mov DWORD PTR _URL$[ebp], eax
jmp SHORT $LN42@xmlCompile
$LN41@xmlCompile:
mov edx, DWORD PTR _i$3[ebp]
shl edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+24]
mov edx, DWORD PTR [ecx+edx*4]
push edx
call _xmlStrdup
add esp, 4
mov DWORD PTR _URL$[ebp], eax
$LN42@xmlCompile:
; 1087 : break;
jmp SHORT $LN7@xmlCompile
$LN40@xmlCompile:
; 1088 : }
; 1089 : }
jmp $LN6@xmlCompile
$LN7@xmlCompile:
; 1090 : if (i >= ctxt->nb_namespaces) {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR _i$3[ebp]
cmp ecx, DWORD PTR [eax+28]
jl SHORT $LN37@xmlCompile
; 1091 : ERROR5(NULL, NULL, NULL,
; 1092 : "xmlCompileStepPattern : no namespace bound to prefix %s\n",
; 1093 : prefix);
; 1094 : ctxt->error = 1;
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx+8], 1
; 1095 : goto error;
jmp $error$120
$LN37@xmlCompile:
; 1096 : }
; 1097 : }
; 1098 : XML_PAT_FREE_STRING(ctxt, prefix);
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN44@xmlCompile
mov esi, esp
mov edx, DWORD PTR _prefix$4[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN44@xmlCompile:
; 1099 : name = NULL;
mov DWORD PTR _name$[ebp], 0
; 1100 : if (token == NULL) {
cmp DWORD PTR _token$[ebp], 0
jne SHORT $LN45@xmlCompile
; 1101 : if (CUR == '*') {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 42 ; 0000002aH
jne SHORT $LN47@xmlCompile
; 1102 : NEXT;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN108@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv351[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN109@xmlCompile
$LN108@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv351[ebp], eax
$LN109@xmlCompile:
; 1103 : PUSH(XML_OP_NS, URL, NULL);
push 0
mov ecx, DWORD PTR _URL$[ebp]
push ecx
push 7
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN49@xmlCompile
jmp $error$120
$LN49@xmlCompile:
; 1104 : } else {
jmp SHORT $LN48@xmlCompile
$LN47@xmlCompile:
; 1105 : ERROR(NULL, NULL, NULL,
; 1106 : "xmlCompileStepPattern : Name expected\n");
; 1107 : ctxt->error = 1;
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx+8], 1
; 1108 : goto error;
jmp $error$120
$LN48@xmlCompile:
; 1109 : }
; 1110 : } else {
jmp SHORT $LN46@xmlCompile
$LN45@xmlCompile:
; 1111 : PUSH(XML_OP_ELEM, token, URL);
mov eax, DWORD PTR _URL$[ebp]
push eax
mov ecx, DWORD PTR _token$[ebp]
push ecx
push 2
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN46@xmlCompile
jmp $error$120
$LN46@xmlCompile:
; 1112 : }
; 1113 : } else {
jmp $LN31@xmlCompile
$LN30@xmlCompile:
; 1114 : NEXT;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN110@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv378[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN111@xmlCompile
$LN110@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv378[ebp], edx
$LN111@xmlCompile:
; 1115 : if (xmlStrEqual(name, (const xmlChar *) "child")) {
push OFFSET ??_C@_05GPGNDLEK@child@
mov eax, DWORD PTR _name$[ebp]
push eax
call _xmlStrEqual
add esp, 8
test eax, eax
je $LN51@xmlCompile
; 1116 : XML_PAT_FREE_STRING(ctxt, name);
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx+16]
cmp DWORD PTR [edx+4], 0
jne SHORT $LN53@xmlCompile
mov esi, esp
mov eax, DWORD PTR _name$[ebp]
push eax
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN53@xmlCompile:
; 1117 : name = xmlPatScanName(ctxt);
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatScanName
add esp, 4
mov DWORD PTR _name$[ebp], eax
; 1118 : if (name == NULL) {
cmp DWORD PTR _name$[ebp], 0
jne SHORT $LN54@xmlCompile
; 1119 : if (CUR == '*') {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 42 ; 0000002aH
jne SHORT $LN55@xmlCompile
; 1120 : NEXT;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN112@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv403[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN113@xmlCompile
$LN112@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv403[ebp], edx
$LN113@xmlCompile:
; 1121 : PUSH(XML_OP_ALL, NULL, NULL);
push 0
push 0
push 8
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN57@xmlCompile
jmp $error$120
$LN57@xmlCompile:
; 1122 : return;
jmp $LN1@xmlCompile
; 1123 : } else {
jmp SHORT $LN54@xmlCompile
$LN55@xmlCompile:
; 1124 : ERROR(NULL, NULL, NULL,
; 1125 : "xmlCompileStepPattern : QName expected\n");
; 1126 : ctxt->error = 1;
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax+8], 1
; 1127 : goto error;
jmp $error$120
$LN54@xmlCompile:
; 1128 : }
; 1129 : }
; 1130 : if (CUR == ':') {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 58 ; 0000003aH
jne $LN58@xmlCompile
; 1131 : xmlChar *prefix = name;
mov ecx, DWORD PTR _name$[ebp]
mov DWORD PTR _prefix$2[ebp], ecx
; 1132 : int i;
; 1133 :
; 1134 : NEXT;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN114@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv426[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN115@xmlCompile
$LN114@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv426[ebp], edx
$LN115@xmlCompile:
; 1135 : if (IS_BLANK_CH(CUR)) {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN61@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN62@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN61@xmlCompile
$LN62@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN60@xmlCompile
$LN61@xmlCompile:
; 1136 : ERROR5(NULL, NULL, NULL, "Invalid QName.\n", NULL);
; 1137 : ctxt->error = 1;
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax+8], 1
; 1138 : goto error;
jmp $error$120
$LN60@xmlCompile:
; 1139 : }
; 1140 : /*
; 1141 : * This is a namespace match
; 1142 : */
; 1143 : token = xmlPatScanName(ctxt);
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatScanName
add esp, 4
mov DWORD PTR _token$[ebp], eax
; 1144 : if ((prefix[0] == 'x') &&
; 1145 : (prefix[1] == 'm') &&
; 1146 : (prefix[2] == 'l') &&
mov edx, 1
imul eax, edx, 0
mov ecx, DWORD PTR _prefix$2[ebp]
movzx edx, BYTE PTR [ecx+eax]
cmp edx, 120 ; 00000078H
jne SHORT $LN63@xmlCompile
mov eax, 1
shl eax, 0
mov ecx, DWORD PTR _prefix$2[ebp]
movzx edx, BYTE PTR [ecx+eax]
cmp edx, 109 ; 0000006dH
jne SHORT $LN63@xmlCompile
mov eax, 1
shl eax, 1
mov ecx, DWORD PTR _prefix$2[ebp]
movzx edx, BYTE PTR [ecx+eax]
cmp edx, 108 ; 0000006cH
jne SHORT $LN63@xmlCompile
mov eax, 1
imul ecx, eax, 3
mov edx, DWORD PTR _prefix$2[ebp]
movzx eax, BYTE PTR [edx+ecx]
test eax, eax
jne SHORT $LN63@xmlCompile
; 1147 : (prefix[3] == 0))
; 1148 : {
; 1149 : XML_PAT_COPY_NSNAME(ctxt, URL, XML_XML_NAMESPACE)
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx+16]
cmp DWORD PTR [edx+4], 0
je SHORT $LN65@xmlCompile
push -1
push OFFSET ??_C@_0CF@GLDAAHFK@http?3?1?1www?4w3?4org?1XML?11998?1name@
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
mov edx, DWORD PTR [ecx+4]
push edx
call _xmlDictLookup
add esp, 12 ; 0000000cH
mov DWORD PTR _URL$[ebp], eax
jmp SHORT $LN66@xmlCompile
$LN65@xmlCompile:
push OFFSET ??_C@_0CF@GLDAAHFK@http?3?1?1www?4w3?4org?1XML?11998?1name@
call _xmlStrdup
add esp, 4
mov DWORD PTR _URL$[ebp], eax
$LN66@xmlCompile:
; 1150 : } else {
jmp $LN64@xmlCompile
$LN63@xmlCompile:
; 1151 : for (i = 0;i < ctxt->nb_namespaces;i++) {
mov DWORD PTR _i$1[ebp], 0
jmp SHORT $LN11@xmlCompile
$LN9@xmlCompile:
mov eax, DWORD PTR _i$1[ebp]
add eax, 1
mov DWORD PTR _i$1[ebp], eax
$LN11@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR _i$1[ebp]
cmp edx, DWORD PTR [ecx+28]
jge SHORT $LN10@xmlCompile
; 1152 : if (xmlStrEqual(ctxt->namespaces[2 * i + 1], prefix)) {
mov eax, DWORD PTR _prefix$2[ebp]
push eax
mov ecx, DWORD PTR _i$1[ebp]
shl ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+24]
mov ecx, DWORD PTR [eax+ecx*4+4]
push ecx
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN67@xmlCompile
; 1153 : XML_PAT_COPY_NSNAME(ctxt, URL, ctxt->namespaces[2 * i])
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
cmp DWORD PTR [eax+4], 0
je SHORT $LN68@xmlCompile
push -1
mov ecx, DWORD PTR _i$1[ebp]
shl ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+24]
mov ecx, DWORD PTR [eax+ecx*4]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
mov ecx, DWORD PTR [eax+4]
push ecx
call _xmlDictLookup
add esp, 12 ; 0000000cH
mov DWORD PTR _URL$[ebp], eax
jmp SHORT $LN69@xmlCompile
$LN68@xmlCompile:
mov edx, DWORD PTR _i$1[ebp]
shl edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+24]
mov edx, DWORD PTR [ecx+edx*4]
push edx
call _xmlStrdup
add esp, 4
mov DWORD PTR _URL$[ebp], eax
$LN69@xmlCompile:
; 1154 : break;
jmp SHORT $LN10@xmlCompile
$LN67@xmlCompile:
; 1155 : }
; 1156 : }
jmp $LN9@xmlCompile
$LN10@xmlCompile:
; 1157 : if (i >= ctxt->nb_namespaces) {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR _i$1[ebp]
cmp ecx, DWORD PTR [eax+28]
jl SHORT $LN64@xmlCompile
; 1158 : ERROR5(NULL, NULL, NULL,
; 1159 : "xmlCompileStepPattern : no namespace bound "
; 1160 : "to prefix %s\n", prefix);
; 1161 : ctxt->error = 1;
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx+8], 1
; 1162 : goto error;
jmp $error$120
$LN64@xmlCompile:
; 1163 : }
; 1164 : }
; 1165 : XML_PAT_FREE_STRING(ctxt, prefix);
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN71@xmlCompile
mov esi, esp
mov edx, DWORD PTR _prefix$2[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN71@xmlCompile:
; 1166 : name = NULL;
mov DWORD PTR _name$[ebp], 0
; 1167 : if (token == NULL) {
cmp DWORD PTR _token$[ebp], 0
jne SHORT $LN72@xmlCompile
; 1168 : if (CUR == '*') {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 42 ; 0000002aH
jne SHORT $LN74@xmlCompile
; 1169 : NEXT;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN116@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv525[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN117@xmlCompile
$LN116@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv525[ebp], eax
$LN117@xmlCompile:
; 1170 : PUSH(XML_OP_NS, URL, NULL);
push 0
mov ecx, DWORD PTR _URL$[ebp]
push ecx
push 7
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN76@xmlCompile
jmp $error$120
$LN76@xmlCompile:
; 1171 : } else {
jmp SHORT $LN75@xmlCompile
$LN74@xmlCompile:
; 1172 : ERROR(NULL, NULL, NULL,
; 1173 : "xmlCompileStepPattern : Name expected\n");
; 1174 : ctxt->error = 1;
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx+8], 1
; 1175 : goto error;
jmp $error$120
$LN75@xmlCompile:
; 1176 : }
; 1177 : } else {
jmp SHORT $LN73@xmlCompile
$LN72@xmlCompile:
; 1178 : PUSH(XML_OP_CHILD, token, URL);
mov eax, DWORD PTR _URL$[ebp]
push eax
mov ecx, DWORD PTR _token$[ebp]
push ecx
push 3
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN73@xmlCompile
jmp $error$120
$LN73@xmlCompile:
; 1179 : }
; 1180 : } else
jmp SHORT $LN59@xmlCompile
$LN58@xmlCompile:
; 1181 : PUSH(XML_OP_CHILD, name, NULL);
push 0
mov edx, DWORD PTR _name$[ebp]
push edx
push 3
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN59@xmlCompile
jmp $error$120
$LN59@xmlCompile:
; 1182 : return;
jmp $LN1@xmlCompile
jmp $LN31@xmlCompile
$LN51@xmlCompile:
; 1183 : } else if (xmlStrEqual(name, (const xmlChar *) "attribute")) {
push OFFSET ??_C@_09HGIEBAJ@attribute@
mov eax, DWORD PTR _name$[ebp]
push eax
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN79@xmlCompile
; 1184 : XML_PAT_FREE_STRING(ctxt, name)
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx+16]
cmp DWORD PTR [edx+4], 0
jne SHORT $LN81@xmlCompile
mov esi, esp
mov eax, DWORD PTR _name$[ebp]
push eax
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN81@xmlCompile:
; 1185 : name = NULL;
mov DWORD PTR _name$[ebp], 0
; 1186 : if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx+16]
mov eax, DWORD PTR [edx+16]
and eax, 2
je SHORT $LN82@xmlCompile
; 1187 : ERROR5(NULL, NULL, NULL,
; 1188 : "Unexpected attribute axis in '%s'.\n", ctxt->base);
; 1189 : ctxt->error = 1;
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx+8], 1
; 1190 : goto error;
jmp $error$120
$LN82@xmlCompile:
; 1191 : }
; 1192 : xmlCompileAttributeTest(ctxt);
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlCompileAttributeTest
add esp, 4
; 1193 : if (ctxt->error != 0)
mov eax, DWORD PTR _ctxt$[ebp]
cmp DWORD PTR [eax+8], 0
je SHORT $LN83@xmlCompile
; 1194 : goto error;
jmp $error$120
$LN83@xmlCompile:
; 1195 : return;
jmp $LN1@xmlCompile
; 1196 : } else {
jmp SHORT $LN31@xmlCompile
$LN79@xmlCompile:
; 1197 : ERROR5(NULL, NULL, NULL,
; 1198 : "The 'element' or 'attribute' axis is expected.\n", NULL);
; 1199 : ctxt->error = 1;
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx+8], 1
; 1200 : goto error;
jmp $error$120
$LN31@xmlCompile:
; 1201 : }
; 1202 : }
jmp $LN29@xmlCompile
$LN28@xmlCompile:
; 1203 : } else if (CUR == '*') {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 42 ; 0000002aH
jne SHORT $LN84@xmlCompile
; 1204 : if (name != NULL) {
cmp DWORD PTR _name$[ebp], 0
je SHORT $LN86@xmlCompile
; 1205 : ctxt->error = 1;
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx+8], 1
; 1206 : goto error;
jmp SHORT $error$120
$LN86@xmlCompile:
; 1207 : }
; 1208 : NEXT;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN118@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv583[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN119@xmlCompile
$LN118@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv583[ebp], eax
$LN119@xmlCompile:
; 1209 : PUSH(XML_OP_ALL, token, NULL);
push 0
mov ecx, DWORD PTR _token$[ebp]
push ecx
push 8
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN87@xmlCompile
jmp SHORT $error$120
$LN87@xmlCompile:
; 1210 : } else {
jmp SHORT $LN29@xmlCompile
$LN84@xmlCompile:
; 1211 : PUSH(XML_OP_ELEM, name, NULL);
push 0
mov edx, DWORD PTR _name$[ebp]
push edx
push 2
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN29@xmlCompile
jmp SHORT $error$120
$LN29@xmlCompile:
; 1212 : }
; 1213 : return;
jmp SHORT $LN1@xmlCompile
$error$120:
; 1214 : error:
; 1215 : if (URL != NULL)
cmp DWORD PTR _URL$[ebp], 0
je SHORT $LN89@xmlCompile
; 1216 : XML_PAT_FREE_STRING(ctxt, URL)
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN89@xmlCompile
mov esi, esp
mov edx, DWORD PTR _URL$[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN89@xmlCompile:
; 1217 : if (token != NULL)
cmp DWORD PTR _token$[ebp], 0
je SHORT $LN91@xmlCompile
; 1218 : XML_PAT_FREE_STRING(ctxt, token)
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN91@xmlCompile
mov esi, esp
mov edx, DWORD PTR _token$[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN91@xmlCompile:
; 1219 : if (name != NULL)
cmp DWORD PTR _name$[ebp], 0
je SHORT $LN1@xmlCompile
; 1220 : XML_PAT_FREE_STRING(ctxt, name)
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN1@xmlCompile
mov esi, esp
mov edx, DWORD PTR _name$[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN1@xmlCompile:
; 1221 : }
pop edi
pop esi
add esp, 80 ; 00000050H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlCompileStepPattern ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlCompileAttributeTest
_TEXT SEGMENT
tv268 = -36 ; size = 4
tv161 = -32 ; size = 4
tv146 = -28 ; size = 4
tv89 = -24 ; size = 4
_prefix$1 = -20 ; size = 4
_i$2 = -16 ; size = 4
_URL$ = -12 ; size = 4
_name$ = -8 ; size = 4
_token$ = -4 ; size = 4
_ctxt$ = 8 ; size = 4
_xmlCompileAttributeTest PROC ; COMDAT
; 921 : xmlCompileAttributeTest(xmlPatParserContextPtr ctxt) {
push ebp
mov ebp, esp
sub esp, 36 ; 00000024H
push esi
mov eax, -858993460 ; ccccccccH
mov DWORD PTR [ebp-36], eax
mov DWORD PTR [ebp-32], eax
mov DWORD PTR [ebp-28], eax
mov DWORD PTR [ebp-24], eax
mov DWORD PTR [ebp-20], eax
mov DWORD PTR [ebp-16], eax
mov DWORD PTR [ebp-12], eax
mov DWORD PTR [ebp-8], eax
mov DWORD PTR [ebp-4], eax
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 922 : xmlChar *token = NULL;
mov DWORD PTR _token$[ebp], 0
; 923 : xmlChar *name = NULL;
mov DWORD PTR _name$[ebp], 0
; 924 : xmlChar *URL = NULL;
mov DWORD PTR _URL$[ebp], 0
$LN2@xmlCompile:
; 925 :
; 926 : SKIP_BLANKS;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN7@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN8@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN7@xmlCompile
$LN8@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN3@xmlCompile
$LN7@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN41@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv89[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN42@xmlCompile
$LN41@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv89[ebp], eax
$LN42@xmlCompile:
jmp SHORT $LN2@xmlCompile
$LN3@xmlCompile:
; 927 : name = xmlPatScanNCName(ctxt);
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatScanNCName
add esp, 4
mov DWORD PTR _name$[ebp], eax
; 928 : if (name == NULL) {
cmp DWORD PTR _name$[ebp], 0
jne SHORT $LN9@xmlCompile
; 929 : if (CUR == '*') {
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
cmp ecx, 42 ; 0000002aH
jne SHORT $LN10@xmlCompile
; 930 : PUSH(XML_OP_ATTR, NULL, NULL);
push 0
push 0
push 4
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN12@xmlCompile
jmp $error$49
$LN12@xmlCompile:
; 931 : NEXT;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN43@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv146[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN44@xmlCompile
$LN43@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv146[ebp], edx
$LN44@xmlCompile:
; 932 : } else {
jmp SHORT $LN11@xmlCompile
$LN10@xmlCompile:
; 933 : ERROR(NULL, NULL, NULL,
; 934 : "xmlCompileAttributeTest : Name expected\n");
; 935 : ctxt->error = 1;
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax+8], 1
$LN11@xmlCompile:
; 936 : }
; 937 : return;
jmp $LN1@xmlCompile
$LN9@xmlCompile:
; 938 : }
; 939 : if (CUR == ':') {
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
movzx eax, BYTE PTR [edx]
cmp eax, 58 ; 0000003aH
jne $LN13@xmlCompile
; 940 : int i;
; 941 : xmlChar *prefix = name;
mov ecx, DWORD PTR _name$[ebp]
mov DWORD PTR _prefix$1[ebp], ecx
; 942 :
; 943 : NEXT;
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN45@xmlCompile
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv161[ebp], eax
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
add edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax], edx
jmp SHORT $LN46@xmlCompile
$LN45@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR tv161[ebp], edx
$LN46@xmlCompile:
; 944 :
; 945 : if (IS_BLANK_CH(CUR)) {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN16@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN17@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN16@xmlCompile
$LN17@xmlCompile:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN15@xmlCompile
$LN16@xmlCompile:
; 946 : ERROR5(NULL, NULL, NULL, "Invalid QName.\n", NULL);
; 947 : XML_PAT_FREE_STRING(ctxt, prefix);
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN18@xmlCompile
mov esi, esp
mov edx, DWORD PTR _prefix$1[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN18@xmlCompile:
; 948 : ctxt->error = 1;
mov eax, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [eax+8], 1
; 949 : goto error;
jmp $error$49
$LN15@xmlCompile:
; 950 : }
; 951 : /*
; 952 : * This is a namespace match
; 953 : */
; 954 : token = xmlPatScanName(ctxt);
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatScanName
add esp, 4
mov DWORD PTR _token$[ebp], eax
; 955 : if ((prefix[0] == 'x') &&
; 956 : (prefix[1] == 'm') &&
; 957 : (prefix[2] == 'l') &&
mov edx, 1
imul eax, edx, 0
mov ecx, DWORD PTR _prefix$1[ebp]
movzx edx, BYTE PTR [ecx+eax]
cmp edx, 120 ; 00000078H
jne SHORT $LN19@xmlCompile
mov eax, 1
shl eax, 0
mov ecx, DWORD PTR _prefix$1[ebp]
movzx edx, BYTE PTR [ecx+eax]
cmp edx, 109 ; 0000006dH
jne SHORT $LN19@xmlCompile
mov eax, 1
shl eax, 1
mov ecx, DWORD PTR _prefix$1[ebp]
movzx edx, BYTE PTR [ecx+eax]
cmp edx, 108 ; 0000006cH
jne SHORT $LN19@xmlCompile
mov eax, 1
imul ecx, eax, 3
mov edx, DWORD PTR _prefix$1[ebp]
movzx eax, BYTE PTR [edx+ecx]
test eax, eax
jne SHORT $LN19@xmlCompile
; 958 : (prefix[3] == 0))
; 959 : {
; 960 : XML_PAT_COPY_NSNAME(ctxt, URL, XML_XML_NAMESPACE);
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx+16]
cmp DWORD PTR [edx+4], 0
je SHORT $LN21@xmlCompile
push -1
push OFFSET ??_C@_0CF@GLDAAHFK@http?3?1?1www?4w3?4org?1XML?11998?1name@
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
mov edx, DWORD PTR [ecx+4]
push edx
call _xmlDictLookup
add esp, 12 ; 0000000cH
mov DWORD PTR _URL$[ebp], eax
jmp SHORT $LN22@xmlCompile
$LN21@xmlCompile:
push OFFSET ??_C@_0CF@GLDAAHFK@http?3?1?1www?4w3?4org?1XML?11998?1name@
call _xmlStrdup
add esp, 4
mov DWORD PTR _URL$[ebp], eax
$LN22@xmlCompile:
; 961 : } else {
jmp $LN20@xmlCompile
$LN19@xmlCompile:
; 962 : for (i = 0;i < ctxt->nb_namespaces;i++) {
mov DWORD PTR _i$2[ebp], 0
jmp SHORT $LN6@xmlCompile
$LN4@xmlCompile:
mov eax, DWORD PTR _i$2[ebp]
add eax, 1
mov DWORD PTR _i$2[ebp], eax
$LN6@xmlCompile:
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR _i$2[ebp]
cmp edx, DWORD PTR [ecx+28]
jge SHORT $LN5@xmlCompile
; 963 : if (xmlStrEqual(ctxt->namespaces[2 * i + 1], prefix)) {
mov eax, DWORD PTR _prefix$1[ebp]
push eax
mov ecx, DWORD PTR _i$2[ebp]
shl ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+24]
mov ecx, DWORD PTR [eax+ecx*4+4]
push ecx
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN23@xmlCompile
; 964 : XML_PAT_COPY_NSNAME(ctxt, URL, ctxt->namespaces[2 * i])
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
cmp DWORD PTR [eax+4], 0
je SHORT $LN24@xmlCompile
push -1
mov ecx, DWORD PTR _i$2[ebp]
shl ecx, 1
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+24]
mov ecx, DWORD PTR [eax+ecx*4]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
mov ecx, DWORD PTR [eax+4]
push ecx
call _xmlDictLookup
add esp, 12 ; 0000000cH
mov DWORD PTR _URL$[ebp], eax
jmp SHORT $LN25@xmlCompile
$LN24@xmlCompile:
mov edx, DWORD PTR _i$2[ebp]
shl edx, 1
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+24]
mov edx, DWORD PTR [ecx+edx*4]
push edx
call _xmlStrdup
add esp, 4
mov DWORD PTR _URL$[ebp], eax
$LN25@xmlCompile:
; 965 : break;
jmp SHORT $LN5@xmlCompile
$LN23@xmlCompile:
; 966 : }
; 967 : }
jmp $LN4@xmlCompile
$LN5@xmlCompile:
; 968 : if (i >= ctxt->nb_namespaces) {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR _i$2[ebp]
cmp ecx, DWORD PTR [eax+28]
jl SHORT $LN20@xmlCompile
; 969 : ERROR5(NULL, NULL, NULL,
; 970 : "xmlCompileAttributeTest : no namespace bound to prefix %s\n",
; 971 : prefix);
; 972 : XML_PAT_FREE_STRING(ctxt, prefix);
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
cmp DWORD PTR [eax+4], 0
jne SHORT $LN27@xmlCompile
mov esi, esp
mov ecx, DWORD PTR _prefix$1[ebp]
push ecx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN27@xmlCompile:
; 973 : ctxt->error = 1;
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx+8], 1
; 974 : goto error;
jmp $error$49
$LN20@xmlCompile:
; 975 : }
; 976 : }
; 977 : XML_PAT_FREE_STRING(ctxt, prefix);
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN28@xmlCompile
mov esi, esp
mov edx, DWORD PTR _prefix$1[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN28@xmlCompile:
; 978 : if (token == NULL) {
cmp DWORD PTR _token$[ebp], 0
jne SHORT $LN29@xmlCompile
; 979 : if (CUR == '*') {
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 42 ; 0000002aH
jne SHORT $LN31@xmlCompile
; 980 : NEXT;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN47@xmlCompile
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv268[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN48@xmlCompile
$LN47@xmlCompile:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv268[ebp], eax
$LN48@xmlCompile:
; 981 : PUSH(XML_OP_ATTR, NULL, URL);
mov ecx, DWORD PTR _URL$[ebp]
push ecx
push 0
push 4
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN33@xmlCompile
jmp SHORT $error$49
$LN33@xmlCompile:
; 982 : } else {
jmp SHORT $LN32@xmlCompile
$LN31@xmlCompile:
; 983 : ERROR(NULL, NULL, NULL,
; 984 : "xmlCompileAttributeTest : Name expected\n");
; 985 : ctxt->error = 1;
mov edx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [edx+8], 1
; 986 : goto error;
jmp SHORT $error$49
$LN32@xmlCompile:
; 987 : }
; 988 : } else {
jmp SHORT $LN30@xmlCompile
$LN29@xmlCompile:
; 989 : PUSH(XML_OP_ATTR, token, URL);
mov eax, DWORD PTR _URL$[ebp]
push eax
mov ecx, DWORD PTR _token$[ebp]
push ecx
push 4
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+16]
push eax
mov ecx, DWORD PTR _ctxt$[ebp]
push ecx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN30@xmlCompile
jmp SHORT $error$49
$LN30@xmlCompile:
; 990 : }
; 991 : } else {
jmp SHORT $LN14@xmlCompile
$LN13@xmlCompile:
; 992 : PUSH(XML_OP_ATTR, name, NULL);
push 0
mov edx, DWORD PTR _name$[ebp]
push edx
push 4
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlPatternAdd
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN14@xmlCompile
jmp SHORT $error$49
$LN14@xmlCompile:
; 993 : }
; 994 : return;
jmp SHORT $LN1@xmlCompile
$error$49:
; 995 : error:
; 996 : if (URL != NULL)
cmp DWORD PTR _URL$[ebp], 0
je SHORT $LN36@xmlCompile
; 997 : XML_PAT_FREE_STRING(ctxt, URL)
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN36@xmlCompile
mov esi, esp
mov edx, DWORD PTR _URL$[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN36@xmlCompile:
; 998 : if (token != NULL)
cmp DWORD PTR _token$[ebp], 0
je SHORT $LN1@xmlCompile
; 999 : XML_PAT_FREE_STRING(ctxt, token);
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax+16]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN1@xmlCompile
mov esi, esp
mov edx, DWORD PTR _token$[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN1@xmlCompile:
; 1000 : }
pop esi
add esp, 36 ; 00000024H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlCompileAttributeTest ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatScanNCName
_TEXT SEGMENT
tv202 = -84 ; size = 4
tv201 = -80 ; size = 4
tv194 = -76 ; size = 4
tv185 = -72 ; size = 4
tv184 = -68 ; size = 4
tv175 = -64 ; size = 4
tv176 = -60 ; size = 4
tv167 = -56 ; size = 4
tv166 = -52 ; size = 4
tv149 = -48 ; size = 4
tv150 = -44 ; size = 4
tv141 = -40 ; size = 4
tv140 = -36 ; size = 4
tv89 = -32 ; size = 4
_len$ = -24 ; size = 4
_val$ = -16 ; size = 4
_ret$ = -12 ; size = 4
_cur$ = -8 ; size = 4
_q$ = -4 ; size = 4
_ctxt$ = 8 ; size = 4
_xmlPatScanNCName PROC ; COMDAT
; 860 : xmlPatScanNCName(xmlPatParserContextPtr ctxt) {
push ebp
mov ebp, esp
sub esp, 84 ; 00000054H
push edi
lea edi, DWORD PTR [ebp-84]
mov ecx, 21 ; 00000015H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 861 : const xmlChar *q, *cur;
; 862 : xmlChar *ret = NULL;
mov DWORD PTR _ret$[ebp], 0
$LN2@xmlPatScan:
; 863 : int val, len;
; 864 :
; 865 : SKIP_BLANKS;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN6@xmlPatScan
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN7@xmlPatScan
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN6@xmlPatScan
$LN7@xmlPatScan:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN3@xmlPatScan
$LN6@xmlPatScan:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN13@xmlPatScan
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv89[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN14@xmlPatScan
$LN13@xmlPatScan:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv89[ebp], eax
$LN14@xmlPatScan:
jmp SHORT $LN2@xmlPatScan
$LN3@xmlPatScan:
; 866 :
; 867 : cur = q = CUR_PTR;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR _q$[ebp], edx
mov eax, DWORD PTR _q$[ebp]
mov DWORD PTR _cur$[ebp], eax
; 868 : val = xmlStringCurrentChar(NULL, cur, &len);
lea ecx, DWORD PTR _len$[ebp]
push ecx
mov edx, DWORD PTR _cur$[ebp]
push edx
push 0
call _xmlStringCurrentChar
add esp, 12 ; 0000000cH
mov DWORD PTR _val$[ebp], eax
; 869 : if (!IS_LETTER(val) && (val != '_'))
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN21@xmlPatScan
cmp DWORD PTR _val$[ebp], 65 ; 00000041H
jl SHORT $LN15@xmlPatScan
cmp DWORD PTR _val$[ebp], 90 ; 0000005aH
jle SHORT $LN17@xmlPatScan
$LN15@xmlPatScan:
cmp DWORD PTR _val$[ebp], 97 ; 00000061H
jl SHORT $LN16@xmlPatScan
cmp DWORD PTR _val$[ebp], 122 ; 0000007aH
jle SHORT $LN17@xmlPatScan
$LN16@xmlPatScan:
cmp DWORD PTR _val$[ebp], 192 ; 000000c0H
jl SHORT $LN18@xmlPatScan
cmp DWORD PTR _val$[ebp], 214 ; 000000d6H
jle SHORT $LN17@xmlPatScan
$LN18@xmlPatScan:
cmp DWORD PTR _val$[ebp], 216 ; 000000d8H
jl SHORT $LN19@xmlPatScan
cmp DWORD PTR _val$[ebp], 246 ; 000000f6H
jle SHORT $LN17@xmlPatScan
$LN19@xmlPatScan:
cmp DWORD PTR _val$[ebp], 248 ; 000000f8H
jge SHORT $LN17@xmlPatScan
mov DWORD PTR tv140[ebp], 0
jmp SHORT $LN20@xmlPatScan
$LN17@xmlPatScan:
mov DWORD PTR tv140[ebp], 1
$LN20@xmlPatScan:
mov eax, DWORD PTR tv140[ebp]
mov DWORD PTR tv141[ebp], eax
jmp SHORT $LN22@xmlPatScan
$LN21@xmlPatScan:
push OFFSET _xmlIsBaseCharGroup
mov ecx, DWORD PTR _val$[ebp]
push ecx
call _xmlCharInRange
add esp, 8
mov DWORD PTR tv141[ebp], eax
$LN22@xmlPatScan:
cmp DWORD PTR tv141[ebp], 0
jne SHORT $LN4@xmlPatScan
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN27@xmlPatScan
mov DWORD PTR tv150[ebp], 0
jmp SHORT $LN28@xmlPatScan
$LN27@xmlPatScan:
cmp DWORD PTR _val$[ebp], 19968 ; 00004e00H
jl SHORT $LN23@xmlPatScan
cmp DWORD PTR _val$[ebp], 40869 ; 00009fa5H
jle SHORT $LN24@xmlPatScan
$LN23@xmlPatScan:
cmp DWORD PTR _val$[ebp], 12295 ; 00003007H
je SHORT $LN24@xmlPatScan
cmp DWORD PTR _val$[ebp], 12321 ; 00003021H
jl SHORT $LN25@xmlPatScan
cmp DWORD PTR _val$[ebp], 12329 ; 00003029H
jle SHORT $LN24@xmlPatScan
$LN25@xmlPatScan:
mov DWORD PTR tv149[ebp], 0
jmp SHORT $LN26@xmlPatScan
$LN24@xmlPatScan:
mov DWORD PTR tv149[ebp], 1
$LN26@xmlPatScan:
mov edx, DWORD PTR tv149[ebp]
mov DWORD PTR tv150[ebp], edx
$LN28@xmlPatScan:
cmp DWORD PTR tv150[ebp], 0
jne SHORT $LN4@xmlPatScan
cmp DWORD PTR _val$[ebp], 95 ; 0000005fH
je SHORT $LN4@xmlPatScan
; 870 : return(NULL);
xor eax, eax
jmp $LN1@xmlPatScan
$LN4@xmlPatScan:
; 871 :
; 872 : while ((IS_LETTER(val)) || (IS_DIGIT(val)) ||
; 873 : (val == '.') || (val == '-') ||
; 874 : (val == '_') ||
; 875 : (IS_COMBINING(val)) ||
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN35@xmlPatScan
cmp DWORD PTR _val$[ebp], 65 ; 00000041H
jl SHORT $LN29@xmlPatScan
cmp DWORD PTR _val$[ebp], 90 ; 0000005aH
jle SHORT $LN31@xmlPatScan
$LN29@xmlPatScan:
cmp DWORD PTR _val$[ebp], 97 ; 00000061H
jl SHORT $LN30@xmlPatScan
cmp DWORD PTR _val$[ebp], 122 ; 0000007aH
jle SHORT $LN31@xmlPatScan
$LN30@xmlPatScan:
cmp DWORD PTR _val$[ebp], 192 ; 000000c0H
jl SHORT $LN32@xmlPatScan
cmp DWORD PTR _val$[ebp], 214 ; 000000d6H
jle SHORT $LN31@xmlPatScan
$LN32@xmlPatScan:
cmp DWORD PTR _val$[ebp], 216 ; 000000d8H
jl SHORT $LN33@xmlPatScan
cmp DWORD PTR _val$[ebp], 246 ; 000000f6H
jle SHORT $LN31@xmlPatScan
$LN33@xmlPatScan:
cmp DWORD PTR _val$[ebp], 248 ; 000000f8H
jge SHORT $LN31@xmlPatScan
mov DWORD PTR tv166[ebp], 0
jmp SHORT $LN34@xmlPatScan
$LN31@xmlPatScan:
mov DWORD PTR tv166[ebp], 1
$LN34@xmlPatScan:
mov eax, DWORD PTR tv166[ebp]
mov DWORD PTR tv167[ebp], eax
jmp SHORT $LN36@xmlPatScan
$LN35@xmlPatScan:
push OFFSET _xmlIsBaseCharGroup
mov ecx, DWORD PTR _val$[ebp]
push ecx
call _xmlCharInRange
add esp, 8
mov DWORD PTR tv167[ebp], eax
$LN36@xmlPatScan:
cmp DWORD PTR tv167[ebp], 0
jne $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN41@xmlPatScan
mov DWORD PTR tv176[ebp], 0
jmp SHORT $LN42@xmlPatScan
$LN41@xmlPatScan:
cmp DWORD PTR _val$[ebp], 19968 ; 00004e00H
jl SHORT $LN37@xmlPatScan
cmp DWORD PTR _val$[ebp], 40869 ; 00009fa5H
jle SHORT $LN38@xmlPatScan
$LN37@xmlPatScan:
cmp DWORD PTR _val$[ebp], 12295 ; 00003007H
je SHORT $LN38@xmlPatScan
cmp DWORD PTR _val$[ebp], 12321 ; 00003021H
jl SHORT $LN39@xmlPatScan
cmp DWORD PTR _val$[ebp], 12329 ; 00003029H
jle SHORT $LN38@xmlPatScan
$LN39@xmlPatScan:
mov DWORD PTR tv175[ebp], 0
jmp SHORT $LN40@xmlPatScan
$LN38@xmlPatScan:
mov DWORD PTR tv175[ebp], 1
$LN40@xmlPatScan:
mov edx, DWORD PTR tv175[ebp]
mov DWORD PTR tv176[ebp], edx
$LN42@xmlPatScan:
cmp DWORD PTR tv176[ebp], 0
jne $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN45@xmlPatScan
cmp DWORD PTR _val$[ebp], 48 ; 00000030H
jl SHORT $LN43@xmlPatScan
cmp DWORD PTR _val$[ebp], 57 ; 00000039H
jg SHORT $LN43@xmlPatScan
mov DWORD PTR tv184[ebp], 1
jmp SHORT $LN44@xmlPatScan
$LN43@xmlPatScan:
mov DWORD PTR tv184[ebp], 0
$LN44@xmlPatScan:
mov eax, DWORD PTR tv184[ebp]
mov DWORD PTR tv185[ebp], eax
jmp SHORT $LN46@xmlPatScan
$LN45@xmlPatScan:
push OFFSET _xmlIsDigitGroup
mov ecx, DWORD PTR _val$[ebp]
push ecx
call _xmlCharInRange
add esp, 8
mov DWORD PTR tv185[ebp], eax
$LN46@xmlPatScan:
cmp DWORD PTR tv185[ebp], 0
jne $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 46 ; 0000002eH
je SHORT $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 45 ; 0000002dH
je SHORT $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 95 ; 0000005fH
je SHORT $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN47@xmlPatScan
mov DWORD PTR tv194[ebp], 0
jmp SHORT $LN48@xmlPatScan
$LN47@xmlPatScan:
push OFFSET _xmlIsCombiningGroup
mov edx, DWORD PTR _val$[ebp]
push edx
call _xmlCharInRange
add esp, 8
mov DWORD PTR tv194[ebp], eax
$LN48@xmlPatScan:
cmp DWORD PTR tv194[ebp], 0
jne SHORT $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN51@xmlPatScan
cmp DWORD PTR _val$[ebp], 183 ; 000000b7H
jne SHORT $LN49@xmlPatScan
mov DWORD PTR tv201[ebp], 1
jmp SHORT $LN50@xmlPatScan
$LN49@xmlPatScan:
mov DWORD PTR tv201[ebp], 0
$LN50@xmlPatScan:
mov eax, DWORD PTR tv201[ebp]
mov DWORD PTR tv202[ebp], eax
jmp SHORT $LN52@xmlPatScan
$LN51@xmlPatScan:
push OFFSET _xmlIsExtenderGroup
mov ecx, DWORD PTR _val$[ebp]
push ecx
call _xmlCharInRange
add esp, 8
mov DWORD PTR tv202[ebp], eax
$LN52@xmlPatScan:
cmp DWORD PTR tv202[ebp], 0
je SHORT $LN5@xmlPatScan
$LN9@xmlPatScan:
; 876 : (IS_EXTENDER(val))) {
; 877 : cur += len;
mov edx, DWORD PTR _cur$[ebp]
add edx, DWORD PTR _len$[ebp]
mov DWORD PTR _cur$[ebp], edx
; 878 : val = xmlStringCurrentChar(NULL, cur, &len);
lea eax, DWORD PTR _len$[ebp]
push eax
mov ecx, DWORD PTR _cur$[ebp]
push ecx
push 0
call _xmlStringCurrentChar
add esp, 12 ; 0000000cH
mov DWORD PTR _val$[ebp], eax
; 879 : }
jmp $LN4@xmlPatScan
$LN5@xmlPatScan:
; 880 : if (ctxt->dict)
mov edx, DWORD PTR _ctxt$[ebp]
cmp DWORD PTR [edx+12], 0
je SHORT $LN10@xmlPatScan
; 881 : ret = (xmlChar *) xmlDictLookup(ctxt->dict, q, cur - q);
mov eax, DWORD PTR _cur$[ebp]
sub eax, DWORD PTR _q$[ebp]
push eax
mov ecx, DWORD PTR _q$[ebp]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+12]
push eax
call _xmlDictLookup
add esp, 12 ; 0000000cH
mov DWORD PTR _ret$[ebp], eax
jmp SHORT $LN11@xmlPatScan
$LN10@xmlPatScan:
; 882 : else
; 883 : ret = xmlStrndup(q, cur - q);
mov ecx, DWORD PTR _cur$[ebp]
sub ecx, DWORD PTR _q$[ebp]
push ecx
mov edx, DWORD PTR _q$[ebp]
push edx
call _xmlStrndup
add esp, 8
mov DWORD PTR _ret$[ebp], eax
$LN11@xmlPatScan:
; 884 : CUR_PTR = cur;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [eax], ecx
; 885 : return(ret);
mov eax, DWORD PTR _ret$[ebp]
$LN1@xmlPatScan:
; 886 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $LN55@xmlPatScan
call @_RTC_CheckStackVars@8
pop eax
pop edx
pop edi
add esp, 84 ; 00000054H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
npad 1
$LN55@xmlPatScan:
DD 1
DD $LN54@xmlPatScan
$LN54@xmlPatScan:
DD -24 ; ffffffe8H
DD 4
DD $LN53@xmlPatScan
$LN53@xmlPatScan:
DB 108 ; 0000006cH
DB 101 ; 00000065H
DB 110 ; 0000006eH
DB 0
_xmlPatScanNCName ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatScanName
_TEXT SEGMENT
tv203 = -84 ; size = 4
tv202 = -80 ; size = 4
tv195 = -76 ; size = 4
tv186 = -72 ; size = 4
tv185 = -68 ; size = 4
tv176 = -64 ; size = 4
tv177 = -60 ; size = 4
tv168 = -56 ; size = 4
tv167 = -52 ; size = 4
tv149 = -48 ; size = 4
tv150 = -44 ; size = 4
tv141 = -40 ; size = 4
tv140 = -36 ; size = 4
tv89 = -32 ; size = 4
_len$ = -24 ; size = 4
_val$ = -16 ; size = 4
_ret$ = -12 ; size = 4
_cur$ = -8 ; size = 4
_q$ = -4 ; size = 4
_ctxt$ = 8 ; size = 4
_xmlPatScanName PROC ; COMDAT
; 822 : xmlPatScanName(xmlPatParserContextPtr ctxt) {
push ebp
mov ebp, esp
sub esp, 84 ; 00000054H
push edi
lea edi, DWORD PTR [ebp-84]
mov ecx, 21 ; 00000015H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 823 : const xmlChar *q, *cur;
; 824 : xmlChar *ret = NULL;
mov DWORD PTR _ret$[ebp], 0
$LN2@xmlPatScan:
; 825 : int val, len;
; 826 :
; 827 : SKIP_BLANKS;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 32 ; 00000020H
je SHORT $LN6@xmlPatScan
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 9
jl SHORT $LN7@xmlPatScan
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 10 ; 0000000aH
jle SHORT $LN6@xmlPatScan
$LN7@xmlPatScan:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
cmp edx, 13 ; 0000000dH
jne SHORT $LN3@xmlPatScan
$LN6@xmlPatScan:
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN13@xmlPatScan
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv89[ebp], ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
jmp SHORT $LN14@xmlPatScan
$LN13@xmlPatScan:
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv89[ebp], eax
$LN14@xmlPatScan:
jmp SHORT $LN2@xmlPatScan
$LN3@xmlPatScan:
; 828 :
; 829 : cur = q = CUR_PTR;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR _q$[ebp], edx
mov eax, DWORD PTR _q$[ebp]
mov DWORD PTR _cur$[ebp], eax
; 830 : val = xmlStringCurrentChar(NULL, cur, &len);
lea ecx, DWORD PTR _len$[ebp]
push ecx
mov edx, DWORD PTR _cur$[ebp]
push edx
push 0
call _xmlStringCurrentChar
add esp, 12 ; 0000000cH
mov DWORD PTR _val$[ebp], eax
; 831 : if (!IS_LETTER(val) && (val != '_') && (val != ':'))
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN21@xmlPatScan
cmp DWORD PTR _val$[ebp], 65 ; 00000041H
jl SHORT $LN15@xmlPatScan
cmp DWORD PTR _val$[ebp], 90 ; 0000005aH
jle SHORT $LN17@xmlPatScan
$LN15@xmlPatScan:
cmp DWORD PTR _val$[ebp], 97 ; 00000061H
jl SHORT $LN16@xmlPatScan
cmp DWORD PTR _val$[ebp], 122 ; 0000007aH
jle SHORT $LN17@xmlPatScan
$LN16@xmlPatScan:
cmp DWORD PTR _val$[ebp], 192 ; 000000c0H
jl SHORT $LN18@xmlPatScan
cmp DWORD PTR _val$[ebp], 214 ; 000000d6H
jle SHORT $LN17@xmlPatScan
$LN18@xmlPatScan:
cmp DWORD PTR _val$[ebp], 216 ; 000000d8H
jl SHORT $LN19@xmlPatScan
cmp DWORD PTR _val$[ebp], 246 ; 000000f6H
jle SHORT $LN17@xmlPatScan
$LN19@xmlPatScan:
cmp DWORD PTR _val$[ebp], 248 ; 000000f8H
jge SHORT $LN17@xmlPatScan
mov DWORD PTR tv140[ebp], 0
jmp SHORT $LN20@xmlPatScan
$LN17@xmlPatScan:
mov DWORD PTR tv140[ebp], 1
$LN20@xmlPatScan:
mov eax, DWORD PTR tv140[ebp]
mov DWORD PTR tv141[ebp], eax
jmp SHORT $LN22@xmlPatScan
$LN21@xmlPatScan:
push OFFSET _xmlIsBaseCharGroup
mov ecx, DWORD PTR _val$[ebp]
push ecx
call _xmlCharInRange
add esp, 8
mov DWORD PTR tv141[ebp], eax
$LN22@xmlPatScan:
cmp DWORD PTR tv141[ebp], 0
jne SHORT $LN4@xmlPatScan
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN27@xmlPatScan
mov DWORD PTR tv150[ebp], 0
jmp SHORT $LN28@xmlPatScan
$LN27@xmlPatScan:
cmp DWORD PTR _val$[ebp], 19968 ; 00004e00H
jl SHORT $LN23@xmlPatScan
cmp DWORD PTR _val$[ebp], 40869 ; 00009fa5H
jle SHORT $LN24@xmlPatScan
$LN23@xmlPatScan:
cmp DWORD PTR _val$[ebp], 12295 ; 00003007H
je SHORT $LN24@xmlPatScan
cmp DWORD PTR _val$[ebp], 12321 ; 00003021H
jl SHORT $LN25@xmlPatScan
cmp DWORD PTR _val$[ebp], 12329 ; 00003029H
jle SHORT $LN24@xmlPatScan
$LN25@xmlPatScan:
mov DWORD PTR tv149[ebp], 0
jmp SHORT $LN26@xmlPatScan
$LN24@xmlPatScan:
mov DWORD PTR tv149[ebp], 1
$LN26@xmlPatScan:
mov edx, DWORD PTR tv149[ebp]
mov DWORD PTR tv150[ebp], edx
$LN28@xmlPatScan:
cmp DWORD PTR tv150[ebp], 0
jne SHORT $LN4@xmlPatScan
cmp DWORD PTR _val$[ebp], 95 ; 0000005fH
je SHORT $LN4@xmlPatScan
cmp DWORD PTR _val$[ebp], 58 ; 0000003aH
je SHORT $LN4@xmlPatScan
; 832 : return(NULL);
xor eax, eax
jmp $LN1@xmlPatScan
$LN4@xmlPatScan:
; 833 :
; 834 : while ((IS_LETTER(val)) || (IS_DIGIT(val)) ||
; 835 : (val == '.') || (val == '-') ||
; 836 : (val == '_') ||
; 837 : (IS_COMBINING(val)) ||
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN35@xmlPatScan
cmp DWORD PTR _val$[ebp], 65 ; 00000041H
jl SHORT $LN29@xmlPatScan
cmp DWORD PTR _val$[ebp], 90 ; 0000005aH
jle SHORT $LN31@xmlPatScan
$LN29@xmlPatScan:
cmp DWORD PTR _val$[ebp], 97 ; 00000061H
jl SHORT $LN30@xmlPatScan
cmp DWORD PTR _val$[ebp], 122 ; 0000007aH
jle SHORT $LN31@xmlPatScan
$LN30@xmlPatScan:
cmp DWORD PTR _val$[ebp], 192 ; 000000c0H
jl SHORT $LN32@xmlPatScan
cmp DWORD PTR _val$[ebp], 214 ; 000000d6H
jle SHORT $LN31@xmlPatScan
$LN32@xmlPatScan:
cmp DWORD PTR _val$[ebp], 216 ; 000000d8H
jl SHORT $LN33@xmlPatScan
cmp DWORD PTR _val$[ebp], 246 ; 000000f6H
jle SHORT $LN31@xmlPatScan
$LN33@xmlPatScan:
cmp DWORD PTR _val$[ebp], 248 ; 000000f8H
jge SHORT $LN31@xmlPatScan
mov DWORD PTR tv167[ebp], 0
jmp SHORT $LN34@xmlPatScan
$LN31@xmlPatScan:
mov DWORD PTR tv167[ebp], 1
$LN34@xmlPatScan:
mov eax, DWORD PTR tv167[ebp]
mov DWORD PTR tv168[ebp], eax
jmp SHORT $LN36@xmlPatScan
$LN35@xmlPatScan:
push OFFSET _xmlIsBaseCharGroup
mov ecx, DWORD PTR _val$[ebp]
push ecx
call _xmlCharInRange
add esp, 8
mov DWORD PTR tv168[ebp], eax
$LN36@xmlPatScan:
cmp DWORD PTR tv168[ebp], 0
jne $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN41@xmlPatScan
mov DWORD PTR tv177[ebp], 0
jmp SHORT $LN42@xmlPatScan
$LN41@xmlPatScan:
cmp DWORD PTR _val$[ebp], 19968 ; 00004e00H
jl SHORT $LN37@xmlPatScan
cmp DWORD PTR _val$[ebp], 40869 ; 00009fa5H
jle SHORT $LN38@xmlPatScan
$LN37@xmlPatScan:
cmp DWORD PTR _val$[ebp], 12295 ; 00003007H
je SHORT $LN38@xmlPatScan
cmp DWORD PTR _val$[ebp], 12321 ; 00003021H
jl SHORT $LN39@xmlPatScan
cmp DWORD PTR _val$[ebp], 12329 ; 00003029H
jle SHORT $LN38@xmlPatScan
$LN39@xmlPatScan:
mov DWORD PTR tv176[ebp], 0
jmp SHORT $LN40@xmlPatScan
$LN38@xmlPatScan:
mov DWORD PTR tv176[ebp], 1
$LN40@xmlPatScan:
mov edx, DWORD PTR tv176[ebp]
mov DWORD PTR tv177[ebp], edx
$LN42@xmlPatScan:
cmp DWORD PTR tv177[ebp], 0
jne $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN45@xmlPatScan
cmp DWORD PTR _val$[ebp], 48 ; 00000030H
jl SHORT $LN43@xmlPatScan
cmp DWORD PTR _val$[ebp], 57 ; 00000039H
jg SHORT $LN43@xmlPatScan
mov DWORD PTR tv185[ebp], 1
jmp SHORT $LN44@xmlPatScan
$LN43@xmlPatScan:
mov DWORD PTR tv185[ebp], 0
$LN44@xmlPatScan:
mov eax, DWORD PTR tv185[ebp]
mov DWORD PTR tv186[ebp], eax
jmp SHORT $LN46@xmlPatScan
$LN45@xmlPatScan:
push OFFSET _xmlIsDigitGroup
mov ecx, DWORD PTR _val$[ebp]
push ecx
call _xmlCharInRange
add esp, 8
mov DWORD PTR tv186[ebp], eax
$LN46@xmlPatScan:
cmp DWORD PTR tv186[ebp], 0
jne $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 46 ; 0000002eH
je SHORT $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 45 ; 0000002dH
je SHORT $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 95 ; 0000005fH
je SHORT $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN47@xmlPatScan
mov DWORD PTR tv195[ebp], 0
jmp SHORT $LN48@xmlPatScan
$LN47@xmlPatScan:
push OFFSET _xmlIsCombiningGroup
mov edx, DWORD PTR _val$[ebp]
push edx
call _xmlCharInRange
add esp, 8
mov DWORD PTR tv195[ebp], eax
$LN48@xmlPatScan:
cmp DWORD PTR tv195[ebp], 0
jne SHORT $LN9@xmlPatScan
cmp DWORD PTR _val$[ebp], 256 ; 00000100H
jge SHORT $LN51@xmlPatScan
cmp DWORD PTR _val$[ebp], 183 ; 000000b7H
jne SHORT $LN49@xmlPatScan
mov DWORD PTR tv202[ebp], 1
jmp SHORT $LN50@xmlPatScan
$LN49@xmlPatScan:
mov DWORD PTR tv202[ebp], 0
$LN50@xmlPatScan:
mov eax, DWORD PTR tv202[ebp]
mov DWORD PTR tv203[ebp], eax
jmp SHORT $LN52@xmlPatScan
$LN51@xmlPatScan:
push OFFSET _xmlIsExtenderGroup
mov ecx, DWORD PTR _val$[ebp]
push ecx
call _xmlCharInRange
add esp, 8
mov DWORD PTR tv203[ebp], eax
$LN52@xmlPatScan:
cmp DWORD PTR tv203[ebp], 0
je SHORT $LN5@xmlPatScan
$LN9@xmlPatScan:
; 838 : (IS_EXTENDER(val))) {
; 839 : cur += len;
mov edx, DWORD PTR _cur$[ebp]
add edx, DWORD PTR _len$[ebp]
mov DWORD PTR _cur$[ebp], edx
; 840 : val = xmlStringCurrentChar(NULL, cur, &len);
lea eax, DWORD PTR _len$[ebp]
push eax
mov ecx, DWORD PTR _cur$[ebp]
push ecx
push 0
call _xmlStringCurrentChar
add esp, 12 ; 0000000cH
mov DWORD PTR _val$[ebp], eax
; 841 : }
jmp $LN4@xmlPatScan
$LN5@xmlPatScan:
; 842 : if (ctxt->dict)
mov edx, DWORD PTR _ctxt$[ebp]
cmp DWORD PTR [edx+12], 0
je SHORT $LN10@xmlPatScan
; 843 : ret = (xmlChar *) xmlDictLookup(ctxt->dict, q, cur - q);
mov eax, DWORD PTR _cur$[ebp]
sub eax, DWORD PTR _q$[ebp]
push eax
mov ecx, DWORD PTR _q$[ebp]
push ecx
mov edx, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edx+12]
push eax
call _xmlDictLookup
add esp, 12 ; 0000000cH
mov DWORD PTR _ret$[ebp], eax
jmp SHORT $LN11@xmlPatScan
$LN10@xmlPatScan:
; 844 : else
; 845 : ret = xmlStrndup(q, cur - q);
mov ecx, DWORD PTR _cur$[ebp]
sub ecx, DWORD PTR _q$[ebp]
push ecx
mov edx, DWORD PTR _q$[ebp]
push edx
call _xmlStrndup
add esp, 8
mov DWORD PTR _ret$[ebp], eax
$LN11@xmlPatScan:
; 846 : CUR_PTR = cur;
mov eax, DWORD PTR _ctxt$[ebp]
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [eax], ecx
; 847 : return(ret);
mov eax, DWORD PTR _ret$[ebp]
$LN1@xmlPatScan:
; 848 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $LN55@xmlPatScan
call @_RTC_CheckStackVars@8
pop eax
pop edx
pop edi
add esp, 84 ; 00000054H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
npad 3
$LN55@xmlPatScan:
DD 1
DD $LN54@xmlPatScan
$LN54@xmlPatScan:
DD -24 ; ffffffe8H
DD 4
DD $LN53@xmlPatScan
$LN53@xmlPatScan:
DB 108 ; 0000006cH
DB 101 ; 00000065H
DB 110 ; 0000006eH
DB 0
_xmlPatScanName ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatMatch
_TEXT SEGMENT
tv73 = -36 ; size = 4
_lst$1 = -32 ; size = 4
_states$ = -24 ; size = 12
_step$ = -8 ; size = 4
_i$ = -4 ; size = 4
_comp$ = 8 ; size = 4
_node$ = 12 ; size = 4
_xmlPatMatch PROC ; COMDAT
; 498 : xmlPatMatch(xmlPatternPtr comp, xmlNodePtr node) {
push ebp
mov ebp, esp
sub esp, 36 ; 00000024H
push esi
mov eax, -858993460 ; ccccccccH
mov DWORD PTR [ebp-36], eax
mov DWORD PTR [ebp-32], eax
mov DWORD PTR [ebp-28], eax
mov DWORD PTR [ebp-24], eax
mov DWORD PTR [ebp-20], eax
mov DWORD PTR [ebp-16], eax
mov DWORD PTR [ebp-12], eax
mov DWORD PTR [ebp-8], eax
mov DWORD PTR [ebp-4], eax
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 499 : int i;
; 500 : xmlStepOpPtr step;
; 501 : xmlStepStates states = {0, 0, NULL}; /* // may require backtrack */
mov DWORD PTR _states$[ebp], 0
mov DWORD PTR _states$[ebp+4], 0
mov DWORD PTR _states$[ebp+8], 0
; 502 :
; 503 : if ((comp == NULL) || (node == NULL)) return(-1);
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN12@xmlPatMatc
cmp DWORD PTR _node$[ebp], 0
jne SHORT $LN11@xmlPatMatc
$LN12@xmlPatMatc:
or eax, -1
jmp $LN1@xmlPatMatc
$LN11@xmlPatMatc:
; 504 : i = 0;
mov DWORD PTR _i$[ebp], 0
$restart$92:
; 505 : restart:
; 506 : for (;i < comp->nbStep;i++) {
jmp SHORT $LN4@xmlPatMatc
$LN2@xmlPatMatc:
mov eax, DWORD PTR _i$[ebp]
add eax, 1
mov DWORD PTR _i$[ebp], eax
$LN4@xmlPatMatc:
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR _i$[ebp]
cmp edx, DWORD PTR [ecx+20]
jge $found$93
; 507 : step = &comp->steps[i];
imul eax, DWORD PTR _i$[ebp], 12
mov ecx, DWORD PTR _comp$[ebp]
add eax, DWORD PTR [ecx+28]
mov DWORD PTR _step$[ebp], eax
; 508 : switch (step->op) {
mov edx, DWORD PTR _step$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv73[ebp], eax
cmp DWORD PTR tv73[ebp], 8
ja $LN5@xmlPatMatc
mov ecx, DWORD PTR tv73[ebp]
jmp DWORD PTR $LN91@xmlPatMatc[ecx*4]
$LN13@xmlPatMatc:
; 509 : case XML_OP_END:
; 510 : goto found;
jmp $found$93
$LN14@xmlPatMatc:
; 511 : case XML_OP_ROOT:
; 512 : if (node->type == XML_NAMESPACE_DECL)
mov edx, DWORD PTR _node$[ebp]
cmp DWORD PTR [edx+4], 18 ; 00000012H
jne SHORT $LN15@xmlPatMatc
; 513 : goto rollback;
jmp $rollback$94
$LN15@xmlPatMatc:
; 514 : node = node->parent;
mov eax, DWORD PTR _node$[ebp]
mov ecx, DWORD PTR [eax+20]
mov DWORD PTR _node$[ebp], ecx
; 515 : if ((node->type == XML_DOCUMENT_NODE) ||
; 516 : #ifdef LIBXML_DOCB_ENABLED
; 517 : (node->type == XML_DOCB_DOCUMENT_NODE) ||
mov edx, DWORD PTR _node$[ebp]
cmp DWORD PTR [edx+4], 9
je SHORT $LN17@xmlPatMatc
mov eax, DWORD PTR _node$[ebp]
cmp DWORD PTR [eax+4], 21 ; 00000015H
je SHORT $LN17@xmlPatMatc
mov ecx, DWORD PTR _node$[ebp]
cmp DWORD PTR [ecx+4], 13 ; 0000000dH
jne SHORT $LN16@xmlPatMatc
$LN17@xmlPatMatc:
; 518 : #endif
; 519 : (node->type == XML_HTML_DOCUMENT_NODE))
; 520 : continue;
jmp SHORT $LN2@xmlPatMatc
$LN16@xmlPatMatc:
; 521 : goto rollback;
jmp $rollback$94
$LN18@xmlPatMatc:
; 522 : case XML_OP_ELEM:
; 523 : if (node->type != XML_ELEMENT_NODE)
mov edx, DWORD PTR _node$[ebp]
cmp DWORD PTR [edx+4], 1
je SHORT $LN19@xmlPatMatc
; 524 : goto rollback;
jmp $rollback$94
$LN19@xmlPatMatc:
; 525 : if (step->value == NULL)
mov eax, DWORD PTR _step$[ebp]
cmp DWORD PTR [eax+4], 0
jne SHORT $LN20@xmlPatMatc
; 526 : continue;
jmp $LN2@xmlPatMatc
$LN20@xmlPatMatc:
; 527 : if (step->value[0] != node->name[0])
mov ecx, 1
imul edx, ecx, 0
mov eax, DWORD PTR _step$[ebp]
mov ecx, DWORD PTR [eax+4]
movzx edx, BYTE PTR [ecx+edx]
mov eax, 1
imul ecx, eax, 0
mov eax, DWORD PTR _node$[ebp]
mov eax, DWORD PTR [eax+8]
movzx ecx, BYTE PTR [eax+ecx]
cmp edx, ecx
je SHORT $LN21@xmlPatMatc
; 528 : goto rollback;
jmp $rollback$94
$LN21@xmlPatMatc:
; 529 : if (!xmlStrEqual(step->value, node->name))
mov edx, DWORD PTR _node$[ebp]
mov eax, DWORD PTR [edx+8]
push eax
mov ecx, DWORD PTR _step$[ebp]
mov edx, DWORD PTR [ecx+4]
push edx
call _xmlStrEqual
add esp, 8
test eax, eax
jne SHORT $LN22@xmlPatMatc
; 530 : goto rollback;
jmp $rollback$94
$LN22@xmlPatMatc:
; 531 :
; 532 : /* Namespace test */
; 533 : if (node->ns == NULL) {
mov eax, DWORD PTR _node$[ebp]
cmp DWORD PTR [eax+36], 0
jne SHORT $LN23@xmlPatMatc
; 534 : if (step->value2 != NULL)
mov ecx, DWORD PTR _step$[ebp]
cmp DWORD PTR [ecx+8], 0
je SHORT $LN25@xmlPatMatc
; 535 : goto rollback;
jmp $rollback$94
$LN25@xmlPatMatc:
; 536 : } else if (node->ns->href != NULL) {
jmp SHORT $LN24@xmlPatMatc
$LN23@xmlPatMatc:
mov edx, DWORD PTR _node$[ebp]
mov eax, DWORD PTR [edx+36]
cmp DWORD PTR [eax+8], 0
je SHORT $LN24@xmlPatMatc
; 537 : if (step->value2 == NULL)
mov ecx, DWORD PTR _step$[ebp]
cmp DWORD PTR [ecx+8], 0
jne SHORT $LN27@xmlPatMatc
; 538 : goto rollback;
jmp $rollback$94
$LN27@xmlPatMatc:
; 539 : if (!xmlStrEqual(step->value2, node->ns->href))
mov edx, DWORD PTR _node$[ebp]
mov eax, DWORD PTR [edx+36]
mov ecx, DWORD PTR [eax+8]
push ecx
mov edx, DWORD PTR _step$[ebp]
mov eax, DWORD PTR [edx+8]
push eax
call _xmlStrEqual
add esp, 8
test eax, eax
jne SHORT $LN24@xmlPatMatc
; 540 : goto rollback;
jmp $rollback$94
$LN24@xmlPatMatc:
; 541 : }
; 542 : continue;
jmp $LN2@xmlPatMatc
$LN29@xmlPatMatc:
; 543 : case XML_OP_CHILD: {
; 544 : xmlNodePtr lst;
; 545 :
; 546 : if ((node->type != XML_ELEMENT_NODE) &&
; 547 : (node->type != XML_DOCUMENT_NODE) &&
; 548 : #ifdef LIBXML_DOCB_ENABLED
; 549 : (node->type != XML_DOCB_DOCUMENT_NODE) &&
mov ecx, DWORD PTR _node$[ebp]
cmp DWORD PTR [ecx+4], 1
je SHORT $LN30@xmlPatMatc
mov edx, DWORD PTR _node$[ebp]
cmp DWORD PTR [edx+4], 9
je SHORT $LN30@xmlPatMatc
mov eax, DWORD PTR _node$[ebp]
cmp DWORD PTR [eax+4], 21 ; 00000015H
je SHORT $LN30@xmlPatMatc
mov ecx, DWORD PTR _node$[ebp]
cmp DWORD PTR [ecx+4], 13 ; 0000000dH
je SHORT $LN30@xmlPatMatc
; 550 : #endif
; 551 : (node->type != XML_HTML_DOCUMENT_NODE))
; 552 : goto rollback;
jmp $rollback$94
$LN30@xmlPatMatc:
; 553 :
; 554 : lst = node->children;
mov edx, DWORD PTR _node$[ebp]
mov eax, DWORD PTR [edx+12]
mov DWORD PTR _lst$1[ebp], eax
; 555 :
; 556 : if (step->value != NULL) {
mov ecx, DWORD PTR _step$[ebp]
cmp DWORD PTR [ecx+4], 0
je SHORT $LN31@xmlPatMatc
$LN7@xmlPatMatc:
; 557 : while (lst != NULL) {
cmp DWORD PTR _lst$1[ebp], 0
je SHORT $LN8@xmlPatMatc
; 558 : if ((lst->type == XML_ELEMENT_NODE) &&
; 559 : (step->value[0] == lst->name[0]) &&
mov edx, DWORD PTR _lst$1[ebp]
cmp DWORD PTR [edx+4], 1
jne SHORT $LN32@xmlPatMatc
mov eax, 1
imul ecx, eax, 0
mov edx, DWORD PTR _step$[ebp]
mov eax, DWORD PTR [edx+4]
movzx ecx, BYTE PTR [eax+ecx]
mov edx, 1
imul eax, edx, 0
mov edx, DWORD PTR _lst$1[ebp]
mov edx, DWORD PTR [edx+8]
movzx eax, BYTE PTR [edx+eax]
cmp ecx, eax
jne SHORT $LN32@xmlPatMatc
mov ecx, DWORD PTR _lst$1[ebp]
mov edx, DWORD PTR [ecx+8]
push edx
mov eax, DWORD PTR _step$[ebp]
mov ecx, DWORD PTR [eax+4]
push ecx
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN32@xmlPatMatc
; 560 : (xmlStrEqual(step->value, lst->name)))
; 561 : break;
jmp SHORT $LN8@xmlPatMatc
$LN32@xmlPatMatc:
; 562 : lst = lst->next;
mov edx, DWORD PTR _lst$1[ebp]
mov eax, DWORD PTR [edx+24]
mov DWORD PTR _lst$1[ebp], eax
; 563 : }
jmp SHORT $LN7@xmlPatMatc
$LN8@xmlPatMatc:
; 564 : if (lst != NULL)
cmp DWORD PTR _lst$1[ebp], 0
je SHORT $LN31@xmlPatMatc
; 565 : continue;
jmp $LN2@xmlPatMatc
$LN31@xmlPatMatc:
; 566 : }
; 567 : goto rollback;
jmp $rollback$94
$LN34@xmlPatMatc:
; 568 : }
; 569 : case XML_OP_ATTR:
; 570 : if (node->type != XML_ATTRIBUTE_NODE)
mov ecx, DWORD PTR _node$[ebp]
cmp DWORD PTR [ecx+4], 2
je SHORT $LN35@xmlPatMatc
; 571 : goto rollback;
jmp $rollback$94
$LN35@xmlPatMatc:
; 572 : if (step->value != NULL) {
mov edx, DWORD PTR _step$[ebp]
cmp DWORD PTR [edx+4], 0
je SHORT $LN36@xmlPatMatc
; 573 : if (step->value[0] != node->name[0])
mov eax, 1
imul ecx, eax, 0
mov edx, DWORD PTR _step$[ebp]
mov eax, DWORD PTR [edx+4]
movzx ecx, BYTE PTR [eax+ecx]
mov edx, 1
imul eax, edx, 0
mov edx, DWORD PTR _node$[ebp]
mov edx, DWORD PTR [edx+8]
movzx eax, BYTE PTR [edx+eax]
cmp ecx, eax
je SHORT $LN37@xmlPatMatc
; 574 : goto rollback;
jmp $rollback$94
$LN37@xmlPatMatc:
; 575 : if (!xmlStrEqual(step->value, node->name))
mov ecx, DWORD PTR _node$[ebp]
mov edx, DWORD PTR [ecx+8]
push edx
mov eax, DWORD PTR _step$[ebp]
mov ecx, DWORD PTR [eax+4]
push ecx
call _xmlStrEqual
add esp, 8
test eax, eax
jne SHORT $LN36@xmlPatMatc
; 576 : goto rollback;
jmp $rollback$94
$LN36@xmlPatMatc:
; 577 : }
; 578 : /* Namespace test */
; 579 : if (node->ns == NULL) {
mov edx, DWORD PTR _node$[ebp]
cmp DWORD PTR [edx+36], 0
jne SHORT $LN39@xmlPatMatc
; 580 : if (step->value2 != NULL)
mov eax, DWORD PTR _step$[ebp]
cmp DWORD PTR [eax+8], 0
je SHORT $LN41@xmlPatMatc
; 581 : goto rollback;
jmp $rollback$94
$LN41@xmlPatMatc:
; 582 : } else if (step->value2 != NULL) {
jmp SHORT $LN40@xmlPatMatc
$LN39@xmlPatMatc:
mov ecx, DWORD PTR _step$[ebp]
cmp DWORD PTR [ecx+8], 0
je SHORT $LN40@xmlPatMatc
; 583 : if (!xmlStrEqual(step->value2, node->ns->href))
mov edx, DWORD PTR _node$[ebp]
mov eax, DWORD PTR [edx+36]
mov ecx, DWORD PTR [eax+8]
push ecx
mov edx, DWORD PTR _step$[ebp]
mov eax, DWORD PTR [edx+8]
push eax
call _xmlStrEqual
add esp, 8
test eax, eax
jne SHORT $LN40@xmlPatMatc
; 584 : goto rollback;
jmp $rollback$94
$LN40@xmlPatMatc:
; 585 : }
; 586 : continue;
jmp $LN2@xmlPatMatc
$LN44@xmlPatMatc:
; 587 : case XML_OP_PARENT:
; 588 : if ((node->type == XML_DOCUMENT_NODE) ||
; 589 : (node->type == XML_HTML_DOCUMENT_NODE) ||
; 590 : #ifdef LIBXML_DOCB_ENABLED
; 591 : (node->type == XML_DOCB_DOCUMENT_NODE) ||
mov ecx, DWORD PTR _node$[ebp]
cmp DWORD PTR [ecx+4], 9
je SHORT $LN46@xmlPatMatc
mov edx, DWORD PTR _node$[ebp]
cmp DWORD PTR [edx+4], 13 ; 0000000dH
je SHORT $LN46@xmlPatMatc
mov eax, DWORD PTR _node$[ebp]
cmp DWORD PTR [eax+4], 21 ; 00000015H
je SHORT $LN46@xmlPatMatc
mov ecx, DWORD PTR _node$[ebp]
cmp DWORD PTR [ecx+4], 18 ; 00000012H
jne SHORT $LN45@xmlPatMatc
$LN46@xmlPatMatc:
; 592 : #endif
; 593 : (node->type == XML_NAMESPACE_DECL))
; 594 : goto rollback;
jmp $rollback$94
$LN45@xmlPatMatc:
; 595 : node = node->parent;
mov edx, DWORD PTR _node$[ebp]
mov eax, DWORD PTR [edx+20]
mov DWORD PTR _node$[ebp], eax
; 596 : if (node == NULL)
cmp DWORD PTR _node$[ebp], 0
jne SHORT $LN47@xmlPatMatc
; 597 : goto rollback;
jmp $rollback$94
$LN47@xmlPatMatc:
; 598 : if (step->value == NULL)
mov ecx, DWORD PTR _step$[ebp]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN48@xmlPatMatc
; 599 : continue;
jmp $LN2@xmlPatMatc
$LN48@xmlPatMatc:
; 600 : if (step->value[0] != node->name[0])
mov edx, 1
imul eax, edx, 0
mov ecx, DWORD PTR _step$[ebp]
mov edx, DWORD PTR [ecx+4]
movzx eax, BYTE PTR [edx+eax]
mov ecx, 1
imul edx, ecx, 0
mov ecx, DWORD PTR _node$[ebp]
mov ecx, DWORD PTR [ecx+8]
movzx edx, BYTE PTR [ecx+edx]
cmp eax, edx
je SHORT $LN49@xmlPatMatc
; 601 : goto rollback;
jmp $rollback$94
$LN49@xmlPatMatc:
; 602 : if (!xmlStrEqual(step->value, node->name))
mov eax, DWORD PTR _node$[ebp]
mov ecx, DWORD PTR [eax+8]
push ecx
mov edx, DWORD PTR _step$[ebp]
mov eax, DWORD PTR [edx+4]
push eax
call _xmlStrEqual
add esp, 8
test eax, eax
jne SHORT $LN50@xmlPatMatc
; 603 : goto rollback;
jmp $rollback$94
$LN50@xmlPatMatc:
; 604 : /* Namespace test */
; 605 : if (node->ns == NULL) {
mov ecx, DWORD PTR _node$[ebp]
cmp DWORD PTR [ecx+36], 0
jne SHORT $LN51@xmlPatMatc
; 606 : if (step->value2 != NULL)
mov edx, DWORD PTR _step$[ebp]
cmp DWORD PTR [edx+8], 0
je SHORT $LN53@xmlPatMatc
; 607 : goto rollback;
jmp $rollback$94
$LN53@xmlPatMatc:
; 608 : } else if (node->ns->href != NULL) {
jmp SHORT $LN52@xmlPatMatc
$LN51@xmlPatMatc:
mov eax, DWORD PTR _node$[ebp]
mov ecx, DWORD PTR [eax+36]
cmp DWORD PTR [ecx+8], 0
je SHORT $LN52@xmlPatMatc
; 609 : if (step->value2 == NULL)
mov edx, DWORD PTR _step$[ebp]
cmp DWORD PTR [edx+8], 0
jne SHORT $LN55@xmlPatMatc
; 610 : goto rollback;
jmp $rollback$94
$LN55@xmlPatMatc:
; 611 : if (!xmlStrEqual(step->value2, node->ns->href))
mov eax, DWORD PTR _node$[ebp]
mov ecx, DWORD PTR [eax+36]
mov edx, DWORD PTR [ecx+8]
push edx
mov eax, DWORD PTR _step$[ebp]
mov ecx, DWORD PTR [eax+8]
push ecx
call _xmlStrEqual
add esp, 8
test eax, eax
jne SHORT $LN52@xmlPatMatc
; 612 : goto rollback;
jmp $rollback$94
$LN52@xmlPatMatc:
; 613 : }
; 614 : continue;
jmp $LN2@xmlPatMatc
$LN57@xmlPatMatc:
; 615 : case XML_OP_ANCESTOR:
; 616 : /* TODO: implement coalescing of ANCESTOR/NODE ops */
; 617 : if (step->value == NULL) {
mov edx, DWORD PTR _step$[ebp]
cmp DWORD PTR [edx+4], 0
jne SHORT $LN58@xmlPatMatc
; 618 : i++;
mov eax, DWORD PTR _i$[ebp]
add eax, 1
mov DWORD PTR _i$[ebp], eax
; 619 : step = &comp->steps[i];
imul ecx, DWORD PTR _i$[ebp], 12
mov edx, DWORD PTR _comp$[ebp]
add ecx, DWORD PTR [edx+28]
mov DWORD PTR _step$[ebp], ecx
; 620 : if (step->op == XML_OP_ROOT)
mov eax, DWORD PTR _step$[ebp]
cmp DWORD PTR [eax], 1
jne SHORT $LN59@xmlPatMatc
; 621 : goto found;
jmp $found$93
$LN59@xmlPatMatc:
; 622 : if (step->op != XML_OP_ELEM)
mov ecx, DWORD PTR _step$[ebp]
cmp DWORD PTR [ecx], 2
je SHORT $LN60@xmlPatMatc
; 623 : goto rollback;
jmp $rollback$94
$LN60@xmlPatMatc:
; 624 : if (step->value == NULL)
mov edx, DWORD PTR _step$[ebp]
cmp DWORD PTR [edx+4], 0
jne SHORT $LN58@xmlPatMatc
; 625 : return(-1);
or eax, -1
jmp $LN1@xmlPatMatc
$LN58@xmlPatMatc:
; 626 : }
; 627 : if (node == NULL)
cmp DWORD PTR _node$[ebp], 0
jne SHORT $LN62@xmlPatMatc
; 628 : goto rollback;
jmp $rollback$94
$LN62@xmlPatMatc:
; 629 : if ((node->type == XML_DOCUMENT_NODE) ||
; 630 : (node->type == XML_HTML_DOCUMENT_NODE) ||
; 631 : #ifdef LIBXML_DOCB_ENABLED
; 632 : (node->type == XML_DOCB_DOCUMENT_NODE) ||
mov eax, DWORD PTR _node$[ebp]
cmp DWORD PTR [eax+4], 9
je SHORT $LN64@xmlPatMatc
mov ecx, DWORD PTR _node$[ebp]
cmp DWORD PTR [ecx+4], 13 ; 0000000dH
je SHORT $LN64@xmlPatMatc
mov edx, DWORD PTR _node$[ebp]
cmp DWORD PTR [edx+4], 21 ; 00000015H
je SHORT $LN64@xmlPatMatc
mov eax, DWORD PTR _node$[ebp]
cmp DWORD PTR [eax+4], 18 ; 00000012H
jne SHORT $LN63@xmlPatMatc
$LN64@xmlPatMatc:
; 633 : #endif
; 634 : (node->type == XML_NAMESPACE_DECL))
; 635 : goto rollback;
jmp $rollback$94
$LN63@xmlPatMatc:
; 636 : node = node->parent;
mov ecx, DWORD PTR _node$[ebp]
mov edx, DWORD PTR [ecx+20]
mov DWORD PTR _node$[ebp], edx
$LN9@xmlPatMatc:
; 637 : while (node != NULL) {
cmp DWORD PTR _node$[ebp], 0
je $LN10@xmlPatMatc
; 638 : if ((node->type == XML_ELEMENT_NODE) &&
; 639 : (step->value[0] == node->name[0]) &&
mov eax, DWORD PTR _node$[ebp]
cmp DWORD PTR [eax+4], 1
jne $LN65@xmlPatMatc
mov ecx, 1
imul edx, ecx, 0
mov eax, DWORD PTR _step$[ebp]
mov ecx, DWORD PTR [eax+4]
movzx edx, BYTE PTR [ecx+edx]
mov eax, 1
imul ecx, eax, 0
mov eax, DWORD PTR _node$[ebp]
mov eax, DWORD PTR [eax+8]
movzx ecx, BYTE PTR [eax+ecx]
cmp edx, ecx
jne SHORT $LN65@xmlPatMatc
mov edx, DWORD PTR _node$[ebp]
mov eax, DWORD PTR [edx+8]
push eax
mov ecx, DWORD PTR _step$[ebp]
mov edx, DWORD PTR [ecx+4]
push edx
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN65@xmlPatMatc
; 640 : (xmlStrEqual(step->value, node->name))) {
; 641 : /* Namespace test */
; 642 : if (node->ns == NULL) {
mov eax, DWORD PTR _node$[ebp]
cmp DWORD PTR [eax+36], 0
jne SHORT $LN66@xmlPatMatc
; 643 : if (step->value2 == NULL)
mov ecx, DWORD PTR _step$[ebp]
cmp DWORD PTR [ecx+8], 0
jne SHORT $LN68@xmlPatMatc
; 644 : break;
jmp SHORT $LN10@xmlPatMatc
$LN68@xmlPatMatc:
; 645 : } else if (node->ns->href != NULL) {
jmp SHORT $LN65@xmlPatMatc
$LN66@xmlPatMatc:
mov edx, DWORD PTR _node$[ebp]
mov eax, DWORD PTR [edx+36]
cmp DWORD PTR [eax+8], 0
je SHORT $LN65@xmlPatMatc
; 646 : if ((step->value2 != NULL) &&
mov ecx, DWORD PTR _step$[ebp]
cmp DWORD PTR [ecx+8], 0
je SHORT $LN65@xmlPatMatc
mov edx, DWORD PTR _node$[ebp]
mov eax, DWORD PTR [edx+36]
mov ecx, DWORD PTR [eax+8]
push ecx
mov edx, DWORD PTR _step$[ebp]
mov eax, DWORD PTR [edx+8]
push eax
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN65@xmlPatMatc
; 647 : (xmlStrEqual(step->value2, node->ns->href)))
; 648 : break;
jmp SHORT $LN10@xmlPatMatc
$LN65@xmlPatMatc:
; 649 : }
; 650 : }
; 651 : node = node->parent;
mov ecx, DWORD PTR _node$[ebp]
mov edx, DWORD PTR [ecx+20]
mov DWORD PTR _node$[ebp], edx
; 652 : }
jmp $LN9@xmlPatMatc
$LN10@xmlPatMatc:
; 653 : if (node == NULL)
cmp DWORD PTR _node$[ebp], 0
jne SHORT $LN71@xmlPatMatc
; 654 : goto rollback;
jmp $rollback$94
$LN71@xmlPatMatc:
; 655 : /*
; 656 : * prepare a potential rollback from here
; 657 : * for ancestors of that node.
; 658 : */
; 659 : if (step->op == XML_OP_ANCESTOR)
mov eax, DWORD PTR _step$[ebp]
cmp DWORD PTR [eax], 6
jne SHORT $LN72@xmlPatMatc
; 660 : xmlPatPushState(&states, i, node);
mov ecx, DWORD PTR _node$[ebp]
push ecx
mov edx, DWORD PTR _i$[ebp]
push edx
lea eax, DWORD PTR _states$[ebp]
push eax
call _xmlPatPushState
add esp, 12 ; 0000000cH
jmp SHORT $LN73@xmlPatMatc
$LN72@xmlPatMatc:
; 661 : else
; 662 : xmlPatPushState(&states, i - 1, node);
mov ecx, DWORD PTR _node$[ebp]
push ecx
mov edx, DWORD PTR _i$[ebp]
sub edx, 1
push edx
lea eax, DWORD PTR _states$[ebp]
push eax
call _xmlPatPushState
add esp, 12 ; 0000000cH
$LN73@xmlPatMatc:
; 663 : continue;
jmp $LN2@xmlPatMatc
$LN74@xmlPatMatc:
; 664 : case XML_OP_NS:
; 665 : if (node->type != XML_ELEMENT_NODE)
mov ecx, DWORD PTR _node$[ebp]
cmp DWORD PTR [ecx+4], 1
je SHORT $LN75@xmlPatMatc
; 666 : goto rollback;
jmp $rollback$94
$LN75@xmlPatMatc:
; 667 : if (node->ns == NULL) {
mov edx, DWORD PTR _node$[ebp]
cmp DWORD PTR [edx+36], 0
jne SHORT $LN76@xmlPatMatc
; 668 : if (step->value != NULL)
mov eax, DWORD PTR _step$[ebp]
cmp DWORD PTR [eax+4], 0
je SHORT $LN78@xmlPatMatc
; 669 : goto rollback;
jmp SHORT $rollback$94
$LN78@xmlPatMatc:
; 670 : } else if (node->ns->href != NULL) {
jmp SHORT $LN77@xmlPatMatc
$LN76@xmlPatMatc:
mov ecx, DWORD PTR _node$[ebp]
mov edx, DWORD PTR [ecx+36]
cmp DWORD PTR [edx+8], 0
je SHORT $LN77@xmlPatMatc
; 671 : if (step->value == NULL)
mov eax, DWORD PTR _step$[ebp]
cmp DWORD PTR [eax+4], 0
jne SHORT $LN80@xmlPatMatc
; 672 : goto rollback;
jmp SHORT $rollback$94
$LN80@xmlPatMatc:
; 673 : if (!xmlStrEqual(step->value, node->ns->href))
mov ecx, DWORD PTR _node$[ebp]
mov edx, DWORD PTR [ecx+36]
mov eax, DWORD PTR [edx+8]
push eax
mov ecx, DWORD PTR _step$[ebp]
mov edx, DWORD PTR [ecx+4]
push edx
call _xmlStrEqual
add esp, 8
test eax, eax
jne SHORT $LN77@xmlPatMatc
; 674 : goto rollback;
jmp SHORT $rollback$94
$LN77@xmlPatMatc:
; 675 : }
; 676 : break;
jmp SHORT $LN5@xmlPatMatc
$LN82@xmlPatMatc:
; 677 : case XML_OP_ALL:
; 678 : if (node->type != XML_ELEMENT_NODE)
mov eax, DWORD PTR _node$[ebp]
cmp DWORD PTR [eax+4], 1
je SHORT $LN5@xmlPatMatc
; 679 : goto rollback;
jmp SHORT $rollback$94
$LN5@xmlPatMatc:
; 680 : break;
; 681 : }
; 682 : }
jmp $LN2@xmlPatMatc
$found$93:
; 683 : found:
; 684 : if (states.states != NULL) {
cmp DWORD PTR _states$[ebp+8], 0
je SHORT $LN84@xmlPatMatc
; 685 : /* Free the rollback states */
; 686 : xmlFree(states.states);
mov esi, esp
mov ecx, DWORD PTR _states$[ebp+8]
push ecx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN84@xmlPatMatc:
; 687 : }
; 688 : return(1);
mov eax, 1
jmp SHORT $LN1@xmlPatMatc
$rollback$94:
; 689 : rollback:
; 690 : /* got an error try to rollback */
; 691 : if (states.states == NULL)
cmp DWORD PTR _states$[ebp+8], 0
jne SHORT $LN85@xmlPatMatc
; 692 : return(0);
xor eax, eax
jmp SHORT $LN1@xmlPatMatc
$LN85@xmlPatMatc:
; 693 : if (states.nbstates <= 0) {
cmp DWORD PTR _states$[ebp], 0
jg SHORT $LN86@xmlPatMatc
; 694 : xmlFree(states.states);
mov esi, esp
mov edx, DWORD PTR _states$[ebp+8]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
; 695 : return(0);
xor eax, eax
jmp SHORT $LN1@xmlPatMatc
$LN86@xmlPatMatc:
; 696 : }
; 697 : states.nbstates--;
mov eax, DWORD PTR _states$[ebp]
sub eax, 1
mov DWORD PTR _states$[ebp], eax
; 698 : i = states.states[states.nbstates].step;
mov ecx, DWORD PTR _states$[ebp]
mov edx, DWORD PTR _states$[ebp+8]
mov eax, DWORD PTR [edx+ecx*8]
mov DWORD PTR _i$[ebp], eax
; 699 : node = states.states[states.nbstates].node;
mov ecx, DWORD PTR _states$[ebp]
mov edx, DWORD PTR _states$[ebp+8]
mov eax, DWORD PTR [edx+ecx*8+4]
mov DWORD PTR _node$[ebp], eax
; 700 : #if 0
; 701 : fprintf(stderr, "Pop: %d, %s\n", i, node->name);
; 702 : #endif
; 703 : goto restart;
jmp $restart$92
$LN1@xmlPatMatc:
; 704 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $LN90@xmlPatMatc
call @_RTC_CheckStackVars@8
pop eax
pop edx
pop esi
add esp, 36 ; 00000024H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
npad 1
$LN90@xmlPatMatc:
DD 1
DD $LN89@xmlPatMatc
$LN89@xmlPatMatc:
DD -24 ; ffffffe8H
DD 12 ; 0000000cH
DD $LN88@xmlPatMatc
$LN88@xmlPatMatc:
DB 115 ; 00000073H
DB 116 ; 00000074H
DB 97 ; 00000061H
DB 116 ; 00000074H
DB 101 ; 00000065H
DB 115 ; 00000073H
DB 0
npad 1
$LN91@xmlPatMatc:
DD $LN13@xmlPatMatc
DD $LN14@xmlPatMatc
DD $LN18@xmlPatMatc
DD $LN29@xmlPatMatc
DD $LN34@xmlPatMatc
DD $LN44@xmlPatMatc
DD $LN57@xmlPatMatc
DD $LN74@xmlPatMatc
DD $LN82@xmlPatMatc
_xmlPatMatch ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatPushState
_TEXT SEGMENT
_tmp$1 = -4 ; size = 4
_states$ = 8 ; size = 4
_step$ = 12 ; size = 4
_node$ = 16 ; size = 4
_xmlPatPushState PROC ; COMDAT
; 464 : xmlPatPushState(xmlStepStates *states, int step, xmlNodePtr node) {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 465 : if ((states->states == NULL) || (states->maxstates <= 0)) {
mov eax, DWORD PTR _states$[ebp]
cmp DWORD PTR [eax+8], 0
je SHORT $LN4@xmlPatPush
mov ecx, DWORD PTR _states$[ebp]
cmp DWORD PTR [ecx+4], 0
jg SHORT $LN2@xmlPatPush
$LN4@xmlPatPush:
; 466 : states->maxstates = 4;
mov edx, DWORD PTR _states$[ebp]
mov DWORD PTR [edx+4], 4
; 467 : states->nbstates = 0;
mov eax, DWORD PTR _states$[ebp]
mov DWORD PTR [eax], 0
; 468 : states->states = xmlMalloc(4 * sizeof(xmlStepState));
mov esi, esp
push 32 ; 00000020H
call DWORD PTR _xmlMalloc
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
mov ecx, DWORD PTR _states$[ebp]
mov DWORD PTR [ecx+8], eax
; 469 : }
jmp SHORT $LN3@xmlPatPush
$LN2@xmlPatPush:
; 470 : else if (states->maxstates <= states->nbstates) {
mov edx, DWORD PTR _states$[ebp]
mov eax, DWORD PTR _states$[ebp]
mov ecx, DWORD PTR [edx+4]
cmp ecx, DWORD PTR [eax]
jg SHORT $LN3@xmlPatPush
; 471 : xmlStepState *tmp;
; 472 :
; 473 : tmp = (xmlStepStatePtr) xmlRealloc(states->states,
mov edx, DWORD PTR _states$[ebp]
mov eax, DWORD PTR [edx+4]
shl eax, 1
shl eax, 3
mov esi, esp
push eax
mov ecx, DWORD PTR _states$[ebp]
mov edx, DWORD PTR [ecx+8]
push edx
call DWORD PTR _xmlRealloc
add esp, 8
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _tmp$1[ebp], eax
; 474 : 2 * states->maxstates * sizeof(xmlStepState));
; 475 : if (tmp == NULL)
cmp DWORD PTR _tmp$1[ebp], 0
jne SHORT $LN6@xmlPatPush
; 476 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlPatPush
$LN6@xmlPatPush:
; 477 : states->states = tmp;
mov eax, DWORD PTR _states$[ebp]
mov ecx, DWORD PTR _tmp$1[ebp]
mov DWORD PTR [eax+8], ecx
; 478 : states->maxstates *= 2;
mov edx, DWORD PTR _states$[ebp]
mov eax, DWORD PTR [edx+4]
shl eax, 1
mov ecx, DWORD PTR _states$[ebp]
mov DWORD PTR [ecx+4], eax
$LN3@xmlPatPush:
; 479 : }
; 480 : states->states[states->nbstates].step = step;
mov edx, DWORD PTR _states$[ebp]
mov eax, DWORD PTR [edx]
mov ecx, DWORD PTR _states$[ebp]
mov edx, DWORD PTR [ecx+8]
mov ecx, DWORD PTR _step$[ebp]
mov DWORD PTR [edx+eax*8], ecx
; 481 : states->states[states->nbstates++].node = node;
mov edx, DWORD PTR _states$[ebp]
mov eax, DWORD PTR [edx]
mov ecx, DWORD PTR _states$[ebp]
mov edx, DWORD PTR [ecx+8]
mov ecx, DWORD PTR _node$[ebp]
mov DWORD PTR [edx+eax*8+4], ecx
mov edx, DWORD PTR _states$[ebp]
mov eax, DWORD PTR [edx]
add eax, 1
mov ecx, DWORD PTR _states$[ebp]
mov DWORD PTR [ecx], eax
; 482 : #if 0
; 483 : fprintf(stderr, "Push: %d, %s\n", step, node->name);
; 484 : #endif
; 485 : return(0);
xor eax, eax
$LN1@xmlPatPush:
; 486 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlPatPushState ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlReversePattern
_TEXT SEGMENT
_op$1 = -20 ; size = 4
_tmp$2 = -16 ; size = 4
_temp$3 = -12 ; size = 4
_j$ = -8 ; size = 4
_i$ = -4 ; size = 4
_comp$ = 8 ; size = 4
_xmlReversePattern PROC ; COMDAT
; 408 : xmlReversePattern(xmlPatternPtr comp) {
push ebp
mov ebp, esp
sub esp, 20 ; 00000014H
push esi
mov eax, -858993460 ; ccccccccH
mov DWORD PTR [ebp-20], eax
mov DWORD PTR [ebp-16], eax
mov DWORD PTR [ebp-12], eax
mov DWORD PTR [ebp-8], eax
mov DWORD PTR [ebp-4], eax
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 409 : int i, j;
; 410 :
; 411 : /*
; 412 : * remove the leading // for //a or .//a
; 413 : */
; 414 : if ((comp->nbStep > 0) && (comp->steps[0].op == XML_OP_ANCESTOR)) {
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+20], 0
jle $LN7@xmlReverse
mov ecx, 12 ; 0000000cH
imul edx, ecx, 0
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
cmp DWORD PTR [ecx+edx], 6
jne $LN7@xmlReverse
; 415 : for (i = 0, j = 1;j < comp->nbStep;i++,j++) {
mov DWORD PTR _i$[ebp], 0
mov DWORD PTR _j$[ebp], 1
jmp SHORT $LN4@xmlReverse
$LN2@xmlReverse:
mov edx, DWORD PTR _i$[ebp]
add edx, 1
mov DWORD PTR _i$[ebp], edx
mov eax, DWORD PTR _j$[ebp]
add eax, 1
mov DWORD PTR _j$[ebp], eax
$LN4@xmlReverse:
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR _j$[ebp]
cmp edx, DWORD PTR [ecx+20]
jge SHORT $LN3@xmlReverse
; 416 : comp->steps[i].value = comp->steps[j].value;
imul eax, DWORD PTR _j$[ebp], 12
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+28]
imul ecx, DWORD PTR _i$[ebp], 12
mov esi, DWORD PTR _comp$[ebp]
mov esi, DWORD PTR [esi+28]
mov edx, DWORD PTR [edx+eax+4]
mov DWORD PTR [esi+ecx+4], edx
; 417 : comp->steps[i].value2 = comp->steps[j].value2;
imul eax, DWORD PTR _j$[ebp], 12
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+28]
imul ecx, DWORD PTR _i$[ebp], 12
mov esi, DWORD PTR _comp$[ebp]
mov esi, DWORD PTR [esi+28]
mov edx, DWORD PTR [edx+eax+8]
mov DWORD PTR [esi+ecx+8], edx
; 418 : comp->steps[i].op = comp->steps[j].op;
imul eax, DWORD PTR _j$[ebp], 12
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+28]
imul ecx, DWORD PTR _i$[ebp], 12
mov esi, DWORD PTR _comp$[ebp]
mov esi, DWORD PTR [esi+28]
mov edx, DWORD PTR [edx+eax]
mov DWORD PTR [esi+ecx], edx
; 419 : }
jmp SHORT $LN2@xmlReverse
$LN3@xmlReverse:
; 420 : comp->nbStep--;
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+20]
sub ecx, 1
mov edx, DWORD PTR _comp$[ebp]
mov DWORD PTR [edx+20], ecx
$LN7@xmlReverse:
; 421 : }
; 422 : if (comp->nbStep >= comp->maxStep) {
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [eax+20]
cmp edx, DWORD PTR [ecx+24]
jl SHORT $LN8@xmlReverse
; 423 : xmlStepOpPtr temp;
; 424 : temp = (xmlStepOpPtr) xmlRealloc(comp->steps, comp->maxStep * 2 *
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+24]
shl ecx, 1
imul edx, ecx, 12
mov esi, esp
push edx
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
push ecx
call DWORD PTR _xmlRealloc
add esp, 8
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _temp$3[ebp], eax
; 425 : sizeof(xmlStepOp));
; 426 : if (temp == NULL) {
cmp DWORD PTR _temp$3[ebp], 0
jne SHORT $LN9@xmlReverse
; 427 : ERROR(ctxt, NULL, NULL,
; 428 : "xmlReversePattern: realloc failed\n");
; 429 : return (-1);
or eax, -1
jmp $LN1@xmlReverse
$LN9@xmlReverse:
; 430 : }
; 431 : comp->steps = temp;
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR _temp$3[ebp]
mov DWORD PTR [edx+28], eax
; 432 : comp->maxStep *= 2;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+24]
shl edx, 1
mov eax, DWORD PTR _comp$[ebp]
mov DWORD PTR [eax+24], edx
$LN8@xmlReverse:
; 433 : }
; 434 : i = 0;
mov DWORD PTR _i$[ebp], 0
; 435 : j = comp->nbStep - 1;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+20]
sub edx, 1
mov DWORD PTR _j$[ebp], edx
$LN5@xmlReverse:
; 436 : while (j > i) {
mov eax, DWORD PTR _j$[ebp]
cmp eax, DWORD PTR _i$[ebp]
jle $LN6@xmlReverse
; 437 : register const xmlChar *tmp;
; 438 : register xmlPatOp op;
; 439 : tmp = comp->steps[i].value;
imul ecx, DWORD PTR _i$[ebp], 12
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+28]
mov ecx, DWORD PTR [eax+ecx+4]
mov DWORD PTR _tmp$2[ebp], ecx
; 440 : comp->steps[i].value = comp->steps[j].value;
imul edx, DWORD PTR _j$[ebp], 12
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
imul eax, DWORD PTR _i$[ebp], 12
mov esi, DWORD PTR _comp$[ebp]
mov esi, DWORD PTR [esi+28]
mov ecx, DWORD PTR [ecx+edx+4]
mov DWORD PTR [esi+eax+4], ecx
; 441 : comp->steps[j].value = tmp;
imul edx, DWORD PTR _j$[ebp], 12
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
mov eax, DWORD PTR _tmp$2[ebp]
mov DWORD PTR [ecx+edx+4], eax
; 442 : tmp = comp->steps[i].value2;
imul ecx, DWORD PTR _i$[ebp], 12
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+28]
mov ecx, DWORD PTR [eax+ecx+8]
mov DWORD PTR _tmp$2[ebp], ecx
; 443 : comp->steps[i].value2 = comp->steps[j].value2;
imul edx, DWORD PTR _j$[ebp], 12
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
imul eax, DWORD PTR _i$[ebp], 12
mov esi, DWORD PTR _comp$[ebp]
mov esi, DWORD PTR [esi+28]
mov ecx, DWORD PTR [ecx+edx+8]
mov DWORD PTR [esi+eax+8], ecx
; 444 : comp->steps[j].value2 = tmp;
imul edx, DWORD PTR _j$[ebp], 12
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
mov eax, DWORD PTR _tmp$2[ebp]
mov DWORD PTR [ecx+edx+8], eax
; 445 : op = comp->steps[i].op;
imul ecx, DWORD PTR _i$[ebp], 12
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+28]
mov ecx, DWORD PTR [eax+ecx]
mov DWORD PTR _op$1[ebp], ecx
; 446 : comp->steps[i].op = comp->steps[j].op;
imul edx, DWORD PTR _j$[ebp], 12
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
imul eax, DWORD PTR _i$[ebp], 12
mov esi, DWORD PTR _comp$[ebp]
mov esi, DWORD PTR [esi+28]
mov ecx, DWORD PTR [ecx+edx]
mov DWORD PTR [esi+eax], ecx
; 447 : comp->steps[j].op = op;
imul edx, DWORD PTR _j$[ebp], 12
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
mov eax, DWORD PTR _op$1[ebp]
mov DWORD PTR [ecx+edx], eax
; 448 : j--;
mov ecx, DWORD PTR _j$[ebp]
sub ecx, 1
mov DWORD PTR _j$[ebp], ecx
; 449 : i++;
mov edx, DWORD PTR _i$[ebp]
add edx, 1
mov DWORD PTR _i$[ebp], edx
; 450 : }
jmp $LN5@xmlReverse
$LN6@xmlReverse:
; 451 : comp->steps[comp->nbStep].value = NULL;
mov eax, DWORD PTR _comp$[ebp]
imul ecx, DWORD PTR [eax+20], 12
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+28]
mov DWORD PTR [eax+ecx+4], 0
; 452 : comp->steps[comp->nbStep].value2 = NULL;
mov ecx, DWORD PTR _comp$[ebp]
imul edx, DWORD PTR [ecx+20], 12
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
mov DWORD PTR [ecx+edx+8], 0
; 453 : comp->steps[comp->nbStep++].op = XML_OP_END;
mov edx, DWORD PTR _comp$[ebp]
imul eax, DWORD PTR [edx+20], 12
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR [edx+eax], 0
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+20]
add ecx, 1
mov edx, DWORD PTR _comp$[ebp]
mov DWORD PTR [edx+20], ecx
; 454 : return(0);
xor eax, eax
$LN1@xmlReverse:
; 455 : }
pop esi
add esp, 20 ; 00000014H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlReversePattern ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatternAdd
_TEXT SEGMENT
_temp$1 = -4 ; size = 4
_ctxt$ = 8 ; size = 4
_comp$ = 12 ; size = 4
_op$ = 16 ; size = 4
_value$ = 20 ; size = 4
_value2$ = 24 ; size = 4
_xmlPatternAdd PROC ; COMDAT
; 350 : {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 351 : if (comp->nbStep >= comp->maxStep) {
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [eax+20]
cmp edx, DWORD PTR [ecx+24]
jl SHORT $LN2@xmlPattern
; 352 : xmlStepOpPtr temp;
; 353 : temp = (xmlStepOpPtr) xmlRealloc(comp->steps, comp->maxStep * 2 *
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+24]
shl ecx, 1
imul edx, ecx, 12
mov esi, esp
push edx
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
push ecx
call DWORD PTR _xmlRealloc
add esp, 8
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _temp$1[ebp], eax
; 354 : sizeof(xmlStepOp));
; 355 : if (temp == NULL) {
cmp DWORD PTR _temp$1[ebp], 0
jne SHORT $LN3@xmlPattern
; 356 : ERROR(ctxt, NULL, NULL,
; 357 : "xmlPatternAdd: realloc failed\n");
; 358 : return (-1);
or eax, -1
jmp SHORT $LN1@xmlPattern
$LN3@xmlPattern:
; 359 : }
; 360 : comp->steps = temp;
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR _temp$1[ebp]
mov DWORD PTR [edx+28], eax
; 361 : comp->maxStep *= 2;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+24]
shl edx, 1
mov eax, DWORD PTR _comp$[ebp]
mov DWORD PTR [eax+24], edx
$LN2@xmlPattern:
; 362 : }
; 363 : comp->steps[comp->nbStep].op = op;
mov ecx, DWORD PTR _comp$[ebp]
imul edx, DWORD PTR [ecx+20], 12
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
mov eax, DWORD PTR _op$[ebp]
mov DWORD PTR [ecx+edx], eax
; 364 : comp->steps[comp->nbStep].value = value;
mov ecx, DWORD PTR _comp$[ebp]
imul edx, DWORD PTR [ecx+20], 12
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
mov eax, DWORD PTR _value$[ebp]
mov DWORD PTR [ecx+edx+4], eax
; 365 : comp->steps[comp->nbStep].value2 = value2;
mov ecx, DWORD PTR _comp$[ebp]
imul edx, DWORD PTR [ecx+20], 12
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+28]
mov eax, DWORD PTR _value2$[ebp]
mov DWORD PTR [ecx+edx+8], eax
; 366 : comp->nbStep++;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+20]
add edx, 1
mov eax, DWORD PTR _comp$[ebp]
mov DWORD PTR [eax+20], edx
; 367 : return (0);
xor eax, eax
$LN1@xmlPattern:
; 368 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlPatternAdd ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlFreePatParserContext
_TEXT SEGMENT
_ctxt$ = 8 ; size = 4
_xmlFreePatParserContext PROC ; COMDAT
; 328 : xmlFreePatParserContext(xmlPatParserContextPtr ctxt) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 329 : if (ctxt == NULL)
cmp DWORD PTR _ctxt$[ebp], 0
jne SHORT $LN2@xmlFreePat
; 330 : return;
jmp SHORT $LN1@xmlFreePat
$LN2@xmlFreePat:
; 331 : memset(ctxt, -1, sizeof(xmlPatParserContext));
or eax, -1
mov ecx, DWORD PTR _ctxt$[ebp]
mov DWORD PTR [ecx], eax
mov DWORD PTR [ecx+4], eax
mov DWORD PTR [ecx+8], eax
mov DWORD PTR [ecx+12], eax
mov DWORD PTR [ecx+16], eax
mov DWORD PTR [ecx+20], eax
mov DWORD PTR [ecx+24], eax
mov DWORD PTR [ecx+28], eax
; 332 : xmlFree(ctxt);
mov esi, esp
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN1@xmlFreePat:
; 333 : }
pop esi
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_xmlFreePatParserContext ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlNewPatParserContext
_TEXT SEGMENT
_i$1 = -8 ; size = 4
_cur$ = -4 ; size = 4
_pattern$ = 8 ; size = 4
_dict$ = 12 ; size = 4
_namespaces$ = 16 ; size = 4
_xmlNewPatParserContext PROC ; COMDAT
; 293 : const xmlChar **namespaces) {
push ebp
mov ebp, esp
sub esp, 8
push esi
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 294 : xmlPatParserContextPtr cur;
; 295 :
; 296 : if (pattern == NULL)
cmp DWORD PTR _pattern$[ebp], 0
jne SHORT $LN5@xmlNewPatP
; 297 : return(NULL);
xor eax, eax
jmp $LN1@xmlNewPatP
$LN5@xmlNewPatP:
; 298 :
; 299 : cur = (xmlPatParserContextPtr) xmlMalloc(sizeof(xmlPatParserContext));
mov esi, esp
push 32 ; 00000020H
call DWORD PTR _xmlMalloc
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _cur$[ebp], eax
; 300 : if (cur == NULL) {
cmp DWORD PTR _cur$[ebp], 0
jne SHORT $LN6@xmlNewPatP
; 301 : ERROR(NULL, NULL, NULL,
; 302 : "xmlNewPatParserContext : malloc failed\n");
; 303 : return(NULL);
xor eax, eax
jmp SHORT $LN1@xmlNewPatP
$LN6@xmlNewPatP:
; 304 : }
; 305 : memset(cur, 0, sizeof(xmlPatParserContext));
xor eax, eax
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [ecx], eax
mov DWORD PTR [ecx+4], eax
mov DWORD PTR [ecx+8], eax
mov DWORD PTR [ecx+12], eax
mov DWORD PTR [ecx+16], eax
mov DWORD PTR [ecx+20], eax
mov DWORD PTR [ecx+24], eax
mov DWORD PTR [ecx+28], eax
; 306 : cur->dict = dict;
mov edx, DWORD PTR _cur$[ebp]
mov eax, DWORD PTR _dict$[ebp]
mov DWORD PTR [edx+12], eax
; 307 : cur->cur = pattern;
mov ecx, DWORD PTR _cur$[ebp]
mov edx, DWORD PTR _pattern$[ebp]
mov DWORD PTR [ecx], edx
; 308 : cur->base = pattern;
mov eax, DWORD PTR _cur$[ebp]
mov ecx, DWORD PTR _pattern$[ebp]
mov DWORD PTR [eax+4], ecx
; 309 : if (namespaces != NULL) {
cmp DWORD PTR _namespaces$[ebp], 0
je SHORT $LN7@xmlNewPatP
; 310 : int i;
; 311 : for (i = 0;namespaces[2 * i] != NULL;i++)
mov DWORD PTR _i$1[ebp], 0
jmp SHORT $LN4@xmlNewPatP
$LN2@xmlNewPatP:
mov edx, DWORD PTR _i$1[ebp]
add edx, 1
mov DWORD PTR _i$1[ebp], edx
$LN4@xmlNewPatP:
mov eax, DWORD PTR _i$1[ebp]
shl eax, 1
mov ecx, DWORD PTR _namespaces$[ebp]
cmp DWORD PTR [ecx+eax*4], 0
je SHORT $LN3@xmlNewPatP
; 312 : ;
jmp SHORT $LN2@xmlNewPatP
$LN3@xmlNewPatP:
; 313 : cur->nb_namespaces = i;
mov edx, DWORD PTR _cur$[ebp]
mov eax, DWORD PTR _i$1[ebp]
mov DWORD PTR [edx+28], eax
; 314 : } else {
jmp SHORT $LN8@xmlNewPatP
$LN7@xmlNewPatP:
; 315 : cur->nb_namespaces = 0;
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [ecx+28], 0
$LN8@xmlNewPatP:
; 316 : }
; 317 : cur->namespaces = namespaces;
mov edx, DWORD PTR _cur$[ebp]
mov eax, DWORD PTR _namespaces$[ebp]
mov DWORD PTR [edx+24], eax
; 318 : return(cur);
mov eax, DWORD PTR _cur$[ebp]
$LN1@xmlNewPatP:
; 319 : }
pop esi
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlNewPatParserContext ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlNewPattern
_TEXT SEGMENT
_cur$ = -4 ; size = 4
_xmlNewPattern PROC ; COMDAT
; 203 : xmlNewPattern(void) {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 204 : xmlPatternPtr cur;
; 205 :
; 206 : cur = (xmlPatternPtr) xmlMalloc(sizeof(xmlPattern));
mov esi, esp
push 36 ; 00000024H
call DWORD PTR _xmlMalloc
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _cur$[ebp], eax
; 207 : if (cur == NULL) {
cmp DWORD PTR _cur$[ebp], 0
jne SHORT $LN2@xmlNewPatt
; 208 : ERROR(NULL, NULL, NULL,
; 209 : "xmlNewPattern : malloc failed\n");
; 210 : return(NULL);
xor eax, eax
jmp SHORT $LN1@xmlNewPatt
$LN2@xmlNewPatt:
; 211 : }
; 212 : memset(cur, 0, sizeof(xmlPattern));
xor eax, eax
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [ecx], eax
mov DWORD PTR [ecx+4], eax
mov DWORD PTR [ecx+8], eax
mov DWORD PTR [ecx+12], eax
mov DWORD PTR [ecx+16], eax
mov DWORD PTR [ecx+20], eax
mov DWORD PTR [ecx+24], eax
mov DWORD PTR [ecx+28], eax
mov DWORD PTR [ecx+32], eax
; 213 : cur->maxStep = 10;
mov edx, DWORD PTR _cur$[ebp]
mov DWORD PTR [edx+24], 10 ; 0000000aH
; 214 : cur->steps = (xmlStepOpPtr) xmlMalloc(cur->maxStep * sizeof(xmlStepOp));
mov eax, DWORD PTR _cur$[ebp]
imul ecx, DWORD PTR [eax+24], 12
mov esi, esp
push ecx
call DWORD PTR _xmlMalloc
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
mov edx, DWORD PTR _cur$[ebp]
mov DWORD PTR [edx+28], eax
; 215 : if (cur->steps == NULL) {
mov eax, DWORD PTR _cur$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN3@xmlNewPatt
; 216 : xmlFree(cur);
mov esi, esp
mov ecx, DWORD PTR _cur$[ebp]
push ecx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
; 217 : ERROR(NULL, NULL, NULL,
; 218 : "xmlNewPattern : malloc failed\n");
; 219 : return(NULL);
xor eax, eax
jmp SHORT $LN1@xmlNewPatt
$LN3@xmlNewPatt:
; 220 : }
; 221 : return(cur);
mov eax, DWORD PTR _cur$[ebp]
$LN1@xmlNewPatt:
; 222 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlNewPattern ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlFreeStreamComp
_TEXT SEGMENT
_comp$ = 8 ; size = 4
_xmlFreeStreamComp PROC ; COMDAT
; 1524 : xmlFreeStreamComp(xmlStreamCompPtr comp) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 1525 : if (comp != NULL) {
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN1@xmlFreeStr
; 1526 : if (comp->steps != NULL)
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+12], 0
je SHORT $LN3@xmlFreeStr
; 1527 : xmlFree(comp->steps);
mov esi, esp
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+12]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN3@xmlFreeStr:
; 1528 : if (comp->dict != NULL)
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax], 0
je SHORT $LN4@xmlFreeStr
; 1529 : xmlDictFree(comp->dict);
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx]
push edx
call _xmlDictFree
add esp, 4
$LN4@xmlFreeStr:
; 1530 : xmlFree(comp);
mov esi, esp
mov eax, DWORD PTR _comp$[ebp]
push eax
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN1@xmlFreeStr:
; 1531 : }
; 1532 : }
pop esi
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_xmlFreeStreamComp ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlStreamWantsAnyNode
_TEXT SEGMENT
_streamCtxt$ = 8 ; size = 4
_xmlStreamWantsAnyNode PROC ; COMDAT
; 2330 : {
push ebp
mov ebp, esp
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2331 : if (streamCtxt == NULL)
cmp DWORD PTR _streamCtxt$[ebp], 0
jne SHORT $LN2@xmlStreamW
; 2332 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlStreamW
$LN2@xmlStreamW:
; 2333 : while (streamCtxt != NULL) {
cmp DWORD PTR _streamCtxt$[ebp], 0
je SHORT $LN3@xmlStreamW
; 2334 : if (streamCtxt->comp->flags & XML_STREAM_FINAL_IS_ANY_NODE)
mov eax, DWORD PTR _streamCtxt$[ebp]
mov ecx, DWORD PTR [eax+4]
mov edx, DWORD PTR [ecx+16]
and edx, 16384 ; 00004000H
je SHORT $LN5@xmlStreamW
; 2335 : return(1);
mov eax, 1
jmp SHORT $LN1@xmlStreamW
$LN5@xmlStreamW:
; 2336 : streamCtxt = streamCtxt->next;
mov eax, DWORD PTR _streamCtxt$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR _streamCtxt$[ebp], ecx
; 2337 : }
jmp SHORT $LN2@xmlStreamW
$LN3@xmlStreamW:
; 2338 : return(0);
xor eax, eax
$LN1@xmlStreamW:
; 2339 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_xmlStreamWantsAnyNode ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlStreamPop
_TEXT SEGMENT
_lev$ = -8 ; size = 4
_i$ = -4 ; size = 4
_stream$ = 8 ; size = 4
_xmlStreamPop PROC ; COMDAT
; 2281 : xmlStreamPop(xmlStreamCtxtPtr stream) {
push ebp
mov ebp, esp
sub esp, 8
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2282 : int i, lev;
; 2283 :
; 2284 : if (stream == NULL)
cmp DWORD PTR _stream$[ebp], 0
jne SHORT $LN2@xmlStreamP
; 2285 : return(-1);
or eax, -1
jmp $LN1@xmlStreamP
$LN2@xmlStreamP:
; 2286 : while (stream != NULL) {
cmp DWORD PTR _stream$[ebp], 0
je $LN3@xmlStreamP
; 2287 : /*
; 2288 : * Reset block-level.
; 2289 : */
; 2290 : if (stream->blockLevel == stream->level)
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [eax+28]
cmp edx, DWORD PTR [ecx+16]
jne SHORT $LN8@xmlStreamP
; 2291 : stream->blockLevel = -1;
mov eax, DWORD PTR _stream$[ebp]
mov DWORD PTR [eax+28], -1
$LN8@xmlStreamP:
; 2292 :
; 2293 : /*
; 2294 : * stream->level can be zero when XML_FINAL_IS_ANY_NODE is set
; 2295 : * (see the thread at
; 2296 : * http://mail.gnome.org/archives/xslt/2008-July/msg00027.html)
; 2297 : */
; 2298 : if (stream->level)
mov ecx, DWORD PTR _stream$[ebp]
cmp DWORD PTR [ecx+16], 0
je SHORT $LN9@xmlStreamP
; 2299 : stream->level--;
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+16]
sub eax, 1
mov ecx, DWORD PTR _stream$[ebp]
mov DWORD PTR [ecx+16], eax
$LN9@xmlStreamP:
; 2300 : /*
; 2301 : * Check evolution of existing states
; 2302 : */
; 2303 : for (i = stream->nbState -1; i >= 0; i--) {
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+8]
sub eax, 1
mov DWORD PTR _i$[ebp], eax
jmp SHORT $LN6@xmlStreamP
$LN4@xmlStreamP:
mov ecx, DWORD PTR _i$[ebp]
sub ecx, 1
mov DWORD PTR _i$[ebp], ecx
$LN6@xmlStreamP:
cmp DWORD PTR _i$[ebp], 0
jl SHORT $LN5@xmlStreamP
; 2304 : /* discard obsoleted states */
; 2305 : lev = stream->states[(2 * i) + 1];
mov edx, DWORD PTR _i$[ebp]
shl edx, 1
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+20]
mov edx, DWORD PTR [ecx+edx*4+4]
mov DWORD PTR _lev$[ebp], edx
; 2306 : if (lev > stream->level)
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR _lev$[ebp]
cmp ecx, DWORD PTR [eax+16]
jle SHORT $LN10@xmlStreamP
; 2307 : stream->nbState--;
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR [edx+8]
sub eax, 1
mov ecx, DWORD PTR _stream$[ebp]
mov DWORD PTR [ecx+8], eax
$LN10@xmlStreamP:
; 2308 : if (lev <= stream->level)
mov edx, DWORD PTR _stream$[ebp]
mov eax, DWORD PTR _lev$[ebp]
cmp eax, DWORD PTR [edx+16]
jg SHORT $LN11@xmlStreamP
; 2309 : break;
jmp SHORT $LN5@xmlStreamP
$LN11@xmlStreamP:
; 2310 : }
jmp SHORT $LN4@xmlStreamP
$LN5@xmlStreamP:
; 2311 : stream = stream->next;
mov ecx, DWORD PTR _stream$[ebp]
mov edx, DWORD PTR [ecx]
mov DWORD PTR _stream$[ebp], edx
; 2312 : }
jmp $LN2@xmlStreamP
$LN3@xmlStreamP:
; 2313 : return(0);
xor eax, eax
$LN1@xmlStreamP:
; 2314 : }
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlStreamPop ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlStreamPushAttr
_TEXT SEGMENT
_stream$ = 8 ; size = 4
_name$ = 12 ; size = 4
_ns$ = 16 ; size = 4
_xmlStreamPushAttr PROC ; COMDAT
; 2268 : const xmlChar *name, const xmlChar *ns) {
push ebp
mov ebp, esp
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2269 : return (xmlStreamPushInternal(stream, name, ns, (int) XML_ATTRIBUTE_NODE));
push 2
mov eax, DWORD PTR _ns$[ebp]
push eax
mov ecx, DWORD PTR _name$[ebp]
push ecx
mov edx, DWORD PTR _stream$[ebp]
push edx
call _xmlStreamPushInternal
add esp, 16 ; 00000010H
; 2270 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_xmlStreamPushAttr ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlStreamPush
_TEXT SEGMENT
_stream$ = 8 ; size = 4
_name$ = 12 ; size = 4
_ns$ = 16 ; size = 4
_xmlStreamPush PROC ; COMDAT
; 2218 : const xmlChar *name, const xmlChar *ns) {
push ebp
mov ebp, esp
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2219 : return (xmlStreamPushInternal(stream, name, ns, (int) XML_ELEMENT_NODE));
push 1
mov eax, DWORD PTR _ns$[ebp]
push eax
mov ecx, DWORD PTR _name$[ebp]
push ecx
mov edx, DWORD PTR _stream$[ebp]
push edx
call _xmlStreamPushInternal
add esp, 16 ; 00000010H
; 2220 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_xmlStreamPush ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlStreamPushNode
_TEXT SEGMENT
_stream$ = 8 ; size = 4
_name$ = 12 ; size = 4
_ns$ = 16 ; size = 4
_nodeType$ = 20 ; size = 4
_xmlStreamPushNode PROC ; COMDAT
; 2245 : {
push ebp
mov ebp, esp
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2246 : return (xmlStreamPushInternal(stream, name, ns,
mov eax, DWORD PTR _nodeType$[ebp]
push eax
mov ecx, DWORD PTR _ns$[ebp]
push ecx
mov edx, DWORD PTR _name$[ebp]
push edx
mov eax, DWORD PTR _stream$[ebp]
push eax
call _xmlStreamPushInternal
add esp, 16 ; 00000010H
; 2247 : nodeType));
; 2248 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_xmlStreamPushNode ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlFreeStreamCtxt
_TEXT SEGMENT
_next$ = -4 ; size = 4
_stream$ = 8 ; size = 4
_xmlFreeStreamCtxt PROC ; COMDAT
; 1792 : xmlFreeStreamCtxt(xmlStreamCtxtPtr stream) {
push ebp
mov ebp, esp
push ecx
push esi
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
$LN2@xmlFreeStr:
; 1793 : xmlStreamCtxtPtr next;
; 1794 :
; 1795 : while (stream != NULL) {
cmp DWORD PTR _stream$[ebp], 0
je SHORT $LN1@xmlFreeStr
; 1796 : next = stream->next;
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR _next$[ebp], ecx
; 1797 : if (stream->states != NULL)
mov edx, DWORD PTR _stream$[ebp]
cmp DWORD PTR [edx+20], 0
je SHORT $LN4@xmlFreeStr
; 1798 : xmlFree(stream->states);
mov esi, esp
mov eax, DWORD PTR _stream$[ebp]
mov ecx, DWORD PTR [eax+20]
push ecx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN4@xmlFreeStr:
; 1799 : xmlFree(stream);
mov esi, esp
mov edx, DWORD PTR _stream$[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
; 1800 : stream = next;
mov eax, DWORD PTR _next$[ebp]
mov DWORD PTR _stream$[ebp], eax
; 1801 : }
jmp SHORT $LN2@xmlFreeStr
$LN1@xmlFreeStr:
; 1802 : }
pop esi
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlFreeStreamCtxt ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatternGetStreamCtxt
_TEXT SEGMENT
_cur$ = -8 ; size = 4
_ret$ = -4 ; size = 4
_comp$ = 8 ; size = 4
_xmlPatternGetStreamCtxt PROC ; COMDAT
; 2491 : {
push ebp
mov ebp, esp
sub esp, 8
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2492 : xmlStreamCtxtPtr ret = NULL, cur;
mov DWORD PTR _ret$[ebp], 0
; 2493 :
; 2494 : if ((comp == NULL) || (comp->stream == NULL))
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN5@xmlPattern
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+32], 0
jne SHORT $LN2@xmlPattern
$LN5@xmlPattern:
; 2495 : return(NULL);
xor eax, eax
jmp SHORT $LN1@xmlPattern
$LN2@xmlPattern:
; 2496 :
; 2497 : while (comp != NULL) {
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN3@xmlPattern
; 2498 : if (comp->stream == NULL)
mov ecx, DWORD PTR _comp$[ebp]
cmp DWORD PTR [ecx+32], 0
jne SHORT $LN6@xmlPattern
; 2499 : goto failed;
jmp SHORT $failed$11
$LN6@xmlPattern:
; 2500 : cur = xmlNewStreamCtxt(comp->stream);
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+32]
push eax
call _xmlNewStreamCtxt
add esp, 4
mov DWORD PTR _cur$[ebp], eax
; 2501 : if (cur == NULL)
cmp DWORD PTR _cur$[ebp], 0
jne SHORT $LN7@xmlPattern
; 2502 : goto failed;
jmp SHORT $failed$11
$LN7@xmlPattern:
; 2503 : if (ret == NULL)
cmp DWORD PTR _ret$[ebp], 0
jne SHORT $LN8@xmlPattern
; 2504 : ret = cur;
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR _ret$[ebp], ecx
jmp SHORT $LN9@xmlPattern
$LN8@xmlPattern:
; 2505 : else {
; 2506 : cur->next = ret->next;
mov edx, DWORD PTR _cur$[ebp]
mov eax, DWORD PTR _ret$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR [edx], ecx
; 2507 : ret->next = cur;
mov edx, DWORD PTR _ret$[ebp]
mov eax, DWORD PTR _cur$[ebp]
mov DWORD PTR [edx], eax
$LN9@xmlPattern:
; 2508 : }
; 2509 : cur->flags = comp->flags;
mov ecx, DWORD PTR _cur$[ebp]
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+16]
mov DWORD PTR [ecx+24], eax
; 2510 : comp = comp->next;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+8]
mov DWORD PTR _comp$[ebp], edx
; 2511 : }
jmp SHORT $LN2@xmlPattern
$LN3@xmlPattern:
; 2512 : return(ret);
mov eax, DWORD PTR _ret$[ebp]
jmp SHORT $LN1@xmlPattern
$failed$11:
; 2513 : failed:
; 2514 : xmlFreeStreamCtxt(ret);
mov eax, DWORD PTR _ret$[ebp]
push eax
call _xmlFreeStreamCtxt
add esp, 4
; 2515 : return(NULL);
xor eax, eax
$LN1@xmlPattern:
; 2516 : }
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlPatternGetStreamCtxt ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatternFromRoot
_TEXT SEGMENT
_comp$ = 8 ; size = 4
_xmlPatternFromRoot PROC ; COMDAT
; 2602 : xmlPatternFromRoot(xmlPatternPtr comp) {
push ebp
mov ebp, esp
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2603 : if (comp == NULL)
cmp DWORD PTR _comp$[ebp], 0
jne SHORT $LN2@xmlPattern
; 2604 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlPattern
$LN2@xmlPattern:
; 2605 : while (comp != NULL) {
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN3@xmlPattern
; 2606 : if (comp->stream == NULL)
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+32], 0
jne SHORT $LN5@xmlPattern
; 2607 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlPattern
$LN5@xmlPattern:
; 2608 : if (comp->flags & PAT_FROM_ROOT)
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+16]
and edx, 256 ; 00000100H
je SHORT $LN6@xmlPattern
; 2609 : return(1);
mov eax, 1
jmp SHORT $LN1@xmlPattern
$LN6@xmlPattern:
; 2610 : comp = comp->next;
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR [eax+8]
mov DWORD PTR _comp$[ebp], ecx
; 2611 : }
jmp SHORT $LN2@xmlPattern
$LN3@xmlPattern:
; 2612 : return(0);
xor eax, eax
$LN1@xmlPattern:
; 2613 :
; 2614 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_xmlPatternFromRoot ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatternMinDepth
_TEXT SEGMENT
_ret$ = -4 ; size = 4
_comp$ = 8 ; size = 4
_xmlPatternMinDepth PROC ; COMDAT
; 2577 : xmlPatternMinDepth(xmlPatternPtr comp) {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2578 : int ret = 12345678;
mov DWORD PTR _ret$[ebp], 12345678 ; 00bc614eH
; 2579 : if (comp == NULL)
cmp DWORD PTR _comp$[ebp], 0
jne SHORT $LN2@xmlPattern
; 2580 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlPattern
$LN2@xmlPattern:
; 2581 : while (comp != NULL) {
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN3@xmlPattern
; 2582 : if (comp->stream == NULL)
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+32], 0
jne SHORT $LN5@xmlPattern
; 2583 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlPattern
$LN5@xmlPattern:
; 2584 : if (comp->stream->nbStep < ret)
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+32]
mov eax, DWORD PTR [edx+4]
cmp eax, DWORD PTR _ret$[ebp]
jge SHORT $LN6@xmlPattern
; 2585 : ret = comp->stream->nbStep;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+32]
mov eax, DWORD PTR [edx+4]
mov DWORD PTR _ret$[ebp], eax
$LN6@xmlPattern:
; 2586 : if (ret == 0)
cmp DWORD PTR _ret$[ebp], 0
jne SHORT $LN7@xmlPattern
; 2587 : return(0);
xor eax, eax
jmp SHORT $LN1@xmlPattern
$LN7@xmlPattern:
; 2588 : comp = comp->next;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+8]
mov DWORD PTR _comp$[ebp], edx
; 2589 : }
jmp SHORT $LN2@xmlPattern
$LN3@xmlPattern:
; 2590 : return(ret);
mov eax, DWORD PTR _ret$[ebp]
$LN1@xmlPattern:
; 2591 : }
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlPatternMinDepth ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatternMaxDepth
_TEXT SEGMENT
_i$ = -8 ; size = 4
_ret$ = -4 ; size = 4
_comp$ = 8 ; size = 4
_xmlPatternMaxDepth PROC ; COMDAT
; 2549 : xmlPatternMaxDepth(xmlPatternPtr comp) {
push ebp
mov ebp, esp
sub esp, 8
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2550 : int ret = 0, i;
mov DWORD PTR _ret$[ebp], 0
; 2551 : if (comp == NULL)
cmp DWORD PTR _comp$[ebp], 0
jne SHORT $LN2@xmlPattern
; 2552 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlPattern
$LN2@xmlPattern:
; 2553 : while (comp != NULL) {
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN3@xmlPattern
; 2554 : if (comp->stream == NULL)
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+32], 0
jne SHORT $LN8@xmlPattern
; 2555 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlPattern
$LN8@xmlPattern:
; 2556 : for (i = 0;i < comp->stream->nbStep;i++)
mov DWORD PTR _i$[ebp], 0
jmp SHORT $LN6@xmlPattern
$LN4@xmlPattern:
mov ecx, DWORD PTR _i$[ebp]
add ecx, 1
mov DWORD PTR _i$[ebp], ecx
$LN6@xmlPattern:
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+32]
mov ecx, DWORD PTR _i$[ebp]
cmp ecx, DWORD PTR [eax+4]
jge SHORT $LN5@xmlPattern
; 2557 : if (comp->stream->steps[i].flags & XML_STREAM_STEP_DESC)
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+32]
mov ecx, DWORD PTR _i$[ebp]
shl ecx, 4
mov edx, DWORD PTR [eax+12]
mov eax, DWORD PTR [edx+ecx]
and eax, 1
je SHORT $LN9@xmlPattern
; 2558 : return(-2);
mov eax, -2 ; fffffffeH
jmp SHORT $LN1@xmlPattern
$LN9@xmlPattern:
jmp SHORT $LN4@xmlPattern
$LN5@xmlPattern:
; 2559 : if (comp->stream->nbStep > ret)
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+32]
mov eax, DWORD PTR [edx+4]
cmp eax, DWORD PTR _ret$[ebp]
jle SHORT $LN10@xmlPattern
; 2560 : ret = comp->stream->nbStep;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+32]
mov eax, DWORD PTR [edx+4]
mov DWORD PTR _ret$[ebp], eax
$LN10@xmlPattern:
; 2561 : comp = comp->next;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+8]
mov DWORD PTR _comp$[ebp], edx
; 2562 : }
jmp SHORT $LN2@xmlPattern
$LN3@xmlPattern:
; 2563 : return(ret);
mov eax, DWORD PTR _ret$[ebp]
$LN1@xmlPattern:
; 2564 : }
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlPatternMaxDepth ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatternStreamable
_TEXT SEGMENT
_comp$ = 8 ; size = 4
_xmlPatternStreamable PROC ; COMDAT
; 2528 : xmlPatternStreamable(xmlPatternPtr comp) {
push ebp
mov ebp, esp
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2529 : if (comp == NULL)
cmp DWORD PTR _comp$[ebp], 0
jne SHORT $LN2@xmlPattern
; 2530 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlPattern
$LN2@xmlPattern:
; 2531 : while (comp != NULL) {
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN3@xmlPattern
; 2532 : if (comp->stream == NULL)
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+32], 0
jne SHORT $LN5@xmlPattern
; 2533 : return(0);
xor eax, eax
jmp SHORT $LN1@xmlPattern
$LN5@xmlPattern:
; 2534 : comp = comp->next;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+8]
mov DWORD PTR _comp$[ebp], edx
; 2535 : }
jmp SHORT $LN2@xmlPattern
$LN3@xmlPattern:
; 2536 : return(1);
mov eax, 1
$LN1@xmlPattern:
; 2537 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_xmlPatternStreamable ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatternMatch
_TEXT SEGMENT
_ret$ = -4 ; size = 4
_comp$ = 8 ; size = 4
_node$ = 12 ; size = 4
_xmlPatternMatch PROC ; COMDAT
; 2465 : {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2466 : int ret = 0;
mov DWORD PTR _ret$[ebp], 0
; 2467 :
; 2468 : if ((comp == NULL) || (node == NULL))
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN5@xmlPattern
cmp DWORD PTR _node$[ebp], 0
jne SHORT $LN2@xmlPattern
$LN5@xmlPattern:
; 2469 : return(-1);
or eax, -1
jmp SHORT $LN1@xmlPattern
$LN2@xmlPattern:
; 2470 :
; 2471 : while (comp != NULL) {
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN3@xmlPattern
; 2472 : ret = xmlPatMatch(comp, node);
mov eax, DWORD PTR _node$[ebp]
push eax
mov ecx, DWORD PTR _comp$[ebp]
push ecx
call _xmlPatMatch
add esp, 8
mov DWORD PTR _ret$[ebp], eax
; 2473 : if (ret != 0)
cmp DWORD PTR _ret$[ebp], 0
je SHORT $LN6@xmlPattern
; 2474 : return(ret);
mov eax, DWORD PTR _ret$[ebp]
jmp SHORT $LN1@xmlPattern
$LN6@xmlPattern:
; 2475 : comp = comp->next;
mov edx, DWORD PTR _comp$[ebp]
mov eax, DWORD PTR [edx+8]
mov DWORD PTR _comp$[ebp], eax
; 2476 : }
jmp SHORT $LN2@xmlPattern
$LN3@xmlPattern:
; 2477 : return(ret);
mov eax, DWORD PTR _ret$[ebp]
$LN1@xmlPattern:
; 2478 : }
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlPatternMatch ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlPatterncompile
_TEXT SEGMENT
_streamable$ = -32 ; size = 4
_type$ = -28 ; size = 4
_tmp$ = -24 ; size = 4
_start$ = -20 ; size = 4
_or$ = -16 ; size = 4
_ctxt$ = -12 ; size = 4
_cur$ = -8 ; size = 4
_ret$ = -4 ; size = 4
_pattern$ = 8 ; size = 4
_dict$ = 12 ; size = 4
_flags$ = 16 ; size = 4
_namespaces$ = 20 ; size = 4
_xmlPatterncompile PROC ; COMDAT
; 2360 : const xmlChar **namespaces) {
push ebp
mov ebp, esp
sub esp, 32 ; 00000020H
push esi
mov eax, -858993460 ; ccccccccH
mov DWORD PTR [ebp-32], eax
mov DWORD PTR [ebp-28], eax
mov DWORD PTR [ebp-24], eax
mov DWORD PTR [ebp-20], eax
mov DWORD PTR [ebp-16], eax
mov DWORD PTR [ebp-12], eax
mov DWORD PTR [ebp-8], eax
mov DWORD PTR [ebp-4], eax
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 2361 : xmlPatternPtr ret = NULL, cur;
mov DWORD PTR _ret$[ebp], 0
; 2362 : xmlPatParserContextPtr ctxt = NULL;
mov DWORD PTR _ctxt$[ebp], 0
; 2363 : const xmlChar *or, *start;
; 2364 : xmlChar *tmp = NULL;
mov DWORD PTR _tmp$[ebp], 0
; 2365 : int type = 0;
mov DWORD PTR _type$[ebp], 0
; 2366 : int streamable = 1;
mov DWORD PTR _streamable$[ebp], 1
; 2367 :
; 2368 : if (pattern == NULL)
cmp DWORD PTR _pattern$[ebp], 0
jne SHORT $LN8@xmlPattern
; 2369 : return(NULL);
xor eax, eax
jmp $LN1@xmlPattern
$LN8@xmlPattern:
; 2370 :
; 2371 : start = pattern;
mov eax, DWORD PTR _pattern$[ebp]
mov DWORD PTR _start$[ebp], eax
; 2372 : or = start;
mov ecx, DWORD PTR _start$[ebp]
mov DWORD PTR _or$[ebp], ecx
$LN2@xmlPattern:
; 2373 : while (*or != 0) {
mov edx, DWORD PTR _or$[ebp]
movzx eax, BYTE PTR [edx]
test eax, eax
je $LN3@xmlPattern
; 2374 : tmp = NULL;
mov DWORD PTR _tmp$[ebp], 0
$LN4@xmlPattern:
; 2375 : while ((*or != 0) && (*or != '|')) or++;
mov ecx, DWORD PTR _or$[ebp]
movzx edx, BYTE PTR [ecx]
test edx, edx
je SHORT $LN5@xmlPattern
mov eax, DWORD PTR _or$[ebp]
movzx ecx, BYTE PTR [eax]
cmp ecx, 124 ; 0000007cH
je SHORT $LN5@xmlPattern
mov edx, DWORD PTR _or$[ebp]
add edx, 1
mov DWORD PTR _or$[ebp], edx
jmp SHORT $LN4@xmlPattern
$LN5@xmlPattern:
; 2376 : if (*or == 0)
mov eax, DWORD PTR _or$[ebp]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
jne SHORT $LN9@xmlPattern
; 2377 : ctxt = xmlNewPatParserContext(start, dict, namespaces);
mov edx, DWORD PTR _namespaces$[ebp]
push edx
mov eax, DWORD PTR _dict$[ebp]
push eax
mov ecx, DWORD PTR _start$[ebp]
push ecx
call _xmlNewPatParserContext
add esp, 12 ; 0000000cH
mov DWORD PTR _ctxt$[ebp], eax
jmp SHORT $LN10@xmlPattern
$LN9@xmlPattern:
; 2378 : else {
; 2379 : tmp = xmlStrndup(start, or - start);
mov edx, DWORD PTR _or$[ebp]
sub edx, DWORD PTR _start$[ebp]
push edx
mov eax, DWORD PTR _start$[ebp]
push eax
call _xmlStrndup
add esp, 8
mov DWORD PTR _tmp$[ebp], eax
; 2380 : if (tmp != NULL) {
cmp DWORD PTR _tmp$[ebp], 0
je SHORT $LN11@xmlPattern
; 2381 : ctxt = xmlNewPatParserContext(tmp, dict, namespaces);
mov ecx, DWORD PTR _namespaces$[ebp]
push ecx
mov edx, DWORD PTR _dict$[ebp]
push edx
mov eax, DWORD PTR _tmp$[ebp]
push eax
call _xmlNewPatParserContext
add esp, 12 ; 0000000cH
mov DWORD PTR _ctxt$[ebp], eax
$LN11@xmlPattern:
; 2382 : }
; 2383 : or++;
mov ecx, DWORD PTR _or$[ebp]
add ecx, 1
mov DWORD PTR _or$[ebp], ecx
$LN10@xmlPattern:
; 2384 : }
; 2385 : if (ctxt == NULL) goto error;
cmp DWORD PTR _ctxt$[ebp], 0
jne SHORT $LN12@xmlPattern
jmp $error$37
$LN12@xmlPattern:
; 2386 : cur = xmlNewPattern();
call _xmlNewPattern
mov DWORD PTR _cur$[ebp], eax
; 2387 : if (cur == NULL) goto error;
cmp DWORD PTR _cur$[ebp], 0
jne SHORT $LN13@xmlPattern
jmp $error$37
$LN13@xmlPattern:
; 2388 : /*
; 2389 : * Assign string dict.
; 2390 : */
; 2391 : if (dict) {
cmp DWORD PTR _dict$[ebp], 0
je SHORT $LN14@xmlPattern
; 2392 : cur->dict = dict;
mov edx, DWORD PTR _cur$[ebp]
mov eax, DWORD PTR _dict$[ebp]
mov DWORD PTR [edx+4], eax
; 2393 : xmlDictReference(dict);
mov ecx, DWORD PTR _dict$[ebp]
push ecx
call _xmlDictReference
add esp, 4
$LN14@xmlPattern:
; 2394 : }
; 2395 : if (ret == NULL)
cmp DWORD PTR _ret$[ebp], 0
jne SHORT $LN15@xmlPattern
; 2396 : ret = cur;
mov edx, DWORD PTR _cur$[ebp]
mov DWORD PTR _ret$[ebp], edx
jmp SHORT $LN16@xmlPattern
$LN15@xmlPattern:
; 2397 : else {
; 2398 : cur->next = ret->next;
mov eax, DWORD PTR _cur$[ebp]
mov ecx, DWORD PTR _ret$[ebp]
mov edx, DWORD PTR [ecx+8]
mov DWORD PTR [eax+8], edx
; 2399 : ret->next = cur;
mov eax, DWORD PTR _ret$[ebp]
mov ecx, DWORD PTR _cur$[ebp]
mov DWORD PTR [eax+8], ecx
$LN16@xmlPattern:
; 2400 : }
; 2401 : cur->flags = flags;
mov edx, DWORD PTR _cur$[ebp]
mov eax, DWORD PTR _flags$[ebp]
mov DWORD PTR [edx+16], eax
; 2402 : ctxt->comp = cur;
mov ecx, DWORD PTR _ctxt$[ebp]
mov edx, DWORD PTR _cur$[ebp]
mov DWORD PTR [ecx+16], edx
; 2403 :
; 2404 : if (XML_STREAM_XS_IDC(cur))
mov eax, DWORD PTR _cur$[ebp]
mov ecx, DWORD PTR [eax+16]
and ecx, 6
je SHORT $LN17@xmlPattern
; 2405 : xmlCompileIDCXPathPath(ctxt);
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlCompileIDCXPathPath
add esp, 4
jmp SHORT $LN18@xmlPattern
$LN17@xmlPattern:
; 2406 : else
; 2407 : xmlCompilePathPattern(ctxt);
mov eax, DWORD PTR _ctxt$[ebp]
push eax
call _xmlCompilePathPattern
add esp, 4
$LN18@xmlPattern:
; 2408 : if (ctxt->error != 0)
mov ecx, DWORD PTR _ctxt$[ebp]
cmp DWORD PTR [ecx+8], 0
je SHORT $LN19@xmlPattern
; 2409 : goto error;
jmp $error$37
$LN19@xmlPattern:
; 2410 : xmlFreePatParserContext(ctxt);
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlFreePatParserContext
add esp, 4
; 2411 : ctxt = NULL;
mov DWORD PTR _ctxt$[ebp], 0
; 2412 :
; 2413 :
; 2414 : if (streamable) {
cmp DWORD PTR _streamable$[ebp], 0
je SHORT $LN20@xmlPattern
; 2415 : if (type == 0) {
cmp DWORD PTR _type$[ebp], 0
jne SHORT $LN21@xmlPattern
; 2416 : type = cur->flags & (PAT_FROM_ROOT | PAT_FROM_CUR);
mov eax, DWORD PTR _cur$[ebp]
mov ecx, DWORD PTR [eax+16]
and ecx, 768 ; 00000300H
mov DWORD PTR _type$[ebp], ecx
jmp SHORT $LN20@xmlPattern
$LN21@xmlPattern:
; 2417 : } else if (type == PAT_FROM_ROOT) {
cmp DWORD PTR _type$[ebp], 256 ; 00000100H
jne SHORT $LN23@xmlPattern
; 2418 : if (cur->flags & PAT_FROM_CUR)
mov edx, DWORD PTR _cur$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 512 ; 00000200H
je SHORT $LN25@xmlPattern
; 2419 : streamable = 0;
mov DWORD PTR _streamable$[ebp], 0
$LN25@xmlPattern:
; 2420 : } else if (type == PAT_FROM_CUR) {
jmp SHORT $LN20@xmlPattern
$LN23@xmlPattern:
cmp DWORD PTR _type$[ebp], 512 ; 00000200H
jne SHORT $LN20@xmlPattern
; 2421 : if (cur->flags & PAT_FROM_ROOT)
mov ecx, DWORD PTR _cur$[ebp]
mov edx, DWORD PTR [ecx+16]
and edx, 256 ; 00000100H
je SHORT $LN20@xmlPattern
; 2422 : streamable = 0;
mov DWORD PTR _streamable$[ebp], 0
$LN20@xmlPattern:
; 2423 : }
; 2424 : }
; 2425 : if (streamable)
cmp DWORD PTR _streamable$[ebp], 0
je SHORT $LN28@xmlPattern
; 2426 : xmlStreamCompile(cur);
mov eax, DWORD PTR _cur$[ebp]
push eax
call _xmlStreamCompile
add esp, 4
$LN28@xmlPattern:
; 2427 : if (xmlReversePattern(cur) < 0)
mov ecx, DWORD PTR _cur$[ebp]
push ecx
call _xmlReversePattern
add esp, 4
test eax, eax
jge SHORT $LN29@xmlPattern
; 2428 : goto error;
jmp SHORT $error$37
$LN29@xmlPattern:
; 2429 : if (tmp != NULL) {
cmp DWORD PTR _tmp$[ebp], 0
je SHORT $LN30@xmlPattern
; 2430 : xmlFree(tmp);
mov esi, esp
mov edx, DWORD PTR _tmp$[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
; 2431 : tmp = NULL;
mov DWORD PTR _tmp$[ebp], 0
$LN30@xmlPattern:
; 2432 : }
; 2433 : start = or;
mov eax, DWORD PTR _or$[ebp]
mov DWORD PTR _start$[ebp], eax
; 2434 : }
jmp $LN2@xmlPattern
$LN3@xmlPattern:
; 2435 : if (streamable == 0) {
cmp DWORD PTR _streamable$[ebp], 0
jne SHORT $LN31@xmlPattern
; 2436 : cur = ret;
mov ecx, DWORD PTR _ret$[ebp]
mov DWORD PTR _cur$[ebp], ecx
$LN6@xmlPattern:
; 2437 : while (cur != NULL) {
cmp DWORD PTR _cur$[ebp], 0
je SHORT $LN31@xmlPattern
; 2438 : if (cur->stream != NULL) {
mov edx, DWORD PTR _cur$[ebp]
cmp DWORD PTR [edx+32], 0
je SHORT $LN32@xmlPattern
; 2439 : xmlFreeStreamComp(cur->stream);
mov eax, DWORD PTR _cur$[ebp]
mov ecx, DWORD PTR [eax+32]
push ecx
call _xmlFreeStreamComp
add esp, 4
; 2440 : cur->stream = NULL;
mov edx, DWORD PTR _cur$[ebp]
mov DWORD PTR [edx+32], 0
$LN32@xmlPattern:
; 2441 : }
; 2442 : cur = cur->next;
mov eax, DWORD PTR _cur$[ebp]
mov ecx, DWORD PTR [eax+8]
mov DWORD PTR _cur$[ebp], ecx
; 2443 : }
jmp SHORT $LN6@xmlPattern
$LN31@xmlPattern:
; 2444 : }
; 2445 :
; 2446 : return(ret);
mov eax, DWORD PTR _ret$[ebp]
jmp SHORT $LN1@xmlPattern
$error$37:
; 2447 : error:
; 2448 : if (ctxt != NULL) xmlFreePatParserContext(ctxt);
cmp DWORD PTR _ctxt$[ebp], 0
je SHORT $LN33@xmlPattern
mov edx, DWORD PTR _ctxt$[ebp]
push edx
call _xmlFreePatParserContext
add esp, 4
$LN33@xmlPattern:
; 2449 : if (ret != NULL) xmlFreePattern(ret);
cmp DWORD PTR _ret$[ebp], 0
je SHORT $LN34@xmlPattern
mov eax, DWORD PTR _ret$[ebp]
push eax
call _xmlFreePattern
add esp, 4
$LN34@xmlPattern:
; 2450 : if (tmp != NULL) xmlFree(tmp);
cmp DWORD PTR _tmp$[ebp], 0
je SHORT $LN35@xmlPattern
mov esi, esp
mov ecx, DWORD PTR _tmp$[ebp]
push ecx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN35@xmlPattern:
; 2451 : return(NULL);
xor eax, eax
$LN1@xmlPattern:
; 2452 : }
pop esi
add esp, 32 ; 00000020H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlPatterncompile ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlFreePatternList
_TEXT SEGMENT
_cur$ = -4 ; size = 4
_comp$ = 8 ; size = 4
_xmlFreePatternList PROC ; COMDAT
; 269 : xmlFreePatternList(xmlPatternPtr comp) {
push ebp
mov ebp, esp
push ecx
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
$LN2@xmlFreePat:
; 270 : xmlPatternPtr cur;
; 271 :
; 272 : while (comp != NULL) {
cmp DWORD PTR _comp$[ebp], 0
je SHORT $LN1@xmlFreePat
; 273 : cur = comp;
mov eax, DWORD PTR _comp$[ebp]
mov DWORD PTR _cur$[ebp], eax
; 274 : comp = comp->next;
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+8]
mov DWORD PTR _comp$[ebp], edx
; 275 : cur->next = NULL;
mov eax, DWORD PTR _cur$[ebp]
mov DWORD PTR [eax+8], 0
; 276 : xmlFreePattern(cur);
mov ecx, DWORD PTR _cur$[ebp]
push ecx
call _xmlFreePattern
add esp, 4
; 277 : }
jmp SHORT $LN2@xmlFreePat
$LN1@xmlFreePat:
; 278 : }
add esp, 4
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlFreePatternList ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\pattern.c
; COMDAT _xmlFreePattern
_TEXT SEGMENT
_i$ = -8 ; size = 4
_op$ = -4 ; size = 4
_comp$ = 8 ; size = 4
_xmlFreePattern PROC ; COMDAT
; 231 : xmlFreePattern(xmlPatternPtr comp) {
push ebp
mov ebp, esp
sub esp, 8
push esi
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __69230394_pattern@c
call @__CheckForDebuggerJustMyCode@4
; 232 : xmlStepOpPtr op;
; 233 : int i;
; 234 :
; 235 : if (comp == NULL)
cmp DWORD PTR _comp$[ebp], 0
jne SHORT $LN5@xmlFreePat
; 236 : return;
jmp $LN1@xmlFreePat
$LN5@xmlFreePat:
; 237 : if (comp->next != NULL)
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+8], 0
je SHORT $LN6@xmlFreePat
; 238 : xmlFreePattern(comp->next);
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+8]
push edx
call _xmlFreePattern
add esp, 4
$LN6@xmlFreePat:
; 239 : if (comp->stream != NULL)
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+32], 0
je SHORT $LN7@xmlFreePat
; 240 : xmlFreeStreamComp(comp->stream);
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+32]
push edx
call _xmlFreeStreamComp
add esp, 4
$LN7@xmlFreePat:
; 241 : if (comp->pattern != NULL)
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+12], 0
je SHORT $LN8@xmlFreePat
; 242 : xmlFree((xmlChar *)comp->pattern);
mov esi, esp
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+12]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN8@xmlFreePat:
; 243 : if (comp->steps != NULL) {
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+28], 0
je $LN9@xmlFreePat
; 244 : if (comp->dict == NULL) {
mov ecx, DWORD PTR _comp$[ebp]
cmp DWORD PTR [ecx+4], 0
jne SHORT $LN10@xmlFreePat
; 245 : for (i = 0;i < comp->nbStep;i++) {
mov DWORD PTR _i$[ebp], 0
jmp SHORT $LN4@xmlFreePat
$LN2@xmlFreePat:
mov edx, DWORD PTR _i$[ebp]
add edx, 1
mov DWORD PTR _i$[ebp], edx
$LN4@xmlFreePat:
mov eax, DWORD PTR _comp$[ebp]
mov ecx, DWORD PTR _i$[ebp]
cmp ecx, DWORD PTR [eax+20]
jge SHORT $LN10@xmlFreePat
; 246 : op = &comp->steps[i];
imul edx, DWORD PTR _i$[ebp], 12
mov eax, DWORD PTR _comp$[ebp]
add edx, DWORD PTR [eax+28]
mov DWORD PTR _op$[ebp], edx
; 247 : if (op->value != NULL)
mov ecx, DWORD PTR _op$[ebp]
cmp DWORD PTR [ecx+4], 0
je SHORT $LN11@xmlFreePat
; 248 : xmlFree((xmlChar *) op->value);
mov esi, esp
mov edx, DWORD PTR _op$[ebp]
mov eax, DWORD PTR [edx+4]
push eax
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN11@xmlFreePat:
; 249 : if (op->value2 != NULL)
mov ecx, DWORD PTR _op$[ebp]
cmp DWORD PTR [ecx+8], 0
je SHORT $LN12@xmlFreePat
; 250 : xmlFree((xmlChar *) op->value2);
mov esi, esp
mov edx, DWORD PTR _op$[ebp]
mov eax, DWORD PTR [edx+8]
push eax
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN12@xmlFreePat:
; 251 : }
jmp SHORT $LN2@xmlFreePat
$LN10@xmlFreePat:
; 252 : }
; 253 : xmlFree(comp->steps);
mov esi, esp
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+28]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN9@xmlFreePat:
; 254 : }
; 255 : if (comp->dict != NULL)
mov eax, DWORD PTR _comp$[ebp]
cmp DWORD PTR [eax+4], 0
je SHORT $LN13@xmlFreePat
; 256 : xmlDictFree(comp->dict);
mov ecx, DWORD PTR _comp$[ebp]
mov edx, DWORD PTR [ecx+4]
push edx
call _xmlDictFree
add esp, 4
$LN13@xmlFreePat:
; 257 :
; 258 : memset(comp, -1, sizeof(xmlPattern));
or eax, -1
mov ecx, DWORD PTR _comp$[ebp]
mov DWORD PTR [ecx], eax
mov DWORD PTR [ecx+4], eax
mov DWORD PTR [ecx+8], eax
mov DWORD PTR [ecx+12], eax
mov DWORD PTR [ecx+16], eax
mov DWORD PTR [ecx+20], eax
mov DWORD PTR [ecx+24], eax
mov DWORD PTR [ecx+28], eax
mov DWORD PTR [ecx+32], eax
; 259 : xmlFree(comp);
mov esi, esp
mov edx, DWORD PTR _comp$[ebp]
push edx
call DWORD PTR _xmlFree
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
$LN1@xmlFreePat:
; 260 : }
pop esi
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_xmlFreePattern ENDP
_TEXT ENDS
END
| 21.782216
| 111
| 0.650767
|
405712b241f78303eb25519cde63cdf78fc71cb9
| 1,405
|
asm
|
Assembly
|
iod/con2/java16/block.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
iod/con2/java16/block.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
iod/con2/java16/block.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
; Draw a rectangular block 16 bit colour v2.00 1998 Tony Tebby
;
; 2.02 (c) W. Lenerz 2016 Oct 23
;
; The block size and origin are assumed to have been adjusted for
; correct position within the area to be set.
;
; Registers:
; Entry Exit
; D0 smashed
; D1 block size smashed
; D2 block origin smashed
; D3-D5 smashed
; D6 stipple
; D7 colour mask smashed
; A1 area base address smashed
; A2 area row increment smashed
;
; All other registers preserved
section con
xdef cn_fblock
xdef cn_xblock
xdef bm_block
xdef bm_xblok
xdef cn_clr2lw
include 'dev8_keys_java'
bm_xblok
moveq #jt5.xbkbm,d0
dc.w jva.trp5
cn_xblock
moveq #jt5.xorbk,d0
dc.w jva.trp5
cn_fblock
moveq #jt5.fblk,d0
dc.w jva.trp5
bm_block
moveq #jt5.fbkbm,d0
dc.w jva.trp5
; set colour masks
;
; d6 cr stipple / even row colours
; d7 cr colours / odd row colours
;
cn_clr2lw
add.w d6,d6
move.w cnc_table(pc,d6.w),d0
move.l d7,d6 ; colour in both long words
jmp cnc_table(pc,d0.w)
dc.w cnc_solid-cnc_table
cnc_table
dc.w cnc_1of4-cnc_table
dc.w cnc_horiz-cnc_table
dc.w cnc_vert-cnc_table
dc.w cnc_check-cnc_table
cnc_1of4
swap d6
move.w d6,d7 ; odd row is solid
swap d6
rts
cnc_horiz
swap d7 ; odd row is contrast
move.w d6,d0
move.w d7,d6 ; odd row is main colour
move.w d0,d7
rts
cnc_check
swap d6 ; even row is different
cnc_solid
cnc_vert
rts
end
| 16.149425
| 66
| 0.713167
|
078f6106ed5cfbf02f8f547395382a04e3de119a
| 558
|
asm
|
Assembly
|
oeis/072/A072987.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/072/A072987.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/072/A072987.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A072987: FIBMOD numbers: a(1) = a(2) = 1, a(n) = a(n-1) mod (n-1) + a(n-2) mod (n-2).
; Submitted by Jamie Morken(s4)
; 1,1,1,2,3,5,8,6,7,13,10,13,11,12,23,20,12,16,28,25,14,19,33,29,15,20,35,28,8,8,16,24,40,31,38,34,37,34,34,68,62,49,28,35,63,53,25,32,57,40,48,88,84,67,44,57,45,46,91,78,50,68,56,62,118,115,102,84,51,67,118,114,89,58,74,132,130,109,84,36,41,77,118,112,63,91,68,73,141,125,87,122,117,54,78,132,114,53,70,123
mov $1,2
mov $2,1
mov $4,1
lpb $0
sub $0,1
sub $1,1
mod $2,$1
add $1,2
mov $3,$4
mov $4,$2
add $2,$3
lpe
mov $0,$2
| 31
| 307
| 0.600358
|
8371e9202ed28d03c98843086face9edcce52607
| 78,940
|
asm
|
Assembly
|
Library/Kernel/File/fileEnum.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Library/Kernel/File/fileEnum.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Library/Kernel/File/fileEnum.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 73
|
2018-11-19T20:46:53.000Z
|
2022-03-29T00:59:26.000Z
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: fileEnum.asm
AUTHOR: Adam de Boor, Apr 9, 1990
ROUTINES:
Name Description
---- -----------
GLB FileEnum Application-level interface
GLB FileEnumLocateAttr Utility routine for application-level
callbacks from FileEnum to locate an
attribute in those passed.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Adam 4/ 9/90 Initial revision
DESCRIPTION:
Functions for enumerating files.
$Id: fileEnum.asm,v 1.1 97/04/05 01:11:46 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FileenumCode segment resource
FileEnumLocals struct
FEL_retBufHandle hptr ; handle of buffer being returned
FEL_curRetOff word ; offset of place to store next return
; value
FEL_numFound word ; number of files found that match
FEL_numMissed word ; number of files that wouldn't fit,
; if a limit was set by the caller.
FEL_realSkipCount word ; count of files to skip regardless of
; whether they match. Starts at the
; initial real skip count and
; decrements once for each file found,
; up until output buffer is full.
; Buffer starts filling when this goes
; < 0.
FEL_fecdHandle hptr ; handle of FileEnumCallbackData block
FEL_valueSpaceReqd word ; number of bytes of space needed
; after the attribute array in the
; FECD block.
FEL_fecdAttrSize word ; current size of attribute array,
; including EOL
FEL_filesSeen hptr ; buffer containing the names of all
; the files given to us by the FSD
; so far, so we can detect duplicate
; files found in different directories
; along the search path for a logical
; directory.
FEL_fsFree word ; Offset into FEL_filesSeen of first
; free byte.
FEL_fsdCallback word ; Offset of callback FSD should call
; within FileenumCode (for use by
; FEEnumCurrentPath)
FileEnumLocals ends
FE_FILES_SEEN_INITIAL_SIZE equ 512
FE_FILES_SEEN_INCR_SIZE equ 512
FECD_INITIAL_SIZE equ 256 ; initial # bytes for FECD
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEFetchCurPathDisk
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Fetch the disk handle for the thread's current path.
CALLED BY: INTERNAL
PASS: nothing
RETURN: bx = the disk handle
carry set if disk is StandardPath member, not real disk
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/26/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEFetchCurPathDisk proc near
uses ds
.enter
LoadVarSeg ds, bx
mov bx, ss:[TPD_curPath]
mov bx, ds:[bx].HM_otherInfo
test bx, DISK_IS_STD_PATH_MASK ; (clears carry)
jnz isStdPath
done:
.leave
ret
isStdPath:
stc
jmp done
FEFetchCurPathDisk endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FESetCallbackEtc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the callback function FEEnumCurrentPath should use and
adjust the FECD as necessary based on the current path,
whether it's a standard path, and whether it has any
directories beyond the local one to deal with.
CALLED BY: FileEnum
PASS: es = segment of FECD
ss:bp = inherited stack frame
RETURN: carry clear if ok:
FEL_fsdCallback set up
FEL_filesSeen allocated if nec'y, or 0 if not
carry set if error:
ax = ERROR_INSUFFICIENT_MEMORY
DESTROYED: ax, bx, cx, dx, si, di, ds
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/26/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
;
; Array of extended attributes that gets merged in when enumerating along a
; standard path to ensure we get the virtual name of all the files from the
; FSD.
;
feNameAttr FileExtAttrDesc \
<FEA_NAME, 0, FILE_LONGNAME_BUFFER_SIZE>,
<FEA_END_OF_LIST>
FESetCallbackEtc proc near
.enter inherit FileEnum
;
; Assume we can use the fast callback.
;
clr ax
mov ss:[locals].FEL_filesSeen, ax
mov ss:[locals].FEL_fsFree, ax
mov ss:[locals].FEL_fsdCallback, offset FEEnumCallback
call FEFetchCurPathDisk
jnc done ; not std path => use faster callback
; that doesn't check for duplicates
;
; See if there are any paths defined. If not, there can only be
; one directory so we can use the faster callback.
;
LoadVarSeg ds
cmp ds:[loaderVars].KLV_stdDirPaths, 0
jz done
;
; Must use the slow method, so ensure that FEA_NAME is in the list
; of attributes the FSD will provide us.
;
mov ss:[locals].FEL_fsdCallback, offset FESlowEnumCallback
segmov ds, cs
mov si, offset feNameAttr
call FEAddAttrs
jc done ; => error, code in AX
;
; Allocate the initial buffer to hold the file names we've seen.
;
mov ax, FE_FILES_SEEN_INITIAL_SIZE
mov cx, mask HF_SWAPABLE
call MemAllocFar
mov ss:[locals].FEL_filesSeen, bx
jnc done
;
; Couldn't alloc => couldn't enum, so return error and carry set
;
mov ax, ERROR_INSUFFICIENT_MEMORY
done:
.leave
ret
FESetCallbackEtc endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FELocateAttr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Locate the passed attribute in the passed attribute array.
CALLED BY: FEAddAttrs, FECmpAttrs, FECopyAttrs
PASS: ds:si = FileExtAttrDesc (or FileExtCustomAttrDesc) that we
want to find.
es:di = start of array of attributes in which to search.
RETURN: ax = FileExtendedAttribute in ds:si
carry set if attribute found:
es:di = descriptor in destination array
carry clear if attribute not found
DESTROYED: dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/20/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FELocateAttr proc near
.enter
mov ax, ds:[si].FEAD_attr
lookForAttr:
;
; Fetch the attribute from the FECD, as we've got two comparisons we
; might need to make...
;
mov dx, es:[di].FEAD_attr
cmp ax, dx ; same as attribute being merged?
je attrMatched ; yes -- go deal with FEA_CUSTOM before
; deciding to drop this one.
cmp dx, FEA_END_OF_LIST ; end of the dest array?
je done ; yes -- attr ain't there, so
; return with carry clear
nextAttr:
;
; Advance to the next attribute in the destination array.
;
add di, size FileExtAttrDesc
jmp lookForAttr
attrMatched:
;
; FEAD_attr matched, but the thing might be a custom attribute, which
; requires more work....
;
cmp ax, FEA_CUSTOM
je checkCustom
;
; Nope. not custom, so signal that we found the attribute and be done.
;
match:
stc
done:
.leave
ret
;--------------------
checkCustom:
;
; Attribute being sought is FEA_CUSTOM, so we have to compare the
; null-terminated name strings as well before declaring a match.
;
push ds, si, es, di, ax ; save affected registers
lds si, ds:[si].FEAD_name
les di, es:[di].FEAD_name
checkCustomLoop:
lodsb
scasb
jne checkCustomEnd
tst al ; done with both?
jnz checkCustomLoop ; nope -- keep looping
checkCustomEnd:
pop ds, si, es, di, ax ; recover affected registers
jne nextAttr
jmp match
FELocateAttr endp
;
; Table of extended-attribute sizes for those that are of a fixed size
; (i.e. that aren't null-terminated strings)
; If the value is zero, then the caller can request return values of
; any size
;
extAttrSizes byte size FileDateAndTime, ; FEA_MODIFIED
size FileAttrs, ; FEA_FILE_ATTR
size dword, ; FEA_SIZE
size GeosFileType, ; FEA_FILE_TYPE
size GeosFileHeaderFlags,; FEA_FLAGS
size ReleaseNumber, ; FEA_RELEASE
size ProtocolNumber, ; FEA_PROTOCOL
size GeodeToken, ; FEA_TOKEN
size GeodeToken, ; FEA_CREATOR
0, ; FEA_USER_NOTES
0, ; FEA_NOTICE
size FileDateAndTime, ; FEA_CREATED
0, ; FEA_PASSWORD
0, ; FEA_CUSTOM
0, ; FEA_NAME
size GeodeAttrs, ; FEA_GEODE_ATTR
size DirPathInfo, ; FEA_PATH_INFO
size FileID, ; FEA_FILE_ID
0, ; FEA_DESKTOP_INFO
size DriveExtendedStatus,; FEA_DRIVE_STATUS
size word, ; FEA_DISK
0, ; FEA_DOS_NAME
0, ; FEA_OWNER
0, ; FEA_RIGHTS
size FileID ; FEA_TARGET_FILE_ID
.assert (length extAttrSizes) eq (FEA_LAST_VALID+1)
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEAddAttrs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Merge an array of attribute descriptors into the
FileEnumCallbackData block being built, being certain
not to duplicate one.
CALLED BY: FileEnum
PASS: ds:si = array of attributes to merge in
es = segment of FileEnumCallbackData
ss:bp = inherited stack frame et al
RETURN: carry set on error:
ax = ERROR_INSUFFICIENT_MEMORY
carry clear if ok:
es = adjusted for any needed reallocations
DESTROYED: si, ax, cx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/20/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEAddAttrs proc near
uses bx
.enter inherit FileEnum
sub si, size FileExtAttrDesc
attrLoop:
;
; Advance to the next attribute to merge in.
;
add si, size FileExtAttrDesc
nextAttr:
;
; Fetch next attribute to merge in.
;
mov ax, ds:[si].FEAD_attr
cmp ax, FEA_END_OF_LIST
je done
;
; See if it already exists in the destination array.
;
clr di
call FELocateAttr
EC < jnc addAttr >
EC < mov bx, ax >
EC < tst cs:[extAttrSizes][bx] ; fixed size? >
EC < jnz attrLoop ; yes -- no point in comparing>
EC < mov ax, ds:[si].FEAD_size ; make sure this descriptor>
EC < ; has the same size as any>
EC < ; previous descriptor >
EC < cmp es:[di].FEAD_size, ax >
EC < je attrLoop >
EC < ERROR EXT_ATTR_VALUE_SIZES_DONT_MATCH >
EC <addAttr: >
NEC< jc attrLoop >
;
; Attribute not there yet, so we must add it to the destination.
; If the thing is of a fixed size (extAttrSizes[ax] != 0), we must
; pass that size off to the IFS driver, else it is likely to complain.
; We deal more gracefully with a size smaller than the fixed size
; when we compare or return attributes.
;
mov_tr bx, ax ; bx <- FileExtendedAttribute
mov al, cs:[extAttrSizes][bx]
cbw ; clear ah (all sizes < 128)
tst ax
jnz haveSize ; => is fixed size
mov ax, ds:[si].FEAD_size ; note more bytes needed for
; value storage
haveSize:
push ax ; save attribute size for after
; the descriptor is copied
add ss:[locals].FEL_valueSpaceReqd, ax
;
; Enlarge the block if we need to.
;
mov bx, ss:[locals].FEL_fecdHandle
mov ax, MGIT_SIZE
call MemGetInfo
mov_trash cx, ax ; cx <- current size of FECD block
mov ax, ss:[locals].FEL_fecdAttrSize
add ax, size FileExtAttrDesc; figure size required
cmp ax, cx ; block big enough?
jbe copyItPlease ; yup -- just copy
shl cx ; double the block size, as there
; will also be attribute values to
; deal with, so we might as well
; allocate all the space at once...
mov_trash ax, cx
clr cx
call MemReAlloc
jc error
; XXX: check for errors
mov es, ax ; point ES to the block's new location
copyItPlease:
;
; Copy the attribute descriptor to the block and terminate the
; array properly.
;
mov di, ss:[locals].FEL_fecdAttrSize
mov cx, size FileExtAttrDesc
sub di, size FEAD_attr
rep movsb
;
; Fetch the size the IFS driver should use off the stack...
;
pop es:[di-size FileExtAttrDesc].FEAD_size
CheckHack <offset FEAD_attr eq 0>
mov ax, FEA_END_OF_LIST
stosw
mov ss:[locals].FEL_fecdAttrSize, di
jmp nextAttr ; si already moved to next
; attr, so just go to
; nextAttr, not attrLoop
done:
.leave
ret
error:
pop ax ; clear size-to-use
mov ax, ERROR_INSUFFICIENT_MEMORY
jmp done
FEAddAttrs endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEAllocValueSpace
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Allocate the space required to hold the file's attribute
values, apportioning that space among the attributes
in the array passed.
CALLED BY: FileEnum
PASS: es = segment of FileEnumCallbackData block
ss:bp = inherited local frame
RETURN: carry set on error:
ax = ERROR_INSUFFICIENT_MEMORY
carry clear if successful:
es = adjusted
all entries in the attribute array given space.
DESTROYED: ax, cx, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/20/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEAllocValueSpace proc near
uses bx
.enter inherit FileEnum
mov bx, ss:[locals].FEL_fecdHandle
mov ax, ss:[locals].FEL_fecdAttrSize
add ax, ss:[locals].FEL_valueSpaceReqd
clr cx
call MemReAlloc
jc error
mov es, ax
mov cx, ss:[locals].FEL_fecdAttrSize
clr si
allocLoop:
cmp es:[si].FEAD_attr, FEA_END_OF_LIST
je done
;
; Point the descriptor at its alloted space. ax = block segment,
; cx = offset of next free byte in block.
;
mov es:[si].FEAD_value.offset, cx
mov es:[si].FEAD_value.segment, ax
;
; Adjust the free offset by the size of the attribute's value, and
; shift our attention to the next attribute.
;
add cx, es:[si].FEAD_size
add si, size FileExtAttrDesc
jmp allocLoop
done:
.leave
ret
error:
mov ax, ERROR_INSUFFICIENT_MEMORY
jmp done
FEAllocValueSpace endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FECompareAttrs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Compare the values required by the source array of
extended attributes against those actually found for
the file.
CALLED BY: FileEnumCallback
PASS: ds:si = file's actual attributes
es:di = attributes against which to match.
RETURN: carry set if mismatch.
DESTROYED: ax, cx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/20/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FECompareAttrs proc near
uses si, di, dx, bx
.enter
xchg si, di
segxchg ds, es
compareLoop:
;
; If made it to the end of the list, all our conditions are met.
;
mov bx, ds:[si].FEAD_attr
cmp bx, FEA_END_OF_LIST
je done
;
; See if we can find this attribute in those we've got for the file.
;
push di
call FELocateAttr
EC < ERROR_NC MATCH_ATTRIBUTE_NOT_IN_FILE_ATTRIBUTE_ARRAY>
cmp es:[di].FEAD_value.segment, 0
jz mismatch ; if FSD has marked file as not
; having such an attribute, it can't
; possibly match what was specified...
mov cx, ds:[si].FEAD_size
shl bx
jmp cs:[extAttrCompares][bx]
extAttrCompares nptr compareBinary, ; FEA_MODIFICATION
compareBits, ; FEA_FILE_ATTR
compareBinary, ; FEA_SIZE
compareBinary, ; FEA_FILE_TYPE
compareBits, ; FEA_FLAGS
compareBinary, ; FEA_RELEASE
compareBinary, ; FEA_PROTOCOL
compareBinary, ; FEA_TOKEN
compareBinary, ; FEA_CREATOR
compareString, ; FEA_USER_NOTES
compareString, ; FEA_NOTICE
compareBinary, ; FEA_CREATION
compareString, ; FEA_PASSWORD
compareBinary, ; FEA_CUSTOM
compareString, ; FEA_NAME
compareBits, ; FEA_GEODE_ATTR
compareBits, ; FEA_PATH_INFO
compareBinary, ; FEA_FILE_ID
compareBinary, ; FEA_DESKTOP_INFO
compareBits, ; FEA_DRIVE_STATUS
compareBinary, ; FEA_DISK
compareString, ; FEA_DOS_NAME
compareString, ; FEA_OWNER
compareString, ; FEA_RIGHTS
compareBinary ; FEA_TARGET_FILE_ID
.assert (length extAttrCompares) eq (FEA_LAST_VALID+1)
compareString:
;
; Compare two null-terminated strings for equality.
;
push ds, si
lds si, ds:[si].FEAD_value
mov di, es:[di].FEAD_value.offset
compareStringLoop:
lodsb ; al <- attr char
scasb ; matches value char?
jne stringCompareFail ; nope => bail
tst al ; end of string?
loopne compareStringLoop ; loop if non-zero
pop ds, si ; recover match attr
nextAttr:
pop di ; recover file attr base
add si, size FileExtAttrDesc
jmp compareLoop
stringCompareFail:
pop ds, si
mismatch:
pop di
stc
done:
segxchg ds, es
.leave
ret
compareBinary:
;
; Compare two sets of binary data for equality.
;
push si, ds
lds si, ds:[si].FEAD_value
mov di, es:[di].FEAD_value.offset
repe cmpsb
pop si, ds
jne mismatch
jmp nextAttr
compareBits:
;
; Perform bitmask comparisons.
; ax <- bits that should be set
; dx <- bits that should *not* be set
; cx <- actual value for the attribute.
;
mov ax, ds:[si].FEAD_value.offset
mov dx, ds:[si].FEAD_value.segment
cmp cx, 1 ; single byte value?
mov di, es:[di].FEAD_value.offset
mov cx, es:[di]
jne checkWord ; no -- use entire registers
test cl, dl ; any set that shouldn't be?
jnz mismatch ; yup -- honk
not cl ; invert file value so any that should
; be set but aren't end up set...
test cl, al ; any not set that should be?
jnz mismatch ; yup -- honk
jmp nextAttr
checkWord:
test cx, dx ; any set that shouldn't be?
jnz mismatch ; yup -- honk
not cx ; invert file value so any that should
; be set but aren't end up set...
test cx, ax ; any not set that should be?
jnz mismatch ; yup -- honk
jmp nextAttr
FECompareAttrs endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FECopyAttrs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copy the extended attributes from the array of file attributes
to the new entry in the return buffer.
CALLED BY: FileEnumCallback
PASS: ds:si = array of file's attributes
es:di = base of entry in return buffer to fill in
ss:bp = inherited stack frame
RETURN: nothing
DESTROYED: ax, cx, dx, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/20/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FECopyAttrs proc near
uses bx, ds
.enter inherit FileEnum
push es, di
mov di, si
mov si, ss:[params].FEP_returnAttrs.offset
attrLoop:
;
; Reload segment registers as we need them for locating the next
; attribute in the file attrs array.
;
segmov es, ds
mov ds, ss:[params].FEP_returnAttrs.segment
;
; If we hit the end of the returnAttrs array, we're done.
;
cmp ds:[si].FEAD_attr, FEA_END_OF_LIST
je done
;
; Nope. Find the attribute in the FECD segment (it'd better be there...)
;
push di
call FELocateAttr
EC < ERROR_NC RETURN_ATTRIBUTE_NOT_IN_FILE_ATTRIBUTE_ARRAY>
mov bx, di
pop di
;
; Recover the base of the entry in the return buffer.
;
pop ax, cx
;
; Save the attribute array offsets.
;
push si, di
;
; Play with things to prepare for the copy...this is ugly
;
mov dx, ds:[si].FEAD_value.offset
mov di, ds:[si].FEAD_size
mov si, es:[bx].FEAD_value.offset
; ax:cx = base of return entry
; ds:si = value for file
; ds:bx = attribute found for file
; di = size of return area
; dx = offset into return entry at which to store result
add dx, cx ; dx <- offset to store value
xchg di, dx ; di <- offset to store, dx <- size of
; destination
segmov ds, es ; ds <- FECD segment
EC < cmp dx, ds:[bx].FEAD_size >
EC < ERROR_B RETURN_AREA_TOO_SMALL_FOR_ATTRIBUTE >
mov es, ax ; es <- return buffer segment
xchg cx, dx ; cx <- size of return area,
; dx <- base of return buffer entry
cmp ds:[bx].FEAD_value.segment,0 ; any value for file?
jz zeroAttr ; no -- zero return
; ds:si = value for file
; es:di = return area for attribute
; cx = size of return area for attribute
rep movsb
nextAttr:
pop si, di ; si <- return attr, di <- file attr
; base
push es, dx ; save return entry base for next loop
;
; Advance to next entry in returnAttrs array.
;
add si, size FileExtAttrDesc
jmp attrLoop
done:
pop es, di
.leave
ret
;--------------------
zeroAttr:
;
; No value for that attribute in the file, so just zero the return area.
;
clr al
rep stosb
jmp nextAttr
FECopyAttrs endp
if ERROR_CHECK
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FECheckReturnAttrs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: EC-only function to make sure the passed returnAttrs array
makes sense.
CALLED BY: FileEnum
PASS: ss:bp = inherited stack frame
RETURN: only if array is valid
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/23/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FECheckReturnAttrs proc near
uses ds, si, ax, bx
.enter inherit FileEnum
lds si, ss:[params].FEP_returnAttrs
checkLoop:
mov bx, ds:[si].FEAD_attr
cmp bx, FEA_END_OF_LIST
je done
cmp bx, FEA_MULTIPLE
ERROR_E FEA_MULTIPLE_MAY_NOT_BE_PART_OF_AN_ATTRIBUTE_ARRAY
cmp bx, FEA_LAST_VALID
ERROR_A ILLEGAL_EXTENDED_ATTRIBUTE
mov al, cs:extAttrSizes[bx]
tst al ; variable-sized?
jz checkBounds ; yes -- don't check
cbw
cmp ax, ds:[si].FEAD_size
ERROR_NE EXT_ATTR_SIZE_DOESNT_MATCH_DEFINED_SIZE
checkBounds:
mov ax, ds:[si].FEAD_value.offset
add ax, ds:[si].FEAD_size
cmp ax, ss:[params].FEP_returnSize
ERROR_A RETURN_AREA_EXTENDS_PAST_RETURN_ENTRY_SIZE
add si, size FileExtAttrDesc
jmp checkLoop
done:
.leave
ret
FECheckReturnAttrs endp
endif
fileEnumStandardReturnArrays nptr.FileExtAttrDesc \
fesrtaCountOnly, ; FESRT_COUNT_ONLY
fesrtaDosInfo, ; FESRT_DOS_INFO
fesrtaName, ; FESRT_NAME
fesrtaNameAndAttr ; FESRT_NAME_AND_ATTR
fesrtaCountOnly FileExtAttrDesc \
<FEA_END_OF_LIST>
fesrtaDosInfo FileExtAttrDesc \
<FEA_FILE_ATTR, FEDI_attributes, size FEDI_attributes>,
<FEA_MODIFICATION, FEDI_modified, size FEDI_modified>,
<FEA_SIZE, FEDI_fileSize, size FEDI_fileSize>,
<FEA_NAME, FEDI_name, size FEDI_name>,
<FEA_PATH_INFO, FEDI_pathInfo, size FEDI_pathInfo>,
<FEA_END_OF_LIST>
fesrtaName FileExtAttrDesc \
<FEA_NAME, 0, size FileLongName>,
<FEA_END_OF_LIST>
fesrtaNameAndAttr FileExtAttrDesc \
<FEA_FILE_ATTR, FENAA_attr, size FENAA_attr>,
<FEA_NAME, FENAA_name, size FENAA_name>,
<FEA_END_OF_LIST>
fileEnumStandardCallbacks nptr.far \
FileEnumWildcard ; FESC_WILDCARD
fileEnumStandardCallbackAttrs nptr.FileExtAttrDesc \
fescaName ; FESC_WILDCARD
fescaName FileExtAttrDesc \
<FEA_NAME, 0, FILE_LONGNAME_BUFFER_SIZE>,
<FEA_END_OF_LIST>
;
; Additional attribute arrays needed for dealing with FESF bits.
;
feFileTypeAttr FileExtAttrDesc \
<FEA_FILE_TYPE, 0, size GeosFileType>,
<FEA_END_OF_LIST>
feFileAttrAttr FileExtAttrDesc \
<FEA_FILE_ATTR, 0, size FileAttrs>,
<FEA_END_OF_LIST>
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEFinishParams
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Finish filling out the FileEnumParams, dealing with the
receipt of FileEnumStandardReturnType and
FileEnumStandardCallback constants.
CALLED BY: FileEnum
PASS: inherited stack frame with parameters and locals set up.
RETURN: nothing
DESTROYED: ax, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/21/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEFinishParams proc near
.enter inherit FileEnum
;
; If caller wants standard return structure, replace FEP_returnAttrs
; with a far pointer to one of the arrays we define.
;
cmp ss:[params].FEP_returnAttrs.segment, 0
jnz haveRetAttrs
mov si, ss:[params].FEP_returnAttrs.offset
EC < cmp si, FileEnumStandardReturnType >
EC < ERROR_AE INVALID_STANDARD_RETURN_TYPE >
shl si
mov si, cs:[fileEnumStandardReturnArrays][si]
mov ss:[params].FEP_returnAttrs.offset, si
mov ss:[params].FEP_returnAttrs.segment, cs
haveRetAttrs:
EC < call FECheckReturnAttrs >
test ss:[params].FEP_searchFlags, mask FESF_CALLBACK
jz done
cmp ss:[params].FEP_callback.segment, 0
jnz done
mov si, ss:[params].FEP_callback.offset
EC < cmp si, FileEnumStandardCallback >
EC < ERROR_AE INVALID_STANDARD_CALLBACK_TYPE >
shl si
mov ax, cs:[fileEnumStandardCallbacks][si]
mov ss:[params].FEP_callback.offset, ax
mov ss:[params].FEP_callback.segment, SEGMENT_CS
mov ss:[params].FEP_callbackAttrs.segment, 0
mov ax, cs:[fileEnumStandardCallbackAttrs][si]
tst ax
jz done
mov ss:[params].FEP_callbackAttrs.offset, ax
mov ss:[params].FEP_callbackAttrs.segment, cs
done:
.leave
ret
FEFinishParams endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEFormFECD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Form the FileEnumCallbackData segment for the whole
operation.
CALLED BY: FileEnum
PASS: inherited stack frame set up
RETURN: carry set if error
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/21/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEFormFECD proc near
.enter inherit FileEnum
;
; Zero-initialize the buffer handle so caller knows if we allocated
; the beast or not.
;
mov ss:[locals].FEL_fecdHandle, 0
;
; Allocate initial space for the FileEnumCallbackData block we use
; to talk about files being enumerated.
;
mov ax, FECD_INITIAL_SIZE
mov cx, mask HAF_LOCK shl 8 or mask HF_SWAPABLE
call MemAllocFar
jc done
;
; Set up local variables for the creation of the FECD block.
; fecdAttrSize is 2 b/c that's all that FEAD_attr requires, and that's
; all we store for the end-of-list descriptor. This is depended on
; in FEAddAttrs, so don't get any ideas... :)
;
mov es, ax
mov ss:[locals].FEL_fecdHandle, bx
mov ss:[locals].FEL_valueSpaceReqd, 0
mov ss:[locals].FEL_fecdAttrSize, 2
mov es:[0].FEAD_attr, FEA_END_OF_LIST
;
; Copy the attribute descriptors needed for the return buffer into the
; FECD.
;
lds si, ss:[params].FEP_returnAttrs
call FEAddAttrs
jc done
;
; If caller has provided attributes we're to match (caller might not
; have provided any, as it might want all files, or might be leaving
; the decision up to its own callback routine), merge them into the
; FECD as well.
;
cmp ss:[params].FEP_matchAttrs.segment, 0
jz checkCallbackAttrs
lds si, ss:[params].FEP_matchAttrs
call FEAddAttrs
jc done
checkCallbackAttrs:
;
; If caller has specified a callback routine and additional attributes
; that are to be fetched for the callback to use, merge them into the
; FECD as well.
;
test ss:[params].FEP_searchFlags, mask FESF_CALLBACK
jz checkSearchFlags
cmp ss:[params].FEP_callbackAttrs.segment, 0
jz checkSearchFlags
lds si, ss:[params].FEP_callbackAttrs
call FEAddAttrs
jc done
checkSearchFlags:
;
; See if we need to get the geos file type for every file. It depends
; on the search flags. If all the bits FESF_NON_GEOS, FESF_GEOS_EXECS,
; and FESF_GEOS_NON_EXECS are set, we can forego the file type, as all
; files will match.
;
mov al, ss:[params].FEP_searchFlags
andnf al, FILE_ENUM_ALL_FILE_TYPES
cmp al, FILE_ENUM_ALL_FILE_TYPES
je ensureFileAttr
segmov ds, cs
mov si, offset feFileTypeAttr
call FEAddAttrs
jc done
ensureFileAttr:
;
; We always need to get FEA_FILE_ATTR so we can skip comparing
; the attributes of a directory against the matchAttrs, thus allowing
; directories to be displayed in a file selector that's matching
; based on the file token.
;
segmov ds, cs
mov si, offset feFileAttrAttr
call FEAddAttrs
jc done
;
; First deal with our callback and the possible need for another
; buffer for file names, etc.
;
call FESetCallbackEtc
jc done
;
; All file attributes we'll be wanting, either for comparison,
; for return, or for our callback, are now stored in the FECD array
; pointed to by ES. Allocate the appropriate number of bytes after
; the array and point the individual FEAD entries to their allotted
; locations within the block.
;
call FEAllocValueSpace
done:
.leave
ret
FEFormFECD endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEAllocReturnBuffer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Allocate the initial return buffer.
CALLED BY: FileEnum
PASS: inherited stack frame
RETURN: carry set if buffer couldn't be allocated
DESTROYED: ax, bx, cx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/21/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEAllocReturnBuffer proc near
.enter inherit FileEnum
mov ss:[locals].FEL_retBufHandle, 0
;
; Allocate the initial return buffer. If the caller has placed a limit
; on the number of entries we're allowed to return, just allocate that
; many, as they've probably got a better idea than we of the number of
; files to expect.
;
; If they've placed no limit, use a reasonable number to start off with.
;
mov ax, ss:[params].FEP_bufSize
cmp ax, FE_BUFSIZE_UNLIMITED
jne allocInitialBuffer
mov ax, FE_INITIAL_BUF_NUMBER
allocInitialBuffer:
mov dx, ss:[params].FEP_returnSize
mul dx
EC < ERROR_C INITIAL_BUFFER_SIZE_TOO_LARGE >
tst ax ;
jz noReturnValuesWanted
;
; See if the caller wants some space left at the front of the
; block for a header of its own devising.
;
test ss:[params].FEP_searchFlags, mask FESF_LEAVE_HEADER
jz allocBlock
addHeaderIn:
;
; Yes! Add the header into the initial block size and set it as the
; initial offset for the return buffer.
;
mov cx, ss:[params].FEP_headerSize
add ax, cx
mov ss:[locals].FEL_curRetOff, cx
allocBlock:
mov cx, (mask HAF_ZERO_INIT shl 8) or mask HF_SWAPABLE or \
mask HF_SHARABLE
call MemAllocFar
jc done
; XXX: could possibly have reduced our request, but
; our request is usually going to be fairly small, and
; if the system can't fulfill it, it's probably going
; to die soon anyway, so...
mov ss:[locals].FEL_retBufHandle, bx
done:
.leave
ret
noReturnValuesWanted:
;
; Initialize appropriate things to 0.
;
mov ss:[params].FEP_bufSize, ax
mov ss:[params].FEP_returnSize, ax
test ss:[params].FEP_searchFlags, mask FESF_LEAVE_HEADER
jnz addHeaderIn
jmp done
FEAllocReturnBuffer endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FECleanup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Clean up after a FileEnum and load registers for return
CALLED BY: FileEnum
PASS: inherited stack frame
RETURN: bx = handle of return buffer
cx = number of entries found
dx = number of entries missed
di = new real skip count, if FESF_REAL_SKIP, else
untouched
flags, ax = as passed
FECD freed
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/21/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FECleanup proc near
uses ax
.enter inherit FileEnum
pushf ; save error flag
push ax
;
; Deal with FESF_REAL_SKIP, leaving DI as it was initially
; passed in unless FESF_REAL_SKIP is set, in which case we return
; an updated real skip count as set up by FEEnumCallback...unless
; there were no missed files, of course...in which case it shouldn't
; matter as the caller shouldn't call us back, but...
;
test ss:[params].FEP_searchFlags, mask FESF_REAL_SKIP
jz freeFECD
mov di, ss:[params].FEP_skipCount
cmp ss:[locals].FEL_numMissed, 0
jnz freeFECD ; => FEP_skipCount is correct
sub di, ss:[locals].FEL_realSkipCount
; ... else we must adjust by the number
; enumerated this time, whose negative
; is in FEL_realSkipCount.
freeFECD:
;
; Now we're done, free up callback data segment.
;
mov bx, ss:[locals].FEL_fecdHandle
call MemFree
;
; Free up the filesSeen buffer, if it was allocated.
;
mov bx, ss:[locals].FEL_filesSeen
tst bx
jz checkReturnBuffer
call MemFree
checkReturnBuffer:
;
; If there's actually a return buffer, shrink it to fit the number
; of entries we found.
;
mov bx, ss:[locals].FEL_retBufHandle
tst bx
jz loadRemainingRegisters
mov ax, ss:[locals].FEL_curRetOff
tst ax
jz noEntriesFound
clr cx
call MemReAlloc
loadRemainingRegisters:
;
; Load registers for return.
;
mov cx, ss:[locals].FEL_numFound
mov dx, ss:[locals].FEL_numMissed
if TEST_FILE_ENUM_SPEED
push bx
call TimerGetCount
sub ax, cs:[fileEnumTime]
mov cs:[fileEnumTime], ax
pop bx
endif
done::
pop ax
popf
jnc exit
;
; Don't return any buffer on error.
;
add dx, cx ; indicate number missed,
; owing to error
clr cx ; no files found
tst bx ; any buffer to free
jz error ; no
call MemFree
clr bx ; return handle of 0
error:
stc ; signal error again
exit:
.leave
ret
noEntriesFound:
;
; If no entries were found, free the return buffer and return bx==0
;
call MemFree
clr bx
jmp loadRemainingRegisters
FECleanup endp
COMMENT @----------------------------------------------------------------------
FUNCTION: FileEnum
DESCRIPTION: Enumerate files in a directory.
CALLED BY: GLOBAL
PASS:
FileEnumParams structure on stack:
(note: ss:sp *must* be pointing to FileEnumParams)
stack parameter passing example:
sub sp, size FileEnumParams
mov bp, sp
mov ss:[bp].FEP_* ; fill in params...
...
call FileEnum
jc error ; handle error
<use FileEnum results> ; success!!
RETURN:
carry - set if error
ax - error code (if an error)
bx - handle of buffer created, if any. If no files found, or if
error occurred, no buffer is returned (bx is 0)
cx - number of matching files returned in buffer
dx - number of matching files that would not fit in buffer
(given maximum of FEP_bufSize)
(If FEP_bufSize is set to 0, this is a count of the matching
files in the directory)
(in buffer) - structures (of type requested by FEP_returnAttrs) for
files found (if filesystem is case-insensitive,
native names returned in UPPER case)
if FESF_REAL_SKIP bit set:
di - updated real skip count (matching file or not)
if FESF_REAL_SKIP bit clear:
di - preserved
FileEnumParams popped off the stack
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/88 Initial version
Adam 4/89 Added skip count
brianc 1/90 support for GEOS files
------------------------------------------------------------------------------@
if TEST_FILE_ENUM_SPEED
include timedate.def
fileEnumTime word 0
endif
FileEnum proc far params:FileEnumParams
locals local FileEnumLocals
uses ds, si, es
.enter
if TEST_FILE_ENUM_SPEED
push ax, bx
call TimerGetCount
mov cs:[fileEnumTime], ax
pop ax, bx
endif
;
; Save DI in case !FESF_REAL_SKIP
;
push di
;------------------------------------------------------------
;
; FLESH OUT PARAMETERS
;
;------------------------------------------------------------
call FEFinishParams
;------------------------------------------------------------
;
; MERGE EXTENDED ATTRIBUTE DESCRIPTORS
;
;------------------------------------------------------------
call FEFormFECD
LONG jc insufficientMemoryFreeFECD
clr ax
mov ss:[locals].FEL_numFound, ax
mov ss:[locals].FEL_numMissed, ax
mov ss:[locals].FEL_retBufHandle, ax
mov ss:[locals].FEL_curRetOff, ax
;
; Deal with FESF_REAL_SKIP, setting FEL_realSkipCount to 0 if
; FESF_REAL_SKIP isn't set.
;
test ss:[params].FEP_searchFlags, mask FESF_REAL_SKIP
jz setRealSkip
mov ax, ss:[params].FEP_skipCount
setRealSkip:
mov ss:[locals].FEL_realSkipCount, ax
call FEAllocReturnBuffer
jc insufficientMemoryFreeFECD
;
; If we're going to be using a callback, we need to lock
; LocalUpCaseChar into memory. This will prevent us from deadlocking
; when the callback calls FileEnumWildcard while LocalUpCaseChar is
; not resident in memory. (FileEnumWildcard -> FEWildcard ->
; FEStringMatch -> LocalUpCaseChar)
;
NOFXIP < test ss:[params].FEP_searchFlags, mask FESF_CALLBACK >
NOFXIP < jz doIt >
NOFXIP < mov bx, vseg LocalUpcaseChar >
NOFXIP < mov ax, offset LocalUpcaseChar >
NOFXIP < call MemLockFixedOrMovable >
;------------------------------------------------------------
;
; IMPLEMENTATION
;
;------------------------------------------------------------
doIt::
;
; Figure the disk handle for the current path. This will be a member
; of the StandardPath enumerated type if the current path is in a
; logical directory whose paths we must enumerate.
;
segmov ds, es ; ds <- FECD for the duration
call FEFetchCurPathDisk
jc enumAlongPath
call FEEnumCurrentPath
jmp done
enumAlongPath:
;
; Current path is a standard one, so we must do the usual traversal of
; all the physical paths bound to this logical/standard one.
;
push cx
clr cx ; ds:dx isn't a path
call InitForPathEnum
pop cx
jc dealWithSpecials
pathLoop:
;
; Advance to the next directory on the path for this logical path.
;
call SetDirOnPath
jc finishPathEnumAndDealWithSpecials
call FEEnumCurrentPath
jnc pathLoop
clc ; signal error...[sic]
finishPathEnumAndDealWithSpecials:
call FinishWithPathEnum
cmc ; set error flag correctly...
jc done ; and skip specials if error
; during previous ordeal
dealWithSpecials:
call FEEnumSpecials
done:
;------------------------------------------------------------
;
; CLEAN UP
;
;------------------------------------------------------------
;
; If we used a callback function, we need to unlock LocalUpcaseChar
; which we locked above.
;
NOFXIP < test ss:[params].FEP_searchFlags, mask FESF_CALLBACK >
NOFXIP < jz cleanUp >
NOFXIP < push ax, bx >
NOFXIP < mov bx, vseg LocalUpcaseChar >
NOFXIP < mov ax, offset LocalUpcaseChar >
NOFXIP < call MemUnlockFixedOrMovable >
NOFXIP < pop ax, bx >
NOFXIP <cleanUp: >
pop di ; recover passed DI, in case not
; FESF_REAL_SKIP
call FECleanup
exit:
.leave
ret @ArgSize
insufficientMemoryFreeFECD:
mov bx, ss:[locals].FEL_fecdHandle
tst bx
jz fecdFreed
call MemFree
fecdFreed:
mov bx, ss:[locals].FEL_filesSeen
tst bx
jz insufficientMemoryForFECD
call MemFree
insufficientMemoryForFECD:
mov ax, ERROR_INSUFFICIENT_MEMORY
stc
jmp exit
FileEnum endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FileEnumPtr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Performs the same function as FileEnum, but accepts a
pointer to a static FileEnumParams structure, taking
care of locking down any virtual segments, etc.
CALLED BY: GLOBAL
PASS: ds:si = FileEnumParams
RETURN: carry clear if ok:
bx = buffer holding structures allocated (bogus
if no files found)
cx = number of files found
dx = number of matching files that wouldn't fit,
given maximum of FEP_bufSize (if FEP_bufSize
is 0, this is a count of the matching files
in the directory)
if FESF_REAL_SKIP bit set:
di = updated real skip count (matching file
or not)
if FESF_REAL_SKIP bit clear:
di = preserved
carry set if error:
ax = error code
bx, cx, dx = destroyed
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 1/22/92 Initial version
sh 5/12/94 XIP'ed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
CopyStackCodeXIP segment resource
FileEnumPtr proc far
;
; Copy the whole structure onto the stack first.
;
push ds, si
mov cx, size FileEnumParams
call SysCopyToStackDSSI
call FileEnumPtrReal
call SysRemoveFromStack
pop ds, si
ret
FileEnumPtr endp
CopyStackCodeXIP ends
else
FileEnumPtr proc far
FALL_THRU FileEnumPtrReal
FileEnumPtr endp
endif
FileEnumPtrReal proc far
uses bp
.enter
;
; Copy the whole structure onto the stack first.
;
sub sp, size FileEnumParams
mov bp, sp
push es, di
segmov es, ss
mov di, bp
mov cx, size FileEnumParams
push si
rep movsb
pop si
pop es, di
;
; Now lock anything that needs locking. Note that 0 is less than
; MAX_SEGMENT and so won't be touched by MemLockFixedOrMovable.
;
mov bx, ss:[bp].FEP_returnAttrs.segment
call MemLockFixedOrMovable
mov ss:[bp].FEP_returnAttrs.segment, ax
mov bx, ss:[bp].FEP_matchAttrs.segment
call MemLockFixedOrMovable
mov ss:[bp].FEP_matchAttrs.segment, ax
test ss:[bp].FEP_searchFlags, mask FESF_CALLBACK
jz callbackHandled
mov bx, ss:[bp].FEP_callback.segment
if FULL_EXECUTE_IN_PLACE
; On Full-XIP systems, don't lock down code resources in the XIP
; image, just call the callback using ProcCallFixedOrMovable.
tst bx
jz checkWildcard
cmp bh, high MAX_SEGMENT
jb noLock
shl bx, 1
shl bx, 1
shl bx, 1
shl bx, 1
cmp bx, LAST_XIP_RESOURCE_HANDLE
jbe noLock
call MemLock
mov ss:[bp].FEP_callback.segment, ax
noLock:
else
call MemLockFixedOrMovable
mov ss:[bp].FEP_callback.segment, ax
tst ax ; standard callback?
jz checkWildcard ; yes => no attrs, but cbData1
; might be wildcard pattern
endif
mov bx, ss:[bp].FEP_callbackAttrs.segment
call MemLockFixedOrMovable
mov ss:[bp].FEP_callbackAttrs.segment, ax
callbackHandled:
;
; Call FileEnum to perform the actual work.
;
call FileEnum
;
; Save the error flag and buffer handle and unlock the things we
; locked before.
;
pushf
push bx
mov bx, ds:[si].FEP_returnAttrs.segment
call MemUnlockFixedOrMovable
mov bx, ds:[si].FEP_matchAttrs.segment
call MemUnlockFixedOrMovable
test ds:[si].FEP_searchFlags, mask FESF_CALLBACK
jz callbackUnlockHandled
mov bx, ds:[si].FEP_callback.segment
if FULL_EXECUTE_IN_PLACE
; On Full-XIP systems, don't unlock the far pointer to the callback
; routine, as it wasn't locked.
tst bx
jz checkWildcardUnlock
cmp bh, high MAX_SEGMENT
jb noUnlock
shl bx, 1
shl bx, 1
shl bx, 1
shl bx, 1
cmp bx, LAST_XIP_RESOURCE_HANDLE
jbe noUnlock
call MemUnlock
noUnlock:
else
call MemUnlockFixedOrMovable
tst bx ; standard callback?
jz checkWildcardUnlock ; yes => no attrs, but cbData1
; might be wildcard pattern
endif
mov bx, ds:[si].FEP_callbackAttrs.segment
call MemUnlockFixedOrMovable
callbackUnlockHandled:
;
; Restore the buffer handle and error flag for return...
;
pop bx
popf
.leave
ret
;
; Deal with locking and unlocking callback data for callbacks we
; understand.
;
checkWildcard:
CheckHack <FESC_WILDCARD eq 0>
cmp ss:[bp].FEP_callback.offset, FESC_WILDCARD
jbe lockCBData1
test ss:[bp].FEP_searchFlags, mask FESF_LOCK_CB_DATA
jz callbackHandled
mov bx, ss:[bp].FEP_cbData2.segment
call MemLockFixedOrMovable
mov ss:[bp].FEP_cbData2.segment, ax
lockCBData1:
mov bx, ss:[bp].FEP_cbData1.segment
call MemLockFixedOrMovable
mov ss:[bp].FEP_cbData1.segment, ax
jmp callbackHandled
checkWildcardUnlock:
CheckHack <FESC_WILDCARD eq 0>
cmp ds:[si].FEP_callback.offset, FESC_WILDCARD
jbe unlockCBData1
test ds:[si].FEP_searchFlags, mask FESF_LOCK_CB_DATA
jz callbackUnlockHandled
mov bx, ds:[si].FEP_cbData2.segment
call MemUnlockFixedOrMovable
unlockCBData1:
mov bx, ds:[si].FEP_cbData1.segment
call MemUnlockFixedOrMovable
jmp callbackUnlockHandled
FileEnumPtrReal endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEEnumCurrentPath
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Ask the appropriate FSD to enumerate all the files in the
current path.
CALLED BY: FileEnum
PASS: ds = segment of FileEnumCallbackData
ss:bp = inherited local variables
RETURN: carry set on error:
ax = error code
DESTROYED: bx, cx, dx, si, es
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/24/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEEnumCurrentPath proc near
.enter inherit FileEnum
call FileLockInfoSharedToES ; es <- FSIR for the duration
;
; Extract the disk handle for the current path into SI for
; DiskLockCallFSD to use.
;
call FEFetchCurPathDisk
mov si, bx
;
; Call the FSD's DR_FS_FILE_ENUM function to do all the hard work.
;
mov bx, bp ; pass inherited frame in BX since
; DiskLockCallFSD destroys BP
push bp
mov di, DR_FS_FILE_ENUM
mov cx, SEGMENT_CS
mov dx, ss:[locals].FEL_fsdCallback ; cx:dx <- our callback
clr al ; allow disk lock to be aborted
call DiskLockCallFSD
;
; Reload appropriate registers...
;
pop bp ; bp <- inherited frame (pushed so BX
; can safely be destroyed by the FSD
; and the callback)
call FSDUnlockInfoShared
.leave
ret
FEEnumCurrentPath endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEEnumCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Callback function for FSD when it's found a file we're to
examine.
CALLED BY: FS Driver
PASS: ds = segment of FileEnumCallbackData
ss:bp = inherited stack frame
RETURN: carry set to stop enumerating files:
ax = error code
DESTROYED: es, ax, bx, cx, dx, di, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/24/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEEnumCallback proc far
.enter inherit FileEnum
;
; If performing "real skip", skip this file while FEL_realSkipCount
; remains non-negative.
;
dec ss:[locals].FEL_realSkipCount
LONG jns skipIt
;
; See if the thing is a directory. If it is and FESF_DIRS is set,
; we accept it unconditionally, else we pass it through the same
; matching process as a regular file.
;
mov ax, FEA_FILE_ATTR
clr si
call FileEnumLocateAttr
EC < ERROR_C MISSING_FILE_ATTR_ATTRIBUTE_IN_CALLBACK_DATA >
EC < cmp es:[di].FEAD_value.segment, 0 >
EC < ERROR_Z MISSING_FILE_ATTR_ATTRIBUTE_IN_CALLBACK_DATA >
mov di, es:[di].FEAD_value.offset
test {FileAttrs}es:[di], mask FA_SUBDIR
jz checkMatchAttrs ; not dir, so check matchAttrs array
;
; If a dir, bail if we're not looking for them. The reverse isn't
; necessarily true (i.e., it's not a dir and we are looking for
; them) as we might be looking for other stuff, too.
;
isDir::
test ss:[params].FEP_searchFlags, mask FESF_DIRS
jnz checkCallback
jmp nomatch
checkMatchAttrs:
;
; See if we're supposed to check anything, as indicated by
; FEP_matchAttrs.segment being non-zero.
;
cmp ss:[params].FEP_matchAttrs.segment, 0
jz checkSearchFlags
;
; Ja. Call our nice little utility routine to compare the two arrays
; of attributes.
;
les di, ss:[params].FEP_matchAttrs ; es:di <- match attrs
clr si ; ds:si <- file attrs
call FECompareAttrs
LONG jc nomatch
checkSearchFlags:
;
; Now deal with the searchFlags, which can't be handled via matchAttrs
; because they are a union of conflicting values.
;
mov al, ss:[params].FEP_searchFlags
and al, FILE_ENUM_ALL_FILE_TYPES
cmp al, FILE_ENUM_ALL_FILE_TYPES
je checkCallback
clr si
mov ax, FEA_FILE_TYPE
call FileEnumLocateAttr
EC < ERROR_C MISSING_FILE_TYPE_ATTRIBUTE_IN_CALLBACK_DATA >
mov al, mask FESF_NON_GEOS
cmp es:[di].FEAD_value.segment, 0
jz checkFileTypeOk
mov di, es:[di].FEAD_value.offset
cmp {GeosFileType}es:[di], GFT_NOT_GEOS_FILE
je checkFileTypeOk
mov al, mask FESF_GEOS_EXECS
cmp {GeosFileType}es:[di], GFT_EXECUTABLE
je checkFileTypeOk
mov al, mask FESF_GEOS_NON_EXECS
checkFileTypeOk:
test ss:[params].FEP_searchFlags, al
jz nomatch
checkCallback:
;
; File matched so far as we're concerned. See if there's a callback
; routine we must consult.
;
test ss:[params].FEP_searchFlags, mask FESF_CALLBACK
jz match
FXIP< mov ss:[TPD_dataAX], ax >
FXIP< mov ss:[TPD_dataBX], bx >
FXIP< movdw bxax, ss:[params].FEP_callback >
FXIP< call ProcCallFixedOrMovable
NOFXIP< call ss:[params].FEP_callback >
jc nomatch
match:
;
; File has passed all our rigorous tests. See if, after all that, we
; should actually skip the beast.
;
test ss:[params].FEP_searchFlags, mask FESF_REAL_SKIP
jnz addIt
dec ss:[params].FEP_skipCount
jns skipIt
addIt:
;
; We need to add the file to the return buffer. Oh joy.
;
mov ax, ss:[locals].FEL_numFound
cmp ax, ss:[params].FEP_bufSize
jae bufferFull
;
; Haven't reached the limit set by FEP_bufSize, but perhaps the return
; block isn't big enough to hold us?
;
mov si, ss:[locals].FEL_curRetOff
mov cx, ss:[params].FEP_returnSize
add cx, si ; cx <- required size of block
mov bx, ss:[locals].FEL_retBufHandle
mov ax, MGIT_SIZE
call MemGetInfo
cmp ax, cx
jae storeNew
;
; Right. Return block is too small. We know now our return size is
; effectively unlimited, at least as far as the caller is concerned,
; so we can just enlarge the block we've got. Add another FE_INCR_SIZE
; entries to the buffer.
;
mov_trash cx, ax ; cx <- current size
mov ax, ss:[params].FEP_returnSize
mov dx, FE_INCR_SIZE
mul dx
add ax, cx
jc insufficientMemory ; => need more than 64K
clr cx ; no special flags...
call MemReAlloc
jc insufficientMemory ; => couldn't enlarge
storeNew:
;
; Now lock down the return buffer and copy the appropriate attributes
; out to it.
;
call MemLock
mov es, ax
mov di, ss:[locals].FEL_curRetOff ; es:di <- return entry
; base
clr si ; ds:si <- file attrs
call FECopyAttrs
;
; Unlock the return buffer and adjust the various loop variables.
;
call MemUnlock
add di, ss:[params].FEP_returnSize
mov ss:[locals].FEL_curRetOff, di
inc ss:[locals].FEL_numFound
skipIt:
nomatch:
doneOK:
clc
done::
.leave
ret
bufferFull:
;
; Not allowed to store this one that matched in the buffer, so up
; the FEL_numMissed to record it. If this is the first missed file,
; adjust FEP_skipCount by the current real skip count, which is the
; negative-1 of the number of files we've been passed before we
; filled up the buffer (and after we real-skipped all the files
; the caller asked us to). The -1 is because we've already decremented
; realSkipCount for this file we've got now.
;
;
mov ax, ss:[locals].FEL_numMissed
test ss:[params].FEP_searchFlags, mask FESF_REAL_SKIP
jz upNumMissed
tst ax
jnz upNumMissed
mov si, ss:[locals].FEL_realSkipCount
; equivalent to "not si | add ss:[params].FEP_skipCount, si"
; but requires fewer bytes and is only a little more obscure
stc ; don't count this file...
sbb ss:[params].FEP_skipCount, si
upNumMissed:
inc ax
mov ss:[locals].FEL_numMissed, ax
jmp doneOK
insufficientMemory:
;
; Change the bufSize to be the number of files found so far so we
; continue to think the thing is full, but also continue to tally
; those files that won't fit.
;
mov ax, ss:[locals].FEL_numFound
mov ss:[params].FEP_bufSize, ax
jmp bufferFull
FEEnumCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEEnumSpecials
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call our standard callback with the individual subdirectories
of the current logical path, if such there be, as there could
well be paths for the logical subdirectories that actually
exist where real directories of the same name exist nowhere
on the path for the current logical subdirectory.
For example, suppose we're in SP_PUBLIC_DATA and nowhere on
the path for SP_PUBLIC_DATA is there a directory named "FONT",
but there is an .ini file entry saying that FONT lives at
g:\company\allfonts. We want the directory "FONT" to appear in
the list for SP_PUBLIC_DATA so if the user navigates into it
we will properly find the files in g:\company\allfonts.
CALLED BY: FileEnum
PASS: ds = segment of FECD
es = segment of shared FSIR
ss:bp = inherited local variables
RETURN: carry set on error:
ax = error code
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEEnumSpecials proc near
uses es
.enter
segmov es, ds ; es <- FECD
;
; If there's no std path block in the system, DON'T DO THIS, as
; changing to one of these dirs won't get you anywhere (if there is
; a std path block, at least there might be a path specified for the
; thing...)
;
LoadVarSeg ds, bx
tst ds:[loaderVars].KLV_stdDirPaths
jz done
;
; Make sure we're in just a standard path, i.e. not a standard path
; with a tail.
;
mov bx, ss:[TPD_curPath]
call MemLock
mov ds, ax ; ds <- FilePath
mov si, ds:[FP_path]
SBCS < tst {char}ds:[si] ; any tail? >
DBCS < tst {wchar}ds:[si] ; any tail? >
jz doItBuckwheat ; no -- do it buckwheat
call MemUnlock ; if there's a tail, there
; are no logical subdirs
clc ; so just return ok.
jmp done
doItBuckwheat:
mov si, ds:[FP_stdPath]
call MemUnlock
mov bx, handle StandardPathStrings
call MemLock
mov ds, ax
clr cx
push si
childLoop:
pop si
push si
push cx
call StdPathPointAtNthChild
pop cx
cmc
jnc doneChildren
call FEEnumOneSpecial
inc cx
jnc childLoop
doneChildren:
pop si
mov bx, handle StandardPathStrings
call MemUnlock
done:
.leave
ret
FEEnumSpecials endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEEnumOneSpecial
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create the necessary attributes for a single logical
subdirectory, passing it to our main callback for processing.
CALLED BY: FEEnumSpecials
PASS: ds:si = logical subdir name
es = segment of FECD
ss:bp = inherited stack frame
RETURN: carry set on error:
ax = error code
carry clear if ok
DESTROYED: ax, bx, dx, si, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEEnumOneSpecial proc near
uses cx, ds
.enter
clr di
attrLoop:
mov bx, es:[di].FEAD_attr
cmp bx, FEA_END_OF_LIST ; check end-of-list first
; since it doesn't have a
; full FEAD
je eaEndOfList
EC < cmp bx, FEA_LAST_VALID >
EC < ERROR_A ILLEGAL_EXTENDED_ATTRIBUTE >
mov es:[di].FEAD_value.segment, es ; assume exists
shl bx
call cs:[extAttrHandlers][bx]
add di, size FileExtAttrDesc
jmp attrLoop
eaEndOfList:
;
; Hit the end of the list. Discard the return address to the attribute
; loop and call our standard callback with the correct arguments.
;
segmov ds, es ; ds <- FECD
call FESlowEnumCallback
segmov es, ds ; es <- FECD
.leave
ret
extAttrHandlers nptr.near eaModified, ; FEA_MODIFICATION
eaFileAttr, ; FEA_FILE_ATTR
eaSize, ; FEA_SIZE
eaNonExistent, ; FEA_FILE_TYPE
eaNonExistent, ; FEA_FLAGS
eaNonExistent, ; FEA_RELEASE
eaNonExistent, ; FEA_PROTOCOL
eaNonExistent, ; FEA_TOKEN
eaNonExistent, ; FEA_CREATOR
eaNonExistent, ; FEA_USER_NOTES
eaNonExistent, ; FEA_NOTICE
eaNonExistent, ; FEA_CREATION
eaNonExistent, ; FEA_PASSWORD
eaNonExistent, ; FEA_CUSTOM
eaName, ; FEA_NAME
eaNonExistent, ; FEA_GEODE_ATTR
eaPathInfo, ; FEA_PATH_INFO
eaFileID, ; FEA_FILE_ID
eaNonExistent, ; FEA_DESKTOP_INFO
eaDriveStatus, ; FEA_DRIVE_STATUS
eaDisk, ; FEA_DISK
eaName, ; FEA_DOS_NAME
eaNonExistent, ; FEA_OWNER
eaNonExistent, ; FEA_RIGHTS
eaNonExistent ; FEA_TARGET_FILE_ID
.assert (length extAttrHandlers) eq (FEA_LAST_VALID+1)
eaModified:
;
; Current date & time? Ancient history? What?
;
;XXX
retn
eaFileAttr:
;
; These logical subdirectories have only the FA_SUBDIR attribute.
; They're not hidden or system, nor do they have longnames...
;
mov bx, es:[di].FEAD_value.offset
mov {FileAttrs}es:[bx], mask FA_SUBDIR
retn
eaName:
;
; Copy ds:si into the value area.
;
push si, di
mov cx, es:[di].FEAD_size
mov di, es:[di].FEAD_value.offset
nameCopyLoop:
LocalGetChar ax, dssi
LocalPutChar esdi, ax
LocalIsNull ax
loopne nameCopyLoop
pop si, di
retn
eaSize:
;
; Store the size of the "directory". We say it's 0 for now...
;
mov bx, es:[di].FEAD_value.offset
clr ax
mov ({dword}es:[bx]).low, ax
mov ({dword}es:[bx]).high, ax
retn
eaPathInfo:
;
; Store the containing logical path with DPI_EXISTS_LOCALLY set false
; so the caller knows this "directory" doesn't actually exist.
;
call FEFetchCurPathDisk
mov_trash ax, bx
andnf ax, mask DPI_STD_PATH
mov bx, es:[di].FEAD_value.offset
mov {DirPathInfo}es:[bx], ax
retn
eaFileID:
;
; Store FILE_NO_ID for the beast, as it'll never change...
;
mov bx, es:[di].FEAD_value.offset
mov ({dword}es:[bx]).low, FILE_NO_ID and 0xffff
mov ({dword}es:[bx]).high, FILE_NO_ID shr 16
retn
eaDisk:
;
; Store system disk, always
;
mov bx, es:[di].FEAD_value.offset
push ds
LoadVarSeg ds, ax
mov ax, ds:[topLevelDiskHandle]
pop ds
mov es:[bx], ax
retn
eaNonExistent:
;
; Request for an attribute this "directory" doesn't have, so clear the
; FEAD_value.segment to indicate its absence.
;
mov es:[di].FEAD_value.segment, 0
retn
eaDriveStatus:
;
; Use extended status for top-level disk.
;
push ds
LoadVarSeg ds, ax
mov bx, ds:[topLevelDiskHandle]
call DiskGetDrive
call DriveGetExtStatus
pop ds
mov bx, es:[di].FEAD_value.offset
mov es:[bx], ax
retn
FEEnumOneSpecial endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FESlowEnumCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Slower callback that's a front-end to FEEnumCallback and
is responsible for remembering the names of all files
we've been told about so far and not passing duplicates
off to FEEnumCallback
CALLED BY: FSD
PASS: ds = segment of FECD with current file's attributes
ss:bp = inherited stack frame
RETURN: carry set to stop enumerating files:
ax = error code
DESTROYED: es, ax, bx, cx, dx, di, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/26/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FESlowEnumCallback proc far
.enter inherit FileEnum
;
; Find the FEA_NAME attribute in the FECD.
;
segmov es, ds
clr di
segmov ds, cs
mov si, offset feNameAttr
call FELocateAttr
EC < ERROR_NC NAME_ATTRIBUTE_NOT_IN_FECD >
EC < cmp es:[di].FEAD_value.segment, 0 >
EC < ERROR_Z NAME_ATTRIBUTE_NOT_IN_FECD >
;
; Determine the length of the file's name, exclusive of its null
; terminator.
;
if DBCS_PCGEOS
push di
mov di, es:[di].FEAD_value.offset
call LocalStringLength ;cx <- length of name w/o null
pop di
else
clr al
push di
mov cx, -1
mov di, es:[di].FEAD_value.offset
repne scasb
not cx
dec cx ; cx <- length of name w/o null
pop di
endif
;
; Now we need to see if the file is already listed in the filesSeen
; block. First, we have to lock the beggar down.
;
mov bx, ss:[locals].FEL_filesSeen
call MemLock
mov ds, ax
clr si ; buffer starts at offset 0
mov di, es:[di].FEAD_value.offset ; es:di <- file name
compareLoop:
;
; See if we've made it to the end of the buffer. If so, the file
; obviously hasn't been seen before.
;
cmp si, ss:[locals].FEL_fsFree
jae notSeen
;
; Compare this string to the file name, checking the size words first
; as a first approximation.
;
lodsw ; ax <- size
cmp cx, ax ; same?
je compare ; yes -- go perform the string compare
DBCS < shl ax, 1 >
add si, ax ; nope -- skip this entry and loop
jmp compareLoop
compare:
;
; Strings are of the same size, so use repe cmpsb to compare the two.
;
push di
SBCS < repe cmpsb >
DBCS < repe cmpsw >
pop di
je found
;
; Strings didn't match, so advance SI to the next entry by adding the
; count remaining in CX to it. Since the strings are the same size,
; AX is also the length of the file's name, so we can restore CX from
; there before we loop back.
;
DBCS < shl cx >
add si, cx
mov_trash cx, ax
jmp compareLoop
found:
;
; File already seen, so release the filesSeen buffer and return
; that everything's ok, but don't call our main callback with the file.
;
call MemUnlock
segmov ds, es ; ds <- FECD again
clc
done:
.leave
ret
;--------------------
notSeen:
;
; The file's not been seen before, so see if its name will fit in
; the filesSeen buffer as it currently stands. The current
; register contents, for those who are keeping score, are:
; ds:si = place at which to store the filename
; es:di = the filename to store
; cx = the length of the filename to store
; bx = filesSeen block handle
;
mov ax, MGIT_SIZE
call MemGetInfo ; ax <- block size (bytes)
lea dx, [si+2]
add dx, cx ; dx <- fsFree after entry is
; added (string length + size
; word)
cmp ax, dx ; enough?
jae storeIt ; yes
;
; Not enough room in the filesSeen buffer, so add another
; FE_FILES_SEEN_INCR_SIZE bytes to the block's current size.
;
add ax, FE_FILES_SEEN_INCR_SIZE
EC < cmp ax, dx >
EC < ERROR_B PREPOSTEROUS_FILE_NAME_LENGTH >
push cx ; save name length
clr cx ; no special allocation flags
call MemReAlloc ; enlarge...
pop cx
jc error ; => out o' memory
mov ds, ax ; ds <- new segment (since
; block is already locked)
storeIt:
;
; Copy the string into the filesSeen buffer. Alas, the registers
; are in exactly the wrong order, so swap them.
;
xchg si, di
segxchg es, ds ; ds:si <- file name, es:di <- storage
mov ax, cx
stosw ; store size word
SBCS < rep movsb ; and copy the file name >
DBCS < rep movsw ; and copy the file name >
;
; Record the new first-free byte in the local variables and unlock our
; filesSeen buffer.
;
mov ss:[locals].FEL_fsFree, di
call MemUnlock
;
; Call the regular callback to finally deal with the file.
;
call FEEnumCallback
jmp done
error:
;
; Couldn't enlarge the filesSeen buffer, so this particular
; enumeration is complete. Unlock the buffer, restore ds to the
; FECD, in case anyone cares, and return the appropriate error.
;
call MemUnlock
segmov ds, es ; ds <- FECD
mov ax, ERROR_INSUFFICIENT_MEMORY
stc
jmp done
FESlowEnumCallback endp
;------------------------------------------------------------------------------
;
; UTILITY ROUTINES FOR APPLICATIONS TO USE
;
;------------------------------------------------------------------------------
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FileEnumWildcard
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: See if the virtual name for the current file matches
the pattern in FEP_cbData1.
CALLED BY: FileEnum, GLOBAL
PASS: ds = segment of FileEnumCallbackData
ss:bp = inherited stack frame:
params.FEP_cbData1 = fptr to pattern to match
params.FEP_cbData2.low = non-zero if matching should
be case-insensitive
RETURN: carry clear if FEA_NAME attribute matches passed pattern
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 10/14/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FileEnumWildcard proc far
uses ax
.enter inherit FileEnum
mov ax, FEA_NAME
call FEWildcard
.leave
ret
FileEnumWildcard endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEWildcard
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Common routine for FileEnumWildcard and FileEnumNativeWildcard
to actually to the work they want to do.
CALLED BY: FileEnumNativeWildcard, FileEnumWildcard
PASS: ds = segment of FileEnumCallbackData
ax = FileExtendedAttribute against which to compare
FEP_cbData1
ss:bp = inherited stack frame
params.FEP_cbData1 = fptr to pattern to match
params.FEP_cbData2.low = non-zero if matching should
be case-insensitive
RETURN: carry clear if attribute matches passed pattern.
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 10/14/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEWildcard proc near
uses bx, cx, si, di, ds, es
.enter inherit FileEnum
clr si ; ds:si <- array in which to search
call FileEnumLocateAttr
EC < ERROR_C MISSING_NAME_ATTRIBUTE_IN_CALLBACK_DATA >
NEC < jc done >
les di, es:[di].FEAD_value
lds si, ss:[params].FEP_cbData1
mov cx, ss:[params].FEP_cbData2.low
call FEStringMatch
NEC <done: >
.leave
ret
FEWildcard endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FEStringMatch
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Perform UNIX-standard wildcard matching of a string against
a pattern. In the pattern, the following characters have
special meaning:
* = 0 or more of any character
? = any single character
[..] = a character range, where a single character
within the range matches.
[^..] = an inverse character range, where a single
character not within the range matches.
The special meaning of these characters can be escaped by
preceding them with a backslash.
CALLED BY: FEWildcard
PASS: ds:si = pattern to match
es:di = string being matched
cx = non-zero if matching should be case-insensitive
RETURN: carry clear if string matches the pattern.
DESTROYED: si, di, ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
Perhaps lock LocalUpcaseChar at the start? Requires another
level, as locking it each recursion would be a waste of time.
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 10/14/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FEStringMatch proc near
.enter
compareChar:
;
; Get pattern character into AL and string character into BL. If
; we're being insensitive to case, upcase both.
;
SBCS < clr ax >
SBCS < mov bx, ax >
SBCS < mov al, ds:[si] >
SBCS < mov bl, es:[di] >
DBCS < mov ax, ds:[si] >
DBCS < mov bx, es:[di] >
jcxz haveChars
call LocalUpcaseChar
xchg ax, bx
call LocalUpcaseChar
xchg ax, bx
haveChars:
;
; If at end of the pattern, only match if at the end of the string.
;
LocalIsNull ax
jnz checkSubstring
LocalIsNull bx
jz done
fail:
stc
done:
.leave
ret
;--------------------
checkSubstring:
;
; If pattern char is *, it matches any substring. We handle this quite
; simply by recursing for each possible suffix of the string until
; we either reach the end of the string without matching, or we
; find one that matches. As a simple optimization, if * is the last
; character in the pattern, we declare a match immediately.
;
LocalCmpChar ax, '*'
jne checkSingle
LocalNextChar dssi ; advance pattern pointer so we're
; matching against the rest of the
; pattern.
SBCS < tst {char}ds:[si] >
DBCS < tst {wchar}ds:[si] >
jz done
starLoop:
push si, di
call FEStringMatch ; check current suffix
pop si, di
jnc done ; match => happiness
;
; advance to next (shorter) suffix and loop if we're not at the
; end of the string.
;
LocalNextChar esdi
SBCS < tst {char}es:[di] >
DBCS < tst {wchar}es:[di] >
jnz starLoop
;
; hit end of string w/o finding a suffix that matched, so declare
; a mistrial.
;
jmp fail
;--------------------
checkSingle:
;
; If pattern char is ?, it matches any character in the string except
; the null-terminator.
;
LocalCmpChar ax, '?'
jne checkRange
LocalIsNull bx
jnz nextChar
jmp fail
;--------------------
checkRange:
;
; If pattern char is '[', it introduces a range of possible matches.
;
LocalCmpChar ax, '['
jne checkBackslash
push dx
clr dx ; assume not inverse
LocalNextChar dssi
SBCS < cmp {char}ds:[si], '^' ; inverse range? >
DBCS < cmp {wchar}ds:[si], '^' ; inverse range? >
jne rangeLoop
not dx ; flag inverse
rangeLoop:
;
; Fetch next char of range, upcasing as necessary.
;
LocalGetChar ax, dssi
jcxz haveNextPatternChar
call LocalUpcaseChar
haveNextPatternChar:
;
; If pattern character is ] or the null-terminator, then the range
; is complete (XXX: what about backslash to escape ]?)
;
LocalCmpChar ax, ']'
je rangeCheckDone
LocalIsNull ax ; XXX: unterminated range
je rangeCheckDone
SBCS < cmp al, bl >
DBCS < cmp ax, bx >
je rangeMatch
ja ignoreSubRange ; if pattern char above string char,
; we need to ignore any following
; subrange (as introduced via a - as
; the next character), as string can't
; possibly be in the subrange.
;
; If subrange indicated (next pattern char is -), fetch the end
; of the subrange, upcase it as necessary, and see if the string
; char falls under or at the end char, indicating it's in the
; subrange, since we already know the string char is above
; the start of the subrange.
;
SBCS < cmp {char}ds:[si], '-' >
DBCS < cmp {wchar}ds:[si], '-' >
jne rangeLoop
LocalNextChar dssi
LocalGetChar ax, dssi
jcxz haveSecondRangeChar
call LocalUpcaseChar
haveSecondRangeChar:
LocalIsNull ax
jz rangeCheckDone ; XXX: unterminated range
SBCS < cmp al, bl >
DBCS < cmp ax, bx >
jb rangeLoop ; pattern below string, so string char
; outside of range...
rangeMatch:
;
; String char matched the pattern char or fell within one of its
; subranges. Invert our return value (DX) to indicate this, thus
; giving us non-zero for a standard range and 0 for an inverse
; range.
;
not dx
SBCS < mov al, 1 ; so we don't decide the character on which >
DBCS < mov ax, 1 ; so we don't decide the character on which >
; we stopped (which might be ]) is actually
; the end of the range...
rangeCheckDone:
;
; We've either gone through all the chars of the range, or have
; decided the thing matched the range, so make sure ds:si points
; past the range.
;
LocalCmpChar ax, ']'
je testRangeResult
LocalIsNull ax
jz unterminatedRange
LocalGetChar ax, dssi
jmp rangeCheckDone
ignoreSubRange:
;
; String char fell below first char of possible subrange, so we've
; only to skip the subrange if we see it.
;
SBCS < cmp {char}ds:[si], '-' >
DBCS < cmp {wchar}ds:[si], '-' >
jne rangeLoop
LocalNextChar dssi
LocalGetChar ax, dssi
LocalIsNull ax
jnz rangeLoop
unterminatedRange:
LocalPrevChar dssi ; point back at null so we know we're
; done with the pattern
testRangeResult:
;
; DX contains the result of the comparison. 0 if string char isn't
; in the range, and non-zero if it did. Because we initialize DX to
; -1 if an inverse range was specified, and use "not dx" to flag
; a match, we need only tst dx here to decide whether to accept
; the string char as matching or not.
;
tst dx
pop dx
jnz nextStringChar ; si already advanced past range...
jmp fail
;--------------------
checkBackslash:
;
; If pattern char is a backslash, it escapes special meaning for the
; following character, unless following character is the null-
; terminator, in which case the match fails.
;
LocalCmpChar ax, C_BACKSLASH
jne checkNormal
LocalNextChar dssi
LocalGetChar ax, dssi, NO_ADVANCE
LocalIsNull ax
LONG jz fail
jcxz checkNormal
call LocalUpcaseChar
;--------------------
checkNormal:
SBCS < cmp al, bl >
DBCS < cmp ax, bx >
LONG jne fail
nextChar:
LocalNextChar dssi
nextStringChar:
LocalNextChar esdi
jmp compareChar
FEStringMatch endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FileEnumLocateAttr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Locate an extended attribute in an array of extended
attribute descriptors.
CALLED BY: GLOBAL
PASS: ax = FileExtendedAttribute (FEA_MULTIPLE not allowed)
ds:si = array in which to search
es:di = attribute name, if FEA_CUSTOM
RETURN: carry set if attribute couldn't be found
es, di destroyed
carry clear if attribute found:
es:di = FileExtAttrDesc
If the file doesn't have this attribute, then
es:di.FEAD_value.segment will be zero.
DESTROYED: es, di (if not returned)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/27/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FileEnumLocateAttr proc far
attr local FileExtAttrDesc
uses dx, ds, si
.enter
if FULL_EXECUTE_IN_PLACE
;
; Make sure the fptrs passed in are valid
;
EC < pushdw bxsi >
EC < mov bx, ds >
EC < call ECAssertValidFarPointerXIP >
EC < cmp ax, FEA_CUSTOM >
EC < jne xipSafe >
EC < movdw bxsi, esdi >
EC < call ECAssertValidFarPointerXIP >
EC < xipSafe: >
EC < popdw bxsi >
endif
;
; Set up the attribute descriptor to pass to our internal routine.
;
mov ss:[attr].FEAD_attr, ax
mov ss:[attr].FEAD_name.offset, di
mov ss:[attr].FEAD_name.segment, es
;
; Adjust registers accordingly.
;
segmov es, ds
mov di, si
segmov ds, ss
lea si, ss:[attr]
;
; Go a-hunting.
;
call FELocateAttr
cmc ; return carry set if *not* found
.leave
ret
FileEnumLocateAttr endp
FileenumCode ends
| 26.641917
| 80
| 0.628376
|
6c8698761c1b2355440ba842b008a4b537d987c1
| 1,172
|
asm
|
Assembly
|
programs/oeis/008/A008867.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/008/A008867.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/008/A008867.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A008867: Triangle of truncated triangular numbers: k-th term in n-th row is number of dots in hexagon of sides k, n-k, k, n-k, k, n-k.
; 1,3,3,6,7,6,10,12,12,10,15,18,19,18,15,21,25,27,27,25,21,28,33,36,37,36,33,28,36,42,46,48,48,46,42,36,45,52,57,60,61,60,57,52,45,55,63,69,73,75,75,73,69,63,55,66,75,82,87,90,91,90,87,82,75,66,78,88,96,102,106,108,108,106,102,96,88,78,91,102,111,118,123,126,127,126,123,118,111,102,91,105,117,127,135,141,145,147,147,145,141,135,127,117,105,120,133,144,153,160,165,168,169,168,165,160,153,144,133,120,136,150,162,172,180,186,190,192,192,190,186,180,172,162,150,136,153,168,181,192,201,208,213,216,217,216,213,208,201,192,181,168,153,171,187,201,213,223,231,237,241,243,243,241,237,231,223,213,201,187,171,190,207,222,235,246,255,262,267,270,271,270,267,262,255,246,235,222,207,190,210,228,244,258,270,280,288,294,298,300,300,298,294,288,280,270,258,244,228,210,231,250,267,282,295,306,315,322,327,330,331,330,327,322,315,306,295,282,267,250,231,253,273,291,307,321,333,343,351,357,361,363,363,361,357,351,343,333,321,307
mov $2,$0
add $0,1
cal $0,128139 ; Triangle read by rows: matrix product A004736 * A128132.
mov $1,$0
add $1,$2
| 130.222222
| 921
| 0.71843
|
cd82a8dc78582f79637a4b42865e1ca77ada559d
| 17,107
|
asm
|
Assembly
|
MIPS_Course/lab4/figure.asm
|
akellermann97/college-dump
|
5c82d93767038709ad71b8f212fdb6243eeb0aec
|
[
"MIT"
] | null | null | null |
MIPS_Course/lab4/figure.asm
|
akellermann97/college-dump
|
5c82d93767038709ad71b8f212fdb6243eeb0aec
|
[
"MIT"
] | null | null | null |
MIPS_Course/lab4/figure.asm
|
akellermann97/college-dump
|
5c82d93767038709ad71b8f212fdb6243eeb0aec
|
[
"MIT"
] | null | null | null |
# File: $Id$
# Author: J. Heliotis, (author's version 1.3)
# Contributors: K. Reek,
# P. White,
# Alexander Kellermann Nieves
# Description: This program reads a description of a geometric
# figure from standard input and displays some
# further information about it. Currently, the
# program handles two types of figures: blocks
# (rectangles) and circles.
#
# Purpose: To demonstrate the implementation of polymorphic
# subroutine calls
#
# Revisions: $Log$
# 4/1/04 M. Reek changed to use MIPS linkage conventions
#
# CONSTANTS
#
# syscall codes
PRINT_INT = 1
PRINT_STRING = 4
READ_INT = 5
READ_STRING = 8
# various frame sizes used by different routines
FRAMESIZE_8 = 8
FRAMESIZE_24 = 24
FRAMESIZE_40 = 40
FRAMESIZE_48 = 48
.data
.align 2
#
# Memory for allocating up to 100 figures.
#
next:
.word pool # ptr into the pool where next free
# space is located
pool:
.space 1200 # room for 100 figures
pool_end: # a marker for the end of the free space
.word 0 # used to tell us if we are out of mem
fig_width:
.word 0
fig_height:
.word 0
.align 0
fig_char:
.asciiz "0123456789" # I know this isn't a character, but
# SPIMs only has read_string, which
# reads to eol and then null
# terminates the string it read in
#
# some constants for the code
#
PI = 3 # an bad integer approx. to pi, 3.14159...
char_c:
.ascii "C"
char_b:
.ascii "B"
new_error:
.asciiz "Out of memory for allocating figures.\n"
figure_type_error_string:
.asciiz "Illegal figure type\n"
circle_string:
.asciiz "Circle ("
block_string:
.asciiz "Block ("
comma_string:
.asciiz ","
area_string:
.asciiz ") - area = "
perimeter_string:
.asciiz "; perimeter = "
new_line:
.asciiz "\n"
#
# Name: MAIN PROGRAM
#
# Description: Main logic for the program.
#
# The program reads three values from standard input:
# 1) a character representing the type of figure to create
# 2) an integer representing the width of the bounding box
# of the figure
# 3) an integer representing the height of the bounding box
# of the figure
#
# After creating the specified figure object, the program then
# displays all available information on the object created.
#
.text # this is program code
.align 2 # instructions must be on word boundaries
.globl main # main is a global label
main:
# allocate stack frame according to formula & save state
addi $sp, $sp,-FRAMESIZE_24
sw $ra, -4+FRAMESIZE_24($sp)
sw $s1, -8+FRAMESIZE_24($sp)
sw $s0, -12+FRAMESIZE_24($sp)
#
# Read the character representing the figure type
#
li $v0, READ_STRING # read a string
la $a0, fig_char # place to store the char read in
addi $a1, $zero, 9 # the number of characters to read
syscall
#
# Read the width into r1
#
li $v0, READ_INT
syscall
move $s0, $v0
#
# Read the height into r2
#
li $v0, READ_INT
syscall
move $s1, $v0
#
# Do the output
#
move $a0, $s0
move $a1, $s1
jal output_figures
#
# All done -- exit the program!
#
lw $ra, -4+FRAMESIZE_24($sp)
lw $s1, -8+FRAMESIZE_24($sp)
lw $s0, -12+FRAMESIZE_24($sp)
addi $sp, $sp, FRAMESIZE_24
jr $ra # return from main and exit spim
# ***********************************************************************
# * *
# * THIS IS THE START OF EXPERIMENT-SPECIFIC CODE *
# * *
# ***********************************************************************
# Name: Constants to keep in mind while working with figures
#
# A Figure contains three words
# address of virtual function table at offset 0 in fig object
# figure width at offset 4 in fig object
# figure height at offset 8 in fig object
# Making the figures size as 12 bytes
# A Figure virtual function table contains two function addresses (words):
# addr area function at offset 0 in vtable
# addr perimeter function at offset 4 in vtable
#
#
# Name: new_figure
#
# Description: Allocate space for a new figure from the pool of
# available space. Luckily, both subclasses of FIGURE
# take up the same amount of space.
#
# Arguments: None.
# Returns: v0: the address of the newly allocated figure.
#
new_figure:
#
# See if there is any space left in the pool.
#
lw $t0, next
la $t1, pool_end
slt $t2, $t0, $t1 # Compare next addr to end of pool
bne $t2, $zero, new_figure_ok # if less, still have space
#
# No space left; write error message and exit.
#
li $v0, PRINT_STRING # print error message
la $a0, new_error
syscall
li $v0, 10 # terminate program
syscall
new_figure_ok:
#
# There is space available. Allocate the next figure, and
# initialize all of its fields.
#
move $v0, $t0 # set up to return spot for new figure
addi $t0, $t0, 12 # Adjust pointer to next figure
sw $t0, next
#
# Clear all fields.
#
sw $zero, 0($v0)
sw $zero, 4($v0)
sw $zero, 8($v0)
jr $ra
#
# Name: figure_make
#
# Description: Initialize the components of the figure object.
# Since FIGURE is an abstract class, it is expected that
# the creation subroutines for child classes will call this
# subroutine.
#
# Arguments: a0 contains the height of the figure's bounding box
# a1 contains the width of the figure's bounding box
# a2 contains the address of the figure object
#
figure_make:
sw $a1, 4($a2) # store the width in the fig object
sw $a0, 8($a2) # store the height in the fig object
jr $ra
# CODE FOR FIGURE SUBCLASS BLOCK
#***** BEGIN STUDENT CODE BLOCK 1 ********************************
#
# Using the circle code below as your guide, write everything
# necessary to implement the FIGURE child class called BLOCK.
# This involves defining BLOCK's virtual function table, its
# creation routine, block_make, and its two virtual (polymorphic)
# functions, block_area and block_perimeter.
#
.data
.align 2
block_vtb1:
.word block_area
.word block_perimeter
.text
block_make:
addi $sp, $sp, -FRAMESIZE_8
sw $ra, -4+FRAMESIZE_8($sp)
la $t1, block_vtb1 # get blocks vtable pointer
sw $t1, 0($a2)
jal figure_make
lw $ra, -4+FRAMESIZE_8($sp) # return the return address
addi $sp, $sp, FRAMESIZE_8
jr $ra
block_area:
# This routine is entirely stolen from the circle's routine. Saving the
# return address register is unnecessary, but I kept it just in case I
# need to revist this function and use it.
# Arguments: a0 contains the address of the figure object
#
# Returns: v0 will contain the area of the block
addi $sp, $sp, -FRAMESIZE_8
sw $ra, -4+FRAMESIZE_8($sp)
# This is where the PI is in the other function but we don't need that
# in our functoin
lw $t0, 4($a0) # Get the width
lw $t1, 8($a0) # Get the height
mul $v0, $t0, $t1 # Multiply width times height put result in v0
lw $ra, -4+FRAMESIZE_8($sp)
addi $sp, $sp, FRAMESIZE_8
jr $ra
block_perimeter:
# Easy maths on this one. Just do two simple add additions. (or if one
# prefers, one could perform 2 multiplications) and then a third to
# combine. Return that
# Arguments: a0 contains the address of the figure object
#
# returns: v0 contains the perimeter
lw $t0, 4($a0) # Get the width
lw $t1, 8($a0) # Get the height
# I duplicate t0 just because I'm worried of what MIPS might do
move $t2, $t0 # Probably unnecessary
add $t0, $t2, $t0 # t0 = t0 + t0
move $t2, $t1 # Probably unnecessary
add $t1, $t2, $t1 # t1 = t1 + t1
add $v0, $t1, $t0 # This boils down to v0 = 2(t1) + 2(t0)
jr $ra
#***** END STUDENT CODE BLOCK 1 **********************************
# CODE FOR FIGURE SUBCLASS CIRCLE
#************************************
.data
.align 2
circle_vtbl:
.word circle_area
.word circle_perimeter
.text
#************************************
#
# Name: circle_make
#
# Description: Initialize the components of the circle object
# All this subroutine does is set the virtual function
# table, then call figure_make.
#
# Arguments: a0 contains the height of the figure's bounding box
# a1 contains the width of the figure's bounding box
# a2 contains the address of the figure object
#
circle_make:
addi $sp, $sp,-FRAMESIZE_8
sw $ra, -4+FRAMESIZE_8($sp)
la $t1, circle_vtbl # get circle's vtable pointer
sw $t1, 0($a2) # put circle's vtable pointer into this fig
# object
jal figure_make
lw $ra, -4+FRAMESIZE_8($sp) # get ra off stack, and restore
addi $sp, $sp, FRAMESIZE_8
jr $ra
#
# Name: circle_area
#
# Description: Compute the area of the circle figure
#
# Arguments: a0 contains the address of the figure object
#
# Returns: v0 contains the area
#
circle_area:
addi $sp, $sp,-FRAMESIZE_8
sw $ra, -4+FRAMESIZE_8($sp)
li $t9, PI # get our int approx. for PI = 3
jal circle_diameter # get my diameter in v0
div $t0, $v0, 2 # t0 = radius
mul $t1, $t0, $t0 # t1 = radius squared
mul $v0, $t1, $t9 # v0 = PI * radius squared
lw $ra, -4+FRAMESIZE_8($sp) # restore ra from stack
addi $sp, $sp, FRAMESIZE_8
jr $ra
#
# Name: circle_perimeter
#
# Description: Compute the perimeter of the circle figure
#
# Arguments: a0 contains the address of the figure object
#
# Returns: v0 contains the perimeter
#
circle_perimeter:
addi $sp, $sp,-FRAMESIZE_8
sw $ra, -4+FRAMESIZE_8($sp)
li $t9, PI # get our int approx. for PI = 3
jal circle_diameter # get my diameter in v0
mul $v0, $v0, $t9 # v0 = PI * diameter
lw $ra, -4+FRAMESIZE_8($sp) # restore ra from stack
addi $sp, $sp, FRAMESIZE_8
jr $ra
#
# Name: circle_diameter
#
# Description: Compute the diameter of the circle figure
#
# Arguments: a0 contains the address of the figure object
#
# Returns: v0 contains the diameter
#
circle_diameter:
lw $t0, 4($a0) # get fig's width
lw $t1, 8($a0) # get fig's height
slt $t2, $t0, $t1 # see if width < height
beq $t2, $zero, cd_height_bigger
move $v0, $t0 # width is smaller
jr $ra
cd_height_bigger:
move $v0, $t1 # height is smaller
jr $ra
#
# Name: output_figures
#
# Description: Given the paramters for a figure, make one and print out
# its attributes.
#
# Arguments: fig_char: Character representing figure type
# a0: width
# a1: height
#
#
output_figures:
addi $sp, $sp,-FRAMESIZE_48
sw $ra, -4+FRAMESIZE_48($sp)
sw $s7, -8+FRAMESIZE_48($sp)
sw $s6, -12+FRAMESIZE_48($sp)
sw $s5, -16+FRAMESIZE_48($sp)
sw $s4, -20+FRAMESIZE_48($sp)
sw $s3, -24+FRAMESIZE_48($sp)
sw $s2, -28+FRAMESIZE_48($sp)
sw $s1, -32+FRAMESIZE_48($sp)
sw $s0, -36+FRAMESIZE_48($sp)
move $s3, $a0 # s3 will be the width
move $s4, $a1 # s4 will be the height
jal new_figure # create a new figure
move $s1, $v0 # save the pointer to the fig object
#
# Now, see which one we should make
#
lbu $s6, char_c # get our characters for comparison
lbu $s7, char_b
lbu $s5, fig_char # get the type of fig to create
bne $s5, $s6, not_circle # see if creating a circle
#
# Set up the arguments to the circle_make call
# a0 contains the height of the figure's bounding box
# a1 contains the width of the figure's bounding box
# a2 contains the address of the figure object
#
move $a0, $s4 # s4 was the height
move $a1, $s3 # s3 was the width
move $a2, $s1 # s1 was the location of new fig object
jal circle_make
#
# Print "Circle ("
#
li $v0, PRINT_STRING # print a "Circle ("
la $a0, circle_string
syscall
move $a0, $s1 # send the pointer to the fig object
# as the arg. to print_rest
jal print_rest # print rest of info of the fig
j done_output
not_circle:
bne $s5, $s7, not_anything # see if creating a block
#
# Set up the arguments to the block_make call
# a0 contains the height of the figure's bounding box
# a1 contains the width of the figure's bounding box
# a2 contains the address of the figure object
#
move $a0, $s4 # s4 was the height
move $a1, $s3 # s3 was the width
move $a2, $s1 # s1 was the location of new fig object
jal block_make
#
# Print "Block ("
#
li $v0, PRINT_STRING # print a "Block ("
la $a0, block_string
syscall
move $a0, $s1 # send the pointer to the fig object
# as the arg. to print_rest
jal print_rest # print rest of info of the fig
j done_output
not_anything:
#
# Print error message
#
li $v0, PRINT_STRING
la $a0, figure_type_error_string
syscall
#
# exit
#
done_output:
lw $ra, -4+FRAMESIZE_48($sp)
lw $s7, -8+FRAMESIZE_48($sp)
lw $s6, -12+FRAMESIZE_48($sp)
lw $s5, -16+FRAMESIZE_48($sp)
lw $s4, -20+FRAMESIZE_48($sp)
lw $s3, -24+FRAMESIZE_48($sp)
lw $s2, -28+FRAMESIZE_48($sp)
lw $s1, -32+FRAMESIZE_48($sp)
lw $s0, -36+FRAMESIZE_48($sp)
addi $sp, $sp, FRAMESIZE_48
jr $ra
#
# Name: print_rest
#
# Description: prints out the information about a figure
#
# Arguments: a0: contains the address of the figure object
#
print_rest:
#
# Save all the S registers & ra
#
addi $sp, $sp,-FRAMESIZE_40
sw $ra, -4+FRAMESIZE_40($sp)
sw $s7, -8+FRAMESIZE_40($sp)
sw $s6, -12+FRAMESIZE_40($sp)
sw $s5, -16+FRAMESIZE_40($sp)
sw $s4, -20+FRAMESIZE_40($sp)
sw $s3, -24+FRAMESIZE_40($sp)
sw $s2, -28+FRAMESIZE_40($sp)
sw $s1, -32+FRAMESIZE_40($sp)
sw $s0, -36+FRAMESIZE_40($sp)
move $s0, $a0 # s0 will be your pointer to figure
# since a0 is needed by the syscalls
#***** BEGIN STUDENT CODE BLOCK 2 ********************************
#
# Print the figure's width using PRINT_INT. At this point, s0 contains
# the address of the figure object, and shouldn't be changed.
#
# Note that this does not involve any polymorphic functions.
#
# Remember s0 is the address. So we need to print it's width
lw $a0, 4($s0)
li $v0, PRINT_INT
syscall
#***** END STUDENT CODE BLOCK 2 **********************************
li $v0, PRINT_STRING # print ','
la $a0, comma_string
syscall
#***** BEGIN STUDENT CODE BLOCK 3 ********************************
#
# Print the figure's height using PRINT_INT. At this point, s0 contains
# the address of the figure object, and shouldn't be changed.
#
# Note that this does not involve any polymorphic functions.
#
lw $a0, 8($s0)
li $v0, PRINT_INT
syscall
#***** END STUDENT CODE BLOCK 3 **********************************
li $v0, PRINT_STRING # print ') - area = '
la $a0, area_string
syscall
#***** BEGIN STUDENT CODE BLOCK 4 ********************************
#
# Print the figure's area using PRINT_INT. At this point, s0 contains
# the address of the figure object, and shouldn't be changed.
#
# First we want to know if it's a Circle or a block
la $t2, fig_char
la $t1, char_b
lb $t7, 0($t2)
lb $t6, 0($t1)
beq $t7, $t6, do_block_stuff
j do_circle_stuff
do_circle_stuff:
move $a0, $s0
jal circle_area
move $a0, $v0
j finish_stuff
do_block_stuff:
move $a0, $s0
jal block_area
move $a0, $v0
j finish_stuff
finish_stuff:
li $v0, PRINT_INT
syscall
#***** END STUDENT CODE BLOCK 4 **********************************
li $v0, PRINT_STRING # print '; perimeter = '
la $a0, perimeter_string
syscall
#***** BEGIN STUDENT CODE BLOCK 5 ********************************
#
# Print the figure's perimeter using PRINT_INT. At this point, s0
# contains the address of the figure object, and shouldn't be changed.
#
# First we want to know if it's a Circle or a block
# This code is basically the same as in student block 4. Except we just do
# perimeter stuff instead of Area.
la $t2, fig_char
la $t1, char_b
lb $t7, 0($t2)
lb $t6, 0($t1)
beq $t7, $t6, do_block_stuff_perim
j do_circle_stuff_perim
do_circle_stuff_perim:
move $a0, $s0
jal circle_perimeter
move $a0, $v0
j finish_stuff_perim
do_block_stuff_perim:
move $a0, $s0
jal block_perimeter
move $a0, $v0
j finish_stuff_perim
finish_stuff_perim:
li $v0, PRINT_INT
syscall
#***** END STUDENT CODE BLOCK 5 **********************************
li $v0, PRINT_STRING # print newline
la $a0, new_line
syscall
#
# Restore all the S registers
#
lw $ra, -4+FRAMESIZE_40($sp)
lw $s7, -8+FRAMESIZE_40($sp)
lw $s6, -12+FRAMESIZE_40($sp)
lw $s5, -16+FRAMESIZE_40($sp)
lw $s4, -20+FRAMESIZE_40($sp)
lw $s3, -24+FRAMESIZE_40($sp)
lw $s2, -28+FRAMESIZE_40($sp)
lw $s1, -32+FRAMESIZE_40($sp)
lw $s0, -36+FRAMESIZE_40($sp)
addi $sp, $sp, FRAMESIZE_40
jr $ra
| 24.060478
| 79
| 0.621909
|
402f7e96e4d99f1e3fe36587c3924cc7e12b6b3c
| 369
|
asm
|
Assembly
|
pkgs/tools/yasm/src/modules/objfmts/win64/tests/sce4-err.asm
|
manggoguy/parsec-modified
|
d14edfb62795805c84a4280d67b50cca175b95af
|
[
"BSD-3-Clause"
] | 2,151
|
2020-04-18T07:31:17.000Z
|
2022-03-31T08:39:18.000Z
|
pkgs/tools/yasm/src/modules/objfmts/win64/tests/sce4-err.asm
|
manggoguy/parsec-modified
|
d14edfb62795805c84a4280d67b50cca175b95af
|
[
"BSD-3-Clause"
] | 395
|
2020-04-18T08:22:18.000Z
|
2021-12-08T13:04:49.000Z
|
pkgs/tools/yasm/src/modules/objfmts/win64/tests/sce4-err.asm
|
manggoguy/parsec-modified
|
d14edfb62795805c84a4280d67b50cca175b95af
|
[
"BSD-3-Clause"
] | 338
|
2020-04-18T08:03:10.000Z
|
2022-03-29T12:33:22.000Z
|
; Negatives
PROC_FRAME sample
[allocstack 0-8]
[setframe rbp, 0-4]
[savexmm128 xmm7, 0-16]
[savereg rsi, 0-8]
END_PROLOGUE
ENDPROC_FRAME
; Too positive
PROC_FRAME sample2
[setframe rbp, 248]
END_PROLOGUE
ENDPROC_FRAME
; Misaligned
PROC_FRAME sample3
[allocstack 128-4]
[setframe rbp, 240-4]
[savexmm128 xmm7, 1024+8]
[savereg rsi, 1024+4]
END_PROLOGUE
ENDPROC_FRAME
| 14.76
| 25
| 0.775068
|
bcb9e0959a86676999eec77f83459f708ab986a3
| 8,337
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_21829_429.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_21829_429.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_21829_429.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 %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0xb7fc, %rsi
lea addresses_WT_ht+0xddc0, %rdi
and $21455, %r10
mov $113, %rcx
rep movsl
nop
nop
cmp $17678, %rbp
lea addresses_WT_ht+0x2e60, %r14
inc %rbp
mov (%r14), %rdi
nop
nop
nop
nop
nop
cmp %r10, %r10
lea addresses_D_ht+0xdde8, %rbp
nop
sub $56360, %rsi
movl $0x61626364, (%rbp)
nop
nop
nop
nop
cmp $33382, %rcx
lea addresses_UC_ht+0x86d0, %r10
nop
nop
nop
nop
and $51144, %r13
mov (%r10), %cx
nop
add %rbp, %rbp
lea addresses_WC_ht+0x588, %r13
nop
dec %r10
movl $0x61626364, (%r13)
xor $6754, %r14
lea addresses_normal_ht+0x5148, %rdi
nop
nop
nop
and $29749, %rcx
and $0xffffffffffffffc0, %rdi
movaps (%rdi), %xmm7
vpextrq $0, %xmm7, %r10
nop
nop
nop
nop
xor %rcx, %rcx
lea addresses_normal_ht+0x1b3f4, %rsi
nop
nop
lfence
mov $0x6162636465666768, %rcx
movq %rcx, %xmm5
movups %xmm5, (%rsi)
nop
nop
nop
nop
nop
sub $30434, %rbp
lea addresses_UC_ht+0xd568, %rsi
lea addresses_UC_ht+0x13468, %rdi
nop
nop
and $56015, %rdx
mov $8, %rcx
rep movsw
nop
nop
nop
nop
nop
add $46868, %rbp
lea addresses_normal_ht+0xebe8, %rcx
nop
nop
nop
nop
xor %rbp, %rbp
movb (%rcx), %r13b
nop
nop
nop
nop
add %r13, %r13
lea addresses_WT_ht+0x18e8, %r14
nop
nop
nop
nop
nop
xor %rcx, %rcx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm0
vmovups %ymm0, (%r14)
nop
add %rcx, %rcx
lea addresses_normal_ht+0xb228, %rsi
lea addresses_WT_ht+0x17f68, %rdi
nop
nop
nop
nop
nop
sub $59991, %rdx
mov $14, %rcx
rep movsw
nop
cmp %rbp, %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r8
push %r9
push %rax
push %rbp
push %rdi
// Store
lea addresses_WC+0x171e8, %rbp
nop
nop
nop
add %rdi, %rdi
movl $0x51525354, (%rbp)
nop
add %r10, %r10
// Store
lea addresses_WT+0x3d28, %r12
nop
nop
nop
nop
dec %rbp
movl $0x51525354, (%r12)
// Exception!!!
nop
nop
nop
nop
mov (0), %r9
nop
nop
nop
sub %rdi, %rdi
// Store
lea addresses_WC+0x181e8, %rbp
nop
nop
nop
nop
and $875, %r8
mov $0x5152535455565758, %r12
movq %r12, %xmm3
vmovups %ymm3, (%rbp)
nop
nop
xor %rdi, %rdi
// Store
lea addresses_US+0x18b70, %rbp
nop
nop
nop
nop
xor $31412, %r10
mov $0x5152535455565758, %r9
movq %r9, (%rbp)
nop
nop
nop
and %r8, %r8
// Store
lea addresses_A+0x21e8, %r9
nop
nop
nop
xor %r12, %r12
mov $0x5152535455565758, %r8
movq %r8, %xmm3
movups %xmm3, (%r9)
xor %rbp, %rbp
// Store
lea addresses_WC+0x181e8, %rdi
nop
nop
nop
nop
nop
xor $21086, %r12
movl $0x51525354, (%rdi)
nop
nop
nop
nop
sub $57767, %rax
// Faulty Load
lea addresses_WC+0x181e8, %r12
nop
dec %r8
mov (%r12), %r10w
lea oracles, %r8
and $0xff, %r10
shlq $12, %r10
mov (%r8,%r10,1), %r10
pop %rdi
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 6, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': True, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 9, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'54': 21829}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
| 30.316364
| 2,999
| 0.655032
|
be8860967aa6c1ca188fb610b1d157176e5763f9
| 48,347
|
asm
|
Assembly
|
src/backend/x64/amd64/fp_x64.asm
|
anang0g0/sidh-rs
|
845316f83e46345d0f1343906e43064b02eb53e7
|
[
"MIT"
] | 11
|
2018-01-03T15:52:02.000Z
|
2021-11-03T16:49:37.000Z
|
src/backend/x64/amd64/fp_x64.asm
|
anang0g0/sidh-rs
|
845316f83e46345d0f1343906e43064b02eb53e7
|
[
"MIT"
] | 3
|
2018-01-23T11:49:29.000Z
|
2021-11-05T14:54:46.000Z
|
src/backend/x64/amd64/fp_x64.asm
|
anang0g0/sidh-rs
|
845316f83e46345d0f1343906e43064b02eb53e7
|
[
"MIT"
] | 6
|
2018-01-23T09:07:20.000Z
|
2022-03-22T17:04:41.000Z
|
;*******************************************************************************************
; SIDH: an efficient supersingular isogeny cryptography library
;
; Abstract: field arithmetic in x64 assembly for P751 on Windows
;*******************************************************************************************
.const
; Under Windows we need to use RCX, RDX and R8 as registers for the first three parameters as that
; is the usual calling convention (cf. https://docs.microsoft.com/en-us/cpp/build/parameter-passing).
reg_p1 equ rcx
reg_p2 equ rdx
reg_p3 equ r8
p751_0 equ 0FFFFFFFFFFFFFFFFh
p751_5 equ 0EEAFFFFFFFFFFFFFh
p751_6 equ 0E3EC968549F878A8h
p751_7 equ 0DA959B1A13F7CC76h
p751_8 equ 0084E9867D6EBE876h
p751_9 equ 08562B5045CB25748h
p751_10 equ 00E12909F97BADC66h
p751_11 equ 000006FE5D541F71Ch
; p751 + 1
p751p1_5 equ 0EEB0000000000000h
p751p1_6 equ 0E3EC968549F878A8h
p751p1_7 equ 0DA959B1A13F7CC76h
p751p1_8 equ 0084E9867D6EBE876h
p751p1_9 equ 08562B5045CB25748h
p751p1_10 equ 00E12909F97BADC66h
p751p1_11 equ 000006FE5D541F71Ch
; p751 x 2
p751x2_0 equ 0FFFFFFFFFFFFFFFEh
p751x2_1 equ 0FFFFFFFFFFFFFFFFh
p751x2_5 equ 0DD5FFFFFFFFFFFFFh
p751x2_6 equ 0C7D92D0A93F0F151h
p751x2_7 equ 0B52B363427EF98EDh
p751x2_8 equ 0109D30CFADD7D0EDh
p751x2_9 equ 00AC56A08B964AE90h
p751x2_10 equ 01C25213F2F75B8CDh
p751x2_11 equ 00000DFCBAA83EE38h
.code
;***********************************************************************
; Conditional swap
; Operation:
; If choice [reg_p3] = 0, leave x[reg_p1],y[reg_p2] unchanged.
; If choice [reg_p3] = 1, set x[reg_p1],y[reg_p2] = y[reg_p2],x[reg_p1].
;***********************************************************************
cswap751_asm proc
push rbx
push rdi
push rsi
movzx rax, r8b ; Get the lower 8 bits of r8 (reg_p3)
neg rax
mov rbx, [reg_p1] ; rbx = x[0]
mov rdi, [reg_p2] ; rdi = y[0]
mov rsi, rdi ; rsi = y[0]
xor rsi, rbx ; rsi = y[0] ^ x[0]
and rsi, rax ; rsi = (y[0] ^ x[0]) & mask
xor rbx, rsi ; rbx = (y[0] ^ x[0]) & mask) ^ y[0] = x[0] or y[0]
xor rdi, rsi ; rdi = (y[0] ^ x[0]) & mask) ^ y[0] = y[0] or x[0]
mov [reg_p1], rbx
mov [reg_p2], rdi
mov rbx, [reg_p1+8]
mov rdi, [reg_p2+8]
mov rsi, rdi
xor rsi, rbx
and rsi, rax
xor rbx, rsi
xor rdi, rsi
mov [reg_p1+8], rbx
mov [reg_p2+8], rdi
mov rbx, [reg_p1+16]
mov rdi, [reg_p2+16]
mov rsi, rdi
xor rsi, rbx
and rsi, rax
xor rbx, rsi
xor rdi, rsi
mov [reg_p1+16], rbx
mov [reg_p2+16], rdi
mov rbx, [reg_p1+24]
mov rdi, [reg_p2+24]
mov rsi, rdi
xor rsi, rbx
and rsi, rax
xor rbx, rsi
xor rdi, rsi
mov [reg_p1+24], rbx
mov [reg_p2+24], rdi
mov rbx, [reg_p1+32]
mov rdi, [reg_p2+32]
mov rsi, rdi
xor rsi, rbx
and rsi, rax
xor rbx, rsi
xor rdi, rsi
mov [reg_p1+32], rbx
mov [reg_p2+32], rdi
mov rbx, [reg_p1+40]
mov rdi, [reg_p2+40]
mov rsi, rdi
xor rsi, rbx
and rsi, rax
xor rbx, rsi
xor rdi, rsi
mov [reg_p1+40], rbx
mov [reg_p2+40], rdi
mov rbx, [reg_p1+48]
mov rdi, [reg_p2+48]
mov rsi, rdi
xor rsi, rbx
and rsi, rax
xor rbx, rsi
xor rdi, rsi
mov [reg_p1+48], rbx
mov [reg_p2+48], rdi
mov rbx, [reg_p1+56]
mov rdi, [reg_p2+56]
mov rsi, rdi
xor rsi, rbx
and rsi, rax
xor rbx, rsi
xor rdi, rsi
mov [reg_p1+56], rbx
mov [reg_p2+56], rdi
mov rbx, [reg_p1+64]
mov rdi, [reg_p2+64]
mov rsi, rdi
xor rsi, rbx
and rsi, rax
xor rbx, rsi
xor rdi, rsi
mov [reg_p1+64], rbx
mov [reg_p2+64], rdi
mov rbx, [reg_p1+72]
mov rdi, [reg_p2+72]
mov rsi, rdi
xor rsi, rbx
and rsi, rax
xor rbx, rsi
xor rdi, rsi
mov [reg_p1+72], rbx
mov [reg_p2+72], rdi
mov rbx, [reg_p1+80]
mov rdi, [reg_p2+80]
mov rsi, rdi
xor rsi, rbx
and rsi, rax
xor rbx, rsi
xor rdi, rsi
mov [reg_p1+80], rbx
mov [reg_p2+80], rdi
mov rbx, [reg_p1+88]
mov rdi, [reg_p2+88]
mov rsi, rdi
xor rsi, rbx
and rsi, rax
xor rbx, rsi
xor rdi, rsi
mov [reg_p1+88], rbx
mov [reg_p2+88], rdi
pop rsi
pop rdi
pop rbx
ret
cswap751_asm endp
;***********************************************************************
; Conditional assign
; Operation: If choice [reg_p3] = 0, leave x [reg_p1] unchanged.
; If choice [reg_p3] = 1, set x [reg_p1] = y [reg_p2].
;***********************************************************************
cassign751_asm proc
push rbx
push rdi
push rsi
movzx rax, r8b ; Get the lower 8 bits of r8 (reg_p3)
neg rax
mov rbx, [reg_p1] ; rbx = x[0]
mov rdi, [reg_p2] ; rdi = y[0]
xor rdi, rbx ; rdi = y[0] ^ x[0]
and rdi, rax ; rdi = (y[0] ^ x[0]) & mask
xor rdi, rbx ; rdi = (y[0] ^ x[0]) & mask) ^ x[0]
mov [reg_p1], rdi ; = x[0] or y[0]
mov rbx, [reg_p1+8]
mov rdi, [reg_p2+8]
xor rdi, rbx
and rdi, rax
xor rdi, rbx
mov [reg_p1+8], rdi
mov rbx, [reg_p1+16]
mov rdi, [reg_p2+16]
xor rdi, rbx
and rdi, rax
xor rdi, rbx
mov [reg_p1+16], rdi
mov rbx, [reg_p1+24]
mov rdi, [reg_p2+24]
xor rdi, rbx
and rdi, rax
xor rdi, rbx
mov [reg_p1+24], rdi
mov rbx, [reg_p1+32]
mov rdi, [reg_p2+32]
xor rdi, rbx
and rdi, rax
xor rdi, rbx
mov [reg_p1+32], rdi
mov rbx, [reg_p1+40]
mov rdi, [reg_p2+40]
xor rdi, rbx
and rdi, rax
xor rdi, rbx
mov [reg_p1+40], rdi
mov rbx, [reg_p1+48]
mov rdi, [reg_p2+48]
xor rdi, rbx
and rdi, rax
xor rdi, rbx
mov [reg_p1+48], rdi
mov rbx, [reg_p1+56]
mov rdi, [reg_p2+56]
xor rdi, rbx
and rdi, rax
xor rdi, rbx
mov [reg_p1+56], rdi
mov rbx, [reg_p1+64]
mov rdi, [reg_p2+64]
xor rdi, rbx
and rdi, rax
xor rdi, rbx
mov [reg_p1+64], rdi
mov rbx, [reg_p1+72]
mov rdi, [reg_p2+72]
xor rdi, rbx
and rdi, rax
xor rdi, rbx
mov [reg_p1+72], rdi
mov rbx, [reg_p1+80]
mov rdi, [reg_p2+80]
xor rdi, rbx
and rdi, rax
xor rdi, rbx
mov [reg_p1+80], rdi
mov rbx, [reg_p1+88]
mov rdi, [reg_p2+88]
xor rdi, rbx
and rdi, rax
xor rdi, rbx
mov [reg_p1+88], rdi
pop rsi
pop rdi
pop rbx
ret
cassign751_asm endp
;***********************************************************************
; Field addition
; Operation: c [reg_p3] = a [reg_p1] + b [reg_p2]
;***********************************************************************
fpadd751_asm proc
push r12
push r13
push r14
push r15
push rbx
push rdi
push rsi
mov rbx, [reg_p1]
mov r9, [reg_p1+8]
mov r10, [reg_p1+16]
mov r11, [reg_p1+24]
mov r12, [reg_p1+32]
mov r13, [reg_p1+40]
mov r14, [reg_p1+48]
mov r15, [reg_p1+56]
mov rdi, [reg_p1+64]
add rbx, [reg_p2]
adc r9, [reg_p2+8]
adc r10, [reg_p2+16]
adc r11, [reg_p2+24]
adc r12, [reg_p2+32]
adc r13, [reg_p2+40]
adc r14, [reg_p2+48]
adc r15, [reg_p2+56]
adc rdi, [reg_p2+64]
mov rax, [reg_p1+72]
adc rax, [reg_p2+72]
mov [reg_p3+72], rax
mov rax, [reg_p1+80]
adc rax, [reg_p2+80]
mov [reg_p3+80], rax
mov rax, [reg_p1+88]
adc rax, [reg_p2+88]
mov [reg_p3+88], rax
mov rax, p751x2_0
sub rbx, rax
mov rax, p751x2_1
sbb r9, rax
sbb r10, rax
sbb r11, rax
sbb r12, rax
mov rax, p751x2_5
sbb r13, rax
mov rax, p751x2_6
sbb r14, rax
mov rax, p751x2_7
sbb r15, rax
mov rax, p751x2_8
sbb rdi, rax
mov [reg_p3], rbx
mov [reg_p3+8], r9
mov [reg_p3+16], r10
mov [reg_p3+24], r11
mov [reg_p3+32], r12
mov [reg_p3+40], r13
mov [reg_p3+48], r14
mov [reg_p3+56], r15
mov [reg_p3+64], rdi
mov rbx, [reg_p3+72]
mov r9, [reg_p3+80]
mov r10, [reg_p3+88]
mov rax, p751x2_9
sbb rbx, rax
mov rax, p751x2_10
sbb r9, rax
mov rax, p751x2_11
sbb r10, rax
mov [reg_p3+72], rbx
mov [reg_p3+80], r9
mov [reg_p3+88], r10
mov rax, 0
sbb rax, 0
mov rsi, p751x2_0
and rsi, rax
mov rbx, p751x2_1
and rbx, rax
mov r9, p751x2_5
and r9, rax
mov r10, p751x2_6
and r10, rax
mov r11, p751x2_7
and r11, rax
mov r12, p751x2_8
and r12, rax
mov r13, p751x2_9
and r13, rax
mov r14, p751x2_10
and r14, rax
mov r15, p751x2_11
and r15, rax
mov rax, [reg_p3]
add rax, rsi
mov [reg_p3], rax
mov rax, [reg_p3+8]
adc rax, rbx
mov [reg_p3+8], rax
mov rax, [reg_p3+16]
adc rax, rbx
mov [reg_p3+16], rax
mov rax, [reg_p3+24]
adc rax, rbx
mov [reg_p3+24], rax
mov rax, [reg_p3+32]
adc rax, rbx
mov [reg_p3+32], rax
mov rax, [reg_p3+40]
adc rax, r9
mov [reg_p3+40], rax
mov rax, [reg_p3+48]
adc rax, r10
mov [reg_p3+48], rax
mov rax, [reg_p3+56]
adc rax, r11
mov [reg_p3+56], rax
mov rax, [reg_p3+64]
adc rax, r12
mov [reg_p3+64], rax
mov rax, [reg_p3+72]
adc rax, r13
mov [reg_p3+72], rax
mov rax, [reg_p3+80]
adc rax, r14
mov [reg_p3+80], rax
mov rax, [reg_p3+88]
adc rax, r15
mov [reg_p3+88], rax
pop rsi
pop rdi
pop rbx
pop r15
pop r14
pop r13
pop r12
ret
fpadd751_asm endp
;***********************************************************************
; Field subtraction
; Operation: c [reg_p3] = a [reg_p1] - b [reg_p2]
;***********************************************************************
fpsub751_asm proc
push r12
push r13
push r14
push r15
push rbx
push rdi
push rsi
mov rbx, [reg_p1]
mov r9, [reg_p1+8]
mov r10, [reg_p1+16]
mov r11, [reg_p1+24]
mov r12, [reg_p1+32]
mov r13, [reg_p1+40]
mov r14, [reg_p1+48]
mov r15, [reg_p1+56]
mov rdi, [reg_p1+64]
sub rbx, [reg_p2]
sbb r9, [reg_p2+8]
sbb r10, [reg_p2+16]
sbb r11, [reg_p2+24]
sbb r12, [reg_p2+32]
sbb r13, [reg_p2+40]
sbb r14, [reg_p2+48]
sbb r15, [reg_p2+56]
sbb rdi, [reg_p2+64]
mov [reg_p3], rbx
mov [reg_p3+8], r9
mov [reg_p3+16], r10
mov [reg_p3+24], r11
mov [reg_p3+32], r12
mov [reg_p3+40], r13
mov [reg_p3+48], r14
mov [reg_p3+56], r15
mov [reg_p3+64], rdi
mov rax, [reg_p1+72]
sbb rax, [reg_p2+72]
mov [reg_p3+72], rax
mov rax, [reg_p1+80]
sbb rax, [reg_p2+80]
mov [reg_p3+80], rax
mov rax, [reg_p1+88]
sbb rax, [reg_p2+88]
mov [reg_p3+88], rax
mov rax, 0
sbb rax, 0
mov rsi, p751x2_0
and rsi, rax
mov rbx, p751x2_1
and rbx, rax
mov r9, p751x2_5
and r9, rax
mov r10, p751x2_6
and r10, rax
mov r11, p751x2_7
and r11, rax
mov r12, p751x2_8
and r12, rax
mov r13, p751x2_9
and r13, rax
mov r14, p751x2_10
and r14, rax
mov r15, p751x2_11
and r15, rax
mov rax, [reg_p3]
add rax, rsi
mov [reg_p3], rax
mov rax, [reg_p3+8]
adc rax, rbx
mov [reg_p3+8], rax
mov rax, [reg_p3+16]
adc rax, rbx
mov [reg_p3+16], rax
mov rax, [reg_p3+24]
adc rax, rbx
mov [reg_p3+24], rax
mov rax, [reg_p3+32]
adc rax, rbx
mov [reg_p3+32], rax
mov rax, [reg_p3+40]
adc rax, r9
mov [reg_p3+40], rax
mov rax, [reg_p3+48]
adc rax, r10
mov [reg_p3+48], rax
mov rax, [reg_p3+56]
adc rax, r11
mov [reg_p3+56], rax
mov rax, [reg_p3+64]
adc rax, r12
mov [reg_p3+64], rax
mov rax, [reg_p3+72]
adc rax, r13
mov [reg_p3+72], rax
mov rax, [reg_p3+80]
adc rax, r14
mov [reg_p3+80], rax
mov rax, [reg_p3+88]
adc rax, r15
mov [reg_p3+88], rax
pop rsi
pop rdi
pop rbx
pop r15
pop r14
pop r13
pop r12
ret
fpsub751_asm endp
;***********************************************************************
; Integer multiplication
; Based on Karatsuba method
; Operation: c [reg_p3] = a [reg_p1] * b [reg_p2]
; NOTE: a=c or b=c are not allowed
;***********************************************************************
mul751_asm proc
push r12
push r13
push r14
push rbx
mov rbx, reg_p3
push rdi
; Here we move reg_p2 to RDI instead of using it directly because
; the multiplication instructions use DX as an implicit destination
; operand: MUL $REG sets DX:AX <-- AX * $REG.
mov rdi, reg_p2
push rsi
; rbx[0-5] <- AH+AL
xor rax, rax
mov r8, [reg_p1+48]
mov r9, [reg_p1+56]
mov r10, [reg_p1+64]
mov r11, [reg_p1+72]
mov r12, [reg_p1+80]
mov r13, [reg_p1+88]
add r8, [reg_p1]
adc r9, [reg_p1+8]
adc r10, [reg_p1+16]
adc r11, [reg_p1+24]
adc r12, [reg_p1+32]
adc r13, [reg_p1+40]
push r15
mov [rbx], r8
mov [rbx+8], r9
mov [rbx+16], r10
mov [rbx+24], r11
mov [rbx+32], r12
mov [rbx+40], r13
sbb rax, 0
sub rsp, 96 ; Allocating space in stack
; rbx[6-11] <- BH+BL
xor rdx, rdx
mov r8, [rdi+48]
mov r9, [rdi+56]
mov r10, [rdi+64]
mov r11, [rdi+72]
mov r12, [rdi+80]
mov r13, [rdi+88]
add r8, [rdi]
adc r9, [rdi+8]
adc r10, [rdi+16]
adc r11, [rdi+24]
adc r12, [rdi+32]
adc r13, [rdi+40]
mov [rbx+48], r8
mov [rbx+56], r9
mov [rbx+64], r10
mov [rbx+72], r11
mov [rbx+80], r12
mov [rbx+88], r13
sbb rdx, 0
mov [rsp+80], rax
mov [rsp+88], rdx
; (rsp[0-8],r10,r8,r9) <- (AH+AL)*(BH+BL)
mov r11, [rbx]
mov rax, r8
mul r11
mov [rsp], rax ; c0
mov r14, rdx
xor r15, r15
mov rax, r9
mul r11
xor r9, r9
add r14, rax
adc r9, rdx
mov r12, [rbx+8]
mov rax, r8
mul r12
add r14, rax
mov [rsp+8], r14 ; c1
adc r9, rdx
adc r15, 0
xor r8, r8
mov rax, r10
mul r11
add r9, rax
mov r13, [rbx+48]
adc r15, rdx
adc r8, 0
mov rax, [rbx+16]
mul r13
add r9, rax
adc r15, rdx
mov rax, [rbx+56]
adc r8, 0
mul r12
add r9, rax
mov [rsp+16], r9 ; c2
adc r15, rdx
adc r8, 0
xor r9, r9
mov rax, [rbx+72]
mul r11
add r15, rax
adc r8, rdx
adc r9, 0
mov rax, [rbx+24]
mul r13
add r15, rax
adc r8, rdx
adc r9, 0
mov rax, r10
mul r12
add r15, rax
adc r8, rdx
adc r9, 0
mov r14, [rbx+16]
mov rax, [rbx+56]
mul r14
add r15, rax
mov [rsp+24], r15 ; c3
adc r8, rdx
adc r9, 0
xor r10, r10
mov rax, [rbx+80]
mul r11
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rbx+64]
mul r14
add r8, rax
adc r9, rdx
adc r10, 0
mov r15, [rbx+48]
mov rax, [rbx+32]
mul r15
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rbx+72]
mul r12
add r8, rax
adc r9, rdx
adc r10, 0
mov r13, [rbx+24]
mov rax, [rbx+56]
mul r13
add r8, rax
mov [rsp+32], r8 ; c4
adc r9, rdx
adc r10, 0
xor r8, r8
mov rax, [rbx+88]
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rbx+64]
mul r13
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rbx+72]
mul r14
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rbx+40]
mul r15
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rbx+80]
mul r12
add r9, rax
adc r10, rdx
adc r8, 0
mov r15, [rbx+32]
mov rax, [rbx+56]
mul r15
add r9, rax
mov [rsp+40], r9 ; c5
adc r10, rdx
adc r8, 0
xor r9, r9
mov rax, [rbx+64]
mul r15
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rbx+88]
mul r12
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rbx+80]
mul r14
add r10, rax
adc r8, rdx
adc r9, 0
mov r11, [rbx+40]
mov rax, [rbx+56]
mul r11
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rbx+72]
mul r13
add r10, rax
mov [rsp+48], r10 ; c6
adc r8, rdx
adc r9, 0
xor r10, r10
mov rax, [rbx+88]
mul r14
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rbx+64]
mul r11
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rbx+80]
mul r13
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rbx+72]
mul r15
add r8, rax
mov [rsp+56], r8 ; c7
adc r9, rdx
adc r10, 0
xor r8, r8
mov rax, [rbx+72]
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rbx+80]
mul r15
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rbx+88]
mul r13
add r9, rax
mov [rsp+64], r9 ; c8
adc r10, rdx
adc r8, 0
xor r9, r9
mov rax, [rbx+88]
mul r15
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rbx+80]
mul r11
add r10, rax ; c9
adc r8, rdx
adc r9, 0
mov rax, [rbx+88]
mul r11
add r8, rax ; c10
adc r9, rdx ; c11
mov rax, [rsp+88]
mov rdx, [rbx]
and r12, rax
and r14, rax
and rdx, rax
and r13, rax
and r15, rax
and r11, rax
mov rax, [rsp+48]
add rdx, rax
mov rax, [rsp+56]
adc r12, rax
mov rax, [rsp+64]
adc r14, rax
adc r13, r10
adc r15, r8
adc r11, r9
mov rax, [rsp+80]
mov [rsp+48], rdx
mov [rsp+56], r12
mov [rsp+64], r14
mov [rsp+72], r13
mov [rsp+80], r15
mov [rsp+88], r11
mov r8, [rbx+48]
mov r9, [rbx+56]
mov r10, [rbx+64]
mov r11, [rbx+72]
mov r12, [rbx+80]
mov r13, [rbx+88]
and r8, rax
and r9, rax
and r10, rax
and r11, rax
and r12, rax
and r13, rax
mov rax, [rsp+48]
add r8, rax
mov rax, [rsp+56]
adc r9, rax
mov rax, [rsp+64]
adc r10, rax
mov rax, [rsp+72]
adc r11, rax
mov rax, [rsp+80]
adc r12, rax
mov rax, [rsp+88]
adc r13, rax
mov [rsp+48], r8
mov [rsp+56], r9
mov [rsp+72], r11
; rbx[0-11] <- AL*BL
mov r11, [reg_p1]
mov rax, [rdi]
mul r11
xor r9, r9
mov [rbx], rax ; c0
mov [rsp+64], r10
mov r8, rdx
mov rax, [rdi+8]
mul r11
xor r10, r10
add r8, rax
mov [rsp+80], r12
adc r9, rdx
mov r12, [reg_p1+8]
mov rax, [rdi]
mul r12
add r8, rax
mov [rbx+8], r8 ; c1
adc r9, rdx
mov [rsp+88], r13
adc r10, 0
xor r8, r8
mov rax, [rdi+16]
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov r13, [rdi]
mov rax, [reg_p1+16]
mul r13
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+8]
mul r12
add r9, rax
mov [rbx+16], r9 ; c2
adc r10, rdx
adc r8, 0
xor r9, r9
mov rax, [rdi+24]
mul r11
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [reg_p1+24]
mul r13
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rdi+16]
mul r12
add r10, rax
adc r8, rdx
adc r9, 0
mov r14, [reg_p1+16]
mov rax, [rdi+8]
mul r14
add r10, rax
mov [rbx+24], r10 ; c3
adc r8, rdx
adc r9, 0
xor r10, r10
mov rax, [rdi+32]
mul r11
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rdi+16]
mul r14
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [reg_p1+32]
mul r13
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rdi+24]
mul r12
add r8, rax
adc r9, rdx
adc r10, 0
mov r13, [reg_p1+24]
mov rax, [rdi+8]
mul r13
add r8, rax
mov [rbx+32], r8 ; c4
adc r9, rdx
adc r10, 0
xor r8, r8
mov rax, [rdi+40]
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+16]
mul r13
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+24]
mul r14
add r9, rax
adc r10, rdx
adc r8, 0
mov r11, [reg_p1+40]
mov rax, [rdi]
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+32]
mul r12
add r9, rax
adc r10, rdx
adc r8, 0
mov r15, [reg_p1+32]
mov rax, [rdi+8]
mul r15
add r9, rax
mov [rbx+40], r9 ; c5
adc r10, rdx
adc r8, 0
xor r9, r9
mov rax, [rdi+16]
mul r15
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rdi+40]
mul r12
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rdi+32]
mul r14
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rdi+8]
mul r11
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rdi+24]
mul r13
add r10, rax
mov [rbx+48], r10 ; c6
adc r8, rdx
adc r9, 0
xor r10, r10
mov rax, [rdi+40]
mul r14
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rdi+16]
mul r11
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rdi+32]
mul r13
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rdi+24]
mul r15
add r8, rax
mov [rbx+56], r8 ; c7
adc r9, rdx
adc r10, 0
xor r8, r8
mov rax, [rdi+24]
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+32]
mul r15
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+40]
mul r13
add r9, rax
mov [rbx+64], r9 ; c8
adc r10, rdx
adc r8, 0
xor r9, r9
mov rax, [rdi+40]
mul r15
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rdi+32]
mul r11
add r10, rax
mov [rbx+72], r10 ; c9
adc r8, rdx
adc r9, 0
mov rax, [rdi+40]
mul r11
add r8, rax
mov [rbx+80], r8 ; c10
adc r9, rdx
mov [rbx+88], r9 ; c11
; rbx[12-23] <- AH*BH
mov r11, [reg_p1+48]
mov rax, [rdi+48]
mul r11
xor r9, r9
mov [rbx+96], rax ; c0
mov r8, rdx
mov rax, [rdi+56]
mul r11
xor r10, r10
add r8, rax
adc r9, rdx
mov r12, [reg_p1+56]
mov rax, [rdi+48]
mul r12
add r8, rax
mov [rbx+104], r8 ; c1
adc r9, rdx
adc r10, 0
xor r8, r8
mov rax, [rdi+64]
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov r13, [rdi+48]
mov rax, [reg_p1+64]
mul r13
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+56]
mul r12
add r9, rax
mov [rbx+112], r9 ; c2
adc r10, rdx
adc r8, 0
xor r9, r9
mov rax, [rdi+72]
mul r11
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [reg_p1+72]
mul r13
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rdi+64]
mul r12
add r10, rax
adc r8, rdx
adc r9, 0
mov r14, [reg_p1+64]
mov rax, [rdi+56]
mul r14
add r10, rax
mov [rbx+120], r10 ; c3
adc r8, rdx
adc r9, 0
xor r10, r10
mov rax, [rdi+80]
mul r11
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rdi+64]
mul r14
add r8, rax
adc r9, rdx
adc r10, 0
mov r15, [reg_p1+80]
mov rax, r13
mul r15
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rdi+72]
mul r12
add r8, rax
adc r9, rdx
adc r10, 0
mov r13, [reg_p1+72]
mov rax, [rdi+56]
mul r13
add r8, rax
mov [rbx+128], r8 ; c4
adc r9, rdx
adc r10, 0
xor r8, r8
mov rax, [rdi+88]
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+64]
mul r13
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+72]
mul r14
add r9, rax
adc r10, rdx
adc r8, 0
mov r11, [reg_p1+88]
mov rax, [rdi+48]
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+80]
mul r12
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+56]
mul r15
add r9, rax
mov [rbx+136], r9 ; c5
adc r10, rdx
adc r8, 0
xor r9, r9
mov rax, [rdi+64]
mul r15
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rdi+88]
mul r12
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rdi+80]
mul r14
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rdi+56]
mul r11
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, [rdi+72]
mul r13
add r10, rax
mov [rbx+144], r10 ; c6
adc r8, rdx
adc r9, 0
xor r10, r10
mov rax, [rdi+88]
mul r14
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rdi+64]
mul r11
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rdi+80]
mul r13
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, [rdi+72]
mul r15
add r8, rax
mov [rbx+152], r8 ; c7
adc r9, rdx
adc r10, 0
xor r8, r8
mov rax, [rdi+72]
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+80]
mul r15
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, [rdi+88]
mul r13
add r9, rax
mov [rbx+160], r9 ; c8
adc r10, rdx
adc r8, 0
mov rax, [rdi+88]
mul r15
add r10, rax
adc r8, rdx
mov rax, [rdi+80]
mul r11
add r10, rax
mov [rbx+168], r10 ; c9
adc r8, rdx
mov rax, [rdi+88]
mul r11
add r8, rax
mov [rbx+176], r8 ; c10
adc rdx, 0
mov [rbx+184], rdx ; c11
; [r8-r15,rax,rdx,rcx,[rsp]] <- (AH+AL)*(BH+BL) - AL*BL
mov r8, [rsp]
sub r8, [rbx]
mov r9, [rsp+8]
sbb r9, [rbx+8]
mov r10, [rsp+16]
sbb r10, [rbx+16]
mov r11, [rsp+24]
sbb r11, [rbx+24]
mov r12, [rsp+32]
sbb r12, [rbx+32]
mov r13, [rsp+40]
sbb r13, [rbx+40]
mov r14, [rsp+48]
sbb r14, [rbx+48]
mov r15, [rsp+56]
sbb r15, [rbx+56]
mov rax, [rsp+64]
sbb rax, [rbx+64]
mov rdx, [rsp+72]
sbb rdx, [rbx+72]
mov rcx, [rsp+80]
sbb rcx, [rbx+80]
mov rsi, [rsp+88]
sbb rsi, [rbx+88]
mov [rsp], rsi
; [r8-r15,rax,rdx,rcx,[rsp]] <- (AH+AL)*(BH+BL) - AL*BL - AH*BH
mov rsi, [rbx+96]
sub r8, rsi
mov rsi, [rbx+104]
sbb r9, rsi
mov rsi, [rbx+112]
sbb r10, rsi
mov rsi, [rbx+120]
sbb r11, rsi
mov rsi, [rbx+128]
sbb r12, rsi
mov rsi, [rbx+136]
sbb r13, rsi
mov rsi, [rbx+144]
sbb r14, rsi
mov rsi, [rbx+152]
sbb r15, rsi
mov rsi, [rbx+160]
sbb rax, rsi
mov rsi, [rbx+168]
sbb rdx, rsi
mov rsi, [rbx+176]
sbb rcx, rsi
mov rsi, [rsp]
sbb rsi, [rbx+184]
; Final result
add r8, [rbx+48]
mov [rbx+48], r8
adc r9, [rbx+56]
mov [rbx+56], r9
adc r10, [rbx+64]
mov [rbx+64], r10
adc r11, [rbx+72]
mov [rbx+72], r11
adc r12, [rbx+80]
mov [rbx+80], r12
adc r13, [rbx+88]
mov [rbx+88], r13
adc r14, [rbx+96]
mov [rbx+96], r14
adc r15, [rbx+104]
mov [rbx+104], r15
adc rax, [rbx+112]
mov [rbx+112], rax
adc rdx, [rbx+120]
mov [rbx+120], rdx
adc rcx, [rbx+128]
mov [rbx+128], rcx
adc rsi, [rbx+136]
mov [rbx+136], rsi
mov rax, [rbx+144]
adc rax, 0
mov [rbx+144], rax
mov rax, [rbx+152]
adc rax, 0
mov [rbx+152], rax
mov rax, [rbx+160]
adc rax, 0
mov [rbx+160], rax
mov rax, [rbx+168]
adc rax, 0
mov [rbx+168], rax
mov rax, [rbx+176]
adc rax, 0
mov [rbx+176], rax
mov rax, [rbx+184]
adc rax, 0
mov [rbx+184], rax
add rsp, 96 ; Restoring space in stack
pop rsi
pop rdi
pop rbx
pop r15
pop r14
pop r13
pop r12
ret
mul751_asm endp
;***********************************************************************
; Montgomery reduction
; Based on comba method
; Operation: c [reg_p2] = a [reg_p1]
; NOTE: a=c is not allowed
;***********************************************************************
rdc751_asm proc
push r12
push r13
push r14
push r15
push rbx
mov rbx, reg_p2
push rdi
mov r11, [reg_p1]
mov rax, p751p1_5
mul r11
xor r8, r8
add rax, [reg_p1+40]
mov [rbx+40], rax ; z5
adc r8, rdx
xor r9, r9
mov rax, p751p1_6
mul r11
xor r10, r10
add r8, rax
adc r9, rdx
mov r12, [reg_p1+8]
mov rax, p751p1_5
mul r12
add r8, rax
adc r9, rdx
adc r10, 0
add r8, [reg_p1+48]
mov [rbx+48], r8 ; z6
adc r9, 0
adc r10, 0
xor r8, r8
mov rax, p751p1_7
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_6
mul r12
add r9, rax
adc r10, rdx
adc r8, 0
mov r13, [reg_p1+16]
mov rax, p751p1_5
mul r13
add r9, rax
adc r10, rdx
adc r8, 0
add r9, [reg_p1+56]
mov [rbx+56], r9 ; z7
adc r10, 0
adc r8, 0
xor r9, r9
mov rax, p751p1_8
mul r11
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_7
mul r12
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_6
mul r13
add r10, rax
adc r8, rdx
adc r9, 0
mov r14, [reg_p1+24]
mov rax, p751p1_5
mul r14
add r10, rax
adc r8, rdx
adc r9, 0
add r10, [reg_p1+64]
mov [rbx+64], r10 ; z8
adc r8, 0
adc r9, 0
xor r10, r10
mov rax, p751p1_9
mul r11
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_8
mul r12
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_7
mul r13
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_6
mul r14
add r8, rax
adc r9, rdx
adc r10, 0
mov r15, [reg_p1+32]
mov rax, p751p1_5
mul r15
add r8, rax
adc r9, rdx
adc r10, 0
add r8, [reg_p1+72]
mov [rbx+72], r8 ; z9
adc r9, 0
adc r10, 0
xor r8, r8
mov rax, p751p1_10
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_9
mul r12
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_8
mul r13
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_7
mul r14
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_6
mul r15
add r9, rax
adc r10, rdx
adc r8, 0
mov rdi, [rbx+40]
mov rax, p751p1_5
mul rdi
add r9, rax
adc r10, rdx
adc r8, 0
add r9, [reg_p1+80]
mov [rbx+80], r9 ; z10
adc r10, 0
adc r8, 0
xor r9, r9
mov rax, p751p1_11
mul r11
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_10
mul r12
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_9
mul r13
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_8
mul r14
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_7
mul r15
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_6
mul rdi
add r10, rax
adc r8, rdx
adc r9, 0
mov r11, [rbx+48]
mov rax, p751p1_5
mul r11
add r10, rax
adc r8, rdx
adc r9, 0
add r10, [reg_p1+88]
mov [rbx+88], r10 ; z11
adc r8, 0
adc r9, 0
xor r10, r10
mov rax, p751p1_11
mul r12
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_10
mul r13
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_9
mul r14
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_8
mul r15
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_7
mul rdi
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_6
mul r11
add r8, rax
adc r9, rdx
adc r10, 0
mov r12, [rbx+56]
mov rax, p751p1_5
mul r12
add r8, rax
adc r9, rdx
adc r10, 0
add r8, [reg_p1+96]
mov [rbx], r8 ; z0
adc r9, 0
adc r10, 0
xor r8, r8
mov rax, p751p1_11
mul r13
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_10
mul r14
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_9
mul r15
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_8
mul rdi
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_7
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_6
mul r12
add r9, rax
adc r10, rdx
adc r8, 0
mov r13, [rbx+64]
mov rax, p751p1_5
mul r13
add r9, rax
adc r10, rdx
adc r8, 0
add r9, [reg_p1+104]
mov [rbx+8], r9 ; z1
adc r10, 0
adc r8, 0
xor r9, r9
mov rax, p751p1_11
mul r14
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_10
mul r15
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_9
mul rdi
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_8
mul r11
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_7
mul r12
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_6
mul r13
add r10, rax
adc r8, rdx
adc r9, 0
mov r14, [rbx+72]
mov rax, p751p1_5
mul r14
add r10, rax
adc r8, rdx
adc r9, 0
add r10, [reg_p1+112]
mov [rbx+16], r10 ; z2
adc r8, 0
adc r9, 0
xor r10, r10
mov rax, p751p1_11
mul r15
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_10
mul rdi
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_9
mul r11
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_8
mul r12
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_7
mul r13
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_6
mul r14
add r8, rax
adc r9, rdx
adc r10, 0
mov r15, [rbx+80]
mov rax, p751p1_5
mul r15
add r8, rax
adc r9, rdx
adc r10, 0
add r8, [reg_p1+120]
mov [rbx+24], r8 ; z3
adc r9, 0
adc r10, 0
xor r8, r8
mov rax, p751p1_11
mul rdi
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_10
mul r11
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_9
mul r12
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_8
mul r13
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_7
mul r14
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_6
mul r15
add r9, rax
adc r10, rdx
adc r8, 0
mov rdi, [rbx+88]
mov rax, p751p1_5
mul rdi
add r9, rax
adc r10, rdx
adc r8, 0
add r9, [reg_p1+128]
mov [rbx+32], r9 ; z4
adc r10, 0
adc r8, 0
xor r9, r9
mov rax, p751p1_11
mul r11
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_10
mul r12
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_9
mul r13
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_8
mul r14
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_7
mul r15
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_6
mul rdi
add r10, rax
adc r8, rdx
adc r9, 0
add r10, [reg_p1+136]
mov [rbx+40], r10 ; z5
adc r8, 0
adc r9, 0
xor r10, r10
mov rax, p751p1_11
mul r12
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_10
mul r13
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_9
mul r14
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_8
mul r15
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_7
mul rdi
add r8, rax
adc r9, rdx
adc r10, 0
add r8, [reg_p1+144]
mov [rbx+48], r8 ; z6
adc r9, 0
adc r10, 0
xor r8, r8
mov rax, p751p1_11
mul r13
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_10
mul r14
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_9
mul r15
add r9, rax
adc r10, rdx
adc r8, 0
mov rax, p751p1_8
mul rdi
add r9, rax
adc r10, rdx
adc r8, 0
add r9, [reg_p1+152]
mov [rbx+56], r9 ; z7
adc r10, 0
adc r8, 0
xor r9, r9
mov rax, p751p1_11
mul r14
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_10
mul r15
add r10, rax
adc r8, rdx
adc r9, 0
mov rax, p751p1_9
mul rdi
add r10, rax
adc r8, rdx
adc r9, 0
add r10, [reg_p1+160]
mov [rbx+64], r10 ; z8
adc r8, 0
adc r9, 0
xor r10, r10
mov rax, p751p1_11
mul r15
add r8, rax
adc r9, rdx
adc r10, 0
mov rax, p751p1_10
mul rdi
add r8, rax
adc r9, rdx
adc r10, 0
add r8, [reg_p1+168] ; z9
mov [rbx+72], r8 ; z9
adc r9, 0
adc r10, 0
mov rax, p751p1_11
mul rdi
add r9, rax
adc r10, rdx
add r9, [reg_p1+176] ; z10
mov [rbx+80], r9 ; z10
adc r10, 0
add r10, [reg_p1+184] ; z11
mov [rbx+88], r10 ; z11
pop rdi
pop rbx
pop r15
pop r14
pop r13
pop r12
ret
rdc751_asm endp
;***********************************************************************
; Strong reduce a field element in [0, 2*p) to one in [0,p)
; Operation: a [reg_p2] = a [reg_p1] mod p
;***********************************************************************
srdc751_asm proc
push r12
push r13
push r14
push r15
push rbx
; Zero rax for later use.
xor rax, rax
; Load p into registers
mov rbx, p751_0
; P751_{1,2,3,4} = P751_0, so reuse RBX
mov r9, p751_5
mov r10, p751_6
mov r11, p751_7
mov r12, p751_8
mov r13, p751_9
mov r14, p751_10
mov r15, p751_11
; Set x <- x - p
sub [reg_p1], rbx
sbb [reg_p1+8], rbx
sbb [reg_p1+16], rbx
sbb [reg_p1+24], rbx
sbb [reg_p1+32], rbx
sbb [reg_p1+40], r9
sbb [reg_p1+48], r10
sbb [reg_p1+56], r11
sbb [reg_p1+64], r12
sbb [reg_p1+72], r13
sbb [reg_p1+80], r14
sbb [reg_p1+88], r15
; Save carry flag indicating x-p < 0 as a mask in AX
sbb rax, 0
; Conditionally add p to x if x-p < 0
and rbx, rax
and r9, rax
and r10, rax
and r11, rax
and r12, rax
and r13, rax
and r14, rax
and r15, rax
adc [reg_p1], rbx
adc [reg_p1+8], rbx
adc [reg_p1+16], rbx
adc [reg_p1+24], rbx
adc [reg_p1+32], rbx
adc [reg_p1+40], r9
adc [reg_p1+48], r10
adc [reg_p1+56], r11
adc [reg_p1+64], r12
adc [reg_p1+72], r13
adc [reg_p1+80], r14
adc [reg_p1+88], r15
pop rbx
pop r15
pop r14
pop r13
pop r12
ret
srdc751_asm endp
;***********************************************************************
; 751-bit multiprecision addition
; Operation: c [reg_p3] = a [reg_p1] + b [reg_p2]
;***********************************************************************
mp_add751_asm proc
push r12
push r13
push r14
push r15
push rbx
push rdi
push rsi
mov r8, [reg_p1]
mov r9, [reg_p1+8]
mov r10, [reg_p1+16]
mov r11, [reg_p1+24]
mov r12, [reg_p1+32]
mov r13, [reg_p1+40]
mov r14, [reg_p1+48]
mov r15, [reg_p1+56]
mov rax, [reg_p1+64]
mov rbx, [reg_p1+72]
mov rsi, [reg_p1+80]
mov rdi, [reg_p1+88]
add r8, [reg_p2]
adc r9, [reg_p2+8]
adc r10, [reg_p2+16]
adc r11, [reg_p2+24]
adc r12, [reg_p2+32]
adc r13, [reg_p2+40]
adc r14, [reg_p2+48]
adc r15, [reg_p2+56]
adc rax, [reg_p2+64]
adc rbx, [reg_p2+72]
adc rsi, [reg_p2+80]
adc rdi, [reg_p2+88]
mov [reg_p3], r8
mov [reg_p3+8], r9
mov [reg_p3+16], r10
mov [reg_p3+24], r11
mov [reg_p3+32], r12
mov [reg_p3+40], r13
mov [reg_p3+48], r14
mov [reg_p3+56], r15
mov [reg_p3+64], rax
mov [reg_p3+72], rbx
mov [reg_p3+80], rsi
mov [reg_p3+88], rdi
pop rsi
pop rdi
pop rbx
pop r15
pop r14
pop r13
pop r12
ret
mp_add751_asm endp
;***********************************************************************
; 2x751-bit multiprecision addition
; Operation: c [reg_p3] = a [reg_p1] + b [reg_p2]
;***********************************************************************
mp_add751x2_asm proc
push r12
push r13
push r14
push r15
push rbx
push rdi
push rsi
mov rdi, [reg_p1]
mov r9, [reg_p1+8]
mov r10, [reg_p1+16]
mov r11, [reg_p1+24]
mov r12, [reg_p1+32]
mov r13, [reg_p1+40]
mov r14, [reg_p1+48]
mov r15, [reg_p1+56]
mov rax, [reg_p1+64]
mov rbx, [reg_p1+72]
mov rsi, [reg_p1+80]
add rdi, [reg_p2]
adc r9, [reg_p2+8]
adc r10, [reg_p2+16]
adc r11, [reg_p2+24]
adc r12, [reg_p2+32]
adc r13, [reg_p2+40]
adc r14, [reg_p2+48]
adc r15, [reg_p2+56]
adc rax, [reg_p2+64]
adc rbx, [reg_p2+72]
adc rsi, [reg_p2+80]
mov [reg_p3], rdi
mov [reg_p3+8], r9
mov [reg_p3+16], r10
mov [reg_p3+24], r11
mov [reg_p3+32], r12
mov [reg_p3+40], r13
mov [reg_p3+48], r14
mov [reg_p3+56], r15
mov [reg_p3+64], rax
mov [reg_p3+72], rbx
mov [reg_p3+80], rsi
mov rax, [reg_p1+88]
adc rax, [reg_p2+88]
mov [reg_p3+88], rax
mov rdi, [reg_p1+96]
mov r9, [reg_p1+104]
mov r10, [reg_p1+112]
mov r11, [reg_p1+120]
mov r12, [reg_p1+128]
mov r13, [reg_p1+136]
mov r14, [reg_p1+144]
mov r15, [reg_p1+152]
mov rax, [reg_p1+160]
mov rbx, [reg_p1+168]
mov rsi, [reg_p1+176]
mov rcx, [reg_p1+184]
adc rdi, [reg_p2+96]
adc r9, [reg_p2+104]
adc r10, [reg_p2+112]
adc r11, [reg_p2+120]
adc r12, [reg_p2+128]
adc r13, [reg_p2+136]
adc r14, [reg_p2+144]
adc r15, [reg_p2+152]
adc rax, [reg_p2+160]
adc rbx, [reg_p2+168]
adc rsi, [reg_p2+176]
adc rcx, [reg_p2+184]
mov [reg_p3+96], rdi
mov [reg_p3+104], r9
mov [reg_p3+112], r10
mov [reg_p3+120], r11
mov [reg_p3+128], r12
mov [reg_p3+136], r13
mov [reg_p3+144], r14
mov [reg_p3+152], r15
mov [reg_p3+160], rax
mov [reg_p3+168], rbx
mov [reg_p3+176], rsi
mov [reg_p3+184], rcx
pop rsi
pop rdi
pop rbx
pop r15
pop r14
pop r13
pop r12
ret
mp_add751x2_asm endp
;***********************************************************************
; 2x751-bit multiprecision subtraction
; Operation: c [reg_p3] = a [reg_p1] - b [reg_p2]. Returns borrow mask
;***********************************************************************
mp_sub751x2_asm proc
push r12
push r13
push r14
push r15
push rbx
push rdi
push rsi
mov rdi, [reg_p1]
mov r9, [reg_p1+8]
mov r10, [reg_p1+16]
mov r11, [reg_p1+24]
mov r12, [reg_p1+32]
mov r13, [reg_p1+40]
mov r14, [reg_p1+48]
mov r15, [reg_p1+56]
mov rax, [reg_p1+64]
mov rbx, [reg_p1+72]
mov rsi, [reg_p1+80]
sub rdi, [reg_p2]
sbb r9, [reg_p2+8]
sbb r10, [reg_p2+16]
sbb r11, [reg_p2+24]
sbb r12, [reg_p2+32]
sbb r13, [reg_p2+40]
sbb r14, [reg_p2+48]
sbb r15, [reg_p2+56]
sbb rax, [reg_p2+64]
sbb rbx, [reg_p2+72]
sbb rsi, [reg_p2+80]
mov [reg_p3], rdi
mov [reg_p3+8], r9
mov [reg_p3+16], r10
mov [reg_p3+24], r11
mov [reg_p3+32], r12
mov [reg_p3+40], r13
mov [reg_p3+48], r14
mov [reg_p3+56], r15
mov [reg_p3+64], rax
mov [reg_p3+72], rbx
mov [reg_p3+80], rsi
mov rax, [reg_p1+88]
sbb rax, [reg_p2+88]
mov [reg_p3+88], rax
mov rdi, [reg_p1+96]
mov r9, [reg_p1+104]
mov r10, [reg_p1+112]
mov r11, [reg_p1+120]
mov r12, [reg_p1+128]
mov r13, [reg_p1+136]
mov r14, [reg_p1+144]
mov r15, [reg_p1+152]
mov rax, [reg_p1+160]
mov rbx, [reg_p1+168]
mov rsi, [reg_p1+176]
mov rcx, [reg_p1+184]
sbb rdi, [reg_p2+96]
sbb r9, [reg_p2+104]
sbb r10, [reg_p2+112]
sbb r11, [reg_p2+120]
sbb r12, [reg_p2+128]
sbb r13, [reg_p2+136]
sbb r14, [reg_p2+144]
sbb r15, [reg_p2+152]
sbb rax, [reg_p2+160]
sbb rbx, [reg_p2+168]
sbb rsi, [reg_p2+176]
sbb rcx, [reg_p2+184]
mov [reg_p3+96], rdi
mov [reg_p3+104], r9
mov [reg_p3+112], r10
mov [reg_p3+120], r11
mov [reg_p3+128], r12
mov [reg_p3+136], r13
mov [reg_p3+144], r14
mov [reg_p3+152], r15
mov [reg_p3+160], rax
mov [reg_p3+168], rbx
mov [reg_p3+176], rsi
mov [reg_p3+184], rcx
; Now the carry flag is 1 if x-y < 0. If so, add p*2^768.
mov rax, 0
sbb rax, 0
; Load p into registers:
mov rdi, p751_0
; P751_{1,2,3,4} = P751_0, so reuse RDI
mov r9, p751_5
mov r10, p751_6
mov r11, p751_7
mov r12, p751_8
mov r13, p751_9
mov r14, p751_10
mov r15, p751_11
and rdi, rax
and r9, rax
and r10, rax
and r11, rax
and r12, rax
and r13, rax
and r14, rax
and r15, rax
add [reg_p3+96], rdi
adc [reg_p3+104], rdi
adc [reg_p3+112], rdi
adc [reg_p3+120], rdi
adc [reg_p3+128], rdi
adc [reg_p3+136], r9
adc [reg_p3+144], r10
adc [reg_p3+152], r11
adc [reg_p3+160], r12
adc [reg_p3+168], r13
adc [reg_p3+176], r14
adc [reg_p3+184], r15
pop rsi
pop rdi
pop rbx
pop r15
pop r14
pop r13
pop r12
ret
mp_sub751x2_asm endp
end
| 19.331068
| 101
| 0.483794
|
ebac0246d62860ab7a9b2d0df13cec30c74f58a8
| 38,196
|
asm
|
Assembly
|
output/out/main.asm
|
elseyf/gb8
|
2ee8ed2fe5df178385cf7363f24eabf31f581cc5
|
[
"MIT"
] | 16
|
2018-07-23T20:54:27.000Z
|
2022-01-27T01:44:47.000Z
|
output/out/main.asm
|
elseyf/gb8
|
2ee8ed2fe5df178385cf7363f24eabf31f581cc5
|
[
"MIT"
] | null | null | null |
output/out/main.asm
|
elseyf/gb8
|
2ee8ed2fe5df178385cf7363f24eabf31f581cc5
|
[
"MIT"
] | null | null | null |
;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 3.7.1 #10455 (MINGW64)
;--------------------------------------------------------
.module main
.optsdcc -mgbz80
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
.globl _main
.globl _key_hold
.globl _read_joypad
.globl _set_bg_map_tile
.globl _set_bg_chr
.globl _fill
.globl _fastcpy
.globl _set_bg_map_select
.globl _gb8_display
.globl _gb8_mem
.globl _gb8_sound_timer
.globl _gb8_delay_timer
.globl _gb8_i
.globl _gb8_seed
.globl _gb8_v
.globl _gb8_stack_p
.globl _gb8_stack
.globl _gb8_pc
.globl _sp_buffer
.globl _gb8_font
.globl _gb8_key_map
.globl _gb8_clear_screen
.globl _gb8_get_key
.globl _gb8_draw_sprite
.globl _gb8_bcd_vx
.globl _gb8_rnd
.globl _gb8_step
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
;--------------------------------------------------------
; ram data
;--------------------------------------------------------
.area _DATA
_sp_buffer::
.ds 2
_gb8_pc::
.ds 2
_gb8_stack::
.ds 64
_gb8_stack_p::
.ds 1
_gb8_v::
.ds 16
_gb8_seed::
.ds 1
_gb8_i::
.ds 2
_gb8_delay_timer::
.ds 1
_gb8_sound_timer::
.ds 1
_gb8_mem::
.ds 4096
_gb8_display = 0xd800
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
.area _DABS (ABS)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
.area _HOME
.area _GSINIT
.area _GSFINAL
.area _GSINIT
;--------------------------------------------------------
; Home
;--------------------------------------------------------
.area _HOME
.area _HOME
;--------------------------------------------------------
; code
;--------------------------------------------------------
.area _CODE
;src/main.c:143: void main(){
; ---------------------------------
; Function main
; ---------------------------------
_main::
add sp, #-6
;src/gb.h:141: inline bool display_state(){return (*reg(REG_LCDC) & LCDC_DISPLAY_ENABLE);}
ld de, #0xff40
ld a,(de)
ld c,a
rlc a
and a, #0x01
;src/gb.h:144: if(display_state()){
bit 0, a
jr Z,00121$
;src/gb.h:145: while((*reg(REG_LCD_STAT) & LCD_STAT_MODE_FLAG) != 1); *reg(REG_LCDC) &= ~LCDC_DISPLAY_ENABLE;
00116$:
ld de, #0xff41
ld a,(de)
ld c, a
ld b, #0x00
ld a, c
and a, #0x03
ld c, a
ld b, #0x00
ld a, c
dec a
or a, b
jr NZ,00116$
ld de, #0xff40
ld a,(de)
res 7, a
ld hl, #0xff40
ld (hl), a
;src/main.c:144: disable_display();
00121$:
;src/main.c:145: fastcpy(HRAM, oam_dma_wait, oam_dma_wait_size);
ld hl, #_oam_dma_wait_size
ld c, (hl)
ld b, #0x00
push bc
ld hl, #_oam_dma_wait
push hl
ld hl, #0xff80
push hl
call _fastcpy
add sp, #6
;src/main.c:147: vblank_happened = false;
ld hl, #_vblank_happened
ld (hl), #0x00
;src/gb.h:157: inline void enable_lcd_stat_int(uint8_t _int){*reg(REG_LCD_STAT) |= _int;}
ld de, #0xff41
ld a,(de)
or a, #0x48
ld hl, #0xff41
ld (hl), a
;src/gb.h:159: inline void set_lyc(uint8_t _lyc){*reg(REG_LYC) = _lyc;}
ld l, #0x45
ld (hl), #0x91
;src/gb.h:167: inline void set_bg_pal(uint8_t _data){*reg(REG_BGP) = bg_pal = _data;}
ld hl, #_bg_pal
ld (hl), #0xf0
ld hl, #0xff47
ld (hl), #0xf0
;src/gb.h:168: inline void set_obj_pal0(uint8_t _data){*reg(REG_OBP0) = obj_pal0 = _data;}
ld hl, #_obj_pal0
ld (hl), #0xe4
ld hl, #0xff48
ld (hl), #0xe4
;src/gb.h:169: inline void set_obj_pal1(uint8_t _data){*reg(REG_OBP1) = obj_pal1 = _data;}
ld hl, #_obj_pal1
ld (hl), #0x27
ld hl, #0xff49
ld (hl), #0x27
;src/main.c:155: set_bg_map_select(false);
xor a, a
push af
inc sp
call _set_bg_map_select
inc sp
;src/main.c:156: set_bg_chr(bg_tiles, 0x0000, sizeof(bg_tiles));
ld hl, #0x1000
push hl
ld h, #0x00
push hl
ld hl, #_bg_tiles
push hl
call _set_bg_chr
add sp, #6
;src/main.c:157: fill(BG_MAP, 0x7F, 0x0400);
ld hl, #0x0400
push hl
ld a, #0x7f
push af
inc sp
ld h, #0x98
push hl
call _fill
add sp, #5
;src/gb.h:189: inline void set_bg_scroll(uint8_t _sx, uint8_t _sy){scroll_x = _sx; scroll_y = _sy;}
ld hl, #_scroll_x
ld (hl), #0x00
ld hl, #_scroll_y
ld (hl), #0x00
;src/main.c:160: for(uint8_t i = 0; i < 4; i++)
ldhl sp,#5
ld (hl), #0x00
00139$:
ldhl sp,#5
ld a, (hl)
sub a, #0x04
jp NC, 00102$
;src/main.c:161: for(uint8_t j = 0; j < 16; j++)
dec hl
ld (hl), #0x00
00136$:
ldhl sp,#4
ld a, (hl)
sub a, #0x10
jp NC, 00140$
;src/main.c:162: set_bg_map_tile_xy(j + 2, i + 8, ((i * 16) + j) & 0x1F);
inc hl
ld a, (hl)
swap a
and a, #0xf0
ld c, a
dec hl
ld e, (hl)
ld a, c
add a, e
and a, #0x1f
dec hl
dec hl
ld (hl), a
ldhl sp,#5
ld a, (hl)
add a, #0x08
inc e
inc e
;src/gb.h:175: inline void set_bg_map_tile_xy(uint8_t _x, uint8_t _y, uint8_t _tile){set_bg_map_tile((_y << 5) + _x, _tile);}
ld c, a
ld b, #0x00
sla c
rl b
sla c
rl b
sla c
rl b
sla c
rl b
sla c
rl b
ldhl sp,#0
ld (hl), e
inc hl
ld (hl), #0x00
pop hl
push hl
add hl, bc
ld c, l
ld b, h
ldhl sp,#2
ld a, (hl)
push af
inc sp
push bc
call _set_bg_map_tile
add sp, #3
;src/main.c:161: for(uint8_t j = 0; j < 16; j++)
ldhl sp,#4
inc (hl)
jp 00136$
00140$:
;src/main.c:160: for(uint8_t i = 0; i < 4; i++)
ldhl sp,#5
inc (hl)
jp 00139$
00102$:
;src/gb.h:153: inline void disable_obj(){*reg(REG_LCDC) &= ~LCDC_OBJ_ENABLE;}
ld de, #0xff40
ld a,(de)
res 1, a
ld hl, #0xff40
ld (hl), a
;src/gb.h:151: inline void disable_win(){*reg(REG_LCDC) &= ~LCDC_WIN_ENABLE;}
ld de, #0xff40
ld a,(de)
res 5, a
ld l, #0x40
ld (hl), a
;src/gb.h:148: inline void enable_bg(){*reg(REG_LCDC) |= LCDC_BG_ENABLE;}
ld de, #0xff40
ld a,(de)
ld c, a
ld b, #0x00
set 0, c
ld l, #0x40
ld (hl), c
;src/gb.h:142: inline void enable_display(){*reg(REG_LCDC) |= LCDC_DISPLAY_ENABLE;}
ld de, #0xff40
ld a,(de)
ld c, a
ld b, #0x00
set 7, c
ld l, #0x40
ld (hl), c
;src/main.c:169: fastcpy(&gb8_mem, &gb8_font, sizeof(gb8_font));
ld hl, #0x0050
push hl
ld hl, #_gb8_font
push hl
ld hl, #_gb8_mem
push hl
call _fastcpy
add sp, #6
;src/main.c:170: fastcpy(&gb8_mem + GB8_PROGRAM_START, &rom, sizeof(rom));
ld hl, #0x0e00
push hl
ld hl, #_rom
push hl
ld hl, #(_gb8_mem + 0x0200)
push hl
call _fastcpy
add sp, #6
;src/main.c:171: gb8_pc = GB8_PROGRAM_START;
ld hl, #_gb8_pc
ld (hl), #0x00
inc hl
ld (hl), #0x02
;src/main.c:172: gb8_stack_p = 0;
ld hl, #_gb8_stack_p
ld (hl), #0x00
;src/main.c:173: for(uint8_t i = 0; i < 16; i++) gb8_v[i] = 0;
ldhl sp,#3
ld (hl), #0x00
00142$:
ldhl sp,#3
ld a, (hl)
sub a, #0x10
jr NC,00103$
ld de, #_gb8_v
ld l, (hl)
ld h, #0x00
add hl, de
ld c, l
ld b, h
xor a, a
ld (bc), a
ldhl sp,#3
inc (hl)
jr 00142$
00103$:
;src/main.c:174: gb8_i = 0;
ld hl, #_gb8_i
ld (hl), #0x00
inc hl
ld (hl), #0x00
;src/main.c:175: gb8_delay_timer = 0;
ld hl, #_gb8_delay_timer
ld (hl), #0x00
;src/main.c:176: gb8_sound_timer = 0;
ld hl, #_gb8_sound_timer
ld (hl), #0x00
;src/gb.h:137: inline void clear_int_request_flags(){*reg(REG_IF) = 0x00;}
ld hl, #0xff0f
ld (hl), #0x00
;src/gb.h:135: inline void enable_int(uint8_t _int){*reg(REG_IE) |= _int;}
ld de, #0xffff
ld a,(de)
or a, #0x03
ld l, #0xff
ld (hl), a
;src/main.c:180: ei();
ei
;src/main.c:183: while(!vblank_happened) halt();
00104$:
ld hl, #_vblank_happened
bit 0, (hl)
jr NZ,00106$
halt
nop
jr 00104$
00106$:
;src/main.c:184: vblank_happened = false;
ld hl, #_vblank_happened
ld (hl), #0x00
;src/main.c:185: read_joypad();
call _read_joypad
;src/main.c:187: for(uint8_t i = 0; i < GB8_INSTR_PER_FRAME; i++) gb8_step();
ld c, #0x00
00145$:
ld a, c
sub a, #0x07
jr NC,00107$
push bc
call _gb8_step
pop bc
inc c
jr 00145$
00107$:
;src/main.c:189: if(gb8_delay_timer > 0) gb8_delay_timer--;
ld hl, #_gb8_delay_timer
ld a, (hl)
or a, a
jr Z,00109$
dec (hl)
00109$:
;src/main.c:190: if(gb8_sound_timer > 0) gb8_sound_timer--;
ld hl, #_gb8_sound_timer
ld a, (hl)
or a, a
jr Z,00104$
dec (hl)
jr 00104$
;src/main.c:195: }
add sp, #6
ret
_gb8_key_map:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x02 ; 2
.db #0x40 ; 64
.db #0x01 ; 1
.db #0x20 ; 32
.db #0x80 ; 128
.db #0x10 ; 16
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
_gb8_font:
.db #0xf0 ; 240
.db #0x90 ; 144
.db #0x90 ; 144
.db #0x90 ; 144
.db #0xf0 ; 240
.db #0x20 ; 32
.db #0x60 ; 96
.db #0x20 ; 32
.db #0x20 ; 32
.db #0x70 ; 112 'p'
.db #0xf0 ; 240
.db #0x10 ; 16
.db #0xf0 ; 240
.db #0x80 ; 128
.db #0xf0 ; 240
.db #0xf0 ; 240
.db #0x10 ; 16
.db #0xf0 ; 240
.db #0x10 ; 16
.db #0xf0 ; 240
.db #0x90 ; 144
.db #0x90 ; 144
.db #0xf0 ; 240
.db #0x10 ; 16
.db #0x10 ; 16
.db #0xf0 ; 240
.db #0x80 ; 128
.db #0xf0 ; 240
.db #0x10 ; 16
.db #0xf0 ; 240
.db #0xf0 ; 240
.db #0x80 ; 128
.db #0xf0 ; 240
.db #0x90 ; 144
.db #0xf0 ; 240
.db #0xf0 ; 240
.db #0x10 ; 16
.db #0x20 ; 32
.db #0x40 ; 64
.db #0x40 ; 64
.db #0xf0 ; 240
.db #0x90 ; 144
.db #0xf0 ; 240
.db #0x90 ; 144
.db #0xf0 ; 240
.db #0xf0 ; 240
.db #0x90 ; 144
.db #0xf0 ; 240
.db #0x10 ; 16
.db #0xf0 ; 240
.db #0xf0 ; 240
.db #0x90 ; 144
.db #0xf0 ; 240
.db #0x90 ; 144
.db #0x90 ; 144
.db #0xe0 ; 224
.db #0x90 ; 144
.db #0xe0 ; 224
.db #0x90 ; 144
.db #0xe0 ; 224
.db #0xf0 ; 240
.db #0x80 ; 128
.db #0x80 ; 128
.db #0x80 ; 128
.db #0xf0 ; 240
.db #0xe0 ; 224
.db #0x90 ; 144
.db #0x90 ; 144
.db #0x90 ; 144
.db #0xe0 ; 224
.db #0xf0 ; 240
.db #0x80 ; 128
.db #0xf0 ; 240
.db #0x80 ; 128
.db #0xf0 ; 240
.db #0xf0 ; 240
.db #0x80 ; 128
.db #0xf0 ; 240
.db #0x80 ; 128
.db #0x80 ; 128
;src/main.c:197: void gb8_clear_screen(){
; ---------------------------------
; Function gb8_clear_screen
; ---------------------------------
_gb8_clear_screen::
;src/main.c:198: fill(&gb8_display, 0x00, sizeof(gb8_display));
ld hl, #0x0200
push hl
xor a, a
push af
inc sp
ld hl, #_gb8_display
push hl
call _fill
add sp, #5
;src/main.c:199: }
ret
;src/main.c:201: uint8_t gb8_get_key(uint8_t _key){
; ---------------------------------
; Function gb8_get_key
; ---------------------------------
_gb8_get_key::
;src/main.c:202: return key_hold(gb8_key_map[_key]);
ld de, #_gb8_key_map
ldhl sp,#2
ld l, (hl)
ld h, #0x00
add hl, de
ld c, l
ld b, h
ld a, (bc)
push af
inc sp
call _key_hold
inc sp
;src/main.c:203: }
ret
;src/main.c:205: void gb8_draw_sprite(uint8_t _px, uint8_t _py, uint8_t _n){
; ---------------------------------
; Function gb8_draw_sprite
; ---------------------------------
_gb8_draw_sprite::
;src/main.c:418: __endasm;
line = 0
qbyte = 1
px = 7
py = 8
n = 9
dest_p = 2
src_b = 0
add sp, #-5
ld hl, #(_gb8_v + 0x0F) ;gb8_v[0xF] = 0
ld (hl), #0
ld bc, #_gb8_display ;dest_p = dest pixel in display
ldhl sp, #py
ld a, (hl)
ld hl, #0
bit 3, a
jr z, 20$
inc h
20$:
bit 4, a
jr z, 21$
inc l
21$:
and #0x07
add a
add l
ld l, a
add hl, bc
ld b, h
ld c, l
ldhl sp, #px
ld a, (hl)
and #0x38
sla a
sla a
ld l, a
ld h, #0
add hl, bc
ld b, h
ld c, l
push bc
ld de, #_gb8_mem ;src_b = src byte from font
ld hl, #_gb8_i
ld a, (hl+)
ld h, (hl)
ld l, a
add hl, de
ld d, h
ld e, l
push de
ldhl sp, #(n + 4)
ld a, (hl)
and #0x0F
ld (hl), a
jp z, 10$
ldhl sp, #(line + 4)
ld (hl), #0
0$:
ldhl sp, #src_b
ld a, (hl+)
ld h, (hl)
ld l, a
ld c, (hl)
ld b, #0
sla c
rl b
ld hl, #_pixel_scale_table
add hl, bc
ld a, (hl+)
ld c, a
ld b, (hl)
xor a
ld e, a
ld d, a
ldhl sp, #(px + 4)
ld a, (hl)
and #0x07
jr z, 2$
1$:
srl c
rr b
rr e
rr d
srl c
rr b
rr e
rr d
dec a
jr nz, 1$
2$:
ldhl sp, #(qbyte + 4)
ld a, c
ld (hl+), a
ld a, b
ld (hl+), a
ld a, e
ld (hl+), a
ld (hl), d
ldhl sp, #(py + 4)
ld a, (hl)
ldhl sp, #(line + 4)
ld d, (hl)
add (hl)
ld e, a
ldhl sp, #dest_p
ld a, (hl+)
ld b, (hl)
ld c, a
ld a, d
add a
add c
and #0x0F
ld d, a
ld a, c
and #0xF0
add d
ld c, a
ld a, b
bit 3, e
jr z, 40$
or #0x01
jr 41$
40$:and #0xFE
41$:
ld b, a
ld a, c
bit 4, e
jr z, 42$
or #0x01
jr 43$
42$:and #0xFE
43$:
ld c, a
ld e, #0
ldhl sp, #(qbyte + 4 + 0)
ld a, (bc)
ld d, a
xor (hl)
ld (bc), a
ld a, (hl+)
and d
jr z, 30$
ld e, #1
30$:
ld a, c
add #16
ld c, a
ld a, (bc)
ld d, a
xor (hl)
ld (bc), a
ld a, (hl+)
and d
jr z, 31$
ld e, #1
31$:
ld a, c
add #16
ld c, a
ld a, (bc)
ld d, a
xor (hl)
ld (bc), a
ld a, (hl+)
and d
jr z, 32$
ld e, #1
32$:
ld a, c
add #16
ld c, a
ld a, (bc)
ld d, a
xor (hl)
ld (bc), a
ld a, (hl+)
and d
jr z, 33$
ld e, #1
33$:
ld a, c
add #16
ld c, a
ld hl, #(_gb8_v + 0x0F) ;gb8_v[0xF] = e
ld a, (hl)
or e
ld (hl), a
4$:
ldhl sp, #src_b
inc (hl)
jr nz, 5$
inc hl
inc (hl)
5$:
ldhl sp, #(line + 4)
inc (hl)
9$:
ldhl sp, #(n + 4)
dec (hl)
jp nz, 0$
10$:
add sp, #9
;src/main.c:419: }
ret
;src/main.c:421: void gb8_bcd_vx(uint8_t _vx){
; ---------------------------------
; Function gb8_bcd_vx
; ---------------------------------
_gb8_bcd_vx::
;src/main.c:462: __endasm;
vx = 2
ldhl sp, #vx
ld l, (hl)
ld h, #0
ld bc, #_gb8_v
add hl, bc
ld e, (hl)
ld hl, #_gb8_mem
ld a, (_gb8_i)
ld c, a
ld a, (_gb8_i + 1)
ld b, a
add hl, bc
ld a, e
ld d, #-100
call 10$
ld (hl), b
inc hl
ld d, #-10
call 10$
ld (hl), b
inc hl
ld d, #-1
call 10$
ld (hl), b
ret
10$:
ld b, #-1
11$:
inc b
add d
jr c, 11$
sbc d
ret
;src/main.c:463: }
ret
;src/main.c:465: uint8_t gb8_rnd(){
; ---------------------------------
; Function gb8_rnd
; ---------------------------------
_gb8_rnd::
;src/main.c:480: __endasm;
ld a, (_gb8_seed)
ld b, a
rrca
rrca
rrca
xor #0x1F
add b
sbc #0xFF
ld e, a
ldh a, (0xFF04)
add e
ld (_gb8_seed), a
ld e, a
;src/main.c:481: }
ret
;src/main.c:483: void gb8_step(){
; ---------------------------------
; Function gb8_step
; ---------------------------------
_gb8_step::
add sp, #-12
;src/main.c:484: uint8_t _instr_hi = gb8_mem[gb8_pc++];
ld hl, #_gb8_pc + 1
dec hl
ld c, (hl)
inc hl
ld b, (hl)
dec hl
inc (hl)
jr NZ,00376$
inc hl
inc (hl)
00376$:
ld hl, #_gb8_mem
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ldhl sp,#10
ld (hl), a
;src/main.c:485: uint8_t _instr_lo = gb8_mem[gb8_pc++];
ld hl, #_gb8_pc + 1
dec hl
ld c, (hl)
inc hl
ld b, (hl)
dec hl
inc (hl)
jr NZ,00377$
inc hl
inc (hl)
00377$:
ld hl, #_gb8_mem
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ldhl sp,#11
;src/main.c:487: switch(_instr_hi >> 4){
ld (hl-), a
ld a, (hl)
swap a
and a, #0x0f
ldhl sp,#4
ld (hl), a
ld a, #0x0f
sub a, (hl)
jp C, 00171$
ld c, (hl)
ld b, #0x00
ld hl, #00378$
add hl, bc
add hl, bc
add hl, bc
jp (hl)
00378$:
jp 00101$
jp 00105$
jp 00106$
jp 00107$
jp 00110$
jp 00113$
jp 00116$
jp 00117$
jp 00118$
jp 00129$
jp 00132$
jp 00133$
jp 00134$
jp 00135$
jp 00136$
jp 00144$
;src/main.c:488: case GB8_INSTR_SPEC:
00101$:
;src/main.c:489: switch(_instr_lo){
ldhl sp,#11
ld a, (hl)
sub a, #0xe0
jr Z,00102$
ldhl sp,#11
ld a, (hl)
sub a, #0xee
jr Z,00103$
jp 00171$
;src/main.c:490: case GB8_INSTR_SPEC_CLR_SCRN:
00102$:
;src/main.c:491: gb8_clear_screen();
call _gb8_clear_screen
;src/main.c:492: break;
jp 00171$
;src/main.c:493: case GB8_INSTR_SPEC_RETURN:
00103$:
;src/main.c:494: gb8_pc = gb8_stack[--gb8_stack_p];
ld hl, #_gb8_stack_p
dec (hl)
ld c, (hl)
ld b, #0x00
sla c
rl b
ld hl, #_gb8_stack
add hl, bc
ld c, l
ld b, h
ld e, c
ld d, b
ld a,(de)
ld hl, #_gb8_pc
ld (hl+), a
inc de
ld a, (de)
ld (hl), a
;src/main.c:497: break;
jp 00171$
;src/main.c:498: case GB8_INSTR_JUMP_N:
00105$:
;src/main.c:499: gb8_pc = ((_instr_hi & 0x0F) << 8) | _instr_lo;
ldhl sp,#10
ld e, (hl)
ld d, #0x00
ld a, e
and a, #0x0f
ld b, a
ld c, #0x00
ld c, #0x00
inc hl
ld e, (hl)
ld d, #0x00
ld a, c
or a, e
ld hl, #_gb8_pc
ld (hl), a
ld a, b
or a, d
inc hl
ld (hl), a
;src/main.c:500: break;
jp 00171$
;src/main.c:501: case GB8_INSTR_CALL_N:
00106$:
;src/main.c:502: gb8_stack[gb8_stack_p++] = gb8_pc;
ld hl, #_gb8_stack_p
ld c, (hl)
inc (hl)
ld b, #0x00
sla c
rl b
ld hl, #_gb8_stack
add hl, bc
ld c, l
ld b, h
ld hl, #_gb8_pc
ld a, (hl+)
ld (bc), a
inc bc
ld a, (hl)
ld (bc), a
;src/main.c:503: gb8_pc = ((_instr_hi & 0x0F) << 8) | _instr_lo;
ldhl sp,#10
ld e, (hl)
ld d, #0x00
ld a, e
and a, #0x0f
ld b, a
ld c, #0x00
ld c, #0x00
inc hl
ld e, (hl)
ld d, #0x00
ld a, c
or a, e
ld hl, #_gb8_pc
ld (hl), a
ld a, b
or a, d
inc hl
ld (hl), a
;src/main.c:504: break;
jp 00171$
;src/main.c:505: case GB8_INSTR_SKIP_EQ_VX_N:
00107$:
;src/main.c:506: if(gb8_v[_instr_hi & 0x0F] == _instr_lo) gb8_pc += 2;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ld c, a
ldhl sp,#11
ld a, (hl)
sub a, c
jp NZ,00171$
ld hl, #_gb8_pc
ld a, (hl)
add a, #0x02
ld (hl+), a
ld a, (hl)
adc a, #0x00
ld (hl), a
;src/main.c:507: break;
jp 00171$
;src/main.c:508: case GB8_INSTR_SKIP_NE_VX_N:
00110$:
;src/main.c:509: if(gb8_v[_instr_hi & 0x0F] != _instr_lo) gb8_pc += 2;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ld c, a
ldhl sp,#11
ld a, (hl)
sub a, c
jp Z,00171$
ld hl, #_gb8_pc
ld a, (hl)
add a, #0x02
ld (hl+), a
ld a, (hl)
adc a, #0x00
ld (hl), a
;src/main.c:510: break;
jp 00171$
;src/main.c:511: case GB8_INSTR_SKIP_EQ_VX_VY:
00113$:
;src/main.c:512: if(gb8_v[_instr_hi & 0x0F] == gb8_v[_instr_lo >> 4]) gb8_pc += 2;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ld c, a
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
add a, #<(_gb8_v)
ld b, a
ld a, #0x00
adc a, #>(_gb8_v)
ld e, b
ld d, a
ld a,(de)
sub a, c
jp NZ,00171$
ld hl, #_gb8_pc
ld a, (hl)
add a, #0x02
ld (hl+), a
ld a, (hl)
adc a, #0x00
ld (hl), a
;src/main.c:513: break;
jp 00171$
;src/main.c:514: case GB8_INSTR_LOAD_VX_N:
00116$:
;src/main.c:515: gb8_v[_instr_hi & 0x0F] = _instr_lo;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ldhl sp,#11
ld a, (hl)
ld (bc), a
;src/main.c:516: break;
jp 00171$
;src/main.c:517: case GB8_INSTR_ADD_VX_N:
00117$:
;src/main.c:518: gb8_v[_instr_hi & 0x0F] += _instr_lo;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ldhl sp,#11
add a, (hl)
ld (bc), a
;src/main.c:519: break;
jp 00171$
;src/main.c:520: case GB8_INSTR_ARITH:
00118$:
;src/main.c:521: switch(_instr_lo & 0x0F){
ldhl sp,#11
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld a, c
or a, a
or a, b
jp Z,00119$
ld a, c
dec a
or a, b
jp Z,00120$
ld a, c
sub a, #0x02
or a, b
jp Z,00121$
ld a, c
sub a, #0x03
or a, b
jp Z,00122$
ld a, c
sub a, #0x04
or a, b
jp Z,00123$
ld a, c
sub a, #0x05
or a, b
jp Z,00124$
ld a, c
sub a, #0x06
or a, b
jp Z,00125$
ld a, c
sub a, #0x07
or a, b
jp Z,00126$
ld a, c
sub a, #0x0e
or a, b
jp Z,00127$
jp 00171$
;src/main.c:522: case GB8_INSTR_ARITH_LOAD_VX_VY:
00119$:
;src/main.c:523: gb8_v[_instr_hi & 0x0F] = gb8_v[_instr_lo >> 4];
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld a, l
ld d, h
ldhl sp,#5
ld (hl+), a
ld (hl), d
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
add a, #<(_gb8_v)
ld c, a
ld a, #0x00
adc a, #>(_gb8_v)
ld b, a
ld a, (bc)
ld c, a
ldhl sp,#5
ld a, (hl+)
ld h, (hl)
ld l, a
ld (hl), c
;src/main.c:524: break;
jp 00171$
;src/main.c:525: case GB8_INSTR_ARITH_OR_VX_VY:
00120$:
;src/main.c:526: gb8_v[_instr_hi & 0x0F] |= gb8_v[_instr_lo >> 4];
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ldhl sp,#5
ld (hl), a
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
ld e, a
ld d, #0x00
ld hl, #_gb8_v
add hl, de
ld a, l
ld d, h
ldhl sp,#2
ld (hl+), a
ld (hl), d
dec hl
ld e, (hl)
inc hl
ld d, (hl)
ld a,(de)
inc hl
inc hl
or a, (hl)
ld (bc), a
;src/main.c:527: break;
jp 00171$
;src/main.c:528: case GB8_INSTR_ARITH_AND_VX_VY:
00121$:
;src/main.c:529: gb8_v[_instr_hi & 0x0F] &= gb8_v[_instr_lo >> 4];
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ldhl sp,#2
ld (hl), a
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
ld e, a
ld d, #0x00
ld hl, #_gb8_v
add hl, de
ld a, l
ld d, h
ldhl sp,#5
ld (hl+), a
ld (hl), d
dec hl
ld e, (hl)
inc hl
ld d, (hl)
ld a,(de)
ldhl sp,#2
and a, (hl)
ld (bc), a
;src/main.c:530: break;
jp 00171$
;src/main.c:531: case GB8_INSTR_ARITH_XOR_VX_VY:
00122$:
;src/main.c:532: gb8_v[_instr_hi & 0x0F] ^= gb8_v[_instr_lo >> 4];
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ldhl sp,#2
ld (hl), a
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
ld e, a
ld d, #0x00
ld hl, #_gb8_v
add hl, de
ld a, l
ld d, h
ldhl sp,#5
ld (hl+), a
ld (hl), d
dec hl
ld e, (hl)
inc hl
ld d, (hl)
ld a,(de)
ldhl sp,#2
xor a, (hl)
ld (bc), a
;src/main.c:533: break;
jp 00171$
;src/main.c:534: case GB8_INSTR_ARITH_ADD_VX_VY:
00123$:
;src/main.c:535: gb8_v[0xF] = (((uint16_t)gb8_v[_instr_hi & 0x0F] + gb8_v[_instr_lo >> 4]) > 0x100) ? 1 : 0;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld a, l
ld d, h
ldhl sp,#2
ld (hl+), a
ld (hl), d
dec hl
ld e, (hl)
inc hl
ld d, (hl)
ld a,(de)
inc hl
inc hl
ld (hl+), a
ld (hl), #0x00
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
ld e, a
ld d, #0x00
ld hl, #_gb8_v
add hl, de
inc sp
inc sp
push hl
pop de
push de
ld a,(de)
ld c, a
ld b, #0x00
ldhl sp,#5
ld a, (hl+)
ld h, (hl)
ld l, a
add hl, bc
ld c, l
ld b, h
xor a, a
cp a, c
ld a, #0x01
sbc a, b
jr NC,00173$
ld bc, #0x0001
jr 00174$
00173$:
ld bc, #0x0000
00174$:
ld hl, #(_gb8_v + 0x000f)
ld (hl), c
;src/main.c:536: gb8_v[_instr_hi & 0x0F] += gb8_v[_instr_lo >> 4];
ldhl sp,#(3 - 1)
ld e, (hl)
inc hl
ld d, (hl)
ld a,(de)
ld c, a
pop de
push de
ld a,(de)
add a, c
ld c, a
dec hl
ld a, (hl+)
ld h, (hl)
ld l, a
ld (hl), c
;src/main.c:537: break;
jp 00171$
;src/main.c:538: case GB8_INSTR_ARITH_SUB_VX_VY:
00124$:
;src/main.c:539: gb8_v[0xF] = (((int16_t)gb8_v[_instr_hi & 0x0F] - gb8_v[_instr_lo >> 4]) < 0) ? 0 : 1;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
inc sp
inc sp
push hl
pop de
push de
ld a,(de)
ld c, a
ld b, #0x00
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
ld e, a
ld d, #0x00
ld hl, #_gb8_v
add hl, de
ld a, l
ld d, h
ldhl sp,#2
ld (hl+), a
ld (hl), d
dec hl
ld e, (hl)
inc hl
ld d, (hl)
ld a,(de)
inc hl
inc hl
ld (hl+), a
ld (hl), #0x00
dec hl
ld e, (hl)
inc hl
ld d, (hl)
ld a, c
sub a, e
ld e, a
ld a, b
sbc a, d
ld b, a
ld c, e
bit 7, b
jr Z,00175$
ld bc, #0x0000
jr 00176$
00175$:
ld bc, #0x0001
00176$:
ld hl, #(_gb8_v + 0x000f)
ld (hl), c
;src/main.c:540: gb8_v[_instr_hi & 0x0F] -= gb8_v[_instr_lo >> 4];
pop de
push de
ld a,(de)
ldhl sp,#(3 - 1)
ld e, (hl)
inc hl
ld d, (hl)
push af
ld a,(de)
ld c, a
pop af
sub a, c
ld c, a
pop hl
push hl
ld (hl), c
;src/main.c:541: break;
jp 00171$
;src/main.c:542: case GB8_INSTR_ARITH_SHR_VX_VY:
00125$:
;src/main.c:543: gb8_v[0xF] = gb8_v[_instr_lo >> 4] & 0x01;
ld bc, #_gb8_v + 15
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
ld e, a
ld d, #0x00
ld hl, #_gb8_v
add hl, de
inc sp
inc sp
push hl
pop de
push de
ld a,(de)
and a, #0x01
ld (bc), a
;src/main.c:544: gb8_v[_instr_hi & 0x0F] = gb8_v[_instr_lo >> 4] >> 1;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
pop de
push de
ld a,(de)
srl a
ld (bc), a
;src/main.c:545: break;
jp 00171$
;src/main.c:546: case GB8_INSTR_ARITH_SUB_VY_VX:
00126$:
;src/main.c:547: gb8_v[0xF] = (((int16_t)gb8_v[_instr_lo >> 4] - gb8_v[_instr_hi & 0x0F]) < 0) ? 0 : 1;
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
ld e, a
ld d, #0x00
ld hl, #_gb8_v
add hl, de
inc sp
inc sp
push hl
pop de
push de
ld a,(de)
ldhl sp,#2
ld (hl+), a
ld (hl), #0x00
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld a, l
ld d, h
ldhl sp,#5
ld (hl+), a
ld (hl), d
dec hl
ld e, (hl)
inc hl
ld d, (hl)
ld a,(de)
ld c, a
ld b, #0x00
ldhl sp,#(3 - 1)
ld e, (hl)
inc hl
ld d, (hl)
ld a, e
sub a, c
ld e, a
ld a, d
sbc a, b
ld b, a
ld c, e
bit 7, b
jr Z,00177$
ld bc, #0x0000
jr 00178$
00177$:
ld bc, #0x0001
00178$:
ld hl, #(_gb8_v + 0x000f)
ld (hl), c
;src/main.c:548: gb8_v[_instr_hi & 0x0F] = gb8_v[_instr_lo >> 4] - gb8_v[_instr_hi & 0x0F];
pop de
push de
ld a,(de)
ldhl sp,#(6 - 1)
ld e, (hl)
inc hl
ld d, (hl)
push af
ld a,(de)
ld c, a
pop af
sub a, c
ld c, a
dec hl
ld a, (hl+)
ld h, (hl)
ld l, a
ld (hl), c
;src/main.c:549: break;
jp 00171$
;src/main.c:550: case GB8_INSTR_ARITH_SHL_VX_VY:
00127$:
;src/main.c:551: gb8_v[0xF] = gb8_v[_instr_lo >> 4] >> 7;
ld bc, #_gb8_v + 15
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
ld e, a
ld d, #0x00
ld hl, #_gb8_v
add hl, de
inc sp
inc sp
push hl
pop de
push de
ld a,(de)
rlca
and a, #0x01
ld (bc), a
;src/main.c:552: gb8_v[_instr_hi & 0x0F] = gb8_v[_instr_lo >> 4] << 1;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
pop de
push de
ld a,(de)
add a, a
ld (bc), a
;src/main.c:555: break;
jp 00171$
;src/main.c:556: case GB8_INSTR_SKIP_NE_VX_VY:
00129$:
;src/main.c:557: if(gb8_v[_instr_hi & 0x0F] != gb8_v[_instr_lo >> 4]) gb8_pc += 2;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ld c, a
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
add a, #<(_gb8_v)
ld b, a
ld a, #0x00
adc a, #>(_gb8_v)
ld e, b
ld d, a
ld a,(de)
sub a, c
jp Z,00171$
ld hl, #_gb8_pc
ld a, (hl)
add a, #0x02
ld (hl+), a
ld a, (hl)
adc a, #0x00
ld (hl), a
;src/main.c:558: break;
jp 00171$
;src/main.c:559: case GB8_INSTR_LOAD_I_N:
00132$:
;src/main.c:560: gb8_i = ((_instr_hi & 0x0F) << 8) | _instr_lo;
ldhl sp,#10
ld e, (hl)
ld d, #0x00
ld a, e
and a, #0x0f
ld b, a
ld c, #0x00
ld c, #0x00
inc hl
ld e, (hl)
ld d, #0x00
ld a, c
or a, e
ld hl, #_gb8_i
ld (hl), a
ld a, b
or a, d
inc hl
ld (hl), a
;src/main.c:561: break;
jp 00171$
;src/main.c:562: case GB8_INSTR_JMP_N_V0:
00133$:
;src/main.c:563: gb8_pc = (((_instr_hi & 0x0F) << 8) | _instr_lo) + gb8_v[0];
ldhl sp,#10
ld e, (hl)
ld d, #0x00
ld a, e
and a, #0x0f
ld b, a
ld c, #0x00
ld c, #0x00
inc hl
ld e, (hl)
ld d, #0x00
ld a, c
or a, e
ld c, a
ld a, b
or a, d
ld b, a
ld a, (#_gb8_v + 0)
ldhl sp,#0
ld (hl+), a
ld (hl), #0x00
pop hl
push hl
add hl, bc
ld a, l
ld d, h
ld hl, #_gb8_pc
ld (hl+), a
ld (hl), d
;src/main.c:564: break;
jp 00171$
;src/main.c:565: case GB8_INSTR_RND_VX_N:
00134$:
;src/main.c:566: gb8_v[_instr_hi & 0x0F] = gb8_rnd() & _instr_lo;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
push bc
call _gb8_rnd
ld a, e
pop bc
ldhl sp,#11
and a, (hl)
ld (bc), a
;src/main.c:567: break;
jp 00171$
;src/main.c:568: case GB8_INSTR_DRAW_SPR:
00135$:
;src/main.c:569: gb8_draw_sprite(gb8_v[_instr_hi & 0x0F], gb8_v[_instr_lo >> 4], _instr_lo & 0x0F);
ldhl sp,#11
ld a, (hl)
and a, #0x0f
ldhl sp,#0
ld (hl), a
ldhl sp,#11
ld a, (hl)
swap a
and a, #0x0f
add a, #<(_gb8_v)
ld c, a
ld a, #0x00
adc a, #>(_gb8_v)
ld b, a
ld a, (bc)
ldhl sp,#2
ld (hl), a
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ld b, a
ldhl sp,#0
ld a, (hl)
push af
inc sp
inc hl
inc hl
ld a, (hl)
push af
inc sp
push bc
inc sp
call _gb8_draw_sprite
add sp, #3
;src/main.c:570: break;
jp 00171$
;src/main.c:571: case GB8_INSTR_SKIP_KEY:
00136$:
;src/main.c:572: switch(_instr_lo){
ldhl sp,#11
ld a, (hl)
sub a, #0x9e
jr Z,00137$
ldhl sp,#11
ld a, (hl)
sub a, #0xa1
jr Z,00140$
jp 00171$
;src/main.c:573: case GB8_INSTR_SKIP_KEY_PRSD:
00137$:
;src/main.c:574: if(gb8_get_key(gb8_v[_instr_hi & 0x0F])) gb8_pc += 2;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
push af
inc sp
call _gb8_get_key
inc sp
ld a, e
or a, a
jp Z, 00171$
ld hl, #_gb8_pc
ld a, (hl)
add a, #0x02
ld (hl+), a
ld a, (hl)
adc a, #0x00
ld (hl), a
;src/main.c:575: break;
jp 00171$
;src/main.c:576: case GB8_INSTR_SKIP_KEY_NOT_PRSD:
00140$:
;src/main.c:577: if(!(gb8_get_key(gb8_v[_instr_hi & 0x0F]))) gb8_pc += 2;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
push af
inc sp
call _gb8_get_key
inc sp
ld a, e
or a, a
jp NZ, 00171$
ld hl, #_gb8_pc
ld a, (hl)
add a, #0x02
ld (hl+), a
ld a, (hl)
adc a, #0x00
ld (hl), a
;src/main.c:580: break;
jp 00171$
;src/main.c:581: case GB8_INSTR_SPEC2:
00144$:
;src/main.c:582: switch(_instr_lo){
ldhl sp,#11
ld a, (hl)
sub a, #0x07
jp Z,00145$
ldhl sp,#11
ld a, (hl)
sub a, #0x0a
jp Z,00146$
ldhl sp,#11
ld a, (hl)
sub a, #0x15
jp Z,00152$
ldhl sp,#11
ld a, (hl)
sub a, #0x18
jp Z,00153$
ldhl sp,#11
ld a, (hl)
sub a, #0x1e
jp Z,00154$
ldhl sp,#11
ld a, (hl)
sub a, #0x29
jp Z,00155$
ldhl sp,#11
ld a, (hl)
sub a, #0x33
jp Z,00156$
ldhl sp,#11
ld a, (hl)
sub a, #0x55
jp Z,00215$
ldhl sp,#11
ld a, (hl)
sub a, #0x65
jp Z,00217$
jp 00171$
;src/main.c:583: case GB8_INSTR_SPEC2_LOAD_VX_DELAY:
00145$:
;src/main.c:584: gb8_v[_instr_hi & 0x0F] = gb8_delay_timer;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld hl, #_gb8_delay_timer
ld a, (hl)
ld (bc), a
;src/main.c:585: break;
jp 00171$
;src/main.c:586: case GB8_INSTR_SPEC2_WAIT_KEY_VX:
00146$:
;src/main.c:587: { uint8_t _key, _any_key_pressed = 0;
ldhl sp,#7
ld (hl), #0x00
;src/main.c:588: for(_key = 0; _key < 16; _key++){
ldhl sp,#0
ld (hl), #0x00
ld b, #0x00
00163$:
;src/main.c:589: _any_key_pressed |= gb8_get_key(_key);
push bc
push bc
inc sp
call _gb8_get_key
inc sp
ld a, e
pop bc
ldhl sp,#7
or a, (hl)
ld (hl), a
;src/main.c:590: if(gb8_get_key(_key)){
push bc
push bc
inc sp
call _gb8_get_key
inc sp
pop bc
ld a, e
or a, a
jr Z,00164$
;src/main.c:591: gb8_v[_instr_hi & 0x0F] = _key;
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ldhl sp,#0
ld a, (hl)
ld (bc), a
;src/main.c:592: break;
jr 00149$
00164$:
;src/main.c:588: for(_key = 0; _key < 16; _key++){
inc b
ldhl sp,#0
ld (hl), b
ld a, b
sub a, #0x10
jp C, 00163$
00149$:
;src/main.c:595: if(!_any_key_pressed) gb8_pc -= 2;
ldhl sp,#7
ld a, (hl)
or a, a
jp NZ, 00171$
ld hl, #_gb8_pc + 1
dec hl
ld e, (hl)
inc hl
ld d, (hl)
dec de
dec de
dec hl
ld (hl), e
inc hl
ld (hl), d
;src/main.c:597: break;
jp 00171$
;src/main.c:598: case GB8_INSTR_SPEC2_LOAD_DELAY_VX:
00152$:
;src/main.c:599: gb8_delay_timer = gb8_v[_instr_hi & 0x0F];
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ld hl, #_gb8_delay_timer
ld (hl), a
;src/main.c:600: break;
jp 00171$
;src/main.c:601: case GB8_INSTR_SPEC2_LOAD_SOUND_VX:
00153$:
;src/main.c:602: gb8_sound_timer = gb8_v[_instr_hi & 0x0F];
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ld hl, #_gb8_sound_timer
ld (hl), a
;src/main.c:603: break;
jp 00171$
;src/main.c:604: case GB8_INSTR_SPEC2_ADD_I_VX:
00154$:
;src/main.c:605: gb8_i += gb8_v[_instr_hi & 0x0F];
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ld c, a
ld b, #0x00
ld hl, #_gb8_i
ld a, (hl)
add a, c
ld (hl+), a
ld a, (hl)
adc a, b
ld (hl), a
;src/main.c:606: break;
jp 00171$
;src/main.c:607: case GB8_INSTR_SPEC2_LOAD_I_SPR_VX:
00155$:
;src/main.c:608: gb8_i = 5 * gb8_v[_instr_hi & 0x0F];
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
ld hl, #_gb8_v
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ld c, a
ld b, #0x00
ld l, c
ld h, b
add hl, hl
add hl, hl
add hl, bc
ld a, l
ld d, h
ld hl, #_gb8_i
ld (hl+), a
ld (hl), d
;src/main.c:609: break;
jp 00171$
;src/main.c:610: case GB8_INSTR_SPEC2_BCD_I_VX:
00156$:
;src/main.c:611: gb8_bcd_vx(_instr_hi & 0x0F);
ldhl sp,#10
ld a, (hl)
and a, #0x0f
push af
inc sp
call _gb8_bcd_vx
inc sp
;src/main.c:612: break;
jp 00171$
;src/main.c:614: for(uint8_t i = 0; i < ((_instr_hi & 0x0F) + 1); i++) gb8_mem[gb8_i + i] = gb8_v[i];
00215$:
ldhl sp,#9
ld (hl), #0x00
00166$:
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
inc bc
inc sp
inc sp
push bc
dec hl
ld c, (hl)
ld b, #0x00
ldhl sp,#0
ld a, c
sub a, (hl)
inc hl
ld a, b
sbc a, (hl)
ld a, b
ld d, a
ld e, (hl)
bit 7, e
jr Z,00411$
bit 7, d
jr NZ,00412$
cp a, a
jr 00412$
00411$:
bit 7, d
jr Z,00412$
scf
00412$:
jp NC, 00158$
ld a, c
ld hl, #_gb8_i
add a, (hl)
ld c, a
ld a, b
inc hl
adc a, (hl)
ld b, a
ld hl, #_gb8_mem
add hl, bc
ld a, l
ld d, h
ldhl sp,#2
ld (hl+), a
ld (hl), d
ld de, #_gb8_v
ldhl sp,#9
ld l, (hl)
ld h, #0x00
add hl, de
ld c, l
ld b, h
ld a, (bc)
ld c, a
ldhl sp,#2
ld a, (hl+)
ld h, (hl)
ld l, a
ld (hl), c
ldhl sp,#9
inc (hl)
jp 00166$
00158$:
;src/main.c:615: gb8_i += (_instr_hi & 0x0F) + 1;
pop bc
push bc
ld hl, #_gb8_i
ld a, (hl)
add a, c
ld (hl+), a
ld a, (hl)
adc a, b
ld (hl), a
;src/main.c:616: break;
jp 00171$
;src/main.c:618: for(uint8_t i = 0; i < ((_instr_hi & 0x0F) + 1); i++) gb8_v[i] = gb8_mem[gb8_i + i];
00217$:
ldhl sp,#8
ld (hl), #0x00
00169$:
ldhl sp,#10
ld c, (hl)
ld b, #0x00
ld a, c
and a, #0x0f
ld c, a
ld b, #0x00
inc bc
inc sp
inc sp
push bc
dec hl
dec hl
ld c, (hl)
ld b, #0x00
ldhl sp,#0
ld a, c
sub a, (hl)
inc hl
ld a, b
sbc a, (hl)
ld a, b
ld d, a
ld e, (hl)
bit 7, e
jr Z,00413$
bit 7, d
jr NZ,00414$
cp a, a
jr 00414$
00413$:
bit 7, d
jr Z,00414$
scf
00414$:
jp NC, 00160$
ld de, #_gb8_v
ldhl sp,#8
ld l, (hl)
ld h, #0x00
add hl, de
ld a, l
ld d, h
ldhl sp,#2
ld (hl+), a
ld (hl), d
ld a, c
ld hl, #_gb8_i
add a, (hl)
ld c, a
ld a, b
inc hl
adc a, (hl)
ld b, a
ld hl, #_gb8_mem
add hl, bc
ld c, l
ld b, h
ld a, (bc)
ld c, a
ldhl sp,#2
ld a, (hl+)
ld h, (hl)
ld l, a
ld (hl), c
ldhl sp,#8
inc (hl)
jp 00169$
00160$:
;src/main.c:619: gb8_i += (_instr_hi & 0x0F) + 1;
pop bc
push bc
ld hl, #_gb8_i
ld a, (hl)
add a, c
ld (hl+), a
ld a, (hl)
adc a, b
ld (hl), a
;src/main.c:623: }
00171$:
;src/main.c:624: }
add sp, #12
ret
.area _CODE
.area _CABS (ABS)
| 16.542226
| 126
| 0.530946
|
f6e47b2b27e2063c32f8772d0f725d4a3cd7842f
| 644
|
asm
|
Assembly
|
oeis/004/A004544.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/004/A004544.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/004/A004544.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A004544: Expansion of sqrt(2) in base 7.
; Submitted by Jon Maiga
; 1,2,6,2,0,3,4,5,4,5,2,1,1,2,3,2,6,1,0,6,1,3,4,2,1,0,1,2,0,1,6,1,6,6,2,4,0,5,0,4,0,0,4,2,5,1,1,2,6,0,5,2,1,6,0,2,2,6,6,1,5,6,3,5,2,2,0,2,6,0,5,6,5,1,5,5,2,2,4,3,6,2,0,6,4,0,5,5,1,4,4,5,1,5,2,0,0,4,1,5
mov $1,1
mov $2,1
mov $3,$0
add $3,2
mov $4,$0
add $4,2
mul $4,2
mov $7,10
pow $7,$4
mov $9,10
lpb $3
mov $4,$2
pow $4,2
mul $4,2
mov $5,$1
pow $5,2
add $4,$5
mov $6,$1
mov $1,$4
mul $6,$2
mul $6,2
mov $2,$6
mov $8,$4
div $8,$7
max $8,1
div $1,$8
div $2,$8
sub $3,1
lpe
sub $9,3
mov $3,$9
pow $3,$0
div $2,$3
div $1,$2
mod $1,$9
mov $0,$1
| 15.707317
| 201
| 0.509317
|
2b8a0bfbf204ac75de7bf038a1e391fcd8ec9f79
| 285
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/adt/w_vector/c/sdcc_iy/w_vector_insert_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/adt/w_vector/c/sdcc_iy/w_vector_insert_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/adt/w_vector/c/sdcc_iy/w_vector_insert_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
; size_t w_vector_insert_callee(w_vector_t *v, size_t idx, void *item)
SECTION code_clib
SECTION code_adt_w_vector
PUBLIC _w_vector_insert_callee
EXTERN asm_w_vector_insert
_w_vector_insert_callee:
pop af
pop hl
pop bc
pop de
push af
jp asm_w_vector_insert
| 14.25
| 70
| 0.77193
|
037dabd230d2ec08cd54ad51226901a8d93c9804
| 7,130
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1490.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_0x84_notsx.log_21829_1490.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_0x84_notsx.log_21829_1490.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 %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1baf3, %r14
nop
xor %r12, %r12
and $0xffffffffffffffc0, %r14
vmovntdqa (%r14), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rbp
nop
nop
nop
and $32452, %r15
lea addresses_UC_ht+0x6887, %rsi
lea addresses_D_ht+0x1cf07, %rdi
nop
nop
nop
cmp $57663, %r14
mov $106, %rcx
rep movsw
nop
nop
add $4855, %r15
lea addresses_normal_ht+0x1af87, %rcx
nop
and %r15, %r15
movups (%rcx), %xmm0
vpextrq $0, %xmm0, %r14
nop
nop
nop
sub $38768, %rcx
lea addresses_WT_ht+0x15cc7, %rsi
nop
nop
nop
nop
nop
inc %r15
movw $0x6162, (%rsi)
nop
cmp $46435, %rcx
lea addresses_WC_ht+0x9a87, %rsi
lea addresses_A_ht+0x19217, %rdi
nop
nop
nop
nop
add $3254, %r12
mov $24, %rcx
rep movsb
nop
dec %r12
lea addresses_D_ht+0x1ae07, %rcx
nop
nop
xor %r14, %r14
mov $0x6162636465666768, %rbp
movq %rbp, (%rcx)
nop
nop
and %rbp, %rbp
lea addresses_D_ht+0x12377, %rsi
lea addresses_D_ht+0x3c07, %rdi
nop
nop
nop
nop
nop
sub $63439, %r9
mov $51, %rcx
rep movsw
cmp %rdi, %rdi
lea addresses_WC_ht+0xd1b7, %rsi
lea addresses_D_ht+0x4207, %rdi
nop
cmp $12268, %r15
mov $91, %rcx
rep movsl
nop
dec %r15
lea addresses_WC_ht+0x97a5, %rbp
nop
xor $50182, %r9
mov (%rbp), %esi
nop
nop
cmp $20316, %r12
lea addresses_UC_ht+0x3fb3, %rcx
nop
nop
nop
inc %rdi
vmovups (%rcx), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %r12
nop
cmp $48262, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
// Store
lea addresses_PSE+0x1548f, %r15
nop
nop
nop
nop
and %r13, %r13
movl $0x51525354, (%r15)
nop
sub %rbx, %rbx
// REPMOV
lea addresses_RW+0x1a67f, %rsi
mov $0xd87, %rdi
nop
sub %r13, %r13
mov $10, %rcx
rep movsq
and $44493, %rbx
// Faulty Load
lea addresses_RW+0x19087, %rsi
nop
nop
nop
nop
sub $54306, %rcx
vmovups (%rsi), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %r15
lea oracles, %r8
and $0xff, %r15
shlq $12, %r15
mov (%r8,%r15,1), %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_RW', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_P', 'congruent': 7, 'same': False}, 'OP': 'REPM'}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'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
*/
| 36.564103
| 2,999
| 0.657363
|
4922f8bcd44ec100fdc36db1a3f710b902acf0d7
| 9,882
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1466.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_1466.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_1466.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 %r8
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0xc566, %rsi
lea addresses_WC_ht+0x215e, %rdi
clflush (%rsi)
nop
add %rbp, %rbp
mov $59, %rcx
rep movsl
add %rbx, %rbx
lea addresses_WC_ht+0x16d84, %rsi
lea addresses_WT_ht+0xba86, %rdi
nop
nop
nop
nop
nop
and %r8, %r8
mov $111, %rcx
rep movsq
nop
nop
nop
nop
and $38049, %rbp
lea addresses_A_ht+0x1b0c8, %rbx
nop
nop
nop
nop
nop
add $57795, %rdx
mov (%rbx), %di
nop
nop
nop
nop
and $46490, %rcx
lea addresses_A_ht+0x6fe5, %rdi
nop
nop
nop
nop
add %rbx, %rbx
mov $0x6162636465666768, %r8
movq %r8, (%rdi)
nop
nop
dec %rbp
lea addresses_D_ht+0x10a1e, %rsi
lea addresses_A_ht+0x1899e, %rdi
nop
nop
nop
nop
nop
dec %r8
mov $119, %rcx
rep movsl
nop
sub $62771, %rdi
lea addresses_WT_ht+0x177de, %rbx
nop
xor %rsi, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, (%rbx)
nop
nop
nop
nop
dec %rdx
lea addresses_D_ht+0x14bee, %r8
nop
nop
nop
nop
nop
cmp %rsi, %rsi
mov (%r8), %rdx
nop
nop
nop
nop
sub %r8, %r8
lea addresses_UC_ht+0x1e39e, %rbp
nop
mfence
movb (%rbp), %bl
nop
nop
nop
add %r8, %r8
lea addresses_WT_ht+0x1a19e, %rsi
nop
nop
sub $61115, %rbp
mov $0x6162636465666768, %rdx
movq %rdx, %xmm6
vmovups %ymm6, (%rsi)
nop
xor %r8, %r8
lea addresses_WC_ht+0x915e, %rsi
lea addresses_normal_ht+0x1b79e, %rdi
nop
nop
nop
nop
nop
xor $55969, %r8
mov $113, %rcx
rep movsb
nop
nop
sub $10311, %rdx
lea addresses_UC_ht+0x1c11e, %rsi
lea addresses_WC_ht+0x1eb9e, %rdi
nop
and %r12, %r12
mov $3, %rcx
rep movsw
nop
add $15093, %rdi
lea addresses_WT_ht+0x12b9e, %rdi
and %rbx, %rbx
movb $0x61, (%rdi)
nop
nop
xor $26935, %rbx
lea addresses_A_ht+0x1e59e, %rsi
lea addresses_normal_ht+0x1961e, %rdi
and $49265, %r8
mov $54, %rcx
rep movsl
nop
nop
add $56748, %rbx
lea addresses_normal_ht+0x699e, %rdi
nop
nop
nop
nop
nop
cmp %rbp, %rbp
mov $0x6162636465666768, %rsi
movq %rsi, (%rdi)
nop
nop
nop
add %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r8
push %r9
push %rcx
push %rdi
push %rsi
// Store
lea addresses_WT+0xd99e, %r12
nop
nop
nop
cmp $57779, %r13
movl $0x51525354, (%r12)
add $58123, %r9
// Store
lea addresses_UC+0x19bbe, %r12
xor $19540, %r9
mov $0x5152535455565758, %r13
movq %r13, %xmm1
vmovups %ymm1, (%r12)
nop
nop
sub %r9, %r9
// Load
lea addresses_UC+0x1507e, %rdi
nop
inc %r8
vmovups (%rdi), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %r9
nop
nop
nop
nop
nop
dec %rcx
// Store
lea addresses_A+0x1bbca, %r8
cmp %rcx, %rcx
mov $0x5152535455565758, %r9
movq %r9, %xmm3
movups %xmm3, (%r8)
nop
and $33696, %rsi
// Load
lea addresses_normal+0x17786, %r12
nop
nop
nop
nop
xor $31805, %r8
mov (%r12), %rsi
nop
nop
dec %r12
// Store
mov $0x13919b00000000da, %rcx
nop
nop
xor $48515, %r12
mov $0x5152535455565758, %rsi
movq %rsi, %xmm7
vmovups %ymm7, (%rcx)
nop
nop
xor %rsi, %rsi
// Store
lea addresses_normal+0x1319e, %r13
nop
nop
cmp $3297, %rdi
mov $0x5152535455565758, %rcx
movq %rcx, %xmm5
movaps %xmm5, (%r13)
nop
inc %r8
// Load
lea addresses_US+0x1509e, %r9
nop
nop
sub $42687, %rdi
movups (%r9), %xmm7
vpextrq $0, %xmm7, %rcx
nop
sub %rcx, %rcx
// Store
lea addresses_WT+0x13e2f, %r8
cmp %r9, %r9
movl $0x51525354, (%r8)
nop
nop
nop
nop
nop
sub $4971, %r8
// Faulty Load
lea addresses_RW+0xc99e, %r13
nop
add %r12, %r12
movb (%r13), %cl
lea oracles, %r8
and $0xff, %rcx
shlq $12, %rcx
mov (%r8,%rcx,1), %rcx
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_WT', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC', 'size': 32, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_A', 'size': 16, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_normal', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_NC', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_normal', 'size': 16, 'AVXalign': True}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_US', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 4, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': True}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 3, 'NT': True, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 8, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': True}}
{'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': 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
*/
| 30.220183
| 2,999
| 0.652803
|
7590a1e709f076b2e424030b032f8bd1f3b1677c
| 759
|
asm
|
Assembly
|
libsrc/strings/strstrip_callee.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/strings/strstrip_callee.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/strings/strstrip_callee.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
; char __CALLEE__ *strstrip_callee(char *s, char c)
; remove occurences of leading char c from string s
; 01.2007 aralbrec
PUBLIC strstrip_callee
PUBLIC ASMDISP_STRSTRIP_CALLEE
.strstrip_callee
pop hl
pop de
ex (sp),hl
ld a,e
; enter : a = char c
; hl = char *s
; exit : hl = char *s
; uses : af, bc, de, hl
.asmentry
ld e,l
ld d,h
.skip
cp (hl)
inc hl
jp z, skip
dec hl
; the case where there are no unwanted chars is common...
ld a,l
cp e
jr nz, copy
ld a,h
cp d
jr nz, copy
ex de,hl
ret
.copy
push de
.copyloop
ld a,(hl)
ldi
or a
jp nz, copyloop
pop hl
ret
DEFC ASMDISP_STRSTRIP_CALLEE = # asmentry - strstrip_callee
| 12.864407
| 60
| 0.582345
|
ff6569e4ab783e4414713ecc03c20a3db2c6fc71
| 1,555
|
asm
|
Assembly
|
tests/automake/gtk3_window/main.asm
|
agguro/nasm-support
|
f4e64dd47a5279cf7fc9cb6d1182626a5b9add62
|
[
"BSD-2-Clause"
] | 6
|
2020-07-19T18:34:43.000Z
|
2022-03-26T10:21:09.000Z
|
tests/automake/gtk3_window/main.asm
|
agguro/nasm-support
|
f4e64dd47a5279cf7fc9cb6d1182626a5b9add62
|
[
"BSD-2-Clause"
] | null | null | null |
tests/automake/gtk3_window/main.asm
|
agguro/nasm-support
|
f4e64dd47a5279cf7fc9cb6d1182626a5b9add62
|
[
"BSD-2-Clause"
] | 3
|
2020-07-19T18:35:10.000Z
|
2021-07-25T17:34:50.000Z
|
; Project : window
; Name : main.asm
;
; Build : aclocal && autoconf && automake --add-missing --foreign
; mkdir build
; cd build
; ../configure
; make
;
; Description : Example window
; Source : https://developer.gnome.org/gtk3/stable/gtk-getting-started.html#id-1.2.3.5
bits 64
global _start
extern gtk_application_new
extern g_signal_connect_data
extern g_application_run
extern g_object_unref
extern exit
extern gtk_application_window_new
extern gtk_window_set_title
extern gtk_window_set_default_size
extern gtk_widget_show_all
extern mainWindow
%define G_APPLICATION_FLAGS_NONE 0
section .bss
app: resq 1 ;GtkApplication*
status: resq 1 ;int
section .rodata
szIdentifier: db "org.agguro.gtk3examples",0
szActivate: db "activate",0
_start:
mov rdi,szIdentifier
mov rsi,G_APPLICATION_FLAGS_NONE
call gtk_application_new
mov qword[app],rax
mov r9d,0
mov r8d,0
mov ecx,0 ;NULL
lea rdx,mainWindow ;G_CALLBACK
lea rsi,szActivate ;'activate'
mov rdi,qword[app] ;app
call g_signal_connect_data
mov rdi,qword[app]
xor rsi,rsi ;argc
xor rdx,rdx ;argv
call g_application_run
mov qword[status],rax
mov rdi,qword[app]
call g_object_unref
mov rdi,qword[status]
call exit
| 24.296875
| 91
| 0.6
|
c9dc2c380fbc8857db1760786b9030e3adc34af9
| 7,327
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_550.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_550.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_550.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1dce, %r10
sub %r14, %r14
movw $0x6162, (%r10)
nop
nop
nop
cmp $39761, %rax
lea addresses_WC_ht+0x26de, %rsi
lea addresses_D_ht+0xd0de, %rdi
nop
nop
nop
xor %r8, %r8
mov $76, %rcx
rep movsw
nop
nop
nop
nop
nop
dec %r10
lea addresses_D_ht+0xebde, %rsi
lea addresses_WT_ht+0x116ae, %rdi
nop
nop
xor %r14, %r14
mov $38, %rcx
rep movsb
nop
nop
nop
inc %r8
lea addresses_WC_ht+0xccde, %rsi
lea addresses_D_ht+0x166de, %rdi
nop
nop
nop
nop
sub $7525, %rax
mov $74, %rcx
rep movsq
and %rcx, %rcx
lea addresses_A_ht+0xede, %rsi
lea addresses_WT_ht+0x1001, %rdi
add %r14, %r14
mov $81, %rcx
rep movsw
nop
nop
nop
nop
inc %r13
lea addresses_D_ht+0x59de, %rsi
lea addresses_WT_ht+0x58c, %rdi
nop
nop
nop
nop
sub $10847, %r14
mov $3, %rcx
rep movsw
add %rdi, %rdi
lea addresses_D_ht+0x66de, %r10
nop
add %rdi, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm6
vmovups %ymm6, (%r10)
nop
nop
nop
and %r8, %r8
lea addresses_UC_ht+0xaede, %r10
nop
mfence
mov $0x6162636465666768, %r13
movq %r13, (%r10)
nop
nop
nop
nop
add $17455, %rcx
lea addresses_WT_ht+0x1a1e, %rsi
clflush (%rsi)
cmp %r10, %r10
movb (%rsi), %cl
nop
and %r13, %r13
lea addresses_normal_ht+0x154ae, %rsi
and $45013, %r13
mov $0x6162636465666768, %rcx
movq %rcx, (%rsi)
nop
nop
dec %r14
lea addresses_normal_ht+0xc6de, %rax
nop
nop
nop
and $51084, %rsi
vmovups (%rax), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %r13
nop
xor %r8, %r8
lea addresses_UC_ht+0x2e46, %rsi
lea addresses_WC_ht+0x173e6, %rdi
and %r13, %r13
mov $4, %rcx
rep movsw
cmp %r13, %r13
lea addresses_WC_ht+0x184de, %r13
clflush (%r13)
nop
nop
nop
nop
sub %r14, %r14
movups (%r13), %xmm0
vpextrq $1, %xmm0, %rsi
nop
xor %r10, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r8
push %rbx
push %rsi
// Faulty Load
lea addresses_normal+0x1cede, %r10
nop
nop
nop
nop
nop
cmp $25502, %r8
mov (%r10), %bx
lea oracles, %r13
and $0xff, %rbx
shlq $12, %rbx
mov (%r13,%rbx,1), %rbx
pop %rsi
pop %rbx
pop %r8
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 4}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8, 'NT': True, 'same': False, 'congruent': 11}}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 3}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'}
{'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
*/
| 37.382653
| 2,999
| 0.659206
|
1efe2cc7dbc71b3343b8afff27b1f6e45951b419
| 611
|
asm
|
Assembly
|
oeis/182/A182174.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/182/A182174.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/182/A182174.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A182174: a(n) = prime(n)^2 - n.
; 3,7,22,45,116,163,282,353,520,831,950,1357,1668,1835,2194,2793,3464,3703,4470,5021,5308,6219,6866,7897,9384,10175,10582,11421,11852,12739,16098,17129,18736,19287,22166,22765,24612,26531,27850,29889,32000,32719,36438,37205,38764,39555,44474,49681,51480,52391,54238,57069,58028,62947,65994,69113,72304,73383,76670,78901,80028,85787,94186,96657,97904,100423,109494,113501,120340,121731,124538,128809,134616,139055,143566,146613,151244,157531,160722,167201,175480,177159,185678,187405,192636,196163
sub $1,$0
seq $0,40 ; The prime numbers.
pow $0,2
sub $0,1
add $1,$0
mov $0,$1
| 61.1
| 496
| 0.772504
|
48902b736b0fb807fdda105a4ecd9614f06bb728
| 467
|
asm
|
Assembly
|
oeis/315/A315751.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/315/A315751.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/315/A315751.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A315751: Coordination sequence Gal.6.628.4 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.
; Submitted by Jamie Morken(s1)
; 1,6,12,18,23,29,35,41,47,52,58,64,70,76,82,88,93,99,105,111,117,122,128,134,140,146,152,158,163,169,175,181,187,192,198,204,210,216,222,228,233,239,245,251,257,262,268,274,280,286
sub $0,1
mul $0,175
div $0,6
add $0,2
div $0,2
mul $0,2
div $0,5
add $0,6
| 35.923077
| 181
| 0.719486
|
d6c3229a14c597df9f35f8f1465506fc51b46d5c
| 546
|
asm
|
Assembly
|
non_regression/other_x86_macosx_12.s.asm
|
LRGH/plasmasm
|
4cd50546c3dc895763d72dd60b7c46179c1916bc
|
[
"Apache-2.0"
] | 1
|
2021-02-28T21:31:18.000Z
|
2021-02-28T21:31:18.000Z
|
non_regression/other_x86_macosx_12.s.asm
|
LRGH/plasmasm
|
4cd50546c3dc895763d72dd60b7c46179c1916bc
|
[
"Apache-2.0"
] | null | null | null |
non_regression/other_x86_macosx_12.s.asm
|
LRGH/plasmasm
|
4cd50546c3dc895763d72dd60b7c46179c1916bc
|
[
"Apache-2.0"
] | null | null | null |
.macosx_version_min 10, 12
.section __TEXT,__text,regular,pure_instructions
.align 4, 0x90
.globl _local_labels
_local_labels:
pushl %ebp
movl %esp, %ebp
.L1_LOCAL_LABEL_1:
movl 8(%ebp), %eax
jmp .L1_LOCAL_LABEL_1
movl $1, 4(%eax)
movl $2, 8(%eax)
movl $3, 12(%eax)
jmp .L1_LOCAL_LABEL_2
jmp .L1_LOCAL_LABEL_1
movl $4, 20(%eax)
.L1_LOCAL_LABEL_2:
movl $5, 16(%eax)
movl $6, 24(%eax)
popl %ebp
ret
# ----------------------
.subsections_via_symbols
| 21.84
| 55
| 0.576923
|
cc365c53229405a19958827cb801967aba46620b
| 161
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/math/float/math48/c/sccz80/cm48_sccz80_nan.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/math/float/math48/c/sccz80/cm48_sccz80_nan.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/math/float/math48/c/sccz80/cm48_sccz80_nan.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
; double __FASTCALL__ nan(const char *tagp)
SECTION code_clib
SECTION code_fp_math48
PUBLIC cm48_sccz80_nan
EXTERN am48_nan
defc cm48_sccz80_nan = am48_nan
| 13.416667
| 43
| 0.826087
|
8e245c2c9a4cf2ae6c21423cb748961349e32848
| 332
|
asm
|
Assembly
|
data/mapObjects/halloffameroom.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 16
|
2018-08-28T21:47:01.000Z
|
2022-02-20T20:29:59.000Z
|
data/mapObjects/halloffameroom.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 5
|
2019-04-03T19:53:11.000Z
|
2022-03-11T22:49:34.000Z
|
data/mapObjects/halloffameroom.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 2
|
2019-12-09T19:46:02.000Z
|
2020-12-05T21:36:30.000Z
|
HallofFameRoomObject:
db $3 ; border block
db $2 ; warps
db $7, $4, $2, CHAMPIONS_ROOM
db $7, $5, $3, CHAMPIONS_ROOM
db $0 ; signs
db $1 ; objects
object SPRITE_OAK, $5, $2, STAY, DOWN, $1 ; person
; warp-to
EVENT_DISP HALL_OF_FAME_WIDTH, $7, $4 ; CHAMPIONS_ROOM
EVENT_DISP HALL_OF_FAME_WIDTH, $7, $5 ; CHAMPIONS_ROOM
| 20.75
| 55
| 0.677711
|
20797366fd9c599526322fe8bf32529b0526001a
| 665,622
|
asm
|
Assembly
|
kernel.asm
|
swu038/CS183lab2
|
b9c4db70ae1b36f4a6b7c26c0361d6728532d1cb
|
[
"MIT-0"
] | null | null | null |
kernel.asm
|
swu038/CS183lab2
|
b9c4db70ae1b36f4a6b7c26c0361d6728532d1cb
|
[
"MIT-0"
] | null | null | null |
kernel.asm
|
swu038/CS183lab2
|
b9c4db70ae1b36f4a6b7c26c0361d6728532d1cb
|
[
"MIT-0"
] | null | null | null |
kernel: file format elf32-i386
Disassembly of section .text:
80100000 <multiboot_header>:
80100000: 02 b0 ad 1b 00 00 add 0x1bad(%eax),%dh
80100006: 00 00 add %al,(%eax)
80100008: fe 4f 52 decb 0x52(%edi)
8010000b: e4 0f in $0xf,%al
8010000c <entry>:
# Entering xv6 on boot processor, with paging off.
.globl entry
entry:
# Turn on page size extension for 4Mbyte pages
movl %cr4, %eax
8010000c: 0f 20 e0 mov %cr4,%eax
orl $(CR4_PSE), %eax
8010000f: 83 c8 10 or $0x10,%eax
movl %eax, %cr4
80100012: 0f 22 e0 mov %eax,%cr4
# Set page directory
movl $(V2P_WO(entrypgdir)), %eax
80100015: b8 00 a0 10 00 mov $0x10a000,%eax
movl %eax, %cr3
8010001a: 0f 22 d8 mov %eax,%cr3
# Turn on paging.
movl %cr0, %eax
8010001d: 0f 20 c0 mov %cr0,%eax
orl $(CR0_PG|CR0_WP), %eax
80100020: 0d 00 00 01 80 or $0x80010000,%eax
movl %eax, %cr0
80100025: 0f 22 c0 mov %eax,%cr0
# Set up the stack pointer.
movl $(stack + KSTACKSIZE), %esp
80100028: bc 70 c6 10 80 mov $0x8010c670,%esp
# Jump to main(), and switch to executing at
# high addresses. The indirect call is needed because
# the assembler produces a PC-relative instruction
# for a direct jump.
mov $main, %eax
8010002d: b8 f0 33 10 80 mov $0x801033f0,%eax
jmp *%eax
80100032: ff e0 jmp *%eax
80100034 <binit>:
struct buf head;
} bcache;
void
binit(void)
{
80100034: 55 push %ebp
80100035: 89 e5 mov %esp,%ebp
80100037: 83 ec 28 sub $0x28,%esp
struct buf *b;
initlock(&bcache.lock, "bcache");
8010003a: c7 44 24 04 fc 85 10 movl $0x801085fc,0x4(%esp)
80100041: 80
80100042: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
80100049: e8 e0 4e 00 00 call 80104f2e <initlock>
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
8010004e: c7 05 b0 db 10 80 a4 movl $0x8010dba4,0x8010dbb0
80100055: db 10 80
bcache.head.next = &bcache.head;
80100058: c7 05 b4 db 10 80 a4 movl $0x8010dba4,0x8010dbb4
8010005f: db 10 80
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80100062: c7 45 f4 b4 c6 10 80 movl $0x8010c6b4,-0xc(%ebp)
80100069: eb 3a jmp 801000a5 <binit+0x71>
b->next = bcache.head.next;
8010006b: 8b 15 b4 db 10 80 mov 0x8010dbb4,%edx
80100071: 8b 45 f4 mov -0xc(%ebp),%eax
80100074: 89 50 10 mov %edx,0x10(%eax)
b->prev = &bcache.head;
80100077: 8b 45 f4 mov -0xc(%ebp),%eax
8010007a: c7 40 0c a4 db 10 80 movl $0x8010dba4,0xc(%eax)
b->dev = -1;
80100081: 8b 45 f4 mov -0xc(%ebp),%eax
80100084: c7 40 04 ff ff ff ff movl $0xffffffff,0x4(%eax)
bcache.head.next->prev = b;
8010008b: a1 b4 db 10 80 mov 0x8010dbb4,%eax
80100090: 8b 55 f4 mov -0xc(%ebp),%edx
80100093: 89 50 0c mov %edx,0xc(%eax)
bcache.head.next = b;
80100096: 8b 45 f4 mov -0xc(%ebp),%eax
80100099: a3 b4 db 10 80 mov %eax,0x8010dbb4
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
bcache.head.next = &bcache.head;
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
8010009e: 81 45 f4 18 02 00 00 addl $0x218,-0xc(%ebp)
801000a5: b8 a4 db 10 80 mov $0x8010dba4,%eax
801000aa: 39 45 f4 cmp %eax,-0xc(%ebp)
801000ad: 72 bc jb 8010006b <binit+0x37>
b->prev = &bcache.head;
b->dev = -1;
bcache.head.next->prev = b;
bcache.head.next = b;
}
}
801000af: c9 leave
801000b0: c3 ret
801000b1 <bget>:
// Look through buffer cache for sector on device dev.
// If not found, allocate fresh block.
// In either case, return B_BUSY buffer.
static struct buf*
bget(uint dev, uint sector)
{
801000b1: 55 push %ebp
801000b2: 89 e5 mov %esp,%ebp
801000b4: 83 ec 28 sub $0x28,%esp
struct buf *b;
acquire(&bcache.lock);
801000b7: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
801000be: e8 8c 4e 00 00 call 80104f4f <acquire>
loop:
// Is the sector already cached?
for(b = bcache.head.next; b != &bcache.head; b = b->next){
801000c3: a1 b4 db 10 80 mov 0x8010dbb4,%eax
801000c8: 89 45 f4 mov %eax,-0xc(%ebp)
801000cb: eb 63 jmp 80100130 <bget+0x7f>
if(b->dev == dev && b->sector == sector){
801000cd: 8b 45 f4 mov -0xc(%ebp),%eax
801000d0: 8b 40 04 mov 0x4(%eax),%eax
801000d3: 3b 45 08 cmp 0x8(%ebp),%eax
801000d6: 75 4f jne 80100127 <bget+0x76>
801000d8: 8b 45 f4 mov -0xc(%ebp),%eax
801000db: 8b 40 08 mov 0x8(%eax),%eax
801000de: 3b 45 0c cmp 0xc(%ebp),%eax
801000e1: 75 44 jne 80100127 <bget+0x76>
if(!(b->flags & B_BUSY)){
801000e3: 8b 45 f4 mov -0xc(%ebp),%eax
801000e6: 8b 00 mov (%eax),%eax
801000e8: 83 e0 01 and $0x1,%eax
801000eb: 85 c0 test %eax,%eax
801000ed: 75 23 jne 80100112 <bget+0x61>
b->flags |= B_BUSY;
801000ef: 8b 45 f4 mov -0xc(%ebp),%eax
801000f2: 8b 00 mov (%eax),%eax
801000f4: 89 c2 mov %eax,%edx
801000f6: 83 ca 01 or $0x1,%edx
801000f9: 8b 45 f4 mov -0xc(%ebp),%eax
801000fc: 89 10 mov %edx,(%eax)
release(&bcache.lock);
801000fe: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
80100105: e8 a6 4e 00 00 call 80104fb0 <release>
return b;
8010010a: 8b 45 f4 mov -0xc(%ebp),%eax
8010010d: e9 93 00 00 00 jmp 801001a5 <bget+0xf4>
}
sleep(b, &bcache.lock);
80100112: c7 44 24 04 80 c6 10 movl $0x8010c680,0x4(%esp)
80100119: 80
8010011a: 8b 45 f4 mov -0xc(%ebp),%eax
8010011d: 89 04 24 mov %eax,(%esp)
80100120: e8 b1 4a 00 00 call 80104bd6 <sleep>
goto loop;
80100125: eb 9c jmp 801000c3 <bget+0x12>
acquire(&bcache.lock);
loop:
// Is the sector already cached?
for(b = bcache.head.next; b != &bcache.head; b = b->next){
80100127: 8b 45 f4 mov -0xc(%ebp),%eax
8010012a: 8b 40 10 mov 0x10(%eax),%eax
8010012d: 89 45 f4 mov %eax,-0xc(%ebp)
80100130: 81 7d f4 a4 db 10 80 cmpl $0x8010dba4,-0xc(%ebp)
80100137: 75 94 jne 801000cd <bget+0x1c>
goto loop;
}
}
// Not cached; recycle some non-busy and clean buffer.
for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
80100139: a1 b0 db 10 80 mov 0x8010dbb0,%eax
8010013e: 89 45 f4 mov %eax,-0xc(%ebp)
80100141: eb 4d jmp 80100190 <bget+0xdf>
if((b->flags & B_BUSY) == 0 && (b->flags & B_DIRTY) == 0){
80100143: 8b 45 f4 mov -0xc(%ebp),%eax
80100146: 8b 00 mov (%eax),%eax
80100148: 83 e0 01 and $0x1,%eax
8010014b: 85 c0 test %eax,%eax
8010014d: 75 38 jne 80100187 <bget+0xd6>
8010014f: 8b 45 f4 mov -0xc(%ebp),%eax
80100152: 8b 00 mov (%eax),%eax
80100154: 83 e0 04 and $0x4,%eax
80100157: 85 c0 test %eax,%eax
80100159: 75 2c jne 80100187 <bget+0xd6>
b->dev = dev;
8010015b: 8b 45 f4 mov -0xc(%ebp),%eax
8010015e: 8b 55 08 mov 0x8(%ebp),%edx
80100161: 89 50 04 mov %edx,0x4(%eax)
b->sector = sector;
80100164: 8b 45 f4 mov -0xc(%ebp),%eax
80100167: 8b 55 0c mov 0xc(%ebp),%edx
8010016a: 89 50 08 mov %edx,0x8(%eax)
b->flags = B_BUSY;
8010016d: 8b 45 f4 mov -0xc(%ebp),%eax
80100170: c7 00 01 00 00 00 movl $0x1,(%eax)
release(&bcache.lock);
80100176: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
8010017d: e8 2e 4e 00 00 call 80104fb0 <release>
return b;
80100182: 8b 45 f4 mov -0xc(%ebp),%eax
80100185: eb 1e jmp 801001a5 <bget+0xf4>
goto loop;
}
}
// Not cached; recycle some non-busy and clean buffer.
for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
80100187: 8b 45 f4 mov -0xc(%ebp),%eax
8010018a: 8b 40 0c mov 0xc(%eax),%eax
8010018d: 89 45 f4 mov %eax,-0xc(%ebp)
80100190: 81 7d f4 a4 db 10 80 cmpl $0x8010dba4,-0xc(%ebp)
80100197: 75 aa jne 80100143 <bget+0x92>
b->flags = B_BUSY;
release(&bcache.lock);
return b;
}
}
panic("bget: no buffers");
80100199: c7 04 24 03 86 10 80 movl $0x80108603,(%esp)
801001a0: e8 95 03 00 00 call 8010053a <panic>
}
801001a5: c9 leave
801001a6: c3 ret
801001a7 <bread>:
// Return a B_BUSY buf with the contents of the indicated disk sector.
struct buf*
bread(uint dev, uint sector)
{
801001a7: 55 push %ebp
801001a8: 89 e5 mov %esp,%ebp
801001aa: 83 ec 28 sub $0x28,%esp
struct buf *b;
b = bget(dev, sector);
801001ad: 8b 45 0c mov 0xc(%ebp),%eax
801001b0: 89 44 24 04 mov %eax,0x4(%esp)
801001b4: 8b 45 08 mov 0x8(%ebp),%eax
801001b7: 89 04 24 mov %eax,(%esp)
801001ba: e8 f2 fe ff ff call 801000b1 <bget>
801001bf: 89 45 f4 mov %eax,-0xc(%ebp)
if(!(b->flags & B_VALID))
801001c2: 8b 45 f4 mov -0xc(%ebp),%eax
801001c5: 8b 00 mov (%eax),%eax
801001c7: 83 e0 02 and $0x2,%eax
801001ca: 85 c0 test %eax,%eax
801001cc: 75 0b jne 801001d9 <bread+0x32>
iderw(b);
801001ce: 8b 45 f4 mov -0xc(%ebp),%eax
801001d1: 89 04 24 mov %eax,(%esp)
801001d4: e8 e5 25 00 00 call 801027be <iderw>
return b;
801001d9: 8b 45 f4 mov -0xc(%ebp),%eax
}
801001dc: c9 leave
801001dd: c3 ret
801001de <bwrite>:
// Write b's contents to disk. Must be B_BUSY.
void
bwrite(struct buf *b)
{
801001de: 55 push %ebp
801001df: 89 e5 mov %esp,%ebp
801001e1: 83 ec 18 sub $0x18,%esp
if((b->flags & B_BUSY) == 0)
801001e4: 8b 45 08 mov 0x8(%ebp),%eax
801001e7: 8b 00 mov (%eax),%eax
801001e9: 83 e0 01 and $0x1,%eax
801001ec: 85 c0 test %eax,%eax
801001ee: 75 0c jne 801001fc <bwrite+0x1e>
panic("bwrite");
801001f0: c7 04 24 14 86 10 80 movl $0x80108614,(%esp)
801001f7: e8 3e 03 00 00 call 8010053a <panic>
b->flags |= B_DIRTY;
801001fc: 8b 45 08 mov 0x8(%ebp),%eax
801001ff: 8b 00 mov (%eax),%eax
80100201: 89 c2 mov %eax,%edx
80100203: 83 ca 04 or $0x4,%edx
80100206: 8b 45 08 mov 0x8(%ebp),%eax
80100209: 89 10 mov %edx,(%eax)
iderw(b);
8010020b: 8b 45 08 mov 0x8(%ebp),%eax
8010020e: 89 04 24 mov %eax,(%esp)
80100211: e8 a8 25 00 00 call 801027be <iderw>
}
80100216: c9 leave
80100217: c3 ret
80100218 <brelse>:
// Release a B_BUSY buffer.
// Move to the head of the MRU list.
void
brelse(struct buf *b)
{
80100218: 55 push %ebp
80100219: 89 e5 mov %esp,%ebp
8010021b: 83 ec 18 sub $0x18,%esp
if((b->flags & B_BUSY) == 0)
8010021e: 8b 45 08 mov 0x8(%ebp),%eax
80100221: 8b 00 mov (%eax),%eax
80100223: 83 e0 01 and $0x1,%eax
80100226: 85 c0 test %eax,%eax
80100228: 75 0c jne 80100236 <brelse+0x1e>
panic("brelse");
8010022a: c7 04 24 1b 86 10 80 movl $0x8010861b,(%esp)
80100231: e8 04 03 00 00 call 8010053a <panic>
acquire(&bcache.lock);
80100236: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
8010023d: e8 0d 4d 00 00 call 80104f4f <acquire>
b->next->prev = b->prev;
80100242: 8b 45 08 mov 0x8(%ebp),%eax
80100245: 8b 40 10 mov 0x10(%eax),%eax
80100248: 8b 55 08 mov 0x8(%ebp),%edx
8010024b: 8b 52 0c mov 0xc(%edx),%edx
8010024e: 89 50 0c mov %edx,0xc(%eax)
b->prev->next = b->next;
80100251: 8b 45 08 mov 0x8(%ebp),%eax
80100254: 8b 40 0c mov 0xc(%eax),%eax
80100257: 8b 55 08 mov 0x8(%ebp),%edx
8010025a: 8b 52 10 mov 0x10(%edx),%edx
8010025d: 89 50 10 mov %edx,0x10(%eax)
b->next = bcache.head.next;
80100260: 8b 15 b4 db 10 80 mov 0x8010dbb4,%edx
80100266: 8b 45 08 mov 0x8(%ebp),%eax
80100269: 89 50 10 mov %edx,0x10(%eax)
b->prev = &bcache.head;
8010026c: 8b 45 08 mov 0x8(%ebp),%eax
8010026f: c7 40 0c a4 db 10 80 movl $0x8010dba4,0xc(%eax)
bcache.head.next->prev = b;
80100276: a1 b4 db 10 80 mov 0x8010dbb4,%eax
8010027b: 8b 55 08 mov 0x8(%ebp),%edx
8010027e: 89 50 0c mov %edx,0xc(%eax)
bcache.head.next = b;
80100281: 8b 45 08 mov 0x8(%ebp),%eax
80100284: a3 b4 db 10 80 mov %eax,0x8010dbb4
b->flags &= ~B_BUSY;
80100289: 8b 45 08 mov 0x8(%ebp),%eax
8010028c: 8b 00 mov (%eax),%eax
8010028e: 89 c2 mov %eax,%edx
80100290: 83 e2 fe and $0xfffffffe,%edx
80100293: 8b 45 08 mov 0x8(%ebp),%eax
80100296: 89 10 mov %edx,(%eax)
wakeup(b);
80100298: 8b 45 08 mov 0x8(%ebp),%eax
8010029b: 89 04 24 mov %eax,(%esp)
8010029e: e8 79 4a 00 00 call 80104d1c <wakeup>
release(&bcache.lock);
801002a3: c7 04 24 80 c6 10 80 movl $0x8010c680,(%esp)
801002aa: e8 01 4d 00 00 call 80104fb0 <release>
}
801002af: c9 leave
801002b0: c3 ret
801002b1: 00 00 add %al,(%eax)
...
801002b4 <inb>:
// Routines to let C code use special x86 instructions.
static inline uchar
inb(ushort port)
{
801002b4: 55 push %ebp
801002b5: 89 e5 mov %esp,%ebp
801002b7: 83 ec 14 sub $0x14,%esp
801002ba: 8b 45 08 mov 0x8(%ebp),%eax
801002bd: 66 89 45 ec mov %ax,-0x14(%ebp)
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801002c1: 0f b7 45 ec movzwl -0x14(%ebp),%eax
801002c5: 89 c2 mov %eax,%edx
801002c7: ec in (%dx),%al
801002c8: 88 45 ff mov %al,-0x1(%ebp)
return data;
801002cb: 0f b6 45 ff movzbl -0x1(%ebp),%eax
}
801002cf: c9 leave
801002d0: c3 ret
801002d1 <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
801002d1: 55 push %ebp
801002d2: 89 e5 mov %esp,%ebp
801002d4: 83 ec 08 sub $0x8,%esp
801002d7: 8b 55 08 mov 0x8(%ebp),%edx
801002da: 8b 45 0c mov 0xc(%ebp),%eax
801002dd: 66 89 55 fc mov %dx,-0x4(%ebp)
801002e1: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801002e4: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
801002e8: 0f b7 55 fc movzwl -0x4(%ebp),%edx
801002ec: ee out %al,(%dx)
}
801002ed: c9 leave
801002ee: c3 ret
801002ef <cli>:
asm volatile("movw %0, %%gs" : : "r" (v));
}
static inline void
cli(void)
{
801002ef: 55 push %ebp
801002f0: 89 e5 mov %esp,%ebp
asm volatile("cli");
801002f2: fa cli
}
801002f3: 5d pop %ebp
801002f4: c3 ret
801002f5 <printint>:
int locking;
} cons;
static void
printint(int xx, int base, int sign)
{
801002f5: 55 push %ebp
801002f6: 89 e5 mov %esp,%ebp
801002f8: 53 push %ebx
801002f9: 83 ec 44 sub $0x44,%esp
static char digits[] = "0123456789abcdef";
char buf[16];
int i;
uint x;
if(sign && (sign = xx < 0))
801002fc: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80100300: 74 19 je 8010031b <printint+0x26>
80100302: 8b 45 08 mov 0x8(%ebp),%eax
80100305: c1 e8 1f shr $0x1f,%eax
80100308: 89 45 10 mov %eax,0x10(%ebp)
8010030b: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010030f: 74 0a je 8010031b <printint+0x26>
x = -xx;
80100311: 8b 45 08 mov 0x8(%ebp),%eax
80100314: f7 d8 neg %eax
80100316: 89 45 f4 mov %eax,-0xc(%ebp)
static char digits[] = "0123456789abcdef";
char buf[16];
int i;
uint x;
if(sign && (sign = xx < 0))
80100319: eb 06 jmp 80100321 <printint+0x2c>
x = -xx;
else
x = xx;
8010031b: 8b 45 08 mov 0x8(%ebp),%eax
8010031e: 89 45 f4 mov %eax,-0xc(%ebp)
i = 0;
80100321: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
do{
buf[i++] = digits[x % base];
80100328: 8b 4d f0 mov -0x10(%ebp),%ecx
8010032b: 8b 5d 0c mov 0xc(%ebp),%ebx
8010032e: 8b 45 f4 mov -0xc(%ebp),%eax
80100331: ba 00 00 00 00 mov $0x0,%edx
80100336: f7 f3 div %ebx
80100338: 89 d0 mov %edx,%eax
8010033a: 0f b6 80 04 90 10 80 movzbl -0x7fef6ffc(%eax),%eax
80100341: 88 44 0d e0 mov %al,-0x20(%ebp,%ecx,1)
80100345: 83 45 f0 01 addl $0x1,-0x10(%ebp)
}while((x /= base) != 0);
80100349: 8b 45 0c mov 0xc(%ebp),%eax
8010034c: 89 45 d4 mov %eax,-0x2c(%ebp)
8010034f: 8b 45 f4 mov -0xc(%ebp),%eax
80100352: ba 00 00 00 00 mov $0x0,%edx
80100357: f7 75 d4 divl -0x2c(%ebp)
8010035a: 89 45 f4 mov %eax,-0xc(%ebp)
8010035d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80100361: 75 c5 jne 80100328 <printint+0x33>
if(sign)
80100363: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80100367: 74 21 je 8010038a <printint+0x95>
buf[i++] = '-';
80100369: 8b 45 f0 mov -0x10(%ebp),%eax
8010036c: c6 44 05 e0 2d movb $0x2d,-0x20(%ebp,%eax,1)
80100371: 83 45 f0 01 addl $0x1,-0x10(%ebp)
while(--i >= 0)
80100375: eb 13 jmp 8010038a <printint+0x95>
consputc(buf[i]);
80100377: 8b 45 f0 mov -0x10(%ebp),%eax
8010037a: 0f b6 44 05 e0 movzbl -0x20(%ebp,%eax,1),%eax
8010037f: 0f be c0 movsbl %al,%eax
80100382: 89 04 24 mov %eax,(%esp)
80100385: e8 c4 03 00 00 call 8010074e <consputc>
}while((x /= base) != 0);
if(sign)
buf[i++] = '-';
while(--i >= 0)
8010038a: 83 6d f0 01 subl $0x1,-0x10(%ebp)
8010038e: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80100392: 79 e3 jns 80100377 <printint+0x82>
consputc(buf[i]);
}
80100394: 83 c4 44 add $0x44,%esp
80100397: 5b pop %ebx
80100398: 5d pop %ebp
80100399: c3 ret
8010039a <cprintf>:
//PAGEBREAK: 50
// Print to the console. only understands %d, %x, %p, %s.
void
cprintf(char *fmt, ...)
{
8010039a: 55 push %ebp
8010039b: 89 e5 mov %esp,%ebp
8010039d: 83 ec 38 sub $0x38,%esp
int i, c, locking;
uint *argp;
char *s;
locking = cons.locking;
801003a0: a1 14 b6 10 80 mov 0x8010b614,%eax
801003a5: 89 45 ec mov %eax,-0x14(%ebp)
if(locking)
801003a8: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
801003ac: 74 0c je 801003ba <cprintf+0x20>
acquire(&cons.lock);
801003ae: c7 04 24 e0 b5 10 80 movl $0x8010b5e0,(%esp)
801003b5: e8 95 4b 00 00 call 80104f4f <acquire>
if (fmt == 0)
801003ba: 8b 45 08 mov 0x8(%ebp),%eax
801003bd: 85 c0 test %eax,%eax
801003bf: 75 0c jne 801003cd <cprintf+0x33>
panic("null fmt");
801003c1: c7 04 24 22 86 10 80 movl $0x80108622,(%esp)
801003c8: e8 6d 01 00 00 call 8010053a <panic>
argp = (uint*)(void*)(&fmt + 1);
801003cd: 8d 45 08 lea 0x8(%ebp),%eax
801003d0: 83 c0 04 add $0x4,%eax
801003d3: 89 45 f0 mov %eax,-0x10(%ebp)
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801003d6: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
801003dd: e9 20 01 00 00 jmp 80100502 <cprintf+0x168>
if(c != '%'){
801003e2: 83 7d e8 25 cmpl $0x25,-0x18(%ebp)
801003e6: 74 10 je 801003f8 <cprintf+0x5e>
consputc(c);
801003e8: 8b 45 e8 mov -0x18(%ebp),%eax
801003eb: 89 04 24 mov %eax,(%esp)
801003ee: e8 5b 03 00 00 call 8010074e <consputc>
continue;
801003f3: e9 06 01 00 00 jmp 801004fe <cprintf+0x164>
}
c = fmt[++i] & 0xff;
801003f8: 8b 55 08 mov 0x8(%ebp),%edx
801003fb: 83 45 e4 01 addl $0x1,-0x1c(%ebp)
801003ff: 8b 45 e4 mov -0x1c(%ebp),%eax
80100402: 8d 04 02 lea (%edx,%eax,1),%eax
80100405: 0f b6 00 movzbl (%eax),%eax
80100408: 0f be c0 movsbl %al,%eax
8010040b: 25 ff 00 00 00 and $0xff,%eax
80100410: 89 45 e8 mov %eax,-0x18(%ebp)
if(c == 0)
80100413: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
80100417: 0f 84 08 01 00 00 je 80100525 <cprintf+0x18b>
break;
switch(c){
8010041d: 8b 45 e8 mov -0x18(%ebp),%eax
80100420: 83 f8 70 cmp $0x70,%eax
80100423: 74 4d je 80100472 <cprintf+0xd8>
80100425: 83 f8 70 cmp $0x70,%eax
80100428: 7f 13 jg 8010043d <cprintf+0xa3>
8010042a: 83 f8 25 cmp $0x25,%eax
8010042d: 0f 84 a6 00 00 00 je 801004d9 <cprintf+0x13f>
80100433: 83 f8 64 cmp $0x64,%eax
80100436: 74 14 je 8010044c <cprintf+0xb2>
80100438: e9 aa 00 00 00 jmp 801004e7 <cprintf+0x14d>
8010043d: 83 f8 73 cmp $0x73,%eax
80100440: 74 53 je 80100495 <cprintf+0xfb>
80100442: 83 f8 78 cmp $0x78,%eax
80100445: 74 2b je 80100472 <cprintf+0xd8>
80100447: e9 9b 00 00 00 jmp 801004e7 <cprintf+0x14d>
case 'd':
printint(*argp++, 10, 1);
8010044c: 8b 45 f0 mov -0x10(%ebp),%eax
8010044f: 8b 00 mov (%eax),%eax
80100451: 83 45 f0 04 addl $0x4,-0x10(%ebp)
80100455: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
8010045c: 00
8010045d: c7 44 24 04 0a 00 00 movl $0xa,0x4(%esp)
80100464: 00
80100465: 89 04 24 mov %eax,(%esp)
80100468: e8 88 fe ff ff call 801002f5 <printint>
break;
8010046d: e9 8c 00 00 00 jmp 801004fe <cprintf+0x164>
case 'x':
case 'p':
printint(*argp++, 16, 0);
80100472: 8b 45 f0 mov -0x10(%ebp),%eax
80100475: 8b 00 mov (%eax),%eax
80100477: 83 45 f0 04 addl $0x4,-0x10(%ebp)
8010047b: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80100482: 00
80100483: c7 44 24 04 10 00 00 movl $0x10,0x4(%esp)
8010048a: 00
8010048b: 89 04 24 mov %eax,(%esp)
8010048e: e8 62 fe ff ff call 801002f5 <printint>
break;
80100493: eb 69 jmp 801004fe <cprintf+0x164>
case 's':
if((s = (char*)*argp++) == 0)
80100495: 8b 45 f0 mov -0x10(%ebp),%eax
80100498: 8b 00 mov (%eax),%eax
8010049a: 89 45 f4 mov %eax,-0xc(%ebp)
8010049d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801004a1: 0f 94 c0 sete %al
801004a4: 83 45 f0 04 addl $0x4,-0x10(%ebp)
801004a8: 84 c0 test %al,%al
801004aa: 74 20 je 801004cc <cprintf+0x132>
s = "(null)";
801004ac: c7 45 f4 2b 86 10 80 movl $0x8010862b,-0xc(%ebp)
for(; *s; s++)
801004b3: eb 18 jmp 801004cd <cprintf+0x133>
consputc(*s);
801004b5: 8b 45 f4 mov -0xc(%ebp),%eax
801004b8: 0f b6 00 movzbl (%eax),%eax
801004bb: 0f be c0 movsbl %al,%eax
801004be: 89 04 24 mov %eax,(%esp)
801004c1: e8 88 02 00 00 call 8010074e <consputc>
printint(*argp++, 16, 0);
break;
case 's':
if((s = (char*)*argp++) == 0)
s = "(null)";
for(; *s; s++)
801004c6: 83 45 f4 01 addl $0x1,-0xc(%ebp)
801004ca: eb 01 jmp 801004cd <cprintf+0x133>
801004cc: 90 nop
801004cd: 8b 45 f4 mov -0xc(%ebp),%eax
801004d0: 0f b6 00 movzbl (%eax),%eax
801004d3: 84 c0 test %al,%al
801004d5: 75 de jne 801004b5 <cprintf+0x11b>
consputc(*s);
break;
801004d7: eb 25 jmp 801004fe <cprintf+0x164>
case '%':
consputc('%');
801004d9: c7 04 24 25 00 00 00 movl $0x25,(%esp)
801004e0: e8 69 02 00 00 call 8010074e <consputc>
break;
801004e5: eb 17 jmp 801004fe <cprintf+0x164>
default:
// Print unknown % sequence to draw attention.
consputc('%');
801004e7: c7 04 24 25 00 00 00 movl $0x25,(%esp)
801004ee: e8 5b 02 00 00 call 8010074e <consputc>
consputc(c);
801004f3: 8b 45 e8 mov -0x18(%ebp),%eax
801004f6: 89 04 24 mov %eax,(%esp)
801004f9: e8 50 02 00 00 call 8010074e <consputc>
if (fmt == 0)
panic("null fmt");
argp = (uint*)(void*)(&fmt + 1);
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801004fe: 83 45 e4 01 addl $0x1,-0x1c(%ebp)
80100502: 8b 55 08 mov 0x8(%ebp),%edx
80100505: 8b 45 e4 mov -0x1c(%ebp),%eax
80100508: 8d 04 02 lea (%edx,%eax,1),%eax
8010050b: 0f b6 00 movzbl (%eax),%eax
8010050e: 0f be c0 movsbl %al,%eax
80100511: 25 ff 00 00 00 and $0xff,%eax
80100516: 89 45 e8 mov %eax,-0x18(%ebp)
80100519: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
8010051d: 0f 85 bf fe ff ff jne 801003e2 <cprintf+0x48>
80100523: eb 01 jmp 80100526 <cprintf+0x18c>
consputc(c);
continue;
}
c = fmt[++i] & 0xff;
if(c == 0)
break;
80100525: 90 nop
consputc(c);
break;
}
}
if(locking)
80100526: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
8010052a: 74 0c je 80100538 <cprintf+0x19e>
release(&cons.lock);
8010052c: c7 04 24 e0 b5 10 80 movl $0x8010b5e0,(%esp)
80100533: e8 78 4a 00 00 call 80104fb0 <release>
}
80100538: c9 leave
80100539: c3 ret
8010053a <panic>:
void
panic(char *s)
{
8010053a: 55 push %ebp
8010053b: 89 e5 mov %esp,%ebp
8010053d: 83 ec 48 sub $0x48,%esp
int i;
uint pcs[10];
cli();
80100540: e8 aa fd ff ff call 801002ef <cli>
cons.locking = 0;
80100545: c7 05 14 b6 10 80 00 movl $0x0,0x8010b614
8010054c: 00 00 00
cprintf("cpu%d: panic: ", cpu->id);
8010054f: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80100555: 0f b6 00 movzbl (%eax),%eax
80100558: 0f b6 c0 movzbl %al,%eax
8010055b: 89 44 24 04 mov %eax,0x4(%esp)
8010055f: c7 04 24 32 86 10 80 movl $0x80108632,(%esp)
80100566: e8 2f fe ff ff call 8010039a <cprintf>
cprintf(s);
8010056b: 8b 45 08 mov 0x8(%ebp),%eax
8010056e: 89 04 24 mov %eax,(%esp)
80100571: e8 24 fe ff ff call 8010039a <cprintf>
cprintf("\n");
80100576: c7 04 24 41 86 10 80 movl $0x80108641,(%esp)
8010057d: e8 18 fe ff ff call 8010039a <cprintf>
getcallerpcs(&s, pcs);
80100582: 8d 45 cc lea -0x34(%ebp),%eax
80100585: 89 44 24 04 mov %eax,0x4(%esp)
80100589: 8d 45 08 lea 0x8(%ebp),%eax
8010058c: 89 04 24 mov %eax,(%esp)
8010058f: e8 6b 4a 00 00 call 80104fff <getcallerpcs>
for(i=0; i<10; i++)
80100594: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
8010059b: eb 1b jmp 801005b8 <panic+0x7e>
cprintf(" %p", pcs[i]);
8010059d: 8b 45 f4 mov -0xc(%ebp),%eax
801005a0: 8b 44 85 cc mov -0x34(%ebp,%eax,4),%eax
801005a4: 89 44 24 04 mov %eax,0x4(%esp)
801005a8: c7 04 24 43 86 10 80 movl $0x80108643,(%esp)
801005af: e8 e6 fd ff ff call 8010039a <cprintf>
cons.locking = 0;
cprintf("cpu%d: panic: ", cpu->id);
cprintf(s);
cprintf("\n");
getcallerpcs(&s, pcs);
for(i=0; i<10; i++)
801005b4: 83 45 f4 01 addl $0x1,-0xc(%ebp)
801005b8: 83 7d f4 09 cmpl $0x9,-0xc(%ebp)
801005bc: 7e df jle 8010059d <panic+0x63>
cprintf(" %p", pcs[i]);
panicked = 1; // freeze other CPU
801005be: c7 05 c0 b5 10 80 01 movl $0x1,0x8010b5c0
801005c5: 00 00 00
for(;;)
;
801005c8: eb fe jmp 801005c8 <panic+0x8e>
801005ca <cgaputc>:
#define CRTPORT 0x3d4
static ushort *crt = (ushort*)P2V(0xb8000); // CGA memory
static void
cgaputc(int c)
{
801005ca: 55 push %ebp
801005cb: 89 e5 mov %esp,%ebp
801005cd: 83 ec 28 sub $0x28,%esp
int pos;
// Cursor position: col + 80*row.
outb(CRTPORT, 14);
801005d0: c7 44 24 04 0e 00 00 movl $0xe,0x4(%esp)
801005d7: 00
801005d8: c7 04 24 d4 03 00 00 movl $0x3d4,(%esp)
801005df: e8 ed fc ff ff call 801002d1 <outb>
pos = inb(CRTPORT+1) << 8;
801005e4: c7 04 24 d5 03 00 00 movl $0x3d5,(%esp)
801005eb: e8 c4 fc ff ff call 801002b4 <inb>
801005f0: 0f b6 c0 movzbl %al,%eax
801005f3: c1 e0 08 shl $0x8,%eax
801005f6: 89 45 f4 mov %eax,-0xc(%ebp)
outb(CRTPORT, 15);
801005f9: c7 44 24 04 0f 00 00 movl $0xf,0x4(%esp)
80100600: 00
80100601: c7 04 24 d4 03 00 00 movl $0x3d4,(%esp)
80100608: e8 c4 fc ff ff call 801002d1 <outb>
pos |= inb(CRTPORT+1);
8010060d: c7 04 24 d5 03 00 00 movl $0x3d5,(%esp)
80100614: e8 9b fc ff ff call 801002b4 <inb>
80100619: 0f b6 c0 movzbl %al,%eax
8010061c: 09 45 f4 or %eax,-0xc(%ebp)
if(c == '\n')
8010061f: 83 7d 08 0a cmpl $0xa,0x8(%ebp)
80100623: 75 30 jne 80100655 <cgaputc+0x8b>
pos += 80 - pos%80;
80100625: 8b 4d f4 mov -0xc(%ebp),%ecx
80100628: ba 67 66 66 66 mov $0x66666667,%edx
8010062d: 89 c8 mov %ecx,%eax
8010062f: f7 ea imul %edx
80100631: c1 fa 05 sar $0x5,%edx
80100634: 89 c8 mov %ecx,%eax
80100636: c1 f8 1f sar $0x1f,%eax
80100639: 29 c2 sub %eax,%edx
8010063b: 89 d0 mov %edx,%eax
8010063d: c1 e0 02 shl $0x2,%eax
80100640: 01 d0 add %edx,%eax
80100642: c1 e0 04 shl $0x4,%eax
80100645: 89 ca mov %ecx,%edx
80100647: 29 c2 sub %eax,%edx
80100649: b8 50 00 00 00 mov $0x50,%eax
8010064e: 29 d0 sub %edx,%eax
80100650: 01 45 f4 add %eax,-0xc(%ebp)
80100653: eb 33 jmp 80100688 <cgaputc+0xbe>
else if(c == BACKSPACE){
80100655: 81 7d 08 00 01 00 00 cmpl $0x100,0x8(%ebp)
8010065c: 75 0c jne 8010066a <cgaputc+0xa0>
if(pos > 0) --pos;
8010065e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80100662: 7e 24 jle 80100688 <cgaputc+0xbe>
80100664: 83 6d f4 01 subl $0x1,-0xc(%ebp)
80100668: eb 1e jmp 80100688 <cgaputc+0xbe>
} else
crt[pos++] = (c&0xff) | 0x0700; // black on white
8010066a: a1 00 90 10 80 mov 0x80109000,%eax
8010066f: 8b 55 f4 mov -0xc(%ebp),%edx
80100672: 01 d2 add %edx,%edx
80100674: 8d 14 10 lea (%eax,%edx,1),%edx
80100677: 8b 45 08 mov 0x8(%ebp),%eax
8010067a: 66 25 ff 00 and $0xff,%ax
8010067e: 80 cc 07 or $0x7,%ah
80100681: 66 89 02 mov %ax,(%edx)
80100684: 83 45 f4 01 addl $0x1,-0xc(%ebp)
if((pos/80) >= 24){ // Scroll up.
80100688: 81 7d f4 7f 07 00 00 cmpl $0x77f,-0xc(%ebp)
8010068f: 7e 53 jle 801006e4 <cgaputc+0x11a>
memmove(crt, crt+80, sizeof(crt[0])*23*80);
80100691: a1 00 90 10 80 mov 0x80109000,%eax
80100696: 8d 90 a0 00 00 00 lea 0xa0(%eax),%edx
8010069c: a1 00 90 10 80 mov 0x80109000,%eax
801006a1: c7 44 24 08 60 0e 00 movl $0xe60,0x8(%esp)
801006a8: 00
801006a9: 89 54 24 04 mov %edx,0x4(%esp)
801006ad: 89 04 24 mov %eax,(%esp)
801006b0: e8 bc 4b 00 00 call 80105271 <memmove>
pos -= 80;
801006b5: 83 6d f4 50 subl $0x50,-0xc(%ebp)
memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
801006b9: b8 80 07 00 00 mov $0x780,%eax
801006be: 2b 45 f4 sub -0xc(%ebp),%eax
801006c1: 8d 14 00 lea (%eax,%eax,1),%edx
801006c4: a1 00 90 10 80 mov 0x80109000,%eax
801006c9: 8b 4d f4 mov -0xc(%ebp),%ecx
801006cc: 01 c9 add %ecx,%ecx
801006ce: 01 c8 add %ecx,%eax
801006d0: 89 54 24 08 mov %edx,0x8(%esp)
801006d4: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801006db: 00
801006dc: 89 04 24 mov %eax,(%esp)
801006df: e8 ba 4a 00 00 call 8010519e <memset>
}
outb(CRTPORT, 14);
801006e4: c7 44 24 04 0e 00 00 movl $0xe,0x4(%esp)
801006eb: 00
801006ec: c7 04 24 d4 03 00 00 movl $0x3d4,(%esp)
801006f3: e8 d9 fb ff ff call 801002d1 <outb>
outb(CRTPORT+1, pos>>8);
801006f8: 8b 45 f4 mov -0xc(%ebp),%eax
801006fb: c1 f8 08 sar $0x8,%eax
801006fe: 0f b6 c0 movzbl %al,%eax
80100701: 89 44 24 04 mov %eax,0x4(%esp)
80100705: c7 04 24 d5 03 00 00 movl $0x3d5,(%esp)
8010070c: e8 c0 fb ff ff call 801002d1 <outb>
outb(CRTPORT, 15);
80100711: c7 44 24 04 0f 00 00 movl $0xf,0x4(%esp)
80100718: 00
80100719: c7 04 24 d4 03 00 00 movl $0x3d4,(%esp)
80100720: e8 ac fb ff ff call 801002d1 <outb>
outb(CRTPORT+1, pos);
80100725: 8b 45 f4 mov -0xc(%ebp),%eax
80100728: 0f b6 c0 movzbl %al,%eax
8010072b: 89 44 24 04 mov %eax,0x4(%esp)
8010072f: c7 04 24 d5 03 00 00 movl $0x3d5,(%esp)
80100736: e8 96 fb ff ff call 801002d1 <outb>
crt[pos] = ' ' | 0x0700;
8010073b: a1 00 90 10 80 mov 0x80109000,%eax
80100740: 8b 55 f4 mov -0xc(%ebp),%edx
80100743: 01 d2 add %edx,%edx
80100745: 01 d0 add %edx,%eax
80100747: 66 c7 00 20 07 movw $0x720,(%eax)
}
8010074c: c9 leave
8010074d: c3 ret
8010074e <consputc>:
void
consputc(int c)
{
8010074e: 55 push %ebp
8010074f: 89 e5 mov %esp,%ebp
80100751: 83 ec 18 sub $0x18,%esp
if(panicked){
80100754: a1 c0 b5 10 80 mov 0x8010b5c0,%eax
80100759: 85 c0 test %eax,%eax
8010075b: 74 07 je 80100764 <consputc+0x16>
cli();
8010075d: e8 8d fb ff ff call 801002ef <cli>
for(;;)
;
80100762: eb fe jmp 80100762 <consputc+0x14>
}
if(c == BACKSPACE){
80100764: 81 7d 08 00 01 00 00 cmpl $0x100,0x8(%ebp)
8010076b: 75 26 jne 80100793 <consputc+0x45>
uartputc('\b'); uartputc(' '); uartputc('\b');
8010076d: c7 04 24 08 00 00 00 movl $0x8,(%esp)
80100774: e8 d3 64 00 00 call 80106c4c <uartputc>
80100779: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80100780: e8 c7 64 00 00 call 80106c4c <uartputc>
80100785: c7 04 24 08 00 00 00 movl $0x8,(%esp)
8010078c: e8 bb 64 00 00 call 80106c4c <uartputc>
80100791: eb 0b jmp 8010079e <consputc+0x50>
} else
uartputc(c);
80100793: 8b 45 08 mov 0x8(%ebp),%eax
80100796: 89 04 24 mov %eax,(%esp)
80100799: e8 ae 64 00 00 call 80106c4c <uartputc>
cgaputc(c);
8010079e: 8b 45 08 mov 0x8(%ebp),%eax
801007a1: 89 04 24 mov %eax,(%esp)
801007a4: e8 21 fe ff ff call 801005ca <cgaputc>
}
801007a9: c9 leave
801007aa: c3 ret
801007ab <consoleintr>:
#define C(x) ((x)-'@') // Control-x
void
consoleintr(int (*getc)(void))
{
801007ab: 55 push %ebp
801007ac: 89 e5 mov %esp,%ebp
801007ae: 83 ec 28 sub $0x28,%esp
int c;
acquire(&input.lock);
801007b1: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
801007b8: e8 92 47 00 00 call 80104f4f <acquire>
while((c = getc()) >= 0){
801007bd: e9 3e 01 00 00 jmp 80100900 <consoleintr+0x155>
switch(c){
801007c2: 8b 45 f4 mov -0xc(%ebp),%eax
801007c5: 83 f8 10 cmp $0x10,%eax
801007c8: 74 1e je 801007e8 <consoleintr+0x3d>
801007ca: 83 f8 10 cmp $0x10,%eax
801007cd: 7f 0a jg 801007d9 <consoleintr+0x2e>
801007cf: 83 f8 08 cmp $0x8,%eax
801007d2: 74 68 je 8010083c <consoleintr+0x91>
801007d4: e9 94 00 00 00 jmp 8010086d <consoleintr+0xc2>
801007d9: 83 f8 15 cmp $0x15,%eax
801007dc: 74 2f je 8010080d <consoleintr+0x62>
801007de: 83 f8 7f cmp $0x7f,%eax
801007e1: 74 59 je 8010083c <consoleintr+0x91>
801007e3: e9 85 00 00 00 jmp 8010086d <consoleintr+0xc2>
case C('P'): // Process listing.
procdump();
801007e8: e8 d6 45 00 00 call 80104dc3 <procdump>
break;
801007ed: e9 0e 01 00 00 jmp 80100900 <consoleintr+0x155>
case C('U'): // Kill line.
while(input.e != input.w &&
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
input.e--;
801007f2: a1 7c de 10 80 mov 0x8010de7c,%eax
801007f7: 83 e8 01 sub $0x1,%eax
801007fa: a3 7c de 10 80 mov %eax,0x8010de7c
consputc(BACKSPACE);
801007ff: c7 04 24 00 01 00 00 movl $0x100,(%esp)
80100806: e8 43 ff ff ff call 8010074e <consputc>
8010080b: eb 01 jmp 8010080e <consoleintr+0x63>
switch(c){
case C('P'): // Process listing.
procdump();
break;
case C('U'): // Kill line.
while(input.e != input.w &&
8010080d: 90 nop
8010080e: 8b 15 7c de 10 80 mov 0x8010de7c,%edx
80100814: a1 78 de 10 80 mov 0x8010de78,%eax
80100819: 39 c2 cmp %eax,%edx
8010081b: 0f 84 db 00 00 00 je 801008fc <consoleintr+0x151>
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
80100821: a1 7c de 10 80 mov 0x8010de7c,%eax
80100826: 83 e8 01 sub $0x1,%eax
80100829: 83 e0 7f and $0x7f,%eax
8010082c: 0f b6 80 f4 dd 10 80 movzbl -0x7fef220c(%eax),%eax
switch(c){
case C('P'): // Process listing.
procdump();
break;
case C('U'): // Kill line.
while(input.e != input.w &&
80100833: 3c 0a cmp $0xa,%al
80100835: 75 bb jne 801007f2 <consoleintr+0x47>
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
input.e--;
consputc(BACKSPACE);
}
break;
80100837: e9 c4 00 00 00 jmp 80100900 <consoleintr+0x155>
case C('H'): case '\x7f': // Backspace
if(input.e != input.w){
8010083c: 8b 15 7c de 10 80 mov 0x8010de7c,%edx
80100842: a1 78 de 10 80 mov 0x8010de78,%eax
80100847: 39 c2 cmp %eax,%edx
80100849: 0f 84 b0 00 00 00 je 801008ff <consoleintr+0x154>
input.e--;
8010084f: a1 7c de 10 80 mov 0x8010de7c,%eax
80100854: 83 e8 01 sub $0x1,%eax
80100857: a3 7c de 10 80 mov %eax,0x8010de7c
consputc(BACKSPACE);
8010085c: c7 04 24 00 01 00 00 movl $0x100,(%esp)
80100863: e8 e6 fe ff ff call 8010074e <consputc>
}
break;
80100868: e9 93 00 00 00 jmp 80100900 <consoleintr+0x155>
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
8010086d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80100871: 0f 84 89 00 00 00 je 80100900 <consoleintr+0x155>
80100877: 8b 15 7c de 10 80 mov 0x8010de7c,%edx
8010087d: a1 74 de 10 80 mov 0x8010de74,%eax
80100882: 89 d1 mov %edx,%ecx
80100884: 29 c1 sub %eax,%ecx
80100886: 89 c8 mov %ecx,%eax
80100888: 83 f8 7f cmp $0x7f,%eax
8010088b: 77 73 ja 80100900 <consoleintr+0x155>
c = (c == '\r') ? '\n' : c;
8010088d: 83 7d f4 0d cmpl $0xd,-0xc(%ebp)
80100891: 74 05 je 80100898 <consoleintr+0xed>
80100893: 8b 45 f4 mov -0xc(%ebp),%eax
80100896: eb 05 jmp 8010089d <consoleintr+0xf2>
80100898: b8 0a 00 00 00 mov $0xa,%eax
8010089d: 89 45 f4 mov %eax,-0xc(%ebp)
input.buf[input.e++ % INPUT_BUF] = c;
801008a0: a1 7c de 10 80 mov 0x8010de7c,%eax
801008a5: 89 c1 mov %eax,%ecx
801008a7: 83 e1 7f and $0x7f,%ecx
801008aa: 8b 55 f4 mov -0xc(%ebp),%edx
801008ad: 88 91 f4 dd 10 80 mov %dl,-0x7fef220c(%ecx)
801008b3: 83 c0 01 add $0x1,%eax
801008b6: a3 7c de 10 80 mov %eax,0x8010de7c
consputc(c);
801008bb: 8b 45 f4 mov -0xc(%ebp),%eax
801008be: 89 04 24 mov %eax,(%esp)
801008c1: e8 88 fe ff ff call 8010074e <consputc>
if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
801008c6: 83 7d f4 0a cmpl $0xa,-0xc(%ebp)
801008ca: 74 18 je 801008e4 <consoleintr+0x139>
801008cc: 83 7d f4 04 cmpl $0x4,-0xc(%ebp)
801008d0: 74 12 je 801008e4 <consoleintr+0x139>
801008d2: a1 7c de 10 80 mov 0x8010de7c,%eax
801008d7: 8b 15 74 de 10 80 mov 0x8010de74,%edx
801008dd: 83 ea 80 sub $0xffffff80,%edx
801008e0: 39 d0 cmp %edx,%eax
801008e2: 75 1c jne 80100900 <consoleintr+0x155>
input.w = input.e;
801008e4: a1 7c de 10 80 mov 0x8010de7c,%eax
801008e9: a3 78 de 10 80 mov %eax,0x8010de78
wakeup(&input.r);
801008ee: c7 04 24 74 de 10 80 movl $0x8010de74,(%esp)
801008f5: e8 22 44 00 00 call 80104d1c <wakeup>
801008fa: eb 04 jmp 80100900 <consoleintr+0x155>
while(input.e != input.w &&
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
input.e--;
consputc(BACKSPACE);
}
break;
801008fc: 90 nop
801008fd: eb 01 jmp 80100900 <consoleintr+0x155>
case C('H'): case '\x7f': // Backspace
if(input.e != input.w){
input.e--;
consputc(BACKSPACE);
}
break;
801008ff: 90 nop
consoleintr(int (*getc)(void))
{
int c;
acquire(&input.lock);
while((c = getc()) >= 0){
80100900: 8b 45 08 mov 0x8(%ebp),%eax
80100903: ff d0 call *%eax
80100905: 89 45 f4 mov %eax,-0xc(%ebp)
80100908: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8010090c: 0f 89 b0 fe ff ff jns 801007c2 <consoleintr+0x17>
}
}
break;
}
}
release(&input.lock);
80100912: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
80100919: e8 92 46 00 00 call 80104fb0 <release>
}
8010091e: c9 leave
8010091f: c3 ret
80100920 <consoleread>:
int
consoleread(struct inode *ip, char *dst, int n)
{
80100920: 55 push %ebp
80100921: 89 e5 mov %esp,%ebp
80100923: 83 ec 28 sub $0x28,%esp
uint target;
int c;
iunlock(ip);
80100926: 8b 45 08 mov 0x8(%ebp),%eax
80100929: 89 04 24 mov %eax,(%esp)
8010092c: e8 9b 10 00 00 call 801019cc <iunlock>
target = n;
80100931: 8b 45 10 mov 0x10(%ebp),%eax
80100934: 89 45 f0 mov %eax,-0x10(%ebp)
acquire(&input.lock);
80100937: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
8010093e: e8 0c 46 00 00 call 80104f4f <acquire>
while(n > 0){
80100943: e9 a8 00 00 00 jmp 801009f0 <consoleread+0xd0>
while(input.r == input.w){
if(proc->killed){
80100948: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010094e: 8b 40 24 mov 0x24(%eax),%eax
80100951: 85 c0 test %eax,%eax
80100953: 74 21 je 80100976 <consoleread+0x56>
release(&input.lock);
80100955: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
8010095c: e8 4f 46 00 00 call 80104fb0 <release>
ilock(ip);
80100961: 8b 45 08 mov 0x8(%ebp),%eax
80100964: 89 04 24 mov %eax,(%esp)
80100967: e8 0f 0f 00 00 call 8010187b <ilock>
return -1;
8010096c: b8 ff ff ff ff mov $0xffffffff,%eax
80100971: e9 a9 00 00 00 jmp 80100a1f <consoleread+0xff>
}
sleep(&input.r, &input.lock);
80100976: c7 44 24 04 c0 dd 10 movl $0x8010ddc0,0x4(%esp)
8010097d: 80
8010097e: c7 04 24 74 de 10 80 movl $0x8010de74,(%esp)
80100985: e8 4c 42 00 00 call 80104bd6 <sleep>
8010098a: eb 01 jmp 8010098d <consoleread+0x6d>
iunlock(ip);
target = n;
acquire(&input.lock);
while(n > 0){
while(input.r == input.w){
8010098c: 90 nop
8010098d: 8b 15 74 de 10 80 mov 0x8010de74,%edx
80100993: a1 78 de 10 80 mov 0x8010de78,%eax
80100998: 39 c2 cmp %eax,%edx
8010099a: 74 ac je 80100948 <consoleread+0x28>
ilock(ip);
return -1;
}
sleep(&input.r, &input.lock);
}
c = input.buf[input.r++ % INPUT_BUF];
8010099c: a1 74 de 10 80 mov 0x8010de74,%eax
801009a1: 89 c2 mov %eax,%edx
801009a3: 83 e2 7f and $0x7f,%edx
801009a6: 0f b6 92 f4 dd 10 80 movzbl -0x7fef220c(%edx),%edx
801009ad: 0f be d2 movsbl %dl,%edx
801009b0: 89 55 f4 mov %edx,-0xc(%ebp)
801009b3: 83 c0 01 add $0x1,%eax
801009b6: a3 74 de 10 80 mov %eax,0x8010de74
if(c == C('D')){ // EOF
801009bb: 83 7d f4 04 cmpl $0x4,-0xc(%ebp)
801009bf: 75 17 jne 801009d8 <consoleread+0xb8>
if(n < target){
801009c1: 8b 45 10 mov 0x10(%ebp),%eax
801009c4: 3b 45 f0 cmp -0x10(%ebp),%eax
801009c7: 73 2f jae 801009f8 <consoleread+0xd8>
// Save ^D for next time, to make sure
// caller gets a 0-byte result.
input.r--;
801009c9: a1 74 de 10 80 mov 0x8010de74,%eax
801009ce: 83 e8 01 sub $0x1,%eax
801009d1: a3 74 de 10 80 mov %eax,0x8010de74
}
break;
801009d6: eb 24 jmp 801009fc <consoleread+0xdc>
}
*dst++ = c;
801009d8: 8b 45 f4 mov -0xc(%ebp),%eax
801009db: 89 c2 mov %eax,%edx
801009dd: 8b 45 0c mov 0xc(%ebp),%eax
801009e0: 88 10 mov %dl,(%eax)
801009e2: 83 45 0c 01 addl $0x1,0xc(%ebp)
--n;
801009e6: 83 6d 10 01 subl $0x1,0x10(%ebp)
if(c == '\n')
801009ea: 83 7d f4 0a cmpl $0xa,-0xc(%ebp)
801009ee: 74 0b je 801009fb <consoleread+0xdb>
int c;
iunlock(ip);
target = n;
acquire(&input.lock);
while(n > 0){
801009f0: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801009f4: 7f 96 jg 8010098c <consoleread+0x6c>
801009f6: eb 04 jmp 801009fc <consoleread+0xdc>
if(n < target){
// Save ^D for next time, to make sure
// caller gets a 0-byte result.
input.r--;
}
break;
801009f8: 90 nop
801009f9: eb 01 jmp 801009fc <consoleread+0xdc>
}
*dst++ = c;
--n;
if(c == '\n')
break;
801009fb: 90 nop
}
release(&input.lock);
801009fc: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
80100a03: e8 a8 45 00 00 call 80104fb0 <release>
ilock(ip);
80100a08: 8b 45 08 mov 0x8(%ebp),%eax
80100a0b: 89 04 24 mov %eax,(%esp)
80100a0e: e8 68 0e 00 00 call 8010187b <ilock>
return target - n;
80100a13: 8b 45 10 mov 0x10(%ebp),%eax
80100a16: 8b 55 f0 mov -0x10(%ebp),%edx
80100a19: 89 d1 mov %edx,%ecx
80100a1b: 29 c1 sub %eax,%ecx
80100a1d: 89 c8 mov %ecx,%eax
}
80100a1f: c9 leave
80100a20: c3 ret
80100a21 <consolewrite>:
int
consolewrite(struct inode *ip, char *buf, int n)
{
80100a21: 55 push %ebp
80100a22: 89 e5 mov %esp,%ebp
80100a24: 83 ec 28 sub $0x28,%esp
int i;
iunlock(ip);
80100a27: 8b 45 08 mov 0x8(%ebp),%eax
80100a2a: 89 04 24 mov %eax,(%esp)
80100a2d: e8 9a 0f 00 00 call 801019cc <iunlock>
acquire(&cons.lock);
80100a32: c7 04 24 e0 b5 10 80 movl $0x8010b5e0,(%esp)
80100a39: e8 11 45 00 00 call 80104f4f <acquire>
for(i = 0; i < n; i++)
80100a3e: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80100a45: eb 1d jmp 80100a64 <consolewrite+0x43>
consputc(buf[i] & 0xff);
80100a47: 8b 45 f4 mov -0xc(%ebp),%eax
80100a4a: 03 45 0c add 0xc(%ebp),%eax
80100a4d: 0f b6 00 movzbl (%eax),%eax
80100a50: 0f be c0 movsbl %al,%eax
80100a53: 25 ff 00 00 00 and $0xff,%eax
80100a58: 89 04 24 mov %eax,(%esp)
80100a5b: e8 ee fc ff ff call 8010074e <consputc>
{
int i;
iunlock(ip);
acquire(&cons.lock);
for(i = 0; i < n; i++)
80100a60: 83 45 f4 01 addl $0x1,-0xc(%ebp)
80100a64: 8b 45 f4 mov -0xc(%ebp),%eax
80100a67: 3b 45 10 cmp 0x10(%ebp),%eax
80100a6a: 7c db jl 80100a47 <consolewrite+0x26>
consputc(buf[i] & 0xff);
release(&cons.lock);
80100a6c: c7 04 24 e0 b5 10 80 movl $0x8010b5e0,(%esp)
80100a73: e8 38 45 00 00 call 80104fb0 <release>
ilock(ip);
80100a78: 8b 45 08 mov 0x8(%ebp),%eax
80100a7b: 89 04 24 mov %eax,(%esp)
80100a7e: e8 f8 0d 00 00 call 8010187b <ilock>
return n;
80100a83: 8b 45 10 mov 0x10(%ebp),%eax
}
80100a86: c9 leave
80100a87: c3 ret
80100a88 <consoleinit>:
void
consoleinit(void)
{
80100a88: 55 push %ebp
80100a89: 89 e5 mov %esp,%ebp
80100a8b: 83 ec 18 sub $0x18,%esp
initlock(&cons.lock, "console");
80100a8e: c7 44 24 04 47 86 10 movl $0x80108647,0x4(%esp)
80100a95: 80
80100a96: c7 04 24 e0 b5 10 80 movl $0x8010b5e0,(%esp)
80100a9d: e8 8c 44 00 00 call 80104f2e <initlock>
initlock(&input.lock, "input");
80100aa2: c7 44 24 04 4f 86 10 movl $0x8010864f,0x4(%esp)
80100aa9: 80
80100aaa: c7 04 24 c0 dd 10 80 movl $0x8010ddc0,(%esp)
80100ab1: e8 78 44 00 00 call 80104f2e <initlock>
devsw[CONSOLE].write = consolewrite;
80100ab6: c7 05 2c e8 10 80 21 movl $0x80100a21,0x8010e82c
80100abd: 0a 10 80
devsw[CONSOLE].read = consoleread;
80100ac0: c7 05 28 e8 10 80 20 movl $0x80100920,0x8010e828
80100ac7: 09 10 80
cons.locking = 1;
80100aca: c7 05 14 b6 10 80 01 movl $0x1,0x8010b614
80100ad1: 00 00 00
picenable(IRQ_KBD);
80100ad4: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80100adb: e8 ad 2f 00 00 call 80103a8d <picenable>
ioapicenable(IRQ_KBD, 0);
80100ae0: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80100ae7: 00
80100ae8: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80100aef: e8 8a 1e 00 00 call 8010297e <ioapicenable>
}
80100af4: c9 leave
80100af5: c3 ret
...
80100af8 <exec>:
#include "x86.h"
#include "elf.h"
int
exec(char *path, char **argv)
{
80100af8: 55 push %ebp
80100af9: 89 e5 mov %esp,%ebp
80100afb: 81 ec 38 01 00 00 sub $0x138,%esp
struct elfhdr elf;
struct inode *ip;
struct proghdr ph;
pde_t *pgdir, *oldpgdir;
if((ip = namei(path)) == 0)
80100b01: 8b 45 08 mov 0x8(%ebp),%eax
80100b04: 89 04 24 mov %eax,(%esp)
80100b07: e8 17 19 00 00 call 80102423 <namei>
80100b0c: 89 45 ec mov %eax,-0x14(%ebp)
80100b0f: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80100b13: 75 0a jne 80100b1f <exec+0x27>
return -1;
80100b15: b8 ff ff ff ff mov $0xffffffff,%eax
80100b1a: e9 e4 03 00 00 jmp 80100f03 <exec+0x40b>
ilock(ip);
80100b1f: 8b 45 ec mov -0x14(%ebp),%eax
80100b22: 89 04 24 mov %eax,(%esp)
80100b25: e8 51 0d 00 00 call 8010187b <ilock>
pgdir = 0;
80100b2a: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
// Check ELF header
if(readi(ip, (char*)&elf, 0, sizeof(elf)) < sizeof(elf))
80100b31: 8d 85 0c ff ff ff lea -0xf4(%ebp),%eax
80100b37: c7 44 24 0c 34 00 00 movl $0x34,0xc(%esp)
80100b3e: 00
80100b3f: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80100b46: 00
80100b47: 89 44 24 04 mov %eax,0x4(%esp)
80100b4b: 8b 45 ec mov -0x14(%ebp),%eax
80100b4e: 89 04 24 mov %eax,(%esp)
80100b51: e8 1e 12 00 00 call 80101d74 <readi>
80100b56: 83 f8 33 cmp $0x33,%eax
80100b59: 0f 86 5e 03 00 00 jbe 80100ebd <exec+0x3c5>
goto bad;
if(elf.magic != ELF_MAGIC)
80100b5f: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax
80100b65: 3d 7f 45 4c 46 cmp $0x464c457f,%eax
80100b6a: 0f 85 50 03 00 00 jne 80100ec0 <exec+0x3c8>
goto bad;
if((pgdir = setupkvm()) == 0)
80100b70: e8 1c 72 00 00 call 80107d91 <setupkvm>
80100b75: 89 45 f0 mov %eax,-0x10(%ebp)
80100b78: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80100b7c: 0f 84 41 03 00 00 je 80100ec3 <exec+0x3cb>
goto bad;
// Load program into memory.
sz = PGSIZE;
80100b82: c7 45 e4 00 10 00 00 movl $0x1000,-0x1c(%ebp)
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100b89: c7 45 d8 00 00 00 00 movl $0x0,-0x28(%ebp)
80100b90: 8b 85 28 ff ff ff mov -0xd8(%ebp),%eax
80100b96: 89 45 dc mov %eax,-0x24(%ebp)
80100b99: e9 ca 00 00 00 jmp 80100c68 <exec+0x170>
if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
80100b9e: 8b 55 dc mov -0x24(%ebp),%edx
80100ba1: 8d 85 ec fe ff ff lea -0x114(%ebp),%eax
80100ba7: c7 44 24 0c 20 00 00 movl $0x20,0xc(%esp)
80100bae: 00
80100baf: 89 54 24 08 mov %edx,0x8(%esp)
80100bb3: 89 44 24 04 mov %eax,0x4(%esp)
80100bb7: 8b 45 ec mov -0x14(%ebp),%eax
80100bba: 89 04 24 mov %eax,(%esp)
80100bbd: e8 b2 11 00 00 call 80101d74 <readi>
80100bc2: 83 f8 20 cmp $0x20,%eax
80100bc5: 0f 85 fb 02 00 00 jne 80100ec6 <exec+0x3ce>
goto bad;
if(ph.type != ELF_PROG_LOAD)
80100bcb: 8b 85 ec fe ff ff mov -0x114(%ebp),%eax
80100bd1: 83 f8 01 cmp $0x1,%eax
80100bd4: 0f 85 80 00 00 00 jne 80100c5a <exec+0x162>
continue;
if(ph.memsz < ph.filesz)
80100bda: 8b 95 00 ff ff ff mov -0x100(%ebp),%edx
80100be0: 8b 85 fc fe ff ff mov -0x104(%ebp),%eax
80100be6: 39 c2 cmp %eax,%edx
80100be8: 0f 82 db 02 00 00 jb 80100ec9 <exec+0x3d1>
goto bad;
if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
80100bee: 8b 95 f4 fe ff ff mov -0x10c(%ebp),%edx
80100bf4: 8b 85 00 ff ff ff mov -0x100(%ebp),%eax
80100bfa: 8d 04 02 lea (%edx,%eax,1),%eax
80100bfd: 89 44 24 08 mov %eax,0x8(%esp)
80100c01: 8b 45 e4 mov -0x1c(%ebp),%eax
80100c04: 89 44 24 04 mov %eax,0x4(%esp)
80100c08: 8b 45 f0 mov -0x10(%ebp),%eax
80100c0b: 89 04 24 mov %eax,(%esp)
80100c0e: e8 52 75 00 00 call 80108165 <allocuvm>
80100c13: 89 45 e4 mov %eax,-0x1c(%ebp)
80100c16: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
80100c1a: 0f 84 ac 02 00 00 je 80100ecc <exec+0x3d4>
goto bad;
if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
80100c20: 8b 8d fc fe ff ff mov -0x104(%ebp),%ecx
80100c26: 8b 95 f0 fe ff ff mov -0x110(%ebp),%edx
80100c2c: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80100c32: 89 4c 24 10 mov %ecx,0x10(%esp)
80100c36: 89 54 24 0c mov %edx,0xc(%esp)
80100c3a: 8b 55 ec mov -0x14(%ebp),%edx
80100c3d: 89 54 24 08 mov %edx,0x8(%esp)
80100c41: 89 44 24 04 mov %eax,0x4(%esp)
80100c45: 8b 45 f0 mov -0x10(%ebp),%eax
80100c48: 89 04 24 mov %eax,(%esp)
80100c4b: e8 25 74 00 00 call 80108075 <loaduvm>
80100c50: 85 c0 test %eax,%eax
80100c52: 0f 88 77 02 00 00 js 80100ecf <exec+0x3d7>
80100c58: eb 01 jmp 80100c5b <exec+0x163>
sz = PGSIZE;
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
goto bad;
if(ph.type != ELF_PROG_LOAD)
continue;
80100c5a: 90 nop
if((pgdir = setupkvm()) == 0)
goto bad;
// Load program into memory.
sz = PGSIZE;
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100c5b: 83 45 d8 01 addl $0x1,-0x28(%ebp)
80100c5f: 8b 45 dc mov -0x24(%ebp),%eax
80100c62: 83 c0 20 add $0x20,%eax
80100c65: 89 45 dc mov %eax,-0x24(%ebp)
80100c68: 0f b7 85 38 ff ff ff movzwl -0xc8(%ebp),%eax
80100c6f: 0f b7 c0 movzwl %ax,%eax
80100c72: 3b 45 d8 cmp -0x28(%ebp),%eax
80100c75: 0f 8f 23 ff ff ff jg 80100b9e <exec+0xa6>
if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
goto bad;
if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
goto bad;
}
iunlockput(ip);
80100c7b: 8b 45 ec mov -0x14(%ebp),%eax
80100c7e: 89 04 24 mov %eax,(%esp)
80100c81: e8 7c 0e 00 00 call 80101b02 <iunlockput>
ip = 0;
80100c86: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
// Allocate two pages at the next page boundary.
// Make the first inaccessible. Use the second as the user stack.
sz = PGROUNDUP(sz);
80100c8d: 8b 45 e4 mov -0x1c(%ebp),%eax
80100c90: 05 ff 0f 00 00 add $0xfff,%eax
80100c95: 25 00 f0 ff ff and $0xfffff000,%eax
80100c9a: 89 45 e4 mov %eax,-0x1c(%ebp)
if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
80100c9d: 8b 45 e4 mov -0x1c(%ebp),%eax
80100ca0: 05 00 20 00 00 add $0x2000,%eax
80100ca5: 89 44 24 08 mov %eax,0x8(%esp)
80100ca9: 8b 45 e4 mov -0x1c(%ebp),%eax
80100cac: 89 44 24 04 mov %eax,0x4(%esp)
80100cb0: 8b 45 f0 mov -0x10(%ebp),%eax
80100cb3: 89 04 24 mov %eax,(%esp)
80100cb6: e8 aa 74 00 00 call 80108165 <allocuvm>
80100cbb: 89 45 e4 mov %eax,-0x1c(%ebp)
80100cbe: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
80100cc2: 0f 84 0a 02 00 00 je 80100ed2 <exec+0x3da>
goto bad;
proc->pstack = (uint *)sz;
80100cc8: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100cce: 8b 55 e4 mov -0x1c(%ebp),%edx
80100cd1: 89 50 7c mov %edx,0x7c(%eax)
clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
80100cd4: 8b 45 e4 mov -0x1c(%ebp),%eax
80100cd7: 2d 00 20 00 00 sub $0x2000,%eax
80100cdc: 89 44 24 04 mov %eax,0x4(%esp)
80100ce0: 8b 45 f0 mov -0x10(%ebp),%eax
80100ce3: 89 04 24 mov %eax,(%esp)
80100ce6: e8 9e 76 00 00 call 80108389 <clearpteu>
sp = sz;
80100ceb: 8b 45 e4 mov -0x1c(%ebp),%eax
80100cee: 89 45 e8 mov %eax,-0x18(%ebp)
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
80100cf1: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp)
80100cf8: e9 81 00 00 00 jmp 80100d7e <exec+0x286>
if(argc >= MAXARG)
80100cfd: 83 7d e0 1f cmpl $0x1f,-0x20(%ebp)
80100d01: 0f 87 ce 01 00 00 ja 80100ed5 <exec+0x3dd>
goto bad;
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100d07: 8b 45 e0 mov -0x20(%ebp),%eax
80100d0a: c1 e0 02 shl $0x2,%eax
80100d0d: 03 45 0c add 0xc(%ebp),%eax
80100d10: 8b 00 mov (%eax),%eax
80100d12: 89 04 24 mov %eax,(%esp)
80100d15: e8 05 47 00 00 call 8010541f <strlen>
80100d1a: f7 d0 not %eax
80100d1c: 03 45 e8 add -0x18(%ebp),%eax
80100d1f: 83 e0 fc and $0xfffffffc,%eax
80100d22: 89 45 e8 mov %eax,-0x18(%ebp)
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100d25: 8b 45 e0 mov -0x20(%ebp),%eax
80100d28: c1 e0 02 shl $0x2,%eax
80100d2b: 03 45 0c add 0xc(%ebp),%eax
80100d2e: 8b 00 mov (%eax),%eax
80100d30: 89 04 24 mov %eax,(%esp)
80100d33: e8 e7 46 00 00 call 8010541f <strlen>
80100d38: 83 c0 01 add $0x1,%eax
80100d3b: 89 c2 mov %eax,%edx
80100d3d: 8b 45 e0 mov -0x20(%ebp),%eax
80100d40: c1 e0 02 shl $0x2,%eax
80100d43: 03 45 0c add 0xc(%ebp),%eax
80100d46: 8b 00 mov (%eax),%eax
80100d48: 89 54 24 0c mov %edx,0xc(%esp)
80100d4c: 89 44 24 08 mov %eax,0x8(%esp)
80100d50: 8b 45 e8 mov -0x18(%ebp),%eax
80100d53: 89 44 24 04 mov %eax,0x4(%esp)
80100d57: 8b 45 f0 mov -0x10(%ebp),%eax
80100d5a: 89 04 24 mov %eax,(%esp)
80100d5d: e8 ec 77 00 00 call 8010854e <copyout>
80100d62: 85 c0 test %eax,%eax
80100d64: 0f 88 6e 01 00 00 js 80100ed8 <exec+0x3e0>
goto bad;
ustack[3+argc] = sp;
80100d6a: 8b 45 e0 mov -0x20(%ebp),%eax
80100d6d: 8d 50 03 lea 0x3(%eax),%edx
80100d70: 8b 45 e8 mov -0x18(%ebp),%eax
80100d73: 89 84 95 40 ff ff ff mov %eax,-0xc0(%ebp,%edx,4)
clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
80100d7a: 83 45 e0 01 addl $0x1,-0x20(%ebp)
80100d7e: 8b 45 e0 mov -0x20(%ebp),%eax
80100d81: c1 e0 02 shl $0x2,%eax
80100d84: 03 45 0c add 0xc(%ebp),%eax
80100d87: 8b 00 mov (%eax),%eax
80100d89: 85 c0 test %eax,%eax
80100d8b: 0f 85 6c ff ff ff jne 80100cfd <exec+0x205>
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
goto bad;
ustack[3+argc] = sp;
}
ustack[3+argc] = 0;
80100d91: 8b 45 e0 mov -0x20(%ebp),%eax
80100d94: 83 c0 03 add $0x3,%eax
80100d97: c7 84 85 40 ff ff ff movl $0x0,-0xc0(%ebp,%eax,4)
80100d9e: 00 00 00 00
ustack[0] = 0xffffffff; // fake return PC
80100da2: c7 85 40 ff ff ff ff movl $0xffffffff,-0xc0(%ebp)
80100da9: ff ff ff
ustack[1] = argc;
80100dac: 8b 45 e0 mov -0x20(%ebp),%eax
80100daf: 89 85 44 ff ff ff mov %eax,-0xbc(%ebp)
ustack[2] = sp - (argc+1)*4; // argv pointer
80100db5: 8b 45 e0 mov -0x20(%ebp),%eax
80100db8: 83 c0 01 add $0x1,%eax
80100dbb: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
80100dc2: 8b 45 e8 mov -0x18(%ebp),%eax
80100dc5: 29 d0 sub %edx,%eax
80100dc7: 89 85 48 ff ff ff mov %eax,-0xb8(%ebp)
sp -= (3+argc+1) * 4;
80100dcd: 8b 45 e0 mov -0x20(%ebp),%eax
80100dd0: 83 c0 04 add $0x4,%eax
80100dd3: c1 e0 02 shl $0x2,%eax
80100dd6: 29 45 e8 sub %eax,-0x18(%ebp)
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100dd9: 8b 45 e0 mov -0x20(%ebp),%eax
80100ddc: 83 c0 04 add $0x4,%eax
80100ddf: c1 e0 02 shl $0x2,%eax
80100de2: 89 44 24 0c mov %eax,0xc(%esp)
80100de6: 8d 85 40 ff ff ff lea -0xc0(%ebp),%eax
80100dec: 89 44 24 08 mov %eax,0x8(%esp)
80100df0: 8b 45 e8 mov -0x18(%ebp),%eax
80100df3: 89 44 24 04 mov %eax,0x4(%esp)
80100df7: 8b 45 f0 mov -0x10(%ebp),%eax
80100dfa: 89 04 24 mov %eax,(%esp)
80100dfd: e8 4c 77 00 00 call 8010854e <copyout>
80100e02: 85 c0 test %eax,%eax
80100e04: 0f 88 d1 00 00 00 js 80100edb <exec+0x3e3>
goto bad;
// Save program name for debugging.
for(last=s=path; *s; s++)
80100e0a: 8b 45 08 mov 0x8(%ebp),%eax
80100e0d: 89 45 d0 mov %eax,-0x30(%ebp)
80100e10: 8b 45 d0 mov -0x30(%ebp),%eax
80100e13: 89 45 d4 mov %eax,-0x2c(%ebp)
80100e16: eb 17 jmp 80100e2f <exec+0x337>
if(*s == '/')
80100e18: 8b 45 d0 mov -0x30(%ebp),%eax
80100e1b: 0f b6 00 movzbl (%eax),%eax
80100e1e: 3c 2f cmp $0x2f,%al
80100e20: 75 09 jne 80100e2b <exec+0x333>
last = s+1;
80100e22: 8b 45 d0 mov -0x30(%ebp),%eax
80100e25: 83 c0 01 add $0x1,%eax
80100e28: 89 45 d4 mov %eax,-0x2c(%ebp)
sp -= (3+argc+1) * 4;
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
goto bad;
// Save program name for debugging.
for(last=s=path; *s; s++)
80100e2b: 83 45 d0 01 addl $0x1,-0x30(%ebp)
80100e2f: 8b 45 d0 mov -0x30(%ebp),%eax
80100e32: 0f b6 00 movzbl (%eax),%eax
80100e35: 84 c0 test %al,%al
80100e37: 75 df jne 80100e18 <exec+0x320>
if(*s == '/')
last = s+1;
safestrcpy(proc->name, last, sizeof(proc->name));
80100e39: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e3f: 8d 50 6c lea 0x6c(%eax),%edx
80100e42: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80100e49: 00
80100e4a: 8b 45 d4 mov -0x2c(%ebp),%eax
80100e4d: 89 44 24 04 mov %eax,0x4(%esp)
80100e51: 89 14 24 mov %edx,(%esp)
80100e54: e8 78 45 00 00 call 801053d1 <safestrcpy>
// Commit to the user image.
oldpgdir = proc->pgdir;
80100e59: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e5f: 8b 40 04 mov 0x4(%eax),%eax
80100e62: 89 45 f4 mov %eax,-0xc(%ebp)
proc->pgdir = pgdir;
80100e65: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e6b: 8b 55 f0 mov -0x10(%ebp),%edx
80100e6e: 89 50 04 mov %edx,0x4(%eax)
proc->sz = sz;
80100e71: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e77: 8b 55 e4 mov -0x1c(%ebp),%edx
80100e7a: 89 10 mov %edx,(%eax)
proc->tf->eip = elf.entry; // main
80100e7c: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e82: 8b 40 18 mov 0x18(%eax),%eax
80100e85: 8b 95 24 ff ff ff mov -0xdc(%ebp),%edx
80100e8b: 89 50 38 mov %edx,0x38(%eax)
proc->tf->esp = sp;
80100e8e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100e94: 8b 40 18 mov 0x18(%eax),%eax
80100e97: 8b 55 e8 mov -0x18(%ebp),%edx
80100e9a: 89 50 44 mov %edx,0x44(%eax)
switchuvm(proc);
80100e9d: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80100ea3: 89 04 24 mov %eax,(%esp)
80100ea6: e8 d8 6f 00 00 call 80107e83 <switchuvm>
freevm(oldpgdir);
80100eab: 8b 45 f4 mov -0xc(%ebp),%eax
80100eae: 89 04 24 mov %eax,(%esp)
80100eb1: e8 45 74 00 00 call 801082fb <freevm>
return 0;
80100eb6: b8 00 00 00 00 mov $0x0,%eax
80100ebb: eb 46 jmp 80100f03 <exec+0x40b>
ilock(ip);
pgdir = 0;
// Check ELF header
if(readi(ip, (char*)&elf, 0, sizeof(elf)) < sizeof(elf))
goto bad;
80100ebd: 90 nop
80100ebe: eb 1c jmp 80100edc <exec+0x3e4>
if(elf.magic != ELF_MAGIC)
goto bad;
80100ec0: 90 nop
80100ec1: eb 19 jmp 80100edc <exec+0x3e4>
if((pgdir = setupkvm()) == 0)
goto bad;
80100ec3: 90 nop
80100ec4: eb 16 jmp 80100edc <exec+0x3e4>
// Load program into memory.
sz = PGSIZE;
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
goto bad;
80100ec6: 90 nop
80100ec7: eb 13 jmp 80100edc <exec+0x3e4>
if(ph.type != ELF_PROG_LOAD)
continue;
if(ph.memsz < ph.filesz)
goto bad;
80100ec9: 90 nop
80100eca: eb 10 jmp 80100edc <exec+0x3e4>
if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
goto bad;
80100ecc: 90 nop
80100ecd: eb 0d jmp 80100edc <exec+0x3e4>
if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
goto bad;
80100ecf: 90 nop
80100ed0: eb 0a jmp 80100edc <exec+0x3e4>
// Allocate two pages at the next page boundary.
// Make the first inaccessible. Use the second as the user stack.
sz = PGROUNDUP(sz);
if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
goto bad;
80100ed2: 90 nop
80100ed3: eb 07 jmp 80100edc <exec+0x3e4>
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for(argc = 0; argv[argc]; argc++) {
if(argc >= MAXARG)
goto bad;
80100ed5: 90 nop
80100ed6: eb 04 jmp 80100edc <exec+0x3e4>
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
goto bad;
80100ed8: 90 nop
80100ed9: eb 01 jmp 80100edc <exec+0x3e4>
ustack[1] = argc;
ustack[2] = sp - (argc+1)*4; // argv pointer
sp -= (3+argc+1) * 4;
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
goto bad;
80100edb: 90 nop
switchuvm(proc);
freevm(oldpgdir);
return 0;
bad:
if(pgdir)
80100edc: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80100ee0: 74 0b je 80100eed <exec+0x3f5>
freevm(pgdir);
80100ee2: 8b 45 f0 mov -0x10(%ebp),%eax
80100ee5: 89 04 24 mov %eax,(%esp)
80100ee8: e8 0e 74 00 00 call 801082fb <freevm>
if(ip)
80100eed: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80100ef1: 74 0b je 80100efe <exec+0x406>
iunlockput(ip);
80100ef3: 8b 45 ec mov -0x14(%ebp),%eax
80100ef6: 89 04 24 mov %eax,(%esp)
80100ef9: e8 04 0c 00 00 call 80101b02 <iunlockput>
return -1;
80100efe: b8 ff ff ff ff mov $0xffffffff,%eax
}
80100f03: c9 leave
80100f04: c3 ret
80100f05: 00 00 add %al,(%eax)
...
80100f08 <fileinit>:
struct file file[NFILE];
} ftable;
void
fileinit(void)
{
80100f08: 55 push %ebp
80100f09: 89 e5 mov %esp,%ebp
80100f0b: 83 ec 18 sub $0x18,%esp
initlock(&ftable.lock, "ftable");
80100f0e: c7 44 24 04 55 86 10 movl $0x80108655,0x4(%esp)
80100f15: 80
80100f16: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100f1d: e8 0c 40 00 00 call 80104f2e <initlock>
}
80100f22: c9 leave
80100f23: c3 ret
80100f24 <filealloc>:
// Allocate a file structure.
struct file*
filealloc(void)
{
80100f24: 55 push %ebp
80100f25: 89 e5 mov %esp,%ebp
80100f27: 83 ec 28 sub $0x28,%esp
struct file *f;
acquire(&ftable.lock);
80100f2a: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100f31: e8 19 40 00 00 call 80104f4f <acquire>
for(f = ftable.file; f < ftable.file + NFILE; f++){
80100f36: c7 45 f4 b4 de 10 80 movl $0x8010deb4,-0xc(%ebp)
80100f3d: eb 29 jmp 80100f68 <filealloc+0x44>
if(f->ref == 0){
80100f3f: 8b 45 f4 mov -0xc(%ebp),%eax
80100f42: 8b 40 04 mov 0x4(%eax),%eax
80100f45: 85 c0 test %eax,%eax
80100f47: 75 1b jne 80100f64 <filealloc+0x40>
f->ref = 1;
80100f49: 8b 45 f4 mov -0xc(%ebp),%eax
80100f4c: c7 40 04 01 00 00 00 movl $0x1,0x4(%eax)
release(&ftable.lock);
80100f53: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100f5a: e8 51 40 00 00 call 80104fb0 <release>
return f;
80100f5f: 8b 45 f4 mov -0xc(%ebp),%eax
80100f62: eb 1f jmp 80100f83 <filealloc+0x5f>
filealloc(void)
{
struct file *f;
acquire(&ftable.lock);
for(f = ftable.file; f < ftable.file + NFILE; f++){
80100f64: 83 45 f4 18 addl $0x18,-0xc(%ebp)
80100f68: b8 14 e8 10 80 mov $0x8010e814,%eax
80100f6d: 39 45 f4 cmp %eax,-0xc(%ebp)
80100f70: 72 cd jb 80100f3f <filealloc+0x1b>
f->ref = 1;
release(&ftable.lock);
return f;
}
}
release(&ftable.lock);
80100f72: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100f79: e8 32 40 00 00 call 80104fb0 <release>
return 0;
80100f7e: b8 00 00 00 00 mov $0x0,%eax
}
80100f83: c9 leave
80100f84: c3 ret
80100f85 <filedup>:
// Increment ref count for file f.
struct file*
filedup(struct file *f)
{
80100f85: 55 push %ebp
80100f86: 89 e5 mov %esp,%ebp
80100f88: 83 ec 18 sub $0x18,%esp
acquire(&ftable.lock);
80100f8b: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100f92: e8 b8 3f 00 00 call 80104f4f <acquire>
if(f->ref < 1)
80100f97: 8b 45 08 mov 0x8(%ebp),%eax
80100f9a: 8b 40 04 mov 0x4(%eax),%eax
80100f9d: 85 c0 test %eax,%eax
80100f9f: 7f 0c jg 80100fad <filedup+0x28>
panic("filedup");
80100fa1: c7 04 24 5c 86 10 80 movl $0x8010865c,(%esp)
80100fa8: e8 8d f5 ff ff call 8010053a <panic>
f->ref++;
80100fad: 8b 45 08 mov 0x8(%ebp),%eax
80100fb0: 8b 40 04 mov 0x4(%eax),%eax
80100fb3: 8d 50 01 lea 0x1(%eax),%edx
80100fb6: 8b 45 08 mov 0x8(%ebp),%eax
80100fb9: 89 50 04 mov %edx,0x4(%eax)
release(&ftable.lock);
80100fbc: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100fc3: e8 e8 3f 00 00 call 80104fb0 <release>
return f;
80100fc8: 8b 45 08 mov 0x8(%ebp),%eax
}
80100fcb: c9 leave
80100fcc: c3 ret
80100fcd <fileclose>:
// Close file f. (Decrement ref count, close when reaches 0.)
void
fileclose(struct file *f)
{
80100fcd: 55 push %ebp
80100fce: 89 e5 mov %esp,%ebp
80100fd0: 83 ec 38 sub $0x38,%esp
struct file ff;
acquire(&ftable.lock);
80100fd3: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80100fda: e8 70 3f 00 00 call 80104f4f <acquire>
if(f->ref < 1)
80100fdf: 8b 45 08 mov 0x8(%ebp),%eax
80100fe2: 8b 40 04 mov 0x4(%eax),%eax
80100fe5: 85 c0 test %eax,%eax
80100fe7: 7f 0c jg 80100ff5 <fileclose+0x28>
panic("fileclose");
80100fe9: c7 04 24 64 86 10 80 movl $0x80108664,(%esp)
80100ff0: e8 45 f5 ff ff call 8010053a <panic>
if(--f->ref > 0){
80100ff5: 8b 45 08 mov 0x8(%ebp),%eax
80100ff8: 8b 40 04 mov 0x4(%eax),%eax
80100ffb: 8d 50 ff lea -0x1(%eax),%edx
80100ffe: 8b 45 08 mov 0x8(%ebp),%eax
80101001: 89 50 04 mov %edx,0x4(%eax)
80101004: 8b 45 08 mov 0x8(%ebp),%eax
80101007: 8b 40 04 mov 0x4(%eax),%eax
8010100a: 85 c0 test %eax,%eax
8010100c: 7e 11 jle 8010101f <fileclose+0x52>
release(&ftable.lock);
8010100e: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
80101015: e8 96 3f 00 00 call 80104fb0 <release>
return;
8010101a: e9 82 00 00 00 jmp 801010a1 <fileclose+0xd4>
}
ff = *f;
8010101f: 8b 45 08 mov 0x8(%ebp),%eax
80101022: 8b 10 mov (%eax),%edx
80101024: 89 55 e0 mov %edx,-0x20(%ebp)
80101027: 8b 50 04 mov 0x4(%eax),%edx
8010102a: 89 55 e4 mov %edx,-0x1c(%ebp)
8010102d: 8b 50 08 mov 0x8(%eax),%edx
80101030: 89 55 e8 mov %edx,-0x18(%ebp)
80101033: 8b 50 0c mov 0xc(%eax),%edx
80101036: 89 55 ec mov %edx,-0x14(%ebp)
80101039: 8b 50 10 mov 0x10(%eax),%edx
8010103c: 89 55 f0 mov %edx,-0x10(%ebp)
8010103f: 8b 40 14 mov 0x14(%eax),%eax
80101042: 89 45 f4 mov %eax,-0xc(%ebp)
f->ref = 0;
80101045: 8b 45 08 mov 0x8(%ebp),%eax
80101048: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
f->type = FD_NONE;
8010104f: 8b 45 08 mov 0x8(%ebp),%eax
80101052: c7 00 00 00 00 00 movl $0x0,(%eax)
release(&ftable.lock);
80101058: c7 04 24 80 de 10 80 movl $0x8010de80,(%esp)
8010105f: e8 4c 3f 00 00 call 80104fb0 <release>
if(ff.type == FD_PIPE)
80101064: 8b 45 e0 mov -0x20(%ebp),%eax
80101067: 83 f8 01 cmp $0x1,%eax
8010106a: 75 18 jne 80101084 <fileclose+0xb7>
pipeclose(ff.pipe, ff.writable);
8010106c: 0f b6 45 e9 movzbl -0x17(%ebp),%eax
80101070: 0f be d0 movsbl %al,%edx
80101073: 8b 45 ec mov -0x14(%ebp),%eax
80101076: 89 54 24 04 mov %edx,0x4(%esp)
8010107a: 89 04 24 mov %eax,(%esp)
8010107d: e8 c5 2c 00 00 call 80103d47 <pipeclose>
80101082: eb 1d jmp 801010a1 <fileclose+0xd4>
else if(ff.type == FD_INODE){
80101084: 8b 45 e0 mov -0x20(%ebp),%eax
80101087: 83 f8 02 cmp $0x2,%eax
8010108a: 75 15 jne 801010a1 <fileclose+0xd4>
begin_trans();
8010108c: e8 81 21 00 00 call 80103212 <begin_trans>
iput(ff.ip);
80101091: 8b 45 f0 mov -0x10(%ebp),%eax
80101094: 89 04 24 mov %eax,(%esp)
80101097: e8 95 09 00 00 call 80101a31 <iput>
commit_trans();
8010109c: e8 ba 21 00 00 call 8010325b <commit_trans>
}
}
801010a1: c9 leave
801010a2: c3 ret
801010a3 <filestat>:
// Get metadata about file f.
int
filestat(struct file *f, struct stat *st)
{
801010a3: 55 push %ebp
801010a4: 89 e5 mov %esp,%ebp
801010a6: 83 ec 18 sub $0x18,%esp
if(f->type == FD_INODE){
801010a9: 8b 45 08 mov 0x8(%ebp),%eax
801010ac: 8b 00 mov (%eax),%eax
801010ae: 83 f8 02 cmp $0x2,%eax
801010b1: 75 38 jne 801010eb <filestat+0x48>
ilock(f->ip);
801010b3: 8b 45 08 mov 0x8(%ebp),%eax
801010b6: 8b 40 10 mov 0x10(%eax),%eax
801010b9: 89 04 24 mov %eax,(%esp)
801010bc: e8 ba 07 00 00 call 8010187b <ilock>
stati(f->ip, st);
801010c1: 8b 45 08 mov 0x8(%ebp),%eax
801010c4: 8b 40 10 mov 0x10(%eax),%eax
801010c7: 8b 55 0c mov 0xc(%ebp),%edx
801010ca: 89 54 24 04 mov %edx,0x4(%esp)
801010ce: 89 04 24 mov %eax,(%esp)
801010d1: e8 59 0c 00 00 call 80101d2f <stati>
iunlock(f->ip);
801010d6: 8b 45 08 mov 0x8(%ebp),%eax
801010d9: 8b 40 10 mov 0x10(%eax),%eax
801010dc: 89 04 24 mov %eax,(%esp)
801010df: e8 e8 08 00 00 call 801019cc <iunlock>
return 0;
801010e4: b8 00 00 00 00 mov $0x0,%eax
801010e9: eb 05 jmp 801010f0 <filestat+0x4d>
}
return -1;
801010eb: b8 ff ff ff ff mov $0xffffffff,%eax
}
801010f0: c9 leave
801010f1: c3 ret
801010f2 <fileread>:
// Read from file f.
int
fileread(struct file *f, char *addr, int n)
{
801010f2: 55 push %ebp
801010f3: 89 e5 mov %esp,%ebp
801010f5: 83 ec 28 sub $0x28,%esp
int r;
if(f->readable == 0)
801010f8: 8b 45 08 mov 0x8(%ebp),%eax
801010fb: 0f b6 40 08 movzbl 0x8(%eax),%eax
801010ff: 84 c0 test %al,%al
80101101: 75 0a jne 8010110d <fileread+0x1b>
return -1;
80101103: b8 ff ff ff ff mov $0xffffffff,%eax
80101108: e9 9f 00 00 00 jmp 801011ac <fileread+0xba>
if(f->type == FD_PIPE)
8010110d: 8b 45 08 mov 0x8(%ebp),%eax
80101110: 8b 00 mov (%eax),%eax
80101112: 83 f8 01 cmp $0x1,%eax
80101115: 75 1e jne 80101135 <fileread+0x43>
return piperead(f->pipe, addr, n);
80101117: 8b 45 08 mov 0x8(%ebp),%eax
8010111a: 8b 40 0c mov 0xc(%eax),%eax
8010111d: 8b 55 10 mov 0x10(%ebp),%edx
80101120: 89 54 24 08 mov %edx,0x8(%esp)
80101124: 8b 55 0c mov 0xc(%ebp),%edx
80101127: 89 54 24 04 mov %edx,0x4(%esp)
8010112b: 89 04 24 mov %eax,(%esp)
8010112e: e8 96 2d 00 00 call 80103ec9 <piperead>
80101133: eb 77 jmp 801011ac <fileread+0xba>
if(f->type == FD_INODE){
80101135: 8b 45 08 mov 0x8(%ebp),%eax
80101138: 8b 00 mov (%eax),%eax
8010113a: 83 f8 02 cmp $0x2,%eax
8010113d: 75 61 jne 801011a0 <fileread+0xae>
ilock(f->ip);
8010113f: 8b 45 08 mov 0x8(%ebp),%eax
80101142: 8b 40 10 mov 0x10(%eax),%eax
80101145: 89 04 24 mov %eax,(%esp)
80101148: e8 2e 07 00 00 call 8010187b <ilock>
if((r = readi(f->ip, addr, f->off, n)) > 0)
8010114d: 8b 4d 10 mov 0x10(%ebp),%ecx
80101150: 8b 45 08 mov 0x8(%ebp),%eax
80101153: 8b 50 14 mov 0x14(%eax),%edx
80101156: 8b 45 08 mov 0x8(%ebp),%eax
80101159: 8b 40 10 mov 0x10(%eax),%eax
8010115c: 89 4c 24 0c mov %ecx,0xc(%esp)
80101160: 89 54 24 08 mov %edx,0x8(%esp)
80101164: 8b 55 0c mov 0xc(%ebp),%edx
80101167: 89 54 24 04 mov %edx,0x4(%esp)
8010116b: 89 04 24 mov %eax,(%esp)
8010116e: e8 01 0c 00 00 call 80101d74 <readi>
80101173: 89 45 f4 mov %eax,-0xc(%ebp)
80101176: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8010117a: 7e 11 jle 8010118d <fileread+0x9b>
f->off += r;
8010117c: 8b 45 08 mov 0x8(%ebp),%eax
8010117f: 8b 50 14 mov 0x14(%eax),%edx
80101182: 8b 45 f4 mov -0xc(%ebp),%eax
80101185: 01 c2 add %eax,%edx
80101187: 8b 45 08 mov 0x8(%ebp),%eax
8010118a: 89 50 14 mov %edx,0x14(%eax)
iunlock(f->ip);
8010118d: 8b 45 08 mov 0x8(%ebp),%eax
80101190: 8b 40 10 mov 0x10(%eax),%eax
80101193: 89 04 24 mov %eax,(%esp)
80101196: e8 31 08 00 00 call 801019cc <iunlock>
return r;
8010119b: 8b 45 f4 mov -0xc(%ebp),%eax
8010119e: eb 0c jmp 801011ac <fileread+0xba>
}
panic("fileread");
801011a0: c7 04 24 6e 86 10 80 movl $0x8010866e,(%esp)
801011a7: e8 8e f3 ff ff call 8010053a <panic>
}
801011ac: c9 leave
801011ad: c3 ret
801011ae <filewrite>:
//PAGEBREAK!
// Write to file f.
int
filewrite(struct file *f, char *addr, int n)
{
801011ae: 55 push %ebp
801011af: 89 e5 mov %esp,%ebp
801011b1: 53 push %ebx
801011b2: 83 ec 24 sub $0x24,%esp
int r;
if(f->writable == 0)
801011b5: 8b 45 08 mov 0x8(%ebp),%eax
801011b8: 0f b6 40 09 movzbl 0x9(%eax),%eax
801011bc: 84 c0 test %al,%al
801011be: 75 0a jne 801011ca <filewrite+0x1c>
return -1;
801011c0: b8 ff ff ff ff mov $0xffffffff,%eax
801011c5: e9 23 01 00 00 jmp 801012ed <filewrite+0x13f>
if(f->type == FD_PIPE)
801011ca: 8b 45 08 mov 0x8(%ebp),%eax
801011cd: 8b 00 mov (%eax),%eax
801011cf: 83 f8 01 cmp $0x1,%eax
801011d2: 75 21 jne 801011f5 <filewrite+0x47>
return pipewrite(f->pipe, addr, n);
801011d4: 8b 45 08 mov 0x8(%ebp),%eax
801011d7: 8b 40 0c mov 0xc(%eax),%eax
801011da: 8b 55 10 mov 0x10(%ebp),%edx
801011dd: 89 54 24 08 mov %edx,0x8(%esp)
801011e1: 8b 55 0c mov 0xc(%ebp),%edx
801011e4: 89 54 24 04 mov %edx,0x4(%esp)
801011e8: 89 04 24 mov %eax,(%esp)
801011eb: e8 e9 2b 00 00 call 80103dd9 <pipewrite>
801011f0: e9 f8 00 00 00 jmp 801012ed <filewrite+0x13f>
if(f->type == FD_INODE){
801011f5: 8b 45 08 mov 0x8(%ebp),%eax
801011f8: 8b 00 mov (%eax),%eax
801011fa: 83 f8 02 cmp $0x2,%eax
801011fd: 0f 85 de 00 00 00 jne 801012e1 <filewrite+0x133>
// the maximum log transaction size, including
// i-node, indirect block, allocation blocks,
// and 2 blocks of slop for non-aligned writes.
// this really belongs lower down, since writei()
// might be writing a device like the console.
int max = ((LOGSIZE-1-1-2) / 2) * 512;
80101203: c7 45 ec 00 06 00 00 movl $0x600,-0x14(%ebp)
int i = 0;
8010120a: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
while(i < n){
80101211: e9 a8 00 00 00 jmp 801012be <filewrite+0x110>
int n1 = n - i;
80101216: 8b 45 f0 mov -0x10(%ebp),%eax
80101219: 8b 55 10 mov 0x10(%ebp),%edx
8010121c: 89 d1 mov %edx,%ecx
8010121e: 29 c1 sub %eax,%ecx
80101220: 89 c8 mov %ecx,%eax
80101222: 89 45 f4 mov %eax,-0xc(%ebp)
if(n1 > max)
80101225: 8b 45 f4 mov -0xc(%ebp),%eax
80101228: 3b 45 ec cmp -0x14(%ebp),%eax
8010122b: 7e 06 jle 80101233 <filewrite+0x85>
n1 = max;
8010122d: 8b 45 ec mov -0x14(%ebp),%eax
80101230: 89 45 f4 mov %eax,-0xc(%ebp)
begin_trans();
80101233: e8 da 1f 00 00 call 80103212 <begin_trans>
ilock(f->ip);
80101238: 8b 45 08 mov 0x8(%ebp),%eax
8010123b: 8b 40 10 mov 0x10(%eax),%eax
8010123e: 89 04 24 mov %eax,(%esp)
80101241: e8 35 06 00 00 call 8010187b <ilock>
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
80101246: 8b 5d f4 mov -0xc(%ebp),%ebx
80101249: 8b 45 08 mov 0x8(%ebp),%eax
8010124c: 8b 48 14 mov 0x14(%eax),%ecx
8010124f: 8b 45 f0 mov -0x10(%ebp),%eax
80101252: 89 c2 mov %eax,%edx
80101254: 03 55 0c add 0xc(%ebp),%edx
80101257: 8b 45 08 mov 0x8(%ebp),%eax
8010125a: 8b 40 10 mov 0x10(%eax),%eax
8010125d: 89 5c 24 0c mov %ebx,0xc(%esp)
80101261: 89 4c 24 08 mov %ecx,0x8(%esp)
80101265: 89 54 24 04 mov %edx,0x4(%esp)
80101269: 89 04 24 mov %eax,(%esp)
8010126c: e8 6f 0c 00 00 call 80101ee0 <writei>
80101271: 89 45 e8 mov %eax,-0x18(%ebp)
80101274: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
80101278: 7e 11 jle 8010128b <filewrite+0xdd>
f->off += r;
8010127a: 8b 45 08 mov 0x8(%ebp),%eax
8010127d: 8b 50 14 mov 0x14(%eax),%edx
80101280: 8b 45 e8 mov -0x18(%ebp),%eax
80101283: 01 c2 add %eax,%edx
80101285: 8b 45 08 mov 0x8(%ebp),%eax
80101288: 89 50 14 mov %edx,0x14(%eax)
iunlock(f->ip);
8010128b: 8b 45 08 mov 0x8(%ebp),%eax
8010128e: 8b 40 10 mov 0x10(%eax),%eax
80101291: 89 04 24 mov %eax,(%esp)
80101294: e8 33 07 00 00 call 801019cc <iunlock>
commit_trans();
80101299: e8 bd 1f 00 00 call 8010325b <commit_trans>
if(r < 0)
8010129e: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
801012a2: 78 28 js 801012cc <filewrite+0x11e>
break;
if(r != n1)
801012a4: 8b 45 e8 mov -0x18(%ebp),%eax
801012a7: 3b 45 f4 cmp -0xc(%ebp),%eax
801012aa: 74 0c je 801012b8 <filewrite+0x10a>
panic("short filewrite");
801012ac: c7 04 24 77 86 10 80 movl $0x80108677,(%esp)
801012b3: e8 82 f2 ff ff call 8010053a <panic>
i += r;
801012b8: 8b 45 e8 mov -0x18(%ebp),%eax
801012bb: 01 45 f0 add %eax,-0x10(%ebp)
// and 2 blocks of slop for non-aligned writes.
// this really belongs lower down, since writei()
// might be writing a device like the console.
int max = ((LOGSIZE-1-1-2) / 2) * 512;
int i = 0;
while(i < n){
801012be: 8b 45 f0 mov -0x10(%ebp),%eax
801012c1: 3b 45 10 cmp 0x10(%ebp),%eax
801012c4: 0f 8c 4c ff ff ff jl 80101216 <filewrite+0x68>
801012ca: eb 01 jmp 801012cd <filewrite+0x11f>
f->off += r;
iunlock(f->ip);
commit_trans();
if(r < 0)
break;
801012cc: 90 nop
if(r != n1)
panic("short filewrite");
i += r;
}
return i == n ? n : -1;
801012cd: 8b 45 f0 mov -0x10(%ebp),%eax
801012d0: 3b 45 10 cmp 0x10(%ebp),%eax
801012d3: 75 05 jne 801012da <filewrite+0x12c>
801012d5: 8b 45 10 mov 0x10(%ebp),%eax
801012d8: eb 05 jmp 801012df <filewrite+0x131>
801012da: b8 ff ff ff ff mov $0xffffffff,%eax
801012df: eb 0c jmp 801012ed <filewrite+0x13f>
}
panic("filewrite");
801012e1: c7 04 24 87 86 10 80 movl $0x80108687,(%esp)
801012e8: e8 4d f2 ff ff call 8010053a <panic>
}
801012ed: 83 c4 24 add $0x24,%esp
801012f0: 5b pop %ebx
801012f1: 5d pop %ebp
801012f2: c3 ret
...
801012f4 <readsb>:
static void itrunc(struct inode*);
// Read the super block.
void
readsb(int dev, struct superblock *sb)
{
801012f4: 55 push %ebp
801012f5: 89 e5 mov %esp,%ebp
801012f7: 83 ec 28 sub $0x28,%esp
struct buf *bp;
bp = bread(dev, 1);
801012fa: 8b 45 08 mov 0x8(%ebp),%eax
801012fd: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80101304: 00
80101305: 89 04 24 mov %eax,(%esp)
80101308: e8 9a ee ff ff call 801001a7 <bread>
8010130d: 89 45 f4 mov %eax,-0xc(%ebp)
memmove(sb, bp->data, sizeof(*sb));
80101310: 8b 45 f4 mov -0xc(%ebp),%eax
80101313: 83 c0 18 add $0x18,%eax
80101316: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
8010131d: 00
8010131e: 89 44 24 04 mov %eax,0x4(%esp)
80101322: 8b 45 0c mov 0xc(%ebp),%eax
80101325: 89 04 24 mov %eax,(%esp)
80101328: e8 44 3f 00 00 call 80105271 <memmove>
brelse(bp);
8010132d: 8b 45 f4 mov -0xc(%ebp),%eax
80101330: 89 04 24 mov %eax,(%esp)
80101333: e8 e0 ee ff ff call 80100218 <brelse>
}
80101338: c9 leave
80101339: c3 ret
8010133a <bzero>:
// Zero a block.
static void
bzero(int dev, int bno)
{
8010133a: 55 push %ebp
8010133b: 89 e5 mov %esp,%ebp
8010133d: 83 ec 28 sub $0x28,%esp
struct buf *bp;
bp = bread(dev, bno);
80101340: 8b 55 0c mov 0xc(%ebp),%edx
80101343: 8b 45 08 mov 0x8(%ebp),%eax
80101346: 89 54 24 04 mov %edx,0x4(%esp)
8010134a: 89 04 24 mov %eax,(%esp)
8010134d: e8 55 ee ff ff call 801001a7 <bread>
80101352: 89 45 f4 mov %eax,-0xc(%ebp)
memset(bp->data, 0, BSIZE);
80101355: 8b 45 f4 mov -0xc(%ebp),%eax
80101358: 83 c0 18 add $0x18,%eax
8010135b: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
80101362: 00
80101363: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
8010136a: 00
8010136b: 89 04 24 mov %eax,(%esp)
8010136e: e8 2b 3e 00 00 call 8010519e <memset>
log_write(bp);
80101373: 8b 45 f4 mov -0xc(%ebp),%eax
80101376: 89 04 24 mov %eax,(%esp)
80101379: e8 35 1f 00 00 call 801032b3 <log_write>
brelse(bp);
8010137e: 8b 45 f4 mov -0xc(%ebp),%eax
80101381: 89 04 24 mov %eax,(%esp)
80101384: e8 8f ee ff ff call 80100218 <brelse>
}
80101389: c9 leave
8010138a: c3 ret
8010138b <balloc>:
// Blocks.
// Allocate a zeroed disk block.
static uint
balloc(uint dev)
{
8010138b: 55 push %ebp
8010138c: 89 e5 mov %esp,%ebp
8010138e: 53 push %ebx
8010138f: 83 ec 34 sub $0x34,%esp
int b, bi, m;
struct buf *bp;
struct superblock sb;
bp = 0;
80101392: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
readsb(dev, &sb);
80101399: 8b 45 08 mov 0x8(%ebp),%eax
8010139c: 8d 55 d8 lea -0x28(%ebp),%edx
8010139f: 89 54 24 04 mov %edx,0x4(%esp)
801013a3: 89 04 24 mov %eax,(%esp)
801013a6: e8 49 ff ff ff call 801012f4 <readsb>
for(b = 0; b < sb.size; b += BPB){
801013ab: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp)
801013b2: e9 15 01 00 00 jmp 801014cc <balloc+0x141>
bp = bread(dev, BBLOCK(b, sb.ninodes));
801013b7: 8b 45 e8 mov -0x18(%ebp),%eax
801013ba: 8d 90 ff 0f 00 00 lea 0xfff(%eax),%edx
801013c0: 85 c0 test %eax,%eax
801013c2: 0f 48 c2 cmovs %edx,%eax
801013c5: c1 f8 0c sar $0xc,%eax
801013c8: 8b 55 e0 mov -0x20(%ebp),%edx
801013cb: c1 ea 03 shr $0x3,%edx
801013ce: 01 d0 add %edx,%eax
801013d0: 83 c0 03 add $0x3,%eax
801013d3: 89 44 24 04 mov %eax,0x4(%esp)
801013d7: 8b 45 08 mov 0x8(%ebp),%eax
801013da: 89 04 24 mov %eax,(%esp)
801013dd: e8 c5 ed ff ff call 801001a7 <bread>
801013e2: 89 45 f4 mov %eax,-0xc(%ebp)
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
801013e5: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
801013ec: e9 aa 00 00 00 jmp 8010149b <balloc+0x110>
m = 1 << (bi % 8);
801013f1: 8b 45 ec mov -0x14(%ebp),%eax
801013f4: 89 c2 mov %eax,%edx
801013f6: c1 fa 1f sar $0x1f,%edx
801013f9: c1 ea 1d shr $0x1d,%edx
801013fc: 01 d0 add %edx,%eax
801013fe: 83 e0 07 and $0x7,%eax
80101401: 29 d0 sub %edx,%eax
80101403: ba 01 00 00 00 mov $0x1,%edx
80101408: 89 d3 mov %edx,%ebx
8010140a: 89 c1 mov %eax,%ecx
8010140c: d3 e3 shl %cl,%ebx
8010140e: 89 d8 mov %ebx,%eax
80101410: 89 45 f0 mov %eax,-0x10(%ebp)
if((bp->data[bi/8] & m) == 0){ // Is block free?
80101413: 8b 45 ec mov -0x14(%ebp),%eax
80101416: 8d 50 07 lea 0x7(%eax),%edx
80101419: 85 c0 test %eax,%eax
8010141b: 0f 48 c2 cmovs %edx,%eax
8010141e: c1 f8 03 sar $0x3,%eax
80101421: 8b 55 f4 mov -0xc(%ebp),%edx
80101424: 0f b6 44 02 18 movzbl 0x18(%edx,%eax,1),%eax
80101429: 0f b6 c0 movzbl %al,%eax
8010142c: 23 45 f0 and -0x10(%ebp),%eax
8010142f: 85 c0 test %eax,%eax
80101431: 75 64 jne 80101497 <balloc+0x10c>
bp->data[bi/8] |= m; // Mark block in use.
80101433: 8b 45 ec mov -0x14(%ebp),%eax
80101436: 8d 50 07 lea 0x7(%eax),%edx
80101439: 85 c0 test %eax,%eax
8010143b: 0f 48 c2 cmovs %edx,%eax
8010143e: c1 f8 03 sar $0x3,%eax
80101441: 89 c2 mov %eax,%edx
80101443: 8b 4d f4 mov -0xc(%ebp),%ecx
80101446: 0f b6 44 01 18 movzbl 0x18(%ecx,%eax,1),%eax
8010144b: 89 c1 mov %eax,%ecx
8010144d: 8b 45 f0 mov -0x10(%ebp),%eax
80101450: 09 c8 or %ecx,%eax
80101452: 89 c1 mov %eax,%ecx
80101454: 8b 45 f4 mov -0xc(%ebp),%eax
80101457: 88 4c 10 18 mov %cl,0x18(%eax,%edx,1)
log_write(bp);
8010145b: 8b 45 f4 mov -0xc(%ebp),%eax
8010145e: 89 04 24 mov %eax,(%esp)
80101461: e8 4d 1e 00 00 call 801032b3 <log_write>
brelse(bp);
80101466: 8b 45 f4 mov -0xc(%ebp),%eax
80101469: 89 04 24 mov %eax,(%esp)
8010146c: e8 a7 ed ff ff call 80100218 <brelse>
bzero(dev, b + bi);
80101471: 8b 45 ec mov -0x14(%ebp),%eax
80101474: 8b 55 e8 mov -0x18(%ebp),%edx
80101477: 01 c2 add %eax,%edx
80101479: 8b 45 08 mov 0x8(%ebp),%eax
8010147c: 89 54 24 04 mov %edx,0x4(%esp)
80101480: 89 04 24 mov %eax,(%esp)
80101483: e8 b2 fe ff ff call 8010133a <bzero>
return b + bi;
80101488: 8b 45 ec mov -0x14(%ebp),%eax
8010148b: 8b 55 e8 mov -0x18(%ebp),%edx
8010148e: 8d 04 02 lea (%edx,%eax,1),%eax
}
}
brelse(bp);
}
panic("balloc: out of blocks");
}
80101491: 83 c4 34 add $0x34,%esp
80101494: 5b pop %ebx
80101495: 5d pop %ebp
80101496: c3 ret
bp = 0;
readsb(dev, &sb);
for(b = 0; b < sb.size; b += BPB){
bp = bread(dev, BBLOCK(b, sb.ninodes));
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
80101497: 83 45 ec 01 addl $0x1,-0x14(%ebp)
8010149b: 81 7d ec ff 0f 00 00 cmpl $0xfff,-0x14(%ebp)
801014a2: 7f 16 jg 801014ba <balloc+0x12f>
801014a4: 8b 45 ec mov -0x14(%ebp),%eax
801014a7: 8b 55 e8 mov -0x18(%ebp),%edx
801014aa: 8d 04 02 lea (%edx,%eax,1),%eax
801014ad: 89 c2 mov %eax,%edx
801014af: 8b 45 d8 mov -0x28(%ebp),%eax
801014b2: 39 c2 cmp %eax,%edx
801014b4: 0f 82 37 ff ff ff jb 801013f1 <balloc+0x66>
brelse(bp);
bzero(dev, b + bi);
return b + bi;
}
}
brelse(bp);
801014ba: 8b 45 f4 mov -0xc(%ebp),%eax
801014bd: 89 04 24 mov %eax,(%esp)
801014c0: e8 53 ed ff ff call 80100218 <brelse>
struct buf *bp;
struct superblock sb;
bp = 0;
readsb(dev, &sb);
for(b = 0; b < sb.size; b += BPB){
801014c5: 81 45 e8 00 10 00 00 addl $0x1000,-0x18(%ebp)
801014cc: 8b 55 e8 mov -0x18(%ebp),%edx
801014cf: 8b 45 d8 mov -0x28(%ebp),%eax
801014d2: 39 c2 cmp %eax,%edx
801014d4: 0f 82 dd fe ff ff jb 801013b7 <balloc+0x2c>
return b + bi;
}
}
brelse(bp);
}
panic("balloc: out of blocks");
801014da: c7 04 24 91 86 10 80 movl $0x80108691,(%esp)
801014e1: e8 54 f0 ff ff call 8010053a <panic>
801014e6 <bfree>:
}
// Free a disk block.
static void
bfree(int dev, uint b)
{
801014e6: 55 push %ebp
801014e7: 89 e5 mov %esp,%ebp
801014e9: 53 push %ebx
801014ea: 83 ec 34 sub $0x34,%esp
struct buf *bp;
struct superblock sb;
int bi, m;
readsb(dev, &sb);
801014ed: 8d 45 dc lea -0x24(%ebp),%eax
801014f0: 89 44 24 04 mov %eax,0x4(%esp)
801014f4: 8b 45 08 mov 0x8(%ebp),%eax
801014f7: 89 04 24 mov %eax,(%esp)
801014fa: e8 f5 fd ff ff call 801012f4 <readsb>
bp = bread(dev, BBLOCK(b, sb.ninodes));
801014ff: 8b 45 0c mov 0xc(%ebp),%eax
80101502: 89 c2 mov %eax,%edx
80101504: c1 ea 0c shr $0xc,%edx
80101507: 8b 45 e4 mov -0x1c(%ebp),%eax
8010150a: c1 e8 03 shr $0x3,%eax
8010150d: 8d 04 02 lea (%edx,%eax,1),%eax
80101510: 8d 50 03 lea 0x3(%eax),%edx
80101513: 8b 45 08 mov 0x8(%ebp),%eax
80101516: 89 54 24 04 mov %edx,0x4(%esp)
8010151a: 89 04 24 mov %eax,(%esp)
8010151d: e8 85 ec ff ff call 801001a7 <bread>
80101522: 89 45 ec mov %eax,-0x14(%ebp)
bi = b % BPB;
80101525: 8b 45 0c mov 0xc(%ebp),%eax
80101528: 25 ff 0f 00 00 and $0xfff,%eax
8010152d: 89 45 f0 mov %eax,-0x10(%ebp)
m = 1 << (bi % 8);
80101530: 8b 45 f0 mov -0x10(%ebp),%eax
80101533: 89 c2 mov %eax,%edx
80101535: c1 fa 1f sar $0x1f,%edx
80101538: c1 ea 1d shr $0x1d,%edx
8010153b: 01 d0 add %edx,%eax
8010153d: 83 e0 07 and $0x7,%eax
80101540: 29 d0 sub %edx,%eax
80101542: ba 01 00 00 00 mov $0x1,%edx
80101547: 89 d3 mov %edx,%ebx
80101549: 89 c1 mov %eax,%ecx
8010154b: d3 e3 shl %cl,%ebx
8010154d: 89 d8 mov %ebx,%eax
8010154f: 89 45 f4 mov %eax,-0xc(%ebp)
if((bp->data[bi/8] & m) == 0)
80101552: 8b 45 f0 mov -0x10(%ebp),%eax
80101555: 8d 50 07 lea 0x7(%eax),%edx
80101558: 85 c0 test %eax,%eax
8010155a: 0f 48 c2 cmovs %edx,%eax
8010155d: c1 f8 03 sar $0x3,%eax
80101560: 8b 55 ec mov -0x14(%ebp),%edx
80101563: 0f b6 44 02 18 movzbl 0x18(%edx,%eax,1),%eax
80101568: 0f b6 c0 movzbl %al,%eax
8010156b: 23 45 f4 and -0xc(%ebp),%eax
8010156e: 85 c0 test %eax,%eax
80101570: 75 0c jne 8010157e <bfree+0x98>
panic("freeing free block");
80101572: c7 04 24 a7 86 10 80 movl $0x801086a7,(%esp)
80101579: e8 bc ef ff ff call 8010053a <panic>
bp->data[bi/8] &= ~m;
8010157e: 8b 45 f0 mov -0x10(%ebp),%eax
80101581: 8d 50 07 lea 0x7(%eax),%edx
80101584: 85 c0 test %eax,%eax
80101586: 0f 48 c2 cmovs %edx,%eax
80101589: c1 f8 03 sar $0x3,%eax
8010158c: 89 c2 mov %eax,%edx
8010158e: 8b 4d ec mov -0x14(%ebp),%ecx
80101591: 0f b6 44 01 18 movzbl 0x18(%ecx,%eax,1),%eax
80101596: 8b 4d f4 mov -0xc(%ebp),%ecx
80101599: f7 d1 not %ecx
8010159b: 21 c8 and %ecx,%eax
8010159d: 89 c1 mov %eax,%ecx
8010159f: 8b 45 ec mov -0x14(%ebp),%eax
801015a2: 88 4c 10 18 mov %cl,0x18(%eax,%edx,1)
log_write(bp);
801015a6: 8b 45 ec mov -0x14(%ebp),%eax
801015a9: 89 04 24 mov %eax,(%esp)
801015ac: e8 02 1d 00 00 call 801032b3 <log_write>
brelse(bp);
801015b1: 8b 45 ec mov -0x14(%ebp),%eax
801015b4: 89 04 24 mov %eax,(%esp)
801015b7: e8 5c ec ff ff call 80100218 <brelse>
}
801015bc: 83 c4 34 add $0x34,%esp
801015bf: 5b pop %ebx
801015c0: 5d pop %ebp
801015c1: c3 ret
801015c2 <iinit>:
struct inode inode[NINODE];
} icache;
void
iinit(void)
{
801015c2: 55 push %ebp
801015c3: 89 e5 mov %esp,%ebp
801015c5: 83 ec 18 sub $0x18,%esp
initlock(&icache.lock, "icache");
801015c8: c7 44 24 04 ba 86 10 movl $0x801086ba,0x4(%esp)
801015cf: 80
801015d0: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
801015d7: e8 52 39 00 00 call 80104f2e <initlock>
}
801015dc: c9 leave
801015dd: c3 ret
801015de <ialloc>:
//PAGEBREAK!
// Allocate a new inode with the given type on device dev.
// A free inode has a type of zero.
struct inode*
ialloc(uint dev, short type)
{
801015de: 55 push %ebp
801015df: 89 e5 mov %esp,%ebp
801015e1: 83 ec 48 sub $0x48,%esp
801015e4: 8b 45 0c mov 0xc(%ebp),%eax
801015e7: 66 89 45 d4 mov %ax,-0x2c(%ebp)
int inum;
struct buf *bp;
struct dinode *dip;
struct superblock sb;
readsb(dev, &sb);
801015eb: 8b 45 08 mov 0x8(%ebp),%eax
801015ee: 8d 55 dc lea -0x24(%ebp),%edx
801015f1: 89 54 24 04 mov %edx,0x4(%esp)
801015f5: 89 04 24 mov %eax,(%esp)
801015f8: e8 f7 fc ff ff call 801012f4 <readsb>
for(inum = 1; inum < sb.ninodes; inum++){
801015fd: c7 45 ec 01 00 00 00 movl $0x1,-0x14(%ebp)
80101604: e9 98 00 00 00 jmp 801016a1 <ialloc+0xc3>
bp = bread(dev, IBLOCK(inum));
80101609: 8b 45 ec mov -0x14(%ebp),%eax
8010160c: c1 e8 03 shr $0x3,%eax
8010160f: 83 c0 02 add $0x2,%eax
80101612: 89 44 24 04 mov %eax,0x4(%esp)
80101616: 8b 45 08 mov 0x8(%ebp),%eax
80101619: 89 04 24 mov %eax,(%esp)
8010161c: e8 86 eb ff ff call 801001a7 <bread>
80101621: 89 45 f0 mov %eax,-0x10(%ebp)
dip = (struct dinode*)bp->data + inum%IPB;
80101624: 8b 45 f0 mov -0x10(%ebp),%eax
80101627: 83 c0 18 add $0x18,%eax
8010162a: 8b 55 ec mov -0x14(%ebp),%edx
8010162d: 83 e2 07 and $0x7,%edx
80101630: c1 e2 06 shl $0x6,%edx
80101633: 01 d0 add %edx,%eax
80101635: 89 45 f4 mov %eax,-0xc(%ebp)
if(dip->type == 0){ // a free inode
80101638: 8b 45 f4 mov -0xc(%ebp),%eax
8010163b: 0f b7 00 movzwl (%eax),%eax
8010163e: 66 85 c0 test %ax,%ax
80101641: 75 4f jne 80101692 <ialloc+0xb4>
memset(dip, 0, sizeof(*dip));
80101643: c7 44 24 08 40 00 00 movl $0x40,0x8(%esp)
8010164a: 00
8010164b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80101652: 00
80101653: 8b 45 f4 mov -0xc(%ebp),%eax
80101656: 89 04 24 mov %eax,(%esp)
80101659: e8 40 3b 00 00 call 8010519e <memset>
dip->type = type;
8010165e: 8b 45 f4 mov -0xc(%ebp),%eax
80101661: 0f b7 55 d4 movzwl -0x2c(%ebp),%edx
80101665: 66 89 10 mov %dx,(%eax)
log_write(bp); // mark it allocated on the disk
80101668: 8b 45 f0 mov -0x10(%ebp),%eax
8010166b: 89 04 24 mov %eax,(%esp)
8010166e: e8 40 1c 00 00 call 801032b3 <log_write>
brelse(bp);
80101673: 8b 45 f0 mov -0x10(%ebp),%eax
80101676: 89 04 24 mov %eax,(%esp)
80101679: e8 9a eb ff ff call 80100218 <brelse>
return iget(dev, inum);
8010167e: 8b 45 ec mov -0x14(%ebp),%eax
80101681: 89 44 24 04 mov %eax,0x4(%esp)
80101685: 8b 45 08 mov 0x8(%ebp),%eax
80101688: 89 04 24 mov %eax,(%esp)
8010168b: e8 e6 00 00 00 call 80101776 <iget>
}
brelse(bp);
}
panic("ialloc: no inodes");
}
80101690: c9 leave
80101691: c3 ret
dip->type = type;
log_write(bp); // mark it allocated on the disk
brelse(bp);
return iget(dev, inum);
}
brelse(bp);
80101692: 8b 45 f0 mov -0x10(%ebp),%eax
80101695: 89 04 24 mov %eax,(%esp)
80101698: e8 7b eb ff ff call 80100218 <brelse>
struct dinode *dip;
struct superblock sb;
readsb(dev, &sb);
for(inum = 1; inum < sb.ninodes; inum++){
8010169d: 83 45 ec 01 addl $0x1,-0x14(%ebp)
801016a1: 8b 55 ec mov -0x14(%ebp),%edx
801016a4: 8b 45 e4 mov -0x1c(%ebp),%eax
801016a7: 39 c2 cmp %eax,%edx
801016a9: 0f 82 5a ff ff ff jb 80101609 <ialloc+0x2b>
brelse(bp);
return iget(dev, inum);
}
brelse(bp);
}
panic("ialloc: no inodes");
801016af: c7 04 24 c1 86 10 80 movl $0x801086c1,(%esp)
801016b6: e8 7f ee ff ff call 8010053a <panic>
801016bb <iupdate>:
}
// Copy a modified in-memory inode to disk.
void
iupdate(struct inode *ip)
{
801016bb: 55 push %ebp
801016bc: 89 e5 mov %esp,%ebp
801016be: 83 ec 28 sub $0x28,%esp
struct buf *bp;
struct dinode *dip;
bp = bread(ip->dev, IBLOCK(ip->inum));
801016c1: 8b 45 08 mov 0x8(%ebp),%eax
801016c4: 8b 40 04 mov 0x4(%eax),%eax
801016c7: c1 e8 03 shr $0x3,%eax
801016ca: 8d 50 02 lea 0x2(%eax),%edx
801016cd: 8b 45 08 mov 0x8(%ebp),%eax
801016d0: 8b 00 mov (%eax),%eax
801016d2: 89 54 24 04 mov %edx,0x4(%esp)
801016d6: 89 04 24 mov %eax,(%esp)
801016d9: e8 c9 ea ff ff call 801001a7 <bread>
801016de: 89 45 f0 mov %eax,-0x10(%ebp)
dip = (struct dinode*)bp->data + ip->inum%IPB;
801016e1: 8b 45 f0 mov -0x10(%ebp),%eax
801016e4: 83 c0 18 add $0x18,%eax
801016e7: 89 c2 mov %eax,%edx
801016e9: 8b 45 08 mov 0x8(%ebp),%eax
801016ec: 8b 40 04 mov 0x4(%eax),%eax
801016ef: 83 e0 07 and $0x7,%eax
801016f2: c1 e0 06 shl $0x6,%eax
801016f5: 8d 04 02 lea (%edx,%eax,1),%eax
801016f8: 89 45 f4 mov %eax,-0xc(%ebp)
dip->type = ip->type;
801016fb: 8b 45 08 mov 0x8(%ebp),%eax
801016fe: 0f b7 50 10 movzwl 0x10(%eax),%edx
80101702: 8b 45 f4 mov -0xc(%ebp),%eax
80101705: 66 89 10 mov %dx,(%eax)
dip->major = ip->major;
80101708: 8b 45 08 mov 0x8(%ebp),%eax
8010170b: 0f b7 50 12 movzwl 0x12(%eax),%edx
8010170f: 8b 45 f4 mov -0xc(%ebp),%eax
80101712: 66 89 50 02 mov %dx,0x2(%eax)
dip->minor = ip->minor;
80101716: 8b 45 08 mov 0x8(%ebp),%eax
80101719: 0f b7 50 14 movzwl 0x14(%eax),%edx
8010171d: 8b 45 f4 mov -0xc(%ebp),%eax
80101720: 66 89 50 04 mov %dx,0x4(%eax)
dip->nlink = ip->nlink;
80101724: 8b 45 08 mov 0x8(%ebp),%eax
80101727: 0f b7 50 16 movzwl 0x16(%eax),%edx
8010172b: 8b 45 f4 mov -0xc(%ebp),%eax
8010172e: 66 89 50 06 mov %dx,0x6(%eax)
dip->size = ip->size;
80101732: 8b 45 08 mov 0x8(%ebp),%eax
80101735: 8b 50 18 mov 0x18(%eax),%edx
80101738: 8b 45 f4 mov -0xc(%ebp),%eax
8010173b: 89 50 08 mov %edx,0x8(%eax)
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010173e: 8b 45 08 mov 0x8(%ebp),%eax
80101741: 8d 50 1c lea 0x1c(%eax),%edx
80101744: 8b 45 f4 mov -0xc(%ebp),%eax
80101747: 83 c0 0c add $0xc,%eax
8010174a: c7 44 24 08 34 00 00 movl $0x34,0x8(%esp)
80101751: 00
80101752: 89 54 24 04 mov %edx,0x4(%esp)
80101756: 89 04 24 mov %eax,(%esp)
80101759: e8 13 3b 00 00 call 80105271 <memmove>
log_write(bp);
8010175e: 8b 45 f0 mov -0x10(%ebp),%eax
80101761: 89 04 24 mov %eax,(%esp)
80101764: e8 4a 1b 00 00 call 801032b3 <log_write>
brelse(bp);
80101769: 8b 45 f0 mov -0x10(%ebp),%eax
8010176c: 89 04 24 mov %eax,(%esp)
8010176f: e8 a4 ea ff ff call 80100218 <brelse>
}
80101774: c9 leave
80101775: c3 ret
80101776 <iget>:
// Find the inode with number inum on device dev
// and return the in-memory copy. Does not lock
// the inode and does not read it from disk.
static struct inode*
iget(uint dev, uint inum)
{
80101776: 55 push %ebp
80101777: 89 e5 mov %esp,%ebp
80101779: 83 ec 28 sub $0x28,%esp
struct inode *ip, *empty;
acquire(&icache.lock);
8010177c: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101783: e8 c7 37 00 00 call 80104f4f <acquire>
// Is the inode already cached?
empty = 0;
80101788: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
8010178f: c7 45 f0 b4 e8 10 80 movl $0x8010e8b4,-0x10(%ebp)
80101796: eb 59 jmp 801017f1 <iget+0x7b>
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
80101798: 8b 45 f0 mov -0x10(%ebp),%eax
8010179b: 8b 40 08 mov 0x8(%eax),%eax
8010179e: 85 c0 test %eax,%eax
801017a0: 7e 35 jle 801017d7 <iget+0x61>
801017a2: 8b 45 f0 mov -0x10(%ebp),%eax
801017a5: 8b 00 mov (%eax),%eax
801017a7: 3b 45 08 cmp 0x8(%ebp),%eax
801017aa: 75 2b jne 801017d7 <iget+0x61>
801017ac: 8b 45 f0 mov -0x10(%ebp),%eax
801017af: 8b 40 04 mov 0x4(%eax),%eax
801017b2: 3b 45 0c cmp 0xc(%ebp),%eax
801017b5: 75 20 jne 801017d7 <iget+0x61>
ip->ref++;
801017b7: 8b 45 f0 mov -0x10(%ebp),%eax
801017ba: 8b 40 08 mov 0x8(%eax),%eax
801017bd: 8d 50 01 lea 0x1(%eax),%edx
801017c0: 8b 45 f0 mov -0x10(%ebp),%eax
801017c3: 89 50 08 mov %edx,0x8(%eax)
release(&icache.lock);
801017c6: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
801017cd: e8 de 37 00 00 call 80104fb0 <release>
return ip;
801017d2: 8b 45 f0 mov -0x10(%ebp),%eax
801017d5: eb 70 jmp 80101847 <iget+0xd1>
}
if(empty == 0 && ip->ref == 0) // Remember empty slot.
801017d7: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801017db: 75 10 jne 801017ed <iget+0x77>
801017dd: 8b 45 f0 mov -0x10(%ebp),%eax
801017e0: 8b 40 08 mov 0x8(%eax),%eax
801017e3: 85 c0 test %eax,%eax
801017e5: 75 06 jne 801017ed <iget+0x77>
empty = ip;
801017e7: 8b 45 f0 mov -0x10(%ebp),%eax
801017ea: 89 45 f4 mov %eax,-0xc(%ebp)
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
801017ed: 83 45 f0 50 addl $0x50,-0x10(%ebp)
801017f1: b8 54 f8 10 80 mov $0x8010f854,%eax
801017f6: 39 45 f0 cmp %eax,-0x10(%ebp)
801017f9: 72 9d jb 80101798 <iget+0x22>
if(empty == 0 && ip->ref == 0) // Remember empty slot.
empty = ip;
}
// Recycle an inode cache entry.
if(empty == 0)
801017fb: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801017ff: 75 0c jne 8010180d <iget+0x97>
panic("iget: no inodes");
80101801: c7 04 24 d3 86 10 80 movl $0x801086d3,(%esp)
80101808: e8 2d ed ff ff call 8010053a <panic>
ip = empty;
8010180d: 8b 45 f4 mov -0xc(%ebp),%eax
80101810: 89 45 f0 mov %eax,-0x10(%ebp)
ip->dev = dev;
80101813: 8b 45 f0 mov -0x10(%ebp),%eax
80101816: 8b 55 08 mov 0x8(%ebp),%edx
80101819: 89 10 mov %edx,(%eax)
ip->inum = inum;
8010181b: 8b 45 f0 mov -0x10(%ebp),%eax
8010181e: 8b 55 0c mov 0xc(%ebp),%edx
80101821: 89 50 04 mov %edx,0x4(%eax)
ip->ref = 1;
80101824: 8b 45 f0 mov -0x10(%ebp),%eax
80101827: c7 40 08 01 00 00 00 movl $0x1,0x8(%eax)
ip->flags = 0;
8010182e: 8b 45 f0 mov -0x10(%ebp),%eax
80101831: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
release(&icache.lock);
80101838: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
8010183f: e8 6c 37 00 00 call 80104fb0 <release>
return ip;
80101844: 8b 45 f0 mov -0x10(%ebp),%eax
}
80101847: c9 leave
80101848: c3 ret
80101849 <idup>:
// Increment reference count for ip.
// Returns ip to enable ip = idup(ip1) idiom.
struct inode*
idup(struct inode *ip)
{
80101849: 55 push %ebp
8010184a: 89 e5 mov %esp,%ebp
8010184c: 83 ec 18 sub $0x18,%esp
acquire(&icache.lock);
8010184f: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101856: e8 f4 36 00 00 call 80104f4f <acquire>
ip->ref++;
8010185b: 8b 45 08 mov 0x8(%ebp),%eax
8010185e: 8b 40 08 mov 0x8(%eax),%eax
80101861: 8d 50 01 lea 0x1(%eax),%edx
80101864: 8b 45 08 mov 0x8(%ebp),%eax
80101867: 89 50 08 mov %edx,0x8(%eax)
release(&icache.lock);
8010186a: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101871: e8 3a 37 00 00 call 80104fb0 <release>
return ip;
80101876: 8b 45 08 mov 0x8(%ebp),%eax
}
80101879: c9 leave
8010187a: c3 ret
8010187b <ilock>:
// Lock the given inode.
// Reads the inode from disk if necessary.
void
ilock(struct inode *ip)
{
8010187b: 55 push %ebp
8010187c: 89 e5 mov %esp,%ebp
8010187e: 83 ec 28 sub $0x28,%esp
struct buf *bp;
struct dinode *dip;
if(ip == 0 || ip->ref < 1)
80101881: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
80101885: 74 0a je 80101891 <ilock+0x16>
80101887: 8b 45 08 mov 0x8(%ebp),%eax
8010188a: 8b 40 08 mov 0x8(%eax),%eax
8010188d: 85 c0 test %eax,%eax
8010188f: 7f 0c jg 8010189d <ilock+0x22>
panic("ilock");
80101891: c7 04 24 e3 86 10 80 movl $0x801086e3,(%esp)
80101898: e8 9d ec ff ff call 8010053a <panic>
acquire(&icache.lock);
8010189d: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
801018a4: e8 a6 36 00 00 call 80104f4f <acquire>
while(ip->flags & I_BUSY)
801018a9: eb 13 jmp 801018be <ilock+0x43>
sleep(ip, &icache.lock);
801018ab: c7 44 24 04 80 e8 10 movl $0x8010e880,0x4(%esp)
801018b2: 80
801018b3: 8b 45 08 mov 0x8(%ebp),%eax
801018b6: 89 04 24 mov %eax,(%esp)
801018b9: e8 18 33 00 00 call 80104bd6 <sleep>
if(ip == 0 || ip->ref < 1)
panic("ilock");
acquire(&icache.lock);
while(ip->flags & I_BUSY)
801018be: 8b 45 08 mov 0x8(%ebp),%eax
801018c1: 8b 40 0c mov 0xc(%eax),%eax
801018c4: 83 e0 01 and $0x1,%eax
801018c7: 84 c0 test %al,%al
801018c9: 75 e0 jne 801018ab <ilock+0x30>
sleep(ip, &icache.lock);
ip->flags |= I_BUSY;
801018cb: 8b 45 08 mov 0x8(%ebp),%eax
801018ce: 8b 40 0c mov 0xc(%eax),%eax
801018d1: 89 c2 mov %eax,%edx
801018d3: 83 ca 01 or $0x1,%edx
801018d6: 8b 45 08 mov 0x8(%ebp),%eax
801018d9: 89 50 0c mov %edx,0xc(%eax)
release(&icache.lock);
801018dc: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
801018e3: e8 c8 36 00 00 call 80104fb0 <release>
if(!(ip->flags & I_VALID)){
801018e8: 8b 45 08 mov 0x8(%ebp),%eax
801018eb: 8b 40 0c mov 0xc(%eax),%eax
801018ee: 83 e0 02 and $0x2,%eax
801018f1: 85 c0 test %eax,%eax
801018f3: 0f 85 d1 00 00 00 jne 801019ca <ilock+0x14f>
bp = bread(ip->dev, IBLOCK(ip->inum));
801018f9: 8b 45 08 mov 0x8(%ebp),%eax
801018fc: 8b 40 04 mov 0x4(%eax),%eax
801018ff: c1 e8 03 shr $0x3,%eax
80101902: 8d 50 02 lea 0x2(%eax),%edx
80101905: 8b 45 08 mov 0x8(%ebp),%eax
80101908: 8b 00 mov (%eax),%eax
8010190a: 89 54 24 04 mov %edx,0x4(%esp)
8010190e: 89 04 24 mov %eax,(%esp)
80101911: e8 91 e8 ff ff call 801001a7 <bread>
80101916: 89 45 f0 mov %eax,-0x10(%ebp)
dip = (struct dinode*)bp->data + ip->inum%IPB;
80101919: 8b 45 f0 mov -0x10(%ebp),%eax
8010191c: 83 c0 18 add $0x18,%eax
8010191f: 89 c2 mov %eax,%edx
80101921: 8b 45 08 mov 0x8(%ebp),%eax
80101924: 8b 40 04 mov 0x4(%eax),%eax
80101927: 83 e0 07 and $0x7,%eax
8010192a: c1 e0 06 shl $0x6,%eax
8010192d: 8d 04 02 lea (%edx,%eax,1),%eax
80101930: 89 45 f4 mov %eax,-0xc(%ebp)
ip->type = dip->type;
80101933: 8b 45 f4 mov -0xc(%ebp),%eax
80101936: 0f b7 10 movzwl (%eax),%edx
80101939: 8b 45 08 mov 0x8(%ebp),%eax
8010193c: 66 89 50 10 mov %dx,0x10(%eax)
ip->major = dip->major;
80101940: 8b 45 f4 mov -0xc(%ebp),%eax
80101943: 0f b7 50 02 movzwl 0x2(%eax),%edx
80101947: 8b 45 08 mov 0x8(%ebp),%eax
8010194a: 66 89 50 12 mov %dx,0x12(%eax)
ip->minor = dip->minor;
8010194e: 8b 45 f4 mov -0xc(%ebp),%eax
80101951: 0f b7 50 04 movzwl 0x4(%eax),%edx
80101955: 8b 45 08 mov 0x8(%ebp),%eax
80101958: 66 89 50 14 mov %dx,0x14(%eax)
ip->nlink = dip->nlink;
8010195c: 8b 45 f4 mov -0xc(%ebp),%eax
8010195f: 0f b7 50 06 movzwl 0x6(%eax),%edx
80101963: 8b 45 08 mov 0x8(%ebp),%eax
80101966: 66 89 50 16 mov %dx,0x16(%eax)
ip->size = dip->size;
8010196a: 8b 45 f4 mov -0xc(%ebp),%eax
8010196d: 8b 50 08 mov 0x8(%eax),%edx
80101970: 8b 45 08 mov 0x8(%ebp),%eax
80101973: 89 50 18 mov %edx,0x18(%eax)
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
80101976: 8b 45 f4 mov -0xc(%ebp),%eax
80101979: 8d 50 0c lea 0xc(%eax),%edx
8010197c: 8b 45 08 mov 0x8(%ebp),%eax
8010197f: 83 c0 1c add $0x1c,%eax
80101982: c7 44 24 08 34 00 00 movl $0x34,0x8(%esp)
80101989: 00
8010198a: 89 54 24 04 mov %edx,0x4(%esp)
8010198e: 89 04 24 mov %eax,(%esp)
80101991: e8 db 38 00 00 call 80105271 <memmove>
brelse(bp);
80101996: 8b 45 f0 mov -0x10(%ebp),%eax
80101999: 89 04 24 mov %eax,(%esp)
8010199c: e8 77 e8 ff ff call 80100218 <brelse>
ip->flags |= I_VALID;
801019a1: 8b 45 08 mov 0x8(%ebp),%eax
801019a4: 8b 40 0c mov 0xc(%eax),%eax
801019a7: 89 c2 mov %eax,%edx
801019a9: 83 ca 02 or $0x2,%edx
801019ac: 8b 45 08 mov 0x8(%ebp),%eax
801019af: 89 50 0c mov %edx,0xc(%eax)
if(ip->type == 0)
801019b2: 8b 45 08 mov 0x8(%ebp),%eax
801019b5: 0f b7 40 10 movzwl 0x10(%eax),%eax
801019b9: 66 85 c0 test %ax,%ax
801019bc: 75 0c jne 801019ca <ilock+0x14f>
panic("ilock: no type");
801019be: c7 04 24 e9 86 10 80 movl $0x801086e9,(%esp)
801019c5: e8 70 eb ff ff call 8010053a <panic>
}
}
801019ca: c9 leave
801019cb: c3 ret
801019cc <iunlock>:
// Unlock the given inode.
void
iunlock(struct inode *ip)
{
801019cc: 55 push %ebp
801019cd: 89 e5 mov %esp,%ebp
801019cf: 83 ec 18 sub $0x18,%esp
if(ip == 0 || !(ip->flags & I_BUSY) || ip->ref < 1)
801019d2: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
801019d6: 74 17 je 801019ef <iunlock+0x23>
801019d8: 8b 45 08 mov 0x8(%ebp),%eax
801019db: 8b 40 0c mov 0xc(%eax),%eax
801019de: 83 e0 01 and $0x1,%eax
801019e1: 85 c0 test %eax,%eax
801019e3: 74 0a je 801019ef <iunlock+0x23>
801019e5: 8b 45 08 mov 0x8(%ebp),%eax
801019e8: 8b 40 08 mov 0x8(%eax),%eax
801019eb: 85 c0 test %eax,%eax
801019ed: 7f 0c jg 801019fb <iunlock+0x2f>
panic("iunlock");
801019ef: c7 04 24 f8 86 10 80 movl $0x801086f8,(%esp)
801019f6: e8 3f eb ff ff call 8010053a <panic>
acquire(&icache.lock);
801019fb: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101a02: e8 48 35 00 00 call 80104f4f <acquire>
ip->flags &= ~I_BUSY;
80101a07: 8b 45 08 mov 0x8(%ebp),%eax
80101a0a: 8b 40 0c mov 0xc(%eax),%eax
80101a0d: 89 c2 mov %eax,%edx
80101a0f: 83 e2 fe and $0xfffffffe,%edx
80101a12: 8b 45 08 mov 0x8(%ebp),%eax
80101a15: 89 50 0c mov %edx,0xc(%eax)
wakeup(ip);
80101a18: 8b 45 08 mov 0x8(%ebp),%eax
80101a1b: 89 04 24 mov %eax,(%esp)
80101a1e: e8 f9 32 00 00 call 80104d1c <wakeup>
release(&icache.lock);
80101a23: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101a2a: e8 81 35 00 00 call 80104fb0 <release>
}
80101a2f: c9 leave
80101a30: c3 ret
80101a31 <iput>:
// be recycled.
// If that was the last reference and the inode has no links
// to it, free the inode (and its content) on disk.
void
iput(struct inode *ip)
{
80101a31: 55 push %ebp
80101a32: 89 e5 mov %esp,%ebp
80101a34: 83 ec 18 sub $0x18,%esp
acquire(&icache.lock);
80101a37: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101a3e: e8 0c 35 00 00 call 80104f4f <acquire>
if(ip->ref == 1 && (ip->flags & I_VALID) && ip->nlink == 0){
80101a43: 8b 45 08 mov 0x8(%ebp),%eax
80101a46: 8b 40 08 mov 0x8(%eax),%eax
80101a49: 83 f8 01 cmp $0x1,%eax
80101a4c: 0f 85 93 00 00 00 jne 80101ae5 <iput+0xb4>
80101a52: 8b 45 08 mov 0x8(%ebp),%eax
80101a55: 8b 40 0c mov 0xc(%eax),%eax
80101a58: 83 e0 02 and $0x2,%eax
80101a5b: 85 c0 test %eax,%eax
80101a5d: 0f 84 82 00 00 00 je 80101ae5 <iput+0xb4>
80101a63: 8b 45 08 mov 0x8(%ebp),%eax
80101a66: 0f b7 40 16 movzwl 0x16(%eax),%eax
80101a6a: 66 85 c0 test %ax,%ax
80101a6d: 75 76 jne 80101ae5 <iput+0xb4>
// inode has no links: truncate and free inode.
if(ip->flags & I_BUSY)
80101a6f: 8b 45 08 mov 0x8(%ebp),%eax
80101a72: 8b 40 0c mov 0xc(%eax),%eax
80101a75: 83 e0 01 and $0x1,%eax
80101a78: 84 c0 test %al,%al
80101a7a: 74 0c je 80101a88 <iput+0x57>
panic("iput busy");
80101a7c: c7 04 24 00 87 10 80 movl $0x80108700,(%esp)
80101a83: e8 b2 ea ff ff call 8010053a <panic>
ip->flags |= I_BUSY;
80101a88: 8b 45 08 mov 0x8(%ebp),%eax
80101a8b: 8b 40 0c mov 0xc(%eax),%eax
80101a8e: 89 c2 mov %eax,%edx
80101a90: 83 ca 01 or $0x1,%edx
80101a93: 8b 45 08 mov 0x8(%ebp),%eax
80101a96: 89 50 0c mov %edx,0xc(%eax)
release(&icache.lock);
80101a99: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101aa0: e8 0b 35 00 00 call 80104fb0 <release>
itrunc(ip);
80101aa5: 8b 45 08 mov 0x8(%ebp),%eax
80101aa8: 89 04 24 mov %eax,(%esp)
80101aab: e8 72 01 00 00 call 80101c22 <itrunc>
ip->type = 0;
80101ab0: 8b 45 08 mov 0x8(%ebp),%eax
80101ab3: 66 c7 40 10 00 00 movw $0x0,0x10(%eax)
iupdate(ip);
80101ab9: 8b 45 08 mov 0x8(%ebp),%eax
80101abc: 89 04 24 mov %eax,(%esp)
80101abf: e8 f7 fb ff ff call 801016bb <iupdate>
acquire(&icache.lock);
80101ac4: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101acb: e8 7f 34 00 00 call 80104f4f <acquire>
ip->flags = 0;
80101ad0: 8b 45 08 mov 0x8(%ebp),%eax
80101ad3: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
wakeup(ip);
80101ada: 8b 45 08 mov 0x8(%ebp),%eax
80101add: 89 04 24 mov %eax,(%esp)
80101ae0: e8 37 32 00 00 call 80104d1c <wakeup>
}
ip->ref--;
80101ae5: 8b 45 08 mov 0x8(%ebp),%eax
80101ae8: 8b 40 08 mov 0x8(%eax),%eax
80101aeb: 8d 50 ff lea -0x1(%eax),%edx
80101aee: 8b 45 08 mov 0x8(%ebp),%eax
80101af1: 89 50 08 mov %edx,0x8(%eax)
release(&icache.lock);
80101af4: c7 04 24 80 e8 10 80 movl $0x8010e880,(%esp)
80101afb: e8 b0 34 00 00 call 80104fb0 <release>
}
80101b00: c9 leave
80101b01: c3 ret
80101b02 <iunlockput>:
// Common idiom: unlock, then put.
void
iunlockput(struct inode *ip)
{
80101b02: 55 push %ebp
80101b03: 89 e5 mov %esp,%ebp
80101b05: 83 ec 18 sub $0x18,%esp
iunlock(ip);
80101b08: 8b 45 08 mov 0x8(%ebp),%eax
80101b0b: 89 04 24 mov %eax,(%esp)
80101b0e: e8 b9 fe ff ff call 801019cc <iunlock>
iput(ip);
80101b13: 8b 45 08 mov 0x8(%ebp),%eax
80101b16: 89 04 24 mov %eax,(%esp)
80101b19: e8 13 ff ff ff call 80101a31 <iput>
}
80101b1e: c9 leave
80101b1f: c3 ret
80101b20 <bmap>:
// Return the disk block address of the nth block in inode ip.
// If there is no such block, bmap allocates one.
static uint
bmap(struct inode *ip, uint bn)
{
80101b20: 55 push %ebp
80101b21: 89 e5 mov %esp,%ebp
80101b23: 53 push %ebx
80101b24: 83 ec 24 sub $0x24,%esp
uint addr, *a;
struct buf *bp;
if(bn < NDIRECT){
80101b27: 83 7d 0c 0b cmpl $0xb,0xc(%ebp)
80101b2b: 77 3e ja 80101b6b <bmap+0x4b>
if((addr = ip->addrs[bn]) == 0)
80101b2d: 8b 55 0c mov 0xc(%ebp),%edx
80101b30: 8b 45 08 mov 0x8(%ebp),%eax
80101b33: 83 c2 04 add $0x4,%edx
80101b36: 8b 44 90 0c mov 0xc(%eax,%edx,4),%eax
80101b3a: 89 45 ec mov %eax,-0x14(%ebp)
80101b3d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80101b41: 75 20 jne 80101b63 <bmap+0x43>
ip->addrs[bn] = addr = balloc(ip->dev);
80101b43: 8b 5d 0c mov 0xc(%ebp),%ebx
80101b46: 8b 45 08 mov 0x8(%ebp),%eax
80101b49: 8b 00 mov (%eax),%eax
80101b4b: 89 04 24 mov %eax,(%esp)
80101b4e: e8 38 f8 ff ff call 8010138b <balloc>
80101b53: 89 45 ec mov %eax,-0x14(%ebp)
80101b56: 8b 45 08 mov 0x8(%ebp),%eax
80101b59: 8d 4b 04 lea 0x4(%ebx),%ecx
80101b5c: 8b 55 ec mov -0x14(%ebp),%edx
80101b5f: 89 54 88 0c mov %edx,0xc(%eax,%ecx,4)
return addr;
80101b63: 8b 45 ec mov -0x14(%ebp),%eax
80101b66: e9 b1 00 00 00 jmp 80101c1c <bmap+0xfc>
}
bn -= NDIRECT;
80101b6b: 83 6d 0c 0c subl $0xc,0xc(%ebp)
if(bn < NINDIRECT){
80101b6f: 83 7d 0c 7f cmpl $0x7f,0xc(%ebp)
80101b73: 0f 87 97 00 00 00 ja 80101c10 <bmap+0xf0>
// Load indirect block, allocating if necessary.
if((addr = ip->addrs[NDIRECT]) == 0)
80101b79: 8b 45 08 mov 0x8(%ebp),%eax
80101b7c: 8b 40 4c mov 0x4c(%eax),%eax
80101b7f: 89 45 ec mov %eax,-0x14(%ebp)
80101b82: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80101b86: 75 19 jne 80101ba1 <bmap+0x81>
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
80101b88: 8b 45 08 mov 0x8(%ebp),%eax
80101b8b: 8b 00 mov (%eax),%eax
80101b8d: 89 04 24 mov %eax,(%esp)
80101b90: e8 f6 f7 ff ff call 8010138b <balloc>
80101b95: 89 45 ec mov %eax,-0x14(%ebp)
80101b98: 8b 45 08 mov 0x8(%ebp),%eax
80101b9b: 8b 55 ec mov -0x14(%ebp),%edx
80101b9e: 89 50 4c mov %edx,0x4c(%eax)
bp = bread(ip->dev, addr);
80101ba1: 8b 45 08 mov 0x8(%ebp),%eax
80101ba4: 8b 00 mov (%eax),%eax
80101ba6: 8b 55 ec mov -0x14(%ebp),%edx
80101ba9: 89 54 24 04 mov %edx,0x4(%esp)
80101bad: 89 04 24 mov %eax,(%esp)
80101bb0: e8 f2 e5 ff ff call 801001a7 <bread>
80101bb5: 89 45 f4 mov %eax,-0xc(%ebp)
a = (uint*)bp->data;
80101bb8: 8b 45 f4 mov -0xc(%ebp),%eax
80101bbb: 83 c0 18 add $0x18,%eax
80101bbe: 89 45 f0 mov %eax,-0x10(%ebp)
if((addr = a[bn]) == 0){
80101bc1: 8b 45 0c mov 0xc(%ebp),%eax
80101bc4: c1 e0 02 shl $0x2,%eax
80101bc7: 03 45 f0 add -0x10(%ebp),%eax
80101bca: 8b 00 mov (%eax),%eax
80101bcc: 89 45 ec mov %eax,-0x14(%ebp)
80101bcf: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80101bd3: 75 2b jne 80101c00 <bmap+0xe0>
a[bn] = addr = balloc(ip->dev);
80101bd5: 8b 45 0c mov 0xc(%ebp),%eax
80101bd8: c1 e0 02 shl $0x2,%eax
80101bdb: 89 c3 mov %eax,%ebx
80101bdd: 03 5d f0 add -0x10(%ebp),%ebx
80101be0: 8b 45 08 mov 0x8(%ebp),%eax
80101be3: 8b 00 mov (%eax),%eax
80101be5: 89 04 24 mov %eax,(%esp)
80101be8: e8 9e f7 ff ff call 8010138b <balloc>
80101bed: 89 45 ec mov %eax,-0x14(%ebp)
80101bf0: 8b 45 ec mov -0x14(%ebp),%eax
80101bf3: 89 03 mov %eax,(%ebx)
log_write(bp);
80101bf5: 8b 45 f4 mov -0xc(%ebp),%eax
80101bf8: 89 04 24 mov %eax,(%esp)
80101bfb: e8 b3 16 00 00 call 801032b3 <log_write>
}
brelse(bp);
80101c00: 8b 45 f4 mov -0xc(%ebp),%eax
80101c03: 89 04 24 mov %eax,(%esp)
80101c06: e8 0d e6 ff ff call 80100218 <brelse>
return addr;
80101c0b: 8b 45 ec mov -0x14(%ebp),%eax
80101c0e: eb 0c jmp 80101c1c <bmap+0xfc>
}
panic("bmap: out of range");
80101c10: c7 04 24 0a 87 10 80 movl $0x8010870a,(%esp)
80101c17: e8 1e e9 ff ff call 8010053a <panic>
}
80101c1c: 83 c4 24 add $0x24,%esp
80101c1f: 5b pop %ebx
80101c20: 5d pop %ebp
80101c21: c3 ret
80101c22 <itrunc>:
// to it (no directory entries referring to it)
// and has no in-memory reference to it (is
// not an open file or current directory).
static void
itrunc(struct inode *ip)
{
80101c22: 55 push %ebp
80101c23: 89 e5 mov %esp,%ebp
80101c25: 83 ec 28 sub $0x28,%esp
int i, j;
struct buf *bp;
uint *a;
for(i = 0; i < NDIRECT; i++){
80101c28: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp)
80101c2f: eb 44 jmp 80101c75 <itrunc+0x53>
if(ip->addrs[i]){
80101c31: 8b 55 e8 mov -0x18(%ebp),%edx
80101c34: 8b 45 08 mov 0x8(%ebp),%eax
80101c37: 83 c2 04 add $0x4,%edx
80101c3a: 8b 44 90 0c mov 0xc(%eax,%edx,4),%eax
80101c3e: 85 c0 test %eax,%eax
80101c40: 74 2f je 80101c71 <itrunc+0x4f>
bfree(ip->dev, ip->addrs[i]);
80101c42: 8b 55 e8 mov -0x18(%ebp),%edx
80101c45: 8b 45 08 mov 0x8(%ebp),%eax
80101c48: 83 c2 04 add $0x4,%edx
80101c4b: 8b 54 90 0c mov 0xc(%eax,%edx,4),%edx
80101c4f: 8b 45 08 mov 0x8(%ebp),%eax
80101c52: 8b 00 mov (%eax),%eax
80101c54: 89 54 24 04 mov %edx,0x4(%esp)
80101c58: 89 04 24 mov %eax,(%esp)
80101c5b: e8 86 f8 ff ff call 801014e6 <bfree>
ip->addrs[i] = 0;
80101c60: 8b 55 e8 mov -0x18(%ebp),%edx
80101c63: 8b 45 08 mov 0x8(%ebp),%eax
80101c66: 83 c2 04 add $0x4,%edx
80101c69: c7 44 90 0c 00 00 00 movl $0x0,0xc(%eax,%edx,4)
80101c70: 00
{
int i, j;
struct buf *bp;
uint *a;
for(i = 0; i < NDIRECT; i++){
80101c71: 83 45 e8 01 addl $0x1,-0x18(%ebp)
80101c75: 83 7d e8 0b cmpl $0xb,-0x18(%ebp)
80101c79: 7e b6 jle 80101c31 <itrunc+0xf>
bfree(ip->dev, ip->addrs[i]);
ip->addrs[i] = 0;
}
}
if(ip->addrs[NDIRECT]){
80101c7b: 8b 45 08 mov 0x8(%ebp),%eax
80101c7e: 8b 40 4c mov 0x4c(%eax),%eax
80101c81: 85 c0 test %eax,%eax
80101c83: 0f 84 8f 00 00 00 je 80101d18 <itrunc+0xf6>
bp = bread(ip->dev, ip->addrs[NDIRECT]);
80101c89: 8b 45 08 mov 0x8(%ebp),%eax
80101c8c: 8b 50 4c mov 0x4c(%eax),%edx
80101c8f: 8b 45 08 mov 0x8(%ebp),%eax
80101c92: 8b 00 mov (%eax),%eax
80101c94: 89 54 24 04 mov %edx,0x4(%esp)
80101c98: 89 04 24 mov %eax,(%esp)
80101c9b: e8 07 e5 ff ff call 801001a7 <bread>
80101ca0: 89 45 f0 mov %eax,-0x10(%ebp)
a = (uint*)bp->data;
80101ca3: 8b 45 f0 mov -0x10(%ebp),%eax
80101ca6: 83 c0 18 add $0x18,%eax
80101ca9: 89 45 f4 mov %eax,-0xc(%ebp)
for(j = 0; j < NINDIRECT; j++){
80101cac: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80101cb3: eb 2f jmp 80101ce4 <itrunc+0xc2>
if(a[j])
80101cb5: 8b 45 ec mov -0x14(%ebp),%eax
80101cb8: c1 e0 02 shl $0x2,%eax
80101cbb: 03 45 f4 add -0xc(%ebp),%eax
80101cbe: 8b 00 mov (%eax),%eax
80101cc0: 85 c0 test %eax,%eax
80101cc2: 74 1c je 80101ce0 <itrunc+0xbe>
bfree(ip->dev, a[j]);
80101cc4: 8b 45 ec mov -0x14(%ebp),%eax
80101cc7: c1 e0 02 shl $0x2,%eax
80101cca: 03 45 f4 add -0xc(%ebp),%eax
80101ccd: 8b 10 mov (%eax),%edx
80101ccf: 8b 45 08 mov 0x8(%ebp),%eax
80101cd2: 8b 00 mov (%eax),%eax
80101cd4: 89 54 24 04 mov %edx,0x4(%esp)
80101cd8: 89 04 24 mov %eax,(%esp)
80101cdb: e8 06 f8 ff ff call 801014e6 <bfree>
}
if(ip->addrs[NDIRECT]){
bp = bread(ip->dev, ip->addrs[NDIRECT]);
a = (uint*)bp->data;
for(j = 0; j < NINDIRECT; j++){
80101ce0: 83 45 ec 01 addl $0x1,-0x14(%ebp)
80101ce4: 8b 45 ec mov -0x14(%ebp),%eax
80101ce7: 83 f8 7f cmp $0x7f,%eax
80101cea: 76 c9 jbe 80101cb5 <itrunc+0x93>
if(a[j])
bfree(ip->dev, a[j]);
}
brelse(bp);
80101cec: 8b 45 f0 mov -0x10(%ebp),%eax
80101cef: 89 04 24 mov %eax,(%esp)
80101cf2: e8 21 e5 ff ff call 80100218 <brelse>
bfree(ip->dev, ip->addrs[NDIRECT]);
80101cf7: 8b 45 08 mov 0x8(%ebp),%eax
80101cfa: 8b 50 4c mov 0x4c(%eax),%edx
80101cfd: 8b 45 08 mov 0x8(%ebp),%eax
80101d00: 8b 00 mov (%eax),%eax
80101d02: 89 54 24 04 mov %edx,0x4(%esp)
80101d06: 89 04 24 mov %eax,(%esp)
80101d09: e8 d8 f7 ff ff call 801014e6 <bfree>
ip->addrs[NDIRECT] = 0;
80101d0e: 8b 45 08 mov 0x8(%ebp),%eax
80101d11: c7 40 4c 00 00 00 00 movl $0x0,0x4c(%eax)
}
ip->size = 0;
80101d18: 8b 45 08 mov 0x8(%ebp),%eax
80101d1b: c7 40 18 00 00 00 00 movl $0x0,0x18(%eax)
iupdate(ip);
80101d22: 8b 45 08 mov 0x8(%ebp),%eax
80101d25: 89 04 24 mov %eax,(%esp)
80101d28: e8 8e f9 ff ff call 801016bb <iupdate>
}
80101d2d: c9 leave
80101d2e: c3 ret
80101d2f <stati>:
// Copy stat information from inode.
void
stati(struct inode *ip, struct stat *st)
{
80101d2f: 55 push %ebp
80101d30: 89 e5 mov %esp,%ebp
st->dev = ip->dev;
80101d32: 8b 45 08 mov 0x8(%ebp),%eax
80101d35: 8b 00 mov (%eax),%eax
80101d37: 89 c2 mov %eax,%edx
80101d39: 8b 45 0c mov 0xc(%ebp),%eax
80101d3c: 89 50 04 mov %edx,0x4(%eax)
st->ino = ip->inum;
80101d3f: 8b 45 08 mov 0x8(%ebp),%eax
80101d42: 8b 50 04 mov 0x4(%eax),%edx
80101d45: 8b 45 0c mov 0xc(%ebp),%eax
80101d48: 89 50 08 mov %edx,0x8(%eax)
st->type = ip->type;
80101d4b: 8b 45 08 mov 0x8(%ebp),%eax
80101d4e: 0f b7 50 10 movzwl 0x10(%eax),%edx
80101d52: 8b 45 0c mov 0xc(%ebp),%eax
80101d55: 66 89 10 mov %dx,(%eax)
st->nlink = ip->nlink;
80101d58: 8b 45 08 mov 0x8(%ebp),%eax
80101d5b: 0f b7 50 16 movzwl 0x16(%eax),%edx
80101d5f: 8b 45 0c mov 0xc(%ebp),%eax
80101d62: 66 89 50 0c mov %dx,0xc(%eax)
st->size = ip->size;
80101d66: 8b 45 08 mov 0x8(%ebp),%eax
80101d69: 8b 50 18 mov 0x18(%eax),%edx
80101d6c: 8b 45 0c mov 0xc(%ebp),%eax
80101d6f: 89 50 10 mov %edx,0x10(%eax)
}
80101d72: 5d pop %ebp
80101d73: c3 ret
80101d74 <readi>:
//PAGEBREAK!
// Read data from inode.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
80101d74: 55 push %ebp
80101d75: 89 e5 mov %esp,%ebp
80101d77: 53 push %ebx
80101d78: 83 ec 24 sub $0x24,%esp
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101d7b: 8b 45 08 mov 0x8(%ebp),%eax
80101d7e: 0f b7 40 10 movzwl 0x10(%eax),%eax
80101d82: 66 83 f8 03 cmp $0x3,%ax
80101d86: 75 60 jne 80101de8 <readi+0x74>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
80101d88: 8b 45 08 mov 0x8(%ebp),%eax
80101d8b: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101d8f: 66 85 c0 test %ax,%ax
80101d92: 78 20 js 80101db4 <readi+0x40>
80101d94: 8b 45 08 mov 0x8(%ebp),%eax
80101d97: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101d9b: 66 83 f8 09 cmp $0x9,%ax
80101d9f: 7f 13 jg 80101db4 <readi+0x40>
80101da1: 8b 45 08 mov 0x8(%ebp),%eax
80101da4: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101da8: 98 cwtl
80101da9: 8b 04 c5 20 e8 10 80 mov -0x7fef17e0(,%eax,8),%eax
80101db0: 85 c0 test %eax,%eax
80101db2: 75 0a jne 80101dbe <readi+0x4a>
return -1;
80101db4: b8 ff ff ff ff mov $0xffffffff,%eax
80101db9: e9 1c 01 00 00 jmp 80101eda <readi+0x166>
return devsw[ip->major].read(ip, dst, n);
80101dbe: 8b 45 08 mov 0x8(%ebp),%eax
80101dc1: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101dc5: 98 cwtl
80101dc6: 8b 14 c5 20 e8 10 80 mov -0x7fef17e0(,%eax,8),%edx
80101dcd: 8b 45 14 mov 0x14(%ebp),%eax
80101dd0: 89 44 24 08 mov %eax,0x8(%esp)
80101dd4: 8b 45 0c mov 0xc(%ebp),%eax
80101dd7: 89 44 24 04 mov %eax,0x4(%esp)
80101ddb: 8b 45 08 mov 0x8(%ebp),%eax
80101dde: 89 04 24 mov %eax,(%esp)
80101de1: ff d2 call *%edx
80101de3: e9 f2 00 00 00 jmp 80101eda <readi+0x166>
}
if(off > ip->size || off + n < off)
80101de8: 8b 45 08 mov 0x8(%ebp),%eax
80101deb: 8b 40 18 mov 0x18(%eax),%eax
80101dee: 3b 45 10 cmp 0x10(%ebp),%eax
80101df1: 72 0e jb 80101e01 <readi+0x8d>
80101df3: 8b 45 14 mov 0x14(%ebp),%eax
80101df6: 8b 55 10 mov 0x10(%ebp),%edx
80101df9: 8d 04 02 lea (%edx,%eax,1),%eax
80101dfc: 3b 45 10 cmp 0x10(%ebp),%eax
80101dff: 73 0a jae 80101e0b <readi+0x97>
return -1;
80101e01: b8 ff ff ff ff mov $0xffffffff,%eax
80101e06: e9 cf 00 00 00 jmp 80101eda <readi+0x166>
if(off + n > ip->size)
80101e0b: 8b 45 14 mov 0x14(%ebp),%eax
80101e0e: 8b 55 10 mov 0x10(%ebp),%edx
80101e11: 01 c2 add %eax,%edx
80101e13: 8b 45 08 mov 0x8(%ebp),%eax
80101e16: 8b 40 18 mov 0x18(%eax),%eax
80101e19: 39 c2 cmp %eax,%edx
80101e1b: 76 0c jbe 80101e29 <readi+0xb5>
n = ip->size - off;
80101e1d: 8b 45 08 mov 0x8(%ebp),%eax
80101e20: 8b 40 18 mov 0x18(%eax),%eax
80101e23: 2b 45 10 sub 0x10(%ebp),%eax
80101e26: 89 45 14 mov %eax,0x14(%ebp)
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101e29: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80101e30: e9 96 00 00 00 jmp 80101ecb <readi+0x157>
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101e35: 8b 45 10 mov 0x10(%ebp),%eax
80101e38: c1 e8 09 shr $0x9,%eax
80101e3b: 89 44 24 04 mov %eax,0x4(%esp)
80101e3f: 8b 45 08 mov 0x8(%ebp),%eax
80101e42: 89 04 24 mov %eax,(%esp)
80101e45: e8 d6 fc ff ff call 80101b20 <bmap>
80101e4a: 8b 55 08 mov 0x8(%ebp),%edx
80101e4d: 8b 12 mov (%edx),%edx
80101e4f: 89 44 24 04 mov %eax,0x4(%esp)
80101e53: 89 14 24 mov %edx,(%esp)
80101e56: e8 4c e3 ff ff call 801001a7 <bread>
80101e5b: 89 45 f4 mov %eax,-0xc(%ebp)
m = min(n - tot, BSIZE - off%BSIZE);
80101e5e: 8b 45 10 mov 0x10(%ebp),%eax
80101e61: 89 c2 mov %eax,%edx
80101e63: 81 e2 ff 01 00 00 and $0x1ff,%edx
80101e69: b8 00 02 00 00 mov $0x200,%eax
80101e6e: 89 c1 mov %eax,%ecx
80101e70: 29 d1 sub %edx,%ecx
80101e72: 89 ca mov %ecx,%edx
80101e74: 8b 45 ec mov -0x14(%ebp),%eax
80101e77: 8b 4d 14 mov 0x14(%ebp),%ecx
80101e7a: 89 cb mov %ecx,%ebx
80101e7c: 29 c3 sub %eax,%ebx
80101e7e: 89 d8 mov %ebx,%eax
80101e80: 39 c2 cmp %eax,%edx
80101e82: 0f 46 c2 cmovbe %edx,%eax
80101e85: 89 45 f0 mov %eax,-0x10(%ebp)
memmove(dst, bp->data + off%BSIZE, m);
80101e88: 8b 45 f4 mov -0xc(%ebp),%eax
80101e8b: 8d 50 18 lea 0x18(%eax),%edx
80101e8e: 8b 45 10 mov 0x10(%ebp),%eax
80101e91: 25 ff 01 00 00 and $0x1ff,%eax
80101e96: 01 c2 add %eax,%edx
80101e98: 8b 45 f0 mov -0x10(%ebp),%eax
80101e9b: 89 44 24 08 mov %eax,0x8(%esp)
80101e9f: 89 54 24 04 mov %edx,0x4(%esp)
80101ea3: 8b 45 0c mov 0xc(%ebp),%eax
80101ea6: 89 04 24 mov %eax,(%esp)
80101ea9: e8 c3 33 00 00 call 80105271 <memmove>
brelse(bp);
80101eae: 8b 45 f4 mov -0xc(%ebp),%eax
80101eb1: 89 04 24 mov %eax,(%esp)
80101eb4: e8 5f e3 ff ff call 80100218 <brelse>
if(off > ip->size || off + n < off)
return -1;
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101eb9: 8b 45 f0 mov -0x10(%ebp),%eax
80101ebc: 01 45 ec add %eax,-0x14(%ebp)
80101ebf: 8b 45 f0 mov -0x10(%ebp),%eax
80101ec2: 01 45 10 add %eax,0x10(%ebp)
80101ec5: 8b 45 f0 mov -0x10(%ebp),%eax
80101ec8: 01 45 0c add %eax,0xc(%ebp)
80101ecb: 8b 45 ec mov -0x14(%ebp),%eax
80101ece: 3b 45 14 cmp 0x14(%ebp),%eax
80101ed1: 0f 82 5e ff ff ff jb 80101e35 <readi+0xc1>
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
memmove(dst, bp->data + off%BSIZE, m);
brelse(bp);
}
return n;
80101ed7: 8b 45 14 mov 0x14(%ebp),%eax
}
80101eda: 83 c4 24 add $0x24,%esp
80101edd: 5b pop %ebx
80101ede: 5d pop %ebp
80101edf: c3 ret
80101ee0 <writei>:
// PAGEBREAK!
// Write data to inode.
int
writei(struct inode *ip, char *src, uint off, uint n)
{
80101ee0: 55 push %ebp
80101ee1: 89 e5 mov %esp,%ebp
80101ee3: 53 push %ebx
80101ee4: 83 ec 24 sub $0x24,%esp
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101ee7: 8b 45 08 mov 0x8(%ebp),%eax
80101eea: 0f b7 40 10 movzwl 0x10(%eax),%eax
80101eee: 66 83 f8 03 cmp $0x3,%ax
80101ef2: 75 60 jne 80101f54 <writei+0x74>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
80101ef4: 8b 45 08 mov 0x8(%ebp),%eax
80101ef7: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101efb: 66 85 c0 test %ax,%ax
80101efe: 78 20 js 80101f20 <writei+0x40>
80101f00: 8b 45 08 mov 0x8(%ebp),%eax
80101f03: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101f07: 66 83 f8 09 cmp $0x9,%ax
80101f0b: 7f 13 jg 80101f20 <writei+0x40>
80101f0d: 8b 45 08 mov 0x8(%ebp),%eax
80101f10: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101f14: 98 cwtl
80101f15: 8b 04 c5 24 e8 10 80 mov -0x7fef17dc(,%eax,8),%eax
80101f1c: 85 c0 test %eax,%eax
80101f1e: 75 0a jne 80101f2a <writei+0x4a>
return -1;
80101f20: b8 ff ff ff ff mov $0xffffffff,%eax
80101f25: e9 48 01 00 00 jmp 80102072 <writei+0x192>
return devsw[ip->major].write(ip, src, n);
80101f2a: 8b 45 08 mov 0x8(%ebp),%eax
80101f2d: 0f b7 40 12 movzwl 0x12(%eax),%eax
80101f31: 98 cwtl
80101f32: 8b 14 c5 24 e8 10 80 mov -0x7fef17dc(,%eax,8),%edx
80101f39: 8b 45 14 mov 0x14(%ebp),%eax
80101f3c: 89 44 24 08 mov %eax,0x8(%esp)
80101f40: 8b 45 0c mov 0xc(%ebp),%eax
80101f43: 89 44 24 04 mov %eax,0x4(%esp)
80101f47: 8b 45 08 mov 0x8(%ebp),%eax
80101f4a: 89 04 24 mov %eax,(%esp)
80101f4d: ff d2 call *%edx
80101f4f: e9 1e 01 00 00 jmp 80102072 <writei+0x192>
}
if(off > ip->size || off + n < off)
80101f54: 8b 45 08 mov 0x8(%ebp),%eax
80101f57: 8b 40 18 mov 0x18(%eax),%eax
80101f5a: 3b 45 10 cmp 0x10(%ebp),%eax
80101f5d: 72 0e jb 80101f6d <writei+0x8d>
80101f5f: 8b 45 14 mov 0x14(%ebp),%eax
80101f62: 8b 55 10 mov 0x10(%ebp),%edx
80101f65: 8d 04 02 lea (%edx,%eax,1),%eax
80101f68: 3b 45 10 cmp 0x10(%ebp),%eax
80101f6b: 73 0a jae 80101f77 <writei+0x97>
return -1;
80101f6d: b8 ff ff ff ff mov $0xffffffff,%eax
80101f72: e9 fb 00 00 00 jmp 80102072 <writei+0x192>
if(off + n > MAXFILE*BSIZE)
80101f77: 8b 45 14 mov 0x14(%ebp),%eax
80101f7a: 8b 55 10 mov 0x10(%ebp),%edx
80101f7d: 8d 04 02 lea (%edx,%eax,1),%eax
80101f80: 3d 00 18 01 00 cmp $0x11800,%eax
80101f85: 76 0a jbe 80101f91 <writei+0xb1>
return -1;
80101f87: b8 ff ff ff ff mov $0xffffffff,%eax
80101f8c: e9 e1 00 00 00 jmp 80102072 <writei+0x192>
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101f91: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80101f98: e9 a1 00 00 00 jmp 8010203e <writei+0x15e>
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101f9d: 8b 45 10 mov 0x10(%ebp),%eax
80101fa0: c1 e8 09 shr $0x9,%eax
80101fa3: 89 44 24 04 mov %eax,0x4(%esp)
80101fa7: 8b 45 08 mov 0x8(%ebp),%eax
80101faa: 89 04 24 mov %eax,(%esp)
80101fad: e8 6e fb ff ff call 80101b20 <bmap>
80101fb2: 8b 55 08 mov 0x8(%ebp),%edx
80101fb5: 8b 12 mov (%edx),%edx
80101fb7: 89 44 24 04 mov %eax,0x4(%esp)
80101fbb: 89 14 24 mov %edx,(%esp)
80101fbe: e8 e4 e1 ff ff call 801001a7 <bread>
80101fc3: 89 45 f4 mov %eax,-0xc(%ebp)
m = min(n - tot, BSIZE - off%BSIZE);
80101fc6: 8b 45 10 mov 0x10(%ebp),%eax
80101fc9: 89 c2 mov %eax,%edx
80101fcb: 81 e2 ff 01 00 00 and $0x1ff,%edx
80101fd1: b8 00 02 00 00 mov $0x200,%eax
80101fd6: 89 c1 mov %eax,%ecx
80101fd8: 29 d1 sub %edx,%ecx
80101fda: 89 ca mov %ecx,%edx
80101fdc: 8b 45 ec mov -0x14(%ebp),%eax
80101fdf: 8b 4d 14 mov 0x14(%ebp),%ecx
80101fe2: 89 cb mov %ecx,%ebx
80101fe4: 29 c3 sub %eax,%ebx
80101fe6: 89 d8 mov %ebx,%eax
80101fe8: 39 c2 cmp %eax,%edx
80101fea: 0f 46 c2 cmovbe %edx,%eax
80101fed: 89 45 f0 mov %eax,-0x10(%ebp)
memmove(bp->data + off%BSIZE, src, m);
80101ff0: 8b 45 f4 mov -0xc(%ebp),%eax
80101ff3: 8d 50 18 lea 0x18(%eax),%edx
80101ff6: 8b 45 10 mov 0x10(%ebp),%eax
80101ff9: 25 ff 01 00 00 and $0x1ff,%eax
80101ffe: 01 c2 add %eax,%edx
80102000: 8b 45 f0 mov -0x10(%ebp),%eax
80102003: 89 44 24 08 mov %eax,0x8(%esp)
80102007: 8b 45 0c mov 0xc(%ebp),%eax
8010200a: 89 44 24 04 mov %eax,0x4(%esp)
8010200e: 89 14 24 mov %edx,(%esp)
80102011: e8 5b 32 00 00 call 80105271 <memmove>
log_write(bp);
80102016: 8b 45 f4 mov -0xc(%ebp),%eax
80102019: 89 04 24 mov %eax,(%esp)
8010201c: e8 92 12 00 00 call 801032b3 <log_write>
brelse(bp);
80102021: 8b 45 f4 mov -0xc(%ebp),%eax
80102024: 89 04 24 mov %eax,(%esp)
80102027: e8 ec e1 ff ff call 80100218 <brelse>
if(off > ip->size || off + n < off)
return -1;
if(off + n > MAXFILE*BSIZE)
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
8010202c: 8b 45 f0 mov -0x10(%ebp),%eax
8010202f: 01 45 ec add %eax,-0x14(%ebp)
80102032: 8b 45 f0 mov -0x10(%ebp),%eax
80102035: 01 45 10 add %eax,0x10(%ebp)
80102038: 8b 45 f0 mov -0x10(%ebp),%eax
8010203b: 01 45 0c add %eax,0xc(%ebp)
8010203e: 8b 45 ec mov -0x14(%ebp),%eax
80102041: 3b 45 14 cmp 0x14(%ebp),%eax
80102044: 0f 82 53 ff ff ff jb 80101f9d <writei+0xbd>
memmove(bp->data + off%BSIZE, src, m);
log_write(bp);
brelse(bp);
}
if(n > 0 && off > ip->size){
8010204a: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
8010204e: 74 1f je 8010206f <writei+0x18f>
80102050: 8b 45 08 mov 0x8(%ebp),%eax
80102053: 8b 40 18 mov 0x18(%eax),%eax
80102056: 3b 45 10 cmp 0x10(%ebp),%eax
80102059: 73 14 jae 8010206f <writei+0x18f>
ip->size = off;
8010205b: 8b 45 08 mov 0x8(%ebp),%eax
8010205e: 8b 55 10 mov 0x10(%ebp),%edx
80102061: 89 50 18 mov %edx,0x18(%eax)
iupdate(ip);
80102064: 8b 45 08 mov 0x8(%ebp),%eax
80102067: 89 04 24 mov %eax,(%esp)
8010206a: e8 4c f6 ff ff call 801016bb <iupdate>
}
return n;
8010206f: 8b 45 14 mov 0x14(%ebp),%eax
}
80102072: 83 c4 24 add $0x24,%esp
80102075: 5b pop %ebx
80102076: 5d pop %ebp
80102077: c3 ret
80102078 <namecmp>:
//PAGEBREAK!
// Directories
int
namecmp(const char *s, const char *t)
{
80102078: 55 push %ebp
80102079: 89 e5 mov %esp,%ebp
8010207b: 83 ec 18 sub $0x18,%esp
return strncmp(s, t, DIRSIZ);
8010207e: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80102085: 00
80102086: 8b 45 0c mov 0xc(%ebp),%eax
80102089: 89 44 24 04 mov %eax,0x4(%esp)
8010208d: 8b 45 08 mov 0x8(%ebp),%eax
80102090: 89 04 24 mov %eax,(%esp)
80102093: e8 81 32 00 00 call 80105319 <strncmp>
}
80102098: c9 leave
80102099: c3 ret
8010209a <dirlookup>:
// Look for a directory entry in a directory.
// If found, set *poff to byte offset of entry.
struct inode*
dirlookup(struct inode *dp, char *name, uint *poff)
{
8010209a: 55 push %ebp
8010209b: 89 e5 mov %esp,%ebp
8010209d: 83 ec 38 sub $0x38,%esp
uint off, inum;
struct dirent de;
if(dp->type != T_DIR)
801020a0: 8b 45 08 mov 0x8(%ebp),%eax
801020a3: 0f b7 40 10 movzwl 0x10(%eax),%eax
801020a7: 66 83 f8 01 cmp $0x1,%ax
801020ab: 74 0c je 801020b9 <dirlookup+0x1f>
panic("dirlookup not DIR");
801020ad: c7 04 24 1d 87 10 80 movl $0x8010871d,(%esp)
801020b4: e8 81 e4 ff ff call 8010053a <panic>
for(off = 0; off < dp->size; off += sizeof(de)){
801020b9: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
801020c0: e9 87 00 00 00 jmp 8010214c <dirlookup+0xb2>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
801020c5: 8d 45 e0 lea -0x20(%ebp),%eax
801020c8: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
801020cf: 00
801020d0: 8b 55 f0 mov -0x10(%ebp),%edx
801020d3: 89 54 24 08 mov %edx,0x8(%esp)
801020d7: 89 44 24 04 mov %eax,0x4(%esp)
801020db: 8b 45 08 mov 0x8(%ebp),%eax
801020de: 89 04 24 mov %eax,(%esp)
801020e1: e8 8e fc ff ff call 80101d74 <readi>
801020e6: 83 f8 10 cmp $0x10,%eax
801020e9: 74 0c je 801020f7 <dirlookup+0x5d>
panic("dirlink read");
801020eb: c7 04 24 2f 87 10 80 movl $0x8010872f,(%esp)
801020f2: e8 43 e4 ff ff call 8010053a <panic>
if(de.inum == 0)
801020f7: 0f b7 45 e0 movzwl -0x20(%ebp),%eax
801020fb: 66 85 c0 test %ax,%ax
801020fe: 74 47 je 80102147 <dirlookup+0xad>
continue;
if(namecmp(name, de.name) == 0){
80102100: 8d 45 e0 lea -0x20(%ebp),%eax
80102103: 83 c0 02 add $0x2,%eax
80102106: 89 44 24 04 mov %eax,0x4(%esp)
8010210a: 8b 45 0c mov 0xc(%ebp),%eax
8010210d: 89 04 24 mov %eax,(%esp)
80102110: e8 63 ff ff ff call 80102078 <namecmp>
80102115: 85 c0 test %eax,%eax
80102117: 75 2f jne 80102148 <dirlookup+0xae>
// entry matches path element
if(poff)
80102119: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010211d: 74 08 je 80102127 <dirlookup+0x8d>
*poff = off;
8010211f: 8b 45 10 mov 0x10(%ebp),%eax
80102122: 8b 55 f0 mov -0x10(%ebp),%edx
80102125: 89 10 mov %edx,(%eax)
inum = de.inum;
80102127: 0f b7 45 e0 movzwl -0x20(%ebp),%eax
8010212b: 0f b7 c0 movzwl %ax,%eax
8010212e: 89 45 f4 mov %eax,-0xc(%ebp)
return iget(dp->dev, inum);
80102131: 8b 45 08 mov 0x8(%ebp),%eax
80102134: 8b 00 mov (%eax),%eax
80102136: 8b 55 f4 mov -0xc(%ebp),%edx
80102139: 89 54 24 04 mov %edx,0x4(%esp)
8010213d: 89 04 24 mov %eax,(%esp)
80102140: e8 31 f6 ff ff call 80101776 <iget>
80102145: eb 19 jmp 80102160 <dirlookup+0xc6>
for(off = 0; off < dp->size; off += sizeof(de)){
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlink read");
if(de.inum == 0)
continue;
80102147: 90 nop
struct dirent de;
if(dp->type != T_DIR)
panic("dirlookup not DIR");
for(off = 0; off < dp->size; off += sizeof(de)){
80102148: 83 45 f0 10 addl $0x10,-0x10(%ebp)
8010214c: 8b 45 08 mov 0x8(%ebp),%eax
8010214f: 8b 40 18 mov 0x18(%eax),%eax
80102152: 3b 45 f0 cmp -0x10(%ebp),%eax
80102155: 0f 87 6a ff ff ff ja 801020c5 <dirlookup+0x2b>
inum = de.inum;
return iget(dp->dev, inum);
}
}
return 0;
8010215b: b8 00 00 00 00 mov $0x0,%eax
}
80102160: c9 leave
80102161: c3 ret
80102162 <dirlink>:
// Write a new directory entry (name, inum) into the directory dp.
int
dirlink(struct inode *dp, char *name, uint inum)
{
80102162: 55 push %ebp
80102163: 89 e5 mov %esp,%ebp
80102165: 83 ec 38 sub $0x38,%esp
int off;
struct dirent de;
struct inode *ip;
// Check that name is not present.
if((ip = dirlookup(dp, name, 0)) != 0){
80102168: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
8010216f: 00
80102170: 8b 45 0c mov 0xc(%ebp),%eax
80102173: 89 44 24 04 mov %eax,0x4(%esp)
80102177: 8b 45 08 mov 0x8(%ebp),%eax
8010217a: 89 04 24 mov %eax,(%esp)
8010217d: e8 18 ff ff ff call 8010209a <dirlookup>
80102182: 89 45 f4 mov %eax,-0xc(%ebp)
80102185: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80102189: 74 15 je 801021a0 <dirlink+0x3e>
iput(ip);
8010218b: 8b 45 f4 mov -0xc(%ebp),%eax
8010218e: 89 04 24 mov %eax,(%esp)
80102191: e8 9b f8 ff ff call 80101a31 <iput>
return -1;
80102196: b8 ff ff ff ff mov $0xffffffff,%eax
8010219b: e9 b8 00 00 00 jmp 80102258 <dirlink+0xf6>
}
// Look for an empty dirent.
for(off = 0; off < dp->size; off += sizeof(de)){
801021a0: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
801021a7: eb 44 jmp 801021ed <dirlink+0x8b>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
801021a9: 8b 55 f0 mov -0x10(%ebp),%edx
801021ac: 8d 45 e0 lea -0x20(%ebp),%eax
801021af: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
801021b6: 00
801021b7: 89 54 24 08 mov %edx,0x8(%esp)
801021bb: 89 44 24 04 mov %eax,0x4(%esp)
801021bf: 8b 45 08 mov 0x8(%ebp),%eax
801021c2: 89 04 24 mov %eax,(%esp)
801021c5: e8 aa fb ff ff call 80101d74 <readi>
801021ca: 83 f8 10 cmp $0x10,%eax
801021cd: 74 0c je 801021db <dirlink+0x79>
panic("dirlink read");
801021cf: c7 04 24 2f 87 10 80 movl $0x8010872f,(%esp)
801021d6: e8 5f e3 ff ff call 8010053a <panic>
if(de.inum == 0)
801021db: 0f b7 45 e0 movzwl -0x20(%ebp),%eax
801021df: 66 85 c0 test %ax,%ax
801021e2: 74 18 je 801021fc <dirlink+0x9a>
iput(ip);
return -1;
}
// Look for an empty dirent.
for(off = 0; off < dp->size; off += sizeof(de)){
801021e4: 8b 45 f0 mov -0x10(%ebp),%eax
801021e7: 83 c0 10 add $0x10,%eax
801021ea: 89 45 f0 mov %eax,-0x10(%ebp)
801021ed: 8b 55 f0 mov -0x10(%ebp),%edx
801021f0: 8b 45 08 mov 0x8(%ebp),%eax
801021f3: 8b 40 18 mov 0x18(%eax),%eax
801021f6: 39 c2 cmp %eax,%edx
801021f8: 72 af jb 801021a9 <dirlink+0x47>
801021fa: eb 01 jmp 801021fd <dirlink+0x9b>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlink read");
if(de.inum == 0)
break;
801021fc: 90 nop
}
strncpy(de.name, name, DIRSIZ);
801021fd: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
80102204: 00
80102205: 8b 45 0c mov 0xc(%ebp),%eax
80102208: 89 44 24 04 mov %eax,0x4(%esp)
8010220c: 8d 45 e0 lea -0x20(%ebp),%eax
8010220f: 83 c0 02 add $0x2,%eax
80102212: 89 04 24 mov %eax,(%esp)
80102215: e8 57 31 00 00 call 80105371 <strncpy>
de.inum = inum;
8010221a: 8b 45 10 mov 0x10(%ebp),%eax
8010221d: 66 89 45 e0 mov %ax,-0x20(%ebp)
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80102221: 8b 55 f0 mov -0x10(%ebp),%edx
80102224: 8d 45 e0 lea -0x20(%ebp),%eax
80102227: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
8010222e: 00
8010222f: 89 54 24 08 mov %edx,0x8(%esp)
80102233: 89 44 24 04 mov %eax,0x4(%esp)
80102237: 8b 45 08 mov 0x8(%ebp),%eax
8010223a: 89 04 24 mov %eax,(%esp)
8010223d: e8 9e fc ff ff call 80101ee0 <writei>
80102242: 83 f8 10 cmp $0x10,%eax
80102245: 74 0c je 80102253 <dirlink+0xf1>
panic("dirlink");
80102247: c7 04 24 3c 87 10 80 movl $0x8010873c,(%esp)
8010224e: e8 e7 e2 ff ff call 8010053a <panic>
return 0;
80102253: b8 00 00 00 00 mov $0x0,%eax
}
80102258: c9 leave
80102259: c3 ret
8010225a <skipelem>:
// skipelem("a", name) = "", setting name = "a"
// skipelem("", name) = skipelem("////", name) = 0
//
static char*
skipelem(char *path, char *name)
{
8010225a: 55 push %ebp
8010225b: 89 e5 mov %esp,%ebp
8010225d: 83 ec 28 sub $0x28,%esp
char *s;
int len;
while(*path == '/')
80102260: eb 04 jmp 80102266 <skipelem+0xc>
path++;
80102262: 83 45 08 01 addl $0x1,0x8(%ebp)
skipelem(char *path, char *name)
{
char *s;
int len;
while(*path == '/')
80102266: 8b 45 08 mov 0x8(%ebp),%eax
80102269: 0f b6 00 movzbl (%eax),%eax
8010226c: 3c 2f cmp $0x2f,%al
8010226e: 74 f2 je 80102262 <skipelem+0x8>
path++;
if(*path == 0)
80102270: 8b 45 08 mov 0x8(%ebp),%eax
80102273: 0f b6 00 movzbl (%eax),%eax
80102276: 84 c0 test %al,%al
80102278: 75 0a jne 80102284 <skipelem+0x2a>
return 0;
8010227a: b8 00 00 00 00 mov $0x0,%eax
8010227f: e9 86 00 00 00 jmp 8010230a <skipelem+0xb0>
s = path;
80102284: 8b 45 08 mov 0x8(%ebp),%eax
80102287: 89 45 f0 mov %eax,-0x10(%ebp)
while(*path != '/' && *path != 0)
8010228a: eb 04 jmp 80102290 <skipelem+0x36>
path++;
8010228c: 83 45 08 01 addl $0x1,0x8(%ebp)
while(*path == '/')
path++;
if(*path == 0)
return 0;
s = path;
while(*path != '/' && *path != 0)
80102290: 8b 45 08 mov 0x8(%ebp),%eax
80102293: 0f b6 00 movzbl (%eax),%eax
80102296: 3c 2f cmp $0x2f,%al
80102298: 74 0a je 801022a4 <skipelem+0x4a>
8010229a: 8b 45 08 mov 0x8(%ebp),%eax
8010229d: 0f b6 00 movzbl (%eax),%eax
801022a0: 84 c0 test %al,%al
801022a2: 75 e8 jne 8010228c <skipelem+0x32>
path++;
len = path - s;
801022a4: 8b 55 08 mov 0x8(%ebp),%edx
801022a7: 8b 45 f0 mov -0x10(%ebp),%eax
801022aa: 89 d1 mov %edx,%ecx
801022ac: 29 c1 sub %eax,%ecx
801022ae: 89 c8 mov %ecx,%eax
801022b0: 89 45 f4 mov %eax,-0xc(%ebp)
if(len >= DIRSIZ)
801022b3: 83 7d f4 0d cmpl $0xd,-0xc(%ebp)
801022b7: 7e 1c jle 801022d5 <skipelem+0x7b>
memmove(name, s, DIRSIZ);
801022b9: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
801022c0: 00
801022c1: 8b 45 f0 mov -0x10(%ebp),%eax
801022c4: 89 44 24 04 mov %eax,0x4(%esp)
801022c8: 8b 45 0c mov 0xc(%ebp),%eax
801022cb: 89 04 24 mov %eax,(%esp)
801022ce: e8 9e 2f 00 00 call 80105271 <memmove>
else {
memmove(name, s, len);
name[len] = 0;
}
while(*path == '/')
801022d3: eb 28 jmp 801022fd <skipelem+0xa3>
path++;
len = path - s;
if(len >= DIRSIZ)
memmove(name, s, DIRSIZ);
else {
memmove(name, s, len);
801022d5: 8b 45 f4 mov -0xc(%ebp),%eax
801022d8: 89 44 24 08 mov %eax,0x8(%esp)
801022dc: 8b 45 f0 mov -0x10(%ebp),%eax
801022df: 89 44 24 04 mov %eax,0x4(%esp)
801022e3: 8b 45 0c mov 0xc(%ebp),%eax
801022e6: 89 04 24 mov %eax,(%esp)
801022e9: e8 83 2f 00 00 call 80105271 <memmove>
name[len] = 0;
801022ee: 8b 45 f4 mov -0xc(%ebp),%eax
801022f1: 03 45 0c add 0xc(%ebp),%eax
801022f4: c6 00 00 movb $0x0,(%eax)
}
while(*path == '/')
801022f7: eb 04 jmp 801022fd <skipelem+0xa3>
path++;
801022f9: 83 45 08 01 addl $0x1,0x8(%ebp)
memmove(name, s, DIRSIZ);
else {
memmove(name, s, len);
name[len] = 0;
}
while(*path == '/')
801022fd: 8b 45 08 mov 0x8(%ebp),%eax
80102300: 0f b6 00 movzbl (%eax),%eax
80102303: 3c 2f cmp $0x2f,%al
80102305: 74 f2 je 801022f9 <skipelem+0x9f>
path++;
return path;
80102307: 8b 45 08 mov 0x8(%ebp),%eax
}
8010230a: c9 leave
8010230b: c3 ret
8010230c <namex>:
// Look up and return the inode for a path name.
// If parent != 0, return the inode for the parent and copy the final
// path element into name, which must have room for DIRSIZ bytes.
static struct inode*
namex(char *path, int nameiparent, char *name)
{
8010230c: 55 push %ebp
8010230d: 89 e5 mov %esp,%ebp
8010230f: 83 ec 28 sub $0x28,%esp
struct inode *ip, *next;
if(*path == '/')
80102312: 8b 45 08 mov 0x8(%ebp),%eax
80102315: 0f b6 00 movzbl (%eax),%eax
80102318: 3c 2f cmp $0x2f,%al
8010231a: 75 1c jne 80102338 <namex+0x2c>
ip = iget(ROOTDEV, ROOTINO);
8010231c: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80102323: 00
80102324: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010232b: e8 46 f4 ff ff call 80101776 <iget>
80102330: 89 45 f0 mov %eax,-0x10(%ebp)
else
ip = idup(proc->cwd);
while((path = skipelem(path, name)) != 0){
80102333: e9 af 00 00 00 jmp 801023e7 <namex+0xdb>
struct inode *ip, *next;
if(*path == '/')
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(proc->cwd);
80102338: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010233e: 8b 40 68 mov 0x68(%eax),%eax
80102341: 89 04 24 mov %eax,(%esp)
80102344: e8 00 f5 ff ff call 80101849 <idup>
80102349: 89 45 f0 mov %eax,-0x10(%ebp)
while((path = skipelem(path, name)) != 0){
8010234c: e9 96 00 00 00 jmp 801023e7 <namex+0xdb>
ilock(ip);
80102351: 8b 45 f0 mov -0x10(%ebp),%eax
80102354: 89 04 24 mov %eax,(%esp)
80102357: e8 1f f5 ff ff call 8010187b <ilock>
if(ip->type != T_DIR){
8010235c: 8b 45 f0 mov -0x10(%ebp),%eax
8010235f: 0f b7 40 10 movzwl 0x10(%eax),%eax
80102363: 66 83 f8 01 cmp $0x1,%ax
80102367: 74 15 je 8010237e <namex+0x72>
iunlockput(ip);
80102369: 8b 45 f0 mov -0x10(%ebp),%eax
8010236c: 89 04 24 mov %eax,(%esp)
8010236f: e8 8e f7 ff ff call 80101b02 <iunlockput>
return 0;
80102374: b8 00 00 00 00 mov $0x0,%eax
80102379: e9 a3 00 00 00 jmp 80102421 <namex+0x115>
}
if(nameiparent && *path == '\0'){
8010237e: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
80102382: 74 1d je 801023a1 <namex+0x95>
80102384: 8b 45 08 mov 0x8(%ebp),%eax
80102387: 0f b6 00 movzbl (%eax),%eax
8010238a: 84 c0 test %al,%al
8010238c: 75 13 jne 801023a1 <namex+0x95>
// Stop one level early.
iunlock(ip);
8010238e: 8b 45 f0 mov -0x10(%ebp),%eax
80102391: 89 04 24 mov %eax,(%esp)
80102394: e8 33 f6 ff ff call 801019cc <iunlock>
return ip;
80102399: 8b 45 f0 mov -0x10(%ebp),%eax
8010239c: e9 80 00 00 00 jmp 80102421 <namex+0x115>
}
if((next = dirlookup(ip, name, 0)) == 0){
801023a1: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
801023a8: 00
801023a9: 8b 45 10 mov 0x10(%ebp),%eax
801023ac: 89 44 24 04 mov %eax,0x4(%esp)
801023b0: 8b 45 f0 mov -0x10(%ebp),%eax
801023b3: 89 04 24 mov %eax,(%esp)
801023b6: e8 df fc ff ff call 8010209a <dirlookup>
801023bb: 89 45 f4 mov %eax,-0xc(%ebp)
801023be: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801023c2: 75 12 jne 801023d6 <namex+0xca>
iunlockput(ip);
801023c4: 8b 45 f0 mov -0x10(%ebp),%eax
801023c7: 89 04 24 mov %eax,(%esp)
801023ca: e8 33 f7 ff ff call 80101b02 <iunlockput>
return 0;
801023cf: b8 00 00 00 00 mov $0x0,%eax
801023d4: eb 4b jmp 80102421 <namex+0x115>
}
iunlockput(ip);
801023d6: 8b 45 f0 mov -0x10(%ebp),%eax
801023d9: 89 04 24 mov %eax,(%esp)
801023dc: e8 21 f7 ff ff call 80101b02 <iunlockput>
ip = next;
801023e1: 8b 45 f4 mov -0xc(%ebp),%eax
801023e4: 89 45 f0 mov %eax,-0x10(%ebp)
if(*path == '/')
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(proc->cwd);
while((path = skipelem(path, name)) != 0){
801023e7: 8b 45 10 mov 0x10(%ebp),%eax
801023ea: 89 44 24 04 mov %eax,0x4(%esp)
801023ee: 8b 45 08 mov 0x8(%ebp),%eax
801023f1: 89 04 24 mov %eax,(%esp)
801023f4: e8 61 fe ff ff call 8010225a <skipelem>
801023f9: 89 45 08 mov %eax,0x8(%ebp)
801023fc: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
80102400: 0f 85 4b ff ff ff jne 80102351 <namex+0x45>
return 0;
}
iunlockput(ip);
ip = next;
}
if(nameiparent){
80102406: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
8010240a: 74 12 je 8010241e <namex+0x112>
iput(ip);
8010240c: 8b 45 f0 mov -0x10(%ebp),%eax
8010240f: 89 04 24 mov %eax,(%esp)
80102412: e8 1a f6 ff ff call 80101a31 <iput>
return 0;
80102417: b8 00 00 00 00 mov $0x0,%eax
8010241c: eb 03 jmp 80102421 <namex+0x115>
}
return ip;
8010241e: 8b 45 f0 mov -0x10(%ebp),%eax
}
80102421: c9 leave
80102422: c3 ret
80102423 <namei>:
struct inode*
namei(char *path)
{
80102423: 55 push %ebp
80102424: 89 e5 mov %esp,%ebp
80102426: 83 ec 28 sub $0x28,%esp
char name[DIRSIZ];
return namex(path, 0, name);
80102429: 8d 45 ea lea -0x16(%ebp),%eax
8010242c: 89 44 24 08 mov %eax,0x8(%esp)
80102430: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102437: 00
80102438: 8b 45 08 mov 0x8(%ebp),%eax
8010243b: 89 04 24 mov %eax,(%esp)
8010243e: e8 c9 fe ff ff call 8010230c <namex>
}
80102443: c9 leave
80102444: c3 ret
80102445 <nameiparent>:
struct inode*
nameiparent(char *path, char *name)
{
80102445: 55 push %ebp
80102446: 89 e5 mov %esp,%ebp
80102448: 83 ec 18 sub $0x18,%esp
return namex(path, 1, name);
8010244b: 8b 45 0c mov 0xc(%ebp),%eax
8010244e: 89 44 24 08 mov %eax,0x8(%esp)
80102452: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80102459: 00
8010245a: 8b 45 08 mov 0x8(%ebp),%eax
8010245d: 89 04 24 mov %eax,(%esp)
80102460: e8 a7 fe ff ff call 8010230c <namex>
}
80102465: c9 leave
80102466: c3 ret
...
80102468 <inb>:
// Routines to let C code use special x86 instructions.
static inline uchar
inb(ushort port)
{
80102468: 55 push %ebp
80102469: 89 e5 mov %esp,%ebp
8010246b: 83 ec 14 sub $0x14,%esp
8010246e: 8b 45 08 mov 0x8(%ebp),%eax
80102471: 66 89 45 ec mov %ax,-0x14(%ebp)
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102475: 0f b7 45 ec movzwl -0x14(%ebp),%eax
80102479: 89 c2 mov %eax,%edx
8010247b: ec in (%dx),%al
8010247c: 88 45 ff mov %al,-0x1(%ebp)
return data;
8010247f: 0f b6 45 ff movzbl -0x1(%ebp),%eax
}
80102483: c9 leave
80102484: c3 ret
80102485 <insl>:
static inline void
insl(int port, void *addr, int cnt)
{
80102485: 55 push %ebp
80102486: 89 e5 mov %esp,%ebp
80102488: 57 push %edi
80102489: 53 push %ebx
asm volatile("cld; rep insl" :
8010248a: 8b 55 08 mov 0x8(%ebp),%edx
8010248d: 8b 4d 0c mov 0xc(%ebp),%ecx
80102490: 8b 45 10 mov 0x10(%ebp),%eax
80102493: 89 cb mov %ecx,%ebx
80102495: 89 df mov %ebx,%edi
80102497: 89 c1 mov %eax,%ecx
80102499: fc cld
8010249a: f3 6d rep insl (%dx),%es:(%edi)
8010249c: 89 c8 mov %ecx,%eax
8010249e: 89 fb mov %edi,%ebx
801024a0: 89 5d 0c mov %ebx,0xc(%ebp)
801024a3: 89 45 10 mov %eax,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"d" (port), "0" (addr), "1" (cnt) :
"memory", "cc");
}
801024a6: 5b pop %ebx
801024a7: 5f pop %edi
801024a8: 5d pop %ebp
801024a9: c3 ret
801024aa <outb>:
static inline void
outb(ushort port, uchar data)
{
801024aa: 55 push %ebp
801024ab: 89 e5 mov %esp,%ebp
801024ad: 83 ec 08 sub $0x8,%esp
801024b0: 8b 55 08 mov 0x8(%ebp),%edx
801024b3: 8b 45 0c mov 0xc(%ebp),%eax
801024b6: 66 89 55 fc mov %dx,-0x4(%ebp)
801024ba: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801024bd: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
801024c1: 0f b7 55 fc movzwl -0x4(%ebp),%edx
801024c5: ee out %al,(%dx)
}
801024c6: c9 leave
801024c7: c3 ret
801024c8 <outsl>:
asm volatile("out %0,%1" : : "a" (data), "d" (port));
}
static inline void
outsl(int port, const void *addr, int cnt)
{
801024c8: 55 push %ebp
801024c9: 89 e5 mov %esp,%ebp
801024cb: 56 push %esi
801024cc: 53 push %ebx
asm volatile("cld; rep outsl" :
801024cd: 8b 55 08 mov 0x8(%ebp),%edx
801024d0: 8b 4d 0c mov 0xc(%ebp),%ecx
801024d3: 8b 45 10 mov 0x10(%ebp),%eax
801024d6: 89 cb mov %ecx,%ebx
801024d8: 89 de mov %ebx,%esi
801024da: 89 c1 mov %eax,%ecx
801024dc: fc cld
801024dd: f3 6f rep outsl %ds:(%esi),(%dx)
801024df: 89 c8 mov %ecx,%eax
801024e1: 89 f3 mov %esi,%ebx
801024e3: 89 5d 0c mov %ebx,0xc(%ebp)
801024e6: 89 45 10 mov %eax,0x10(%ebp)
"=S" (addr), "=c" (cnt) :
"d" (port), "0" (addr), "1" (cnt) :
"cc");
}
801024e9: 5b pop %ebx
801024ea: 5e pop %esi
801024eb: 5d pop %ebp
801024ec: c3 ret
801024ed <idewait>:
static void idestart(struct buf*);
// Wait for IDE disk to become ready.
static int
idewait(int checkerr)
{
801024ed: 55 push %ebp
801024ee: 89 e5 mov %esp,%ebp
801024f0: 83 ec 14 sub $0x14,%esp
int r;
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
801024f3: c7 04 24 f7 01 00 00 movl $0x1f7,(%esp)
801024fa: e8 69 ff ff ff call 80102468 <inb>
801024ff: 0f b6 c0 movzbl %al,%eax
80102502: 89 45 fc mov %eax,-0x4(%ebp)
80102505: 8b 45 fc mov -0x4(%ebp),%eax
80102508: 25 c0 00 00 00 and $0xc0,%eax
8010250d: 83 f8 40 cmp $0x40,%eax
80102510: 75 e1 jne 801024f3 <idewait+0x6>
;
if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0)
80102512: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
80102516: 74 11 je 80102529 <idewait+0x3c>
80102518: 8b 45 fc mov -0x4(%ebp),%eax
8010251b: 83 e0 21 and $0x21,%eax
8010251e: 85 c0 test %eax,%eax
80102520: 74 07 je 80102529 <idewait+0x3c>
return -1;
80102522: b8 ff ff ff ff mov $0xffffffff,%eax
80102527: eb 05 jmp 8010252e <idewait+0x41>
return 0;
80102529: b8 00 00 00 00 mov $0x0,%eax
}
8010252e: c9 leave
8010252f: c3 ret
80102530 <ideinit>:
void
ideinit(void)
{
80102530: 55 push %ebp
80102531: 89 e5 mov %esp,%ebp
80102533: 83 ec 28 sub $0x28,%esp
int i;
initlock(&idelock, "ide");
80102536: c7 44 24 04 44 87 10 movl $0x80108744,0x4(%esp)
8010253d: 80
8010253e: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
80102545: e8 e4 29 00 00 call 80104f2e <initlock>
picenable(IRQ_IDE);
8010254a: c7 04 24 0e 00 00 00 movl $0xe,(%esp)
80102551: e8 37 15 00 00 call 80103a8d <picenable>
ioapicenable(IRQ_IDE, ncpu - 1);
80102556: a1 20 ff 10 80 mov 0x8010ff20,%eax
8010255b: 83 e8 01 sub $0x1,%eax
8010255e: 89 44 24 04 mov %eax,0x4(%esp)
80102562: c7 04 24 0e 00 00 00 movl $0xe,(%esp)
80102569: e8 10 04 00 00 call 8010297e <ioapicenable>
idewait(0);
8010256e: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80102575: e8 73 ff ff ff call 801024ed <idewait>
// Check if disk 1 is present
outb(0x1f6, 0xe0 | (1<<4));
8010257a: c7 44 24 04 f0 00 00 movl $0xf0,0x4(%esp)
80102581: 00
80102582: c7 04 24 f6 01 00 00 movl $0x1f6,(%esp)
80102589: e8 1c ff ff ff call 801024aa <outb>
for(i=0; i<1000; i++){
8010258e: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80102595: eb 20 jmp 801025b7 <ideinit+0x87>
if(inb(0x1f7) != 0){
80102597: c7 04 24 f7 01 00 00 movl $0x1f7,(%esp)
8010259e: e8 c5 fe ff ff call 80102468 <inb>
801025a3: 84 c0 test %al,%al
801025a5: 74 0c je 801025b3 <ideinit+0x83>
havedisk1 = 1;
801025a7: c7 05 58 b6 10 80 01 movl $0x1,0x8010b658
801025ae: 00 00 00
break;
801025b1: eb 0d jmp 801025c0 <ideinit+0x90>
ioapicenable(IRQ_IDE, ncpu - 1);
idewait(0);
// Check if disk 1 is present
outb(0x1f6, 0xe0 | (1<<4));
for(i=0; i<1000; i++){
801025b3: 83 45 f4 01 addl $0x1,-0xc(%ebp)
801025b7: 81 7d f4 e7 03 00 00 cmpl $0x3e7,-0xc(%ebp)
801025be: 7e d7 jle 80102597 <ideinit+0x67>
break;
}
}
// Switch back to disk 0.
outb(0x1f6, 0xe0 | (0<<4));
801025c0: c7 44 24 04 e0 00 00 movl $0xe0,0x4(%esp)
801025c7: 00
801025c8: c7 04 24 f6 01 00 00 movl $0x1f6,(%esp)
801025cf: e8 d6 fe ff ff call 801024aa <outb>
}
801025d4: c9 leave
801025d5: c3 ret
801025d6 <idestart>:
// Start the request for b. Caller must hold idelock.
static void
idestart(struct buf *b)
{
801025d6: 55 push %ebp
801025d7: 89 e5 mov %esp,%ebp
801025d9: 83 ec 18 sub $0x18,%esp
if(b == 0)
801025dc: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
801025e0: 75 0c jne 801025ee <idestart+0x18>
panic("idestart");
801025e2: c7 04 24 48 87 10 80 movl $0x80108748,(%esp)
801025e9: e8 4c df ff ff call 8010053a <panic>
idewait(0);
801025ee: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801025f5: e8 f3 fe ff ff call 801024ed <idewait>
outb(0x3f6, 0); // generate interrupt
801025fa: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102601: 00
80102602: c7 04 24 f6 03 00 00 movl $0x3f6,(%esp)
80102609: e8 9c fe ff ff call 801024aa <outb>
outb(0x1f2, 1); // number of sectors
8010260e: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80102615: 00
80102616: c7 04 24 f2 01 00 00 movl $0x1f2,(%esp)
8010261d: e8 88 fe ff ff call 801024aa <outb>
outb(0x1f3, b->sector & 0xff);
80102622: 8b 45 08 mov 0x8(%ebp),%eax
80102625: 8b 40 08 mov 0x8(%eax),%eax
80102628: 0f b6 c0 movzbl %al,%eax
8010262b: 89 44 24 04 mov %eax,0x4(%esp)
8010262f: c7 04 24 f3 01 00 00 movl $0x1f3,(%esp)
80102636: e8 6f fe ff ff call 801024aa <outb>
outb(0x1f4, (b->sector >> 8) & 0xff);
8010263b: 8b 45 08 mov 0x8(%ebp),%eax
8010263e: 8b 40 08 mov 0x8(%eax),%eax
80102641: c1 e8 08 shr $0x8,%eax
80102644: 0f b6 c0 movzbl %al,%eax
80102647: 89 44 24 04 mov %eax,0x4(%esp)
8010264b: c7 04 24 f4 01 00 00 movl $0x1f4,(%esp)
80102652: e8 53 fe ff ff call 801024aa <outb>
outb(0x1f5, (b->sector >> 16) & 0xff);
80102657: 8b 45 08 mov 0x8(%ebp),%eax
8010265a: 8b 40 08 mov 0x8(%eax),%eax
8010265d: c1 e8 10 shr $0x10,%eax
80102660: 0f b6 c0 movzbl %al,%eax
80102663: 89 44 24 04 mov %eax,0x4(%esp)
80102667: c7 04 24 f5 01 00 00 movl $0x1f5,(%esp)
8010266e: e8 37 fe ff ff call 801024aa <outb>
outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((b->sector>>24)&0x0f));
80102673: 8b 45 08 mov 0x8(%ebp),%eax
80102676: 8b 40 04 mov 0x4(%eax),%eax
80102679: 83 e0 01 and $0x1,%eax
8010267c: 89 c2 mov %eax,%edx
8010267e: c1 e2 04 shl $0x4,%edx
80102681: 8b 45 08 mov 0x8(%ebp),%eax
80102684: 8b 40 08 mov 0x8(%eax),%eax
80102687: c1 e8 18 shr $0x18,%eax
8010268a: 83 e0 0f and $0xf,%eax
8010268d: 09 d0 or %edx,%eax
8010268f: 83 c8 e0 or $0xffffffe0,%eax
80102692: 0f b6 c0 movzbl %al,%eax
80102695: 89 44 24 04 mov %eax,0x4(%esp)
80102699: c7 04 24 f6 01 00 00 movl $0x1f6,(%esp)
801026a0: e8 05 fe ff ff call 801024aa <outb>
if(b->flags & B_DIRTY){
801026a5: 8b 45 08 mov 0x8(%ebp),%eax
801026a8: 8b 00 mov (%eax),%eax
801026aa: 83 e0 04 and $0x4,%eax
801026ad: 85 c0 test %eax,%eax
801026af: 74 34 je 801026e5 <idestart+0x10f>
outb(0x1f7, IDE_CMD_WRITE);
801026b1: c7 44 24 04 30 00 00 movl $0x30,0x4(%esp)
801026b8: 00
801026b9: c7 04 24 f7 01 00 00 movl $0x1f7,(%esp)
801026c0: e8 e5 fd ff ff call 801024aa <outb>
outsl(0x1f0, b->data, 512/4);
801026c5: 8b 45 08 mov 0x8(%ebp),%eax
801026c8: 83 c0 18 add $0x18,%eax
801026cb: c7 44 24 08 80 00 00 movl $0x80,0x8(%esp)
801026d2: 00
801026d3: 89 44 24 04 mov %eax,0x4(%esp)
801026d7: c7 04 24 f0 01 00 00 movl $0x1f0,(%esp)
801026de: e8 e5 fd ff ff call 801024c8 <outsl>
801026e3: eb 14 jmp 801026f9 <idestart+0x123>
} else {
outb(0x1f7, IDE_CMD_READ);
801026e5: c7 44 24 04 20 00 00 movl $0x20,0x4(%esp)
801026ec: 00
801026ed: c7 04 24 f7 01 00 00 movl $0x1f7,(%esp)
801026f4: e8 b1 fd ff ff call 801024aa <outb>
}
}
801026f9: c9 leave
801026fa: c3 ret
801026fb <ideintr>:
// Interrupt handler.
void
ideintr(void)
{
801026fb: 55 push %ebp
801026fc: 89 e5 mov %esp,%ebp
801026fe: 83 ec 28 sub $0x28,%esp
struct buf *b;
// First queued buffer is the active request.
acquire(&idelock);
80102701: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
80102708: e8 42 28 00 00 call 80104f4f <acquire>
if((b = idequeue) == 0){
8010270d: a1 54 b6 10 80 mov 0x8010b654,%eax
80102712: 89 45 f4 mov %eax,-0xc(%ebp)
80102715: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80102719: 75 11 jne 8010272c <ideintr+0x31>
release(&idelock);
8010271b: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
80102722: e8 89 28 00 00 call 80104fb0 <release>
// cprintf("spurious IDE interrupt\n");
return;
80102727: e9 90 00 00 00 jmp 801027bc <ideintr+0xc1>
}
idequeue = b->qnext;
8010272c: 8b 45 f4 mov -0xc(%ebp),%eax
8010272f: 8b 40 14 mov 0x14(%eax),%eax
80102732: a3 54 b6 10 80 mov %eax,0x8010b654
// Read data if needed.
if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
80102737: 8b 45 f4 mov -0xc(%ebp),%eax
8010273a: 8b 00 mov (%eax),%eax
8010273c: 83 e0 04 and $0x4,%eax
8010273f: 85 c0 test %eax,%eax
80102741: 75 2e jne 80102771 <ideintr+0x76>
80102743: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010274a: e8 9e fd ff ff call 801024ed <idewait>
8010274f: 85 c0 test %eax,%eax
80102751: 78 1e js 80102771 <ideintr+0x76>
insl(0x1f0, b->data, 512/4);
80102753: 8b 45 f4 mov -0xc(%ebp),%eax
80102756: 83 c0 18 add $0x18,%eax
80102759: c7 44 24 08 80 00 00 movl $0x80,0x8(%esp)
80102760: 00
80102761: 89 44 24 04 mov %eax,0x4(%esp)
80102765: c7 04 24 f0 01 00 00 movl $0x1f0,(%esp)
8010276c: e8 14 fd ff ff call 80102485 <insl>
// Wake process waiting for this buf.
b->flags |= B_VALID;
80102771: 8b 45 f4 mov -0xc(%ebp),%eax
80102774: 8b 00 mov (%eax),%eax
80102776: 89 c2 mov %eax,%edx
80102778: 83 ca 02 or $0x2,%edx
8010277b: 8b 45 f4 mov -0xc(%ebp),%eax
8010277e: 89 10 mov %edx,(%eax)
b->flags &= ~B_DIRTY;
80102780: 8b 45 f4 mov -0xc(%ebp),%eax
80102783: 8b 00 mov (%eax),%eax
80102785: 89 c2 mov %eax,%edx
80102787: 83 e2 fb and $0xfffffffb,%edx
8010278a: 8b 45 f4 mov -0xc(%ebp),%eax
8010278d: 89 10 mov %edx,(%eax)
wakeup(b);
8010278f: 8b 45 f4 mov -0xc(%ebp),%eax
80102792: 89 04 24 mov %eax,(%esp)
80102795: e8 82 25 00 00 call 80104d1c <wakeup>
// Start disk on next buf in queue.
if(idequeue != 0)
8010279a: a1 54 b6 10 80 mov 0x8010b654,%eax
8010279f: 85 c0 test %eax,%eax
801027a1: 74 0d je 801027b0 <ideintr+0xb5>
idestart(idequeue);
801027a3: a1 54 b6 10 80 mov 0x8010b654,%eax
801027a8: 89 04 24 mov %eax,(%esp)
801027ab: e8 26 fe ff ff call 801025d6 <idestart>
release(&idelock);
801027b0: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
801027b7: e8 f4 27 00 00 call 80104fb0 <release>
}
801027bc: c9 leave
801027bd: c3 ret
801027be <iderw>:
// Sync buf with disk.
// If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID.
// Else if B_VALID is not set, read buf from disk, set B_VALID.
void
iderw(struct buf *b)
{
801027be: 55 push %ebp
801027bf: 89 e5 mov %esp,%ebp
801027c1: 83 ec 28 sub $0x28,%esp
struct buf **pp;
if(!(b->flags & B_BUSY))
801027c4: 8b 45 08 mov 0x8(%ebp),%eax
801027c7: 8b 00 mov (%eax),%eax
801027c9: 83 e0 01 and $0x1,%eax
801027cc: 85 c0 test %eax,%eax
801027ce: 75 0c jne 801027dc <iderw+0x1e>
panic("iderw: buf not busy");
801027d0: c7 04 24 51 87 10 80 movl $0x80108751,(%esp)
801027d7: e8 5e dd ff ff call 8010053a <panic>
if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
801027dc: 8b 45 08 mov 0x8(%ebp),%eax
801027df: 8b 00 mov (%eax),%eax
801027e1: 83 e0 06 and $0x6,%eax
801027e4: 83 f8 02 cmp $0x2,%eax
801027e7: 75 0c jne 801027f5 <iderw+0x37>
panic("iderw: nothing to do");
801027e9: c7 04 24 65 87 10 80 movl $0x80108765,(%esp)
801027f0: e8 45 dd ff ff call 8010053a <panic>
if(b->dev != 0 && !havedisk1)
801027f5: 8b 45 08 mov 0x8(%ebp),%eax
801027f8: 8b 40 04 mov 0x4(%eax),%eax
801027fb: 85 c0 test %eax,%eax
801027fd: 74 15 je 80102814 <iderw+0x56>
801027ff: a1 58 b6 10 80 mov 0x8010b658,%eax
80102804: 85 c0 test %eax,%eax
80102806: 75 0c jne 80102814 <iderw+0x56>
panic("iderw: ide disk 1 not present");
80102808: c7 04 24 7a 87 10 80 movl $0x8010877a,(%esp)
8010280f: e8 26 dd ff ff call 8010053a <panic>
acquire(&idelock); //DOC:acquire-lock
80102814: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
8010281b: e8 2f 27 00 00 call 80104f4f <acquire>
// Append b to idequeue.
b->qnext = 0;
80102820: 8b 45 08 mov 0x8(%ebp),%eax
80102823: c7 40 14 00 00 00 00 movl $0x0,0x14(%eax)
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
8010282a: c7 45 f4 54 b6 10 80 movl $0x8010b654,-0xc(%ebp)
80102831: eb 0b jmp 8010283e <iderw+0x80>
80102833: 8b 45 f4 mov -0xc(%ebp),%eax
80102836: 8b 00 mov (%eax),%eax
80102838: 83 c0 14 add $0x14,%eax
8010283b: 89 45 f4 mov %eax,-0xc(%ebp)
8010283e: 8b 45 f4 mov -0xc(%ebp),%eax
80102841: 8b 00 mov (%eax),%eax
80102843: 85 c0 test %eax,%eax
80102845: 75 ec jne 80102833 <iderw+0x75>
;
*pp = b;
80102847: 8b 45 f4 mov -0xc(%ebp),%eax
8010284a: 8b 55 08 mov 0x8(%ebp),%edx
8010284d: 89 10 mov %edx,(%eax)
// Start disk if necessary.
if(idequeue == b)
8010284f: a1 54 b6 10 80 mov 0x8010b654,%eax
80102854: 3b 45 08 cmp 0x8(%ebp),%eax
80102857: 75 22 jne 8010287b <iderw+0xbd>
idestart(b);
80102859: 8b 45 08 mov 0x8(%ebp),%eax
8010285c: 89 04 24 mov %eax,(%esp)
8010285f: e8 72 fd ff ff call 801025d6 <idestart>
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
80102864: eb 16 jmp 8010287c <iderw+0xbe>
sleep(b, &idelock);
80102866: c7 44 24 04 20 b6 10 movl $0x8010b620,0x4(%esp)
8010286d: 80
8010286e: 8b 45 08 mov 0x8(%ebp),%eax
80102871: 89 04 24 mov %eax,(%esp)
80102874: e8 5d 23 00 00 call 80104bd6 <sleep>
80102879: eb 01 jmp 8010287c <iderw+0xbe>
// Start disk if necessary.
if(idequeue == b)
idestart(b);
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
8010287b: 90 nop
8010287c: 8b 45 08 mov 0x8(%ebp),%eax
8010287f: 8b 00 mov (%eax),%eax
80102881: 83 e0 06 and $0x6,%eax
80102884: 83 f8 02 cmp $0x2,%eax
80102887: 75 dd jne 80102866 <iderw+0xa8>
sleep(b, &idelock);
}
release(&idelock);
80102889: c7 04 24 20 b6 10 80 movl $0x8010b620,(%esp)
80102890: e8 1b 27 00 00 call 80104fb0 <release>
}
80102895: c9 leave
80102896: c3 ret
...
80102898 <ioapicread>:
uint data;
};
static uint
ioapicread(int reg)
{
80102898: 55 push %ebp
80102899: 89 e5 mov %esp,%ebp
ioapic->reg = reg;
8010289b: a1 54 f8 10 80 mov 0x8010f854,%eax
801028a0: 8b 55 08 mov 0x8(%ebp),%edx
801028a3: 89 10 mov %edx,(%eax)
return ioapic->data;
801028a5: a1 54 f8 10 80 mov 0x8010f854,%eax
801028aa: 8b 40 10 mov 0x10(%eax),%eax
}
801028ad: 5d pop %ebp
801028ae: c3 ret
801028af <ioapicwrite>:
static void
ioapicwrite(int reg, uint data)
{
801028af: 55 push %ebp
801028b0: 89 e5 mov %esp,%ebp
ioapic->reg = reg;
801028b2: a1 54 f8 10 80 mov 0x8010f854,%eax
801028b7: 8b 55 08 mov 0x8(%ebp),%edx
801028ba: 89 10 mov %edx,(%eax)
ioapic->data = data;
801028bc: a1 54 f8 10 80 mov 0x8010f854,%eax
801028c1: 8b 55 0c mov 0xc(%ebp),%edx
801028c4: 89 50 10 mov %edx,0x10(%eax)
}
801028c7: 5d pop %ebp
801028c8: c3 ret
801028c9 <ioapicinit>:
void
ioapicinit(void)
{
801028c9: 55 push %ebp
801028ca: 89 e5 mov %esp,%ebp
801028cc: 83 ec 28 sub $0x28,%esp
int i, id, maxintr;
if(!ismp)
801028cf: a1 24 f9 10 80 mov 0x8010f924,%eax
801028d4: 85 c0 test %eax,%eax
801028d6: 0f 84 9f 00 00 00 je 8010297b <ioapicinit+0xb2>
return;
ioapic = (volatile struct ioapic*)IOAPIC;
801028dc: c7 05 54 f8 10 80 00 movl $0xfec00000,0x8010f854
801028e3: 00 c0 fe
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
801028e6: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801028ed: e8 a6 ff ff ff call 80102898 <ioapicread>
801028f2: c1 e8 10 shr $0x10,%eax
801028f5: 25 ff 00 00 00 and $0xff,%eax
801028fa: 89 45 f4 mov %eax,-0xc(%ebp)
id = ioapicread(REG_ID) >> 24;
801028fd: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80102904: e8 8f ff ff ff call 80102898 <ioapicread>
80102909: c1 e8 18 shr $0x18,%eax
8010290c: 89 45 f0 mov %eax,-0x10(%ebp)
if(id != ioapicid)
8010290f: 0f b6 05 20 f9 10 80 movzbl 0x8010f920,%eax
80102916: 0f b6 c0 movzbl %al,%eax
80102919: 3b 45 f0 cmp -0x10(%ebp),%eax
8010291c: 74 0c je 8010292a <ioapicinit+0x61>
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
8010291e: c7 04 24 98 87 10 80 movl $0x80108798,(%esp)
80102925: e8 70 da ff ff call 8010039a <cprintf>
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
8010292a: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80102931: eb 3e jmp 80102971 <ioapicinit+0xa8>
ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
80102933: 8b 45 ec mov -0x14(%ebp),%eax
80102936: 83 c0 20 add $0x20,%eax
80102939: 0d 00 00 01 00 or $0x10000,%eax
8010293e: 8b 55 ec mov -0x14(%ebp),%edx
80102941: 83 c2 08 add $0x8,%edx
80102944: 01 d2 add %edx,%edx
80102946: 89 44 24 04 mov %eax,0x4(%esp)
8010294a: 89 14 24 mov %edx,(%esp)
8010294d: e8 5d ff ff ff call 801028af <ioapicwrite>
ioapicwrite(REG_TABLE+2*i+1, 0);
80102952: 8b 45 ec mov -0x14(%ebp),%eax
80102955: 83 c0 08 add $0x8,%eax
80102958: 01 c0 add %eax,%eax
8010295a: 83 c0 01 add $0x1,%eax
8010295d: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102964: 00
80102965: 89 04 24 mov %eax,(%esp)
80102968: e8 42 ff ff ff call 801028af <ioapicwrite>
if(id != ioapicid)
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
8010296d: 83 45 ec 01 addl $0x1,-0x14(%ebp)
80102971: 8b 45 ec mov -0x14(%ebp),%eax
80102974: 3b 45 f4 cmp -0xc(%ebp),%eax
80102977: 7e ba jle 80102933 <ioapicinit+0x6a>
80102979: eb 01 jmp 8010297c <ioapicinit+0xb3>
ioapicinit(void)
{
int i, id, maxintr;
if(!ismp)
return;
8010297b: 90 nop
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
ioapicwrite(REG_TABLE+2*i+1, 0);
}
}
8010297c: c9 leave
8010297d: c3 ret
8010297e <ioapicenable>:
void
ioapicenable(int irq, int cpunum)
{
8010297e: 55 push %ebp
8010297f: 89 e5 mov %esp,%ebp
80102981: 83 ec 08 sub $0x8,%esp
if(!ismp)
80102984: a1 24 f9 10 80 mov 0x8010f924,%eax
80102989: 85 c0 test %eax,%eax
8010298b: 74 39 je 801029c6 <ioapicenable+0x48>
return;
// Mark interrupt edge-triggered, active high,
// enabled, and routed to the given cpunum,
// which happens to be that cpu's APIC ID.
ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
8010298d: 8b 45 08 mov 0x8(%ebp),%eax
80102990: 83 c0 20 add $0x20,%eax
80102993: 8b 55 08 mov 0x8(%ebp),%edx
80102996: 83 c2 08 add $0x8,%edx
80102999: 01 d2 add %edx,%edx
8010299b: 89 44 24 04 mov %eax,0x4(%esp)
8010299f: 89 14 24 mov %edx,(%esp)
801029a2: e8 08 ff ff ff call 801028af <ioapicwrite>
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801029a7: 8b 45 0c mov 0xc(%ebp),%eax
801029aa: c1 e0 18 shl $0x18,%eax
801029ad: 8b 55 08 mov 0x8(%ebp),%edx
801029b0: 83 c2 08 add $0x8,%edx
801029b3: 01 d2 add %edx,%edx
801029b5: 83 c2 01 add $0x1,%edx
801029b8: 89 44 24 04 mov %eax,0x4(%esp)
801029bc: 89 14 24 mov %edx,(%esp)
801029bf: e8 eb fe ff ff call 801028af <ioapicwrite>
801029c4: eb 01 jmp 801029c7 <ioapicenable+0x49>
void
ioapicenable(int irq, int cpunum)
{
if(!ismp)
return;
801029c6: 90 nop
// Mark interrupt edge-triggered, active high,
// enabled, and routed to the given cpunum,
// which happens to be that cpu's APIC ID.
ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
}
801029c7: c9 leave
801029c8: c3 ret
801029c9: 00 00 add %al,(%eax)
...
801029cc <v2p>:
#define KERNBASE 0x80000000 // First kernel virtual address
#define KERNLINK (KERNBASE+EXTMEM) // Address where kernel is linked
#ifndef __ASSEMBLER__
static inline uint v2p(void *a) { return ((uint) (a)) - KERNBASE; }
801029cc: 55 push %ebp
801029cd: 89 e5 mov %esp,%ebp
801029cf: 8b 45 08 mov 0x8(%ebp),%eax
801029d2: 2d 00 00 00 80 sub $0x80000000,%eax
801029d7: 5d pop %ebp
801029d8: c3 ret
801029d9 <kinit1>:
// the pages mapped by entrypgdir on free list.
// 2. main() calls kinit2() with the rest of the physical pages
// after installing a full page table that maps them on all cores.
void
kinit1(void *vstart, void *vend)
{
801029d9: 55 push %ebp
801029da: 89 e5 mov %esp,%ebp
801029dc: 83 ec 18 sub $0x18,%esp
initlock(&kmem.lock, "kmem");
801029df: c7 44 24 04 ca 87 10 movl $0x801087ca,0x4(%esp)
801029e6: 80
801029e7: c7 04 24 60 f8 10 80 movl $0x8010f860,(%esp)
801029ee: e8 3b 25 00 00 call 80104f2e <initlock>
kmem.use_lock = 0;
801029f3: c7 05 94 f8 10 80 00 movl $0x0,0x8010f894
801029fa: 00 00 00
freerange(vstart, vend);
801029fd: 8b 45 0c mov 0xc(%ebp),%eax
80102a00: 89 44 24 04 mov %eax,0x4(%esp)
80102a04: 8b 45 08 mov 0x8(%ebp),%eax
80102a07: 89 04 24 mov %eax,(%esp)
80102a0a: e8 26 00 00 00 call 80102a35 <freerange>
}
80102a0f: c9 leave
80102a10: c3 ret
80102a11 <kinit2>:
void
kinit2(void *vstart, void *vend)
{
80102a11: 55 push %ebp
80102a12: 89 e5 mov %esp,%ebp
80102a14: 83 ec 18 sub $0x18,%esp
freerange(vstart, vend);
80102a17: 8b 45 0c mov 0xc(%ebp),%eax
80102a1a: 89 44 24 04 mov %eax,0x4(%esp)
80102a1e: 8b 45 08 mov 0x8(%ebp),%eax
80102a21: 89 04 24 mov %eax,(%esp)
80102a24: e8 0c 00 00 00 call 80102a35 <freerange>
kmem.use_lock = 1;
80102a29: c7 05 94 f8 10 80 01 movl $0x1,0x8010f894
80102a30: 00 00 00
}
80102a33: c9 leave
80102a34: c3 ret
80102a35 <freerange>:
void
freerange(void *vstart, void *vend)
{
80102a35: 55 push %ebp
80102a36: 89 e5 mov %esp,%ebp
80102a38: 83 ec 28 sub $0x28,%esp
char *p;
p = (char*)PGROUNDUP((uint)vstart);
80102a3b: 8b 45 08 mov 0x8(%ebp),%eax
80102a3e: 05 ff 0f 00 00 add $0xfff,%eax
80102a43: 25 00 f0 ff ff and $0xfffff000,%eax
80102a48: 89 45 f4 mov %eax,-0xc(%ebp)
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102a4b: eb 12 jmp 80102a5f <freerange+0x2a>
kfree(p);
80102a4d: 8b 45 f4 mov -0xc(%ebp),%eax
80102a50: 89 04 24 mov %eax,(%esp)
80102a53: e8 19 00 00 00 call 80102a71 <kfree>
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102a58: 81 45 f4 00 10 00 00 addl $0x1000,-0xc(%ebp)
80102a5f: 8b 45 f4 mov -0xc(%ebp),%eax
80102a62: 8d 90 00 10 00 00 lea 0x1000(%eax),%edx
80102a68: 8b 45 0c mov 0xc(%ebp),%eax
80102a6b: 39 c2 cmp %eax,%edx
80102a6d: 76 de jbe 80102a4d <freerange+0x18>
kfree(p);
}
80102a6f: c9 leave
80102a70: c3 ret
80102a71 <kfree>:
// which normally should have been returned by a
// call to kalloc(). (The exception is when
// initializing the allocator; see kinit above.)
void
kfree(char *v)
{
80102a71: 55 push %ebp
80102a72: 89 e5 mov %esp,%ebp
80102a74: 83 ec 28 sub $0x28,%esp
struct run *r;
if((uint)v % PGSIZE || v < end || v2p(v) >= PHYSTOP)
80102a77: 8b 45 08 mov 0x8(%ebp),%eax
80102a7a: 25 ff 0f 00 00 and $0xfff,%eax
80102a7f: 85 c0 test %eax,%eax
80102a81: 75 1b jne 80102a9e <kfree+0x2d>
80102a83: 81 7d 08 1c 29 11 80 cmpl $0x8011291c,0x8(%ebp)
80102a8a: 72 12 jb 80102a9e <kfree+0x2d>
80102a8c: 8b 45 08 mov 0x8(%ebp),%eax
80102a8f: 89 04 24 mov %eax,(%esp)
80102a92: e8 35 ff ff ff call 801029cc <v2p>
80102a97: 3d ff ff ff 0d cmp $0xdffffff,%eax
80102a9c: 76 0c jbe 80102aaa <kfree+0x39>
panic("kfree");
80102a9e: c7 04 24 cf 87 10 80 movl $0x801087cf,(%esp)
80102aa5: e8 90 da ff ff call 8010053a <panic>
// Fill with junk to catch dangling refs.
memset(v, 1, PGSIZE);
80102aaa: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80102ab1: 00
80102ab2: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80102ab9: 00
80102aba: 8b 45 08 mov 0x8(%ebp),%eax
80102abd: 89 04 24 mov %eax,(%esp)
80102ac0: e8 d9 26 00 00 call 8010519e <memset>
if(kmem.use_lock)
80102ac5: a1 94 f8 10 80 mov 0x8010f894,%eax
80102aca: 85 c0 test %eax,%eax
80102acc: 74 0c je 80102ada <kfree+0x69>
acquire(&kmem.lock);
80102ace: c7 04 24 60 f8 10 80 movl $0x8010f860,(%esp)
80102ad5: e8 75 24 00 00 call 80104f4f <acquire>
r = (struct run*)v;
80102ada: 8b 45 08 mov 0x8(%ebp),%eax
80102add: 89 45 f4 mov %eax,-0xc(%ebp)
r->next = kmem.freelist;
80102ae0: 8b 15 98 f8 10 80 mov 0x8010f898,%edx
80102ae6: 8b 45 f4 mov -0xc(%ebp),%eax
80102ae9: 89 10 mov %edx,(%eax)
kmem.freelist = r;
80102aeb: 8b 45 f4 mov -0xc(%ebp),%eax
80102aee: a3 98 f8 10 80 mov %eax,0x8010f898
if(kmem.use_lock)
80102af3: a1 94 f8 10 80 mov 0x8010f894,%eax
80102af8: 85 c0 test %eax,%eax
80102afa: 74 0c je 80102b08 <kfree+0x97>
release(&kmem.lock);
80102afc: c7 04 24 60 f8 10 80 movl $0x8010f860,(%esp)
80102b03: e8 a8 24 00 00 call 80104fb0 <release>
}
80102b08: c9 leave
80102b09: c3 ret
80102b0a <kalloc>:
// Allocate one 4096-byte page of physical memory.
// Returns a pointer that the kernel can use.
// Returns 0 if the memory cannot be allocated.
char*
kalloc(void)
{
80102b0a: 55 push %ebp
80102b0b: 89 e5 mov %esp,%ebp
80102b0d: 83 ec 28 sub $0x28,%esp
struct run *r;
if(kmem.use_lock)
80102b10: a1 94 f8 10 80 mov 0x8010f894,%eax
80102b15: 85 c0 test %eax,%eax
80102b17: 74 0c je 80102b25 <kalloc+0x1b>
acquire(&kmem.lock);
80102b19: c7 04 24 60 f8 10 80 movl $0x8010f860,(%esp)
80102b20: e8 2a 24 00 00 call 80104f4f <acquire>
r = kmem.freelist;
80102b25: a1 98 f8 10 80 mov 0x8010f898,%eax
80102b2a: 89 45 f4 mov %eax,-0xc(%ebp)
if(r)
80102b2d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80102b31: 74 0a je 80102b3d <kalloc+0x33>
kmem.freelist = r->next;
80102b33: 8b 45 f4 mov -0xc(%ebp),%eax
80102b36: 8b 00 mov (%eax),%eax
80102b38: a3 98 f8 10 80 mov %eax,0x8010f898
if(kmem.use_lock)
80102b3d: a1 94 f8 10 80 mov 0x8010f894,%eax
80102b42: 85 c0 test %eax,%eax
80102b44: 74 0c je 80102b52 <kalloc+0x48>
release(&kmem.lock);
80102b46: c7 04 24 60 f8 10 80 movl $0x8010f860,(%esp)
80102b4d: e8 5e 24 00 00 call 80104fb0 <release>
return (char*)r;
80102b52: 8b 45 f4 mov -0xc(%ebp),%eax
}
80102b55: c9 leave
80102b56: c3 ret
...
80102b58 <inb>:
// Routines to let C code use special x86 instructions.
static inline uchar
inb(ushort port)
{
80102b58: 55 push %ebp
80102b59: 89 e5 mov %esp,%ebp
80102b5b: 83 ec 14 sub $0x14,%esp
80102b5e: 8b 45 08 mov 0x8(%ebp),%eax
80102b61: 66 89 45 ec mov %ax,-0x14(%ebp)
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b65: 0f b7 45 ec movzwl -0x14(%ebp),%eax
80102b69: 89 c2 mov %eax,%edx
80102b6b: ec in (%dx),%al
80102b6c: 88 45 ff mov %al,-0x1(%ebp)
return data;
80102b6f: 0f b6 45 ff movzbl -0x1(%ebp),%eax
}
80102b73: c9 leave
80102b74: c3 ret
80102b75 <kbdgetc>:
#include "defs.h"
#include "kbd.h"
int
kbdgetc(void)
{
80102b75: 55 push %ebp
80102b76: 89 e5 mov %esp,%ebp
80102b78: 83 ec 14 sub $0x14,%esp
static uchar *charcode[4] = {
normalmap, shiftmap, ctlmap, ctlmap
};
uint st, data, c;
st = inb(KBSTATP);
80102b7b: c7 04 24 64 00 00 00 movl $0x64,(%esp)
80102b82: e8 d1 ff ff ff call 80102b58 <inb>
80102b87: 0f b6 c0 movzbl %al,%eax
80102b8a: 89 45 f4 mov %eax,-0xc(%ebp)
if((st & KBS_DIB) == 0)
80102b8d: 8b 45 f4 mov -0xc(%ebp),%eax
80102b90: 83 e0 01 and $0x1,%eax
80102b93: 85 c0 test %eax,%eax
80102b95: 75 0a jne 80102ba1 <kbdgetc+0x2c>
return -1;
80102b97: b8 ff ff ff ff mov $0xffffffff,%eax
80102b9c: e9 20 01 00 00 jmp 80102cc1 <kbdgetc+0x14c>
data = inb(KBDATAP);
80102ba1: c7 04 24 60 00 00 00 movl $0x60,(%esp)
80102ba8: e8 ab ff ff ff call 80102b58 <inb>
80102bad: 0f b6 c0 movzbl %al,%eax
80102bb0: 89 45 f8 mov %eax,-0x8(%ebp)
if(data == 0xE0){
80102bb3: 81 7d f8 e0 00 00 00 cmpl $0xe0,-0x8(%ebp)
80102bba: 75 17 jne 80102bd3 <kbdgetc+0x5e>
shift |= E0ESC;
80102bbc: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102bc1: 83 c8 40 or $0x40,%eax
80102bc4: a3 5c b6 10 80 mov %eax,0x8010b65c
return 0;
80102bc9: b8 00 00 00 00 mov $0x0,%eax
80102bce: e9 ee 00 00 00 jmp 80102cc1 <kbdgetc+0x14c>
} else if(data & 0x80){
80102bd3: 8b 45 f8 mov -0x8(%ebp),%eax
80102bd6: 25 80 00 00 00 and $0x80,%eax
80102bdb: 85 c0 test %eax,%eax
80102bdd: 74 44 je 80102c23 <kbdgetc+0xae>
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
80102bdf: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102be4: 83 e0 40 and $0x40,%eax
80102be7: 85 c0 test %eax,%eax
80102be9: 75 08 jne 80102bf3 <kbdgetc+0x7e>
80102beb: 8b 45 f8 mov -0x8(%ebp),%eax
80102bee: 83 e0 7f and $0x7f,%eax
80102bf1: eb 03 jmp 80102bf6 <kbdgetc+0x81>
80102bf3: 8b 45 f8 mov -0x8(%ebp),%eax
80102bf6: 89 45 f8 mov %eax,-0x8(%ebp)
shift &= ~(shiftcode[data] | E0ESC);
80102bf9: 8b 45 f8 mov -0x8(%ebp),%eax
80102bfc: 0f b6 80 20 90 10 80 movzbl -0x7fef6fe0(%eax),%eax
80102c03: 83 c8 40 or $0x40,%eax
80102c06: 0f b6 c0 movzbl %al,%eax
80102c09: f7 d0 not %eax
80102c0b: 89 c2 mov %eax,%edx
80102c0d: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c12: 21 d0 and %edx,%eax
80102c14: a3 5c b6 10 80 mov %eax,0x8010b65c
return 0;
80102c19: b8 00 00 00 00 mov $0x0,%eax
80102c1e: e9 9e 00 00 00 jmp 80102cc1 <kbdgetc+0x14c>
} else if(shift & E0ESC){
80102c23: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c28: 83 e0 40 and $0x40,%eax
80102c2b: 85 c0 test %eax,%eax
80102c2d: 74 14 je 80102c43 <kbdgetc+0xce>
// Last character was an E0 escape; or with 0x80
data |= 0x80;
80102c2f: 81 4d f8 80 00 00 00 orl $0x80,-0x8(%ebp)
shift &= ~E0ESC;
80102c36: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c3b: 83 e0 bf and $0xffffffbf,%eax
80102c3e: a3 5c b6 10 80 mov %eax,0x8010b65c
}
shift |= shiftcode[data];
80102c43: 8b 45 f8 mov -0x8(%ebp),%eax
80102c46: 0f b6 80 20 90 10 80 movzbl -0x7fef6fe0(%eax),%eax
80102c4d: 0f b6 d0 movzbl %al,%edx
80102c50: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c55: 09 d0 or %edx,%eax
80102c57: a3 5c b6 10 80 mov %eax,0x8010b65c
shift ^= togglecode[data];
80102c5c: 8b 45 f8 mov -0x8(%ebp),%eax
80102c5f: 0f b6 80 20 91 10 80 movzbl -0x7fef6ee0(%eax),%eax
80102c66: 0f b6 d0 movzbl %al,%edx
80102c69: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c6e: 31 d0 xor %edx,%eax
80102c70: a3 5c b6 10 80 mov %eax,0x8010b65c
c = charcode[shift & (CTL | SHIFT)][data];
80102c75: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c7a: 83 e0 03 and $0x3,%eax
80102c7d: 8b 04 85 20 95 10 80 mov -0x7fef6ae0(,%eax,4),%eax
80102c84: 03 45 f8 add -0x8(%ebp),%eax
80102c87: 0f b6 00 movzbl (%eax),%eax
80102c8a: 0f b6 c0 movzbl %al,%eax
80102c8d: 89 45 fc mov %eax,-0x4(%ebp)
if(shift & CAPSLOCK){
80102c90: a1 5c b6 10 80 mov 0x8010b65c,%eax
80102c95: 83 e0 08 and $0x8,%eax
80102c98: 85 c0 test %eax,%eax
80102c9a: 74 22 je 80102cbe <kbdgetc+0x149>
if('a' <= c && c <= 'z')
80102c9c: 83 7d fc 60 cmpl $0x60,-0x4(%ebp)
80102ca0: 76 0c jbe 80102cae <kbdgetc+0x139>
80102ca2: 83 7d fc 7a cmpl $0x7a,-0x4(%ebp)
80102ca6: 77 06 ja 80102cae <kbdgetc+0x139>
c += 'A' - 'a';
80102ca8: 83 6d fc 20 subl $0x20,-0x4(%ebp)
shift |= shiftcode[data];
shift ^= togglecode[data];
c = charcode[shift & (CTL | SHIFT)][data];
if(shift & CAPSLOCK){
if('a' <= c && c <= 'z')
80102cac: eb 10 jmp 80102cbe <kbdgetc+0x149>
c += 'A' - 'a';
else if('A' <= c && c <= 'Z')
80102cae: 83 7d fc 40 cmpl $0x40,-0x4(%ebp)
80102cb2: 76 0a jbe 80102cbe <kbdgetc+0x149>
80102cb4: 83 7d fc 5a cmpl $0x5a,-0x4(%ebp)
80102cb8: 77 04 ja 80102cbe <kbdgetc+0x149>
c += 'a' - 'A';
80102cba: 83 45 fc 20 addl $0x20,-0x4(%ebp)
}
return c;
80102cbe: 8b 45 fc mov -0x4(%ebp),%eax
}
80102cc1: c9 leave
80102cc2: c3 ret
80102cc3 <kbdintr>:
void
kbdintr(void)
{
80102cc3: 55 push %ebp
80102cc4: 89 e5 mov %esp,%ebp
80102cc6: 83 ec 18 sub $0x18,%esp
consoleintr(kbdgetc);
80102cc9: c7 04 24 75 2b 10 80 movl $0x80102b75,(%esp)
80102cd0: e8 d6 da ff ff call 801007ab <consoleintr>
}
80102cd5: c9 leave
80102cd6: c3 ret
...
80102cd8 <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
80102cd8: 55 push %ebp
80102cd9: 89 e5 mov %esp,%ebp
80102cdb: 83 ec 08 sub $0x8,%esp
80102cde: 8b 55 08 mov 0x8(%ebp),%edx
80102ce1: 8b 45 0c mov 0xc(%ebp),%eax
80102ce4: 66 89 55 fc mov %dx,-0x4(%ebp)
80102ce8: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102ceb: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
80102cef: 0f b7 55 fc movzwl -0x4(%ebp),%edx
80102cf3: ee out %al,(%dx)
}
80102cf4: c9 leave
80102cf5: c3 ret
80102cf6 <readeflags>:
asm volatile("ltr %0" : : "r" (sel));
}
static inline uint
readeflags(void)
{
80102cf6: 55 push %ebp
80102cf7: 89 e5 mov %esp,%ebp
80102cf9: 83 ec 10 sub $0x10,%esp
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80102cfc: 9c pushf
80102cfd: 58 pop %eax
80102cfe: 89 45 fc mov %eax,-0x4(%ebp)
return eflags;
80102d01: 8b 45 fc mov -0x4(%ebp),%eax
}
80102d04: c9 leave
80102d05: c3 ret
80102d06 <lapicw>:
volatile uint *lapic; // Initialized in mp.c
static void
lapicw(int index, int value)
{
80102d06: 55 push %ebp
80102d07: 89 e5 mov %esp,%ebp
lapic[index] = value;
80102d09: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102d0e: 8b 55 08 mov 0x8(%ebp),%edx
80102d11: c1 e2 02 shl $0x2,%edx
80102d14: 8d 14 10 lea (%eax,%edx,1),%edx
80102d17: 8b 45 0c mov 0xc(%ebp),%eax
80102d1a: 89 02 mov %eax,(%edx)
lapic[ID]; // wait for write to finish, by reading
80102d1c: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102d21: 83 c0 20 add $0x20,%eax
80102d24: 8b 00 mov (%eax),%eax
}
80102d26: 5d pop %ebp
80102d27: c3 ret
80102d28 <lapicinit>:
//PAGEBREAK!
void
lapicinit(void)
{
80102d28: 55 push %ebp
80102d29: 89 e5 mov %esp,%ebp
80102d2b: 83 ec 08 sub $0x8,%esp
if(!lapic)
80102d2e: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102d33: 85 c0 test %eax,%eax
80102d35: 0f 84 46 01 00 00 je 80102e81 <lapicinit+0x159>
return;
// Enable local APIC; set spurious interrupt vector.
lapicw(SVR, ENABLE | (T_IRQ0 + IRQ_SPURIOUS));
80102d3b: c7 44 24 04 3f 01 00 movl $0x13f,0x4(%esp)
80102d42: 00
80102d43: c7 04 24 3c 00 00 00 movl $0x3c,(%esp)
80102d4a: e8 b7 ff ff ff call 80102d06 <lapicw>
// The timer repeatedly counts down at bus frequency
// from lapic[TICR] and then issues an interrupt.
// If xv6 cared more about precise timekeeping,
// TICR would be calibrated using an external time source.
lapicw(TDCR, X1);
80102d4f: c7 44 24 04 0b 00 00 movl $0xb,0x4(%esp)
80102d56: 00
80102d57: c7 04 24 f8 00 00 00 movl $0xf8,(%esp)
80102d5e: e8 a3 ff ff ff call 80102d06 <lapicw>
lapicw(TIMER, PERIODIC | (T_IRQ0 + IRQ_TIMER));
80102d63: c7 44 24 04 20 00 02 movl $0x20020,0x4(%esp)
80102d6a: 00
80102d6b: c7 04 24 c8 00 00 00 movl $0xc8,(%esp)
80102d72: e8 8f ff ff ff call 80102d06 <lapicw>
lapicw(TICR, 10000000);
80102d77: c7 44 24 04 80 96 98 movl $0x989680,0x4(%esp)
80102d7e: 00
80102d7f: c7 04 24 e0 00 00 00 movl $0xe0,(%esp)
80102d86: e8 7b ff ff ff call 80102d06 <lapicw>
// Disable logical interrupt lines.
lapicw(LINT0, MASKED);
80102d8b: c7 44 24 04 00 00 01 movl $0x10000,0x4(%esp)
80102d92: 00
80102d93: c7 04 24 d4 00 00 00 movl $0xd4,(%esp)
80102d9a: e8 67 ff ff ff call 80102d06 <lapicw>
lapicw(LINT1, MASKED);
80102d9f: c7 44 24 04 00 00 01 movl $0x10000,0x4(%esp)
80102da6: 00
80102da7: c7 04 24 d8 00 00 00 movl $0xd8,(%esp)
80102dae: e8 53 ff ff ff call 80102d06 <lapicw>
// Disable performance counter overflow interrupts
// on machines that provide that interrupt entry.
if(((lapic[VER]>>16) & 0xFF) >= 4)
80102db3: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102db8: 83 c0 30 add $0x30,%eax
80102dbb: 8b 00 mov (%eax),%eax
80102dbd: c1 e8 10 shr $0x10,%eax
80102dc0: 25 ff 00 00 00 and $0xff,%eax
80102dc5: 83 f8 03 cmp $0x3,%eax
80102dc8: 76 14 jbe 80102dde <lapicinit+0xb6>
lapicw(PCINT, MASKED);
80102dca: c7 44 24 04 00 00 01 movl $0x10000,0x4(%esp)
80102dd1: 00
80102dd2: c7 04 24 d0 00 00 00 movl $0xd0,(%esp)
80102dd9: e8 28 ff ff ff call 80102d06 <lapicw>
// Map error interrupt to IRQ_ERROR.
lapicw(ERROR, T_IRQ0 + IRQ_ERROR);
80102dde: c7 44 24 04 33 00 00 movl $0x33,0x4(%esp)
80102de5: 00
80102de6: c7 04 24 dc 00 00 00 movl $0xdc,(%esp)
80102ded: e8 14 ff ff ff call 80102d06 <lapicw>
// Clear error status register (requires back-to-back writes).
lapicw(ESR, 0);
80102df2: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102df9: 00
80102dfa: c7 04 24 a0 00 00 00 movl $0xa0,(%esp)
80102e01: e8 00 ff ff ff call 80102d06 <lapicw>
lapicw(ESR, 0);
80102e06: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102e0d: 00
80102e0e: c7 04 24 a0 00 00 00 movl $0xa0,(%esp)
80102e15: e8 ec fe ff ff call 80102d06 <lapicw>
// Ack any outstanding interrupts.
lapicw(EOI, 0);
80102e1a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102e21: 00
80102e22: c7 04 24 2c 00 00 00 movl $0x2c,(%esp)
80102e29: e8 d8 fe ff ff call 80102d06 <lapicw>
// Send an Init Level De-Assert to synchronise arbitration ID's.
lapicw(ICRHI, 0);
80102e2e: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102e35: 00
80102e36: c7 04 24 c4 00 00 00 movl $0xc4,(%esp)
80102e3d: e8 c4 fe ff ff call 80102d06 <lapicw>
lapicw(ICRLO, BCAST | INIT | LEVEL);
80102e42: c7 44 24 04 00 85 08 movl $0x88500,0x4(%esp)
80102e49: 00
80102e4a: c7 04 24 c0 00 00 00 movl $0xc0,(%esp)
80102e51: e8 b0 fe ff ff call 80102d06 <lapicw>
while(lapic[ICRLO] & DELIVS)
80102e56: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102e5b: 05 00 03 00 00 add $0x300,%eax
80102e60: 8b 00 mov (%eax),%eax
80102e62: 25 00 10 00 00 and $0x1000,%eax
80102e67: 85 c0 test %eax,%eax
80102e69: 75 eb jne 80102e56 <lapicinit+0x12e>
;
// Enable interrupts on the APIC (but not on the processor).
lapicw(TPR, 0);
80102e6b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102e72: 00
80102e73: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80102e7a: e8 87 fe ff ff call 80102d06 <lapicw>
80102e7f: eb 01 jmp 80102e82 <lapicinit+0x15a>
void
lapicinit(void)
{
if(!lapic)
return;
80102e81: 90 nop
while(lapic[ICRLO] & DELIVS)
;
// Enable interrupts on the APIC (but not on the processor).
lapicw(TPR, 0);
}
80102e82: c9 leave
80102e83: c3 ret
80102e84 <cpunum>:
int
cpunum(void)
{
80102e84: 55 push %ebp
80102e85: 89 e5 mov %esp,%ebp
80102e87: 83 ec 18 sub $0x18,%esp
// Cannot call cpu when interrupts are enabled:
// result not guaranteed to last long enough to be used!
// Would prefer to panic but even printing is chancy here:
// almost everything, including cprintf and panic, calls cpu,
// often indirectly through acquire and release.
if(readeflags()&FL_IF){
80102e8a: e8 67 fe ff ff call 80102cf6 <readeflags>
80102e8f: 25 00 02 00 00 and $0x200,%eax
80102e94: 85 c0 test %eax,%eax
80102e96: 74 29 je 80102ec1 <cpunum+0x3d>
static int n;
if(n++ == 0)
80102e98: a1 60 b6 10 80 mov 0x8010b660,%eax
80102e9d: 85 c0 test %eax,%eax
80102e9f: 0f 94 c2 sete %dl
80102ea2: 83 c0 01 add $0x1,%eax
80102ea5: a3 60 b6 10 80 mov %eax,0x8010b660
80102eaa: 84 d2 test %dl,%dl
80102eac: 74 13 je 80102ec1 <cpunum+0x3d>
cprintf("cpu called from %x with interrupts enabled\n",
80102eae: 8b 45 04 mov 0x4(%ebp),%eax
80102eb1: 89 44 24 04 mov %eax,0x4(%esp)
80102eb5: c7 04 24 d8 87 10 80 movl $0x801087d8,(%esp)
80102ebc: e8 d9 d4 ff ff call 8010039a <cprintf>
__builtin_return_address(0));
}
if(lapic)
80102ec1: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102ec6: 85 c0 test %eax,%eax
80102ec8: 74 0f je 80102ed9 <cpunum+0x55>
return lapic[ID]>>24;
80102eca: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102ecf: 83 c0 20 add $0x20,%eax
80102ed2: 8b 00 mov (%eax),%eax
80102ed4: c1 e8 18 shr $0x18,%eax
80102ed7: eb 05 jmp 80102ede <cpunum+0x5a>
return 0;
80102ed9: b8 00 00 00 00 mov $0x0,%eax
}
80102ede: c9 leave
80102edf: c3 ret
80102ee0 <lapiceoi>:
// Acknowledge interrupt.
void
lapiceoi(void)
{
80102ee0: 55 push %ebp
80102ee1: 89 e5 mov %esp,%ebp
80102ee3: 83 ec 08 sub $0x8,%esp
if(lapic)
80102ee6: a1 9c f8 10 80 mov 0x8010f89c,%eax
80102eeb: 85 c0 test %eax,%eax
80102eed: 74 14 je 80102f03 <lapiceoi+0x23>
lapicw(EOI, 0);
80102eef: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80102ef6: 00
80102ef7: c7 04 24 2c 00 00 00 movl $0x2c,(%esp)
80102efe: e8 03 fe ff ff call 80102d06 <lapicw>
}
80102f03: c9 leave
80102f04: c3 ret
80102f05 <microdelay>:
// Spin for a given number of microseconds.
// On real hardware would want to tune this dynamically.
void
microdelay(int us)
{
80102f05: 55 push %ebp
80102f06: 89 e5 mov %esp,%ebp
}
80102f08: 5d pop %ebp
80102f09: c3 ret
80102f0a <lapicstartap>:
// Start additional processor running entry code at addr.
// See Appendix B of MultiProcessor Specification.
void
lapicstartap(uchar apicid, uint addr)
{
80102f0a: 55 push %ebp
80102f0b: 89 e5 mov %esp,%ebp
80102f0d: 83 ec 1c sub $0x1c,%esp
80102f10: 8b 45 08 mov 0x8(%ebp),%eax
80102f13: 88 45 ec mov %al,-0x14(%ebp)
ushort *wrv;
// "The BSP must initialize CMOS shutdown code to 0AH
// and the warm reset vector (DWORD based at 40:67) to point at
// the AP startup code prior to the [universal startup algorithm]."
outb(IO_RTC, 0xF); // offset 0xF is shutdown code
80102f16: c7 44 24 04 0f 00 00 movl $0xf,0x4(%esp)
80102f1d: 00
80102f1e: c7 04 24 70 00 00 00 movl $0x70,(%esp)
80102f25: e8 ae fd ff ff call 80102cd8 <outb>
outb(IO_RTC+1, 0x0A);
80102f2a: c7 44 24 04 0a 00 00 movl $0xa,0x4(%esp)
80102f31: 00
80102f32: c7 04 24 71 00 00 00 movl $0x71,(%esp)
80102f39: e8 9a fd ff ff call 80102cd8 <outb>
wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector
80102f3e: c7 45 fc 67 04 00 80 movl $0x80000467,-0x4(%ebp)
wrv[0] = 0;
80102f45: 8b 45 fc mov -0x4(%ebp),%eax
80102f48: 66 c7 00 00 00 movw $0x0,(%eax)
wrv[1] = addr >> 4;
80102f4d: 8b 45 fc mov -0x4(%ebp),%eax
80102f50: 8d 50 02 lea 0x2(%eax),%edx
80102f53: 8b 45 0c mov 0xc(%ebp),%eax
80102f56: c1 e8 04 shr $0x4,%eax
80102f59: 66 89 02 mov %ax,(%edx)
// "Universal startup algorithm."
// Send INIT (level-triggered) interrupt to reset other CPU.
lapicw(ICRHI, apicid<<24);
80102f5c: 0f b6 45 ec movzbl -0x14(%ebp),%eax
80102f60: c1 e0 18 shl $0x18,%eax
80102f63: 89 44 24 04 mov %eax,0x4(%esp)
80102f67: c7 04 24 c4 00 00 00 movl $0xc4,(%esp)
80102f6e: e8 93 fd ff ff call 80102d06 <lapicw>
lapicw(ICRLO, INIT | LEVEL | ASSERT);
80102f73: c7 44 24 04 00 c5 00 movl $0xc500,0x4(%esp)
80102f7a: 00
80102f7b: c7 04 24 c0 00 00 00 movl $0xc0,(%esp)
80102f82: e8 7f fd ff ff call 80102d06 <lapicw>
microdelay(200);
80102f87: c7 04 24 c8 00 00 00 movl $0xc8,(%esp)
80102f8e: e8 72 ff ff ff call 80102f05 <microdelay>
lapicw(ICRLO, INIT | LEVEL);
80102f93: c7 44 24 04 00 85 00 movl $0x8500,0x4(%esp)
80102f9a: 00
80102f9b: c7 04 24 c0 00 00 00 movl $0xc0,(%esp)
80102fa2: e8 5f fd ff ff call 80102d06 <lapicw>
microdelay(100); // should be 10ms, but too slow in Bochs!
80102fa7: c7 04 24 64 00 00 00 movl $0x64,(%esp)
80102fae: e8 52 ff ff ff call 80102f05 <microdelay>
// Send startup IPI (twice!) to enter code.
// Regular hardware is supposed to only accept a STARTUP
// when it is in the halted state due to an INIT. So the second
// should be ignored, but it is part of the official Intel algorithm.
// Bochs complains about the second one. Too bad for Bochs.
for(i = 0; i < 2; i++){
80102fb3: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%ebp)
80102fba: eb 40 jmp 80102ffc <lapicstartap+0xf2>
lapicw(ICRHI, apicid<<24);
80102fbc: 0f b6 45 ec movzbl -0x14(%ebp),%eax
80102fc0: c1 e0 18 shl $0x18,%eax
80102fc3: 89 44 24 04 mov %eax,0x4(%esp)
80102fc7: c7 04 24 c4 00 00 00 movl $0xc4,(%esp)
80102fce: e8 33 fd ff ff call 80102d06 <lapicw>
lapicw(ICRLO, STARTUP | (addr>>12));
80102fd3: 8b 45 0c mov 0xc(%ebp),%eax
80102fd6: c1 e8 0c shr $0xc,%eax
80102fd9: 80 cc 06 or $0x6,%ah
80102fdc: 89 44 24 04 mov %eax,0x4(%esp)
80102fe0: c7 04 24 c0 00 00 00 movl $0xc0,(%esp)
80102fe7: e8 1a fd ff ff call 80102d06 <lapicw>
microdelay(200);
80102fec: c7 04 24 c8 00 00 00 movl $0xc8,(%esp)
80102ff3: e8 0d ff ff ff call 80102f05 <microdelay>
// Send startup IPI (twice!) to enter code.
// Regular hardware is supposed to only accept a STARTUP
// when it is in the halted state due to an INIT. So the second
// should be ignored, but it is part of the official Intel algorithm.
// Bochs complains about the second one. Too bad for Bochs.
for(i = 0; i < 2; i++){
80102ff8: 83 45 f8 01 addl $0x1,-0x8(%ebp)
80102ffc: 83 7d f8 01 cmpl $0x1,-0x8(%ebp)
80103000: 7e ba jle 80102fbc <lapicstartap+0xb2>
lapicw(ICRHI, apicid<<24);
lapicw(ICRLO, STARTUP | (addr>>12));
microdelay(200);
}
}
80103002: c9 leave
80103003: c3 ret
80103004 <initlog>:
static void recover_from_log(void);
void
initlog(void)
{
80103004: 55 push %ebp
80103005: 89 e5 mov %esp,%ebp
80103007: 83 ec 28 sub $0x28,%esp
if (sizeof(struct logheader) >= BSIZE)
8010300a: 90 nop
panic("initlog: too big logheader");
struct superblock sb;
initlock(&log.lock, "log");
8010300b: c7 44 24 04 04 88 10 movl $0x80108804,0x4(%esp)
80103012: 80
80103013: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
8010301a: e8 0f 1f 00 00 call 80104f2e <initlock>
readsb(ROOTDEV, &sb);
8010301f: 8d 45 e8 lea -0x18(%ebp),%eax
80103022: 89 44 24 04 mov %eax,0x4(%esp)
80103026: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010302d: e8 c2 e2 ff ff call 801012f4 <readsb>
log.start = sb.size - sb.nlog;
80103032: 8b 55 e8 mov -0x18(%ebp),%edx
80103035: 8b 45 f4 mov -0xc(%ebp),%eax
80103038: 89 d1 mov %edx,%ecx
8010303a: 29 c1 sub %eax,%ecx
8010303c: 89 c8 mov %ecx,%eax
8010303e: a3 d4 f8 10 80 mov %eax,0x8010f8d4
log.size = sb.nlog;
80103043: 8b 45 f4 mov -0xc(%ebp),%eax
80103046: a3 d8 f8 10 80 mov %eax,0x8010f8d8
log.dev = ROOTDEV;
8010304b: c7 05 e0 f8 10 80 01 movl $0x1,0x8010f8e0
80103052: 00 00 00
recover_from_log();
80103055: e8 97 01 00 00 call 801031f1 <recover_from_log>
}
8010305a: c9 leave
8010305b: c3 ret
8010305c <install_trans>:
// Copy committed blocks from log to their home location
static void
install_trans(void)
{
8010305c: 55 push %ebp
8010305d: 89 e5 mov %esp,%ebp
8010305f: 83 ec 28 sub $0x28,%esp
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80103062: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80103069: e9 89 00 00 00 jmp 801030f7 <install_trans+0x9b>
struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
8010306e: a1 d4 f8 10 80 mov 0x8010f8d4,%eax
80103073: 03 45 ec add -0x14(%ebp),%eax
80103076: 83 c0 01 add $0x1,%eax
80103079: 89 c2 mov %eax,%edx
8010307b: a1 e0 f8 10 80 mov 0x8010f8e0,%eax
80103080: 89 54 24 04 mov %edx,0x4(%esp)
80103084: 89 04 24 mov %eax,(%esp)
80103087: e8 1b d1 ff ff call 801001a7 <bread>
8010308c: 89 45 f0 mov %eax,-0x10(%ebp)
struct buf *dbuf = bread(log.dev, log.lh.sector[tail]); // read dst
8010308f: 8b 45 ec mov -0x14(%ebp),%eax
80103092: 83 c0 10 add $0x10,%eax
80103095: 8b 04 85 a8 f8 10 80 mov -0x7fef0758(,%eax,4),%eax
8010309c: 89 c2 mov %eax,%edx
8010309e: a1 e0 f8 10 80 mov 0x8010f8e0,%eax
801030a3: 89 54 24 04 mov %edx,0x4(%esp)
801030a7: 89 04 24 mov %eax,(%esp)
801030aa: e8 f8 d0 ff ff call 801001a7 <bread>
801030af: 89 45 f4 mov %eax,-0xc(%ebp)
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
801030b2: 8b 45 f0 mov -0x10(%ebp),%eax
801030b5: 8d 50 18 lea 0x18(%eax),%edx
801030b8: 8b 45 f4 mov -0xc(%ebp),%eax
801030bb: 83 c0 18 add $0x18,%eax
801030be: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
801030c5: 00
801030c6: 89 54 24 04 mov %edx,0x4(%esp)
801030ca: 89 04 24 mov %eax,(%esp)
801030cd: e8 9f 21 00 00 call 80105271 <memmove>
bwrite(dbuf); // write dst to disk
801030d2: 8b 45 f4 mov -0xc(%ebp),%eax
801030d5: 89 04 24 mov %eax,(%esp)
801030d8: e8 01 d1 ff ff call 801001de <bwrite>
brelse(lbuf);
801030dd: 8b 45 f0 mov -0x10(%ebp),%eax
801030e0: 89 04 24 mov %eax,(%esp)
801030e3: e8 30 d1 ff ff call 80100218 <brelse>
brelse(dbuf);
801030e8: 8b 45 f4 mov -0xc(%ebp),%eax
801030eb: 89 04 24 mov %eax,(%esp)
801030ee: e8 25 d1 ff ff call 80100218 <brelse>
static void
install_trans(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
801030f3: 83 45 ec 01 addl $0x1,-0x14(%ebp)
801030f7: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
801030fc: 3b 45 ec cmp -0x14(%ebp),%eax
801030ff: 0f 8f 69 ff ff ff jg 8010306e <install_trans+0x12>
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
bwrite(dbuf); // write dst to disk
brelse(lbuf);
brelse(dbuf);
}
}
80103105: c9 leave
80103106: c3 ret
80103107 <read_head>:
// Read the log header from disk into the in-memory log header
static void
read_head(void)
{
80103107: 55 push %ebp
80103108: 89 e5 mov %esp,%ebp
8010310a: 83 ec 28 sub $0x28,%esp
struct buf *buf = bread(log.dev, log.start);
8010310d: a1 d4 f8 10 80 mov 0x8010f8d4,%eax
80103112: 89 c2 mov %eax,%edx
80103114: a1 e0 f8 10 80 mov 0x8010f8e0,%eax
80103119: 89 54 24 04 mov %edx,0x4(%esp)
8010311d: 89 04 24 mov %eax,(%esp)
80103120: e8 82 d0 ff ff call 801001a7 <bread>
80103125: 89 45 ec mov %eax,-0x14(%ebp)
struct logheader *lh = (struct logheader *) (buf->data);
80103128: 8b 45 ec mov -0x14(%ebp),%eax
8010312b: 83 c0 18 add $0x18,%eax
8010312e: 89 45 f0 mov %eax,-0x10(%ebp)
int i;
log.lh.n = lh->n;
80103131: 8b 45 f0 mov -0x10(%ebp),%eax
80103134: 8b 00 mov (%eax),%eax
80103136: a3 e4 f8 10 80 mov %eax,0x8010f8e4
for (i = 0; i < log.lh.n; i++) {
8010313b: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80103142: eb 1b jmp 8010315f <read_head+0x58>
log.lh.sector[i] = lh->sector[i];
80103144: 8b 4d f4 mov -0xc(%ebp),%ecx
80103147: 8b 55 f4 mov -0xc(%ebp),%edx
8010314a: 8b 45 f0 mov -0x10(%ebp),%eax
8010314d: 8b 44 90 04 mov 0x4(%eax,%edx,4),%eax
80103151: 8d 51 10 lea 0x10(%ecx),%edx
80103154: 89 04 95 a8 f8 10 80 mov %eax,-0x7fef0758(,%edx,4)
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *lh = (struct logheader *) (buf->data);
int i;
log.lh.n = lh->n;
for (i = 0; i < log.lh.n; i++) {
8010315b: 83 45 f4 01 addl $0x1,-0xc(%ebp)
8010315f: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
80103164: 3b 45 f4 cmp -0xc(%ebp),%eax
80103167: 7f db jg 80103144 <read_head+0x3d>
log.lh.sector[i] = lh->sector[i];
}
brelse(buf);
80103169: 8b 45 ec mov -0x14(%ebp),%eax
8010316c: 89 04 24 mov %eax,(%esp)
8010316f: e8 a4 d0 ff ff call 80100218 <brelse>
}
80103174: c9 leave
80103175: c3 ret
80103176 <write_head>:
// Write in-memory log header to disk.
// This is the true point at which the
// current transaction commits.
static void
write_head(void)
{
80103176: 55 push %ebp
80103177: 89 e5 mov %esp,%ebp
80103179: 83 ec 28 sub $0x28,%esp
struct buf *buf = bread(log.dev, log.start);
8010317c: a1 d4 f8 10 80 mov 0x8010f8d4,%eax
80103181: 89 c2 mov %eax,%edx
80103183: a1 e0 f8 10 80 mov 0x8010f8e0,%eax
80103188: 89 54 24 04 mov %edx,0x4(%esp)
8010318c: 89 04 24 mov %eax,(%esp)
8010318f: e8 13 d0 ff ff call 801001a7 <bread>
80103194: 89 45 ec mov %eax,-0x14(%ebp)
struct logheader *hb = (struct logheader *) (buf->data);
80103197: 8b 45 ec mov -0x14(%ebp),%eax
8010319a: 83 c0 18 add $0x18,%eax
8010319d: 89 45 f0 mov %eax,-0x10(%ebp)
int i;
hb->n = log.lh.n;
801031a0: 8b 15 e4 f8 10 80 mov 0x8010f8e4,%edx
801031a6: 8b 45 f0 mov -0x10(%ebp),%eax
801031a9: 89 10 mov %edx,(%eax)
for (i = 0; i < log.lh.n; i++) {
801031ab: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
801031b2: eb 1b jmp 801031cf <write_head+0x59>
hb->sector[i] = log.lh.sector[i];
801031b4: 8b 55 f4 mov -0xc(%ebp),%edx
801031b7: 8b 45 f4 mov -0xc(%ebp),%eax
801031ba: 83 c0 10 add $0x10,%eax
801031bd: 8b 0c 85 a8 f8 10 80 mov -0x7fef0758(,%eax,4),%ecx
801031c4: 8b 45 f0 mov -0x10(%ebp),%eax
801031c7: 89 4c 90 04 mov %ecx,0x4(%eax,%edx,4)
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
for (i = 0; i < log.lh.n; i++) {
801031cb: 83 45 f4 01 addl $0x1,-0xc(%ebp)
801031cf: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
801031d4: 3b 45 f4 cmp -0xc(%ebp),%eax
801031d7: 7f db jg 801031b4 <write_head+0x3e>
hb->sector[i] = log.lh.sector[i];
}
bwrite(buf);
801031d9: 8b 45 ec mov -0x14(%ebp),%eax
801031dc: 89 04 24 mov %eax,(%esp)
801031df: e8 fa cf ff ff call 801001de <bwrite>
brelse(buf);
801031e4: 8b 45 ec mov -0x14(%ebp),%eax
801031e7: 89 04 24 mov %eax,(%esp)
801031ea: e8 29 d0 ff ff call 80100218 <brelse>
}
801031ef: c9 leave
801031f0: c3 ret
801031f1 <recover_from_log>:
static void
recover_from_log(void)
{
801031f1: 55 push %ebp
801031f2: 89 e5 mov %esp,%ebp
801031f4: 83 ec 08 sub $0x8,%esp
read_head();
801031f7: e8 0b ff ff ff call 80103107 <read_head>
install_trans(); // if committed, copy from log to disk
801031fc: e8 5b fe ff ff call 8010305c <install_trans>
log.lh.n = 0;
80103201: c7 05 e4 f8 10 80 00 movl $0x0,0x8010f8e4
80103208: 00 00 00
write_head(); // clear the log
8010320b: e8 66 ff ff ff call 80103176 <write_head>
}
80103210: c9 leave
80103211: c3 ret
80103212 <begin_trans>:
void
begin_trans(void)
{
80103212: 55 push %ebp
80103213: 89 e5 mov %esp,%ebp
80103215: 83 ec 18 sub $0x18,%esp
acquire(&log.lock);
80103218: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
8010321f: e8 2b 1d 00 00 call 80104f4f <acquire>
while (log.busy) {
80103224: eb 14 jmp 8010323a <begin_trans+0x28>
sleep(&log, &log.lock);
80103226: c7 44 24 04 a0 f8 10 movl $0x8010f8a0,0x4(%esp)
8010322d: 80
8010322e: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
80103235: e8 9c 19 00 00 call 80104bd6 <sleep>
void
begin_trans(void)
{
acquire(&log.lock);
while (log.busy) {
8010323a: a1 dc f8 10 80 mov 0x8010f8dc,%eax
8010323f: 85 c0 test %eax,%eax
80103241: 75 e3 jne 80103226 <begin_trans+0x14>
sleep(&log, &log.lock);
}
log.busy = 1;
80103243: c7 05 dc f8 10 80 01 movl $0x1,0x8010f8dc
8010324a: 00 00 00
release(&log.lock);
8010324d: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
80103254: e8 57 1d 00 00 call 80104fb0 <release>
}
80103259: c9 leave
8010325a: c3 ret
8010325b <commit_trans>:
void
commit_trans(void)
{
8010325b: 55 push %ebp
8010325c: 89 e5 mov %esp,%ebp
8010325e: 83 ec 18 sub $0x18,%esp
if (log.lh.n > 0) {
80103261: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
80103266: 85 c0 test %eax,%eax
80103268: 7e 19 jle 80103283 <commit_trans+0x28>
write_head(); // Write header to disk -- the real commit
8010326a: e8 07 ff ff ff call 80103176 <write_head>
install_trans(); // Now install writes to home locations
8010326f: e8 e8 fd ff ff call 8010305c <install_trans>
log.lh.n = 0;
80103274: c7 05 e4 f8 10 80 00 movl $0x0,0x8010f8e4
8010327b: 00 00 00
write_head(); // Erase the transaction from the log
8010327e: e8 f3 fe ff ff call 80103176 <write_head>
}
acquire(&log.lock);
80103283: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
8010328a: e8 c0 1c 00 00 call 80104f4f <acquire>
log.busy = 0;
8010328f: c7 05 dc f8 10 80 00 movl $0x0,0x8010f8dc
80103296: 00 00 00
wakeup(&log);
80103299: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
801032a0: e8 77 1a 00 00 call 80104d1c <wakeup>
release(&log.lock);
801032a5: c7 04 24 a0 f8 10 80 movl $0x8010f8a0,(%esp)
801032ac: e8 ff 1c 00 00 call 80104fb0 <release>
}
801032b1: c9 leave
801032b2: c3 ret
801032b3 <log_write>:
// modify bp->data[]
// log_write(bp)
// brelse(bp)
void
log_write(struct buf *b)
{
801032b3: 55 push %ebp
801032b4: 89 e5 mov %esp,%ebp
801032b6: 83 ec 28 sub $0x28,%esp
int i;
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
801032b9: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
801032be: 83 f8 09 cmp $0x9,%eax
801032c1: 7f 12 jg 801032d5 <log_write+0x22>
801032c3: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
801032c8: 8b 15 d8 f8 10 80 mov 0x8010f8d8,%edx
801032ce: 83 ea 01 sub $0x1,%edx
801032d1: 39 d0 cmp %edx,%eax
801032d3: 7c 0c jl 801032e1 <log_write+0x2e>
panic("too big a transaction");
801032d5: c7 04 24 08 88 10 80 movl $0x80108808,(%esp)
801032dc: e8 59 d2 ff ff call 8010053a <panic>
if (!log.busy)
801032e1: a1 dc f8 10 80 mov 0x8010f8dc,%eax
801032e6: 85 c0 test %eax,%eax
801032e8: 75 0c jne 801032f6 <log_write+0x43>
panic("write outside of trans");
801032ea: c7 04 24 1e 88 10 80 movl $0x8010881e,(%esp)
801032f1: e8 44 d2 ff ff call 8010053a <panic>
for (i = 0; i < log.lh.n; i++) {
801032f6: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
801032fd: eb 1d jmp 8010331c <log_write+0x69>
if (log.lh.sector[i] == b->sector) // log absorbtion?
801032ff: 8b 45 f0 mov -0x10(%ebp),%eax
80103302: 83 c0 10 add $0x10,%eax
80103305: 8b 04 85 a8 f8 10 80 mov -0x7fef0758(,%eax,4),%eax
8010330c: 89 c2 mov %eax,%edx
8010330e: 8b 45 08 mov 0x8(%ebp),%eax
80103311: 8b 40 08 mov 0x8(%eax),%eax
80103314: 39 c2 cmp %eax,%edx
80103316: 74 10 je 80103328 <log_write+0x75>
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
panic("too big a transaction");
if (!log.busy)
panic("write outside of trans");
for (i = 0; i < log.lh.n; i++) {
80103318: 83 45 f0 01 addl $0x1,-0x10(%ebp)
8010331c: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
80103321: 3b 45 f0 cmp -0x10(%ebp),%eax
80103324: 7f d9 jg 801032ff <log_write+0x4c>
80103326: eb 01 jmp 80103329 <log_write+0x76>
if (log.lh.sector[i] == b->sector) // log absorbtion?
break;
80103328: 90 nop
}
log.lh.sector[i] = b->sector;
80103329: 8b 55 f0 mov -0x10(%ebp),%edx
8010332c: 8b 45 08 mov 0x8(%ebp),%eax
8010332f: 8b 40 08 mov 0x8(%eax),%eax
80103332: 83 c2 10 add $0x10,%edx
80103335: 89 04 95 a8 f8 10 80 mov %eax,-0x7fef0758(,%edx,4)
struct buf *lbuf = bread(b->dev, log.start+i+1);
8010333c: a1 d4 f8 10 80 mov 0x8010f8d4,%eax
80103341: 03 45 f0 add -0x10(%ebp),%eax
80103344: 83 c0 01 add $0x1,%eax
80103347: 89 c2 mov %eax,%edx
80103349: 8b 45 08 mov 0x8(%ebp),%eax
8010334c: 8b 40 04 mov 0x4(%eax),%eax
8010334f: 89 54 24 04 mov %edx,0x4(%esp)
80103353: 89 04 24 mov %eax,(%esp)
80103356: e8 4c ce ff ff call 801001a7 <bread>
8010335b: 89 45 f4 mov %eax,-0xc(%ebp)
memmove(lbuf->data, b->data, BSIZE);
8010335e: 8b 45 08 mov 0x8(%ebp),%eax
80103361: 8d 50 18 lea 0x18(%eax),%edx
80103364: 8b 45 f4 mov -0xc(%ebp),%eax
80103367: 83 c0 18 add $0x18,%eax
8010336a: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
80103371: 00
80103372: 89 54 24 04 mov %edx,0x4(%esp)
80103376: 89 04 24 mov %eax,(%esp)
80103379: e8 f3 1e 00 00 call 80105271 <memmove>
bwrite(lbuf);
8010337e: 8b 45 f4 mov -0xc(%ebp),%eax
80103381: 89 04 24 mov %eax,(%esp)
80103384: e8 55 ce ff ff call 801001de <bwrite>
brelse(lbuf);
80103389: 8b 45 f4 mov -0xc(%ebp),%eax
8010338c: 89 04 24 mov %eax,(%esp)
8010338f: e8 84 ce ff ff call 80100218 <brelse>
if (i == log.lh.n)
80103394: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
80103399: 3b 45 f0 cmp -0x10(%ebp),%eax
8010339c: 75 0d jne 801033ab <log_write+0xf8>
log.lh.n++;
8010339e: a1 e4 f8 10 80 mov 0x8010f8e4,%eax
801033a3: 83 c0 01 add $0x1,%eax
801033a6: a3 e4 f8 10 80 mov %eax,0x8010f8e4
b->flags |= B_DIRTY; // XXX prevent eviction
801033ab: 8b 45 08 mov 0x8(%ebp),%eax
801033ae: 8b 00 mov (%eax),%eax
801033b0: 89 c2 mov %eax,%edx
801033b2: 83 ca 04 or $0x4,%edx
801033b5: 8b 45 08 mov 0x8(%ebp),%eax
801033b8: 89 10 mov %edx,(%eax)
}
801033ba: c9 leave
801033bb: c3 ret
801033bc <v2p>:
801033bc: 55 push %ebp
801033bd: 89 e5 mov %esp,%ebp
801033bf: 8b 45 08 mov 0x8(%ebp),%eax
801033c2: 2d 00 00 00 80 sub $0x80000000,%eax
801033c7: 5d pop %ebp
801033c8: c3 ret
801033c9 <p2v>:
static inline void *p2v(uint a) { return (void *) ((a) + KERNBASE); }
801033c9: 55 push %ebp
801033ca: 89 e5 mov %esp,%ebp
801033cc: 8b 45 08 mov 0x8(%ebp),%eax
801033cf: 2d 00 00 00 80 sub $0x80000000,%eax
801033d4: 5d pop %ebp
801033d5: c3 ret
801033d6 <xchg>:
asm volatile("sti");
}
static inline uint
xchg(volatile uint *addr, uint newval)
{
801033d6: 55 push %ebp
801033d7: 89 e5 mov %esp,%ebp
801033d9: 83 ec 10 sub $0x10,%esp
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
801033dc: 8b 55 08 mov 0x8(%ebp),%edx
801033df: 8b 45 0c mov 0xc(%ebp),%eax
801033e2: 8b 4d 08 mov 0x8(%ebp),%ecx
801033e5: f0 87 02 lock xchg %eax,(%edx)
801033e8: 89 45 fc mov %eax,-0x4(%ebp)
"+m" (*addr), "=a" (result) :
"1" (newval) :
"cc");
return result;
801033eb: 8b 45 fc mov -0x4(%ebp),%eax
}
801033ee: c9 leave
801033ef: c3 ret
801033f0 <main>:
// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
int
main(void)
{
801033f0: 55 push %ebp
801033f1: 89 e5 mov %esp,%ebp
801033f3: 83 e4 f0 and $0xfffffff0,%esp
801033f6: 83 ec 10 sub $0x10,%esp
kinit1(end, P2V(4*1024*1024)); // phys page allocator
801033f9: c7 44 24 04 00 00 40 movl $0x80400000,0x4(%esp)
80103400: 80
80103401: c7 04 24 1c 29 11 80 movl $0x8011291c,(%esp)
80103408: e8 cc f5 ff ff call 801029d9 <kinit1>
kvmalloc(); // kernel page table
8010340d: e8 3d 4a 00 00 call 80107e4f <kvmalloc>
mpinit(); // collect info about this machine
80103412: e8 45 04 00 00 call 8010385c <mpinit>
lapicinit();
80103417: e8 0c f9 ff ff call 80102d28 <lapicinit>
seginit(); // set up segments
8010341c: e8 d0 43 00 00 call 801077f1 <seginit>
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
80103421: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80103427: 0f b6 00 movzbl (%eax),%eax
8010342a: 0f b6 c0 movzbl %al,%eax
8010342d: 89 44 24 04 mov %eax,0x4(%esp)
80103431: c7 04 24 35 88 10 80 movl $0x80108835,(%esp)
80103438: e8 5d cf ff ff call 8010039a <cprintf>
picinit(); // interrupt controller
8010343d: e8 80 06 00 00 call 80103ac2 <picinit>
ioapicinit(); // another interrupt controller
80103442: e8 82 f4 ff ff call 801028c9 <ioapicinit>
consoleinit(); // I/O devices & their interrupts
80103447: e8 3c d6 ff ff call 80100a88 <consoleinit>
uartinit(); // serial port
8010344c: e8 ea 36 00 00 call 80106b3b <uartinit>
pinit(); // process table
80103451: e8 03 0c 00 00 call 80104059 <pinit>
tvinit(); // trap vectors
80103456: e8 93 32 00 00 call 801066ee <tvinit>
binit(); // buffer cache
8010345b: e8 d4 cb ff ff call 80100034 <binit>
fileinit(); // file table
80103460: e8 a3 da ff ff call 80100f08 <fileinit>
iinit(); // inode cache
80103465: e8 58 e1 ff ff call 801015c2 <iinit>
ideinit(); // disk
8010346a: e8 c1 f0 ff ff call 80102530 <ideinit>
if(!ismp)
8010346f: a1 24 f9 10 80 mov 0x8010f924,%eax
80103474: 85 c0 test %eax,%eax
80103476: 75 05 jne 8010347d <main+0x8d>
timerinit(); // uniprocessor timer
80103478: e8 b9 31 00 00 call 80106636 <timerinit>
startothers(); // start other processors
8010347d: e8 7f 00 00 00 call 80103501 <startothers>
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
80103482: c7 44 24 04 00 00 00 movl $0x8e000000,0x4(%esp)
80103489: 8e
8010348a: c7 04 24 00 00 40 80 movl $0x80400000,(%esp)
80103491: e8 7b f5 ff ff call 80102a11 <kinit2>
userinit(); // first user process
80103496: e8 dd 0c 00 00 call 80104178 <userinit>
// Finish setting up this processor in mpmain.
mpmain();
8010349b: e8 1a 00 00 00 call 801034ba <mpmain>
801034a0 <mpenter>:
}
// Other CPUs jump here from entryother.S.
static void
mpenter(void)
{
801034a0: 55 push %ebp
801034a1: 89 e5 mov %esp,%ebp
801034a3: 83 ec 08 sub $0x8,%esp
switchkvm();
801034a6: e8 bb 49 00 00 call 80107e66 <switchkvm>
seginit();
801034ab: e8 41 43 00 00 call 801077f1 <seginit>
lapicinit();
801034b0: e8 73 f8 ff ff call 80102d28 <lapicinit>
mpmain();
801034b5: e8 00 00 00 00 call 801034ba <mpmain>
801034ba <mpmain>:
}
// Common CPU setup code.
static void
mpmain(void)
{
801034ba: 55 push %ebp
801034bb: 89 e5 mov %esp,%ebp
801034bd: 83 ec 18 sub $0x18,%esp
cprintf("cpu%d: starting\n", cpu->id);
801034c0: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801034c6: 0f b6 00 movzbl (%eax),%eax
801034c9: 0f b6 c0 movzbl %al,%eax
801034cc: 89 44 24 04 mov %eax,0x4(%esp)
801034d0: c7 04 24 4c 88 10 80 movl $0x8010884c,(%esp)
801034d7: e8 be ce ff ff call 8010039a <cprintf>
idtinit(); // load idt register
801034dc: e8 7d 33 00 00 call 8010685e <idtinit>
xchg(&cpu->started, 1); // tell startothers() we're up
801034e1: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801034e7: 05 a8 00 00 00 add $0xa8,%eax
801034ec: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
801034f3: 00
801034f4: 89 04 24 mov %eax,(%esp)
801034f7: e8 da fe ff ff call 801033d6 <xchg>
scheduler(); // start running processes
801034fc: e8 da 14 00 00 call 801049db <scheduler>
80103501 <startothers>:
pde_t entrypgdir[]; // For entry.S
// Start the non-boot (AP) processors.
static void
startothers(void)
{
80103501: 55 push %ebp
80103502: 89 e5 mov %esp,%ebp
80103504: 53 push %ebx
80103505: 83 ec 24 sub $0x24,%esp
char *stack;
// Write entry code to unused memory at 0x7000.
// The linker has placed the image of entryother.S in
// _binary_entryother_start.
code = p2v(0x7000);
80103508: c7 04 24 00 70 00 00 movl $0x7000,(%esp)
8010350f: e8 b5 fe ff ff call 801033c9 <p2v>
80103514: 89 45 ec mov %eax,-0x14(%ebp)
memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
80103517: b8 8a 00 00 00 mov $0x8a,%eax
8010351c: 89 44 24 08 mov %eax,0x8(%esp)
80103520: c7 44 24 04 2c b5 10 movl $0x8010b52c,0x4(%esp)
80103527: 80
80103528: 8b 45 ec mov -0x14(%ebp),%eax
8010352b: 89 04 24 mov %eax,(%esp)
8010352e: e8 3e 1d 00 00 call 80105271 <memmove>
for(c = cpus; c < cpus+ncpu; c++){
80103533: c7 45 f0 40 f9 10 80 movl $0x8010f940,-0x10(%ebp)
8010353a: e9 85 00 00 00 jmp 801035c4 <startothers+0xc3>
if(c == cpus+cpunum()) // We've started already.
8010353f: e8 40 f9 ff ff call 80102e84 <cpunum>
80103544: 69 c0 bc 00 00 00 imul $0xbc,%eax,%eax
8010354a: 05 40 f9 10 80 add $0x8010f940,%eax
8010354f: 3b 45 f0 cmp -0x10(%ebp),%eax
80103552: 74 68 je 801035bc <startothers+0xbb>
continue;
// Tell entryother.S what stack to use, where to enter, and what
// pgdir to use. We cannot use kpgdir yet, because the AP processor
// is running in low memory, so we use entrypgdir for the APs too.
stack = kalloc();
80103554: e8 b1 f5 ff ff call 80102b0a <kalloc>
80103559: 89 45 f4 mov %eax,-0xc(%ebp)
*(void**)(code-4) = stack + KSTACKSIZE;
8010355c: 8b 45 ec mov -0x14(%ebp),%eax
8010355f: 83 e8 04 sub $0x4,%eax
80103562: 8b 55 f4 mov -0xc(%ebp),%edx
80103565: 81 c2 00 10 00 00 add $0x1000,%edx
8010356b: 89 10 mov %edx,(%eax)
*(void**)(code-8) = mpenter;
8010356d: 8b 45 ec mov -0x14(%ebp),%eax
80103570: 83 e8 08 sub $0x8,%eax
80103573: c7 00 a0 34 10 80 movl $0x801034a0,(%eax)
*(int**)(code-12) = (void *) v2p(entrypgdir);
80103579: 8b 45 ec mov -0x14(%ebp),%eax
8010357c: 8d 58 f4 lea -0xc(%eax),%ebx
8010357f: c7 04 24 00 a0 10 80 movl $0x8010a000,(%esp)
80103586: e8 31 fe ff ff call 801033bc <v2p>
8010358b: 89 03 mov %eax,(%ebx)
lapicstartap(c->id, v2p(code));
8010358d: 8b 45 ec mov -0x14(%ebp),%eax
80103590: 89 04 24 mov %eax,(%esp)
80103593: e8 24 fe ff ff call 801033bc <v2p>
80103598: 8b 55 f0 mov -0x10(%ebp),%edx
8010359b: 0f b6 12 movzbl (%edx),%edx
8010359e: 0f b6 d2 movzbl %dl,%edx
801035a1: 89 44 24 04 mov %eax,0x4(%esp)
801035a5: 89 14 24 mov %edx,(%esp)
801035a8: e8 5d f9 ff ff call 80102f0a <lapicstartap>
// wait for cpu to finish mpmain()
while(c->started == 0)
801035ad: 8b 45 f0 mov -0x10(%ebp),%eax
801035b0: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax
801035b6: 85 c0 test %eax,%eax
801035b8: 74 f3 je 801035ad <startothers+0xac>
801035ba: eb 01 jmp 801035bd <startothers+0xbc>
code = p2v(0x7000);
memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
for(c = cpus; c < cpus+ncpu; c++){
if(c == cpus+cpunum()) // We've started already.
continue;
801035bc: 90 nop
// The linker has placed the image of entryother.S in
// _binary_entryother_start.
code = p2v(0x7000);
memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
for(c = cpus; c < cpus+ncpu; c++){
801035bd: 81 45 f0 bc 00 00 00 addl $0xbc,-0x10(%ebp)
801035c4: a1 20 ff 10 80 mov 0x8010ff20,%eax
801035c9: 69 c0 bc 00 00 00 imul $0xbc,%eax,%eax
801035cf: 05 40 f9 10 80 add $0x8010f940,%eax
801035d4: 3b 45 f0 cmp -0x10(%ebp),%eax
801035d7: 0f 87 62 ff ff ff ja 8010353f <startothers+0x3e>
// wait for cpu to finish mpmain()
while(c->started == 0)
;
}
}
801035dd: 83 c4 24 add $0x24,%esp
801035e0: 5b pop %ebx
801035e1: 5d pop %ebp
801035e2: c3 ret
...
801035e4 <p2v>:
801035e4: 55 push %ebp
801035e5: 89 e5 mov %esp,%ebp
801035e7: 8b 45 08 mov 0x8(%ebp),%eax
801035ea: 2d 00 00 00 80 sub $0x80000000,%eax
801035ef: 5d pop %ebp
801035f0: c3 ret
801035f1 <inb>:
// Routines to let C code use special x86 instructions.
static inline uchar
inb(ushort port)
{
801035f1: 55 push %ebp
801035f2: 89 e5 mov %esp,%ebp
801035f4: 83 ec 14 sub $0x14,%esp
801035f7: 8b 45 08 mov 0x8(%ebp),%eax
801035fa: 66 89 45 ec mov %ax,-0x14(%ebp)
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801035fe: 0f b7 45 ec movzwl -0x14(%ebp),%eax
80103602: 89 c2 mov %eax,%edx
80103604: ec in (%dx),%al
80103605: 88 45 ff mov %al,-0x1(%ebp)
return data;
80103608: 0f b6 45 ff movzbl -0x1(%ebp),%eax
}
8010360c: c9 leave
8010360d: c3 ret
8010360e <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
8010360e: 55 push %ebp
8010360f: 89 e5 mov %esp,%ebp
80103611: 83 ec 08 sub $0x8,%esp
80103614: 8b 55 08 mov 0x8(%ebp),%edx
80103617: 8b 45 0c mov 0xc(%ebp),%eax
8010361a: 66 89 55 fc mov %dx,-0x4(%ebp)
8010361e: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80103621: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
80103625: 0f b7 55 fc movzwl -0x4(%ebp),%edx
80103629: ee out %al,(%dx)
}
8010362a: c9 leave
8010362b: c3 ret
8010362c <mpbcpu>:
int ncpu;
uchar ioapicid;
int
mpbcpu(void)
{
8010362c: 55 push %ebp
8010362d: 89 e5 mov %esp,%ebp
return bcpu-cpus;
8010362f: a1 64 b6 10 80 mov 0x8010b664,%eax
80103634: 89 c2 mov %eax,%edx
80103636: b8 40 f9 10 80 mov $0x8010f940,%eax
8010363b: 89 d1 mov %edx,%ecx
8010363d: 29 c1 sub %eax,%ecx
8010363f: 89 c8 mov %ecx,%eax
80103641: c1 f8 02 sar $0x2,%eax
80103644: 69 c0 cf 46 7d 67 imul $0x677d46cf,%eax,%eax
}
8010364a: 5d pop %ebp
8010364b: c3 ret
8010364c <sum>:
static uchar
sum(uchar *addr, int len)
{
8010364c: 55 push %ebp
8010364d: 89 e5 mov %esp,%ebp
8010364f: 83 ec 10 sub $0x10,%esp
int i, sum;
sum = 0;
80103652: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
for(i=0; i<len; i++)
80103659: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%ebp)
80103660: eb 13 jmp 80103675 <sum+0x29>
sum += addr[i];
80103662: 8b 45 f8 mov -0x8(%ebp),%eax
80103665: 03 45 08 add 0x8(%ebp),%eax
80103668: 0f b6 00 movzbl (%eax),%eax
8010366b: 0f b6 c0 movzbl %al,%eax
8010366e: 01 45 fc add %eax,-0x4(%ebp)
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
80103671: 83 45 f8 01 addl $0x1,-0x8(%ebp)
80103675: 8b 45 f8 mov -0x8(%ebp),%eax
80103678: 3b 45 0c cmp 0xc(%ebp),%eax
8010367b: 7c e5 jl 80103662 <sum+0x16>
sum += addr[i];
return sum;
8010367d: 8b 45 fc mov -0x4(%ebp),%eax
}
80103680: c9 leave
80103681: c3 ret
80103682 <mpsearch1>:
// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
80103682: 55 push %ebp
80103683: 89 e5 mov %esp,%ebp
80103685: 83 ec 28 sub $0x28,%esp
uchar *e, *p, *addr;
addr = p2v(a);
80103688: 8b 45 08 mov 0x8(%ebp),%eax
8010368b: 89 04 24 mov %eax,(%esp)
8010368e: e8 51 ff ff ff call 801035e4 <p2v>
80103693: 89 45 f4 mov %eax,-0xc(%ebp)
e = addr+len;
80103696: 8b 45 0c mov 0xc(%ebp),%eax
80103699: 03 45 f4 add -0xc(%ebp),%eax
8010369c: 89 45 ec mov %eax,-0x14(%ebp)
for(p = addr; p < e; p += sizeof(struct mp))
8010369f: 8b 45 f4 mov -0xc(%ebp),%eax
801036a2: 89 45 f0 mov %eax,-0x10(%ebp)
801036a5: eb 3f jmp 801036e6 <mpsearch1+0x64>
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
801036a7: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp)
801036ae: 00
801036af: c7 44 24 04 60 88 10 movl $0x80108860,0x4(%esp)
801036b6: 80
801036b7: 8b 45 f0 mov -0x10(%ebp),%eax
801036ba: 89 04 24 mov %eax,(%esp)
801036bd: e8 53 1b 00 00 call 80105215 <memcmp>
801036c2: 85 c0 test %eax,%eax
801036c4: 75 1c jne 801036e2 <mpsearch1+0x60>
801036c6: c7 44 24 04 10 00 00 movl $0x10,0x4(%esp)
801036cd: 00
801036ce: 8b 45 f0 mov -0x10(%ebp),%eax
801036d1: 89 04 24 mov %eax,(%esp)
801036d4: e8 73 ff ff ff call 8010364c <sum>
801036d9: 84 c0 test %al,%al
801036db: 75 05 jne 801036e2 <mpsearch1+0x60>
return (struct mp*)p;
801036dd: 8b 45 f0 mov -0x10(%ebp),%eax
801036e0: eb 11 jmp 801036f3 <mpsearch1+0x71>
{
uchar *e, *p, *addr;
addr = p2v(a);
e = addr+len;
for(p = addr; p < e; p += sizeof(struct mp))
801036e2: 83 45 f0 10 addl $0x10,-0x10(%ebp)
801036e6: 8b 45 f0 mov -0x10(%ebp),%eax
801036e9: 3b 45 ec cmp -0x14(%ebp),%eax
801036ec: 72 b9 jb 801036a7 <mpsearch1+0x25>
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
return (struct mp*)p;
return 0;
801036ee: b8 00 00 00 00 mov $0x0,%eax
}
801036f3: c9 leave
801036f4: c3 ret
801036f5 <mpsearch>:
// 1) in the first KB of the EBDA;
// 2) in the last KB of system base memory;
// 3) in the BIOS ROM between 0xE0000 and 0xFFFFF.
static struct mp*
mpsearch(void)
{
801036f5: 55 push %ebp
801036f6: 89 e5 mov %esp,%ebp
801036f8: 83 ec 28 sub $0x28,%esp
uchar *bda;
uint p;
struct mp *mp;
bda = (uchar *) P2V(0x400);
801036fb: c7 45 ec 00 04 00 80 movl $0x80000400,-0x14(%ebp)
if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
80103702: 8b 45 ec mov -0x14(%ebp),%eax
80103705: 83 c0 0f add $0xf,%eax
80103708: 0f b6 00 movzbl (%eax),%eax
8010370b: 0f b6 c0 movzbl %al,%eax
8010370e: 89 c2 mov %eax,%edx
80103710: c1 e2 08 shl $0x8,%edx
80103713: 8b 45 ec mov -0x14(%ebp),%eax
80103716: 83 c0 0e add $0xe,%eax
80103719: 0f b6 00 movzbl (%eax),%eax
8010371c: 0f b6 c0 movzbl %al,%eax
8010371f: 09 d0 or %edx,%eax
80103721: c1 e0 04 shl $0x4,%eax
80103724: 89 45 f0 mov %eax,-0x10(%ebp)
80103727: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
8010372b: 74 21 je 8010374e <mpsearch+0x59>
if((mp = mpsearch1(p, 1024)))
8010372d: c7 44 24 04 00 04 00 movl $0x400,0x4(%esp)
80103734: 00
80103735: 8b 45 f0 mov -0x10(%ebp),%eax
80103738: 89 04 24 mov %eax,(%esp)
8010373b: e8 42 ff ff ff call 80103682 <mpsearch1>
80103740: 89 45 f4 mov %eax,-0xc(%ebp)
80103743: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80103747: 74 50 je 80103799 <mpsearch+0xa4>
return mp;
80103749: 8b 45 f4 mov -0xc(%ebp),%eax
8010374c: eb 5f jmp 801037ad <mpsearch+0xb8>
} else {
p = ((bda[0x14]<<8)|bda[0x13])*1024;
8010374e: 8b 45 ec mov -0x14(%ebp),%eax
80103751: 83 c0 14 add $0x14,%eax
80103754: 0f b6 00 movzbl (%eax),%eax
80103757: 0f b6 c0 movzbl %al,%eax
8010375a: 89 c2 mov %eax,%edx
8010375c: c1 e2 08 shl $0x8,%edx
8010375f: 8b 45 ec mov -0x14(%ebp),%eax
80103762: 83 c0 13 add $0x13,%eax
80103765: 0f b6 00 movzbl (%eax),%eax
80103768: 0f b6 c0 movzbl %al,%eax
8010376b: 09 d0 or %edx,%eax
8010376d: c1 e0 0a shl $0xa,%eax
80103770: 89 45 f0 mov %eax,-0x10(%ebp)
if((mp = mpsearch1(p-1024, 1024)))
80103773: 8b 45 f0 mov -0x10(%ebp),%eax
80103776: 2d 00 04 00 00 sub $0x400,%eax
8010377b: c7 44 24 04 00 04 00 movl $0x400,0x4(%esp)
80103782: 00
80103783: 89 04 24 mov %eax,(%esp)
80103786: e8 f7 fe ff ff call 80103682 <mpsearch1>
8010378b: 89 45 f4 mov %eax,-0xc(%ebp)
8010378e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80103792: 74 05 je 80103799 <mpsearch+0xa4>
return mp;
80103794: 8b 45 f4 mov -0xc(%ebp),%eax
80103797: eb 14 jmp 801037ad <mpsearch+0xb8>
}
return mpsearch1(0xF0000, 0x10000);
80103799: c7 44 24 04 00 00 01 movl $0x10000,0x4(%esp)
801037a0: 00
801037a1: c7 04 24 00 00 0f 00 movl $0xf0000,(%esp)
801037a8: e8 d5 fe ff ff call 80103682 <mpsearch1>
}
801037ad: c9 leave
801037ae: c3 ret
801037af <mpconfig>:
// Check for correct signature, calculate the checksum and,
// if correct, check the version.
// To do: check extended table checksum.
static struct mpconf*
mpconfig(struct mp **pmp)
{
801037af: 55 push %ebp
801037b0: 89 e5 mov %esp,%ebp
801037b2: 83 ec 28 sub $0x28,%esp
struct mpconf *conf;
struct mp *mp;
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801037b5: e8 3b ff ff ff call 801036f5 <mpsearch>
801037ba: 89 45 f4 mov %eax,-0xc(%ebp)
801037bd: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801037c1: 74 0a je 801037cd <mpconfig+0x1e>
801037c3: 8b 45 f4 mov -0xc(%ebp),%eax
801037c6: 8b 40 04 mov 0x4(%eax),%eax
801037c9: 85 c0 test %eax,%eax
801037cb: 75 0a jne 801037d7 <mpconfig+0x28>
return 0;
801037cd: b8 00 00 00 00 mov $0x0,%eax
801037d2: e9 83 00 00 00 jmp 8010385a <mpconfig+0xab>
conf = (struct mpconf*) p2v((uint) mp->physaddr);
801037d7: 8b 45 f4 mov -0xc(%ebp),%eax
801037da: 8b 40 04 mov 0x4(%eax),%eax
801037dd: 89 04 24 mov %eax,(%esp)
801037e0: e8 ff fd ff ff call 801035e4 <p2v>
801037e5: 89 45 f0 mov %eax,-0x10(%ebp)
if(memcmp(conf, "PCMP", 4) != 0)
801037e8: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp)
801037ef: 00
801037f0: c7 44 24 04 65 88 10 movl $0x80108865,0x4(%esp)
801037f7: 80
801037f8: 8b 45 f0 mov -0x10(%ebp),%eax
801037fb: 89 04 24 mov %eax,(%esp)
801037fe: e8 12 1a 00 00 call 80105215 <memcmp>
80103803: 85 c0 test %eax,%eax
80103805: 74 07 je 8010380e <mpconfig+0x5f>
return 0;
80103807: b8 00 00 00 00 mov $0x0,%eax
8010380c: eb 4c jmp 8010385a <mpconfig+0xab>
if(conf->version != 1 && conf->version != 4)
8010380e: 8b 45 f0 mov -0x10(%ebp),%eax
80103811: 0f b6 40 06 movzbl 0x6(%eax),%eax
80103815: 3c 01 cmp $0x1,%al
80103817: 74 12 je 8010382b <mpconfig+0x7c>
80103819: 8b 45 f0 mov -0x10(%ebp),%eax
8010381c: 0f b6 40 06 movzbl 0x6(%eax),%eax
80103820: 3c 04 cmp $0x4,%al
80103822: 74 07 je 8010382b <mpconfig+0x7c>
return 0;
80103824: b8 00 00 00 00 mov $0x0,%eax
80103829: eb 2f jmp 8010385a <mpconfig+0xab>
if(sum((uchar*)conf, conf->length) != 0)
8010382b: 8b 45 f0 mov -0x10(%ebp),%eax
8010382e: 0f b7 40 04 movzwl 0x4(%eax),%eax
80103832: 0f b7 d0 movzwl %ax,%edx
80103835: 8b 45 f0 mov -0x10(%ebp),%eax
80103838: 89 54 24 04 mov %edx,0x4(%esp)
8010383c: 89 04 24 mov %eax,(%esp)
8010383f: e8 08 fe ff ff call 8010364c <sum>
80103844: 84 c0 test %al,%al
80103846: 74 07 je 8010384f <mpconfig+0xa0>
return 0;
80103848: b8 00 00 00 00 mov $0x0,%eax
8010384d: eb 0b jmp 8010385a <mpconfig+0xab>
*pmp = mp;
8010384f: 8b 45 08 mov 0x8(%ebp),%eax
80103852: 8b 55 f4 mov -0xc(%ebp),%edx
80103855: 89 10 mov %edx,(%eax)
return conf;
80103857: 8b 45 f0 mov -0x10(%ebp),%eax
}
8010385a: c9 leave
8010385b: c3 ret
8010385c <mpinit>:
void
mpinit(void)
{
8010385c: 55 push %ebp
8010385d: 89 e5 mov %esp,%ebp
8010385f: 83 ec 38 sub $0x38,%esp
struct mp *mp;
struct mpconf *conf;
struct mpproc *proc;
struct mpioapic *ioapic;
bcpu = &cpus[0];
80103862: c7 05 64 b6 10 80 40 movl $0x8010f940,0x8010b664
80103869: f9 10 80
if((conf = mpconfig(&mp)) == 0)
8010386c: 8d 45 e0 lea -0x20(%ebp),%eax
8010386f: 89 04 24 mov %eax,(%esp)
80103872: e8 38 ff ff ff call 801037af <mpconfig>
80103877: 89 45 ec mov %eax,-0x14(%ebp)
8010387a: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
8010387e: 0f 84 9d 01 00 00 je 80103a21 <mpinit+0x1c5>
return;
ismp = 1;
80103884: c7 05 24 f9 10 80 01 movl $0x1,0x8010f924
8010388b: 00 00 00
lapic = (uint*)conf->lapicaddr;
8010388e: 8b 45 ec mov -0x14(%ebp),%eax
80103891: 8b 40 24 mov 0x24(%eax),%eax
80103894: a3 9c f8 10 80 mov %eax,0x8010f89c
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
80103899: 8b 45 ec mov -0x14(%ebp),%eax
8010389c: 83 c0 2c add $0x2c,%eax
8010389f: 89 45 e4 mov %eax,-0x1c(%ebp)
801038a2: 8b 55 ec mov -0x14(%ebp),%edx
801038a5: 8b 45 ec mov -0x14(%ebp),%eax
801038a8: 0f b7 40 04 movzwl 0x4(%eax),%eax
801038ac: 0f b7 c0 movzwl %ax,%eax
801038af: 8d 04 02 lea (%edx,%eax,1),%eax
801038b2: 89 45 e8 mov %eax,-0x18(%ebp)
801038b5: e9 f2 00 00 00 jmp 801039ac <mpinit+0x150>
switch(*p){
801038ba: 8b 45 e4 mov -0x1c(%ebp),%eax
801038bd: 0f b6 00 movzbl (%eax),%eax
801038c0: 0f b6 c0 movzbl %al,%eax
801038c3: 83 f8 04 cmp $0x4,%eax
801038c6: 0f 87 bd 00 00 00 ja 80103989 <mpinit+0x12d>
801038cc: 8b 04 85 a8 88 10 80 mov -0x7fef7758(,%eax,4),%eax
801038d3: ff e0 jmp *%eax
case MPPROC:
proc = (struct mpproc*)p;
801038d5: 8b 45 e4 mov -0x1c(%ebp),%eax
801038d8: 89 45 f0 mov %eax,-0x10(%ebp)
if(ncpu != proc->apicid){
801038db: 8b 45 f0 mov -0x10(%ebp),%eax
801038de: 0f b6 40 01 movzbl 0x1(%eax),%eax
801038e2: 0f b6 d0 movzbl %al,%edx
801038e5: a1 20 ff 10 80 mov 0x8010ff20,%eax
801038ea: 39 c2 cmp %eax,%edx
801038ec: 74 2d je 8010391b <mpinit+0xbf>
cprintf("mpinit: ncpu=%d apicid=%d\n", ncpu, proc->apicid);
801038ee: 8b 45 f0 mov -0x10(%ebp),%eax
801038f1: 0f b6 40 01 movzbl 0x1(%eax),%eax
801038f5: 0f b6 d0 movzbl %al,%edx
801038f8: a1 20 ff 10 80 mov 0x8010ff20,%eax
801038fd: 89 54 24 08 mov %edx,0x8(%esp)
80103901: 89 44 24 04 mov %eax,0x4(%esp)
80103905: c7 04 24 6a 88 10 80 movl $0x8010886a,(%esp)
8010390c: e8 89 ca ff ff call 8010039a <cprintf>
ismp = 0;
80103911: c7 05 24 f9 10 80 00 movl $0x0,0x8010f924
80103918: 00 00 00
}
if(proc->flags & MPBOOT)
8010391b: 8b 45 f0 mov -0x10(%ebp),%eax
8010391e: 0f b6 40 03 movzbl 0x3(%eax),%eax
80103922: 0f b6 c0 movzbl %al,%eax
80103925: 83 e0 02 and $0x2,%eax
80103928: 85 c0 test %eax,%eax
8010392a: 74 15 je 80103941 <mpinit+0xe5>
bcpu = &cpus[ncpu];
8010392c: a1 20 ff 10 80 mov 0x8010ff20,%eax
80103931: 69 c0 bc 00 00 00 imul $0xbc,%eax,%eax
80103937: 05 40 f9 10 80 add $0x8010f940,%eax
8010393c: a3 64 b6 10 80 mov %eax,0x8010b664
cpus[ncpu].id = ncpu;
80103941: a1 20 ff 10 80 mov 0x8010ff20,%eax
80103946: 8b 15 20 ff 10 80 mov 0x8010ff20,%edx
8010394c: 69 c0 bc 00 00 00 imul $0xbc,%eax,%eax
80103952: 88 90 40 f9 10 80 mov %dl,-0x7fef06c0(%eax)
ncpu++;
80103958: a1 20 ff 10 80 mov 0x8010ff20,%eax
8010395d: 83 c0 01 add $0x1,%eax
80103960: a3 20 ff 10 80 mov %eax,0x8010ff20
p += sizeof(struct mpproc);
80103965: 83 45 e4 14 addl $0x14,-0x1c(%ebp)
continue;
80103969: eb 41 jmp 801039ac <mpinit+0x150>
case MPIOAPIC:
ioapic = (struct mpioapic*)p;
8010396b: 8b 45 e4 mov -0x1c(%ebp),%eax
8010396e: 89 45 f4 mov %eax,-0xc(%ebp)
ioapicid = ioapic->apicno;
80103971: 8b 45 f4 mov -0xc(%ebp),%eax
80103974: 0f b6 40 01 movzbl 0x1(%eax),%eax
80103978: a2 20 f9 10 80 mov %al,0x8010f920
p += sizeof(struct mpioapic);
8010397d: 83 45 e4 08 addl $0x8,-0x1c(%ebp)
continue;
80103981: eb 29 jmp 801039ac <mpinit+0x150>
case MPBUS:
case MPIOINTR:
case MPLINTR:
p += 8;
80103983: 83 45 e4 08 addl $0x8,-0x1c(%ebp)
continue;
80103987: eb 23 jmp 801039ac <mpinit+0x150>
default:
cprintf("mpinit: unknown config type %x\n", *p);
80103989: 8b 45 e4 mov -0x1c(%ebp),%eax
8010398c: 0f b6 00 movzbl (%eax),%eax
8010398f: 0f b6 c0 movzbl %al,%eax
80103992: 89 44 24 04 mov %eax,0x4(%esp)
80103996: c7 04 24 88 88 10 80 movl $0x80108888,(%esp)
8010399d: e8 f8 c9 ff ff call 8010039a <cprintf>
ismp = 0;
801039a2: c7 05 24 f9 10 80 00 movl $0x0,0x8010f924
801039a9: 00 00 00
bcpu = &cpus[0];
if((conf = mpconfig(&mp)) == 0)
return;
ismp = 1;
lapic = (uint*)conf->lapicaddr;
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
801039ac: 8b 45 e4 mov -0x1c(%ebp),%eax
801039af: 3b 45 e8 cmp -0x18(%ebp),%eax
801039b2: 0f 82 02 ff ff ff jb 801038ba <mpinit+0x5e>
default:
cprintf("mpinit: unknown config type %x\n", *p);
ismp = 0;
}
}
if(!ismp){
801039b8: a1 24 f9 10 80 mov 0x8010f924,%eax
801039bd: 85 c0 test %eax,%eax
801039bf: 75 1d jne 801039de <mpinit+0x182>
// Didn't like what we found; fall back to no MP.
ncpu = 1;
801039c1: c7 05 20 ff 10 80 01 movl $0x1,0x8010ff20
801039c8: 00 00 00
lapic = 0;
801039cb: c7 05 9c f8 10 80 00 movl $0x0,0x8010f89c
801039d2: 00 00 00
ioapicid = 0;
801039d5: c6 05 20 f9 10 80 00 movb $0x0,0x8010f920
return;
801039dc: eb 44 jmp 80103a22 <mpinit+0x1c6>
}
if(mp->imcrp){
801039de: 8b 45 e0 mov -0x20(%ebp),%eax
801039e1: 0f b6 40 0c movzbl 0xc(%eax),%eax
801039e5: 84 c0 test %al,%al
801039e7: 74 39 je 80103a22 <mpinit+0x1c6>
// Bochs doesn't support IMCR, so this doesn't run on Bochs.
// But it would on real hardware.
outb(0x22, 0x70); // Select IMCR
801039e9: c7 44 24 04 70 00 00 movl $0x70,0x4(%esp)
801039f0: 00
801039f1: c7 04 24 22 00 00 00 movl $0x22,(%esp)
801039f8: e8 11 fc ff ff call 8010360e <outb>
outb(0x23, inb(0x23) | 1); // Mask external interrupts.
801039fd: c7 04 24 23 00 00 00 movl $0x23,(%esp)
80103a04: e8 e8 fb ff ff call 801035f1 <inb>
80103a09: 83 c8 01 or $0x1,%eax
80103a0c: 0f b6 c0 movzbl %al,%eax
80103a0f: 89 44 24 04 mov %eax,0x4(%esp)
80103a13: c7 04 24 23 00 00 00 movl $0x23,(%esp)
80103a1a: e8 ef fb ff ff call 8010360e <outb>
80103a1f: eb 01 jmp 80103a22 <mpinit+0x1c6>
struct mpproc *proc;
struct mpioapic *ioapic;
bcpu = &cpus[0];
if((conf = mpconfig(&mp)) == 0)
return;
80103a21: 90 nop
// Bochs doesn't support IMCR, so this doesn't run on Bochs.
// But it would on real hardware.
outb(0x22, 0x70); // Select IMCR
outb(0x23, inb(0x23) | 1); // Mask external interrupts.
}
}
80103a22: c9 leave
80103a23: c3 ret
80103a24 <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
80103a24: 55 push %ebp
80103a25: 89 e5 mov %esp,%ebp
80103a27: 83 ec 08 sub $0x8,%esp
80103a2a: 8b 55 08 mov 0x8(%ebp),%edx
80103a2d: 8b 45 0c mov 0xc(%ebp),%eax
80103a30: 66 89 55 fc mov %dx,-0x4(%ebp)
80103a34: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80103a37: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
80103a3b: 0f b7 55 fc movzwl -0x4(%ebp),%edx
80103a3f: ee out %al,(%dx)
}
80103a40: c9 leave
80103a41: c3 ret
80103a42 <picsetmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static ushort irqmask = 0xFFFF & ~(1<<IRQ_SLAVE);
static void
picsetmask(ushort mask)
{
80103a42: 55 push %ebp
80103a43: 89 e5 mov %esp,%ebp
80103a45: 83 ec 0c sub $0xc,%esp
80103a48: 8b 45 08 mov 0x8(%ebp),%eax
80103a4b: 66 89 45 fc mov %ax,-0x4(%ebp)
irqmask = mask;
80103a4f: 0f b7 45 fc movzwl -0x4(%ebp),%eax
80103a53: 66 a3 00 b0 10 80 mov %ax,0x8010b000
outb(IO_PIC1+1, mask);
80103a59: 0f b7 45 fc movzwl -0x4(%ebp),%eax
80103a5d: 0f b6 c0 movzbl %al,%eax
80103a60: 89 44 24 04 mov %eax,0x4(%esp)
80103a64: c7 04 24 21 00 00 00 movl $0x21,(%esp)
80103a6b: e8 b4 ff ff ff call 80103a24 <outb>
outb(IO_PIC2+1, mask >> 8);
80103a70: 0f b7 45 fc movzwl -0x4(%ebp),%eax
80103a74: 66 c1 e8 08 shr $0x8,%ax
80103a78: 0f b6 c0 movzbl %al,%eax
80103a7b: 89 44 24 04 mov %eax,0x4(%esp)
80103a7f: c7 04 24 a1 00 00 00 movl $0xa1,(%esp)
80103a86: e8 99 ff ff ff call 80103a24 <outb>
}
80103a8b: c9 leave
80103a8c: c3 ret
80103a8d <picenable>:
void
picenable(int irq)
{
80103a8d: 55 push %ebp
80103a8e: 89 e5 mov %esp,%ebp
80103a90: 53 push %ebx
80103a91: 83 ec 04 sub $0x4,%esp
picsetmask(irqmask & ~(1<<irq));
80103a94: 8b 45 08 mov 0x8(%ebp),%eax
80103a97: ba 01 00 00 00 mov $0x1,%edx
80103a9c: 89 d3 mov %edx,%ebx
80103a9e: 89 c1 mov %eax,%ecx
80103aa0: d3 e3 shl %cl,%ebx
80103aa2: 89 d8 mov %ebx,%eax
80103aa4: 89 c2 mov %eax,%edx
80103aa6: f7 d2 not %edx
80103aa8: 0f b7 05 00 b0 10 80 movzwl 0x8010b000,%eax
80103aaf: 21 d0 and %edx,%eax
80103ab1: 0f b7 c0 movzwl %ax,%eax
80103ab4: 89 04 24 mov %eax,(%esp)
80103ab7: e8 86 ff ff ff call 80103a42 <picsetmask>
}
80103abc: 83 c4 04 add $0x4,%esp
80103abf: 5b pop %ebx
80103ac0: 5d pop %ebp
80103ac1: c3 ret
80103ac2 <picinit>:
// Initialize the 8259A interrupt controllers.
void
picinit(void)
{
80103ac2: 55 push %ebp
80103ac3: 89 e5 mov %esp,%ebp
80103ac5: 83 ec 08 sub $0x8,%esp
// mask all interrupts
outb(IO_PIC1+1, 0xFF);
80103ac8: c7 44 24 04 ff 00 00 movl $0xff,0x4(%esp)
80103acf: 00
80103ad0: c7 04 24 21 00 00 00 movl $0x21,(%esp)
80103ad7: e8 48 ff ff ff call 80103a24 <outb>
outb(IO_PIC2+1, 0xFF);
80103adc: c7 44 24 04 ff 00 00 movl $0xff,0x4(%esp)
80103ae3: 00
80103ae4: c7 04 24 a1 00 00 00 movl $0xa1,(%esp)
80103aeb: e8 34 ff ff ff call 80103a24 <outb>
// ICW1: 0001g0hi
// g: 0 = edge triggering, 1 = level triggering
// h: 0 = cascaded PICs, 1 = master only
// i: 0 = no ICW4, 1 = ICW4 required
outb(IO_PIC1, 0x11);
80103af0: c7 44 24 04 11 00 00 movl $0x11,0x4(%esp)
80103af7: 00
80103af8: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80103aff: e8 20 ff ff ff call 80103a24 <outb>
// ICW2: Vector offset
outb(IO_PIC1+1, T_IRQ0);
80103b04: c7 44 24 04 20 00 00 movl $0x20,0x4(%esp)
80103b0b: 00
80103b0c: c7 04 24 21 00 00 00 movl $0x21,(%esp)
80103b13: e8 0c ff ff ff call 80103a24 <outb>
// ICW3: (master PIC) bit mask of IR lines connected to slaves
// (slave PIC) 3-bit # of slave's connection to master
outb(IO_PIC1+1, 1<<IRQ_SLAVE);
80103b18: c7 44 24 04 04 00 00 movl $0x4,0x4(%esp)
80103b1f: 00
80103b20: c7 04 24 21 00 00 00 movl $0x21,(%esp)
80103b27: e8 f8 fe ff ff call 80103a24 <outb>
// m: 0 = slave PIC, 1 = master PIC
// (ignored when b is 0, as the master/slave role
// can be hardwired).
// a: 1 = Automatic EOI mode
// p: 0 = MCS-80/85 mode, 1 = intel x86 mode
outb(IO_PIC1+1, 0x3);
80103b2c: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
80103b33: 00
80103b34: c7 04 24 21 00 00 00 movl $0x21,(%esp)
80103b3b: e8 e4 fe ff ff call 80103a24 <outb>
// Set up slave (8259A-2)
outb(IO_PIC2, 0x11); // ICW1
80103b40: c7 44 24 04 11 00 00 movl $0x11,0x4(%esp)
80103b47: 00
80103b48: c7 04 24 a0 00 00 00 movl $0xa0,(%esp)
80103b4f: e8 d0 fe ff ff call 80103a24 <outb>
outb(IO_PIC2+1, T_IRQ0 + 8); // ICW2
80103b54: c7 44 24 04 28 00 00 movl $0x28,0x4(%esp)
80103b5b: 00
80103b5c: c7 04 24 a1 00 00 00 movl $0xa1,(%esp)
80103b63: e8 bc fe ff ff call 80103a24 <outb>
outb(IO_PIC2+1, IRQ_SLAVE); // ICW3
80103b68: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp)
80103b6f: 00
80103b70: c7 04 24 a1 00 00 00 movl $0xa1,(%esp)
80103b77: e8 a8 fe ff ff call 80103a24 <outb>
// NB Automatic EOI mode doesn't tend to work on the slave.
// Linux source code says it's "to be investigated".
outb(IO_PIC2+1, 0x3); // ICW4
80103b7c: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
80103b83: 00
80103b84: c7 04 24 a1 00 00 00 movl $0xa1,(%esp)
80103b8b: e8 94 fe ff ff call 80103a24 <outb>
// OCW3: 0ef01prs
// ef: 0x = NOP, 10 = clear specific mask, 11 = set specific mask
// p: 0 = no polling, 1 = polling mode
// rs: 0x = NOP, 10 = read IRR, 11 = read ISR
outb(IO_PIC1, 0x68); // clear specific mask
80103b90: c7 44 24 04 68 00 00 movl $0x68,0x4(%esp)
80103b97: 00
80103b98: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80103b9f: e8 80 fe ff ff call 80103a24 <outb>
outb(IO_PIC1, 0x0a); // read IRR by default
80103ba4: c7 44 24 04 0a 00 00 movl $0xa,0x4(%esp)
80103bab: 00
80103bac: c7 04 24 20 00 00 00 movl $0x20,(%esp)
80103bb3: e8 6c fe ff ff call 80103a24 <outb>
outb(IO_PIC2, 0x68); // OCW3
80103bb8: c7 44 24 04 68 00 00 movl $0x68,0x4(%esp)
80103bbf: 00
80103bc0: c7 04 24 a0 00 00 00 movl $0xa0,(%esp)
80103bc7: e8 58 fe ff ff call 80103a24 <outb>
outb(IO_PIC2, 0x0a); // OCW3
80103bcc: c7 44 24 04 0a 00 00 movl $0xa,0x4(%esp)
80103bd3: 00
80103bd4: c7 04 24 a0 00 00 00 movl $0xa0,(%esp)
80103bdb: e8 44 fe ff ff call 80103a24 <outb>
if(irqmask != 0xFFFF)
80103be0: 0f b7 05 00 b0 10 80 movzwl 0x8010b000,%eax
80103be7: 66 83 f8 ff cmp $0xffffffff,%ax
80103beb: 74 12 je 80103bff <picinit+0x13d>
picsetmask(irqmask);
80103bed: 0f b7 05 00 b0 10 80 movzwl 0x8010b000,%eax
80103bf4: 0f b7 c0 movzwl %ax,%eax
80103bf7: 89 04 24 mov %eax,(%esp)
80103bfa: e8 43 fe ff ff call 80103a42 <picsetmask>
}
80103bff: c9 leave
80103c00: c3 ret
80103c01: 00 00 add %al,(%eax)
...
80103c04 <pipealloc>:
int writeopen; // write fd is still open
};
int
pipealloc(struct file **f0, struct file **f1)
{
80103c04: 55 push %ebp
80103c05: 89 e5 mov %esp,%ebp
80103c07: 83 ec 28 sub $0x28,%esp
struct pipe *p;
p = 0;
80103c0a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
*f0 = *f1 = 0;
80103c11: 8b 45 0c mov 0xc(%ebp),%eax
80103c14: c7 00 00 00 00 00 movl $0x0,(%eax)
80103c1a: 8b 45 0c mov 0xc(%ebp),%eax
80103c1d: 8b 10 mov (%eax),%edx
80103c1f: 8b 45 08 mov 0x8(%ebp),%eax
80103c22: 89 10 mov %edx,(%eax)
if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
80103c24: e8 fb d2 ff ff call 80100f24 <filealloc>
80103c29: 8b 55 08 mov 0x8(%ebp),%edx
80103c2c: 89 02 mov %eax,(%edx)
80103c2e: 8b 45 08 mov 0x8(%ebp),%eax
80103c31: 8b 00 mov (%eax),%eax
80103c33: 85 c0 test %eax,%eax
80103c35: 0f 84 c8 00 00 00 je 80103d03 <pipealloc+0xff>
80103c3b: e8 e4 d2 ff ff call 80100f24 <filealloc>
80103c40: 8b 55 0c mov 0xc(%ebp),%edx
80103c43: 89 02 mov %eax,(%edx)
80103c45: 8b 45 0c mov 0xc(%ebp),%eax
80103c48: 8b 00 mov (%eax),%eax
80103c4a: 85 c0 test %eax,%eax
80103c4c: 0f 84 b1 00 00 00 je 80103d03 <pipealloc+0xff>
goto bad;
if((p = (struct pipe*)kalloc()) == 0)
80103c52: e8 b3 ee ff ff call 80102b0a <kalloc>
80103c57: 89 45 f4 mov %eax,-0xc(%ebp)
80103c5a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80103c5e: 0f 84 9e 00 00 00 je 80103d02 <pipealloc+0xfe>
goto bad;
p->readopen = 1;
80103c64: 8b 45 f4 mov -0xc(%ebp),%eax
80103c67: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax)
80103c6e: 00 00 00
p->writeopen = 1;
80103c71: 8b 45 f4 mov -0xc(%ebp),%eax
80103c74: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax)
80103c7b: 00 00 00
p->nwrite = 0;
80103c7e: 8b 45 f4 mov -0xc(%ebp),%eax
80103c81: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax)
80103c88: 00 00 00
p->nread = 0;
80103c8b: 8b 45 f4 mov -0xc(%ebp),%eax
80103c8e: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax)
80103c95: 00 00 00
initlock(&p->lock, "pipe");
80103c98: 8b 45 f4 mov -0xc(%ebp),%eax
80103c9b: c7 44 24 04 bc 88 10 movl $0x801088bc,0x4(%esp)
80103ca2: 80
80103ca3: 89 04 24 mov %eax,(%esp)
80103ca6: e8 83 12 00 00 call 80104f2e <initlock>
(*f0)->type = FD_PIPE;
80103cab: 8b 45 08 mov 0x8(%ebp),%eax
80103cae: 8b 00 mov (%eax),%eax
80103cb0: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f0)->readable = 1;
80103cb6: 8b 45 08 mov 0x8(%ebp),%eax
80103cb9: 8b 00 mov (%eax),%eax
80103cbb: c6 40 08 01 movb $0x1,0x8(%eax)
(*f0)->writable = 0;
80103cbf: 8b 45 08 mov 0x8(%ebp),%eax
80103cc2: 8b 00 mov (%eax),%eax
80103cc4: c6 40 09 00 movb $0x0,0x9(%eax)
(*f0)->pipe = p;
80103cc8: 8b 45 08 mov 0x8(%ebp),%eax
80103ccb: 8b 00 mov (%eax),%eax
80103ccd: 8b 55 f4 mov -0xc(%ebp),%edx
80103cd0: 89 50 0c mov %edx,0xc(%eax)
(*f1)->type = FD_PIPE;
80103cd3: 8b 45 0c mov 0xc(%ebp),%eax
80103cd6: 8b 00 mov (%eax),%eax
80103cd8: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f1)->readable = 0;
80103cde: 8b 45 0c mov 0xc(%ebp),%eax
80103ce1: 8b 00 mov (%eax),%eax
80103ce3: c6 40 08 00 movb $0x0,0x8(%eax)
(*f1)->writable = 1;
80103ce7: 8b 45 0c mov 0xc(%ebp),%eax
80103cea: 8b 00 mov (%eax),%eax
80103cec: c6 40 09 01 movb $0x1,0x9(%eax)
(*f1)->pipe = p;
80103cf0: 8b 45 0c mov 0xc(%ebp),%eax
80103cf3: 8b 00 mov (%eax),%eax
80103cf5: 8b 55 f4 mov -0xc(%ebp),%edx
80103cf8: 89 50 0c mov %edx,0xc(%eax)
return 0;
80103cfb: b8 00 00 00 00 mov $0x0,%eax
80103d00: eb 43 jmp 80103d45 <pipealloc+0x141>
p = 0;
*f0 = *f1 = 0;
if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
goto bad;
if((p = (struct pipe*)kalloc()) == 0)
goto bad;
80103d02: 90 nop
(*f1)->pipe = p;
return 0;
//PAGEBREAK: 20
bad:
if(p)
80103d03: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80103d07: 74 0b je 80103d14 <pipealloc+0x110>
kfree((char*)p);
80103d09: 8b 45 f4 mov -0xc(%ebp),%eax
80103d0c: 89 04 24 mov %eax,(%esp)
80103d0f: e8 5d ed ff ff call 80102a71 <kfree>
if(*f0)
80103d14: 8b 45 08 mov 0x8(%ebp),%eax
80103d17: 8b 00 mov (%eax),%eax
80103d19: 85 c0 test %eax,%eax
80103d1b: 74 0d je 80103d2a <pipealloc+0x126>
fileclose(*f0);
80103d1d: 8b 45 08 mov 0x8(%ebp),%eax
80103d20: 8b 00 mov (%eax),%eax
80103d22: 89 04 24 mov %eax,(%esp)
80103d25: e8 a3 d2 ff ff call 80100fcd <fileclose>
if(*f1)
80103d2a: 8b 45 0c mov 0xc(%ebp),%eax
80103d2d: 8b 00 mov (%eax),%eax
80103d2f: 85 c0 test %eax,%eax
80103d31: 74 0d je 80103d40 <pipealloc+0x13c>
fileclose(*f1);
80103d33: 8b 45 0c mov 0xc(%ebp),%eax
80103d36: 8b 00 mov (%eax),%eax
80103d38: 89 04 24 mov %eax,(%esp)
80103d3b: e8 8d d2 ff ff call 80100fcd <fileclose>
return -1;
80103d40: b8 ff ff ff ff mov $0xffffffff,%eax
}
80103d45: c9 leave
80103d46: c3 ret
80103d47 <pipeclose>:
void
pipeclose(struct pipe *p, int writable)
{
80103d47: 55 push %ebp
80103d48: 89 e5 mov %esp,%ebp
80103d4a: 83 ec 18 sub $0x18,%esp
acquire(&p->lock);
80103d4d: 8b 45 08 mov 0x8(%ebp),%eax
80103d50: 89 04 24 mov %eax,(%esp)
80103d53: e8 f7 11 00 00 call 80104f4f <acquire>
if(writable){
80103d58: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
80103d5c: 74 1f je 80103d7d <pipeclose+0x36>
p->writeopen = 0;
80103d5e: 8b 45 08 mov 0x8(%ebp),%eax
80103d61: c7 80 40 02 00 00 00 movl $0x0,0x240(%eax)
80103d68: 00 00 00
wakeup(&p->nread);
80103d6b: 8b 45 08 mov 0x8(%ebp),%eax
80103d6e: 05 34 02 00 00 add $0x234,%eax
80103d73: 89 04 24 mov %eax,(%esp)
80103d76: e8 a1 0f 00 00 call 80104d1c <wakeup>
80103d7b: eb 1d jmp 80103d9a <pipeclose+0x53>
} else {
p->readopen = 0;
80103d7d: 8b 45 08 mov 0x8(%ebp),%eax
80103d80: c7 80 3c 02 00 00 00 movl $0x0,0x23c(%eax)
80103d87: 00 00 00
wakeup(&p->nwrite);
80103d8a: 8b 45 08 mov 0x8(%ebp),%eax
80103d8d: 05 38 02 00 00 add $0x238,%eax
80103d92: 89 04 24 mov %eax,(%esp)
80103d95: e8 82 0f 00 00 call 80104d1c <wakeup>
}
if(p->readopen == 0 && p->writeopen == 0){
80103d9a: 8b 45 08 mov 0x8(%ebp),%eax
80103d9d: 8b 80 3c 02 00 00 mov 0x23c(%eax),%eax
80103da3: 85 c0 test %eax,%eax
80103da5: 75 25 jne 80103dcc <pipeclose+0x85>
80103da7: 8b 45 08 mov 0x8(%ebp),%eax
80103daa: 8b 80 40 02 00 00 mov 0x240(%eax),%eax
80103db0: 85 c0 test %eax,%eax
80103db2: 75 18 jne 80103dcc <pipeclose+0x85>
release(&p->lock);
80103db4: 8b 45 08 mov 0x8(%ebp),%eax
80103db7: 89 04 24 mov %eax,(%esp)
80103dba: e8 f1 11 00 00 call 80104fb0 <release>
kfree((char*)p);
80103dbf: 8b 45 08 mov 0x8(%ebp),%eax
80103dc2: 89 04 24 mov %eax,(%esp)
80103dc5: e8 a7 ec ff ff call 80102a71 <kfree>
wakeup(&p->nread);
} else {
p->readopen = 0;
wakeup(&p->nwrite);
}
if(p->readopen == 0 && p->writeopen == 0){
80103dca: eb 0b jmp 80103dd7 <pipeclose+0x90>
release(&p->lock);
kfree((char*)p);
} else
release(&p->lock);
80103dcc: 8b 45 08 mov 0x8(%ebp),%eax
80103dcf: 89 04 24 mov %eax,(%esp)
80103dd2: e8 d9 11 00 00 call 80104fb0 <release>
}
80103dd7: c9 leave
80103dd8: c3 ret
80103dd9 <pipewrite>:
//PAGEBREAK: 40
int
pipewrite(struct pipe *p, char *addr, int n)
{
80103dd9: 55 push %ebp
80103dda: 89 e5 mov %esp,%ebp
80103ddc: 53 push %ebx
80103ddd: 83 ec 24 sub $0x24,%esp
int i;
acquire(&p->lock);
80103de0: 8b 45 08 mov 0x8(%ebp),%eax
80103de3: 89 04 24 mov %eax,(%esp)
80103de6: e8 64 11 00 00 call 80104f4f <acquire>
for(i = 0; i < n; i++){
80103deb: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80103df2: e9 a6 00 00 00 jmp 80103e9d <pipewrite+0xc4>
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
if(p->readopen == 0 || proc->killed){
80103df7: 8b 45 08 mov 0x8(%ebp),%eax
80103dfa: 8b 80 3c 02 00 00 mov 0x23c(%eax),%eax
80103e00: 85 c0 test %eax,%eax
80103e02: 74 0d je 80103e11 <pipewrite+0x38>
80103e04: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80103e0a: 8b 40 24 mov 0x24(%eax),%eax
80103e0d: 85 c0 test %eax,%eax
80103e0f: 74 15 je 80103e26 <pipewrite+0x4d>
release(&p->lock);
80103e11: 8b 45 08 mov 0x8(%ebp),%eax
80103e14: 89 04 24 mov %eax,(%esp)
80103e17: e8 94 11 00 00 call 80104fb0 <release>
return -1;
80103e1c: b8 ff ff ff ff mov $0xffffffff,%eax
80103e21: e9 9d 00 00 00 jmp 80103ec3 <pipewrite+0xea>
}
wakeup(&p->nread);
80103e26: 8b 45 08 mov 0x8(%ebp),%eax
80103e29: 05 34 02 00 00 add $0x234,%eax
80103e2e: 89 04 24 mov %eax,(%esp)
80103e31: e8 e6 0e 00 00 call 80104d1c <wakeup>
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
80103e36: 8b 45 08 mov 0x8(%ebp),%eax
80103e39: 8b 55 08 mov 0x8(%ebp),%edx
80103e3c: 81 c2 38 02 00 00 add $0x238,%edx
80103e42: 89 44 24 04 mov %eax,0x4(%esp)
80103e46: 89 14 24 mov %edx,(%esp)
80103e49: e8 88 0d 00 00 call 80104bd6 <sleep>
80103e4e: eb 01 jmp 80103e51 <pipewrite+0x78>
{
int i;
acquire(&p->lock);
for(i = 0; i < n; i++){
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
80103e50: 90 nop
80103e51: 8b 45 08 mov 0x8(%ebp),%eax
80103e54: 8b 90 38 02 00 00 mov 0x238(%eax),%edx
80103e5a: 8b 45 08 mov 0x8(%ebp),%eax
80103e5d: 8b 80 34 02 00 00 mov 0x234(%eax),%eax
80103e63: 05 00 02 00 00 add $0x200,%eax
80103e68: 39 c2 cmp %eax,%edx
80103e6a: 74 8b je 80103df7 <pipewrite+0x1e>
return -1;
}
wakeup(&p->nread);
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
}
p->data[p->nwrite++ % PIPESIZE] = addr[i];
80103e6c: 8b 45 08 mov 0x8(%ebp),%eax
80103e6f: 8b 80 38 02 00 00 mov 0x238(%eax),%eax
80103e75: 89 c3 mov %eax,%ebx
80103e77: 81 e3 ff 01 00 00 and $0x1ff,%ebx
80103e7d: 8b 55 f4 mov -0xc(%ebp),%edx
80103e80: 03 55 0c add 0xc(%ebp),%edx
80103e83: 0f b6 0a movzbl (%edx),%ecx
80103e86: 8b 55 08 mov 0x8(%ebp),%edx
80103e89: 88 4c 1a 34 mov %cl,0x34(%edx,%ebx,1)
80103e8d: 8d 50 01 lea 0x1(%eax),%edx
80103e90: 8b 45 08 mov 0x8(%ebp),%eax
80103e93: 89 90 38 02 00 00 mov %edx,0x238(%eax)
pipewrite(struct pipe *p, char *addr, int n)
{
int i;
acquire(&p->lock);
for(i = 0; i < n; i++){
80103e99: 83 45 f4 01 addl $0x1,-0xc(%ebp)
80103e9d: 8b 45 f4 mov -0xc(%ebp),%eax
80103ea0: 3b 45 10 cmp 0x10(%ebp),%eax
80103ea3: 7c ab jl 80103e50 <pipewrite+0x77>
wakeup(&p->nread);
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
}
p->data[p->nwrite++ % PIPESIZE] = addr[i];
}
wakeup(&p->nread); //DOC: pipewrite-wakeup1
80103ea5: 8b 45 08 mov 0x8(%ebp),%eax
80103ea8: 05 34 02 00 00 add $0x234,%eax
80103ead: 89 04 24 mov %eax,(%esp)
80103eb0: e8 67 0e 00 00 call 80104d1c <wakeup>
release(&p->lock);
80103eb5: 8b 45 08 mov 0x8(%ebp),%eax
80103eb8: 89 04 24 mov %eax,(%esp)
80103ebb: e8 f0 10 00 00 call 80104fb0 <release>
return n;
80103ec0: 8b 45 10 mov 0x10(%ebp),%eax
}
80103ec3: 83 c4 24 add $0x24,%esp
80103ec6: 5b pop %ebx
80103ec7: 5d pop %ebp
80103ec8: c3 ret
80103ec9 <piperead>:
int
piperead(struct pipe *p, char *addr, int n)
{
80103ec9: 55 push %ebp
80103eca: 89 e5 mov %esp,%ebp
80103ecc: 53 push %ebx
80103ecd: 83 ec 24 sub $0x24,%esp
int i;
acquire(&p->lock);
80103ed0: 8b 45 08 mov 0x8(%ebp),%eax
80103ed3: 89 04 24 mov %eax,(%esp)
80103ed6: e8 74 10 00 00 call 80104f4f <acquire>
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
80103edb: eb 3a jmp 80103f17 <piperead+0x4e>
if(proc->killed){
80103edd: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80103ee3: 8b 40 24 mov 0x24(%eax),%eax
80103ee6: 85 c0 test %eax,%eax
80103ee8: 74 15 je 80103eff <piperead+0x36>
release(&p->lock);
80103eea: 8b 45 08 mov 0x8(%ebp),%eax
80103eed: 89 04 24 mov %eax,(%esp)
80103ef0: e8 bb 10 00 00 call 80104fb0 <release>
return -1;
80103ef5: b8 ff ff ff ff mov $0xffffffff,%eax
80103efa: e9 b6 00 00 00 jmp 80103fb5 <piperead+0xec>
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
80103eff: 8b 45 08 mov 0x8(%ebp),%eax
80103f02: 8b 55 08 mov 0x8(%ebp),%edx
80103f05: 81 c2 34 02 00 00 add $0x234,%edx
80103f0b: 89 44 24 04 mov %eax,0x4(%esp)
80103f0f: 89 14 24 mov %edx,(%esp)
80103f12: e8 bf 0c 00 00 call 80104bd6 <sleep>
piperead(struct pipe *p, char *addr, int n)
{
int i;
acquire(&p->lock);
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
80103f17: 8b 45 08 mov 0x8(%ebp),%eax
80103f1a: 8b 90 34 02 00 00 mov 0x234(%eax),%edx
80103f20: 8b 45 08 mov 0x8(%ebp),%eax
80103f23: 8b 80 38 02 00 00 mov 0x238(%eax),%eax
80103f29: 39 c2 cmp %eax,%edx
80103f2b: 75 0d jne 80103f3a <piperead+0x71>
80103f2d: 8b 45 08 mov 0x8(%ebp),%eax
80103f30: 8b 80 40 02 00 00 mov 0x240(%eax),%eax
80103f36: 85 c0 test %eax,%eax
80103f38: 75 a3 jne 80103edd <piperead+0x14>
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
}
for(i = 0; i < n; i++){ //DOC: piperead-copy
80103f3a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80103f41: eb 49 jmp 80103f8c <piperead+0xc3>
if(p->nread == p->nwrite)
80103f43: 8b 45 08 mov 0x8(%ebp),%eax
80103f46: 8b 90 34 02 00 00 mov 0x234(%eax),%edx
80103f4c: 8b 45 08 mov 0x8(%ebp),%eax
80103f4f: 8b 80 38 02 00 00 mov 0x238(%eax),%eax
80103f55: 39 c2 cmp %eax,%edx
80103f57: 74 3d je 80103f96 <piperead+0xcd>
break;
addr[i] = p->data[p->nread++ % PIPESIZE];
80103f59: 8b 45 f4 mov -0xc(%ebp),%eax
80103f5c: 89 c2 mov %eax,%edx
80103f5e: 03 55 0c add 0xc(%ebp),%edx
80103f61: 8b 45 08 mov 0x8(%ebp),%eax
80103f64: 8b 80 34 02 00 00 mov 0x234(%eax),%eax
80103f6a: 89 c3 mov %eax,%ebx
80103f6c: 81 e3 ff 01 00 00 and $0x1ff,%ebx
80103f72: 8b 4d 08 mov 0x8(%ebp),%ecx
80103f75: 0f b6 4c 19 34 movzbl 0x34(%ecx,%ebx,1),%ecx
80103f7a: 88 0a mov %cl,(%edx)
80103f7c: 8d 50 01 lea 0x1(%eax),%edx
80103f7f: 8b 45 08 mov 0x8(%ebp),%eax
80103f82: 89 90 34 02 00 00 mov %edx,0x234(%eax)
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
}
for(i = 0; i < n; i++){ //DOC: piperead-copy
80103f88: 83 45 f4 01 addl $0x1,-0xc(%ebp)
80103f8c: 8b 45 f4 mov -0xc(%ebp),%eax
80103f8f: 3b 45 10 cmp 0x10(%ebp),%eax
80103f92: 7c af jl 80103f43 <piperead+0x7a>
80103f94: eb 01 jmp 80103f97 <piperead+0xce>
if(p->nread == p->nwrite)
break;
80103f96: 90 nop
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
80103f97: 8b 45 08 mov 0x8(%ebp),%eax
80103f9a: 05 38 02 00 00 add $0x238,%eax
80103f9f: 89 04 24 mov %eax,(%esp)
80103fa2: e8 75 0d 00 00 call 80104d1c <wakeup>
release(&p->lock);
80103fa7: 8b 45 08 mov 0x8(%ebp),%eax
80103faa: 89 04 24 mov %eax,(%esp)
80103fad: e8 fe 0f 00 00 call 80104fb0 <release>
return i;
80103fb2: 8b 45 f4 mov -0xc(%ebp),%eax
}
80103fb5: 83 c4 24 add $0x24,%esp
80103fb8: 5b pop %ebx
80103fb9: 5d pop %ebp
80103fba: c3 ret
...
80103fbc <readeflags>:
asm volatile("ltr %0" : : "r" (sel));
}
static inline uint
readeflags(void)
{
80103fbc: 55 push %ebp
80103fbd: 89 e5 mov %esp,%ebp
80103fbf: 83 ec 10 sub $0x10,%esp
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80103fc2: 9c pushf
80103fc3: 58 pop %eax
80103fc4: 89 45 fc mov %eax,-0x4(%ebp)
return eflags;
80103fc7: 8b 45 fc mov -0x4(%ebp),%eax
}
80103fca: c9 leave
80103fcb: c3 ret
80103fcc <sti>:
asm volatile("cli");
}
static inline void
sti(void)
{
80103fcc: 55 push %ebp
80103fcd: 89 e5 mov %esp,%ebp
asm volatile("sti");
80103fcf: fb sti
}
80103fd0: 5d pop %ebp
80103fd1: c3 ret
80103fd2 <memcop>:
static void wakeup1(void *chan);
void*
memcop(void *dst, void *src, uint n)
{
80103fd2: 55 push %ebp
80103fd3: 89 e5 mov %esp,%ebp
80103fd5: 83 ec 10 sub $0x10,%esp
const char *s;
char *d;
s = src;
80103fd8: 8b 45 0c mov 0xc(%ebp),%eax
80103fdb: 89 45 f8 mov %eax,-0x8(%ebp)
d = dst;
80103fde: 8b 45 08 mov 0x8(%ebp),%eax
80103fe1: 89 45 fc mov %eax,-0x4(%ebp)
if(s < d && s + n > d){
80103fe4: 8b 45 f8 mov -0x8(%ebp),%eax
80103fe7: 3b 45 fc cmp -0x4(%ebp),%eax
80103fea: 73 55 jae 80104041 <memcop+0x6f>
80103fec: 8b 45 10 mov 0x10(%ebp),%eax
80103fef: 8b 55 f8 mov -0x8(%ebp),%edx
80103ff2: 8d 04 02 lea (%edx,%eax,1),%eax
80103ff5: 3b 45 fc cmp -0x4(%ebp),%eax
80103ff8: 76 4a jbe 80104044 <memcop+0x72>
s += n;
80103ffa: 8b 45 10 mov 0x10(%ebp),%eax
80103ffd: 01 45 f8 add %eax,-0x8(%ebp)
d += n;
80104000: 8b 45 10 mov 0x10(%ebp),%eax
80104003: 01 45 fc add %eax,-0x4(%ebp)
while(n-- > 0)
80104006: eb 13 jmp 8010401b <memcop+0x49>
*--d = *--s;
80104008: 83 6d fc 01 subl $0x1,-0x4(%ebp)
8010400c: 83 6d f8 01 subl $0x1,-0x8(%ebp)
80104010: 8b 45 f8 mov -0x8(%ebp),%eax
80104013: 0f b6 10 movzbl (%eax),%edx
80104016: 8b 45 fc mov -0x4(%ebp),%eax
80104019: 88 10 mov %dl,(%eax)
s = src;
d = dst;
if(s < d && s + n > d){
s += n;
d += n;
while(n-- > 0)
8010401b: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010401f: 0f 95 c0 setne %al
80104022: 83 6d 10 01 subl $0x1,0x10(%ebp)
80104026: 84 c0 test %al,%al
80104028: 75 de jne 80104008 <memcop+0x36>
const char *s;
char *d;
s = src;
d = dst;
if(s < d && s + n > d){
8010402a: eb 28 jmp 80104054 <memcop+0x82>
d += n;
while(n-- > 0)
*--d = *--s;
} else
while(n-- > 0)
*d++ = *s++;
8010402c: 8b 45 f8 mov -0x8(%ebp),%eax
8010402f: 0f b6 10 movzbl (%eax),%edx
80104032: 8b 45 fc mov -0x4(%ebp),%eax
80104035: 88 10 mov %dl,(%eax)
80104037: 83 45 fc 01 addl $0x1,-0x4(%ebp)
8010403b: 83 45 f8 01 addl $0x1,-0x8(%ebp)
8010403f: eb 04 jmp 80104045 <memcop+0x73>
s += n;
d += n;
while(n-- > 0)
*--d = *--s;
} else
while(n-- > 0)
80104041: 90 nop
80104042: eb 01 jmp 80104045 <memcop+0x73>
80104044: 90 nop
80104045: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80104049: 0f 95 c0 setne %al
8010404c: 83 6d 10 01 subl $0x1,0x10(%ebp)
80104050: 84 c0 test %al,%al
80104052: 75 d8 jne 8010402c <memcop+0x5a>
*d++ = *s++;
return dst;
80104054: 8b 45 08 mov 0x8(%ebp),%eax
}
80104057: c9 leave
80104058: c3 ret
80104059 <pinit>:
void
pinit(void)
{
80104059: 55 push %ebp
8010405a: 89 e5 mov %esp,%ebp
8010405c: 83 ec 18 sub $0x18,%esp
initlock(&ptable.lock, "ptable");
8010405f: c7 44 24 04 c4 88 10 movl $0x801088c4,0x4(%esp)
80104066: 80
80104067: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
8010406e: e8 bb 0e 00 00 call 80104f2e <initlock>
}
80104073: c9 leave
80104074: c3 ret
80104075 <allocproc>:
// If found, change state to EMBRYO and initialize
// state required to run in the kernel.
// Otherwise return 0.
static struct proc*
allocproc(void)
{
80104075: 55 push %ebp
80104076: 89 e5 mov %esp,%ebp
80104078: 83 ec 28 sub $0x28,%esp
struct proc *p;
char *sp;
acquire(&ptable.lock);
8010407b: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104082: e8 c8 0e 00 00 call 80104f4f <acquire>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80104087: c7 45 f0 74 ff 10 80 movl $0x8010ff74,-0x10(%ebp)
8010408e: eb 11 jmp 801040a1 <allocproc+0x2c>
if(p->state == UNUSED)
80104090: 8b 45 f0 mov -0x10(%ebp),%eax
80104093: 8b 40 0c mov 0xc(%eax),%eax
80104096: 85 c0 test %eax,%eax
80104098: 74 27 je 801040c1 <allocproc+0x4c>
{
struct proc *p;
char *sp;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
8010409a: 81 45 f0 84 00 00 00 addl $0x84,-0x10(%ebp)
801040a1: b8 74 20 11 80 mov $0x80112074,%eax
801040a6: 39 45 f0 cmp %eax,-0x10(%ebp)
801040a9: 72 e5 jb 80104090 <allocproc+0x1b>
if(p->state == UNUSED)
goto found;
release(&ptable.lock);
801040ab: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
801040b2: e8 f9 0e 00 00 call 80104fb0 <release>
return 0;
801040b7: b8 00 00 00 00 mov $0x0,%eax
801040bc: e9 b5 00 00 00 jmp 80104176 <allocproc+0x101>
char *sp;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
if(p->state == UNUSED)
goto found;
801040c1: 90 nop
release(&ptable.lock);
return 0;
found:
p->state = EMBRYO;
801040c2: 8b 45 f0 mov -0x10(%ebp),%eax
801040c5: c7 40 0c 01 00 00 00 movl $0x1,0xc(%eax)
p->pid = nextpid++;
801040cc: a1 04 b0 10 80 mov 0x8010b004,%eax
801040d1: 8b 55 f0 mov -0x10(%ebp),%edx
801040d4: 89 42 10 mov %eax,0x10(%edx)
801040d7: 83 c0 01 add $0x1,%eax
801040da: a3 04 b0 10 80 mov %eax,0x8010b004
release(&ptable.lock);
801040df: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
801040e6: e8 c5 0e 00 00 call 80104fb0 <release>
// Allocate kernel stack.
if((p->kstack = kalloc()) == 0){
801040eb: e8 1a ea ff ff call 80102b0a <kalloc>
801040f0: 8b 55 f0 mov -0x10(%ebp),%edx
801040f3: 89 42 08 mov %eax,0x8(%edx)
801040f6: 8b 45 f0 mov -0x10(%ebp),%eax
801040f9: 8b 40 08 mov 0x8(%eax),%eax
801040fc: 85 c0 test %eax,%eax
801040fe: 75 11 jne 80104111 <allocproc+0x9c>
p->state = UNUSED;
80104100: 8b 45 f0 mov -0x10(%ebp),%eax
80104103: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
return 0;
8010410a: b8 00 00 00 00 mov $0x0,%eax
8010410f: eb 65 jmp 80104176 <allocproc+0x101>
}
sp = p->kstack + KSTACKSIZE;
80104111: 8b 45 f0 mov -0x10(%ebp),%eax
80104114: 8b 40 08 mov 0x8(%eax),%eax
80104117: 05 00 10 00 00 add $0x1000,%eax
8010411c: 89 45 f4 mov %eax,-0xc(%ebp)
// Leave room for trap frame.
sp -= sizeof *p->tf;
8010411f: 83 6d f4 4c subl $0x4c,-0xc(%ebp)
p->tf = (struct trapframe*)sp;
80104123: 8b 55 f4 mov -0xc(%ebp),%edx
80104126: 8b 45 f0 mov -0x10(%ebp),%eax
80104129: 89 50 18 mov %edx,0x18(%eax)
// Set up new context to start executing at forkret,
// which returns to trapret.
sp -= 4;
8010412c: 83 6d f4 04 subl $0x4,-0xc(%ebp)
*(uint*)sp = (uint)trapret;
80104130: 8b 45 f4 mov -0xc(%ebp),%eax
80104133: ba a8 66 10 80 mov $0x801066a8,%edx
80104138: 89 10 mov %edx,(%eax)
sp -= sizeof *p->context;
8010413a: 83 6d f4 14 subl $0x14,-0xc(%ebp)
p->context = (struct context*)sp;
8010413e: 8b 55 f4 mov -0xc(%ebp),%edx
80104141: 8b 45 f0 mov -0x10(%ebp),%eax
80104144: 89 50 1c mov %edx,0x1c(%eax)
memset(p->context, 0, sizeof *p->context);
80104147: 8b 45 f0 mov -0x10(%ebp),%eax
8010414a: 8b 40 1c mov 0x1c(%eax),%eax
8010414d: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp)
80104154: 00
80104155: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
8010415c: 00
8010415d: 89 04 24 mov %eax,(%esp)
80104160: e8 39 10 00 00 call 8010519e <memset>
p->context->eip = (uint)forkret;
80104165: 8b 45 f0 mov -0x10(%ebp),%eax
80104168: 8b 40 1c mov 0x1c(%eax),%eax
8010416b: ba aa 4b 10 80 mov $0x80104baa,%edx
80104170: 89 50 10 mov %edx,0x10(%eax)
return p;
80104173: 8b 45 f0 mov -0x10(%ebp),%eax
}
80104176: c9 leave
80104177: c3 ret
80104178 <userinit>:
//PAGEBREAK: 32
// Set up first user process.
void
userinit(void)
{
80104178: 55 push %ebp
80104179: 89 e5 mov %esp,%ebp
8010417b: 83 ec 28 sub $0x28,%esp
struct proc *p;
extern char _binary_initcode_start[], _binary_initcode_size[];
p = allocproc();
8010417e: e8 f2 fe ff ff call 80104075 <allocproc>
80104183: 89 45 f4 mov %eax,-0xc(%ebp)
initproc = p;
80104186: 8b 45 f4 mov -0xc(%ebp),%eax
80104189: a3 68 b6 10 80 mov %eax,0x8010b668
if((p->pgdir = setupkvm()) == 0)
8010418e: e8 fe 3b 00 00 call 80107d91 <setupkvm>
80104193: 8b 55 f4 mov -0xc(%ebp),%edx
80104196: 89 42 04 mov %eax,0x4(%edx)
80104199: 8b 45 f4 mov -0xc(%ebp),%eax
8010419c: 8b 40 04 mov 0x4(%eax),%eax
8010419f: 85 c0 test %eax,%eax
801041a1: 75 0c jne 801041af <userinit+0x37>
panic("userinit: out of memory?");
801041a3: c7 04 24 cb 88 10 80 movl $0x801088cb,(%esp)
801041aa: e8 8b c3 ff ff call 8010053a <panic>
inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
801041af: ba 2c 00 00 00 mov $0x2c,%edx
801041b4: 8b 45 f4 mov -0xc(%ebp),%eax
801041b7: 8b 40 04 mov 0x4(%eax),%eax
801041ba: 89 54 24 08 mov %edx,0x8(%esp)
801041be: c7 44 24 04 00 b5 10 movl $0x8010b500,0x4(%esp)
801041c5: 80
801041c6: 89 04 24 mov %eax,(%esp)
801041c9: e8 1c 3e 00 00 call 80107fea <inituvm>
p->sz = PGSIZE;
801041ce: 8b 45 f4 mov -0xc(%ebp),%eax
801041d1: c7 00 00 10 00 00 movl $0x1000,(%eax)
memset(p->tf, 0, sizeof(*p->tf));
801041d7: 8b 45 f4 mov -0xc(%ebp),%eax
801041da: 8b 40 18 mov 0x18(%eax),%eax
801041dd: c7 44 24 08 4c 00 00 movl $0x4c,0x8(%esp)
801041e4: 00
801041e5: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801041ec: 00
801041ed: 89 04 24 mov %eax,(%esp)
801041f0: e8 a9 0f 00 00 call 8010519e <memset>
p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
801041f5: 8b 45 f4 mov -0xc(%ebp),%eax
801041f8: 8b 40 18 mov 0x18(%eax),%eax
801041fb: 66 c7 40 3c 23 00 movw $0x23,0x3c(%eax)
p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
80104201: 8b 45 f4 mov -0xc(%ebp),%eax
80104204: 8b 40 18 mov 0x18(%eax),%eax
80104207: 66 c7 40 2c 2b 00 movw $0x2b,0x2c(%eax)
p->tf->es = p->tf->ds;
8010420d: 8b 45 f4 mov -0xc(%ebp),%eax
80104210: 8b 40 18 mov 0x18(%eax),%eax
80104213: 8b 55 f4 mov -0xc(%ebp),%edx
80104216: 8b 52 18 mov 0x18(%edx),%edx
80104219: 0f b7 52 2c movzwl 0x2c(%edx),%edx
8010421d: 66 89 50 28 mov %dx,0x28(%eax)
p->tf->ss = p->tf->ds;
80104221: 8b 45 f4 mov -0xc(%ebp),%eax
80104224: 8b 40 18 mov 0x18(%eax),%eax
80104227: 8b 55 f4 mov -0xc(%ebp),%edx
8010422a: 8b 52 18 mov 0x18(%edx),%edx
8010422d: 0f b7 52 2c movzwl 0x2c(%edx),%edx
80104231: 66 89 50 48 mov %dx,0x48(%eax)
p->tf->eflags = FL_IF;
80104235: 8b 45 f4 mov -0xc(%ebp),%eax
80104238: 8b 40 18 mov 0x18(%eax),%eax
8010423b: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax)
p->tf->esp = PGSIZE;
80104242: 8b 45 f4 mov -0xc(%ebp),%eax
80104245: 8b 40 18 mov 0x18(%eax),%eax
80104248: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax)
p->tf->eip = 0; // beginning of initcode.S
8010424f: 8b 45 f4 mov -0xc(%ebp),%eax
80104252: 8b 40 18 mov 0x18(%eax),%eax
80104255: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax)
safestrcpy(p->name, "initcode", sizeof(p->name));
8010425c: 8b 45 f4 mov -0xc(%ebp),%eax
8010425f: 83 c0 6c add $0x6c,%eax
80104262: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80104269: 00
8010426a: c7 44 24 04 e4 88 10 movl $0x801088e4,0x4(%esp)
80104271: 80
80104272: 89 04 24 mov %eax,(%esp)
80104275: e8 57 11 00 00 call 801053d1 <safestrcpy>
p->cwd = namei("/");
8010427a: c7 04 24 ed 88 10 80 movl $0x801088ed,(%esp)
80104281: e8 9d e1 ff ff call 80102423 <namei>
80104286: 8b 55 f4 mov -0xc(%ebp),%edx
80104289: 89 42 68 mov %eax,0x68(%edx)
p->state = RUNNABLE;
8010428c: 8b 45 f4 mov -0xc(%ebp),%eax
8010428f: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
}
80104296: c9 leave
80104297: c3 ret
80104298 <growproc>:
// Grow current process's memory by n bytes.
// Return 0 on success, -1 on failure.
int
growproc(int n)
{
80104298: 55 push %ebp
80104299: 89 e5 mov %esp,%ebp
8010429b: 83 ec 28 sub $0x28,%esp
uint sz;
sz = proc->sz;
8010429e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801042a4: 8b 00 mov (%eax),%eax
801042a6: 89 45 f4 mov %eax,-0xc(%ebp)
if(n > 0){
801042a9: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
801042ad: 7e 34 jle 801042e3 <growproc+0x4b>
if((sz = allocuvm(proc->pgdir, sz, sz + n)) == 0)
801042af: 8b 45 08 mov 0x8(%ebp),%eax
801042b2: 89 c2 mov %eax,%edx
801042b4: 03 55 f4 add -0xc(%ebp),%edx
801042b7: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801042bd: 8b 40 04 mov 0x4(%eax),%eax
801042c0: 89 54 24 08 mov %edx,0x8(%esp)
801042c4: 8b 55 f4 mov -0xc(%ebp),%edx
801042c7: 89 54 24 04 mov %edx,0x4(%esp)
801042cb: 89 04 24 mov %eax,(%esp)
801042ce: e8 92 3e 00 00 call 80108165 <allocuvm>
801042d3: 89 45 f4 mov %eax,-0xc(%ebp)
801042d6: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801042da: 75 41 jne 8010431d <growproc+0x85>
return -1;
801042dc: b8 ff ff ff ff mov $0xffffffff,%eax
801042e1: eb 58 jmp 8010433b <growproc+0xa3>
} else if(n < 0){
801042e3: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
801042e7: 79 34 jns 8010431d <growproc+0x85>
if((sz = deallocuvm(proc->pgdir, sz, sz + n)) == 0)
801042e9: 8b 45 08 mov 0x8(%ebp),%eax
801042ec: 89 c2 mov %eax,%edx
801042ee: 03 55 f4 add -0xc(%ebp),%edx
801042f1: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801042f7: 8b 40 04 mov 0x4(%eax),%eax
801042fa: 89 54 24 08 mov %edx,0x8(%esp)
801042fe: 8b 55 f4 mov -0xc(%ebp),%edx
80104301: 89 54 24 04 mov %edx,0x4(%esp)
80104305: 89 04 24 mov %eax,(%esp)
80104308: e8 32 3f 00 00 call 8010823f <deallocuvm>
8010430d: 89 45 f4 mov %eax,-0xc(%ebp)
80104310: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80104314: 75 07 jne 8010431d <growproc+0x85>
return -1;
80104316: b8 ff ff ff ff mov $0xffffffff,%eax
8010431b: eb 1e jmp 8010433b <growproc+0xa3>
}
proc->sz = sz;
8010431d: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104323: 8b 55 f4 mov -0xc(%ebp),%edx
80104326: 89 10 mov %edx,(%eax)
switchuvm(proc);
80104328: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010432e: 89 04 24 mov %eax,(%esp)
80104331: e8 4d 3b 00 00 call 80107e83 <switchuvm>
return 0;
80104336: b8 00 00 00 00 mov $0x0,%eax
}
8010433b: c9 leave
8010433c: c3 ret
8010433d <fork>:
// Create a new process copying p as the parent.
// Sets up stack to return as if from system call.
// Caller must set state of returned proc to RUNNABLE.
int
fork(void)
{
8010433d: 55 push %ebp
8010433e: 89 e5 mov %esp,%ebp
80104340: 57 push %edi
80104341: 56 push %esi
80104342: 53 push %ebx
80104343: 83 ec 2c sub $0x2c,%esp
int i, pid;
struct proc *np;
// Allocate process.
if((np = allocproc()) == 0)
80104346: e8 2a fd ff ff call 80104075 <allocproc>
8010434b: 89 45 e4 mov %eax,-0x1c(%ebp)
8010434e: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
80104352: 75 0a jne 8010435e <fork+0x21>
return -1;
80104354: b8 ff ff ff ff mov $0xffffffff,%eax
80104359: e9 47 01 00 00 jmp 801044a5 <fork+0x168>
// Copy process state from p.
if((np->pgdir = copyuvm(proc->pgdir, proc->sz)) == 0){
8010435e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104364: 8b 10 mov (%eax),%edx
80104366: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010436c: 8b 40 04 mov 0x4(%eax),%eax
8010436f: 89 54 24 04 mov %edx,0x4(%esp)
80104373: 89 04 24 mov %eax,(%esp)
80104376: e8 54 40 00 00 call 801083cf <copyuvm>
8010437b: 8b 55 e4 mov -0x1c(%ebp),%edx
8010437e: 89 42 04 mov %eax,0x4(%edx)
80104381: 8b 45 e4 mov -0x1c(%ebp),%eax
80104384: 8b 40 04 mov 0x4(%eax),%eax
80104387: 85 c0 test %eax,%eax
80104389: 75 2c jne 801043b7 <fork+0x7a>
kfree(np->kstack);
8010438b: 8b 45 e4 mov -0x1c(%ebp),%eax
8010438e: 8b 40 08 mov 0x8(%eax),%eax
80104391: 89 04 24 mov %eax,(%esp)
80104394: e8 d8 e6 ff ff call 80102a71 <kfree>
np->kstack = 0;
80104399: 8b 45 e4 mov -0x1c(%ebp),%eax
8010439c: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
np->state = UNUSED;
801043a3: 8b 45 e4 mov -0x1c(%ebp),%eax
801043a6: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
return -1;
801043ad: b8 ff ff ff ff mov $0xffffffff,%eax
801043b2: e9 ee 00 00 00 jmp 801044a5 <fork+0x168>
}
np->sz = proc->sz;
801043b7: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801043bd: 8b 10 mov (%eax),%edx
801043bf: 8b 45 e4 mov -0x1c(%ebp),%eax
801043c2: 89 10 mov %edx,(%eax)
np->parent = proc;
801043c4: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
801043cb: 8b 45 e4 mov -0x1c(%ebp),%eax
801043ce: 89 50 14 mov %edx,0x14(%eax)
*np->tf = *proc->tf;
801043d1: 8b 45 e4 mov -0x1c(%ebp),%eax
801043d4: 8b 50 18 mov 0x18(%eax),%edx
801043d7: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801043dd: 8b 40 18 mov 0x18(%eax),%eax
801043e0: 89 c3 mov %eax,%ebx
801043e2: b8 13 00 00 00 mov $0x13,%eax
801043e7: 89 d7 mov %edx,%edi
801043e9: 89 de mov %ebx,%esi
801043eb: 89 c1 mov %eax,%ecx
801043ed: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
np->isthread = 0;
801043ef: 8b 45 e4 mov -0x1c(%ebp),%eax
801043f2: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax)
801043f9: 00 00 00
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
801043fc: 8b 45 e4 mov -0x1c(%ebp),%eax
801043ff: 8b 40 18 mov 0x18(%eax),%eax
80104402: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
for(i = 0; i < NOFILE; i++)
80104409: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp)
80104410: eb 3d jmp 8010444f <fork+0x112>
if(proc->ofile[i])
80104412: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104418: 8b 55 dc mov -0x24(%ebp),%edx
8010441b: 83 c2 08 add $0x8,%edx
8010441e: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
80104422: 85 c0 test %eax,%eax
80104424: 74 25 je 8010444b <fork+0x10e>
np->ofile[i] = filedup(proc->ofile[i]);
80104426: 8b 5d dc mov -0x24(%ebp),%ebx
80104429: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010442f: 8b 55 dc mov -0x24(%ebp),%edx
80104432: 83 c2 08 add $0x8,%edx
80104435: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
80104439: 89 04 24 mov %eax,(%esp)
8010443c: e8 44 cb ff ff call 80100f85 <filedup>
80104441: 8b 55 e4 mov -0x1c(%ebp),%edx
80104444: 8d 4b 08 lea 0x8(%ebx),%ecx
80104447: 89 44 8a 08 mov %eax,0x8(%edx,%ecx,4)
np->isthread = 0;
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
for(i = 0; i < NOFILE; i++)
8010444b: 83 45 dc 01 addl $0x1,-0x24(%ebp)
8010444f: 83 7d dc 0f cmpl $0xf,-0x24(%ebp)
80104453: 7e bd jle 80104412 <fork+0xd5>
if(proc->ofile[i])
np->ofile[i] = filedup(proc->ofile[i]);
np->cwd = idup(proc->cwd);
80104455: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010445b: 8b 40 68 mov 0x68(%eax),%eax
8010445e: 89 04 24 mov %eax,(%esp)
80104461: e8 e3 d3 ff ff call 80101849 <idup>
80104466: 8b 55 e4 mov -0x1c(%ebp),%edx
80104469: 89 42 68 mov %eax,0x68(%edx)
pid = np->pid;
8010446c: 8b 45 e4 mov -0x1c(%ebp),%eax
8010446f: 8b 40 10 mov 0x10(%eax),%eax
80104472: 89 45 e0 mov %eax,-0x20(%ebp)
np->state = RUNNABLE;
80104475: 8b 45 e4 mov -0x1c(%ebp),%eax
80104478: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
safestrcpy(np->name, proc->name, sizeof(proc->name));
8010447f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104485: 8d 50 6c lea 0x6c(%eax),%edx
80104488: 8b 45 e4 mov -0x1c(%ebp),%eax
8010448b: 83 c0 6c add $0x6c,%eax
8010448e: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80104495: 00
80104496: 89 54 24 04 mov %edx,0x4(%esp)
8010449a: 89 04 24 mov %eax,(%esp)
8010449d: e8 2f 0f 00 00 call 801053d1 <safestrcpy>
return pid;
801044a2: 8b 45 e0 mov -0x20(%ebp),%eax
}
801044a5: 83 c4 2c add $0x2c,%esp
801044a8: 5b pop %ebx
801044a9: 5e pop %esi
801044aa: 5f pop %edi
801044ab: 5d pop %ebp
801044ac: c3 ret
801044ad <clone>:
//creat a new process but used parent pgdir.
int clone(int stack, int size, int routine, int arg){
801044ad: 55 push %ebp
801044ae: 89 e5 mov %esp,%ebp
801044b0: 57 push %edi
801044b1: 56 push %esi
801044b2: 53 push %ebx
801044b3: 81 ec bc 00 00 00 sub $0xbc,%esp
int i, pid;
struct proc *np;
//cprintf("in clone\n");
// Allocate process.
if((np = allocproc()) == 0)
801044b9: e8 b7 fb ff ff call 80104075 <allocproc>
801044be: 89 45 dc mov %eax,-0x24(%ebp)
801044c1: 83 7d dc 00 cmpl $0x0,-0x24(%ebp)
801044c5: 75 0a jne 801044d1 <clone+0x24>
return -1;
801044c7: b8 ff ff ff ff mov $0xffffffff,%eax
801044cc: e9 f4 01 00 00 jmp 801046c5 <clone+0x218>
if((stack % PGSIZE) != 0 || stack == 0 || routine == 0)
801044d1: 8b 45 08 mov 0x8(%ebp),%eax
801044d4: 25 ff 0f 00 00 and $0xfff,%eax
801044d9: 85 c0 test %eax,%eax
801044db: 75 0c jne 801044e9 <clone+0x3c>
801044dd: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
801044e1: 74 06 je 801044e9 <clone+0x3c>
801044e3: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801044e7: 75 0a jne 801044f3 <clone+0x46>
return -1;
801044e9: b8 ff ff ff ff mov $0xffffffff,%eax
801044ee: e9 d2 01 00 00 jmp 801046c5 <clone+0x218>
np->pgdir = proc->pgdir;
801044f3: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801044f9: 8b 50 04 mov 0x4(%eax),%edx
801044fc: 8b 45 dc mov -0x24(%ebp),%eax
801044ff: 89 50 04 mov %edx,0x4(%eax)
np->sz = proc->sz;
80104502: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104508: 8b 10 mov (%eax),%edx
8010450a: 8b 45 dc mov -0x24(%ebp),%eax
8010450d: 89 10 mov %edx,(%eax)
np->parent = proc;
8010450f: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
80104516: 8b 45 dc mov -0x24(%ebp),%eax
80104519: 89 50 14 mov %edx,0x14(%eax)
*np->tf = *proc->tf;
8010451c: 8b 45 dc mov -0x24(%ebp),%eax
8010451f: 8b 50 18 mov 0x18(%eax),%edx
80104522: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104528: 8b 40 18 mov 0x18(%eax),%eax
8010452b: 89 c3 mov %eax,%ebx
8010452d: b8 13 00 00 00 mov $0x13,%eax
80104532: 89 d7 mov %edx,%edi
80104534: 89 de mov %ebx,%esi
80104536: 89 c1 mov %eax,%ecx
80104538: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
np->isthread = 1;
8010453a: 8b 45 dc mov -0x24(%ebp),%eax
8010453d: c7 80 80 00 00 00 01 movl $0x1,0x80(%eax)
80104544: 00 00 00
pid = np->pid;
80104547: 8b 45 dc mov -0x24(%ebp),%eax
8010454a: 8b 40 10 mov 0x10(%eax),%eax
8010454d: 89 45 d8 mov %eax,-0x28(%ebp)
struct proc *pp;
pp = proc;
80104550: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104556: 89 45 e0 mov %eax,-0x20(%ebp)
while(pp->isthread == 1){
80104559: eb 09 jmp 80104564 <clone+0xb7>
pp = pp->parent;
8010455b: 8b 45 e0 mov -0x20(%ebp),%eax
8010455e: 8b 40 14 mov 0x14(%eax),%eax
80104561: 89 45 e0 mov %eax,-0x20(%ebp)
np->isthread = 1;
pid = np->pid;
struct proc *pp;
pp = proc;
while(pp->isthread == 1){
80104564: 8b 45 e0 mov -0x20(%ebp),%eax
80104567: 8b 80 80 00 00 00 mov 0x80(%eax),%eax
8010456d: 83 f8 01 cmp $0x1,%eax
80104570: 74 e9 je 8010455b <clone+0xae>
pp = pp->parent;
}
np->parent = pp;
80104572: 8b 45 dc mov -0x24(%ebp),%eax
80104575: 8b 55 e0 mov -0x20(%ebp),%edx
80104578: 89 50 14 mov %edx,0x14(%eax)
//need to be modified as point to the same address
//*np->ofile = *proc->ofile;
for(i = 0; i < NOFILE; i++)
8010457b: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp)
80104582: eb 3d jmp 801045c1 <clone+0x114>
if(proc->ofile[i])
80104584: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010458a: 8b 55 d4 mov -0x2c(%ebp),%edx
8010458d: 83 c2 08 add $0x8,%edx
80104590: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
80104594: 85 c0 test %eax,%eax
80104596: 74 25 je 801045bd <clone+0x110>
np->ofile[i] = filedup(proc->ofile[i]);
80104598: 8b 5d d4 mov -0x2c(%ebp),%ebx
8010459b: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801045a1: 8b 55 d4 mov -0x2c(%ebp),%edx
801045a4: 83 c2 08 add $0x8,%edx
801045a7: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
801045ab: 89 04 24 mov %eax,(%esp)
801045ae: e8 d2 c9 ff ff call 80100f85 <filedup>
801045b3: 8b 55 dc mov -0x24(%ebp),%edx
801045b6: 8d 4b 08 lea 0x8(%ebx),%ecx
801045b9: 89 44 8a 08 mov %eax,0x8(%edx,%ecx,4)
pp = pp->parent;
}
np->parent = pp;
//need to be modified as point to the same address
//*np->ofile = *proc->ofile;
for(i = 0; i < NOFILE; i++)
801045bd: 83 45 d4 01 addl $0x1,-0x2c(%ebp)
801045c1: 83 7d d4 0f cmpl $0xf,-0x2c(%ebp)
801045c5: 7e bd jle 80104584 <clone+0xd7>
if(proc->ofile[i])
np->ofile[i] = filedup(proc->ofile[i]);
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
801045c7: 8b 45 dc mov -0x24(%ebp),%eax
801045ca: 8b 40 18 mov 0x18(%eax),%eax
801045cd: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
uint ustack[MAXARG];
uint sp = stack + PGSIZE;
801045d4: 8b 45 08 mov 0x8(%ebp),%eax
801045d7: 05 00 10 00 00 add $0x1000,%eax
801045dc: 89 45 e4 mov %eax,-0x1c(%ebp)
//
//modify here <<<<<
np->tf->ebp = sp;
801045df: 8b 45 dc mov -0x24(%ebp),%eax
801045e2: 8b 40 18 mov 0x18(%eax),%eax
801045e5: 8b 55 e4 mov -0x1c(%ebp),%edx
801045e8: 89 50 08 mov %edx,0x8(%eax)
ustack[0] = 0xffffffff;
801045eb: c7 85 54 ff ff ff ff movl $0xffffffff,-0xac(%ebp)
801045f2: ff ff ff
ustack[1] = arg;
801045f5: 8b 45 14 mov 0x14(%ebp),%eax
801045f8: 89 85 58 ff ff ff mov %eax,-0xa8(%ebp)
sp -= 8;
801045fe: 83 6d e4 08 subl $0x8,-0x1c(%ebp)
if(copyout(np->pgdir,sp,ustack,8)<0){
80104602: 8b 45 dc mov -0x24(%ebp),%eax
80104605: 8b 40 04 mov 0x4(%eax),%eax
80104608: c7 44 24 0c 08 00 00 movl $0x8,0xc(%esp)
8010460f: 00
80104610: 8d 95 54 ff ff ff lea -0xac(%ebp),%edx
80104616: 89 54 24 08 mov %edx,0x8(%esp)
8010461a: 8b 55 e4 mov -0x1c(%ebp),%edx
8010461d: 89 54 24 04 mov %edx,0x4(%esp)
80104621: 89 04 24 mov %eax,(%esp)
80104624: e8 25 3f 00 00 call 8010854e <copyout>
80104629: 85 c0 test %eax,%eax
8010462b: 79 16 jns 80104643 <clone+0x196>
cprintf("push arg fails\n");
8010462d: c7 04 24 ef 88 10 80 movl $0x801088ef,(%esp)
80104634: e8 61 bd ff ff call 8010039a <cprintf>
return -1;
80104639: b8 ff ff ff ff mov $0xffffffff,%eax
8010463e: e9 82 00 00 00 jmp 801046c5 <clone+0x218>
}
np->tf->eip = routine;
80104643: 8b 45 dc mov -0x24(%ebp),%eax
80104646: 8b 40 18 mov 0x18(%eax),%eax
80104649: 8b 55 10 mov 0x10(%ebp),%edx
8010464c: 89 50 38 mov %edx,0x38(%eax)
np->tf->esp = sp;
8010464f: 8b 45 dc mov -0x24(%ebp),%eax
80104652: 8b 40 18 mov 0x18(%eax),%eax
80104655: 8b 55 e4 mov -0x1c(%ebp),%edx
80104658: 89 50 44 mov %edx,0x44(%eax)
np->cwd = idup(proc->cwd);
8010465b: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104661: 8b 40 68 mov 0x68(%eax),%eax
80104664: 89 04 24 mov %eax,(%esp)
80104667: e8 dd d1 ff ff call 80101849 <idup>
8010466c: 8b 55 dc mov -0x24(%ebp),%edx
8010466f: 89 42 68 mov %eax,0x68(%edx)
switchuvm(np);
80104672: 8b 45 dc mov -0x24(%ebp),%eax
80104675: 89 04 24 mov %eax,(%esp)
80104678: e8 06 38 00 00 call 80107e83 <switchuvm>
acquire(&ptable.lock);
8010467d: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104684: e8 c6 08 00 00 call 80104f4f <acquire>
np->state = RUNNABLE;
80104689: 8b 45 dc mov -0x24(%ebp),%eax
8010468c: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
release(&ptable.lock);
80104693: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
8010469a: e8 11 09 00 00 call 80104fb0 <release>
safestrcpy(np->name, proc->name, sizeof(proc->name));
8010469f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801046a5: 8d 50 6c lea 0x6c(%eax),%edx
801046a8: 8b 45 dc mov -0x24(%ebp),%eax
801046ab: 83 c0 6c add $0x6c,%eax
801046ae: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
801046b5: 00
801046b6: 89 54 24 04 mov %edx,0x4(%esp)
801046ba: 89 04 24 mov %eax,(%esp)
801046bd: e8 0f 0d 00 00 call 801053d1 <safestrcpy>
return pid;
801046c2: 8b 45 d8 mov -0x28(%ebp),%eax
}
801046c5: 81 c4 bc 00 00 00 add $0xbc,%esp
801046cb: 5b pop %ebx
801046cc: 5e pop %esi
801046cd: 5f pop %edi
801046ce: 5d pop %ebp
801046cf: c3 ret
801046d0 <exit>:
// Exit the current process. Does not return.
// An exited process remains in the zombie state
// until its parent calls wait() to find out it exited.
void
exit(void)
{
801046d0: 55 push %ebp
801046d1: 89 e5 mov %esp,%ebp
801046d3: 83 ec 28 sub $0x28,%esp
struct proc *p;
int fd;
if(proc == initproc)
801046d6: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
801046dd: a1 68 b6 10 80 mov 0x8010b668,%eax
801046e2: 39 c2 cmp %eax,%edx
801046e4: 75 0c jne 801046f2 <exit+0x22>
panic("init exiting");
801046e6: c7 04 24 ff 88 10 80 movl $0x801088ff,(%esp)
801046ed: e8 48 be ff ff call 8010053a <panic>
// Close all open files.
for(fd = 0; fd < NOFILE; fd++){
801046f2: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
801046f9: eb 44 jmp 8010473f <exit+0x6f>
if(proc->ofile[fd]){
801046fb: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104701: 8b 55 f4 mov -0xc(%ebp),%edx
80104704: 83 c2 08 add $0x8,%edx
80104707: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
8010470b: 85 c0 test %eax,%eax
8010470d: 74 2c je 8010473b <exit+0x6b>
fileclose(proc->ofile[fd]);
8010470f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104715: 8b 55 f4 mov -0xc(%ebp),%edx
80104718: 83 c2 08 add $0x8,%edx
8010471b: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
8010471f: 89 04 24 mov %eax,(%esp)
80104722: e8 a6 c8 ff ff call 80100fcd <fileclose>
proc->ofile[fd] = 0;
80104727: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010472d: 8b 55 f4 mov -0xc(%ebp),%edx
80104730: 83 c2 08 add $0x8,%edx
80104733: c7 44 90 08 00 00 00 movl $0x0,0x8(%eax,%edx,4)
8010473a: 00
if(proc == initproc)
panic("init exiting");
// Close all open files.
for(fd = 0; fd < NOFILE; fd++){
8010473b: 83 45 f4 01 addl $0x1,-0xc(%ebp)
8010473f: 83 7d f4 0f cmpl $0xf,-0xc(%ebp)
80104743: 7e b6 jle 801046fb <exit+0x2b>
fileclose(proc->ofile[fd]);
proc->ofile[fd] = 0;
}
}
iput(proc->cwd);
80104745: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010474b: 8b 40 68 mov 0x68(%eax),%eax
8010474e: 89 04 24 mov %eax,(%esp)
80104751: e8 db d2 ff ff call 80101a31 <iput>
proc->cwd = 0;
80104756: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010475c: c7 40 68 00 00 00 00 movl $0x0,0x68(%eax)
acquire(&ptable.lock);
80104763: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
8010476a: e8 e0 07 00 00 call 80104f4f <acquire>
// Parent might be sleeping in wait().
wakeup1(proc->parent);
8010476f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104775: 8b 40 14 mov 0x14(%eax),%eax
80104778: 89 04 24 mov %eax,(%esp)
8010477b: e8 f1 04 00 00 call 80104c71 <wakeup1>
// Pass abandoned children to init.
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104780: c7 45 f0 74 ff 10 80 movl $0x8010ff74,-0x10(%ebp)
80104787: eb 3b jmp 801047c4 <exit+0xf4>
if(p->parent == proc){
80104789: 8b 45 f0 mov -0x10(%ebp),%eax
8010478c: 8b 50 14 mov 0x14(%eax),%edx
8010478f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104795: 39 c2 cmp %eax,%edx
80104797: 75 24 jne 801047bd <exit+0xed>
p->parent = initproc;
80104799: 8b 15 68 b6 10 80 mov 0x8010b668,%edx
8010479f: 8b 45 f0 mov -0x10(%ebp),%eax
801047a2: 89 50 14 mov %edx,0x14(%eax)
if(p->state == ZOMBIE)
801047a5: 8b 45 f0 mov -0x10(%ebp),%eax
801047a8: 8b 40 0c mov 0xc(%eax),%eax
801047ab: 83 f8 05 cmp $0x5,%eax
801047ae: 75 0d jne 801047bd <exit+0xed>
wakeup1(initproc);
801047b0: a1 68 b6 10 80 mov 0x8010b668,%eax
801047b5: 89 04 24 mov %eax,(%esp)
801047b8: e8 b4 04 00 00 call 80104c71 <wakeup1>
// Parent might be sleeping in wait().
wakeup1(proc->parent);
// Pass abandoned children to init.
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801047bd: 81 45 f0 84 00 00 00 addl $0x84,-0x10(%ebp)
801047c4: b8 74 20 11 80 mov $0x80112074,%eax
801047c9: 39 45 f0 cmp %eax,-0x10(%ebp)
801047cc: 72 bb jb 80104789 <exit+0xb9>
wakeup1(initproc);
}
}
// Jump into the scheduler, never to return.
proc->state = ZOMBIE;
801047ce: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801047d4: c7 40 0c 05 00 00 00 movl $0x5,0xc(%eax)
sched();
801047db: e8 98 02 00 00 call 80104a78 <sched>
panic("zombie exit");
801047e0: c7 04 24 0c 89 10 80 movl $0x8010890c,(%esp)
801047e7: e8 4e bd ff ff call 8010053a <panic>
801047ec <texit>:
}
void
texit(void)
{
801047ec: 55 push %ebp
801047ed: 89 e5 mov %esp,%ebp
801047ef: 83 ec 28 sub $0x28,%esp
// struct proc *p;
int fd;
if(proc == initproc)
801047f2: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
801047f9: a1 68 b6 10 80 mov 0x8010b668,%eax
801047fe: 39 c2 cmp %eax,%edx
80104800: 75 0c jne 8010480e <texit+0x22>
panic("init exiting");
80104802: c7 04 24 ff 88 10 80 movl $0x801088ff,(%esp)
80104809: e8 2c bd ff ff call 8010053a <panic>
// Close all open files.
for(fd = 0; fd < NOFILE; fd++){
8010480e: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80104815: eb 44 jmp 8010485b <texit+0x6f>
if(proc->ofile[fd]){
80104817: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010481d: 8b 55 f4 mov -0xc(%ebp),%edx
80104820: 83 c2 08 add $0x8,%edx
80104823: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
80104827: 85 c0 test %eax,%eax
80104829: 74 2c je 80104857 <texit+0x6b>
fileclose(proc->ofile[fd]);
8010482b: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104831: 8b 55 f4 mov -0xc(%ebp),%edx
80104834: 83 c2 08 add $0x8,%edx
80104837: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
8010483b: 89 04 24 mov %eax,(%esp)
8010483e: e8 8a c7 ff ff call 80100fcd <fileclose>
proc->ofile[fd] = 0;
80104843: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104849: 8b 55 f4 mov -0xc(%ebp),%edx
8010484c: 83 c2 08 add $0x8,%edx
8010484f: c7 44 90 08 00 00 00 movl $0x0,0x8(%eax,%edx,4)
80104856: 00
if(proc == initproc)
panic("init exiting");
// Close all open files.
for(fd = 0; fd < NOFILE; fd++){
80104857: 83 45 f4 01 addl $0x1,-0xc(%ebp)
8010485b: 83 7d f4 0f cmpl $0xf,-0xc(%ebp)
8010485f: 7e b6 jle 80104817 <texit+0x2b>
if(proc->ofile[fd]){
fileclose(proc->ofile[fd]);
proc->ofile[fd] = 0;
}
}
iput(proc->cwd);
80104861: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104867: 8b 40 68 mov 0x68(%eax),%eax
8010486a: 89 04 24 mov %eax,(%esp)
8010486d: e8 bf d1 ff ff call 80101a31 <iput>
proc->cwd = 0;
80104872: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104878: c7 40 68 00 00 00 00 movl $0x0,0x68(%eax)
acquire(&ptable.lock);
8010487f: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104886: e8 c4 06 00 00 call 80104f4f <acquire>
// Parent might be sleeping in wait().
wakeup1(proc->parent);
8010488b: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104891: 8b 40 14 mov 0x14(%eax),%eax
80104894: 89 04 24 mov %eax,(%esp)
80104897: e8 d5 03 00 00 call 80104c71 <wakeup1>
// if(p->state == ZOMBIE)
// wakeup1(initproc);
// }
// }
// Jump into the scheduler, never to return.
proc->state = ZOMBIE;
8010489c: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801048a2: c7 40 0c 05 00 00 00 movl $0x5,0xc(%eax)
sched();
801048a9: e8 ca 01 00 00 call 80104a78 <sched>
panic("zombie exit");
801048ae: c7 04 24 0c 89 10 80 movl $0x8010890c,(%esp)
801048b5: e8 80 bc ff ff call 8010053a <panic>
801048ba <wait>:
}
// Wait for a child process to exit and return its pid.
// Return -1 if this process has no children.
int
wait(void)
{
801048ba: 55 push %ebp
801048bb: 89 e5 mov %esp,%ebp
801048bd: 83 ec 28 sub $0x28,%esp
struct proc *p;
int havekids, pid;
acquire(&ptable.lock);
801048c0: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
801048c7: e8 83 06 00 00 call 80104f4f <acquire>
for(;;){
// Scan through table looking for zombie children.
havekids = 0;
801048cc: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801048d3: c7 45 ec 74 ff 10 80 movl $0x8010ff74,-0x14(%ebp)
801048da: e9 ab 00 00 00 jmp 8010498a <wait+0xd0>
// if(p->parent != proc && p->isthread ==1)
if(p->parent != proc)
801048df: 8b 45 ec mov -0x14(%ebp),%eax
801048e2: 8b 50 14 mov 0x14(%eax),%edx
801048e5: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801048eb: 39 c2 cmp %eax,%edx
801048ed: 0f 85 8f 00 00 00 jne 80104982 <wait+0xc8>
continue;
havekids = 1;
801048f3: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
if(p->state == ZOMBIE){
801048fa: 8b 45 ec mov -0x14(%ebp),%eax
801048fd: 8b 40 0c mov 0xc(%eax),%eax
80104900: 83 f8 05 cmp $0x5,%eax
80104903: 75 7e jne 80104983 <wait+0xc9>
// Found one.
pid = p->pid;
80104905: 8b 45 ec mov -0x14(%ebp),%eax
80104908: 8b 40 10 mov 0x10(%eax),%eax
8010490b: 89 45 f4 mov %eax,-0xc(%ebp)
kfree(p->kstack);
8010490e: 8b 45 ec mov -0x14(%ebp),%eax
80104911: 8b 40 08 mov 0x8(%eax),%eax
80104914: 89 04 24 mov %eax,(%esp)
80104917: e8 55 e1 ff ff call 80102a71 <kfree>
p->kstack = 0;
8010491c: 8b 45 ec mov -0x14(%ebp),%eax
8010491f: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
if(p->isthread != 1){
80104926: 8b 45 ec mov -0x14(%ebp),%eax
80104929: 8b 80 80 00 00 00 mov 0x80(%eax),%eax
8010492f: 83 f8 01 cmp $0x1,%eax
80104932: 74 0e je 80104942 <wait+0x88>
freevm(p->pgdir);
80104934: 8b 45 ec mov -0x14(%ebp),%eax
80104937: 8b 40 04 mov 0x4(%eax),%eax
8010493a: 89 04 24 mov %eax,(%esp)
8010493d: e8 b9 39 00 00 call 801082fb <freevm>
}
p->state = UNUSED;
80104942: 8b 45 ec mov -0x14(%ebp),%eax
80104945: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
p->pid = 0;
8010494c: 8b 45 ec mov -0x14(%ebp),%eax
8010494f: c7 40 10 00 00 00 00 movl $0x0,0x10(%eax)
p->parent = 0;
80104956: 8b 45 ec mov -0x14(%ebp),%eax
80104959: c7 40 14 00 00 00 00 movl $0x0,0x14(%eax)
p->name[0] = 0;
80104960: 8b 45 ec mov -0x14(%ebp),%eax
80104963: c6 40 6c 00 movb $0x0,0x6c(%eax)
p->killed = 0;
80104967: 8b 45 ec mov -0x14(%ebp),%eax
8010496a: c7 40 24 00 00 00 00 movl $0x0,0x24(%eax)
release(&ptable.lock);
80104971: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104978: e8 33 06 00 00 call 80104fb0 <release>
return pid;
8010497d: 8b 45 f4 mov -0xc(%ebp),%eax
80104980: eb 57 jmp 801049d9 <wait+0x11f>
// Scan through table looking for zombie children.
havekids = 0;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
// if(p->parent != proc && p->isthread ==1)
if(p->parent != proc)
continue;
80104982: 90 nop
acquire(&ptable.lock);
for(;;){
// Scan through table looking for zombie children.
havekids = 0;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104983: 81 45 ec 84 00 00 00 addl $0x84,-0x14(%ebp)
8010498a: b8 74 20 11 80 mov $0x80112074,%eax
8010498f: 39 45 ec cmp %eax,-0x14(%ebp)
80104992: 0f 82 47 ff ff ff jb 801048df <wait+0x25>
return pid;
}
}
// No point waiting if we don't have any children.
if(!havekids || proc->killed){
80104998: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
8010499c: 74 0d je 801049ab <wait+0xf1>
8010499e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801049a4: 8b 40 24 mov 0x24(%eax),%eax
801049a7: 85 c0 test %eax,%eax
801049a9: 74 13 je 801049be <wait+0x104>
release(&ptable.lock);
801049ab: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
801049b2: e8 f9 05 00 00 call 80104fb0 <release>
return -1;
801049b7: b8 ff ff ff ff mov $0xffffffff,%eax
801049bc: eb 1b jmp 801049d9 <wait+0x11f>
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(proc, &ptable.lock); //DOC: wait-sleep
801049be: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801049c4: c7 44 24 04 40 ff 10 movl $0x8010ff40,0x4(%esp)
801049cb: 80
801049cc: 89 04 24 mov %eax,(%esp)
801049cf: e8 02 02 00 00 call 80104bd6 <sleep>
}
801049d4: e9 f3 fe ff ff jmp 801048cc <wait+0x12>
}
801049d9: c9 leave
801049da: c3 ret
801049db <scheduler>:
// - swtch to start running that process
// - eventually that process transfers control
// via swtch back to the scheduler.
void
scheduler(void)
{
801049db: 55 push %ebp
801049dc: 89 e5 mov %esp,%ebp
801049de: 83 ec 28 sub $0x28,%esp
struct proc *p;
for(;;){
// Enable interrupts on this processor.
sti();
801049e1: e8 e6 f5 ff ff call 80103fcc <sti>
// Loop over process table looking for process to run.
acquire(&ptable.lock);
801049e6: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
801049ed: e8 5d 05 00 00 call 80104f4f <acquire>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801049f2: c7 45 f4 74 ff 10 80 movl $0x8010ff74,-0xc(%ebp)
801049f9: eb 62 jmp 80104a5d <scheduler+0x82>
if(p->state != RUNNABLE)
801049fb: 8b 45 f4 mov -0xc(%ebp),%eax
801049fe: 8b 40 0c mov 0xc(%eax),%eax
80104a01: 83 f8 03 cmp $0x3,%eax
80104a04: 75 4f jne 80104a55 <scheduler+0x7a>
continue;
// Switch to chosen process. It is the process's job
// to release ptable.lock and then reacquire it
// before jumping back to us.
proc = p;
80104a06: 8b 45 f4 mov -0xc(%ebp),%eax
80104a09: 65 a3 04 00 00 00 mov %eax,%gs:0x4
switchuvm(p);
80104a0f: 8b 45 f4 mov -0xc(%ebp),%eax
80104a12: 89 04 24 mov %eax,(%esp)
80104a15: e8 69 34 00 00 call 80107e83 <switchuvm>
p->state = RUNNING;
80104a1a: 8b 45 f4 mov -0xc(%ebp),%eax
80104a1d: c7 40 0c 04 00 00 00 movl $0x4,0xc(%eax)
swtch(&cpu->scheduler, proc->context);
80104a24: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104a2a: 8b 40 1c mov 0x1c(%eax),%eax
80104a2d: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
80104a34: 83 c2 04 add $0x4,%edx
80104a37: 89 44 24 04 mov %eax,0x4(%esp)
80104a3b: 89 14 24 mov %edx,(%esp)
80104a3e: e8 01 0a 00 00 call 80105444 <swtch>
switchkvm();
80104a43: e8 1e 34 00 00 call 80107e66 <switchkvm>
// Process is done running for now.
// It should have changed its p->state before coming back.
proc = 0;
80104a48: 65 c7 05 04 00 00 00 movl $0x0,%gs:0x4
80104a4f: 00 00 00 00
80104a53: eb 01 jmp 80104a56 <scheduler+0x7b>
// Loop over process table looking for process to run.
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->state != RUNNABLE)
continue;
80104a55: 90 nop
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104a56: 81 45 f4 84 00 00 00 addl $0x84,-0xc(%ebp)
80104a5d: b8 74 20 11 80 mov $0x80112074,%eax
80104a62: 39 45 f4 cmp %eax,-0xc(%ebp)
80104a65: 72 94 jb 801049fb <scheduler+0x20>
// Process is done running for now.
// It should have changed its p->state before coming back.
proc = 0;
}
release(&ptable.lock);
80104a67: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104a6e: e8 3d 05 00 00 call 80104fb0 <release>
}
80104a73: e9 69 ff ff ff jmp 801049e1 <scheduler+0x6>
80104a78 <sched>:
// Enter scheduler. Must hold only ptable.lock
// and have changed proc->state.
void
sched(void)
{
80104a78: 55 push %ebp
80104a79: 89 e5 mov %esp,%ebp
80104a7b: 83 ec 28 sub $0x28,%esp
int intena;
if(!holding(&ptable.lock))
80104a7e: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104a85: e8 e4 05 00 00 call 8010506e <holding>
80104a8a: 85 c0 test %eax,%eax
80104a8c: 75 0c jne 80104a9a <sched+0x22>
panic("sched ptable.lock");
80104a8e: c7 04 24 18 89 10 80 movl $0x80108918,(%esp)
80104a95: e8 a0 ba ff ff call 8010053a <panic>
if(cpu->ncli != 1){
80104a9a: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80104aa0: 8b 80 ac 00 00 00 mov 0xac(%eax),%eax
80104aa6: 83 f8 01 cmp $0x1,%eax
80104aa9: 74 35 je 80104ae0 <sched+0x68>
cprintf("current proc %d\n cpu->ncli %d\n",proc->pid,cpu->ncli);
80104aab: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80104ab1: 8b 90 ac 00 00 00 mov 0xac(%eax),%edx
80104ab7: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104abd: 8b 40 10 mov 0x10(%eax),%eax
80104ac0: 89 54 24 08 mov %edx,0x8(%esp)
80104ac4: 89 44 24 04 mov %eax,0x4(%esp)
80104ac8: c7 04 24 2c 89 10 80 movl $0x8010892c,(%esp)
80104acf: e8 c6 b8 ff ff call 8010039a <cprintf>
panic("sched locks");
80104ad4: c7 04 24 4b 89 10 80 movl $0x8010894b,(%esp)
80104adb: e8 5a ba ff ff call 8010053a <panic>
}
if(proc->state == RUNNING)
80104ae0: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104ae6: 8b 40 0c mov 0xc(%eax),%eax
80104ae9: 83 f8 04 cmp $0x4,%eax
80104aec: 75 0c jne 80104afa <sched+0x82>
panic("sched running");
80104aee: c7 04 24 57 89 10 80 movl $0x80108957,(%esp)
80104af5: e8 40 ba ff ff call 8010053a <panic>
if(readeflags()&FL_IF)
80104afa: e8 bd f4 ff ff call 80103fbc <readeflags>
80104aff: 25 00 02 00 00 and $0x200,%eax
80104b04: 85 c0 test %eax,%eax
80104b06: 74 0c je 80104b14 <sched+0x9c>
panic("sched interruptible");
80104b08: c7 04 24 65 89 10 80 movl $0x80108965,(%esp)
80104b0f: e8 26 ba ff ff call 8010053a <panic>
intena = cpu->intena;
80104b14: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80104b1a: 8b 80 b0 00 00 00 mov 0xb0(%eax),%eax
80104b20: 89 45 f4 mov %eax,-0xc(%ebp)
swtch(&proc->context, cpu->scheduler);
80104b23: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80104b29: 8b 40 04 mov 0x4(%eax),%eax
80104b2c: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
80104b33: 83 c2 1c add $0x1c,%edx
80104b36: 89 44 24 04 mov %eax,0x4(%esp)
80104b3a: 89 14 24 mov %edx,(%esp)
80104b3d: e8 02 09 00 00 call 80105444 <swtch>
cpu->intena = intena;
80104b42: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80104b48: 8b 55 f4 mov -0xc(%ebp),%edx
80104b4b: 89 90 b0 00 00 00 mov %edx,0xb0(%eax)
}
80104b51: c9 leave
80104b52: c3 ret
80104b53 <yield>:
// Give up the CPU for one scheduling round.
void
yield(void)
{
80104b53: 55 push %ebp
80104b54: 89 e5 mov %esp,%ebp
80104b56: 83 ec 18 sub $0x18,%esp
acquire(&ptable.lock); //DOC: yieldlock
80104b59: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104b60: e8 ea 03 00 00 call 80104f4f <acquire>
proc->state = RUNNABLE;
80104b65: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104b6b: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
sched();
80104b72: e8 01 ff ff ff call 80104a78 <sched>
release(&ptable.lock);
80104b77: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104b7e: e8 2d 04 00 00 call 80104fb0 <release>
}
80104b83: c9 leave
80104b84: c3 ret
80104b85 <thread_yield>:
void
thread_yield(void)
{
80104b85: 55 push %ebp
80104b86: 89 e5 mov %esp,%ebp
80104b88: 83 ec 18 sub $0x18,%esp
acquire(&ptable.lock);
80104b8b: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104b92: e8 b8 03 00 00 call 80104f4f <acquire>
yield();
80104b97: e8 b7 ff ff ff call 80104b53 <yield>
release(&ptable.lock);
80104b9c: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104ba3: e8 08 04 00 00 call 80104fb0 <release>
}
80104ba8: c9 leave
80104ba9: c3 ret
80104baa <forkret>:
// A fork child's very first scheduling by scheduler()
// will swtch here. "Return" to user space.
void
forkret(void)
{
80104baa: 55 push %ebp
80104bab: 89 e5 mov %esp,%ebp
80104bad: 83 ec 18 sub $0x18,%esp
static int first = 1;
// Still holding ptable.lock from scheduler.
release(&ptable.lock);
80104bb0: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104bb7: e8 f4 03 00 00 call 80104fb0 <release>
if (first) {
80104bbc: a1 20 b0 10 80 mov 0x8010b020,%eax
80104bc1: 85 c0 test %eax,%eax
80104bc3: 74 0f je 80104bd4 <forkret+0x2a>
// Some initialization functions must be run in the context
// of a regular process (e.g., they call sleep), and thus cannot
// be run from main().
first = 0;
80104bc5: c7 05 20 b0 10 80 00 movl $0x0,0x8010b020
80104bcc: 00 00 00
initlog();
80104bcf: e8 30 e4 ff ff call 80103004 <initlog>
}
// Return to "caller", actually trapret (see allocproc).
}
80104bd4: c9 leave
80104bd5: c3 ret
80104bd6 <sleep>:
// Atomically release lock and sleep on chan.
// Reacquires lock when awakened.
void
sleep(void *chan, struct spinlock *lk)
{
80104bd6: 55 push %ebp
80104bd7: 89 e5 mov %esp,%ebp
80104bd9: 83 ec 18 sub $0x18,%esp
if(proc == 0)
80104bdc: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104be2: 85 c0 test %eax,%eax
80104be4: 75 0c jne 80104bf2 <sleep+0x1c>
panic("sleep");
80104be6: c7 04 24 79 89 10 80 movl $0x80108979,(%esp)
80104bed: e8 48 b9 ff ff call 8010053a <panic>
if(lk == 0)
80104bf2: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
80104bf6: 75 0c jne 80104c04 <sleep+0x2e>
panic("sleep without lk");
80104bf8: c7 04 24 7f 89 10 80 movl $0x8010897f,(%esp)
80104bff: e8 36 b9 ff ff call 8010053a <panic>
// change p->state and then call sched.
// Once we hold ptable.lock, we can be
// guaranteed that we won't miss any wakeup
// (wakeup runs with ptable.lock locked),
// so it's okay to release lk.
if(lk != &ptable.lock){ //DOC: sleeplock0
80104c04: 81 7d 0c 40 ff 10 80 cmpl $0x8010ff40,0xc(%ebp)
80104c0b: 74 17 je 80104c24 <sleep+0x4e>
acquire(&ptable.lock); //DOC: sleeplock1
80104c0d: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104c14: e8 36 03 00 00 call 80104f4f <acquire>
release(lk);
80104c19: 8b 45 0c mov 0xc(%ebp),%eax
80104c1c: 89 04 24 mov %eax,(%esp)
80104c1f: e8 8c 03 00 00 call 80104fb0 <release>
}
// Go to sleep.
proc->chan = chan;
80104c24: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104c2a: 8b 55 08 mov 0x8(%ebp),%edx
80104c2d: 89 50 20 mov %edx,0x20(%eax)
proc->state = SLEEPING;
80104c30: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104c36: c7 40 0c 02 00 00 00 movl $0x2,0xc(%eax)
sched();
80104c3d: e8 36 fe ff ff call 80104a78 <sched>
// Tidy up.
proc->chan = 0;
80104c42: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104c48: c7 40 20 00 00 00 00 movl $0x0,0x20(%eax)
// Reacquire original lock.
if(lk != &ptable.lock){ //DOC: sleeplock2
80104c4f: 81 7d 0c 40 ff 10 80 cmpl $0x8010ff40,0xc(%ebp)
80104c56: 74 17 je 80104c6f <sleep+0x99>
release(&ptable.lock);
80104c58: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104c5f: e8 4c 03 00 00 call 80104fb0 <release>
acquire(lk);
80104c64: 8b 45 0c mov 0xc(%ebp),%eax
80104c67: 89 04 24 mov %eax,(%esp)
80104c6a: e8 e0 02 00 00 call 80104f4f <acquire>
}
}
80104c6f: c9 leave
80104c70: c3 ret
80104c71 <wakeup1>:
//PAGEBREAK!
// Wake up all processes sleeping on chan.
// The ptable lock must be held.
static void
wakeup1(void *chan)
{
80104c71: 55 push %ebp
80104c72: 89 e5 mov %esp,%ebp
80104c74: 83 ec 10 sub $0x10,%esp
struct proc *p;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80104c77: c7 45 fc 74 ff 10 80 movl $0x8010ff74,-0x4(%ebp)
80104c7e: eb 27 jmp 80104ca7 <wakeup1+0x36>
if(p->state == SLEEPING && p->chan == chan)
80104c80: 8b 45 fc mov -0x4(%ebp),%eax
80104c83: 8b 40 0c mov 0xc(%eax),%eax
80104c86: 83 f8 02 cmp $0x2,%eax
80104c89: 75 15 jne 80104ca0 <wakeup1+0x2f>
80104c8b: 8b 45 fc mov -0x4(%ebp),%eax
80104c8e: 8b 40 20 mov 0x20(%eax),%eax
80104c91: 3b 45 08 cmp 0x8(%ebp),%eax
80104c94: 75 0a jne 80104ca0 <wakeup1+0x2f>
p->state = RUNNABLE;
80104c96: 8b 45 fc mov -0x4(%ebp),%eax
80104c99: 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++)
80104ca0: 81 45 fc 84 00 00 00 addl $0x84,-0x4(%ebp)
80104ca7: b8 74 20 11 80 mov $0x80112074,%eax
80104cac: 39 45 fc cmp %eax,-0x4(%ebp)
80104caf: 72 cf jb 80104c80 <wakeup1+0xf>
if(p->state == SLEEPING && p->chan == chan)
p->state = RUNNABLE;
}
80104cb1: c9 leave
80104cb2: c3 ret
80104cb3 <twakeup>:
void
twakeup(int tid){
80104cb3: 55 push %ebp
80104cb4: 89 e5 mov %esp,%ebp
80104cb6: 83 ec 28 sub $0x28,%esp
struct proc *p;
acquire(&ptable.lock);
80104cb9: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104cc0: e8 8a 02 00 00 call 80104f4f <acquire>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104cc5: c7 45 f4 74 ff 10 80 movl $0x8010ff74,-0xc(%ebp)
80104ccc: eb 36 jmp 80104d04 <twakeup+0x51>
if(p->state == SLEEPING && p->pid == tid && p->isthread == 1){
80104cce: 8b 45 f4 mov -0xc(%ebp),%eax
80104cd1: 8b 40 0c mov 0xc(%eax),%eax
80104cd4: 83 f8 02 cmp $0x2,%eax
80104cd7: 75 24 jne 80104cfd <twakeup+0x4a>
80104cd9: 8b 45 f4 mov -0xc(%ebp),%eax
80104cdc: 8b 40 10 mov 0x10(%eax),%eax
80104cdf: 3b 45 08 cmp 0x8(%ebp),%eax
80104ce2: 75 19 jne 80104cfd <twakeup+0x4a>
80104ce4: 8b 45 f4 mov -0xc(%ebp),%eax
80104ce7: 8b 80 80 00 00 00 mov 0x80(%eax),%eax
80104ced: 83 f8 01 cmp $0x1,%eax
80104cf0: 75 0b jne 80104cfd <twakeup+0x4a>
wakeup1(p);
80104cf2: 8b 45 f4 mov -0xc(%ebp),%eax
80104cf5: 89 04 24 mov %eax,(%esp)
80104cf8: e8 74 ff ff ff call 80104c71 <wakeup1>
void
twakeup(int tid){
struct proc *p;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104cfd: 81 45 f4 84 00 00 00 addl $0x84,-0xc(%ebp)
80104d04: b8 74 20 11 80 mov $0x80112074,%eax
80104d09: 39 45 f4 cmp %eax,-0xc(%ebp)
80104d0c: 72 c0 jb 80104cce <twakeup+0x1b>
if(p->state == SLEEPING && p->pid == tid && p->isthread == 1){
wakeup1(p);
}
}
release(&ptable.lock);
80104d0e: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104d15: e8 96 02 00 00 call 80104fb0 <release>
}
80104d1a: c9 leave
80104d1b: c3 ret
80104d1c <wakeup>:
// Wake up all processes sleeping on chan.
void
wakeup(void *chan)
{
80104d1c: 55 push %ebp
80104d1d: 89 e5 mov %esp,%ebp
80104d1f: 83 ec 18 sub $0x18,%esp
acquire(&ptable.lock);
80104d22: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104d29: e8 21 02 00 00 call 80104f4f <acquire>
wakeup1(chan);
80104d2e: 8b 45 08 mov 0x8(%ebp),%eax
80104d31: 89 04 24 mov %eax,(%esp)
80104d34: e8 38 ff ff ff call 80104c71 <wakeup1>
release(&ptable.lock);
80104d39: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104d40: e8 6b 02 00 00 call 80104fb0 <release>
}
80104d45: c9 leave
80104d46: c3 ret
80104d47 <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)
{
80104d47: 55 push %ebp
80104d48: 89 e5 mov %esp,%ebp
80104d4a: 83 ec 28 sub $0x28,%esp
struct proc *p;
acquire(&ptable.lock);
80104d4d: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104d54: e8 f6 01 00 00 call 80104f4f <acquire>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104d59: c7 45 f4 74 ff 10 80 movl $0x8010ff74,-0xc(%ebp)
80104d60: eb 44 jmp 80104da6 <kill+0x5f>
if(p->pid == pid){
80104d62: 8b 45 f4 mov -0xc(%ebp),%eax
80104d65: 8b 40 10 mov 0x10(%eax),%eax
80104d68: 3b 45 08 cmp 0x8(%ebp),%eax
80104d6b: 75 32 jne 80104d9f <kill+0x58>
p->killed = 1;
80104d6d: 8b 45 f4 mov -0xc(%ebp),%eax
80104d70: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax)
// Wake process from sleep if necessary.
if(p->state == SLEEPING)
80104d77: 8b 45 f4 mov -0xc(%ebp),%eax
80104d7a: 8b 40 0c mov 0xc(%eax),%eax
80104d7d: 83 f8 02 cmp $0x2,%eax
80104d80: 75 0a jne 80104d8c <kill+0x45>
p->state = RUNNABLE;
80104d82: 8b 45 f4 mov -0xc(%ebp),%eax
80104d85: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
release(&ptable.lock);
80104d8c: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104d93: e8 18 02 00 00 call 80104fb0 <release>
return 0;
80104d98: b8 00 00 00 00 mov $0x0,%eax
80104d9d: eb 22 jmp 80104dc1 <kill+0x7a>
kill(int pid)
{
struct proc *p;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104d9f: 81 45 f4 84 00 00 00 addl $0x84,-0xc(%ebp)
80104da6: b8 74 20 11 80 mov $0x80112074,%eax
80104dab: 39 45 f4 cmp %eax,-0xc(%ebp)
80104dae: 72 b2 jb 80104d62 <kill+0x1b>
p->state = RUNNABLE;
release(&ptable.lock);
return 0;
}
}
release(&ptable.lock);
80104db0: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104db7: e8 f4 01 00 00 call 80104fb0 <release>
return -1;
80104dbc: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104dc1: c9 leave
80104dc2: c3 ret
80104dc3 <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)
{
80104dc3: 55 push %ebp
80104dc4: 89 e5 mov %esp,%ebp
80104dc6: 83 ec 58 sub $0x58,%esp
int i;
struct proc *p;
char *state;
uint pc[10];
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104dc9: c7 45 f0 74 ff 10 80 movl $0x8010ff74,-0x10(%ebp)
80104dd0: e9 db 00 00 00 jmp 80104eb0 <procdump+0xed>
if(p->state == UNUSED)
80104dd5: 8b 45 f0 mov -0x10(%ebp),%eax
80104dd8: 8b 40 0c mov 0xc(%eax),%eax
80104ddb: 85 c0 test %eax,%eax
80104ddd: 0f 84 c5 00 00 00 je 80104ea8 <procdump+0xe5>
continue;
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
80104de3: 8b 45 f0 mov -0x10(%ebp),%eax
80104de6: 8b 40 0c mov 0xc(%eax),%eax
80104de9: 83 f8 05 cmp $0x5,%eax
80104dec: 77 23 ja 80104e11 <procdump+0x4e>
80104dee: 8b 45 f0 mov -0x10(%ebp),%eax
80104df1: 8b 40 0c mov 0xc(%eax),%eax
80104df4: 8b 04 85 08 b0 10 80 mov -0x7fef4ff8(,%eax,4),%eax
80104dfb: 85 c0 test %eax,%eax
80104dfd: 74 12 je 80104e11 <procdump+0x4e>
state = states[p->state];
80104dff: 8b 45 f0 mov -0x10(%ebp),%eax
80104e02: 8b 40 0c mov 0xc(%eax),%eax
80104e05: 8b 04 85 08 b0 10 80 mov -0x7fef4ff8(,%eax,4),%eax
80104e0c: 89 45 f4 mov %eax,-0xc(%ebp)
uint pc[10];
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->state == UNUSED)
continue;
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
80104e0f: eb 07 jmp 80104e18 <procdump+0x55>
state = states[p->state];
else
state = "???";
80104e11: c7 45 f4 90 89 10 80 movl $0x80108990,-0xc(%ebp)
cprintf("%d %s %s", p->pid, state, p->name);
80104e18: 8b 45 f0 mov -0x10(%ebp),%eax
80104e1b: 8d 50 6c lea 0x6c(%eax),%edx
80104e1e: 8b 45 f0 mov -0x10(%ebp),%eax
80104e21: 8b 40 10 mov 0x10(%eax),%eax
80104e24: 89 54 24 0c mov %edx,0xc(%esp)
80104e28: 8b 55 f4 mov -0xc(%ebp),%edx
80104e2b: 89 54 24 08 mov %edx,0x8(%esp)
80104e2f: 89 44 24 04 mov %eax,0x4(%esp)
80104e33: c7 04 24 94 89 10 80 movl $0x80108994,(%esp)
80104e3a: e8 5b b5 ff ff call 8010039a <cprintf>
if(p->state == SLEEPING){
80104e3f: 8b 45 f0 mov -0x10(%ebp),%eax
80104e42: 8b 40 0c mov 0xc(%eax),%eax
80104e45: 83 f8 02 cmp $0x2,%eax
80104e48: 75 50 jne 80104e9a <procdump+0xd7>
getcallerpcs((uint*)p->context->ebp+2, pc);
80104e4a: 8b 45 f0 mov -0x10(%ebp),%eax
80104e4d: 8b 40 1c mov 0x1c(%eax),%eax
80104e50: 8b 40 0c mov 0xc(%eax),%eax
80104e53: 83 c0 08 add $0x8,%eax
80104e56: 8d 55 c4 lea -0x3c(%ebp),%edx
80104e59: 89 54 24 04 mov %edx,0x4(%esp)
80104e5d: 89 04 24 mov %eax,(%esp)
80104e60: e8 9a 01 00 00 call 80104fff <getcallerpcs>
for(i=0; i<10 && pc[i] != 0; i++)
80104e65: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
80104e6c: eb 1b jmp 80104e89 <procdump+0xc6>
cprintf(" %p", pc[i]);
80104e6e: 8b 45 ec mov -0x14(%ebp),%eax
80104e71: 8b 44 85 c4 mov -0x3c(%ebp,%eax,4),%eax
80104e75: 89 44 24 04 mov %eax,0x4(%esp)
80104e79: c7 04 24 9d 89 10 80 movl $0x8010899d,(%esp)
80104e80: e8 15 b5 ff ff call 8010039a <cprintf>
else
state = "???";
cprintf("%d %s %s", p->pid, state, p->name);
if(p->state == SLEEPING){
getcallerpcs((uint*)p->context->ebp+2, pc);
for(i=0; i<10 && pc[i] != 0; i++)
80104e85: 83 45 ec 01 addl $0x1,-0x14(%ebp)
80104e89: 83 7d ec 09 cmpl $0x9,-0x14(%ebp)
80104e8d: 7f 0b jg 80104e9a <procdump+0xd7>
80104e8f: 8b 45 ec mov -0x14(%ebp),%eax
80104e92: 8b 44 85 c4 mov -0x3c(%ebp,%eax,4),%eax
80104e96: 85 c0 test %eax,%eax
80104e98: 75 d4 jne 80104e6e <procdump+0xab>
cprintf(" %p", pc[i]);
}
cprintf("\n");
80104e9a: c7 04 24 a1 89 10 80 movl $0x801089a1,(%esp)
80104ea1: e8 f4 b4 ff ff call 8010039a <cprintf>
80104ea6: eb 01 jmp 80104ea9 <procdump+0xe6>
char *state;
uint pc[10];
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->state == UNUSED)
continue;
80104ea8: 90 nop
int i;
struct proc *p;
char *state;
uint pc[10];
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104ea9: 81 45 f0 84 00 00 00 addl $0x84,-0x10(%ebp)
80104eb0: b8 74 20 11 80 mov $0x80112074,%eax
80104eb5: 39 45 f0 cmp %eax,-0x10(%ebp)
80104eb8: 0f 82 17 ff ff ff jb 80104dd5 <procdump+0x12>
for(i=0; i<10 && pc[i] != 0; i++)
cprintf(" %p", pc[i]);
}
cprintf("\n");
}
}
80104ebe: c9 leave
80104ebf: c3 ret
80104ec0 <tsleep>:
void tsleep(void){
80104ec0: 55 push %ebp
80104ec1: 89 e5 mov %esp,%ebp
80104ec3: 83 ec 18 sub $0x18,%esp
acquire(&ptable.lock);
80104ec6: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104ecd: e8 7d 00 00 00 call 80104f4f <acquire>
sleep(proc, &ptable.lock);
80104ed2: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80104ed8: c7 44 24 04 40 ff 10 movl $0x8010ff40,0x4(%esp)
80104edf: 80
80104ee0: 89 04 24 mov %eax,(%esp)
80104ee3: e8 ee fc ff ff call 80104bd6 <sleep>
release(&ptable.lock);
80104ee8: c7 04 24 40 ff 10 80 movl $0x8010ff40,(%esp)
80104eef: e8 bc 00 00 00 call 80104fb0 <release>
}
80104ef4: c9 leave
80104ef5: c3 ret
...
80104ef8 <readeflags>:
asm volatile("ltr %0" : : "r" (sel));
}
static inline uint
readeflags(void)
{
80104ef8: 55 push %ebp
80104ef9: 89 e5 mov %esp,%ebp
80104efb: 83 ec 10 sub $0x10,%esp
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80104efe: 9c pushf
80104eff: 58 pop %eax
80104f00: 89 45 fc mov %eax,-0x4(%ebp)
return eflags;
80104f03: 8b 45 fc mov -0x4(%ebp),%eax
}
80104f06: c9 leave
80104f07: c3 ret
80104f08 <cli>:
asm volatile("movw %0, %%gs" : : "r" (v));
}
static inline void
cli(void)
{
80104f08: 55 push %ebp
80104f09: 89 e5 mov %esp,%ebp
asm volatile("cli");
80104f0b: fa cli
}
80104f0c: 5d pop %ebp
80104f0d: c3 ret
80104f0e <sti>:
static inline void
sti(void)
{
80104f0e: 55 push %ebp
80104f0f: 89 e5 mov %esp,%ebp
asm volatile("sti");
80104f11: fb sti
}
80104f12: 5d pop %ebp
80104f13: c3 ret
80104f14 <xchg>:
static inline uint
xchg(volatile uint *addr, uint newval)
{
80104f14: 55 push %ebp
80104f15: 89 e5 mov %esp,%ebp
80104f17: 83 ec 10 sub $0x10,%esp
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
80104f1a: 8b 55 08 mov 0x8(%ebp),%edx
80104f1d: 8b 45 0c mov 0xc(%ebp),%eax
80104f20: 8b 4d 08 mov 0x8(%ebp),%ecx
80104f23: f0 87 02 lock xchg %eax,(%edx)
80104f26: 89 45 fc mov %eax,-0x4(%ebp)
"+m" (*addr), "=a" (result) :
"1" (newval) :
"cc");
return result;
80104f29: 8b 45 fc mov -0x4(%ebp),%eax
}
80104f2c: c9 leave
80104f2d: c3 ret
80104f2e <initlock>:
#include "proc.h"
#include "spinlock.h"
void
initlock(struct spinlock *lk, char *name)
{
80104f2e: 55 push %ebp
80104f2f: 89 e5 mov %esp,%ebp
lk->name = name;
80104f31: 8b 45 08 mov 0x8(%ebp),%eax
80104f34: 8b 55 0c mov 0xc(%ebp),%edx
80104f37: 89 50 04 mov %edx,0x4(%eax)
lk->locked = 0;
80104f3a: 8b 45 08 mov 0x8(%ebp),%eax
80104f3d: c7 00 00 00 00 00 movl $0x0,(%eax)
lk->cpu = 0;
80104f43: 8b 45 08 mov 0x8(%ebp),%eax
80104f46: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
80104f4d: 5d pop %ebp
80104f4e: c3 ret
80104f4f <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)
{
80104f4f: 55 push %ebp
80104f50: 89 e5 mov %esp,%ebp
80104f52: 83 ec 18 sub $0x18,%esp
pushcli(); // disable interrupts to avoid deadlock.
80104f55: e8 3e 01 00 00 call 80105098 <pushcli>
if(holding(lk))
80104f5a: 8b 45 08 mov 0x8(%ebp),%eax
80104f5d: 89 04 24 mov %eax,(%esp)
80104f60: e8 09 01 00 00 call 8010506e <holding>
80104f65: 85 c0 test %eax,%eax
80104f67: 74 0c je 80104f75 <acquire+0x26>
panic("acquire");
80104f69: c7 04 24 cd 89 10 80 movl $0x801089cd,(%esp)
80104f70: e8 c5 b5 ff ff call 8010053a <panic>
// The xchg is atomic.
// It also serializes, so that reads after acquire are not
// reordered before it.
while(xchg(&lk->locked, 1) != 0)
80104f75: 8b 45 08 mov 0x8(%ebp),%eax
80104f78: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80104f7f: 00
80104f80: 89 04 24 mov %eax,(%esp)
80104f83: e8 8c ff ff ff call 80104f14 <xchg>
80104f88: 85 c0 test %eax,%eax
80104f8a: 75 e9 jne 80104f75 <acquire+0x26>
;
// Record info about lock acquisition for debugging.
lk->cpu = cpu;
80104f8c: 8b 45 08 mov 0x8(%ebp),%eax
80104f8f: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
80104f96: 89 50 08 mov %edx,0x8(%eax)
getcallerpcs(&lk, lk->pcs);
80104f99: 8b 45 08 mov 0x8(%ebp),%eax
80104f9c: 83 c0 0c add $0xc,%eax
80104f9f: 89 44 24 04 mov %eax,0x4(%esp)
80104fa3: 8d 45 08 lea 0x8(%ebp),%eax
80104fa6: 89 04 24 mov %eax,(%esp)
80104fa9: e8 51 00 00 00 call 80104fff <getcallerpcs>
}
80104fae: c9 leave
80104faf: c3 ret
80104fb0 <release>:
// Release the lock.
void
release(struct spinlock *lk)
{
80104fb0: 55 push %ebp
80104fb1: 89 e5 mov %esp,%ebp
80104fb3: 83 ec 18 sub $0x18,%esp
if(!holding(lk))
80104fb6: 8b 45 08 mov 0x8(%ebp),%eax
80104fb9: 89 04 24 mov %eax,(%esp)
80104fbc: e8 ad 00 00 00 call 8010506e <holding>
80104fc1: 85 c0 test %eax,%eax
80104fc3: 75 0c jne 80104fd1 <release+0x21>
panic("release");
80104fc5: c7 04 24 d5 89 10 80 movl $0x801089d5,(%esp)
80104fcc: e8 69 b5 ff ff call 8010053a <panic>
lk->pcs[0] = 0;
80104fd1: 8b 45 08 mov 0x8(%ebp),%eax
80104fd4: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
lk->cpu = 0;
80104fdb: 8b 45 08 mov 0x8(%ebp),%eax
80104fde: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
// But the 2007 Intel 64 Architecture Memory Ordering White
// Paper says that Intel 64 and IA-32 will not move a load
// after a store. So lock->locked = 0 would work here.
// The xchg being asm volatile ensures gcc emits it after
// the above assignments (and after the critical section).
xchg(&lk->locked, 0);
80104fe5: 8b 45 08 mov 0x8(%ebp),%eax
80104fe8: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80104fef: 00
80104ff0: 89 04 24 mov %eax,(%esp)
80104ff3: e8 1c ff ff ff call 80104f14 <xchg>
popcli();
80104ff8: e8 e3 00 00 00 call 801050e0 <popcli>
}
80104ffd: c9 leave
80104ffe: c3 ret
80104fff <getcallerpcs>:
// Record the current call stack in pcs[] by following the %ebp chain.
void
getcallerpcs(void *v, uint pcs[])
{
80104fff: 55 push %ebp
80105000: 89 e5 mov %esp,%ebp
80105002: 83 ec 10 sub $0x10,%esp
uint *ebp;
int i;
ebp = (uint*)v - 2;
80105005: 8b 45 08 mov 0x8(%ebp),%eax
80105008: 83 e8 08 sub $0x8,%eax
8010500b: 89 45 f8 mov %eax,-0x8(%ebp)
for(i = 0; i < 10; i++){
8010500e: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
80105015: eb 34 jmp 8010504b <getcallerpcs+0x4c>
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
80105017: 83 7d f8 00 cmpl $0x0,-0x8(%ebp)
8010501b: 74 49 je 80105066 <getcallerpcs+0x67>
8010501d: 81 7d f8 ff ff ff 7f cmpl $0x7fffffff,-0x8(%ebp)
80105024: 76 40 jbe 80105066 <getcallerpcs+0x67>
80105026: 83 7d f8 ff cmpl $0xffffffff,-0x8(%ebp)
8010502a: 74 3a je 80105066 <getcallerpcs+0x67>
break;
pcs[i] = ebp[1]; // saved %eip
8010502c: 8b 45 fc mov -0x4(%ebp),%eax
8010502f: c1 e0 02 shl $0x2,%eax
80105032: 03 45 0c add 0xc(%ebp),%eax
80105035: 8b 55 f8 mov -0x8(%ebp),%edx
80105038: 83 c2 04 add $0x4,%edx
8010503b: 8b 12 mov (%edx),%edx
8010503d: 89 10 mov %edx,(%eax)
ebp = (uint*)ebp[0]; // saved %ebp
8010503f: 8b 45 f8 mov -0x8(%ebp),%eax
80105042: 8b 00 mov (%eax),%eax
80105044: 89 45 f8 mov %eax,-0x8(%ebp)
{
uint *ebp;
int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
80105047: 83 45 fc 01 addl $0x1,-0x4(%ebp)
8010504b: 83 7d fc 09 cmpl $0x9,-0x4(%ebp)
8010504f: 7e c6 jle 80105017 <getcallerpcs+0x18>
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
80105051: eb 13 jmp 80105066 <getcallerpcs+0x67>
pcs[i] = 0;
80105053: 8b 45 fc mov -0x4(%ebp),%eax
80105056: c1 e0 02 shl $0x2,%eax
80105059: 03 45 0c add 0xc(%ebp),%eax
8010505c: c7 00 00 00 00 00 movl $0x0,(%eax)
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
80105062: 83 45 fc 01 addl $0x1,-0x4(%ebp)
80105066: 83 7d fc 09 cmpl $0x9,-0x4(%ebp)
8010506a: 7e e7 jle 80105053 <getcallerpcs+0x54>
pcs[i] = 0;
}
8010506c: c9 leave
8010506d: c3 ret
8010506e <holding>:
// Check whether this cpu is holding the lock.
int
holding(struct spinlock *lock)
{
8010506e: 55 push %ebp
8010506f: 89 e5 mov %esp,%ebp
return lock->locked && lock->cpu == cpu;
80105071: 8b 45 08 mov 0x8(%ebp),%eax
80105074: 8b 00 mov (%eax),%eax
80105076: 85 c0 test %eax,%eax
80105078: 74 17 je 80105091 <holding+0x23>
8010507a: 8b 45 08 mov 0x8(%ebp),%eax
8010507d: 8b 50 08 mov 0x8(%eax),%edx
80105080: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80105086: 39 c2 cmp %eax,%edx
80105088: 75 07 jne 80105091 <holding+0x23>
8010508a: b8 01 00 00 00 mov $0x1,%eax
8010508f: eb 05 jmp 80105096 <holding+0x28>
80105091: b8 00 00 00 00 mov $0x0,%eax
}
80105096: 5d pop %ebp
80105097: c3 ret
80105098 <pushcli>:
// it takes two popcli to undo two pushcli. Also, if interrupts
// are off, then pushcli, popcli leaves them off.
void
pushcli(void)
{
80105098: 55 push %ebp
80105099: 89 e5 mov %esp,%ebp
8010509b: 83 ec 10 sub $0x10,%esp
int eflags;
eflags = readeflags();
8010509e: e8 55 fe ff ff call 80104ef8 <readeflags>
801050a3: 89 45 fc mov %eax,-0x4(%ebp)
cli();
801050a6: e8 5d fe ff ff call 80104f08 <cli>
if(cpu->ncli++ == 0)
801050ab: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801050b1: 8b 90 ac 00 00 00 mov 0xac(%eax),%edx
801050b7: 85 d2 test %edx,%edx
801050b9: 0f 94 c1 sete %cl
801050bc: 83 c2 01 add $0x1,%edx
801050bf: 89 90 ac 00 00 00 mov %edx,0xac(%eax)
801050c5: 84 c9 test %cl,%cl
801050c7: 74 15 je 801050de <pushcli+0x46>
cpu->intena = eflags & FL_IF;
801050c9: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801050cf: 8b 55 fc mov -0x4(%ebp),%edx
801050d2: 81 e2 00 02 00 00 and $0x200,%edx
801050d8: 89 90 b0 00 00 00 mov %edx,0xb0(%eax)
}
801050de: c9 leave
801050df: c3 ret
801050e0 <popcli>:
void
popcli(void)
{
801050e0: 55 push %ebp
801050e1: 89 e5 mov %esp,%ebp
801050e3: 83 ec 18 sub $0x18,%esp
if(readeflags()&FL_IF)
801050e6: e8 0d fe ff ff call 80104ef8 <readeflags>
801050eb: 25 00 02 00 00 and $0x200,%eax
801050f0: 85 c0 test %eax,%eax
801050f2: 74 0c je 80105100 <popcli+0x20>
panic("popcli - interruptible");
801050f4: c7 04 24 dd 89 10 80 movl $0x801089dd,(%esp)
801050fb: e8 3a b4 ff ff call 8010053a <panic>
if(--cpu->ncli < 0)
80105100: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80105106: 8b 90 ac 00 00 00 mov 0xac(%eax),%edx
8010510c: 83 ea 01 sub $0x1,%edx
8010510f: 89 90 ac 00 00 00 mov %edx,0xac(%eax)
80105115: 8b 80 ac 00 00 00 mov 0xac(%eax),%eax
8010511b: 85 c0 test %eax,%eax
8010511d: 79 0c jns 8010512b <popcli+0x4b>
panic("popcli");
8010511f: c7 04 24 f4 89 10 80 movl $0x801089f4,(%esp)
80105126: e8 0f b4 ff ff call 8010053a <panic>
if(cpu->ncli == 0 && cpu->intena)
8010512b: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80105131: 8b 80 ac 00 00 00 mov 0xac(%eax),%eax
80105137: 85 c0 test %eax,%eax
80105139: 75 15 jne 80105150 <popcli+0x70>
8010513b: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80105141: 8b 80 b0 00 00 00 mov 0xb0(%eax),%eax
80105147: 85 c0 test %eax,%eax
80105149: 74 05 je 80105150 <popcli+0x70>
sti();
8010514b: e8 be fd ff ff call 80104f0e <sti>
}
80105150: c9 leave
80105151: c3 ret
...
80105154 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
80105154: 55 push %ebp
80105155: 89 e5 mov %esp,%ebp
80105157: 57 push %edi
80105158: 53 push %ebx
asm volatile("cld; rep stosb" :
80105159: 8b 4d 08 mov 0x8(%ebp),%ecx
8010515c: 8b 55 10 mov 0x10(%ebp),%edx
8010515f: 8b 45 0c mov 0xc(%ebp),%eax
80105162: 89 cb mov %ecx,%ebx
80105164: 89 df mov %ebx,%edi
80105166: 89 d1 mov %edx,%ecx
80105168: fc cld
80105169: f3 aa rep stos %al,%es:(%edi)
8010516b: 89 ca mov %ecx,%edx
8010516d: 89 fb mov %edi,%ebx
8010516f: 89 5d 08 mov %ebx,0x8(%ebp)
80105172: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
80105175: 5b pop %ebx
80105176: 5f pop %edi
80105177: 5d pop %ebp
80105178: c3 ret
80105179 <stosl>:
static inline void
stosl(void *addr, int data, int cnt)
{
80105179: 55 push %ebp
8010517a: 89 e5 mov %esp,%ebp
8010517c: 57 push %edi
8010517d: 53 push %ebx
asm volatile("cld; rep stosl" :
8010517e: 8b 4d 08 mov 0x8(%ebp),%ecx
80105181: 8b 55 10 mov 0x10(%ebp),%edx
80105184: 8b 45 0c mov 0xc(%ebp),%eax
80105187: 89 cb mov %ecx,%ebx
80105189: 89 df mov %ebx,%edi
8010518b: 89 d1 mov %edx,%ecx
8010518d: fc cld
8010518e: f3 ab rep stos %eax,%es:(%edi)
80105190: 89 ca mov %ecx,%edx
80105192: 89 fb mov %edi,%ebx
80105194: 89 5d 08 mov %ebx,0x8(%ebp)
80105197: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
8010519a: 5b pop %ebx
8010519b: 5f pop %edi
8010519c: 5d pop %ebp
8010519d: c3 ret
8010519e <memset>:
#include "types.h"
#include "x86.h"
void*
memset(void *dst, int c, uint n)
{
8010519e: 55 push %ebp
8010519f: 89 e5 mov %esp,%ebp
801051a1: 83 ec 0c sub $0xc,%esp
if ((int)dst%4 == 0 && n%4 == 0){
801051a4: 8b 45 08 mov 0x8(%ebp),%eax
801051a7: 83 e0 03 and $0x3,%eax
801051aa: 85 c0 test %eax,%eax
801051ac: 75 49 jne 801051f7 <memset+0x59>
801051ae: 8b 45 10 mov 0x10(%ebp),%eax
801051b1: 83 e0 03 and $0x3,%eax
801051b4: 85 c0 test %eax,%eax
801051b6: 75 3f jne 801051f7 <memset+0x59>
c &= 0xFF;
801051b8: 81 65 0c ff 00 00 00 andl $0xff,0xc(%ebp)
stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
801051bf: 8b 45 10 mov 0x10(%ebp),%eax
801051c2: c1 e8 02 shr $0x2,%eax
801051c5: 89 c2 mov %eax,%edx
801051c7: 8b 45 0c mov 0xc(%ebp),%eax
801051ca: 89 c1 mov %eax,%ecx
801051cc: c1 e1 18 shl $0x18,%ecx
801051cf: 8b 45 0c mov 0xc(%ebp),%eax
801051d2: c1 e0 10 shl $0x10,%eax
801051d5: 09 c1 or %eax,%ecx
801051d7: 8b 45 0c mov 0xc(%ebp),%eax
801051da: c1 e0 08 shl $0x8,%eax
801051dd: 09 c8 or %ecx,%eax
801051df: 0b 45 0c or 0xc(%ebp),%eax
801051e2: 89 54 24 08 mov %edx,0x8(%esp)
801051e6: 89 44 24 04 mov %eax,0x4(%esp)
801051ea: 8b 45 08 mov 0x8(%ebp),%eax
801051ed: 89 04 24 mov %eax,(%esp)
801051f0: e8 84 ff ff ff call 80105179 <stosl>
#include "x86.h"
void*
memset(void *dst, int c, uint n)
{
if ((int)dst%4 == 0 && n%4 == 0){
801051f5: eb 19 jmp 80105210 <memset+0x72>
c &= 0xFF;
stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
} else
stosb(dst, c, n);
801051f7: 8b 45 10 mov 0x10(%ebp),%eax
801051fa: 89 44 24 08 mov %eax,0x8(%esp)
801051fe: 8b 45 0c mov 0xc(%ebp),%eax
80105201: 89 44 24 04 mov %eax,0x4(%esp)
80105205: 8b 45 08 mov 0x8(%ebp),%eax
80105208: 89 04 24 mov %eax,(%esp)
8010520b: e8 44 ff ff ff call 80105154 <stosb>
return dst;
80105210: 8b 45 08 mov 0x8(%ebp),%eax
}
80105213: c9 leave
80105214: c3 ret
80105215 <memcmp>:
int
memcmp(const void *v1, const void *v2, uint n)
{
80105215: 55 push %ebp
80105216: 89 e5 mov %esp,%ebp
80105218: 83 ec 10 sub $0x10,%esp
const uchar *s1, *s2;
s1 = v1;
8010521b: 8b 45 08 mov 0x8(%ebp),%eax
8010521e: 89 45 f8 mov %eax,-0x8(%ebp)
s2 = v2;
80105221: 8b 45 0c mov 0xc(%ebp),%eax
80105224: 89 45 fc mov %eax,-0x4(%ebp)
while(n-- > 0){
80105227: eb 32 jmp 8010525b <memcmp+0x46>
if(*s1 != *s2)
80105229: 8b 45 f8 mov -0x8(%ebp),%eax
8010522c: 0f b6 10 movzbl (%eax),%edx
8010522f: 8b 45 fc mov -0x4(%ebp),%eax
80105232: 0f b6 00 movzbl (%eax),%eax
80105235: 38 c2 cmp %al,%dl
80105237: 74 1a je 80105253 <memcmp+0x3e>
return *s1 - *s2;
80105239: 8b 45 f8 mov -0x8(%ebp),%eax
8010523c: 0f b6 00 movzbl (%eax),%eax
8010523f: 0f b6 d0 movzbl %al,%edx
80105242: 8b 45 fc mov -0x4(%ebp),%eax
80105245: 0f b6 00 movzbl (%eax),%eax
80105248: 0f b6 c0 movzbl %al,%eax
8010524b: 89 d1 mov %edx,%ecx
8010524d: 29 c1 sub %eax,%ecx
8010524f: 89 c8 mov %ecx,%eax
80105251: eb 1c jmp 8010526f <memcmp+0x5a>
s1++, s2++;
80105253: 83 45 f8 01 addl $0x1,-0x8(%ebp)
80105257: 83 45 fc 01 addl $0x1,-0x4(%ebp)
{
const uchar *s1, *s2;
s1 = v1;
s2 = v2;
while(n-- > 0){
8010525b: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010525f: 0f 95 c0 setne %al
80105262: 83 6d 10 01 subl $0x1,0x10(%ebp)
80105266: 84 c0 test %al,%al
80105268: 75 bf jne 80105229 <memcmp+0x14>
if(*s1 != *s2)
return *s1 - *s2;
s1++, s2++;
}
return 0;
8010526a: b8 00 00 00 00 mov $0x0,%eax
}
8010526f: c9 leave
80105270: c3 ret
80105271 <memmove>:
void*
memmove(void *dst, const void *src, uint n)
{
80105271: 55 push %ebp
80105272: 89 e5 mov %esp,%ebp
80105274: 83 ec 10 sub $0x10,%esp
const char *s;
char *d;
s = src;
80105277: 8b 45 0c mov 0xc(%ebp),%eax
8010527a: 89 45 f8 mov %eax,-0x8(%ebp)
d = dst;
8010527d: 8b 45 08 mov 0x8(%ebp),%eax
80105280: 89 45 fc mov %eax,-0x4(%ebp)
if(s < d && s + n > d){
80105283: 8b 45 f8 mov -0x8(%ebp),%eax
80105286: 3b 45 fc cmp -0x4(%ebp),%eax
80105289: 73 55 jae 801052e0 <memmove+0x6f>
8010528b: 8b 45 10 mov 0x10(%ebp),%eax
8010528e: 8b 55 f8 mov -0x8(%ebp),%edx
80105291: 8d 04 02 lea (%edx,%eax,1),%eax
80105294: 3b 45 fc cmp -0x4(%ebp),%eax
80105297: 76 4a jbe 801052e3 <memmove+0x72>
s += n;
80105299: 8b 45 10 mov 0x10(%ebp),%eax
8010529c: 01 45 f8 add %eax,-0x8(%ebp)
d += n;
8010529f: 8b 45 10 mov 0x10(%ebp),%eax
801052a2: 01 45 fc add %eax,-0x4(%ebp)
while(n-- > 0)
801052a5: eb 13 jmp 801052ba <memmove+0x49>
*--d = *--s;
801052a7: 83 6d fc 01 subl $0x1,-0x4(%ebp)
801052ab: 83 6d f8 01 subl $0x1,-0x8(%ebp)
801052af: 8b 45 f8 mov -0x8(%ebp),%eax
801052b2: 0f b6 10 movzbl (%eax),%edx
801052b5: 8b 45 fc mov -0x4(%ebp),%eax
801052b8: 88 10 mov %dl,(%eax)
s = src;
d = dst;
if(s < d && s + n > d){
s += n;
d += n;
while(n-- > 0)
801052ba: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801052be: 0f 95 c0 setne %al
801052c1: 83 6d 10 01 subl $0x1,0x10(%ebp)
801052c5: 84 c0 test %al,%al
801052c7: 75 de jne 801052a7 <memmove+0x36>
const char *s;
char *d;
s = src;
d = dst;
if(s < d && s + n > d){
801052c9: eb 28 jmp 801052f3 <memmove+0x82>
d += n;
while(n-- > 0)
*--d = *--s;
} else
while(n-- > 0)
*d++ = *s++;
801052cb: 8b 45 f8 mov -0x8(%ebp),%eax
801052ce: 0f b6 10 movzbl (%eax),%edx
801052d1: 8b 45 fc mov -0x4(%ebp),%eax
801052d4: 88 10 mov %dl,(%eax)
801052d6: 83 45 fc 01 addl $0x1,-0x4(%ebp)
801052da: 83 45 f8 01 addl $0x1,-0x8(%ebp)
801052de: eb 04 jmp 801052e4 <memmove+0x73>
s += n;
d += n;
while(n-- > 0)
*--d = *--s;
} else
while(n-- > 0)
801052e0: 90 nop
801052e1: eb 01 jmp 801052e4 <memmove+0x73>
801052e3: 90 nop
801052e4: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801052e8: 0f 95 c0 setne %al
801052eb: 83 6d 10 01 subl $0x1,0x10(%ebp)
801052ef: 84 c0 test %al,%al
801052f1: 75 d8 jne 801052cb <memmove+0x5a>
*d++ = *s++;
return dst;
801052f3: 8b 45 08 mov 0x8(%ebp),%eax
}
801052f6: c9 leave
801052f7: c3 ret
801052f8 <memcpy>:
// memcpy exists to placate GCC. Use memmove.
void*
memcpy(void *dst, const void *src, uint n)
{
801052f8: 55 push %ebp
801052f9: 89 e5 mov %esp,%ebp
801052fb: 83 ec 0c sub $0xc,%esp
return memmove(dst, src, n);
801052fe: 8b 45 10 mov 0x10(%ebp),%eax
80105301: 89 44 24 08 mov %eax,0x8(%esp)
80105305: 8b 45 0c mov 0xc(%ebp),%eax
80105308: 89 44 24 04 mov %eax,0x4(%esp)
8010530c: 8b 45 08 mov 0x8(%ebp),%eax
8010530f: 89 04 24 mov %eax,(%esp)
80105312: e8 5a ff ff ff call 80105271 <memmove>
}
80105317: c9 leave
80105318: c3 ret
80105319 <strncmp>:
int
strncmp(const char *p, const char *q, uint n)
{
80105319: 55 push %ebp
8010531a: 89 e5 mov %esp,%ebp
while(n > 0 && *p && *p == *q)
8010531c: eb 0c jmp 8010532a <strncmp+0x11>
n--, p++, q++;
8010531e: 83 6d 10 01 subl $0x1,0x10(%ebp)
80105322: 83 45 08 01 addl $0x1,0x8(%ebp)
80105326: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strncmp(const char *p, const char *q, uint n)
{
while(n > 0 && *p && *p == *q)
8010532a: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010532e: 74 1a je 8010534a <strncmp+0x31>
80105330: 8b 45 08 mov 0x8(%ebp),%eax
80105333: 0f b6 00 movzbl (%eax),%eax
80105336: 84 c0 test %al,%al
80105338: 74 10 je 8010534a <strncmp+0x31>
8010533a: 8b 45 08 mov 0x8(%ebp),%eax
8010533d: 0f b6 10 movzbl (%eax),%edx
80105340: 8b 45 0c mov 0xc(%ebp),%eax
80105343: 0f b6 00 movzbl (%eax),%eax
80105346: 38 c2 cmp %al,%dl
80105348: 74 d4 je 8010531e <strncmp+0x5>
n--, p++, q++;
if(n == 0)
8010534a: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
8010534e: 75 07 jne 80105357 <strncmp+0x3e>
return 0;
80105350: b8 00 00 00 00 mov $0x0,%eax
80105355: eb 18 jmp 8010536f <strncmp+0x56>
return (uchar)*p - (uchar)*q;
80105357: 8b 45 08 mov 0x8(%ebp),%eax
8010535a: 0f b6 00 movzbl (%eax),%eax
8010535d: 0f b6 d0 movzbl %al,%edx
80105360: 8b 45 0c mov 0xc(%ebp),%eax
80105363: 0f b6 00 movzbl (%eax),%eax
80105366: 0f b6 c0 movzbl %al,%eax
80105369: 89 d1 mov %edx,%ecx
8010536b: 29 c1 sub %eax,%ecx
8010536d: 89 c8 mov %ecx,%eax
}
8010536f: 5d pop %ebp
80105370: c3 ret
80105371 <strncpy>:
char*
strncpy(char *s, const char *t, int n)
{
80105371: 55 push %ebp
80105372: 89 e5 mov %esp,%ebp
80105374: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
80105377: 8b 45 08 mov 0x8(%ebp),%eax
8010537a: 89 45 fc mov %eax,-0x4(%ebp)
while(n-- > 0 && (*s++ = *t++) != 0)
8010537d: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80105381: 0f 9f c0 setg %al
80105384: 83 6d 10 01 subl $0x1,0x10(%ebp)
80105388: 84 c0 test %al,%al
8010538a: 74 30 je 801053bc <strncpy+0x4b>
8010538c: 8b 45 0c mov 0xc(%ebp),%eax
8010538f: 0f b6 10 movzbl (%eax),%edx
80105392: 8b 45 08 mov 0x8(%ebp),%eax
80105395: 88 10 mov %dl,(%eax)
80105397: 8b 45 08 mov 0x8(%ebp),%eax
8010539a: 0f b6 00 movzbl (%eax),%eax
8010539d: 84 c0 test %al,%al
8010539f: 0f 95 c0 setne %al
801053a2: 83 45 08 01 addl $0x1,0x8(%ebp)
801053a6: 83 45 0c 01 addl $0x1,0xc(%ebp)
801053aa: 84 c0 test %al,%al
801053ac: 75 cf jne 8010537d <strncpy+0xc>
;
while(n-- > 0)
801053ae: eb 0d jmp 801053bd <strncpy+0x4c>
*s++ = 0;
801053b0: 8b 45 08 mov 0x8(%ebp),%eax
801053b3: c6 00 00 movb $0x0,(%eax)
801053b6: 83 45 08 01 addl $0x1,0x8(%ebp)
801053ba: eb 01 jmp 801053bd <strncpy+0x4c>
char *os;
os = s;
while(n-- > 0 && (*s++ = *t++) != 0)
;
while(n-- > 0)
801053bc: 90 nop
801053bd: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801053c1: 0f 9f c0 setg %al
801053c4: 83 6d 10 01 subl $0x1,0x10(%ebp)
801053c8: 84 c0 test %al,%al
801053ca: 75 e4 jne 801053b0 <strncpy+0x3f>
*s++ = 0;
return os;
801053cc: 8b 45 fc mov -0x4(%ebp),%eax
}
801053cf: c9 leave
801053d0: c3 ret
801053d1 <safestrcpy>:
// Like strncpy but guaranteed to NUL-terminate.
char*
safestrcpy(char *s, const char *t, int n)
{
801053d1: 55 push %ebp
801053d2: 89 e5 mov %esp,%ebp
801053d4: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
801053d7: 8b 45 08 mov 0x8(%ebp),%eax
801053da: 89 45 fc mov %eax,-0x4(%ebp)
if(n <= 0)
801053dd: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801053e1: 7f 05 jg 801053e8 <safestrcpy+0x17>
return os;
801053e3: 8b 45 fc mov -0x4(%ebp),%eax
801053e6: eb 35 jmp 8010541d <safestrcpy+0x4c>
while(--n > 0 && (*s++ = *t++) != 0)
801053e8: 83 6d 10 01 subl $0x1,0x10(%ebp)
801053ec: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801053f0: 7e 22 jle 80105414 <safestrcpy+0x43>
801053f2: 8b 45 0c mov 0xc(%ebp),%eax
801053f5: 0f b6 10 movzbl (%eax),%edx
801053f8: 8b 45 08 mov 0x8(%ebp),%eax
801053fb: 88 10 mov %dl,(%eax)
801053fd: 8b 45 08 mov 0x8(%ebp),%eax
80105400: 0f b6 00 movzbl (%eax),%eax
80105403: 84 c0 test %al,%al
80105405: 0f 95 c0 setne %al
80105408: 83 45 08 01 addl $0x1,0x8(%ebp)
8010540c: 83 45 0c 01 addl $0x1,0xc(%ebp)
80105410: 84 c0 test %al,%al
80105412: 75 d4 jne 801053e8 <safestrcpy+0x17>
;
*s = 0;
80105414: 8b 45 08 mov 0x8(%ebp),%eax
80105417: c6 00 00 movb $0x0,(%eax)
return os;
8010541a: 8b 45 fc mov -0x4(%ebp),%eax
}
8010541d: c9 leave
8010541e: c3 ret
8010541f <strlen>:
int
strlen(const char *s)
{
8010541f: 55 push %ebp
80105420: 89 e5 mov %esp,%ebp
80105422: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
80105425: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
8010542c: eb 04 jmp 80105432 <strlen+0x13>
8010542e: 83 45 fc 01 addl $0x1,-0x4(%ebp)
80105432: 8b 45 fc mov -0x4(%ebp),%eax
80105435: 03 45 08 add 0x8(%ebp),%eax
80105438: 0f b6 00 movzbl (%eax),%eax
8010543b: 84 c0 test %al,%al
8010543d: 75 ef jne 8010542e <strlen+0xf>
;
return n;
8010543f: 8b 45 fc mov -0x4(%ebp),%eax
}
80105442: c9 leave
80105443: c3 ret
80105444 <swtch>:
# Save current register context in old
# and then load register context from new.
.globl swtch
swtch:
movl 4(%esp), %eax
80105444: 8b 44 24 04 mov 0x4(%esp),%eax
movl 8(%esp), %edx
80105448: 8b 54 24 08 mov 0x8(%esp),%edx
# Save old callee-save registers
pushl %ebp
8010544c: 55 push %ebp
pushl %ebx
8010544d: 53 push %ebx
pushl %esi
8010544e: 56 push %esi
pushl %edi
8010544f: 57 push %edi
# Switch stacks
movl %esp, (%eax)
80105450: 89 20 mov %esp,(%eax)
movl %edx, %esp
80105452: 89 d4 mov %edx,%esp
# Load new callee-save registers
popl %edi
80105454: 5f pop %edi
popl %esi
80105455: 5e pop %esi
popl %ebx
80105456: 5b pop %ebx
popl %ebp
80105457: 5d pop %ebp
ret
80105458: c3 ret
80105459: 00 00 add %al,(%eax)
...
8010545c <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)
{
8010545c: 55 push %ebp
8010545d: 89 e5 mov %esp,%ebp
if(addr >= proc->sz || addr+4 > proc->sz)
8010545f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105465: 8b 00 mov (%eax),%eax
80105467: 3b 45 08 cmp 0x8(%ebp),%eax
8010546a: 76 12 jbe 8010547e <fetchint+0x22>
8010546c: 8b 45 08 mov 0x8(%ebp),%eax
8010546f: 8d 50 04 lea 0x4(%eax),%edx
80105472: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105478: 8b 00 mov (%eax),%eax
8010547a: 39 c2 cmp %eax,%edx
8010547c: 76 07 jbe 80105485 <fetchint+0x29>
return -1;
8010547e: b8 ff ff ff ff mov $0xffffffff,%eax
80105483: eb 0f jmp 80105494 <fetchint+0x38>
*ip = *(int*)(addr);
80105485: 8b 45 08 mov 0x8(%ebp),%eax
80105488: 8b 10 mov (%eax),%edx
8010548a: 8b 45 0c mov 0xc(%ebp),%eax
8010548d: 89 10 mov %edx,(%eax)
return 0;
8010548f: b8 00 00 00 00 mov $0x0,%eax
}
80105494: 5d pop %ebp
80105495: c3 ret
80105496 <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)
{
80105496: 55 push %ebp
80105497: 89 e5 mov %esp,%ebp
80105499: 83 ec 10 sub $0x10,%esp
char *s, *ep;
if(addr >= proc->sz)
8010549c: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801054a2: 8b 00 mov (%eax),%eax
801054a4: 3b 45 08 cmp 0x8(%ebp),%eax
801054a7: 77 07 ja 801054b0 <fetchstr+0x1a>
return -1;
801054a9: b8 ff ff ff ff mov $0xffffffff,%eax
801054ae: eb 48 jmp 801054f8 <fetchstr+0x62>
*pp = (char*)addr;
801054b0: 8b 55 08 mov 0x8(%ebp),%edx
801054b3: 8b 45 0c mov 0xc(%ebp),%eax
801054b6: 89 10 mov %edx,(%eax)
ep = (char*)proc->sz;
801054b8: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801054be: 8b 00 mov (%eax),%eax
801054c0: 89 45 fc mov %eax,-0x4(%ebp)
for(s = *pp; s < ep; s++)
801054c3: 8b 45 0c mov 0xc(%ebp),%eax
801054c6: 8b 00 mov (%eax),%eax
801054c8: 89 45 f8 mov %eax,-0x8(%ebp)
801054cb: eb 1e jmp 801054eb <fetchstr+0x55>
if(*s == 0)
801054cd: 8b 45 f8 mov -0x8(%ebp),%eax
801054d0: 0f b6 00 movzbl (%eax),%eax
801054d3: 84 c0 test %al,%al
801054d5: 75 10 jne 801054e7 <fetchstr+0x51>
return s - *pp;
801054d7: 8b 55 f8 mov -0x8(%ebp),%edx
801054da: 8b 45 0c mov 0xc(%ebp),%eax
801054dd: 8b 00 mov (%eax),%eax
801054df: 89 d1 mov %edx,%ecx
801054e1: 29 c1 sub %eax,%ecx
801054e3: 89 c8 mov %ecx,%eax
801054e5: eb 11 jmp 801054f8 <fetchstr+0x62>
if(addr >= proc->sz)
return -1;
*pp = (char*)addr;
ep = (char*)proc->sz;
for(s = *pp; s < ep; s++)
801054e7: 83 45 f8 01 addl $0x1,-0x8(%ebp)
801054eb: 8b 45 f8 mov -0x8(%ebp),%eax
801054ee: 3b 45 fc cmp -0x4(%ebp),%eax
801054f1: 72 da jb 801054cd <fetchstr+0x37>
if(*s == 0)
return s - *pp;
return -1;
801054f3: b8 ff ff ff ff mov $0xffffffff,%eax
}
801054f8: c9 leave
801054f9: c3 ret
801054fa <argint>:
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
801054fa: 55 push %ebp
801054fb: 89 e5 mov %esp,%ebp
801054fd: 83 ec 08 sub $0x8,%esp
return fetchint(proc->tf->esp + 4 + 4*n, ip);
80105500: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105506: 8b 40 18 mov 0x18(%eax),%eax
80105509: 8b 50 44 mov 0x44(%eax),%edx
8010550c: 8b 45 08 mov 0x8(%ebp),%eax
8010550f: c1 e0 02 shl $0x2,%eax
80105512: 8d 04 02 lea (%edx,%eax,1),%eax
80105515: 8d 50 04 lea 0x4(%eax),%edx
80105518: 8b 45 0c mov 0xc(%ebp),%eax
8010551b: 89 44 24 04 mov %eax,0x4(%esp)
8010551f: 89 14 24 mov %edx,(%esp)
80105522: e8 35 ff ff ff call 8010545c <fetchint>
}
80105527: c9 leave
80105528: c3 ret
80105529 <argptr>:
// Fetch the nth word-sized system call argument as a pointer
// to a block of memory of size n bytes. Check that the pointer
// lies within the process address space.
int
argptr(int n, char **pp, int size)
{
80105529: 55 push %ebp
8010552a: 89 e5 mov %esp,%ebp
8010552c: 83 ec 18 sub $0x18,%esp
int i;
if(argint(n, &i) < 0)
8010552f: 8d 45 fc lea -0x4(%ebp),%eax
80105532: 89 44 24 04 mov %eax,0x4(%esp)
80105536: 8b 45 08 mov 0x8(%ebp),%eax
80105539: 89 04 24 mov %eax,(%esp)
8010553c: e8 b9 ff ff ff call 801054fa <argint>
80105541: 85 c0 test %eax,%eax
80105543: 79 07 jns 8010554c <argptr+0x23>
return -1;
80105545: b8 ff ff ff ff mov $0xffffffff,%eax
8010554a: eb 3d jmp 80105589 <argptr+0x60>
if((uint)i >= proc->sz || (uint)i+size > proc->sz)
8010554c: 8b 45 fc mov -0x4(%ebp),%eax
8010554f: 89 c2 mov %eax,%edx
80105551: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105557: 8b 00 mov (%eax),%eax
80105559: 39 c2 cmp %eax,%edx
8010555b: 73 16 jae 80105573 <argptr+0x4a>
8010555d: 8b 45 fc mov -0x4(%ebp),%eax
80105560: 89 c2 mov %eax,%edx
80105562: 8b 45 10 mov 0x10(%ebp),%eax
80105565: 01 c2 add %eax,%edx
80105567: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010556d: 8b 00 mov (%eax),%eax
8010556f: 39 c2 cmp %eax,%edx
80105571: 76 07 jbe 8010557a <argptr+0x51>
return -1;
80105573: b8 ff ff ff ff mov $0xffffffff,%eax
80105578: eb 0f jmp 80105589 <argptr+0x60>
*pp = (char*)i;
8010557a: 8b 45 fc mov -0x4(%ebp),%eax
8010557d: 89 c2 mov %eax,%edx
8010557f: 8b 45 0c mov 0xc(%ebp),%eax
80105582: 89 10 mov %edx,(%eax)
return 0;
80105584: b8 00 00 00 00 mov $0x0,%eax
}
80105589: c9 leave
8010558a: c3 ret
8010558b <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)
{
8010558b: 55 push %ebp
8010558c: 89 e5 mov %esp,%ebp
8010558e: 83 ec 18 sub $0x18,%esp
int addr;
if(argint(n, &addr) < 0)
80105591: 8d 45 fc lea -0x4(%ebp),%eax
80105594: 89 44 24 04 mov %eax,0x4(%esp)
80105598: 8b 45 08 mov 0x8(%ebp),%eax
8010559b: 89 04 24 mov %eax,(%esp)
8010559e: e8 57 ff ff ff call 801054fa <argint>
801055a3: 85 c0 test %eax,%eax
801055a5: 79 07 jns 801055ae <argstr+0x23>
return -1;
801055a7: b8 ff ff ff ff mov $0xffffffff,%eax
801055ac: eb 12 jmp 801055c0 <argstr+0x35>
return fetchstr(addr, pp);
801055ae: 8b 45 fc mov -0x4(%ebp),%eax
801055b1: 8b 55 0c mov 0xc(%ebp),%edx
801055b4: 89 54 24 04 mov %edx,0x4(%esp)
801055b8: 89 04 24 mov %eax,(%esp)
801055bb: e8 d6 fe ff ff call 80105496 <fetchstr>
}
801055c0: c9 leave
801055c1: c3 ret
801055c2 <syscall>:
[SYS_thread_yield] sys_thread_yield,
};
void
syscall(void)
{
801055c2: 55 push %ebp
801055c3: 89 e5 mov %esp,%ebp
801055c5: 53 push %ebx
801055c6: 83 ec 24 sub $0x24,%esp
int num;
num = proc->tf->eax;
801055c9: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801055cf: 8b 40 18 mov 0x18(%eax),%eax
801055d2: 8b 40 1c mov 0x1c(%eax),%eax
801055d5: 89 45 f4 mov %eax,-0xc(%ebp)
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
801055d8: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801055dc: 7e 30 jle 8010560e <syscall+0x4c>
801055de: 8b 45 f4 mov -0xc(%ebp),%eax
801055e1: 83 f8 1a cmp $0x1a,%eax
801055e4: 77 28 ja 8010560e <syscall+0x4c>
801055e6: 8b 45 f4 mov -0xc(%ebp),%eax
801055e9: 8b 04 85 40 b0 10 80 mov -0x7fef4fc0(,%eax,4),%eax
801055f0: 85 c0 test %eax,%eax
801055f2: 74 1a je 8010560e <syscall+0x4c>
proc->tf->eax = syscalls[num]();
801055f4: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801055fa: 8b 58 18 mov 0x18(%eax),%ebx
801055fd: 8b 45 f4 mov -0xc(%ebp),%eax
80105600: 8b 04 85 40 b0 10 80 mov -0x7fef4fc0(,%eax,4),%eax
80105607: ff d0 call *%eax
80105609: 89 43 1c mov %eax,0x1c(%ebx)
syscall(void)
{
int num;
num = proc->tf->eax;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
8010560c: eb 3d jmp 8010564b <syscall+0x89>
proc->tf->eax = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
proc->pid, proc->name, num);
8010560e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
num = proc->tf->eax;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
proc->tf->eax = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
80105614: 8d 48 6c lea 0x6c(%eax),%ecx
proc->pid, proc->name, num);
80105617: 65 a1 04 00 00 00 mov %gs:0x4,%eax
num = proc->tf->eax;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
proc->tf->eax = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
8010561d: 8b 40 10 mov 0x10(%eax),%eax
80105620: 8b 55 f4 mov -0xc(%ebp),%edx
80105623: 89 54 24 0c mov %edx,0xc(%esp)
80105627: 89 4c 24 08 mov %ecx,0x8(%esp)
8010562b: 89 44 24 04 mov %eax,0x4(%esp)
8010562f: c7 04 24 fb 89 10 80 movl $0x801089fb,(%esp)
80105636: e8 5f ad ff ff call 8010039a <cprintf>
proc->pid, proc->name, num);
proc->tf->eax = -1;
8010563b: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105641: 8b 40 18 mov 0x18(%eax),%eax
80105644: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax)
}
}
8010564b: 83 c4 24 add $0x24,%esp
8010564e: 5b pop %ebx
8010564f: 5d pop %ebp
80105650: c3 ret
80105651: 00 00 add %al,(%eax)
...
80105654 <argfd>:
// Fetch the nth word-sized system call argument as a file descriptor
// and return both the descriptor and the corresponding struct file.
static int
argfd(int n, int *pfd, struct file **pf)
{
80105654: 55 push %ebp
80105655: 89 e5 mov %esp,%ebp
80105657: 83 ec 28 sub $0x28,%esp
int fd;
struct file *f;
if(argint(n, &fd) < 0)
8010565a: 8d 45 f0 lea -0x10(%ebp),%eax
8010565d: 89 44 24 04 mov %eax,0x4(%esp)
80105661: 8b 45 08 mov 0x8(%ebp),%eax
80105664: 89 04 24 mov %eax,(%esp)
80105667: e8 8e fe ff ff call 801054fa <argint>
8010566c: 85 c0 test %eax,%eax
8010566e: 79 07 jns 80105677 <argfd+0x23>
return -1;
80105670: b8 ff ff ff ff mov $0xffffffff,%eax
80105675: eb 50 jmp 801056c7 <argfd+0x73>
if(fd < 0 || fd >= NOFILE || (f=proc->ofile[fd]) == 0)
80105677: 8b 45 f0 mov -0x10(%ebp),%eax
8010567a: 85 c0 test %eax,%eax
8010567c: 78 21 js 8010569f <argfd+0x4b>
8010567e: 8b 45 f0 mov -0x10(%ebp),%eax
80105681: 83 f8 0f cmp $0xf,%eax
80105684: 7f 19 jg 8010569f <argfd+0x4b>
80105686: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010568c: 8b 55 f0 mov -0x10(%ebp),%edx
8010568f: 83 c2 08 add $0x8,%edx
80105692: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
80105696: 89 45 f4 mov %eax,-0xc(%ebp)
80105699: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8010569d: 75 07 jne 801056a6 <argfd+0x52>
return -1;
8010569f: b8 ff ff ff ff mov $0xffffffff,%eax
801056a4: eb 21 jmp 801056c7 <argfd+0x73>
if(pfd)
801056a6: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
801056aa: 74 08 je 801056b4 <argfd+0x60>
*pfd = fd;
801056ac: 8b 55 f0 mov -0x10(%ebp),%edx
801056af: 8b 45 0c mov 0xc(%ebp),%eax
801056b2: 89 10 mov %edx,(%eax)
if(pf)
801056b4: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
801056b8: 74 08 je 801056c2 <argfd+0x6e>
*pf = f;
801056ba: 8b 45 10 mov 0x10(%ebp),%eax
801056bd: 8b 55 f4 mov -0xc(%ebp),%edx
801056c0: 89 10 mov %edx,(%eax)
return 0;
801056c2: b8 00 00 00 00 mov $0x0,%eax
}
801056c7: c9 leave
801056c8: c3 ret
801056c9 <fdalloc>:
// Allocate a file descriptor for the given file.
// Takes over file reference from caller on success.
static int
fdalloc(struct file *f)
{
801056c9: 55 push %ebp
801056ca: 89 e5 mov %esp,%ebp
801056cc: 83 ec 10 sub $0x10,%esp
int fd;
for(fd = 0; fd < NOFILE; fd++){
801056cf: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
801056d6: eb 30 jmp 80105708 <fdalloc+0x3f>
if(proc->ofile[fd] == 0){
801056d8: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801056de: 8b 55 fc mov -0x4(%ebp),%edx
801056e1: 83 c2 08 add $0x8,%edx
801056e4: 8b 44 90 08 mov 0x8(%eax,%edx,4),%eax
801056e8: 85 c0 test %eax,%eax
801056ea: 75 18 jne 80105704 <fdalloc+0x3b>
proc->ofile[fd] = f;
801056ec: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801056f2: 8b 55 fc mov -0x4(%ebp),%edx
801056f5: 8d 4a 08 lea 0x8(%edx),%ecx
801056f8: 8b 55 08 mov 0x8(%ebp),%edx
801056fb: 89 54 88 08 mov %edx,0x8(%eax,%ecx,4)
return fd;
801056ff: 8b 45 fc mov -0x4(%ebp),%eax
80105702: eb 0f jmp 80105713 <fdalloc+0x4a>
static int
fdalloc(struct file *f)
{
int fd;
for(fd = 0; fd < NOFILE; fd++){
80105704: 83 45 fc 01 addl $0x1,-0x4(%ebp)
80105708: 83 7d fc 0f cmpl $0xf,-0x4(%ebp)
8010570c: 7e ca jle 801056d8 <fdalloc+0xf>
if(proc->ofile[fd] == 0){
proc->ofile[fd] = f;
return fd;
}
}
return -1;
8010570e: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105713: c9 leave
80105714: c3 ret
80105715 <sys_dup>:
int
sys_dup(void)
{
80105715: 55 push %ebp
80105716: 89 e5 mov %esp,%ebp
80105718: 83 ec 28 sub $0x28,%esp
struct file *f;
int fd;
if(argfd(0, 0, &f) < 0)
8010571b: 8d 45 f0 lea -0x10(%ebp),%eax
8010571e: 89 44 24 08 mov %eax,0x8(%esp)
80105722: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80105729: 00
8010572a: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105731: e8 1e ff ff ff call 80105654 <argfd>
80105736: 85 c0 test %eax,%eax
80105738: 79 07 jns 80105741 <sys_dup+0x2c>
return -1;
8010573a: b8 ff ff ff ff mov $0xffffffff,%eax
8010573f: eb 29 jmp 8010576a <sys_dup+0x55>
if((fd=fdalloc(f)) < 0)
80105741: 8b 45 f0 mov -0x10(%ebp),%eax
80105744: 89 04 24 mov %eax,(%esp)
80105747: e8 7d ff ff ff call 801056c9 <fdalloc>
8010574c: 89 45 f4 mov %eax,-0xc(%ebp)
8010574f: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80105753: 79 07 jns 8010575c <sys_dup+0x47>
return -1;
80105755: b8 ff ff ff ff mov $0xffffffff,%eax
8010575a: eb 0e jmp 8010576a <sys_dup+0x55>
filedup(f);
8010575c: 8b 45 f0 mov -0x10(%ebp),%eax
8010575f: 89 04 24 mov %eax,(%esp)
80105762: e8 1e b8 ff ff call 80100f85 <filedup>
return fd;
80105767: 8b 45 f4 mov -0xc(%ebp),%eax
}
8010576a: c9 leave
8010576b: c3 ret
8010576c <sys_read>:
int
sys_read(void)
{
8010576c: 55 push %ebp
8010576d: 89 e5 mov %esp,%ebp
8010576f: 83 ec 28 sub $0x28,%esp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80105772: 8d 45 f4 lea -0xc(%ebp),%eax
80105775: 89 44 24 08 mov %eax,0x8(%esp)
80105779: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80105780: 00
80105781: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105788: e8 c7 fe ff ff call 80105654 <argfd>
8010578d: 85 c0 test %eax,%eax
8010578f: 78 35 js 801057c6 <sys_read+0x5a>
80105791: 8d 45 f0 lea -0x10(%ebp),%eax
80105794: 89 44 24 04 mov %eax,0x4(%esp)
80105798: c7 04 24 02 00 00 00 movl $0x2,(%esp)
8010579f: e8 56 fd ff ff call 801054fa <argint>
801057a4: 85 c0 test %eax,%eax
801057a6: 78 1e js 801057c6 <sys_read+0x5a>
801057a8: 8b 45 f0 mov -0x10(%ebp),%eax
801057ab: 89 44 24 08 mov %eax,0x8(%esp)
801057af: 8d 45 ec lea -0x14(%ebp),%eax
801057b2: 89 44 24 04 mov %eax,0x4(%esp)
801057b6: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801057bd: e8 67 fd ff ff call 80105529 <argptr>
801057c2: 85 c0 test %eax,%eax
801057c4: 79 07 jns 801057cd <sys_read+0x61>
return -1;
801057c6: b8 ff ff ff ff mov $0xffffffff,%eax
801057cb: eb 19 jmp 801057e6 <sys_read+0x7a>
return fileread(f, p, n);
801057cd: 8b 4d f0 mov -0x10(%ebp),%ecx
801057d0: 8b 55 ec mov -0x14(%ebp),%edx
801057d3: 8b 45 f4 mov -0xc(%ebp),%eax
801057d6: 89 4c 24 08 mov %ecx,0x8(%esp)
801057da: 89 54 24 04 mov %edx,0x4(%esp)
801057de: 89 04 24 mov %eax,(%esp)
801057e1: e8 0c b9 ff ff call 801010f2 <fileread>
}
801057e6: c9 leave
801057e7: c3 ret
801057e8 <sys_write>:
int
sys_write(void)
{
801057e8: 55 push %ebp
801057e9: 89 e5 mov %esp,%ebp
801057eb: 83 ec 28 sub $0x28,%esp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
801057ee: 8d 45 f4 lea -0xc(%ebp),%eax
801057f1: 89 44 24 08 mov %eax,0x8(%esp)
801057f5: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801057fc: 00
801057fd: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105804: e8 4b fe ff ff call 80105654 <argfd>
80105809: 85 c0 test %eax,%eax
8010580b: 78 35 js 80105842 <sys_write+0x5a>
8010580d: 8d 45 f0 lea -0x10(%ebp),%eax
80105810: 89 44 24 04 mov %eax,0x4(%esp)
80105814: c7 04 24 02 00 00 00 movl $0x2,(%esp)
8010581b: e8 da fc ff ff call 801054fa <argint>
80105820: 85 c0 test %eax,%eax
80105822: 78 1e js 80105842 <sys_write+0x5a>
80105824: 8b 45 f0 mov -0x10(%ebp),%eax
80105827: 89 44 24 08 mov %eax,0x8(%esp)
8010582b: 8d 45 ec lea -0x14(%ebp),%eax
8010582e: 89 44 24 04 mov %eax,0x4(%esp)
80105832: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80105839: e8 eb fc ff ff call 80105529 <argptr>
8010583e: 85 c0 test %eax,%eax
80105840: 79 07 jns 80105849 <sys_write+0x61>
return -1;
80105842: b8 ff ff ff ff mov $0xffffffff,%eax
80105847: eb 19 jmp 80105862 <sys_write+0x7a>
return filewrite(f, p, n);
80105849: 8b 4d f0 mov -0x10(%ebp),%ecx
8010584c: 8b 55 ec mov -0x14(%ebp),%edx
8010584f: 8b 45 f4 mov -0xc(%ebp),%eax
80105852: 89 4c 24 08 mov %ecx,0x8(%esp)
80105856: 89 54 24 04 mov %edx,0x4(%esp)
8010585a: 89 04 24 mov %eax,(%esp)
8010585d: e8 4c b9 ff ff call 801011ae <filewrite>
}
80105862: c9 leave
80105863: c3 ret
80105864 <sys_close>:
int
sys_close(void)
{
80105864: 55 push %ebp
80105865: 89 e5 mov %esp,%ebp
80105867: 83 ec 28 sub $0x28,%esp
int fd;
struct file *f;
if(argfd(0, &fd, &f) < 0)
8010586a: 8d 45 f0 lea -0x10(%ebp),%eax
8010586d: 89 44 24 08 mov %eax,0x8(%esp)
80105871: 8d 45 f4 lea -0xc(%ebp),%eax
80105874: 89 44 24 04 mov %eax,0x4(%esp)
80105878: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010587f: e8 d0 fd ff ff call 80105654 <argfd>
80105884: 85 c0 test %eax,%eax
80105886: 79 07 jns 8010588f <sys_close+0x2b>
return -1;
80105888: b8 ff ff ff ff mov $0xffffffff,%eax
8010588d: eb 24 jmp 801058b3 <sys_close+0x4f>
proc->ofile[fd] = 0;
8010588f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80105895: 8b 55 f4 mov -0xc(%ebp),%edx
80105898: 83 c2 08 add $0x8,%edx
8010589b: c7 44 90 08 00 00 00 movl $0x0,0x8(%eax,%edx,4)
801058a2: 00
fileclose(f);
801058a3: 8b 45 f0 mov -0x10(%ebp),%eax
801058a6: 89 04 24 mov %eax,(%esp)
801058a9: e8 1f b7 ff ff call 80100fcd <fileclose>
return 0;
801058ae: b8 00 00 00 00 mov $0x0,%eax
}
801058b3: c9 leave
801058b4: c3 ret
801058b5 <sys_fstat>:
int
sys_fstat(void)
{
801058b5: 55 push %ebp
801058b6: 89 e5 mov %esp,%ebp
801058b8: 83 ec 28 sub $0x28,%esp
struct file *f;
struct stat *st;
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
801058bb: 8d 45 f4 lea -0xc(%ebp),%eax
801058be: 89 44 24 08 mov %eax,0x8(%esp)
801058c2: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801058c9: 00
801058ca: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801058d1: e8 7e fd ff ff call 80105654 <argfd>
801058d6: 85 c0 test %eax,%eax
801058d8: 78 1f js 801058f9 <sys_fstat+0x44>
801058da: 8d 45 f0 lea -0x10(%ebp),%eax
801058dd: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp)
801058e4: 00
801058e5: 89 44 24 04 mov %eax,0x4(%esp)
801058e9: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801058f0: e8 34 fc ff ff call 80105529 <argptr>
801058f5: 85 c0 test %eax,%eax
801058f7: 79 07 jns 80105900 <sys_fstat+0x4b>
return -1;
801058f9: b8 ff ff ff ff mov $0xffffffff,%eax
801058fe: eb 12 jmp 80105912 <sys_fstat+0x5d>
return filestat(f, st);
80105900: 8b 55 f0 mov -0x10(%ebp),%edx
80105903: 8b 45 f4 mov -0xc(%ebp),%eax
80105906: 89 54 24 04 mov %edx,0x4(%esp)
8010590a: 89 04 24 mov %eax,(%esp)
8010590d: e8 91 b7 ff ff call 801010a3 <filestat>
}
80105912: c9 leave
80105913: c3 ret
80105914 <sys_link>:
// Create the path new as a link to the same inode as old.
int
sys_link(void)
{
80105914: 55 push %ebp
80105915: 89 e5 mov %esp,%ebp
80105917: 83 ec 38 sub $0x38,%esp
char name[DIRSIZ], *new, *old;
struct inode *dp, *ip;
if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
8010591a: 8d 45 d8 lea -0x28(%ebp),%eax
8010591d: 89 44 24 04 mov %eax,0x4(%esp)
80105921: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105928: e8 5e fc ff ff call 8010558b <argstr>
8010592d: 85 c0 test %eax,%eax
8010592f: 78 17 js 80105948 <sys_link+0x34>
80105931: 8d 45 dc lea -0x24(%ebp),%eax
80105934: 89 44 24 04 mov %eax,0x4(%esp)
80105938: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010593f: e8 47 fc ff ff call 8010558b <argstr>
80105944: 85 c0 test %eax,%eax
80105946: 79 0a jns 80105952 <sys_link+0x3e>
return -1;
80105948: b8 ff ff ff ff mov $0xffffffff,%eax
8010594d: e9 3c 01 00 00 jmp 80105a8e <sys_link+0x17a>
if((ip = namei(old)) == 0)
80105952: 8b 45 d8 mov -0x28(%ebp),%eax
80105955: 89 04 24 mov %eax,(%esp)
80105958: e8 c6 ca ff ff call 80102423 <namei>
8010595d: 89 45 f4 mov %eax,-0xc(%ebp)
80105960: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80105964: 75 0a jne 80105970 <sys_link+0x5c>
return -1;
80105966: b8 ff ff ff ff mov $0xffffffff,%eax
8010596b: e9 1e 01 00 00 jmp 80105a8e <sys_link+0x17a>
begin_trans();
80105970: e8 9d d8 ff ff call 80103212 <begin_trans>
ilock(ip);
80105975: 8b 45 f4 mov -0xc(%ebp),%eax
80105978: 89 04 24 mov %eax,(%esp)
8010597b: e8 fb be ff ff call 8010187b <ilock>
if(ip->type == T_DIR){
80105980: 8b 45 f4 mov -0xc(%ebp),%eax
80105983: 0f b7 40 10 movzwl 0x10(%eax),%eax
80105987: 66 83 f8 01 cmp $0x1,%ax
8010598b: 75 1a jne 801059a7 <sys_link+0x93>
iunlockput(ip);
8010598d: 8b 45 f4 mov -0xc(%ebp),%eax
80105990: 89 04 24 mov %eax,(%esp)
80105993: e8 6a c1 ff ff call 80101b02 <iunlockput>
commit_trans();
80105998: e8 be d8 ff ff call 8010325b <commit_trans>
return -1;
8010599d: b8 ff ff ff ff mov $0xffffffff,%eax
801059a2: e9 e7 00 00 00 jmp 80105a8e <sys_link+0x17a>
}
ip->nlink++;
801059a7: 8b 45 f4 mov -0xc(%ebp),%eax
801059aa: 0f b7 40 16 movzwl 0x16(%eax),%eax
801059ae: 8d 50 01 lea 0x1(%eax),%edx
801059b1: 8b 45 f4 mov -0xc(%ebp),%eax
801059b4: 66 89 50 16 mov %dx,0x16(%eax)
iupdate(ip);
801059b8: 8b 45 f4 mov -0xc(%ebp),%eax
801059bb: 89 04 24 mov %eax,(%esp)
801059be: e8 f8 bc ff ff call 801016bb <iupdate>
iunlock(ip);
801059c3: 8b 45 f4 mov -0xc(%ebp),%eax
801059c6: 89 04 24 mov %eax,(%esp)
801059c9: e8 fe bf ff ff call 801019cc <iunlock>
if((dp = nameiparent(new, name)) == 0)
801059ce: 8b 45 dc mov -0x24(%ebp),%eax
801059d1: 8d 55 e2 lea -0x1e(%ebp),%edx
801059d4: 89 54 24 04 mov %edx,0x4(%esp)
801059d8: 89 04 24 mov %eax,(%esp)
801059db: e8 65 ca ff ff call 80102445 <nameiparent>
801059e0: 89 45 f0 mov %eax,-0x10(%ebp)
801059e3: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
801059e7: 74 68 je 80105a51 <sys_link+0x13d>
goto bad;
ilock(dp);
801059e9: 8b 45 f0 mov -0x10(%ebp),%eax
801059ec: 89 04 24 mov %eax,(%esp)
801059ef: e8 87 be ff ff call 8010187b <ilock>
if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
801059f4: 8b 45 f0 mov -0x10(%ebp),%eax
801059f7: 8b 10 mov (%eax),%edx
801059f9: 8b 45 f4 mov -0xc(%ebp),%eax
801059fc: 8b 00 mov (%eax),%eax
801059fe: 39 c2 cmp %eax,%edx
80105a00: 75 20 jne 80105a22 <sys_link+0x10e>
80105a02: 8b 45 f4 mov -0xc(%ebp),%eax
80105a05: 8b 40 04 mov 0x4(%eax),%eax
80105a08: 89 44 24 08 mov %eax,0x8(%esp)
80105a0c: 8d 45 e2 lea -0x1e(%ebp),%eax
80105a0f: 89 44 24 04 mov %eax,0x4(%esp)
80105a13: 8b 45 f0 mov -0x10(%ebp),%eax
80105a16: 89 04 24 mov %eax,(%esp)
80105a19: e8 44 c7 ff ff call 80102162 <dirlink>
80105a1e: 85 c0 test %eax,%eax
80105a20: 79 0d jns 80105a2f <sys_link+0x11b>
iunlockput(dp);
80105a22: 8b 45 f0 mov -0x10(%ebp),%eax
80105a25: 89 04 24 mov %eax,(%esp)
80105a28: e8 d5 c0 ff ff call 80101b02 <iunlockput>
goto bad;
80105a2d: eb 23 jmp 80105a52 <sys_link+0x13e>
}
iunlockput(dp);
80105a2f: 8b 45 f0 mov -0x10(%ebp),%eax
80105a32: 89 04 24 mov %eax,(%esp)
80105a35: e8 c8 c0 ff ff call 80101b02 <iunlockput>
iput(ip);
80105a3a: 8b 45 f4 mov -0xc(%ebp),%eax
80105a3d: 89 04 24 mov %eax,(%esp)
80105a40: e8 ec bf ff ff call 80101a31 <iput>
commit_trans();
80105a45: e8 11 d8 ff ff call 8010325b <commit_trans>
return 0;
80105a4a: b8 00 00 00 00 mov $0x0,%eax
80105a4f: eb 3d jmp 80105a8e <sys_link+0x17a>
ip->nlink++;
iupdate(ip);
iunlock(ip);
if((dp = nameiparent(new, name)) == 0)
goto bad;
80105a51: 90 nop
commit_trans();
return 0;
bad:
ilock(ip);
80105a52: 8b 45 f4 mov -0xc(%ebp),%eax
80105a55: 89 04 24 mov %eax,(%esp)
80105a58: e8 1e be ff ff call 8010187b <ilock>
ip->nlink--;
80105a5d: 8b 45 f4 mov -0xc(%ebp),%eax
80105a60: 0f b7 40 16 movzwl 0x16(%eax),%eax
80105a64: 8d 50 ff lea -0x1(%eax),%edx
80105a67: 8b 45 f4 mov -0xc(%ebp),%eax
80105a6a: 66 89 50 16 mov %dx,0x16(%eax)
iupdate(ip);
80105a6e: 8b 45 f4 mov -0xc(%ebp),%eax
80105a71: 89 04 24 mov %eax,(%esp)
80105a74: e8 42 bc ff ff call 801016bb <iupdate>
iunlockput(ip);
80105a79: 8b 45 f4 mov -0xc(%ebp),%eax
80105a7c: 89 04 24 mov %eax,(%esp)
80105a7f: e8 7e c0 ff ff call 80101b02 <iunlockput>
commit_trans();
80105a84: e8 d2 d7 ff ff call 8010325b <commit_trans>
return -1;
80105a89: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105a8e: c9 leave
80105a8f: c3 ret
80105a90 <isdirempty>:
// Is the directory dp empty except for "." and ".." ?
static int
isdirempty(struct inode *dp)
{
80105a90: 55 push %ebp
80105a91: 89 e5 mov %esp,%ebp
80105a93: 83 ec 38 sub $0x38,%esp
int off;
struct dirent de;
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
80105a96: c7 45 f4 20 00 00 00 movl $0x20,-0xc(%ebp)
80105a9d: eb 4b jmp 80105aea <isdirempty+0x5a>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80105a9f: 8b 55 f4 mov -0xc(%ebp),%edx
80105aa2: 8d 45 e4 lea -0x1c(%ebp),%eax
80105aa5: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80105aac: 00
80105aad: 89 54 24 08 mov %edx,0x8(%esp)
80105ab1: 89 44 24 04 mov %eax,0x4(%esp)
80105ab5: 8b 45 08 mov 0x8(%ebp),%eax
80105ab8: 89 04 24 mov %eax,(%esp)
80105abb: e8 b4 c2 ff ff call 80101d74 <readi>
80105ac0: 83 f8 10 cmp $0x10,%eax
80105ac3: 74 0c je 80105ad1 <isdirempty+0x41>
panic("isdirempty: readi");
80105ac5: c7 04 24 17 8a 10 80 movl $0x80108a17,(%esp)
80105acc: e8 69 aa ff ff call 8010053a <panic>
if(de.inum != 0)
80105ad1: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax
80105ad5: 66 85 c0 test %ax,%ax
80105ad8: 74 07 je 80105ae1 <isdirempty+0x51>
return 0;
80105ada: b8 00 00 00 00 mov $0x0,%eax
80105adf: eb 1b jmp 80105afc <isdirempty+0x6c>
isdirempty(struct inode *dp)
{
int off;
struct dirent de;
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
80105ae1: 8b 45 f4 mov -0xc(%ebp),%eax
80105ae4: 83 c0 10 add $0x10,%eax
80105ae7: 89 45 f4 mov %eax,-0xc(%ebp)
80105aea: 8b 55 f4 mov -0xc(%ebp),%edx
80105aed: 8b 45 08 mov 0x8(%ebp),%eax
80105af0: 8b 40 18 mov 0x18(%eax),%eax
80105af3: 39 c2 cmp %eax,%edx
80105af5: 72 a8 jb 80105a9f <isdirempty+0xf>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("isdirempty: readi");
if(de.inum != 0)
return 0;
}
return 1;
80105af7: b8 01 00 00 00 mov $0x1,%eax
}
80105afc: c9 leave
80105afd: c3 ret
80105afe <sys_unlink>:
//PAGEBREAK!
int
sys_unlink(void)
{
80105afe: 55 push %ebp
80105aff: 89 e5 mov %esp,%ebp
80105b01: 83 ec 48 sub $0x48,%esp
struct inode *ip, *dp;
struct dirent de;
char name[DIRSIZ], *path;
uint off;
if(argstr(0, &path) < 0)
80105b04: 8d 45 cc lea -0x34(%ebp),%eax
80105b07: 89 44 24 04 mov %eax,0x4(%esp)
80105b0b: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105b12: e8 74 fa ff ff call 8010558b <argstr>
80105b17: 85 c0 test %eax,%eax
80105b19: 79 0a jns 80105b25 <sys_unlink+0x27>
return -1;
80105b1b: b8 ff ff ff ff mov $0xffffffff,%eax
80105b20: e9 aa 01 00 00 jmp 80105ccf <sys_unlink+0x1d1>
if((dp = nameiparent(path, name)) == 0)
80105b25: 8b 45 cc mov -0x34(%ebp),%eax
80105b28: 8d 55 d2 lea -0x2e(%ebp),%edx
80105b2b: 89 54 24 04 mov %edx,0x4(%esp)
80105b2f: 89 04 24 mov %eax,(%esp)
80105b32: e8 0e c9 ff ff call 80102445 <nameiparent>
80105b37: 89 45 f4 mov %eax,-0xc(%ebp)
80105b3a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80105b3e: 75 0a jne 80105b4a <sys_unlink+0x4c>
return -1;
80105b40: b8 ff ff ff ff mov $0xffffffff,%eax
80105b45: e9 85 01 00 00 jmp 80105ccf <sys_unlink+0x1d1>
begin_trans();
80105b4a: e8 c3 d6 ff ff call 80103212 <begin_trans>
ilock(dp);
80105b4f: 8b 45 f4 mov -0xc(%ebp),%eax
80105b52: 89 04 24 mov %eax,(%esp)
80105b55: e8 21 bd ff ff call 8010187b <ilock>
// Cannot unlink "." or "..".
if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0)
80105b5a: c7 44 24 04 29 8a 10 movl $0x80108a29,0x4(%esp)
80105b61: 80
80105b62: 8d 45 d2 lea -0x2e(%ebp),%eax
80105b65: 89 04 24 mov %eax,(%esp)
80105b68: e8 0b c5 ff ff call 80102078 <namecmp>
80105b6d: 85 c0 test %eax,%eax
80105b6f: 0f 84 45 01 00 00 je 80105cba <sys_unlink+0x1bc>
80105b75: c7 44 24 04 2b 8a 10 movl $0x80108a2b,0x4(%esp)
80105b7c: 80
80105b7d: 8d 45 d2 lea -0x2e(%ebp),%eax
80105b80: 89 04 24 mov %eax,(%esp)
80105b83: e8 f0 c4 ff ff call 80102078 <namecmp>
80105b88: 85 c0 test %eax,%eax
80105b8a: 0f 84 2a 01 00 00 je 80105cba <sys_unlink+0x1bc>
goto bad;
if((ip = dirlookup(dp, name, &off)) == 0)
80105b90: 8d 45 c8 lea -0x38(%ebp),%eax
80105b93: 89 44 24 08 mov %eax,0x8(%esp)
80105b97: 8d 45 d2 lea -0x2e(%ebp),%eax
80105b9a: 89 44 24 04 mov %eax,0x4(%esp)
80105b9e: 8b 45 f4 mov -0xc(%ebp),%eax
80105ba1: 89 04 24 mov %eax,(%esp)
80105ba4: e8 f1 c4 ff ff call 8010209a <dirlookup>
80105ba9: 89 45 f0 mov %eax,-0x10(%ebp)
80105bac: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80105bb0: 0f 84 03 01 00 00 je 80105cb9 <sys_unlink+0x1bb>
goto bad;
ilock(ip);
80105bb6: 8b 45 f0 mov -0x10(%ebp),%eax
80105bb9: 89 04 24 mov %eax,(%esp)
80105bbc: e8 ba bc ff ff call 8010187b <ilock>
if(ip->nlink < 1)
80105bc1: 8b 45 f0 mov -0x10(%ebp),%eax
80105bc4: 0f b7 40 16 movzwl 0x16(%eax),%eax
80105bc8: 66 85 c0 test %ax,%ax
80105bcb: 7f 0c jg 80105bd9 <sys_unlink+0xdb>
panic("unlink: nlink < 1");
80105bcd: c7 04 24 2e 8a 10 80 movl $0x80108a2e,(%esp)
80105bd4: e8 61 a9 ff ff call 8010053a <panic>
if(ip->type == T_DIR && !isdirempty(ip)){
80105bd9: 8b 45 f0 mov -0x10(%ebp),%eax
80105bdc: 0f b7 40 10 movzwl 0x10(%eax),%eax
80105be0: 66 83 f8 01 cmp $0x1,%ax
80105be4: 75 1f jne 80105c05 <sys_unlink+0x107>
80105be6: 8b 45 f0 mov -0x10(%ebp),%eax
80105be9: 89 04 24 mov %eax,(%esp)
80105bec: e8 9f fe ff ff call 80105a90 <isdirempty>
80105bf1: 85 c0 test %eax,%eax
80105bf3: 75 10 jne 80105c05 <sys_unlink+0x107>
iunlockput(ip);
80105bf5: 8b 45 f0 mov -0x10(%ebp),%eax
80105bf8: 89 04 24 mov %eax,(%esp)
80105bfb: e8 02 bf ff ff call 80101b02 <iunlockput>
goto bad;
80105c00: e9 b5 00 00 00 jmp 80105cba <sys_unlink+0x1bc>
}
memset(&de, 0, sizeof(de));
80105c05: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
80105c0c: 00
80105c0d: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80105c14: 00
80105c15: 8d 45 e0 lea -0x20(%ebp),%eax
80105c18: 89 04 24 mov %eax,(%esp)
80105c1b: e8 7e f5 ff ff call 8010519e <memset>
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80105c20: 8b 55 c8 mov -0x38(%ebp),%edx
80105c23: 8d 45 e0 lea -0x20(%ebp),%eax
80105c26: c7 44 24 0c 10 00 00 movl $0x10,0xc(%esp)
80105c2d: 00
80105c2e: 89 54 24 08 mov %edx,0x8(%esp)
80105c32: 89 44 24 04 mov %eax,0x4(%esp)
80105c36: 8b 45 f4 mov -0xc(%ebp),%eax
80105c39: 89 04 24 mov %eax,(%esp)
80105c3c: e8 9f c2 ff ff call 80101ee0 <writei>
80105c41: 83 f8 10 cmp $0x10,%eax
80105c44: 74 0c je 80105c52 <sys_unlink+0x154>
panic("unlink: writei");
80105c46: c7 04 24 40 8a 10 80 movl $0x80108a40,(%esp)
80105c4d: e8 e8 a8 ff ff call 8010053a <panic>
if(ip->type == T_DIR){
80105c52: 8b 45 f0 mov -0x10(%ebp),%eax
80105c55: 0f b7 40 10 movzwl 0x10(%eax),%eax
80105c59: 66 83 f8 01 cmp $0x1,%ax
80105c5d: 75 1c jne 80105c7b <sys_unlink+0x17d>
dp->nlink--;
80105c5f: 8b 45 f4 mov -0xc(%ebp),%eax
80105c62: 0f b7 40 16 movzwl 0x16(%eax),%eax
80105c66: 8d 50 ff lea -0x1(%eax),%edx
80105c69: 8b 45 f4 mov -0xc(%ebp),%eax
80105c6c: 66 89 50 16 mov %dx,0x16(%eax)
iupdate(dp);
80105c70: 8b 45 f4 mov -0xc(%ebp),%eax
80105c73: 89 04 24 mov %eax,(%esp)
80105c76: e8 40 ba ff ff call 801016bb <iupdate>
}
iunlockput(dp);
80105c7b: 8b 45 f4 mov -0xc(%ebp),%eax
80105c7e: 89 04 24 mov %eax,(%esp)
80105c81: e8 7c be ff ff call 80101b02 <iunlockput>
ip->nlink--;
80105c86: 8b 45 f0 mov -0x10(%ebp),%eax
80105c89: 0f b7 40 16 movzwl 0x16(%eax),%eax
80105c8d: 8d 50 ff lea -0x1(%eax),%edx
80105c90: 8b 45 f0 mov -0x10(%ebp),%eax
80105c93: 66 89 50 16 mov %dx,0x16(%eax)
iupdate(ip);
80105c97: 8b 45 f0 mov -0x10(%ebp),%eax
80105c9a: 89 04 24 mov %eax,(%esp)
80105c9d: e8 19 ba ff ff call 801016bb <iupdate>
iunlockput(ip);
80105ca2: 8b 45 f0 mov -0x10(%ebp),%eax
80105ca5: 89 04 24 mov %eax,(%esp)
80105ca8: e8 55 be ff ff call 80101b02 <iunlockput>
commit_trans();
80105cad: e8 a9 d5 ff ff call 8010325b <commit_trans>
return 0;
80105cb2: b8 00 00 00 00 mov $0x0,%eax
80105cb7: eb 16 jmp 80105ccf <sys_unlink+0x1d1>
// Cannot unlink "." or "..".
if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0)
goto bad;
if((ip = dirlookup(dp, name, &off)) == 0)
goto bad;
80105cb9: 90 nop
commit_trans();
return 0;
bad:
iunlockput(dp);
80105cba: 8b 45 f4 mov -0xc(%ebp),%eax
80105cbd: 89 04 24 mov %eax,(%esp)
80105cc0: e8 3d be ff ff call 80101b02 <iunlockput>
commit_trans();
80105cc5: e8 91 d5 ff ff call 8010325b <commit_trans>
return -1;
80105cca: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105ccf: c9 leave
80105cd0: c3 ret
80105cd1 <create>:
static struct inode*
create(char *path, short type, short major, short minor)
{
80105cd1: 55 push %ebp
80105cd2: 89 e5 mov %esp,%ebp
80105cd4: 83 ec 48 sub $0x48,%esp
80105cd7: 8b 4d 0c mov 0xc(%ebp),%ecx
80105cda: 8b 55 10 mov 0x10(%ebp),%edx
80105cdd: 8b 45 14 mov 0x14(%ebp),%eax
80105ce0: 66 89 4d d4 mov %cx,-0x2c(%ebp)
80105ce4: 66 89 55 d0 mov %dx,-0x30(%ebp)
80105ce8: 66 89 45 cc mov %ax,-0x34(%ebp)
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
80105cec: 8d 45 de lea -0x22(%ebp),%eax
80105cef: 89 44 24 04 mov %eax,0x4(%esp)
80105cf3: 8b 45 08 mov 0x8(%ebp),%eax
80105cf6: 89 04 24 mov %eax,(%esp)
80105cf9: e8 47 c7 ff ff call 80102445 <nameiparent>
80105cfe: 89 45 f4 mov %eax,-0xc(%ebp)
80105d01: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80105d05: 75 0a jne 80105d11 <create+0x40>
return 0;
80105d07: b8 00 00 00 00 mov $0x0,%eax
80105d0c: e9 7e 01 00 00 jmp 80105e8f <create+0x1be>
ilock(dp);
80105d11: 8b 45 f4 mov -0xc(%ebp),%eax
80105d14: 89 04 24 mov %eax,(%esp)
80105d17: e8 5f bb ff ff call 8010187b <ilock>
if((ip = dirlookup(dp, name, &off)) != 0){
80105d1c: 8d 45 ec lea -0x14(%ebp),%eax
80105d1f: 89 44 24 08 mov %eax,0x8(%esp)
80105d23: 8d 45 de lea -0x22(%ebp),%eax
80105d26: 89 44 24 04 mov %eax,0x4(%esp)
80105d2a: 8b 45 f4 mov -0xc(%ebp),%eax
80105d2d: 89 04 24 mov %eax,(%esp)
80105d30: e8 65 c3 ff ff call 8010209a <dirlookup>
80105d35: 89 45 f0 mov %eax,-0x10(%ebp)
80105d38: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80105d3c: 74 47 je 80105d85 <create+0xb4>
iunlockput(dp);
80105d3e: 8b 45 f4 mov -0xc(%ebp),%eax
80105d41: 89 04 24 mov %eax,(%esp)
80105d44: e8 b9 bd ff ff call 80101b02 <iunlockput>
ilock(ip);
80105d49: 8b 45 f0 mov -0x10(%ebp),%eax
80105d4c: 89 04 24 mov %eax,(%esp)
80105d4f: e8 27 bb ff ff call 8010187b <ilock>
if(type == T_FILE && ip->type == T_FILE)
80105d54: 66 83 7d d4 02 cmpw $0x2,-0x2c(%ebp)
80105d59: 75 15 jne 80105d70 <create+0x9f>
80105d5b: 8b 45 f0 mov -0x10(%ebp),%eax
80105d5e: 0f b7 40 10 movzwl 0x10(%eax),%eax
80105d62: 66 83 f8 02 cmp $0x2,%ax
80105d66: 75 08 jne 80105d70 <create+0x9f>
return ip;
80105d68: 8b 45 f0 mov -0x10(%ebp),%eax
80105d6b: e9 1f 01 00 00 jmp 80105e8f <create+0x1be>
iunlockput(ip);
80105d70: 8b 45 f0 mov -0x10(%ebp),%eax
80105d73: 89 04 24 mov %eax,(%esp)
80105d76: e8 87 bd ff ff call 80101b02 <iunlockput>
return 0;
80105d7b: b8 00 00 00 00 mov $0x0,%eax
80105d80: e9 0a 01 00 00 jmp 80105e8f <create+0x1be>
}
if((ip = ialloc(dp->dev, type)) == 0)
80105d85: 0f bf 55 d4 movswl -0x2c(%ebp),%edx
80105d89: 8b 45 f4 mov -0xc(%ebp),%eax
80105d8c: 8b 00 mov (%eax),%eax
80105d8e: 89 54 24 04 mov %edx,0x4(%esp)
80105d92: 89 04 24 mov %eax,(%esp)
80105d95: e8 44 b8 ff ff call 801015de <ialloc>
80105d9a: 89 45 f0 mov %eax,-0x10(%ebp)
80105d9d: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80105da1: 75 0c jne 80105daf <create+0xde>
panic("create: ialloc");
80105da3: c7 04 24 4f 8a 10 80 movl $0x80108a4f,(%esp)
80105daa: e8 8b a7 ff ff call 8010053a <panic>
ilock(ip);
80105daf: 8b 45 f0 mov -0x10(%ebp),%eax
80105db2: 89 04 24 mov %eax,(%esp)
80105db5: e8 c1 ba ff ff call 8010187b <ilock>
ip->major = major;
80105dba: 8b 45 f0 mov -0x10(%ebp),%eax
80105dbd: 0f b7 55 d0 movzwl -0x30(%ebp),%edx
80105dc1: 66 89 50 12 mov %dx,0x12(%eax)
ip->minor = minor;
80105dc5: 8b 45 f0 mov -0x10(%ebp),%eax
80105dc8: 0f b7 55 cc movzwl -0x34(%ebp),%edx
80105dcc: 66 89 50 14 mov %dx,0x14(%eax)
ip->nlink = 1;
80105dd0: 8b 45 f0 mov -0x10(%ebp),%eax
80105dd3: 66 c7 40 16 01 00 movw $0x1,0x16(%eax)
iupdate(ip);
80105dd9: 8b 45 f0 mov -0x10(%ebp),%eax
80105ddc: 89 04 24 mov %eax,(%esp)
80105ddf: e8 d7 b8 ff ff call 801016bb <iupdate>
if(type == T_DIR){ // Create . and .. entries.
80105de4: 66 83 7d d4 01 cmpw $0x1,-0x2c(%ebp)
80105de9: 75 6a jne 80105e55 <create+0x184>
dp->nlink++; // for ".."
80105deb: 8b 45 f4 mov -0xc(%ebp),%eax
80105dee: 0f b7 40 16 movzwl 0x16(%eax),%eax
80105df2: 8d 50 01 lea 0x1(%eax),%edx
80105df5: 8b 45 f4 mov -0xc(%ebp),%eax
80105df8: 66 89 50 16 mov %dx,0x16(%eax)
iupdate(dp);
80105dfc: 8b 45 f4 mov -0xc(%ebp),%eax
80105dff: 89 04 24 mov %eax,(%esp)
80105e02: e8 b4 b8 ff ff call 801016bb <iupdate>
// No ip->nlink++ for ".": avoid cyclic ref count.
if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
80105e07: 8b 45 f0 mov -0x10(%ebp),%eax
80105e0a: 8b 40 04 mov 0x4(%eax),%eax
80105e0d: 89 44 24 08 mov %eax,0x8(%esp)
80105e11: c7 44 24 04 29 8a 10 movl $0x80108a29,0x4(%esp)
80105e18: 80
80105e19: 8b 45 f0 mov -0x10(%ebp),%eax
80105e1c: 89 04 24 mov %eax,(%esp)
80105e1f: e8 3e c3 ff ff call 80102162 <dirlink>
80105e24: 85 c0 test %eax,%eax
80105e26: 78 21 js 80105e49 <create+0x178>
80105e28: 8b 45 f4 mov -0xc(%ebp),%eax
80105e2b: 8b 40 04 mov 0x4(%eax),%eax
80105e2e: 89 44 24 08 mov %eax,0x8(%esp)
80105e32: c7 44 24 04 2b 8a 10 movl $0x80108a2b,0x4(%esp)
80105e39: 80
80105e3a: 8b 45 f0 mov -0x10(%ebp),%eax
80105e3d: 89 04 24 mov %eax,(%esp)
80105e40: e8 1d c3 ff ff call 80102162 <dirlink>
80105e45: 85 c0 test %eax,%eax
80105e47: 79 0c jns 80105e55 <create+0x184>
panic("create dots");
80105e49: c7 04 24 5e 8a 10 80 movl $0x80108a5e,(%esp)
80105e50: e8 e5 a6 ff ff call 8010053a <panic>
}
if(dirlink(dp, name, ip->inum) < 0)
80105e55: 8b 45 f0 mov -0x10(%ebp),%eax
80105e58: 8b 40 04 mov 0x4(%eax),%eax
80105e5b: 89 44 24 08 mov %eax,0x8(%esp)
80105e5f: 8d 45 de lea -0x22(%ebp),%eax
80105e62: 89 44 24 04 mov %eax,0x4(%esp)
80105e66: 8b 45 f4 mov -0xc(%ebp),%eax
80105e69: 89 04 24 mov %eax,(%esp)
80105e6c: e8 f1 c2 ff ff call 80102162 <dirlink>
80105e71: 85 c0 test %eax,%eax
80105e73: 79 0c jns 80105e81 <create+0x1b0>
panic("create: dirlink");
80105e75: c7 04 24 6a 8a 10 80 movl $0x80108a6a,(%esp)
80105e7c: e8 b9 a6 ff ff call 8010053a <panic>
iunlockput(dp);
80105e81: 8b 45 f4 mov -0xc(%ebp),%eax
80105e84: 89 04 24 mov %eax,(%esp)
80105e87: e8 76 bc ff ff call 80101b02 <iunlockput>
return ip;
80105e8c: 8b 45 f0 mov -0x10(%ebp),%eax
}
80105e8f: c9 leave
80105e90: c3 ret
80105e91 <sys_open>:
int
sys_open(void)
{
80105e91: 55 push %ebp
80105e92: 89 e5 mov %esp,%ebp
80105e94: 83 ec 38 sub $0x38,%esp
char *path;
int fd, omode;
struct file *f;
struct inode *ip;
if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
80105e97: 8d 45 e8 lea -0x18(%ebp),%eax
80105e9a: 89 44 24 04 mov %eax,0x4(%esp)
80105e9e: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80105ea5: e8 e1 f6 ff ff call 8010558b <argstr>
80105eaa: 85 c0 test %eax,%eax
80105eac: 78 17 js 80105ec5 <sys_open+0x34>
80105eae: 8d 45 e4 lea -0x1c(%ebp),%eax
80105eb1: 89 44 24 04 mov %eax,0x4(%esp)
80105eb5: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80105ebc: e8 39 f6 ff ff call 801054fa <argint>
80105ec1: 85 c0 test %eax,%eax
80105ec3: 79 0a jns 80105ecf <sys_open+0x3e>
return -1;
80105ec5: b8 ff ff ff ff mov $0xffffffff,%eax
80105eca: e9 46 01 00 00 jmp 80106015 <sys_open+0x184>
if(omode & O_CREATE){
80105ecf: 8b 45 e4 mov -0x1c(%ebp),%eax
80105ed2: 25 00 02 00 00 and $0x200,%eax
80105ed7: 85 c0 test %eax,%eax
80105ed9: 74 40 je 80105f1b <sys_open+0x8a>
begin_trans();
80105edb: e8 32 d3 ff ff call 80103212 <begin_trans>
ip = create(path, T_FILE, 0, 0);
80105ee0: 8b 45 e8 mov -0x18(%ebp),%eax
80105ee3: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
80105eea: 00
80105eeb: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80105ef2: 00
80105ef3: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp)
80105efa: 00
80105efb: 89 04 24 mov %eax,(%esp)
80105efe: e8 ce fd ff ff call 80105cd1 <create>
80105f03: 89 45 f4 mov %eax,-0xc(%ebp)
commit_trans();
80105f06: e8 50 d3 ff ff call 8010325b <commit_trans>
if(ip == 0)
80105f0b: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80105f0f: 75 5c jne 80105f6d <sys_open+0xdc>
return -1;
80105f11: b8 ff ff ff ff mov $0xffffffff,%eax
80105f16: e9 fa 00 00 00 jmp 80106015 <sys_open+0x184>
} else {
if((ip = namei(path)) == 0)
80105f1b: 8b 45 e8 mov -0x18(%ebp),%eax
80105f1e: 89 04 24 mov %eax,(%esp)
80105f21: e8 fd c4 ff ff call 80102423 <namei>
80105f26: 89 45 f4 mov %eax,-0xc(%ebp)
80105f29: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80105f2d: 75 0a jne 80105f39 <sys_open+0xa8>
return -1;
80105f2f: b8 ff ff ff ff mov $0xffffffff,%eax
80105f34: e9 dc 00 00 00 jmp 80106015 <sys_open+0x184>
ilock(ip);
80105f39: 8b 45 f4 mov -0xc(%ebp),%eax
80105f3c: 89 04 24 mov %eax,(%esp)
80105f3f: e8 37 b9 ff ff call 8010187b <ilock>
if(ip->type == T_DIR && omode != O_RDONLY){
80105f44: 8b 45 f4 mov -0xc(%ebp),%eax
80105f47: 0f b7 40 10 movzwl 0x10(%eax),%eax
80105f4b: 66 83 f8 01 cmp $0x1,%ax
80105f4f: 75 1c jne 80105f6d <sys_open+0xdc>
80105f51: 8b 45 e4 mov -0x1c(%ebp),%eax
80105f54: 85 c0 test %eax,%eax
80105f56: 74 15 je 80105f6d <sys_open+0xdc>
iunlockput(ip);
80105f58: 8b 45 f4 mov -0xc(%ebp),%eax
80105f5b: 89 04 24 mov %eax,(%esp)
80105f5e: e8 9f bb ff ff call 80101b02 <iunlockput>
return -1;
80105f63: b8 ff ff ff ff mov $0xffffffff,%eax
80105f68: e9 a8 00 00 00 jmp 80106015 <sys_open+0x184>
}
}
if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
80105f6d: e8 b2 af ff ff call 80100f24 <filealloc>
80105f72: 89 45 f0 mov %eax,-0x10(%ebp)
80105f75: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80105f79: 74 14 je 80105f8f <sys_open+0xfe>
80105f7b: 8b 45 f0 mov -0x10(%ebp),%eax
80105f7e: 89 04 24 mov %eax,(%esp)
80105f81: e8 43 f7 ff ff call 801056c9 <fdalloc>
80105f86: 89 45 ec mov %eax,-0x14(%ebp)
80105f89: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80105f8d: 79 23 jns 80105fb2 <sys_open+0x121>
if(f)
80105f8f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80105f93: 74 0b je 80105fa0 <sys_open+0x10f>
fileclose(f);
80105f95: 8b 45 f0 mov -0x10(%ebp),%eax
80105f98: 89 04 24 mov %eax,(%esp)
80105f9b: e8 2d b0 ff ff call 80100fcd <fileclose>
iunlockput(ip);
80105fa0: 8b 45 f4 mov -0xc(%ebp),%eax
80105fa3: 89 04 24 mov %eax,(%esp)
80105fa6: e8 57 bb ff ff call 80101b02 <iunlockput>
return -1;
80105fab: b8 ff ff ff ff mov $0xffffffff,%eax
80105fb0: eb 63 jmp 80106015 <sys_open+0x184>
}
iunlock(ip);
80105fb2: 8b 45 f4 mov -0xc(%ebp),%eax
80105fb5: 89 04 24 mov %eax,(%esp)
80105fb8: e8 0f ba ff ff call 801019cc <iunlock>
f->type = FD_INODE;
80105fbd: 8b 45 f0 mov -0x10(%ebp),%eax
80105fc0: c7 00 02 00 00 00 movl $0x2,(%eax)
f->ip = ip;
80105fc6: 8b 45 f0 mov -0x10(%ebp),%eax
80105fc9: 8b 55 f4 mov -0xc(%ebp),%edx
80105fcc: 89 50 10 mov %edx,0x10(%eax)
f->off = 0;
80105fcf: 8b 45 f0 mov -0x10(%ebp),%eax
80105fd2: c7 40 14 00 00 00 00 movl $0x0,0x14(%eax)
f->readable = !(omode & O_WRONLY);
80105fd9: 8b 45 e4 mov -0x1c(%ebp),%eax
80105fdc: 83 e0 01 and $0x1,%eax
80105fdf: 85 c0 test %eax,%eax
80105fe1: 0f 94 c2 sete %dl
80105fe4: 8b 45 f0 mov -0x10(%ebp),%eax
80105fe7: 88 50 08 mov %dl,0x8(%eax)
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80105fea: 8b 45 e4 mov -0x1c(%ebp),%eax
80105fed: 83 e0 01 and $0x1,%eax
80105ff0: 84 c0 test %al,%al
80105ff2: 75 0a jne 80105ffe <sys_open+0x16d>
80105ff4: 8b 45 e4 mov -0x1c(%ebp),%eax
80105ff7: 83 e0 02 and $0x2,%eax
80105ffa: 85 c0 test %eax,%eax
80105ffc: 74 07 je 80106005 <sys_open+0x174>
80105ffe: b8 01 00 00 00 mov $0x1,%eax
80106003: eb 05 jmp 8010600a <sys_open+0x179>
80106005: b8 00 00 00 00 mov $0x0,%eax
8010600a: 89 c2 mov %eax,%edx
8010600c: 8b 45 f0 mov -0x10(%ebp),%eax
8010600f: 88 50 09 mov %dl,0x9(%eax)
return fd;
80106012: 8b 45 ec mov -0x14(%ebp),%eax
}
80106015: c9 leave
80106016: c3 ret
80106017 <sys_mkdir>:
int
sys_mkdir(void)
{
80106017: 55 push %ebp
80106018: 89 e5 mov %esp,%ebp
8010601a: 83 ec 28 sub $0x28,%esp
char *path;
struct inode *ip;
begin_trans();
8010601d: e8 f0 d1 ff ff call 80103212 <begin_trans>
if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
80106022: 8d 45 f0 lea -0x10(%ebp),%eax
80106025: 89 44 24 04 mov %eax,0x4(%esp)
80106029: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80106030: e8 56 f5 ff ff call 8010558b <argstr>
80106035: 85 c0 test %eax,%eax
80106037: 78 2c js 80106065 <sys_mkdir+0x4e>
80106039: 8b 45 f0 mov -0x10(%ebp),%eax
8010603c: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
80106043: 00
80106044: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
8010604b: 00
8010604c: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80106053: 00
80106054: 89 04 24 mov %eax,(%esp)
80106057: e8 75 fc ff ff call 80105cd1 <create>
8010605c: 89 45 f4 mov %eax,-0xc(%ebp)
8010605f: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80106063: 75 0c jne 80106071 <sys_mkdir+0x5a>
commit_trans();
80106065: e8 f1 d1 ff ff call 8010325b <commit_trans>
return -1;
8010606a: b8 ff ff ff ff mov $0xffffffff,%eax
8010606f: eb 15 jmp 80106086 <sys_mkdir+0x6f>
}
iunlockput(ip);
80106071: 8b 45 f4 mov -0xc(%ebp),%eax
80106074: 89 04 24 mov %eax,(%esp)
80106077: e8 86 ba ff ff call 80101b02 <iunlockput>
commit_trans();
8010607c: e8 da d1 ff ff call 8010325b <commit_trans>
return 0;
80106081: b8 00 00 00 00 mov $0x0,%eax
}
80106086: c9 leave
80106087: c3 ret
80106088 <sys_mknod>:
int
sys_mknod(void)
{
80106088: 55 push %ebp
80106089: 89 e5 mov %esp,%ebp
8010608b: 83 ec 38 sub $0x38,%esp
struct inode *ip;
char *path;
int len;
int major, minor;
begin_trans();
8010608e: e8 7f d1 ff ff call 80103212 <begin_trans>
if((len=argstr(0, &path)) < 0 ||
80106093: 8d 45 ec lea -0x14(%ebp),%eax
80106096: 89 44 24 04 mov %eax,0x4(%esp)
8010609a: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801060a1: e8 e5 f4 ff ff call 8010558b <argstr>
801060a6: 89 45 f4 mov %eax,-0xc(%ebp)
801060a9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801060ad: 78 5e js 8010610d <sys_mknod+0x85>
argint(1, &major) < 0 ||
801060af: 8d 45 e8 lea -0x18(%ebp),%eax
801060b2: 89 44 24 04 mov %eax,0x4(%esp)
801060b6: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801060bd: e8 38 f4 ff ff call 801054fa <argint>
char *path;
int len;
int major, minor;
begin_trans();
if((len=argstr(0, &path)) < 0 ||
801060c2: 85 c0 test %eax,%eax
801060c4: 78 47 js 8010610d <sys_mknod+0x85>
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
801060c6: 8d 45 e4 lea -0x1c(%ebp),%eax
801060c9: 89 44 24 04 mov %eax,0x4(%esp)
801060cd: c7 04 24 02 00 00 00 movl $0x2,(%esp)
801060d4: e8 21 f4 ff ff call 801054fa <argint>
char *path;
int len;
int major, minor;
begin_trans();
if((len=argstr(0, &path)) < 0 ||
801060d9: 85 c0 test %eax,%eax
801060db: 78 30 js 8010610d <sys_mknod+0x85>
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
(ip = create(path, T_DEV, major, minor)) == 0){
801060dd: 8b 45 e4 mov -0x1c(%ebp),%eax
801060e0: 0f bf c8 movswl %ax,%ecx
801060e3: 8b 45 e8 mov -0x18(%ebp),%eax
801060e6: 0f bf d0 movswl %ax,%edx
801060e9: 8b 45 ec mov -0x14(%ebp),%eax
801060ec: 89 4c 24 0c mov %ecx,0xc(%esp)
801060f0: 89 54 24 08 mov %edx,0x8(%esp)
801060f4: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
801060fb: 00
801060fc: 89 04 24 mov %eax,(%esp)
801060ff: e8 cd fb ff ff call 80105cd1 <create>
char *path;
int len;
int major, minor;
begin_trans();
if((len=argstr(0, &path)) < 0 ||
80106104: 89 45 f0 mov %eax,-0x10(%ebp)
80106107: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
8010610b: 75 0c jne 80106119 <sys_mknod+0x91>
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
(ip = create(path, T_DEV, major, minor)) == 0){
commit_trans();
8010610d: e8 49 d1 ff ff call 8010325b <commit_trans>
return -1;
80106112: b8 ff ff ff ff mov $0xffffffff,%eax
80106117: eb 15 jmp 8010612e <sys_mknod+0xa6>
}
iunlockput(ip);
80106119: 8b 45 f0 mov -0x10(%ebp),%eax
8010611c: 89 04 24 mov %eax,(%esp)
8010611f: e8 de b9 ff ff call 80101b02 <iunlockput>
commit_trans();
80106124: e8 32 d1 ff ff call 8010325b <commit_trans>
return 0;
80106129: b8 00 00 00 00 mov $0x0,%eax
}
8010612e: c9 leave
8010612f: c3 ret
80106130 <sys_chdir>:
int
sys_chdir(void)
{
80106130: 55 push %ebp
80106131: 89 e5 mov %esp,%ebp
80106133: 83 ec 28 sub $0x28,%esp
char *path;
struct inode *ip;
if(argstr(0, &path) < 0 || (ip = namei(path)) == 0)
80106136: 8d 45 f0 lea -0x10(%ebp),%eax
80106139: 89 44 24 04 mov %eax,0x4(%esp)
8010613d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80106144: e8 42 f4 ff ff call 8010558b <argstr>
80106149: 85 c0 test %eax,%eax
8010614b: 78 14 js 80106161 <sys_chdir+0x31>
8010614d: 8b 45 f0 mov -0x10(%ebp),%eax
80106150: 89 04 24 mov %eax,(%esp)
80106153: e8 cb c2 ff ff call 80102423 <namei>
80106158: 89 45 f4 mov %eax,-0xc(%ebp)
8010615b: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8010615f: 75 07 jne 80106168 <sys_chdir+0x38>
return -1;
80106161: b8 ff ff ff ff mov $0xffffffff,%eax
80106166: eb 57 jmp 801061bf <sys_chdir+0x8f>
ilock(ip);
80106168: 8b 45 f4 mov -0xc(%ebp),%eax
8010616b: 89 04 24 mov %eax,(%esp)
8010616e: e8 08 b7 ff ff call 8010187b <ilock>
if(ip->type != T_DIR){
80106173: 8b 45 f4 mov -0xc(%ebp),%eax
80106176: 0f b7 40 10 movzwl 0x10(%eax),%eax
8010617a: 66 83 f8 01 cmp $0x1,%ax
8010617e: 74 12 je 80106192 <sys_chdir+0x62>
iunlockput(ip);
80106180: 8b 45 f4 mov -0xc(%ebp),%eax
80106183: 89 04 24 mov %eax,(%esp)
80106186: e8 77 b9 ff ff call 80101b02 <iunlockput>
return -1;
8010618b: b8 ff ff ff ff mov $0xffffffff,%eax
80106190: eb 2d jmp 801061bf <sys_chdir+0x8f>
}
iunlock(ip);
80106192: 8b 45 f4 mov -0xc(%ebp),%eax
80106195: 89 04 24 mov %eax,(%esp)
80106198: e8 2f b8 ff ff call 801019cc <iunlock>
iput(proc->cwd);
8010619d: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801061a3: 8b 40 68 mov 0x68(%eax),%eax
801061a6: 89 04 24 mov %eax,(%esp)
801061a9: e8 83 b8 ff ff call 80101a31 <iput>
proc->cwd = ip;
801061ae: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801061b4: 8b 55 f4 mov -0xc(%ebp),%edx
801061b7: 89 50 68 mov %edx,0x68(%eax)
return 0;
801061ba: b8 00 00 00 00 mov $0x0,%eax
}
801061bf: c9 leave
801061c0: c3 ret
801061c1 <sys_exec>:
int
sys_exec(void)
{
801061c1: 55 push %ebp
801061c2: 89 e5 mov %esp,%ebp
801061c4: 81 ec a8 00 00 00 sub $0xa8,%esp
char *path, *argv[MAXARG];
int i;
uint uargv, uarg;
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
801061ca: 8d 45 f0 lea -0x10(%ebp),%eax
801061cd: 89 44 24 04 mov %eax,0x4(%esp)
801061d1: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801061d8: e8 ae f3 ff ff call 8010558b <argstr>
801061dd: 85 c0 test %eax,%eax
801061df: 78 1a js 801061fb <sys_exec+0x3a>
801061e1: 8d 85 6c ff ff ff lea -0x94(%ebp),%eax
801061e7: 89 44 24 04 mov %eax,0x4(%esp)
801061eb: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801061f2: e8 03 f3 ff ff call 801054fa <argint>
801061f7: 85 c0 test %eax,%eax
801061f9: 79 0a jns 80106205 <sys_exec+0x44>
return -1;
801061fb: b8 ff ff ff ff mov $0xffffffff,%eax
80106200: e9 cd 00 00 00 jmp 801062d2 <sys_exec+0x111>
}
memset(argv, 0, sizeof(argv));
80106205: c7 44 24 08 80 00 00 movl $0x80,0x8(%esp)
8010620c: 00
8010620d: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106214: 00
80106215: 8d 85 70 ff ff ff lea -0x90(%ebp),%eax
8010621b: 89 04 24 mov %eax,(%esp)
8010621e: e8 7b ef ff ff call 8010519e <memset>
for(i=0;; i++){
80106223: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
if(i >= NELEM(argv))
8010622a: 8b 45 f4 mov -0xc(%ebp),%eax
8010622d: 83 f8 1f cmp $0x1f,%eax
80106230: 76 0a jbe 8010623c <sys_exec+0x7b>
return -1;
80106232: b8 ff ff ff ff mov $0xffffffff,%eax
80106237: e9 96 00 00 00 jmp 801062d2 <sys_exec+0x111>
if(fetchint(uargv+4*i, (int*)&uarg) < 0)
8010623c: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
80106242: 8b 55 f4 mov -0xc(%ebp),%edx
80106245: c1 e2 02 shl $0x2,%edx
80106248: 89 d1 mov %edx,%ecx
8010624a: 8b 95 6c ff ff ff mov -0x94(%ebp),%edx
80106250: 8d 14 11 lea (%ecx,%edx,1),%edx
80106253: 89 44 24 04 mov %eax,0x4(%esp)
80106257: 89 14 24 mov %edx,(%esp)
8010625a: e8 fd f1 ff ff call 8010545c <fetchint>
8010625f: 85 c0 test %eax,%eax
80106261: 79 07 jns 8010626a <sys_exec+0xa9>
return -1;
80106263: b8 ff ff ff ff mov $0xffffffff,%eax
80106268: eb 68 jmp 801062d2 <sys_exec+0x111>
if(uarg == 0){
8010626a: 8b 85 68 ff ff ff mov -0x98(%ebp),%eax
80106270: 85 c0 test %eax,%eax
80106272: 75 26 jne 8010629a <sys_exec+0xd9>
argv[i] = 0;
80106274: 8b 45 f4 mov -0xc(%ebp),%eax
80106277: c7 84 85 70 ff ff ff movl $0x0,-0x90(%ebp,%eax,4)
8010627e: 00 00 00 00
break;
80106282: 90 nop
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
80106283: 8b 45 f0 mov -0x10(%ebp),%eax
80106286: 8d 95 70 ff ff ff lea -0x90(%ebp),%edx
8010628c: 89 54 24 04 mov %edx,0x4(%esp)
80106290: 89 04 24 mov %eax,(%esp)
80106293: e8 60 a8 ff ff call 80100af8 <exec>
80106298: eb 38 jmp 801062d2 <sys_exec+0x111>
return -1;
if(uarg == 0){
argv[i] = 0;
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
8010629a: 8b 45 f4 mov -0xc(%ebp),%eax
8010629d: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
801062a4: 8d 85 70 ff ff ff lea -0x90(%ebp),%eax
801062aa: 01 d0 add %edx,%eax
801062ac: 8b 95 68 ff ff ff mov -0x98(%ebp),%edx
801062b2: 89 44 24 04 mov %eax,0x4(%esp)
801062b6: 89 14 24 mov %edx,(%esp)
801062b9: e8 d8 f1 ff ff call 80105496 <fetchstr>
801062be: 85 c0 test %eax,%eax
801062c0: 79 07 jns 801062c9 <sys_exec+0x108>
return -1;
801062c2: b8 ff ff ff ff mov $0xffffffff,%eax
801062c7: eb 09 jmp 801062d2 <sys_exec+0x111>
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
return -1;
}
memset(argv, 0, sizeof(argv));
for(i=0;; i++){
801062c9: 83 45 f4 01 addl $0x1,-0xc(%ebp)
argv[i] = 0;
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
801062cd: e9 58 ff ff ff jmp 8010622a <sys_exec+0x69>
return exec(path, argv);
}
801062d2: c9 leave
801062d3: c3 ret
801062d4 <sys_pipe>:
int
sys_pipe(void)
{
801062d4: 55 push %ebp
801062d5: 89 e5 mov %esp,%ebp
801062d7: 83 ec 38 sub $0x38,%esp
int *fd;
struct file *rf, *wf;
int fd0, fd1;
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
801062da: 8d 45 ec lea -0x14(%ebp),%eax
801062dd: c7 44 24 08 08 00 00 movl $0x8,0x8(%esp)
801062e4: 00
801062e5: 89 44 24 04 mov %eax,0x4(%esp)
801062e9: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801062f0: e8 34 f2 ff ff call 80105529 <argptr>
801062f5: 85 c0 test %eax,%eax
801062f7: 79 0a jns 80106303 <sys_pipe+0x2f>
return -1;
801062f9: b8 ff ff ff ff mov $0xffffffff,%eax
801062fe: e9 9b 00 00 00 jmp 8010639e <sys_pipe+0xca>
if(pipealloc(&rf, &wf) < 0)
80106303: 8d 45 e4 lea -0x1c(%ebp),%eax
80106306: 89 44 24 04 mov %eax,0x4(%esp)
8010630a: 8d 45 e8 lea -0x18(%ebp),%eax
8010630d: 89 04 24 mov %eax,(%esp)
80106310: e8 ef d8 ff ff call 80103c04 <pipealloc>
80106315: 85 c0 test %eax,%eax
80106317: 79 07 jns 80106320 <sys_pipe+0x4c>
return -1;
80106319: b8 ff ff ff ff mov $0xffffffff,%eax
8010631e: eb 7e jmp 8010639e <sys_pipe+0xca>
fd0 = -1;
80106320: c7 45 f0 ff ff ff ff movl $0xffffffff,-0x10(%ebp)
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
80106327: 8b 45 e8 mov -0x18(%ebp),%eax
8010632a: 89 04 24 mov %eax,(%esp)
8010632d: e8 97 f3 ff ff call 801056c9 <fdalloc>
80106332: 89 45 f0 mov %eax,-0x10(%ebp)
80106335: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80106339: 78 14 js 8010634f <sys_pipe+0x7b>
8010633b: 8b 45 e4 mov -0x1c(%ebp),%eax
8010633e: 89 04 24 mov %eax,(%esp)
80106341: e8 83 f3 ff ff call 801056c9 <fdalloc>
80106346: 89 45 f4 mov %eax,-0xc(%ebp)
80106349: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8010634d: 79 37 jns 80106386 <sys_pipe+0xb2>
if(fd0 >= 0)
8010634f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80106353: 78 14 js 80106369 <sys_pipe+0x95>
proc->ofile[fd0] = 0;
80106355: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010635b: 8b 55 f0 mov -0x10(%ebp),%edx
8010635e: 83 c2 08 add $0x8,%edx
80106361: c7 44 90 08 00 00 00 movl $0x0,0x8(%eax,%edx,4)
80106368: 00
fileclose(rf);
80106369: 8b 45 e8 mov -0x18(%ebp),%eax
8010636c: 89 04 24 mov %eax,(%esp)
8010636f: e8 59 ac ff ff call 80100fcd <fileclose>
fileclose(wf);
80106374: 8b 45 e4 mov -0x1c(%ebp),%eax
80106377: 89 04 24 mov %eax,(%esp)
8010637a: e8 4e ac ff ff call 80100fcd <fileclose>
return -1;
8010637f: b8 ff ff ff ff mov $0xffffffff,%eax
80106384: eb 18 jmp 8010639e <sys_pipe+0xca>
}
fd[0] = fd0;
80106386: 8b 45 ec mov -0x14(%ebp),%eax
80106389: 8b 55 f0 mov -0x10(%ebp),%edx
8010638c: 89 10 mov %edx,(%eax)
fd[1] = fd1;
8010638e: 8b 45 ec mov -0x14(%ebp),%eax
80106391: 8d 50 04 lea 0x4(%eax),%edx
80106394: 8b 45 f4 mov -0xc(%ebp),%eax
80106397: 89 02 mov %eax,(%edx)
return 0;
80106399: b8 00 00 00 00 mov $0x0,%eax
}
8010639e: c9 leave
8010639f: c3 ret
801063a0 <sys_fork>:
#include "mmu.h"
#include "proc.h"
int
sys_fork(void)
{
801063a0: 55 push %ebp
801063a1: 89 e5 mov %esp,%ebp
801063a3: 83 ec 08 sub $0x8,%esp
return fork();
801063a6: e8 92 df ff ff call 8010433d <fork>
}
801063ab: c9 leave
801063ac: c3 ret
801063ad <sys_clone>:
int
sys_clone(){
801063ad: 55 push %ebp
801063ae: 89 e5 mov %esp,%ebp
801063b0: 53 push %ebx
801063b1: 83 ec 24 sub $0x24,%esp
int stack;
int size;
int routine;
int arg;
if(argint(1,&size) < 0 || size <=0 || argint(0,&stack) <0 ||
801063b4: 8d 45 f0 lea -0x10(%ebp),%eax
801063b7: 89 44 24 04 mov %eax,0x4(%esp)
801063bb: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801063c2: e8 33 f1 ff ff call 801054fa <argint>
801063c7: 85 c0 test %eax,%eax
801063c9: 78 4c js 80106417 <sys_clone+0x6a>
801063cb: 8b 45 f0 mov -0x10(%ebp),%eax
801063ce: 85 c0 test %eax,%eax
801063d0: 7e 45 jle 80106417 <sys_clone+0x6a>
801063d2: 8d 45 f4 lea -0xc(%ebp),%eax
801063d5: 89 44 24 04 mov %eax,0x4(%esp)
801063d9: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801063e0: e8 15 f1 ff ff call 801054fa <argint>
801063e5: 85 c0 test %eax,%eax
801063e7: 78 2e js 80106417 <sys_clone+0x6a>
argint(2,&routine) < 0 || argint(3,&arg)<0){
801063e9: 8d 45 ec lea -0x14(%ebp),%eax
801063ec: 89 44 24 04 mov %eax,0x4(%esp)
801063f0: c7 04 24 02 00 00 00 movl $0x2,(%esp)
801063f7: e8 fe f0 ff ff call 801054fa <argint>
int stack;
int size;
int routine;
int arg;
if(argint(1,&size) < 0 || size <=0 || argint(0,&stack) <0 ||
801063fc: 85 c0 test %eax,%eax
801063fe: 78 17 js 80106417 <sys_clone+0x6a>
argint(2,&routine) < 0 || argint(3,&arg)<0){
80106400: 8d 45 e8 lea -0x18(%ebp),%eax
80106403: 89 44 24 04 mov %eax,0x4(%esp)
80106407: c7 04 24 03 00 00 00 movl $0x3,(%esp)
8010640e: e8 e7 f0 ff ff call 801054fa <argint>
int stack;
int size;
int routine;
int arg;
if(argint(1,&size) < 0 || size <=0 || argint(0,&stack) <0 ||
80106413: 85 c0 test %eax,%eax
80106415: 79 07 jns 8010641e <sys_clone+0x71>
argint(2,&routine) < 0 || argint(3,&arg)<0){
return -1;
80106417: b8 ff ff ff ff mov $0xffffffff,%eax
8010641c: eb 20 jmp 8010643e <sys_clone+0x91>
}
return clone(stack,size,routine,arg);
8010641e: 8b 5d e8 mov -0x18(%ebp),%ebx
80106421: 8b 4d ec mov -0x14(%ebp),%ecx
80106424: 8b 55 f0 mov -0x10(%ebp),%edx
80106427: 8b 45 f4 mov -0xc(%ebp),%eax
8010642a: 89 5c 24 0c mov %ebx,0xc(%esp)
8010642e: 89 4c 24 08 mov %ecx,0x8(%esp)
80106432: 89 54 24 04 mov %edx,0x4(%esp)
80106436: 89 04 24 mov %eax,(%esp)
80106439: e8 6f e0 ff ff call 801044ad <clone>
}
8010643e: 83 c4 24 add $0x24,%esp
80106441: 5b pop %ebx
80106442: 5d pop %ebp
80106443: c3 ret
80106444 <sys_exit>:
int
sys_exit(void)
{
80106444: 55 push %ebp
80106445: 89 e5 mov %esp,%ebp
80106447: 83 ec 08 sub $0x8,%esp
exit();
8010644a: e8 81 e2 ff ff call 801046d0 <exit>
return 0; // not reached
8010644f: b8 00 00 00 00 mov $0x0,%eax
}
80106454: c9 leave
80106455: c3 ret
80106456 <sys_texit>:
int
sys_texit(void)
{
80106456: 55 push %ebp
80106457: 89 e5 mov %esp,%ebp
80106459: 83 ec 08 sub $0x8,%esp
texit();
8010645c: e8 8b e3 ff ff call 801047ec <texit>
return 0;
80106461: b8 00 00 00 00 mov $0x0,%eax
}
80106466: c9 leave
80106467: c3 ret
80106468 <sys_wait>:
int
sys_wait(void)
{
80106468: 55 push %ebp
80106469: 89 e5 mov %esp,%ebp
8010646b: 83 ec 08 sub $0x8,%esp
return wait();
8010646e: e8 47 e4 ff ff call 801048ba <wait>
}
80106473: c9 leave
80106474: c3 ret
80106475 <sys_kill>:
int
sys_kill(void)
{
80106475: 55 push %ebp
80106476: 89 e5 mov %esp,%ebp
80106478: 83 ec 28 sub $0x28,%esp
int pid;
if(argint(0, &pid) < 0)
8010647b: 8d 45 f4 lea -0xc(%ebp),%eax
8010647e: 89 44 24 04 mov %eax,0x4(%esp)
80106482: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80106489: e8 6c f0 ff ff call 801054fa <argint>
8010648e: 85 c0 test %eax,%eax
80106490: 79 07 jns 80106499 <sys_kill+0x24>
return -1;
80106492: b8 ff ff ff ff mov $0xffffffff,%eax
80106497: eb 0b jmp 801064a4 <sys_kill+0x2f>
return kill(pid);
80106499: 8b 45 f4 mov -0xc(%ebp),%eax
8010649c: 89 04 24 mov %eax,(%esp)
8010649f: e8 a3 e8 ff ff call 80104d47 <kill>
}
801064a4: c9 leave
801064a5: c3 ret
801064a6 <sys_getpid>:
int
sys_getpid(void)
{
801064a6: 55 push %ebp
801064a7: 89 e5 mov %esp,%ebp
return proc->pid;
801064a9: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801064af: 8b 40 10 mov 0x10(%eax),%eax
}
801064b2: 5d pop %ebp
801064b3: c3 ret
801064b4 <sys_sbrk>:
int
sys_sbrk(void)
{
801064b4: 55 push %ebp
801064b5: 89 e5 mov %esp,%ebp
801064b7: 83 ec 28 sub $0x28,%esp
int addr;
int n;
if(argint(0, &n) < 0)
801064ba: 8d 45 f0 lea -0x10(%ebp),%eax
801064bd: 89 44 24 04 mov %eax,0x4(%esp)
801064c1: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801064c8: e8 2d f0 ff ff call 801054fa <argint>
801064cd: 85 c0 test %eax,%eax
801064cf: 79 07 jns 801064d8 <sys_sbrk+0x24>
return -1;
801064d1: b8 ff ff ff ff mov $0xffffffff,%eax
801064d6: eb 24 jmp 801064fc <sys_sbrk+0x48>
addr = proc->sz;
801064d8: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801064de: 8b 00 mov (%eax),%eax
801064e0: 89 45 f4 mov %eax,-0xc(%ebp)
if(growproc(n) < 0)
801064e3: 8b 45 f0 mov -0x10(%ebp),%eax
801064e6: 89 04 24 mov %eax,(%esp)
801064e9: e8 aa dd ff ff call 80104298 <growproc>
801064ee: 85 c0 test %eax,%eax
801064f0: 79 07 jns 801064f9 <sys_sbrk+0x45>
return -1;
801064f2: b8 ff ff ff ff mov $0xffffffff,%eax
801064f7: eb 03 jmp 801064fc <sys_sbrk+0x48>
return addr;
801064f9: 8b 45 f4 mov -0xc(%ebp),%eax
}
801064fc: c9 leave
801064fd: c3 ret
801064fe <sys_sleep>:
int
sys_sleep(void)
{
801064fe: 55 push %ebp
801064ff: 89 e5 mov %esp,%ebp
80106501: 83 ec 28 sub $0x28,%esp
int n;
uint ticks0;
if(argint(0, &n) < 0)
80106504: 8d 45 f0 lea -0x10(%ebp),%eax
80106507: 89 44 24 04 mov %eax,0x4(%esp)
8010650b: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80106512: e8 e3 ef ff ff call 801054fa <argint>
80106517: 85 c0 test %eax,%eax
80106519: 79 07 jns 80106522 <sys_sleep+0x24>
return -1;
8010651b: b8 ff ff ff ff mov $0xffffffff,%eax
80106520: eb 6c jmp 8010658e <sys_sleep+0x90>
acquire(&tickslock);
80106522: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
80106529: e8 21 ea ff ff call 80104f4f <acquire>
ticks0 = ticks;
8010652e: a1 c0 28 11 80 mov 0x801128c0,%eax
80106533: 89 45 f4 mov %eax,-0xc(%ebp)
while(ticks - ticks0 < n){
80106536: eb 34 jmp 8010656c <sys_sleep+0x6e>
if(proc->killed){
80106538: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010653e: 8b 40 24 mov 0x24(%eax),%eax
80106541: 85 c0 test %eax,%eax
80106543: 74 13 je 80106558 <sys_sleep+0x5a>
release(&tickslock);
80106545: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
8010654c: e8 5f ea ff ff call 80104fb0 <release>
return -1;
80106551: b8 ff ff ff ff mov $0xffffffff,%eax
80106556: eb 36 jmp 8010658e <sys_sleep+0x90>
}
sleep(&ticks, &tickslock);
80106558: c7 44 24 04 80 20 11 movl $0x80112080,0x4(%esp)
8010655f: 80
80106560: c7 04 24 c0 28 11 80 movl $0x801128c0,(%esp)
80106567: e8 6a e6 ff ff call 80104bd6 <sleep>
if(argint(0, &n) < 0)
return -1;
acquire(&tickslock);
ticks0 = ticks;
while(ticks - ticks0 < n){
8010656c: a1 c0 28 11 80 mov 0x801128c0,%eax
80106571: 89 c2 mov %eax,%edx
80106573: 2b 55 f4 sub -0xc(%ebp),%edx
80106576: 8b 45 f0 mov -0x10(%ebp),%eax
80106579: 39 c2 cmp %eax,%edx
8010657b: 72 bb jb 80106538 <sys_sleep+0x3a>
release(&tickslock);
return -1;
}
sleep(&ticks, &tickslock);
}
release(&tickslock);
8010657d: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
80106584: e8 27 ea ff ff call 80104fb0 <release>
return 0;
80106589: b8 00 00 00 00 mov $0x0,%eax
}
8010658e: c9 leave
8010658f: c3 ret
80106590 <sys_uptime>:
// return how many clock tick interrupts have occurred
// since start.
int
sys_uptime(void)
{
80106590: 55 push %ebp
80106591: 89 e5 mov %esp,%ebp
80106593: 83 ec 28 sub $0x28,%esp
uint xticks;
acquire(&tickslock);
80106596: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
8010659d: e8 ad e9 ff ff call 80104f4f <acquire>
xticks = ticks;
801065a2: a1 c0 28 11 80 mov 0x801128c0,%eax
801065a7: 89 45 f4 mov %eax,-0xc(%ebp)
release(&tickslock);
801065aa: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
801065b1: e8 fa e9 ff ff call 80104fb0 <release>
return xticks;
801065b6: 8b 45 f4 mov -0xc(%ebp),%eax
}
801065b9: c9 leave
801065ba: c3 ret
801065bb <sys_tsleep>:
int
sys_tsleep(void)
{
801065bb: 55 push %ebp
801065bc: 89 e5 mov %esp,%ebp
801065be: 83 ec 08 sub $0x8,%esp
tsleep();
801065c1: e8 fa e8 ff ff call 80104ec0 <tsleep>
return 0;
801065c6: b8 00 00 00 00 mov $0x0,%eax
}
801065cb: c9 leave
801065cc: c3 ret
801065cd <sys_twakeup>:
int
sys_twakeup(void)
{
801065cd: 55 push %ebp
801065ce: 89 e5 mov %esp,%ebp
801065d0: 83 ec 28 sub $0x28,%esp
int tid;
if(argint(0,&tid) < 0){
801065d3: 8d 45 f4 lea -0xc(%ebp),%eax
801065d6: 89 44 24 04 mov %eax,0x4(%esp)
801065da: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801065e1: e8 14 ef ff ff call 801054fa <argint>
801065e6: 85 c0 test %eax,%eax
801065e8: 79 07 jns 801065f1 <sys_twakeup+0x24>
return -1;
801065ea: b8 ff ff ff ff mov $0xffffffff,%eax
801065ef: eb 10 jmp 80106601 <sys_twakeup+0x34>
}
twakeup(tid);
801065f1: 8b 45 f4 mov -0xc(%ebp),%eax
801065f4: 89 04 24 mov %eax,(%esp)
801065f7: e8 b7 e6 ff ff call 80104cb3 <twakeup>
return 0;
801065fc: b8 00 00 00 00 mov $0x0,%eax
}
80106601: c9 leave
80106602: c3 ret
80106603 <sys_thread_yield>:
int
sys_thread_yield(void)
{
80106603: 55 push %ebp
80106604: 89 e5 mov %esp,%ebp
80106606: 83 ec 08 sub $0x8,%esp
thread_yield();
80106609: e8 77 e5 ff ff call 80104b85 <thread_yield>
return 0;
8010660e: b8 00 00 00 00 mov $0x0,%eax
}
80106613: c9 leave
80106614: c3 ret
80106615: 00 00 add %al,(%eax)
...
80106618 <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
80106618: 55 push %ebp
80106619: 89 e5 mov %esp,%ebp
8010661b: 83 ec 08 sub $0x8,%esp
8010661e: 8b 55 08 mov 0x8(%ebp),%edx
80106621: 8b 45 0c mov 0xc(%ebp),%eax
80106624: 66 89 55 fc mov %dx,-0x4(%ebp)
80106628: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010662b: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
8010662f: 0f b7 55 fc movzwl -0x4(%ebp),%edx
80106633: ee out %al,(%dx)
}
80106634: c9 leave
80106635: c3 ret
80106636 <timerinit>:
#define TIMER_RATEGEN 0x04 // mode 2, rate generator
#define TIMER_16BIT 0x30 // r/w counter 16 bits, LSB first
void
timerinit(void)
{
80106636: 55 push %ebp
80106637: 89 e5 mov %esp,%ebp
80106639: 83 ec 18 sub $0x18,%esp
// Interrupt 100 times/sec.
outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
8010663c: c7 44 24 04 34 00 00 movl $0x34,0x4(%esp)
80106643: 00
80106644: c7 04 24 43 00 00 00 movl $0x43,(%esp)
8010664b: e8 c8 ff ff ff call 80106618 <outb>
outb(IO_TIMER1, TIMER_DIV(100) % 256);
80106650: c7 44 24 04 9c 00 00 movl $0x9c,0x4(%esp)
80106657: 00
80106658: c7 04 24 40 00 00 00 movl $0x40,(%esp)
8010665f: e8 b4 ff ff ff call 80106618 <outb>
outb(IO_TIMER1, TIMER_DIV(100) / 256);
80106664: c7 44 24 04 2e 00 00 movl $0x2e,0x4(%esp)
8010666b: 00
8010666c: c7 04 24 40 00 00 00 movl $0x40,(%esp)
80106673: e8 a0 ff ff ff call 80106618 <outb>
picenable(IRQ_TIMER);
80106678: c7 04 24 00 00 00 00 movl $0x0,(%esp)
8010667f: e8 09 d4 ff ff call 80103a8d <picenable>
}
80106684: c9 leave
80106685: c3 ret
...
80106688 <alltraps>:
# vectors.S sends all traps here.
.globl alltraps
alltraps:
# Build trap frame.
pushl %ds
80106688: 1e push %ds
pushl %es
80106689: 06 push %es
pushl %fs
8010668a: 0f a0 push %fs
pushl %gs
8010668c: 0f a8 push %gs
pushal
8010668e: 60 pusha
# Set up data and per-cpu segments.
movw $(SEG_KDATA<<3), %ax
8010668f: 66 b8 10 00 mov $0x10,%ax
movw %ax, %ds
80106693: 8e d8 mov %eax,%ds
movw %ax, %es
80106695: 8e c0 mov %eax,%es
movw $(SEG_KCPU<<3), %ax
80106697: 66 b8 18 00 mov $0x18,%ax
movw %ax, %fs
8010669b: 8e e0 mov %eax,%fs
movw %ax, %gs
8010669d: 8e e8 mov %eax,%gs
# Call trap(tf), where tf=%esp
pushl %esp
8010669f: 54 push %esp
call trap
801066a0: e8 d5 01 00 00 call 8010687a <trap>
addl $4, %esp
801066a5: 83 c4 04 add $0x4,%esp
801066a8 <trapret>:
# Return falls through to trapret...
.globl trapret
trapret:
popal
801066a8: 61 popa
popl %gs
801066a9: 0f a9 pop %gs
popl %fs
801066ab: 0f a1 pop %fs
popl %es
801066ad: 07 pop %es
popl %ds
801066ae: 1f pop %ds
addl $0x8, %esp # trapno and errcode
801066af: 83 c4 08 add $0x8,%esp
iret
801066b2: cf iret
...
801066b4 <lidt>:
struct gatedesc;
static inline void
lidt(struct gatedesc *p, int size)
{
801066b4: 55 push %ebp
801066b5: 89 e5 mov %esp,%ebp
801066b7: 83 ec 10 sub $0x10,%esp
volatile ushort pd[3];
pd[0] = size-1;
801066ba: 8b 45 0c mov 0xc(%ebp),%eax
801066bd: 83 e8 01 sub $0x1,%eax
801066c0: 66 89 45 fa mov %ax,-0x6(%ebp)
pd[1] = (uint)p;
801066c4: 8b 45 08 mov 0x8(%ebp),%eax
801066c7: 66 89 45 fc mov %ax,-0x4(%ebp)
pd[2] = (uint)p >> 16;
801066cb: 8b 45 08 mov 0x8(%ebp),%eax
801066ce: c1 e8 10 shr $0x10,%eax
801066d1: 66 89 45 fe mov %ax,-0x2(%ebp)
asm volatile("lidt (%0)" : : "r" (pd));
801066d5: 8d 45 fa lea -0x6(%ebp),%eax
801066d8: 0f 01 18 lidtl (%eax)
}
801066db: c9 leave
801066dc: c3 ret
801066dd <rcr2>:
return result;
}
static inline uint
rcr2(void)
{
801066dd: 55 push %ebp
801066de: 89 e5 mov %esp,%ebp
801066e0: 83 ec 10 sub $0x10,%esp
uint val;
asm volatile("movl %%cr2,%0" : "=r" (val));
801066e3: 0f 20 d0 mov %cr2,%eax
801066e6: 89 45 fc mov %eax,-0x4(%ebp)
return val;
801066e9: 8b 45 fc mov -0x4(%ebp),%eax
}
801066ec: c9 leave
801066ed: c3 ret
801066ee <tvinit>:
struct spinlock tickslock;
uint ticks;
void
tvinit(void)
{
801066ee: 55 push %ebp
801066ef: 89 e5 mov %esp,%ebp
801066f1: 83 ec 28 sub $0x28,%esp
int i;
for(i = 0; i < 256; i++)
801066f4: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
801066fb: e9 bf 00 00 00 jmp 801067bf <tvinit+0xd1>
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
80106700: 8b 45 f4 mov -0xc(%ebp),%eax
80106703: 8b 55 f4 mov -0xc(%ebp),%edx
80106706: 8b 14 95 ac b0 10 80 mov -0x7fef4f54(,%edx,4),%edx
8010670d: 66 89 14 c5 c0 20 11 mov %dx,-0x7feedf40(,%eax,8)
80106714: 80
80106715: 8b 45 f4 mov -0xc(%ebp),%eax
80106718: 66 c7 04 c5 c2 20 11 movw $0x8,-0x7feedf3e(,%eax,8)
8010671f: 80 08 00
80106722: 8b 45 f4 mov -0xc(%ebp),%eax
80106725: 0f b6 14 c5 c4 20 11 movzbl -0x7feedf3c(,%eax,8),%edx
8010672c: 80
8010672d: 83 e2 e0 and $0xffffffe0,%edx
80106730: 88 14 c5 c4 20 11 80 mov %dl,-0x7feedf3c(,%eax,8)
80106737: 8b 45 f4 mov -0xc(%ebp),%eax
8010673a: 0f b6 14 c5 c4 20 11 movzbl -0x7feedf3c(,%eax,8),%edx
80106741: 80
80106742: 83 e2 1f and $0x1f,%edx
80106745: 88 14 c5 c4 20 11 80 mov %dl,-0x7feedf3c(,%eax,8)
8010674c: 8b 45 f4 mov -0xc(%ebp),%eax
8010674f: 0f b6 14 c5 c5 20 11 movzbl -0x7feedf3b(,%eax,8),%edx
80106756: 80
80106757: 83 e2 f0 and $0xfffffff0,%edx
8010675a: 83 ca 0e or $0xe,%edx
8010675d: 88 14 c5 c5 20 11 80 mov %dl,-0x7feedf3b(,%eax,8)
80106764: 8b 45 f4 mov -0xc(%ebp),%eax
80106767: 0f b6 14 c5 c5 20 11 movzbl -0x7feedf3b(,%eax,8),%edx
8010676e: 80
8010676f: 83 e2 ef and $0xffffffef,%edx
80106772: 88 14 c5 c5 20 11 80 mov %dl,-0x7feedf3b(,%eax,8)
80106779: 8b 45 f4 mov -0xc(%ebp),%eax
8010677c: 0f b6 14 c5 c5 20 11 movzbl -0x7feedf3b(,%eax,8),%edx
80106783: 80
80106784: 83 e2 9f and $0xffffff9f,%edx
80106787: 88 14 c5 c5 20 11 80 mov %dl,-0x7feedf3b(,%eax,8)
8010678e: 8b 45 f4 mov -0xc(%ebp),%eax
80106791: 0f b6 14 c5 c5 20 11 movzbl -0x7feedf3b(,%eax,8),%edx
80106798: 80
80106799: 83 ca 80 or $0xffffff80,%edx
8010679c: 88 14 c5 c5 20 11 80 mov %dl,-0x7feedf3b(,%eax,8)
801067a3: 8b 45 f4 mov -0xc(%ebp),%eax
801067a6: 8b 55 f4 mov -0xc(%ebp),%edx
801067a9: 8b 14 95 ac b0 10 80 mov -0x7fef4f54(,%edx,4),%edx
801067b0: c1 ea 10 shr $0x10,%edx
801067b3: 66 89 14 c5 c6 20 11 mov %dx,-0x7feedf3a(,%eax,8)
801067ba: 80
void
tvinit(void)
{
int i;
for(i = 0; i < 256; i++)
801067bb: 83 45 f4 01 addl $0x1,-0xc(%ebp)
801067bf: 81 7d f4 ff 00 00 00 cmpl $0xff,-0xc(%ebp)
801067c6: 0f 8e 34 ff ff ff jle 80106700 <tvinit+0x12>
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
801067cc: a1 ac b1 10 80 mov 0x8010b1ac,%eax
801067d1: 66 a3 c0 22 11 80 mov %ax,0x801122c0
801067d7: 66 c7 05 c2 22 11 80 movw $0x8,0x801122c2
801067de: 08 00
801067e0: 0f b6 05 c4 22 11 80 movzbl 0x801122c4,%eax
801067e7: 83 e0 e0 and $0xffffffe0,%eax
801067ea: a2 c4 22 11 80 mov %al,0x801122c4
801067ef: 0f b6 05 c4 22 11 80 movzbl 0x801122c4,%eax
801067f6: 83 e0 1f and $0x1f,%eax
801067f9: a2 c4 22 11 80 mov %al,0x801122c4
801067fe: 0f b6 05 c5 22 11 80 movzbl 0x801122c5,%eax
80106805: 83 c8 0f or $0xf,%eax
80106808: a2 c5 22 11 80 mov %al,0x801122c5
8010680d: 0f b6 05 c5 22 11 80 movzbl 0x801122c5,%eax
80106814: 83 e0 ef and $0xffffffef,%eax
80106817: a2 c5 22 11 80 mov %al,0x801122c5
8010681c: 0f b6 05 c5 22 11 80 movzbl 0x801122c5,%eax
80106823: 83 c8 60 or $0x60,%eax
80106826: a2 c5 22 11 80 mov %al,0x801122c5
8010682b: 0f b6 05 c5 22 11 80 movzbl 0x801122c5,%eax
80106832: 83 c8 80 or $0xffffff80,%eax
80106835: a2 c5 22 11 80 mov %al,0x801122c5
8010683a: a1 ac b1 10 80 mov 0x8010b1ac,%eax
8010683f: c1 e8 10 shr $0x10,%eax
80106842: 66 a3 c6 22 11 80 mov %ax,0x801122c6
initlock(&tickslock, "time");
80106848: c7 44 24 04 7c 8a 10 movl $0x80108a7c,0x4(%esp)
8010684f: 80
80106850: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
80106857: e8 d2 e6 ff ff call 80104f2e <initlock>
}
8010685c: c9 leave
8010685d: c3 ret
8010685e <idtinit>:
void
idtinit(void)
{
8010685e: 55 push %ebp
8010685f: 89 e5 mov %esp,%ebp
80106861: 83 ec 08 sub $0x8,%esp
lidt(idt, sizeof(idt));
80106864: c7 44 24 04 00 08 00 movl $0x800,0x4(%esp)
8010686b: 00
8010686c: c7 04 24 c0 20 11 80 movl $0x801120c0,(%esp)
80106873: e8 3c fe ff ff call 801066b4 <lidt>
}
80106878: c9 leave
80106879: c3 ret
8010687a <trap>:
//PAGEBREAK: 41
void
trap(struct trapframe *tf)
{
8010687a: 55 push %ebp
8010687b: 89 e5 mov %esp,%ebp
8010687d: 57 push %edi
8010687e: 56 push %esi
8010687f: 53 push %ebx
80106880: 83 ec 3c sub $0x3c,%esp
if(tf->trapno == T_SYSCALL){
80106883: 8b 45 08 mov 0x8(%ebp),%eax
80106886: 8b 40 30 mov 0x30(%eax),%eax
80106889: 83 f8 40 cmp $0x40,%eax
8010688c: 75 3e jne 801068cc <trap+0x52>
if(proc->killed)
8010688e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106894: 8b 40 24 mov 0x24(%eax),%eax
80106897: 85 c0 test %eax,%eax
80106899: 74 05 je 801068a0 <trap+0x26>
exit();
8010689b: e8 30 de ff ff call 801046d0 <exit>
proc->tf = tf;
801068a0: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801068a6: 8b 55 08 mov 0x8(%ebp),%edx
801068a9: 89 50 18 mov %edx,0x18(%eax)
syscall();
801068ac: e8 11 ed ff ff call 801055c2 <syscall>
if(proc->killed)
801068b1: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801068b7: 8b 40 24 mov 0x24(%eax),%eax
801068ba: 85 c0 test %eax,%eax
801068bc: 0f 84 34 02 00 00 je 80106af6 <trap+0x27c>
exit();
801068c2: e8 09 de ff ff call 801046d0 <exit>
return;
801068c7: e9 2b 02 00 00 jmp 80106af7 <trap+0x27d>
}
switch(tf->trapno){
801068cc: 8b 45 08 mov 0x8(%ebp),%eax
801068cf: 8b 40 30 mov 0x30(%eax),%eax
801068d2: 83 e8 20 sub $0x20,%eax
801068d5: 83 f8 1f cmp $0x1f,%eax
801068d8: 0f 87 bc 00 00 00 ja 8010699a <trap+0x120>
801068de: 8b 04 85 24 8b 10 80 mov -0x7fef74dc(,%eax,4),%eax
801068e5: ff e0 jmp *%eax
case T_IRQ0 + IRQ_TIMER:
if(cpu->id == 0){
801068e7: 65 a1 00 00 00 00 mov %gs:0x0,%eax
801068ed: 0f b6 00 movzbl (%eax),%eax
801068f0: 84 c0 test %al,%al
801068f2: 75 31 jne 80106925 <trap+0xab>
acquire(&tickslock);
801068f4: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
801068fb: e8 4f e6 ff ff call 80104f4f <acquire>
ticks++;
80106900: a1 c0 28 11 80 mov 0x801128c0,%eax
80106905: 83 c0 01 add $0x1,%eax
80106908: a3 c0 28 11 80 mov %eax,0x801128c0
wakeup(&ticks);
8010690d: c7 04 24 c0 28 11 80 movl $0x801128c0,(%esp)
80106914: e8 03 e4 ff ff call 80104d1c <wakeup>
release(&tickslock);
80106919: c7 04 24 80 20 11 80 movl $0x80112080,(%esp)
80106920: e8 8b e6 ff ff call 80104fb0 <release>
}
lapiceoi();
80106925: e8 b6 c5 ff ff call 80102ee0 <lapiceoi>
break;
8010692a: e9 41 01 00 00 jmp 80106a70 <trap+0x1f6>
case T_IRQ0 + IRQ_IDE:
ideintr();
8010692f: e8 c7 bd ff ff call 801026fb <ideintr>
lapiceoi();
80106934: e8 a7 c5 ff ff call 80102ee0 <lapiceoi>
break;
80106939: e9 32 01 00 00 jmp 80106a70 <trap+0x1f6>
case T_IRQ0 + IRQ_IDE+1:
// Bochs generates spurious IDE1 interrupts.
break;
case T_IRQ0 + IRQ_KBD:
kbdintr();
8010693e: e8 80 c3 ff ff call 80102cc3 <kbdintr>
lapiceoi();
80106943: e8 98 c5 ff ff call 80102ee0 <lapiceoi>
break;
80106948: e9 23 01 00 00 jmp 80106a70 <trap+0x1f6>
case T_IRQ0 + IRQ_COM1:
uartintr();
8010694d: e8 9d 03 00 00 call 80106cef <uartintr>
lapiceoi();
80106952: e8 89 c5 ff ff call 80102ee0 <lapiceoi>
break;
80106957: e9 14 01 00 00 jmp 80106a70 <trap+0x1f6>
case T_IRQ0 + 7:
case T_IRQ0 + IRQ_SPURIOUS:
cprintf("cpu%d: spurious interrupt at %x:%x\n",
8010695c: 8b 45 08 mov 0x8(%ebp),%eax
8010695f: 8b 48 38 mov 0x38(%eax),%ecx
cpu->id, tf->cs, tf->eip);
80106962: 8b 45 08 mov 0x8(%ebp),%eax
80106965: 0f b7 40 3c movzwl 0x3c(%eax),%eax
uartintr();
lapiceoi();
break;
case T_IRQ0 + 7:
case T_IRQ0 + IRQ_SPURIOUS:
cprintf("cpu%d: spurious interrupt at %x:%x\n",
80106969: 0f b7 d0 movzwl %ax,%edx
cpu->id, tf->cs, tf->eip);
8010696c: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80106972: 0f b6 00 movzbl (%eax),%eax
uartintr();
lapiceoi();
break;
case T_IRQ0 + 7:
case T_IRQ0 + IRQ_SPURIOUS:
cprintf("cpu%d: spurious interrupt at %x:%x\n",
80106975: 0f b6 c0 movzbl %al,%eax
80106978: 89 4c 24 0c mov %ecx,0xc(%esp)
8010697c: 89 54 24 08 mov %edx,0x8(%esp)
80106980: 89 44 24 04 mov %eax,0x4(%esp)
80106984: c7 04 24 84 8a 10 80 movl $0x80108a84,(%esp)
8010698b: e8 0a 9a ff ff call 8010039a <cprintf>
cpu->id, tf->cs, tf->eip);
lapiceoi();
80106990: e8 4b c5 ff ff call 80102ee0 <lapiceoi>
break;
80106995: e9 d6 00 00 00 jmp 80106a70 <trap+0x1f6>
//PAGEBREAK: 13
default:
if(proc == 0 || (tf->cs&3) == 0){
8010699a: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801069a0: 85 c0 test %eax,%eax
801069a2: 74 11 je 801069b5 <trap+0x13b>
801069a4: 8b 45 08 mov 0x8(%ebp),%eax
801069a7: 0f b7 40 3c movzwl 0x3c(%eax),%eax
801069ab: 0f b7 c0 movzwl %ax,%eax
801069ae: 83 e0 03 and $0x3,%eax
801069b1: 85 c0 test %eax,%eax
801069b3: 75 46 jne 801069fb <trap+0x181>
// In kernel, it must be our mistake.
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
801069b5: e8 23 fd ff ff call 801066dd <rcr2>
801069ba: 8b 55 08 mov 0x8(%ebp),%edx
801069bd: 8b 5a 38 mov 0x38(%edx),%ebx
tf->trapno, cpu->id, tf->eip, rcr2());
801069c0: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
801069c7: 0f b6 12 movzbl (%edx),%edx
//PAGEBREAK: 13
default:
if(proc == 0 || (tf->cs&3) == 0){
// In kernel, it must be our mistake.
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
801069ca: 0f b6 ca movzbl %dl,%ecx
801069cd: 8b 55 08 mov 0x8(%ebp),%edx
801069d0: 8b 52 30 mov 0x30(%edx),%edx
801069d3: 89 44 24 10 mov %eax,0x10(%esp)
801069d7: 89 5c 24 0c mov %ebx,0xc(%esp)
801069db: 89 4c 24 08 mov %ecx,0x8(%esp)
801069df: 89 54 24 04 mov %edx,0x4(%esp)
801069e3: c7 04 24 a8 8a 10 80 movl $0x80108aa8,(%esp)
801069ea: e8 ab 99 ff ff call 8010039a <cprintf>
tf->trapno, cpu->id, tf->eip, rcr2());
panic("trap");
801069ef: c7 04 24 da 8a 10 80 movl $0x80108ada,(%esp)
801069f6: e8 3f 9b ff ff call 8010053a <panic>
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
801069fb: e8 dd fc ff ff call 801066dd <rcr2>
80106a00: 89 c2 mov %eax,%edx
80106a02: 8b 45 08 mov 0x8(%ebp),%eax
80106a05: 8b 78 38 mov 0x38(%eax),%edi
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
80106a08: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80106a0e: 0f b6 00 movzbl (%eax),%eax
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
tf->trapno, cpu->id, tf->eip, rcr2());
panic("trap");
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
80106a11: 0f b6 f0 movzbl %al,%esi
80106a14: 8b 45 08 mov 0x8(%ebp),%eax
80106a17: 8b 58 34 mov 0x34(%eax),%ebx
80106a1a: 8b 45 08 mov 0x8(%ebp),%eax
80106a1d: 8b 48 30 mov 0x30(%eax),%ecx
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
80106a20: 65 a1 04 00 00 00 mov %gs:0x4,%eax
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
tf->trapno, cpu->id, tf->eip, rcr2());
panic("trap");
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
80106a26: 83 c0 6c add $0x6c,%eax
80106a29: 89 45 e4 mov %eax,-0x1c(%ebp)
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
80106a2c: 65 a1 04 00 00 00 mov %gs:0x4,%eax
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
tf->trapno, cpu->id, tf->eip, rcr2());
panic("trap");
}
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
80106a32: 8b 40 10 mov 0x10(%eax),%eax
80106a35: 89 54 24 1c mov %edx,0x1c(%esp)
80106a39: 89 7c 24 18 mov %edi,0x18(%esp)
80106a3d: 89 74 24 14 mov %esi,0x14(%esp)
80106a41: 89 5c 24 10 mov %ebx,0x10(%esp)
80106a45: 89 4c 24 0c mov %ecx,0xc(%esp)
80106a49: 8b 55 e4 mov -0x1c(%ebp),%edx
80106a4c: 89 54 24 08 mov %edx,0x8(%esp)
80106a50: 89 44 24 04 mov %eax,0x4(%esp)
80106a54: c7 04 24 e0 8a 10 80 movl $0x80108ae0,(%esp)
80106a5b: e8 3a 99 ff ff call 8010039a <cprintf>
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
rcr2());
proc->killed = 1;
80106a60: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106a66: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax)
80106a6d: eb 01 jmp 80106a70 <trap+0x1f6>
ideintr();
lapiceoi();
break;
case T_IRQ0 + IRQ_IDE+1:
// Bochs generates spurious IDE1 interrupts.
break;
80106a6f: 90 nop
}
// Force process exit if it has been killed and is in user space.
// (If it is still executing in the kernel, let it keep running
// until it gets to the regular system call return.)
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
80106a70: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106a76: 85 c0 test %eax,%eax
80106a78: 74 24 je 80106a9e <trap+0x224>
80106a7a: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106a80: 8b 40 24 mov 0x24(%eax),%eax
80106a83: 85 c0 test %eax,%eax
80106a85: 74 17 je 80106a9e <trap+0x224>
80106a87: 8b 45 08 mov 0x8(%ebp),%eax
80106a8a: 0f b7 40 3c movzwl 0x3c(%eax),%eax
80106a8e: 0f b7 c0 movzwl %ax,%eax
80106a91: 83 e0 03 and $0x3,%eax
80106a94: 83 f8 03 cmp $0x3,%eax
80106a97: 75 05 jne 80106a9e <trap+0x224>
exit();
80106a99: e8 32 dc ff ff call 801046d0 <exit>
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.
if(proc && proc->state == RUNNING && tf->trapno == T_IRQ0+IRQ_TIMER)
80106a9e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106aa4: 85 c0 test %eax,%eax
80106aa6: 74 1e je 80106ac6 <trap+0x24c>
80106aa8: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106aae: 8b 40 0c mov 0xc(%eax),%eax
80106ab1: 83 f8 04 cmp $0x4,%eax
80106ab4: 75 10 jne 80106ac6 <trap+0x24c>
80106ab6: 8b 45 08 mov 0x8(%ebp),%eax
80106ab9: 8b 40 30 mov 0x30(%eax),%eax
80106abc: 83 f8 20 cmp $0x20,%eax
80106abf: 75 05 jne 80106ac6 <trap+0x24c>
yield();
80106ac1: e8 8d e0 ff ff call 80104b53 <yield>
// Check if the process has been killed since we yielded
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
80106ac6: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106acc: 85 c0 test %eax,%eax
80106ace: 74 27 je 80106af7 <trap+0x27d>
80106ad0: 65 a1 04 00 00 00 mov %gs:0x4,%eax
80106ad6: 8b 40 24 mov 0x24(%eax),%eax
80106ad9: 85 c0 test %eax,%eax
80106adb: 74 1a je 80106af7 <trap+0x27d>
80106add: 8b 45 08 mov 0x8(%ebp),%eax
80106ae0: 0f b7 40 3c movzwl 0x3c(%eax),%eax
80106ae4: 0f b7 c0 movzwl %ax,%eax
80106ae7: 83 e0 03 and $0x3,%eax
80106aea: 83 f8 03 cmp $0x3,%eax
80106aed: 75 08 jne 80106af7 <trap+0x27d>
exit();
80106aef: e8 dc db ff ff call 801046d0 <exit>
80106af4: eb 01 jmp 80106af7 <trap+0x27d>
exit();
proc->tf = tf;
syscall();
if(proc->killed)
exit();
return;
80106af6: 90 nop
yield();
// Check if the process has been killed since we yielded
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
exit();
}
80106af7: 83 c4 3c add $0x3c,%esp
80106afa: 5b pop %ebx
80106afb: 5e pop %esi
80106afc: 5f pop %edi
80106afd: 5d pop %ebp
80106afe: c3 ret
...
80106b00 <inb>:
// Routines to let C code use special x86 instructions.
static inline uchar
inb(ushort port)
{
80106b00: 55 push %ebp
80106b01: 89 e5 mov %esp,%ebp
80106b03: 83 ec 14 sub $0x14,%esp
80106b06: 8b 45 08 mov 0x8(%ebp),%eax
80106b09: 66 89 45 ec mov %ax,-0x14(%ebp)
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80106b0d: 0f b7 45 ec movzwl -0x14(%ebp),%eax
80106b11: 89 c2 mov %eax,%edx
80106b13: ec in (%dx),%al
80106b14: 88 45 ff mov %al,-0x1(%ebp)
return data;
80106b17: 0f b6 45 ff movzbl -0x1(%ebp),%eax
}
80106b1b: c9 leave
80106b1c: c3 ret
80106b1d <outb>:
"memory", "cc");
}
static inline void
outb(ushort port, uchar data)
{
80106b1d: 55 push %ebp
80106b1e: 89 e5 mov %esp,%ebp
80106b20: 83 ec 08 sub $0x8,%esp
80106b23: 8b 55 08 mov 0x8(%ebp),%edx
80106b26: 8b 45 0c mov 0xc(%ebp),%eax
80106b29: 66 89 55 fc mov %dx,-0x4(%ebp)
80106b2d: 88 45 f8 mov %al,-0x8(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80106b30: 0f b6 45 f8 movzbl -0x8(%ebp),%eax
80106b34: 0f b7 55 fc movzwl -0x4(%ebp),%edx
80106b38: ee out %al,(%dx)
}
80106b39: c9 leave
80106b3a: c3 ret
80106b3b <uartinit>:
static int uart; // is there a uart?
void
uartinit(void)
{
80106b3b: 55 push %ebp
80106b3c: 89 e5 mov %esp,%ebp
80106b3e: 83 ec 28 sub $0x28,%esp
char *p;
// Turn off the FIFO
outb(COM1+2, 0);
80106b41: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106b48: 00
80106b49: c7 04 24 fa 03 00 00 movl $0x3fa,(%esp)
80106b50: e8 c8 ff ff ff call 80106b1d <outb>
// 9600 baud, 8 data bits, 1 stop bit, parity off.
outb(COM1+3, 0x80); // Unlock divisor
80106b55: c7 44 24 04 80 00 00 movl $0x80,0x4(%esp)
80106b5c: 00
80106b5d: c7 04 24 fb 03 00 00 movl $0x3fb,(%esp)
80106b64: e8 b4 ff ff ff call 80106b1d <outb>
outb(COM1+0, 115200/9600);
80106b69: c7 44 24 04 0c 00 00 movl $0xc,0x4(%esp)
80106b70: 00
80106b71: c7 04 24 f8 03 00 00 movl $0x3f8,(%esp)
80106b78: e8 a0 ff ff ff call 80106b1d <outb>
outb(COM1+1, 0);
80106b7d: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106b84: 00
80106b85: c7 04 24 f9 03 00 00 movl $0x3f9,(%esp)
80106b8c: e8 8c ff ff ff call 80106b1d <outb>
outb(COM1+3, 0x03); // Lock divisor, 8 data bits.
80106b91: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
80106b98: 00
80106b99: c7 04 24 fb 03 00 00 movl $0x3fb,(%esp)
80106ba0: e8 78 ff ff ff call 80106b1d <outb>
outb(COM1+4, 0);
80106ba5: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106bac: 00
80106bad: c7 04 24 fc 03 00 00 movl $0x3fc,(%esp)
80106bb4: e8 64 ff ff ff call 80106b1d <outb>
outb(COM1+1, 0x01); // Enable receive interrupts.
80106bb9: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
80106bc0: 00
80106bc1: c7 04 24 f9 03 00 00 movl $0x3f9,(%esp)
80106bc8: e8 50 ff ff ff call 80106b1d <outb>
// If status is 0xFF, no serial port.
if(inb(COM1+5) == 0xFF)
80106bcd: c7 04 24 fd 03 00 00 movl $0x3fd,(%esp)
80106bd4: e8 27 ff ff ff call 80106b00 <inb>
80106bd9: 3c ff cmp $0xff,%al
80106bdb: 74 6c je 80106c49 <uartinit+0x10e>
return;
uart = 1;
80106bdd: c7 05 6c b6 10 80 01 movl $0x1,0x8010b66c
80106be4: 00 00 00
// Acknowledge pre-existing interrupt conditions;
// enable interrupts.
inb(COM1+2);
80106be7: c7 04 24 fa 03 00 00 movl $0x3fa,(%esp)
80106bee: e8 0d ff ff ff call 80106b00 <inb>
inb(COM1+0);
80106bf3: c7 04 24 f8 03 00 00 movl $0x3f8,(%esp)
80106bfa: e8 01 ff ff ff call 80106b00 <inb>
picenable(IRQ_COM1);
80106bff: c7 04 24 04 00 00 00 movl $0x4,(%esp)
80106c06: e8 82 ce ff ff call 80103a8d <picenable>
ioapicenable(IRQ_COM1, 0);
80106c0b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80106c12: 00
80106c13: c7 04 24 04 00 00 00 movl $0x4,(%esp)
80106c1a: e8 5f bd ff ff call 8010297e <ioapicenable>
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
80106c1f: c7 45 f4 a4 8b 10 80 movl $0x80108ba4,-0xc(%ebp)
80106c26: eb 15 jmp 80106c3d <uartinit+0x102>
uartputc(*p);
80106c28: 8b 45 f4 mov -0xc(%ebp),%eax
80106c2b: 0f b6 00 movzbl (%eax),%eax
80106c2e: 0f be c0 movsbl %al,%eax
80106c31: 89 04 24 mov %eax,(%esp)
80106c34: e8 13 00 00 00 call 80106c4c <uartputc>
inb(COM1+0);
picenable(IRQ_COM1);
ioapicenable(IRQ_COM1, 0);
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
80106c39: 83 45 f4 01 addl $0x1,-0xc(%ebp)
80106c3d: 8b 45 f4 mov -0xc(%ebp),%eax
80106c40: 0f b6 00 movzbl (%eax),%eax
80106c43: 84 c0 test %al,%al
80106c45: 75 e1 jne 80106c28 <uartinit+0xed>
80106c47: eb 01 jmp 80106c4a <uartinit+0x10f>
outb(COM1+4, 0);
outb(COM1+1, 0x01); // Enable receive interrupts.
// If status is 0xFF, no serial port.
if(inb(COM1+5) == 0xFF)
return;
80106c49: 90 nop
ioapicenable(IRQ_COM1, 0);
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
uartputc(*p);
}
80106c4a: c9 leave
80106c4b: c3 ret
80106c4c <uartputc>:
void
uartputc(int c)
{
80106c4c: 55 push %ebp
80106c4d: 89 e5 mov %esp,%ebp
80106c4f: 83 ec 28 sub $0x28,%esp
int i;
if(!uart)
80106c52: a1 6c b6 10 80 mov 0x8010b66c,%eax
80106c57: 85 c0 test %eax,%eax
80106c59: 74 4d je 80106ca8 <uartputc+0x5c>
return;
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
80106c5b: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
80106c62: eb 10 jmp 80106c74 <uartputc+0x28>
microdelay(10);
80106c64: c7 04 24 0a 00 00 00 movl $0xa,(%esp)
80106c6b: e8 95 c2 ff ff call 80102f05 <microdelay>
{
int i;
if(!uart)
return;
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
80106c70: 83 45 f4 01 addl $0x1,-0xc(%ebp)
80106c74: 83 7d f4 7f cmpl $0x7f,-0xc(%ebp)
80106c78: 7f 16 jg 80106c90 <uartputc+0x44>
80106c7a: c7 04 24 fd 03 00 00 movl $0x3fd,(%esp)
80106c81: e8 7a fe ff ff call 80106b00 <inb>
80106c86: 0f b6 c0 movzbl %al,%eax
80106c89: 83 e0 20 and $0x20,%eax
80106c8c: 85 c0 test %eax,%eax
80106c8e: 74 d4 je 80106c64 <uartputc+0x18>
microdelay(10);
outb(COM1+0, c);
80106c90: 8b 45 08 mov 0x8(%ebp),%eax
80106c93: 0f b6 c0 movzbl %al,%eax
80106c96: 89 44 24 04 mov %eax,0x4(%esp)
80106c9a: c7 04 24 f8 03 00 00 movl $0x3f8,(%esp)
80106ca1: e8 77 fe ff ff call 80106b1d <outb>
80106ca6: eb 01 jmp 80106ca9 <uartputc+0x5d>
uartputc(int c)
{
int i;
if(!uart)
return;
80106ca8: 90 nop
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
microdelay(10);
outb(COM1+0, c);
}
80106ca9: c9 leave
80106caa: c3 ret
80106cab <uartgetc>:
static int
uartgetc(void)
{
80106cab: 55 push %ebp
80106cac: 89 e5 mov %esp,%ebp
80106cae: 83 ec 04 sub $0x4,%esp
if(!uart)
80106cb1: a1 6c b6 10 80 mov 0x8010b66c,%eax
80106cb6: 85 c0 test %eax,%eax
80106cb8: 75 07 jne 80106cc1 <uartgetc+0x16>
return -1;
80106cba: b8 ff ff ff ff mov $0xffffffff,%eax
80106cbf: eb 2c jmp 80106ced <uartgetc+0x42>
if(!(inb(COM1+5) & 0x01))
80106cc1: c7 04 24 fd 03 00 00 movl $0x3fd,(%esp)
80106cc8: e8 33 fe ff ff call 80106b00 <inb>
80106ccd: 0f b6 c0 movzbl %al,%eax
80106cd0: 83 e0 01 and $0x1,%eax
80106cd3: 85 c0 test %eax,%eax
80106cd5: 75 07 jne 80106cde <uartgetc+0x33>
return -1;
80106cd7: b8 ff ff ff ff mov $0xffffffff,%eax
80106cdc: eb 0f jmp 80106ced <uartgetc+0x42>
return inb(COM1+0);
80106cde: c7 04 24 f8 03 00 00 movl $0x3f8,(%esp)
80106ce5: e8 16 fe ff ff call 80106b00 <inb>
80106cea: 0f b6 c0 movzbl %al,%eax
}
80106ced: c9 leave
80106cee: c3 ret
80106cef <uartintr>:
void
uartintr(void)
{
80106cef: 55 push %ebp
80106cf0: 89 e5 mov %esp,%ebp
80106cf2: 83 ec 18 sub $0x18,%esp
consoleintr(uartgetc);
80106cf5: c7 04 24 ab 6c 10 80 movl $0x80106cab,(%esp)
80106cfc: e8 aa 9a ff ff call 801007ab <consoleintr>
}
80106d01: c9 leave
80106d02: c3 ret
...
80106d04 <vector0>:
# generated by vectors.pl - do not edit
# handlers
.globl alltraps
.globl vector0
vector0:
pushl $0
80106d04: 6a 00 push $0x0
pushl $0
80106d06: 6a 00 push $0x0
jmp alltraps
80106d08: e9 7b f9 ff ff jmp 80106688 <alltraps>
80106d0d <vector1>:
.globl vector1
vector1:
pushl $0
80106d0d: 6a 00 push $0x0
pushl $1
80106d0f: 6a 01 push $0x1
jmp alltraps
80106d11: e9 72 f9 ff ff jmp 80106688 <alltraps>
80106d16 <vector2>:
.globl vector2
vector2:
pushl $0
80106d16: 6a 00 push $0x0
pushl $2
80106d18: 6a 02 push $0x2
jmp alltraps
80106d1a: e9 69 f9 ff ff jmp 80106688 <alltraps>
80106d1f <vector3>:
.globl vector3
vector3:
pushl $0
80106d1f: 6a 00 push $0x0
pushl $3
80106d21: 6a 03 push $0x3
jmp alltraps
80106d23: e9 60 f9 ff ff jmp 80106688 <alltraps>
80106d28 <vector4>:
.globl vector4
vector4:
pushl $0
80106d28: 6a 00 push $0x0
pushl $4
80106d2a: 6a 04 push $0x4
jmp alltraps
80106d2c: e9 57 f9 ff ff jmp 80106688 <alltraps>
80106d31 <vector5>:
.globl vector5
vector5:
pushl $0
80106d31: 6a 00 push $0x0
pushl $5
80106d33: 6a 05 push $0x5
jmp alltraps
80106d35: e9 4e f9 ff ff jmp 80106688 <alltraps>
80106d3a <vector6>:
.globl vector6
vector6:
pushl $0
80106d3a: 6a 00 push $0x0
pushl $6
80106d3c: 6a 06 push $0x6
jmp alltraps
80106d3e: e9 45 f9 ff ff jmp 80106688 <alltraps>
80106d43 <vector7>:
.globl vector7
vector7:
pushl $0
80106d43: 6a 00 push $0x0
pushl $7
80106d45: 6a 07 push $0x7
jmp alltraps
80106d47: e9 3c f9 ff ff jmp 80106688 <alltraps>
80106d4c <vector8>:
.globl vector8
vector8:
pushl $8
80106d4c: 6a 08 push $0x8
jmp alltraps
80106d4e: e9 35 f9 ff ff jmp 80106688 <alltraps>
80106d53 <vector9>:
.globl vector9
vector9:
pushl $0
80106d53: 6a 00 push $0x0
pushl $9
80106d55: 6a 09 push $0x9
jmp alltraps
80106d57: e9 2c f9 ff ff jmp 80106688 <alltraps>
80106d5c <vector10>:
.globl vector10
vector10:
pushl $10
80106d5c: 6a 0a push $0xa
jmp alltraps
80106d5e: e9 25 f9 ff ff jmp 80106688 <alltraps>
80106d63 <vector11>:
.globl vector11
vector11:
pushl $11
80106d63: 6a 0b push $0xb
jmp alltraps
80106d65: e9 1e f9 ff ff jmp 80106688 <alltraps>
80106d6a <vector12>:
.globl vector12
vector12:
pushl $12
80106d6a: 6a 0c push $0xc
jmp alltraps
80106d6c: e9 17 f9 ff ff jmp 80106688 <alltraps>
80106d71 <vector13>:
.globl vector13
vector13:
pushl $13
80106d71: 6a 0d push $0xd
jmp alltraps
80106d73: e9 10 f9 ff ff jmp 80106688 <alltraps>
80106d78 <vector14>:
.globl vector14
vector14:
pushl $14
80106d78: 6a 0e push $0xe
jmp alltraps
80106d7a: e9 09 f9 ff ff jmp 80106688 <alltraps>
80106d7f <vector15>:
.globl vector15
vector15:
pushl $0
80106d7f: 6a 00 push $0x0
pushl $15
80106d81: 6a 0f push $0xf
jmp alltraps
80106d83: e9 00 f9 ff ff jmp 80106688 <alltraps>
80106d88 <vector16>:
.globl vector16
vector16:
pushl $0
80106d88: 6a 00 push $0x0
pushl $16
80106d8a: 6a 10 push $0x10
jmp alltraps
80106d8c: e9 f7 f8 ff ff jmp 80106688 <alltraps>
80106d91 <vector17>:
.globl vector17
vector17:
pushl $17
80106d91: 6a 11 push $0x11
jmp alltraps
80106d93: e9 f0 f8 ff ff jmp 80106688 <alltraps>
80106d98 <vector18>:
.globl vector18
vector18:
pushl $0
80106d98: 6a 00 push $0x0
pushl $18
80106d9a: 6a 12 push $0x12
jmp alltraps
80106d9c: e9 e7 f8 ff ff jmp 80106688 <alltraps>
80106da1 <vector19>:
.globl vector19
vector19:
pushl $0
80106da1: 6a 00 push $0x0
pushl $19
80106da3: 6a 13 push $0x13
jmp alltraps
80106da5: e9 de f8 ff ff jmp 80106688 <alltraps>
80106daa <vector20>:
.globl vector20
vector20:
pushl $0
80106daa: 6a 00 push $0x0
pushl $20
80106dac: 6a 14 push $0x14
jmp alltraps
80106dae: e9 d5 f8 ff ff jmp 80106688 <alltraps>
80106db3 <vector21>:
.globl vector21
vector21:
pushl $0
80106db3: 6a 00 push $0x0
pushl $21
80106db5: 6a 15 push $0x15
jmp alltraps
80106db7: e9 cc f8 ff ff jmp 80106688 <alltraps>
80106dbc <vector22>:
.globl vector22
vector22:
pushl $0
80106dbc: 6a 00 push $0x0
pushl $22
80106dbe: 6a 16 push $0x16
jmp alltraps
80106dc0: e9 c3 f8 ff ff jmp 80106688 <alltraps>
80106dc5 <vector23>:
.globl vector23
vector23:
pushl $0
80106dc5: 6a 00 push $0x0
pushl $23
80106dc7: 6a 17 push $0x17
jmp alltraps
80106dc9: e9 ba f8 ff ff jmp 80106688 <alltraps>
80106dce <vector24>:
.globl vector24
vector24:
pushl $0
80106dce: 6a 00 push $0x0
pushl $24
80106dd0: 6a 18 push $0x18
jmp alltraps
80106dd2: e9 b1 f8 ff ff jmp 80106688 <alltraps>
80106dd7 <vector25>:
.globl vector25
vector25:
pushl $0
80106dd7: 6a 00 push $0x0
pushl $25
80106dd9: 6a 19 push $0x19
jmp alltraps
80106ddb: e9 a8 f8 ff ff jmp 80106688 <alltraps>
80106de0 <vector26>:
.globl vector26
vector26:
pushl $0
80106de0: 6a 00 push $0x0
pushl $26
80106de2: 6a 1a push $0x1a
jmp alltraps
80106de4: e9 9f f8 ff ff jmp 80106688 <alltraps>
80106de9 <vector27>:
.globl vector27
vector27:
pushl $0
80106de9: 6a 00 push $0x0
pushl $27
80106deb: 6a 1b push $0x1b
jmp alltraps
80106ded: e9 96 f8 ff ff jmp 80106688 <alltraps>
80106df2 <vector28>:
.globl vector28
vector28:
pushl $0
80106df2: 6a 00 push $0x0
pushl $28
80106df4: 6a 1c push $0x1c
jmp alltraps
80106df6: e9 8d f8 ff ff jmp 80106688 <alltraps>
80106dfb <vector29>:
.globl vector29
vector29:
pushl $0
80106dfb: 6a 00 push $0x0
pushl $29
80106dfd: 6a 1d push $0x1d
jmp alltraps
80106dff: e9 84 f8 ff ff jmp 80106688 <alltraps>
80106e04 <vector30>:
.globl vector30
vector30:
pushl $0
80106e04: 6a 00 push $0x0
pushl $30
80106e06: 6a 1e push $0x1e
jmp alltraps
80106e08: e9 7b f8 ff ff jmp 80106688 <alltraps>
80106e0d <vector31>:
.globl vector31
vector31:
pushl $0
80106e0d: 6a 00 push $0x0
pushl $31
80106e0f: 6a 1f push $0x1f
jmp alltraps
80106e11: e9 72 f8 ff ff jmp 80106688 <alltraps>
80106e16 <vector32>:
.globl vector32
vector32:
pushl $0
80106e16: 6a 00 push $0x0
pushl $32
80106e18: 6a 20 push $0x20
jmp alltraps
80106e1a: e9 69 f8 ff ff jmp 80106688 <alltraps>
80106e1f <vector33>:
.globl vector33
vector33:
pushl $0
80106e1f: 6a 00 push $0x0
pushl $33
80106e21: 6a 21 push $0x21
jmp alltraps
80106e23: e9 60 f8 ff ff jmp 80106688 <alltraps>
80106e28 <vector34>:
.globl vector34
vector34:
pushl $0
80106e28: 6a 00 push $0x0
pushl $34
80106e2a: 6a 22 push $0x22
jmp alltraps
80106e2c: e9 57 f8 ff ff jmp 80106688 <alltraps>
80106e31 <vector35>:
.globl vector35
vector35:
pushl $0
80106e31: 6a 00 push $0x0
pushl $35
80106e33: 6a 23 push $0x23
jmp alltraps
80106e35: e9 4e f8 ff ff jmp 80106688 <alltraps>
80106e3a <vector36>:
.globl vector36
vector36:
pushl $0
80106e3a: 6a 00 push $0x0
pushl $36
80106e3c: 6a 24 push $0x24
jmp alltraps
80106e3e: e9 45 f8 ff ff jmp 80106688 <alltraps>
80106e43 <vector37>:
.globl vector37
vector37:
pushl $0
80106e43: 6a 00 push $0x0
pushl $37
80106e45: 6a 25 push $0x25
jmp alltraps
80106e47: e9 3c f8 ff ff jmp 80106688 <alltraps>
80106e4c <vector38>:
.globl vector38
vector38:
pushl $0
80106e4c: 6a 00 push $0x0
pushl $38
80106e4e: 6a 26 push $0x26
jmp alltraps
80106e50: e9 33 f8 ff ff jmp 80106688 <alltraps>
80106e55 <vector39>:
.globl vector39
vector39:
pushl $0
80106e55: 6a 00 push $0x0
pushl $39
80106e57: 6a 27 push $0x27
jmp alltraps
80106e59: e9 2a f8 ff ff jmp 80106688 <alltraps>
80106e5e <vector40>:
.globl vector40
vector40:
pushl $0
80106e5e: 6a 00 push $0x0
pushl $40
80106e60: 6a 28 push $0x28
jmp alltraps
80106e62: e9 21 f8 ff ff jmp 80106688 <alltraps>
80106e67 <vector41>:
.globl vector41
vector41:
pushl $0
80106e67: 6a 00 push $0x0
pushl $41
80106e69: 6a 29 push $0x29
jmp alltraps
80106e6b: e9 18 f8 ff ff jmp 80106688 <alltraps>
80106e70 <vector42>:
.globl vector42
vector42:
pushl $0
80106e70: 6a 00 push $0x0
pushl $42
80106e72: 6a 2a push $0x2a
jmp alltraps
80106e74: e9 0f f8 ff ff jmp 80106688 <alltraps>
80106e79 <vector43>:
.globl vector43
vector43:
pushl $0
80106e79: 6a 00 push $0x0
pushl $43
80106e7b: 6a 2b push $0x2b
jmp alltraps
80106e7d: e9 06 f8 ff ff jmp 80106688 <alltraps>
80106e82 <vector44>:
.globl vector44
vector44:
pushl $0
80106e82: 6a 00 push $0x0
pushl $44
80106e84: 6a 2c push $0x2c
jmp alltraps
80106e86: e9 fd f7 ff ff jmp 80106688 <alltraps>
80106e8b <vector45>:
.globl vector45
vector45:
pushl $0
80106e8b: 6a 00 push $0x0
pushl $45
80106e8d: 6a 2d push $0x2d
jmp alltraps
80106e8f: e9 f4 f7 ff ff jmp 80106688 <alltraps>
80106e94 <vector46>:
.globl vector46
vector46:
pushl $0
80106e94: 6a 00 push $0x0
pushl $46
80106e96: 6a 2e push $0x2e
jmp alltraps
80106e98: e9 eb f7 ff ff jmp 80106688 <alltraps>
80106e9d <vector47>:
.globl vector47
vector47:
pushl $0
80106e9d: 6a 00 push $0x0
pushl $47
80106e9f: 6a 2f push $0x2f
jmp alltraps
80106ea1: e9 e2 f7 ff ff jmp 80106688 <alltraps>
80106ea6 <vector48>:
.globl vector48
vector48:
pushl $0
80106ea6: 6a 00 push $0x0
pushl $48
80106ea8: 6a 30 push $0x30
jmp alltraps
80106eaa: e9 d9 f7 ff ff jmp 80106688 <alltraps>
80106eaf <vector49>:
.globl vector49
vector49:
pushl $0
80106eaf: 6a 00 push $0x0
pushl $49
80106eb1: 6a 31 push $0x31
jmp alltraps
80106eb3: e9 d0 f7 ff ff jmp 80106688 <alltraps>
80106eb8 <vector50>:
.globl vector50
vector50:
pushl $0
80106eb8: 6a 00 push $0x0
pushl $50
80106eba: 6a 32 push $0x32
jmp alltraps
80106ebc: e9 c7 f7 ff ff jmp 80106688 <alltraps>
80106ec1 <vector51>:
.globl vector51
vector51:
pushl $0
80106ec1: 6a 00 push $0x0
pushl $51
80106ec3: 6a 33 push $0x33
jmp alltraps
80106ec5: e9 be f7 ff ff jmp 80106688 <alltraps>
80106eca <vector52>:
.globl vector52
vector52:
pushl $0
80106eca: 6a 00 push $0x0
pushl $52
80106ecc: 6a 34 push $0x34
jmp alltraps
80106ece: e9 b5 f7 ff ff jmp 80106688 <alltraps>
80106ed3 <vector53>:
.globl vector53
vector53:
pushl $0
80106ed3: 6a 00 push $0x0
pushl $53
80106ed5: 6a 35 push $0x35
jmp alltraps
80106ed7: e9 ac f7 ff ff jmp 80106688 <alltraps>
80106edc <vector54>:
.globl vector54
vector54:
pushl $0
80106edc: 6a 00 push $0x0
pushl $54
80106ede: 6a 36 push $0x36
jmp alltraps
80106ee0: e9 a3 f7 ff ff jmp 80106688 <alltraps>
80106ee5 <vector55>:
.globl vector55
vector55:
pushl $0
80106ee5: 6a 00 push $0x0
pushl $55
80106ee7: 6a 37 push $0x37
jmp alltraps
80106ee9: e9 9a f7 ff ff jmp 80106688 <alltraps>
80106eee <vector56>:
.globl vector56
vector56:
pushl $0
80106eee: 6a 00 push $0x0
pushl $56
80106ef0: 6a 38 push $0x38
jmp alltraps
80106ef2: e9 91 f7 ff ff jmp 80106688 <alltraps>
80106ef7 <vector57>:
.globl vector57
vector57:
pushl $0
80106ef7: 6a 00 push $0x0
pushl $57
80106ef9: 6a 39 push $0x39
jmp alltraps
80106efb: e9 88 f7 ff ff jmp 80106688 <alltraps>
80106f00 <vector58>:
.globl vector58
vector58:
pushl $0
80106f00: 6a 00 push $0x0
pushl $58
80106f02: 6a 3a push $0x3a
jmp alltraps
80106f04: e9 7f f7 ff ff jmp 80106688 <alltraps>
80106f09 <vector59>:
.globl vector59
vector59:
pushl $0
80106f09: 6a 00 push $0x0
pushl $59
80106f0b: 6a 3b push $0x3b
jmp alltraps
80106f0d: e9 76 f7 ff ff jmp 80106688 <alltraps>
80106f12 <vector60>:
.globl vector60
vector60:
pushl $0
80106f12: 6a 00 push $0x0
pushl $60
80106f14: 6a 3c push $0x3c
jmp alltraps
80106f16: e9 6d f7 ff ff jmp 80106688 <alltraps>
80106f1b <vector61>:
.globl vector61
vector61:
pushl $0
80106f1b: 6a 00 push $0x0
pushl $61
80106f1d: 6a 3d push $0x3d
jmp alltraps
80106f1f: e9 64 f7 ff ff jmp 80106688 <alltraps>
80106f24 <vector62>:
.globl vector62
vector62:
pushl $0
80106f24: 6a 00 push $0x0
pushl $62
80106f26: 6a 3e push $0x3e
jmp alltraps
80106f28: e9 5b f7 ff ff jmp 80106688 <alltraps>
80106f2d <vector63>:
.globl vector63
vector63:
pushl $0
80106f2d: 6a 00 push $0x0
pushl $63
80106f2f: 6a 3f push $0x3f
jmp alltraps
80106f31: e9 52 f7 ff ff jmp 80106688 <alltraps>
80106f36 <vector64>:
.globl vector64
vector64:
pushl $0
80106f36: 6a 00 push $0x0
pushl $64
80106f38: 6a 40 push $0x40
jmp alltraps
80106f3a: e9 49 f7 ff ff jmp 80106688 <alltraps>
80106f3f <vector65>:
.globl vector65
vector65:
pushl $0
80106f3f: 6a 00 push $0x0
pushl $65
80106f41: 6a 41 push $0x41
jmp alltraps
80106f43: e9 40 f7 ff ff jmp 80106688 <alltraps>
80106f48 <vector66>:
.globl vector66
vector66:
pushl $0
80106f48: 6a 00 push $0x0
pushl $66
80106f4a: 6a 42 push $0x42
jmp alltraps
80106f4c: e9 37 f7 ff ff jmp 80106688 <alltraps>
80106f51 <vector67>:
.globl vector67
vector67:
pushl $0
80106f51: 6a 00 push $0x0
pushl $67
80106f53: 6a 43 push $0x43
jmp alltraps
80106f55: e9 2e f7 ff ff jmp 80106688 <alltraps>
80106f5a <vector68>:
.globl vector68
vector68:
pushl $0
80106f5a: 6a 00 push $0x0
pushl $68
80106f5c: 6a 44 push $0x44
jmp alltraps
80106f5e: e9 25 f7 ff ff jmp 80106688 <alltraps>
80106f63 <vector69>:
.globl vector69
vector69:
pushl $0
80106f63: 6a 00 push $0x0
pushl $69
80106f65: 6a 45 push $0x45
jmp alltraps
80106f67: e9 1c f7 ff ff jmp 80106688 <alltraps>
80106f6c <vector70>:
.globl vector70
vector70:
pushl $0
80106f6c: 6a 00 push $0x0
pushl $70
80106f6e: 6a 46 push $0x46
jmp alltraps
80106f70: e9 13 f7 ff ff jmp 80106688 <alltraps>
80106f75 <vector71>:
.globl vector71
vector71:
pushl $0
80106f75: 6a 00 push $0x0
pushl $71
80106f77: 6a 47 push $0x47
jmp alltraps
80106f79: e9 0a f7 ff ff jmp 80106688 <alltraps>
80106f7e <vector72>:
.globl vector72
vector72:
pushl $0
80106f7e: 6a 00 push $0x0
pushl $72
80106f80: 6a 48 push $0x48
jmp alltraps
80106f82: e9 01 f7 ff ff jmp 80106688 <alltraps>
80106f87 <vector73>:
.globl vector73
vector73:
pushl $0
80106f87: 6a 00 push $0x0
pushl $73
80106f89: 6a 49 push $0x49
jmp alltraps
80106f8b: e9 f8 f6 ff ff jmp 80106688 <alltraps>
80106f90 <vector74>:
.globl vector74
vector74:
pushl $0
80106f90: 6a 00 push $0x0
pushl $74
80106f92: 6a 4a push $0x4a
jmp alltraps
80106f94: e9 ef f6 ff ff jmp 80106688 <alltraps>
80106f99 <vector75>:
.globl vector75
vector75:
pushl $0
80106f99: 6a 00 push $0x0
pushl $75
80106f9b: 6a 4b push $0x4b
jmp alltraps
80106f9d: e9 e6 f6 ff ff jmp 80106688 <alltraps>
80106fa2 <vector76>:
.globl vector76
vector76:
pushl $0
80106fa2: 6a 00 push $0x0
pushl $76
80106fa4: 6a 4c push $0x4c
jmp alltraps
80106fa6: e9 dd f6 ff ff jmp 80106688 <alltraps>
80106fab <vector77>:
.globl vector77
vector77:
pushl $0
80106fab: 6a 00 push $0x0
pushl $77
80106fad: 6a 4d push $0x4d
jmp alltraps
80106faf: e9 d4 f6 ff ff jmp 80106688 <alltraps>
80106fb4 <vector78>:
.globl vector78
vector78:
pushl $0
80106fb4: 6a 00 push $0x0
pushl $78
80106fb6: 6a 4e push $0x4e
jmp alltraps
80106fb8: e9 cb f6 ff ff jmp 80106688 <alltraps>
80106fbd <vector79>:
.globl vector79
vector79:
pushl $0
80106fbd: 6a 00 push $0x0
pushl $79
80106fbf: 6a 4f push $0x4f
jmp alltraps
80106fc1: e9 c2 f6 ff ff jmp 80106688 <alltraps>
80106fc6 <vector80>:
.globl vector80
vector80:
pushl $0
80106fc6: 6a 00 push $0x0
pushl $80
80106fc8: 6a 50 push $0x50
jmp alltraps
80106fca: e9 b9 f6 ff ff jmp 80106688 <alltraps>
80106fcf <vector81>:
.globl vector81
vector81:
pushl $0
80106fcf: 6a 00 push $0x0
pushl $81
80106fd1: 6a 51 push $0x51
jmp alltraps
80106fd3: e9 b0 f6 ff ff jmp 80106688 <alltraps>
80106fd8 <vector82>:
.globl vector82
vector82:
pushl $0
80106fd8: 6a 00 push $0x0
pushl $82
80106fda: 6a 52 push $0x52
jmp alltraps
80106fdc: e9 a7 f6 ff ff jmp 80106688 <alltraps>
80106fe1 <vector83>:
.globl vector83
vector83:
pushl $0
80106fe1: 6a 00 push $0x0
pushl $83
80106fe3: 6a 53 push $0x53
jmp alltraps
80106fe5: e9 9e f6 ff ff jmp 80106688 <alltraps>
80106fea <vector84>:
.globl vector84
vector84:
pushl $0
80106fea: 6a 00 push $0x0
pushl $84
80106fec: 6a 54 push $0x54
jmp alltraps
80106fee: e9 95 f6 ff ff jmp 80106688 <alltraps>
80106ff3 <vector85>:
.globl vector85
vector85:
pushl $0
80106ff3: 6a 00 push $0x0
pushl $85
80106ff5: 6a 55 push $0x55
jmp alltraps
80106ff7: e9 8c f6 ff ff jmp 80106688 <alltraps>
80106ffc <vector86>:
.globl vector86
vector86:
pushl $0
80106ffc: 6a 00 push $0x0
pushl $86
80106ffe: 6a 56 push $0x56
jmp alltraps
80107000: e9 83 f6 ff ff jmp 80106688 <alltraps>
80107005 <vector87>:
.globl vector87
vector87:
pushl $0
80107005: 6a 00 push $0x0
pushl $87
80107007: 6a 57 push $0x57
jmp alltraps
80107009: e9 7a f6 ff ff jmp 80106688 <alltraps>
8010700e <vector88>:
.globl vector88
vector88:
pushl $0
8010700e: 6a 00 push $0x0
pushl $88
80107010: 6a 58 push $0x58
jmp alltraps
80107012: e9 71 f6 ff ff jmp 80106688 <alltraps>
80107017 <vector89>:
.globl vector89
vector89:
pushl $0
80107017: 6a 00 push $0x0
pushl $89
80107019: 6a 59 push $0x59
jmp alltraps
8010701b: e9 68 f6 ff ff jmp 80106688 <alltraps>
80107020 <vector90>:
.globl vector90
vector90:
pushl $0
80107020: 6a 00 push $0x0
pushl $90
80107022: 6a 5a push $0x5a
jmp alltraps
80107024: e9 5f f6 ff ff jmp 80106688 <alltraps>
80107029 <vector91>:
.globl vector91
vector91:
pushl $0
80107029: 6a 00 push $0x0
pushl $91
8010702b: 6a 5b push $0x5b
jmp alltraps
8010702d: e9 56 f6 ff ff jmp 80106688 <alltraps>
80107032 <vector92>:
.globl vector92
vector92:
pushl $0
80107032: 6a 00 push $0x0
pushl $92
80107034: 6a 5c push $0x5c
jmp alltraps
80107036: e9 4d f6 ff ff jmp 80106688 <alltraps>
8010703b <vector93>:
.globl vector93
vector93:
pushl $0
8010703b: 6a 00 push $0x0
pushl $93
8010703d: 6a 5d push $0x5d
jmp alltraps
8010703f: e9 44 f6 ff ff jmp 80106688 <alltraps>
80107044 <vector94>:
.globl vector94
vector94:
pushl $0
80107044: 6a 00 push $0x0
pushl $94
80107046: 6a 5e push $0x5e
jmp alltraps
80107048: e9 3b f6 ff ff jmp 80106688 <alltraps>
8010704d <vector95>:
.globl vector95
vector95:
pushl $0
8010704d: 6a 00 push $0x0
pushl $95
8010704f: 6a 5f push $0x5f
jmp alltraps
80107051: e9 32 f6 ff ff jmp 80106688 <alltraps>
80107056 <vector96>:
.globl vector96
vector96:
pushl $0
80107056: 6a 00 push $0x0
pushl $96
80107058: 6a 60 push $0x60
jmp alltraps
8010705a: e9 29 f6 ff ff jmp 80106688 <alltraps>
8010705f <vector97>:
.globl vector97
vector97:
pushl $0
8010705f: 6a 00 push $0x0
pushl $97
80107061: 6a 61 push $0x61
jmp alltraps
80107063: e9 20 f6 ff ff jmp 80106688 <alltraps>
80107068 <vector98>:
.globl vector98
vector98:
pushl $0
80107068: 6a 00 push $0x0
pushl $98
8010706a: 6a 62 push $0x62
jmp alltraps
8010706c: e9 17 f6 ff ff jmp 80106688 <alltraps>
80107071 <vector99>:
.globl vector99
vector99:
pushl $0
80107071: 6a 00 push $0x0
pushl $99
80107073: 6a 63 push $0x63
jmp alltraps
80107075: e9 0e f6 ff ff jmp 80106688 <alltraps>
8010707a <vector100>:
.globl vector100
vector100:
pushl $0
8010707a: 6a 00 push $0x0
pushl $100
8010707c: 6a 64 push $0x64
jmp alltraps
8010707e: e9 05 f6 ff ff jmp 80106688 <alltraps>
80107083 <vector101>:
.globl vector101
vector101:
pushl $0
80107083: 6a 00 push $0x0
pushl $101
80107085: 6a 65 push $0x65
jmp alltraps
80107087: e9 fc f5 ff ff jmp 80106688 <alltraps>
8010708c <vector102>:
.globl vector102
vector102:
pushl $0
8010708c: 6a 00 push $0x0
pushl $102
8010708e: 6a 66 push $0x66
jmp alltraps
80107090: e9 f3 f5 ff ff jmp 80106688 <alltraps>
80107095 <vector103>:
.globl vector103
vector103:
pushl $0
80107095: 6a 00 push $0x0
pushl $103
80107097: 6a 67 push $0x67
jmp alltraps
80107099: e9 ea f5 ff ff jmp 80106688 <alltraps>
8010709e <vector104>:
.globl vector104
vector104:
pushl $0
8010709e: 6a 00 push $0x0
pushl $104
801070a0: 6a 68 push $0x68
jmp alltraps
801070a2: e9 e1 f5 ff ff jmp 80106688 <alltraps>
801070a7 <vector105>:
.globl vector105
vector105:
pushl $0
801070a7: 6a 00 push $0x0
pushl $105
801070a9: 6a 69 push $0x69
jmp alltraps
801070ab: e9 d8 f5 ff ff jmp 80106688 <alltraps>
801070b0 <vector106>:
.globl vector106
vector106:
pushl $0
801070b0: 6a 00 push $0x0
pushl $106
801070b2: 6a 6a push $0x6a
jmp alltraps
801070b4: e9 cf f5 ff ff jmp 80106688 <alltraps>
801070b9 <vector107>:
.globl vector107
vector107:
pushl $0
801070b9: 6a 00 push $0x0
pushl $107
801070bb: 6a 6b push $0x6b
jmp alltraps
801070bd: e9 c6 f5 ff ff jmp 80106688 <alltraps>
801070c2 <vector108>:
.globl vector108
vector108:
pushl $0
801070c2: 6a 00 push $0x0
pushl $108
801070c4: 6a 6c push $0x6c
jmp alltraps
801070c6: e9 bd f5 ff ff jmp 80106688 <alltraps>
801070cb <vector109>:
.globl vector109
vector109:
pushl $0
801070cb: 6a 00 push $0x0
pushl $109
801070cd: 6a 6d push $0x6d
jmp alltraps
801070cf: e9 b4 f5 ff ff jmp 80106688 <alltraps>
801070d4 <vector110>:
.globl vector110
vector110:
pushl $0
801070d4: 6a 00 push $0x0
pushl $110
801070d6: 6a 6e push $0x6e
jmp alltraps
801070d8: e9 ab f5 ff ff jmp 80106688 <alltraps>
801070dd <vector111>:
.globl vector111
vector111:
pushl $0
801070dd: 6a 00 push $0x0
pushl $111
801070df: 6a 6f push $0x6f
jmp alltraps
801070e1: e9 a2 f5 ff ff jmp 80106688 <alltraps>
801070e6 <vector112>:
.globl vector112
vector112:
pushl $0
801070e6: 6a 00 push $0x0
pushl $112
801070e8: 6a 70 push $0x70
jmp alltraps
801070ea: e9 99 f5 ff ff jmp 80106688 <alltraps>
801070ef <vector113>:
.globl vector113
vector113:
pushl $0
801070ef: 6a 00 push $0x0
pushl $113
801070f1: 6a 71 push $0x71
jmp alltraps
801070f3: e9 90 f5 ff ff jmp 80106688 <alltraps>
801070f8 <vector114>:
.globl vector114
vector114:
pushl $0
801070f8: 6a 00 push $0x0
pushl $114
801070fa: 6a 72 push $0x72
jmp alltraps
801070fc: e9 87 f5 ff ff jmp 80106688 <alltraps>
80107101 <vector115>:
.globl vector115
vector115:
pushl $0
80107101: 6a 00 push $0x0
pushl $115
80107103: 6a 73 push $0x73
jmp alltraps
80107105: e9 7e f5 ff ff jmp 80106688 <alltraps>
8010710a <vector116>:
.globl vector116
vector116:
pushl $0
8010710a: 6a 00 push $0x0
pushl $116
8010710c: 6a 74 push $0x74
jmp alltraps
8010710e: e9 75 f5 ff ff jmp 80106688 <alltraps>
80107113 <vector117>:
.globl vector117
vector117:
pushl $0
80107113: 6a 00 push $0x0
pushl $117
80107115: 6a 75 push $0x75
jmp alltraps
80107117: e9 6c f5 ff ff jmp 80106688 <alltraps>
8010711c <vector118>:
.globl vector118
vector118:
pushl $0
8010711c: 6a 00 push $0x0
pushl $118
8010711e: 6a 76 push $0x76
jmp alltraps
80107120: e9 63 f5 ff ff jmp 80106688 <alltraps>
80107125 <vector119>:
.globl vector119
vector119:
pushl $0
80107125: 6a 00 push $0x0
pushl $119
80107127: 6a 77 push $0x77
jmp alltraps
80107129: e9 5a f5 ff ff jmp 80106688 <alltraps>
8010712e <vector120>:
.globl vector120
vector120:
pushl $0
8010712e: 6a 00 push $0x0
pushl $120
80107130: 6a 78 push $0x78
jmp alltraps
80107132: e9 51 f5 ff ff jmp 80106688 <alltraps>
80107137 <vector121>:
.globl vector121
vector121:
pushl $0
80107137: 6a 00 push $0x0
pushl $121
80107139: 6a 79 push $0x79
jmp alltraps
8010713b: e9 48 f5 ff ff jmp 80106688 <alltraps>
80107140 <vector122>:
.globl vector122
vector122:
pushl $0
80107140: 6a 00 push $0x0
pushl $122
80107142: 6a 7a push $0x7a
jmp alltraps
80107144: e9 3f f5 ff ff jmp 80106688 <alltraps>
80107149 <vector123>:
.globl vector123
vector123:
pushl $0
80107149: 6a 00 push $0x0
pushl $123
8010714b: 6a 7b push $0x7b
jmp alltraps
8010714d: e9 36 f5 ff ff jmp 80106688 <alltraps>
80107152 <vector124>:
.globl vector124
vector124:
pushl $0
80107152: 6a 00 push $0x0
pushl $124
80107154: 6a 7c push $0x7c
jmp alltraps
80107156: e9 2d f5 ff ff jmp 80106688 <alltraps>
8010715b <vector125>:
.globl vector125
vector125:
pushl $0
8010715b: 6a 00 push $0x0
pushl $125
8010715d: 6a 7d push $0x7d
jmp alltraps
8010715f: e9 24 f5 ff ff jmp 80106688 <alltraps>
80107164 <vector126>:
.globl vector126
vector126:
pushl $0
80107164: 6a 00 push $0x0
pushl $126
80107166: 6a 7e push $0x7e
jmp alltraps
80107168: e9 1b f5 ff ff jmp 80106688 <alltraps>
8010716d <vector127>:
.globl vector127
vector127:
pushl $0
8010716d: 6a 00 push $0x0
pushl $127
8010716f: 6a 7f push $0x7f
jmp alltraps
80107171: e9 12 f5 ff ff jmp 80106688 <alltraps>
80107176 <vector128>:
.globl vector128
vector128:
pushl $0
80107176: 6a 00 push $0x0
pushl $128
80107178: 68 80 00 00 00 push $0x80
jmp alltraps
8010717d: e9 06 f5 ff ff jmp 80106688 <alltraps>
80107182 <vector129>:
.globl vector129
vector129:
pushl $0
80107182: 6a 00 push $0x0
pushl $129
80107184: 68 81 00 00 00 push $0x81
jmp alltraps
80107189: e9 fa f4 ff ff jmp 80106688 <alltraps>
8010718e <vector130>:
.globl vector130
vector130:
pushl $0
8010718e: 6a 00 push $0x0
pushl $130
80107190: 68 82 00 00 00 push $0x82
jmp alltraps
80107195: e9 ee f4 ff ff jmp 80106688 <alltraps>
8010719a <vector131>:
.globl vector131
vector131:
pushl $0
8010719a: 6a 00 push $0x0
pushl $131
8010719c: 68 83 00 00 00 push $0x83
jmp alltraps
801071a1: e9 e2 f4 ff ff jmp 80106688 <alltraps>
801071a6 <vector132>:
.globl vector132
vector132:
pushl $0
801071a6: 6a 00 push $0x0
pushl $132
801071a8: 68 84 00 00 00 push $0x84
jmp alltraps
801071ad: e9 d6 f4 ff ff jmp 80106688 <alltraps>
801071b2 <vector133>:
.globl vector133
vector133:
pushl $0
801071b2: 6a 00 push $0x0
pushl $133
801071b4: 68 85 00 00 00 push $0x85
jmp alltraps
801071b9: e9 ca f4 ff ff jmp 80106688 <alltraps>
801071be <vector134>:
.globl vector134
vector134:
pushl $0
801071be: 6a 00 push $0x0
pushl $134
801071c0: 68 86 00 00 00 push $0x86
jmp alltraps
801071c5: e9 be f4 ff ff jmp 80106688 <alltraps>
801071ca <vector135>:
.globl vector135
vector135:
pushl $0
801071ca: 6a 00 push $0x0
pushl $135
801071cc: 68 87 00 00 00 push $0x87
jmp alltraps
801071d1: e9 b2 f4 ff ff jmp 80106688 <alltraps>
801071d6 <vector136>:
.globl vector136
vector136:
pushl $0
801071d6: 6a 00 push $0x0
pushl $136
801071d8: 68 88 00 00 00 push $0x88
jmp alltraps
801071dd: e9 a6 f4 ff ff jmp 80106688 <alltraps>
801071e2 <vector137>:
.globl vector137
vector137:
pushl $0
801071e2: 6a 00 push $0x0
pushl $137
801071e4: 68 89 00 00 00 push $0x89
jmp alltraps
801071e9: e9 9a f4 ff ff jmp 80106688 <alltraps>
801071ee <vector138>:
.globl vector138
vector138:
pushl $0
801071ee: 6a 00 push $0x0
pushl $138
801071f0: 68 8a 00 00 00 push $0x8a
jmp alltraps
801071f5: e9 8e f4 ff ff jmp 80106688 <alltraps>
801071fa <vector139>:
.globl vector139
vector139:
pushl $0
801071fa: 6a 00 push $0x0
pushl $139
801071fc: 68 8b 00 00 00 push $0x8b
jmp alltraps
80107201: e9 82 f4 ff ff jmp 80106688 <alltraps>
80107206 <vector140>:
.globl vector140
vector140:
pushl $0
80107206: 6a 00 push $0x0
pushl $140
80107208: 68 8c 00 00 00 push $0x8c
jmp alltraps
8010720d: e9 76 f4 ff ff jmp 80106688 <alltraps>
80107212 <vector141>:
.globl vector141
vector141:
pushl $0
80107212: 6a 00 push $0x0
pushl $141
80107214: 68 8d 00 00 00 push $0x8d
jmp alltraps
80107219: e9 6a f4 ff ff jmp 80106688 <alltraps>
8010721e <vector142>:
.globl vector142
vector142:
pushl $0
8010721e: 6a 00 push $0x0
pushl $142
80107220: 68 8e 00 00 00 push $0x8e
jmp alltraps
80107225: e9 5e f4 ff ff jmp 80106688 <alltraps>
8010722a <vector143>:
.globl vector143
vector143:
pushl $0
8010722a: 6a 00 push $0x0
pushl $143
8010722c: 68 8f 00 00 00 push $0x8f
jmp alltraps
80107231: e9 52 f4 ff ff jmp 80106688 <alltraps>
80107236 <vector144>:
.globl vector144
vector144:
pushl $0
80107236: 6a 00 push $0x0
pushl $144
80107238: 68 90 00 00 00 push $0x90
jmp alltraps
8010723d: e9 46 f4 ff ff jmp 80106688 <alltraps>
80107242 <vector145>:
.globl vector145
vector145:
pushl $0
80107242: 6a 00 push $0x0
pushl $145
80107244: 68 91 00 00 00 push $0x91
jmp alltraps
80107249: e9 3a f4 ff ff jmp 80106688 <alltraps>
8010724e <vector146>:
.globl vector146
vector146:
pushl $0
8010724e: 6a 00 push $0x0
pushl $146
80107250: 68 92 00 00 00 push $0x92
jmp alltraps
80107255: e9 2e f4 ff ff jmp 80106688 <alltraps>
8010725a <vector147>:
.globl vector147
vector147:
pushl $0
8010725a: 6a 00 push $0x0
pushl $147
8010725c: 68 93 00 00 00 push $0x93
jmp alltraps
80107261: e9 22 f4 ff ff jmp 80106688 <alltraps>
80107266 <vector148>:
.globl vector148
vector148:
pushl $0
80107266: 6a 00 push $0x0
pushl $148
80107268: 68 94 00 00 00 push $0x94
jmp alltraps
8010726d: e9 16 f4 ff ff jmp 80106688 <alltraps>
80107272 <vector149>:
.globl vector149
vector149:
pushl $0
80107272: 6a 00 push $0x0
pushl $149
80107274: 68 95 00 00 00 push $0x95
jmp alltraps
80107279: e9 0a f4 ff ff jmp 80106688 <alltraps>
8010727e <vector150>:
.globl vector150
vector150:
pushl $0
8010727e: 6a 00 push $0x0
pushl $150
80107280: 68 96 00 00 00 push $0x96
jmp alltraps
80107285: e9 fe f3 ff ff jmp 80106688 <alltraps>
8010728a <vector151>:
.globl vector151
vector151:
pushl $0
8010728a: 6a 00 push $0x0
pushl $151
8010728c: 68 97 00 00 00 push $0x97
jmp alltraps
80107291: e9 f2 f3 ff ff jmp 80106688 <alltraps>
80107296 <vector152>:
.globl vector152
vector152:
pushl $0
80107296: 6a 00 push $0x0
pushl $152
80107298: 68 98 00 00 00 push $0x98
jmp alltraps
8010729d: e9 e6 f3 ff ff jmp 80106688 <alltraps>
801072a2 <vector153>:
.globl vector153
vector153:
pushl $0
801072a2: 6a 00 push $0x0
pushl $153
801072a4: 68 99 00 00 00 push $0x99
jmp alltraps
801072a9: e9 da f3 ff ff jmp 80106688 <alltraps>
801072ae <vector154>:
.globl vector154
vector154:
pushl $0
801072ae: 6a 00 push $0x0
pushl $154
801072b0: 68 9a 00 00 00 push $0x9a
jmp alltraps
801072b5: e9 ce f3 ff ff jmp 80106688 <alltraps>
801072ba <vector155>:
.globl vector155
vector155:
pushl $0
801072ba: 6a 00 push $0x0
pushl $155
801072bc: 68 9b 00 00 00 push $0x9b
jmp alltraps
801072c1: e9 c2 f3 ff ff jmp 80106688 <alltraps>
801072c6 <vector156>:
.globl vector156
vector156:
pushl $0
801072c6: 6a 00 push $0x0
pushl $156
801072c8: 68 9c 00 00 00 push $0x9c
jmp alltraps
801072cd: e9 b6 f3 ff ff jmp 80106688 <alltraps>
801072d2 <vector157>:
.globl vector157
vector157:
pushl $0
801072d2: 6a 00 push $0x0
pushl $157
801072d4: 68 9d 00 00 00 push $0x9d
jmp alltraps
801072d9: e9 aa f3 ff ff jmp 80106688 <alltraps>
801072de <vector158>:
.globl vector158
vector158:
pushl $0
801072de: 6a 00 push $0x0
pushl $158
801072e0: 68 9e 00 00 00 push $0x9e
jmp alltraps
801072e5: e9 9e f3 ff ff jmp 80106688 <alltraps>
801072ea <vector159>:
.globl vector159
vector159:
pushl $0
801072ea: 6a 00 push $0x0
pushl $159
801072ec: 68 9f 00 00 00 push $0x9f
jmp alltraps
801072f1: e9 92 f3 ff ff jmp 80106688 <alltraps>
801072f6 <vector160>:
.globl vector160
vector160:
pushl $0
801072f6: 6a 00 push $0x0
pushl $160
801072f8: 68 a0 00 00 00 push $0xa0
jmp alltraps
801072fd: e9 86 f3 ff ff jmp 80106688 <alltraps>
80107302 <vector161>:
.globl vector161
vector161:
pushl $0
80107302: 6a 00 push $0x0
pushl $161
80107304: 68 a1 00 00 00 push $0xa1
jmp alltraps
80107309: e9 7a f3 ff ff jmp 80106688 <alltraps>
8010730e <vector162>:
.globl vector162
vector162:
pushl $0
8010730e: 6a 00 push $0x0
pushl $162
80107310: 68 a2 00 00 00 push $0xa2
jmp alltraps
80107315: e9 6e f3 ff ff jmp 80106688 <alltraps>
8010731a <vector163>:
.globl vector163
vector163:
pushl $0
8010731a: 6a 00 push $0x0
pushl $163
8010731c: 68 a3 00 00 00 push $0xa3
jmp alltraps
80107321: e9 62 f3 ff ff jmp 80106688 <alltraps>
80107326 <vector164>:
.globl vector164
vector164:
pushl $0
80107326: 6a 00 push $0x0
pushl $164
80107328: 68 a4 00 00 00 push $0xa4
jmp alltraps
8010732d: e9 56 f3 ff ff jmp 80106688 <alltraps>
80107332 <vector165>:
.globl vector165
vector165:
pushl $0
80107332: 6a 00 push $0x0
pushl $165
80107334: 68 a5 00 00 00 push $0xa5
jmp alltraps
80107339: e9 4a f3 ff ff jmp 80106688 <alltraps>
8010733e <vector166>:
.globl vector166
vector166:
pushl $0
8010733e: 6a 00 push $0x0
pushl $166
80107340: 68 a6 00 00 00 push $0xa6
jmp alltraps
80107345: e9 3e f3 ff ff jmp 80106688 <alltraps>
8010734a <vector167>:
.globl vector167
vector167:
pushl $0
8010734a: 6a 00 push $0x0
pushl $167
8010734c: 68 a7 00 00 00 push $0xa7
jmp alltraps
80107351: e9 32 f3 ff ff jmp 80106688 <alltraps>
80107356 <vector168>:
.globl vector168
vector168:
pushl $0
80107356: 6a 00 push $0x0
pushl $168
80107358: 68 a8 00 00 00 push $0xa8
jmp alltraps
8010735d: e9 26 f3 ff ff jmp 80106688 <alltraps>
80107362 <vector169>:
.globl vector169
vector169:
pushl $0
80107362: 6a 00 push $0x0
pushl $169
80107364: 68 a9 00 00 00 push $0xa9
jmp alltraps
80107369: e9 1a f3 ff ff jmp 80106688 <alltraps>
8010736e <vector170>:
.globl vector170
vector170:
pushl $0
8010736e: 6a 00 push $0x0
pushl $170
80107370: 68 aa 00 00 00 push $0xaa
jmp alltraps
80107375: e9 0e f3 ff ff jmp 80106688 <alltraps>
8010737a <vector171>:
.globl vector171
vector171:
pushl $0
8010737a: 6a 00 push $0x0
pushl $171
8010737c: 68 ab 00 00 00 push $0xab
jmp alltraps
80107381: e9 02 f3 ff ff jmp 80106688 <alltraps>
80107386 <vector172>:
.globl vector172
vector172:
pushl $0
80107386: 6a 00 push $0x0
pushl $172
80107388: 68 ac 00 00 00 push $0xac
jmp alltraps
8010738d: e9 f6 f2 ff ff jmp 80106688 <alltraps>
80107392 <vector173>:
.globl vector173
vector173:
pushl $0
80107392: 6a 00 push $0x0
pushl $173
80107394: 68 ad 00 00 00 push $0xad
jmp alltraps
80107399: e9 ea f2 ff ff jmp 80106688 <alltraps>
8010739e <vector174>:
.globl vector174
vector174:
pushl $0
8010739e: 6a 00 push $0x0
pushl $174
801073a0: 68 ae 00 00 00 push $0xae
jmp alltraps
801073a5: e9 de f2 ff ff jmp 80106688 <alltraps>
801073aa <vector175>:
.globl vector175
vector175:
pushl $0
801073aa: 6a 00 push $0x0
pushl $175
801073ac: 68 af 00 00 00 push $0xaf
jmp alltraps
801073b1: e9 d2 f2 ff ff jmp 80106688 <alltraps>
801073b6 <vector176>:
.globl vector176
vector176:
pushl $0
801073b6: 6a 00 push $0x0
pushl $176
801073b8: 68 b0 00 00 00 push $0xb0
jmp alltraps
801073bd: e9 c6 f2 ff ff jmp 80106688 <alltraps>
801073c2 <vector177>:
.globl vector177
vector177:
pushl $0
801073c2: 6a 00 push $0x0
pushl $177
801073c4: 68 b1 00 00 00 push $0xb1
jmp alltraps
801073c9: e9 ba f2 ff ff jmp 80106688 <alltraps>
801073ce <vector178>:
.globl vector178
vector178:
pushl $0
801073ce: 6a 00 push $0x0
pushl $178
801073d0: 68 b2 00 00 00 push $0xb2
jmp alltraps
801073d5: e9 ae f2 ff ff jmp 80106688 <alltraps>
801073da <vector179>:
.globl vector179
vector179:
pushl $0
801073da: 6a 00 push $0x0
pushl $179
801073dc: 68 b3 00 00 00 push $0xb3
jmp alltraps
801073e1: e9 a2 f2 ff ff jmp 80106688 <alltraps>
801073e6 <vector180>:
.globl vector180
vector180:
pushl $0
801073e6: 6a 00 push $0x0
pushl $180
801073e8: 68 b4 00 00 00 push $0xb4
jmp alltraps
801073ed: e9 96 f2 ff ff jmp 80106688 <alltraps>
801073f2 <vector181>:
.globl vector181
vector181:
pushl $0
801073f2: 6a 00 push $0x0
pushl $181
801073f4: 68 b5 00 00 00 push $0xb5
jmp alltraps
801073f9: e9 8a f2 ff ff jmp 80106688 <alltraps>
801073fe <vector182>:
.globl vector182
vector182:
pushl $0
801073fe: 6a 00 push $0x0
pushl $182
80107400: 68 b6 00 00 00 push $0xb6
jmp alltraps
80107405: e9 7e f2 ff ff jmp 80106688 <alltraps>
8010740a <vector183>:
.globl vector183
vector183:
pushl $0
8010740a: 6a 00 push $0x0
pushl $183
8010740c: 68 b7 00 00 00 push $0xb7
jmp alltraps
80107411: e9 72 f2 ff ff jmp 80106688 <alltraps>
80107416 <vector184>:
.globl vector184
vector184:
pushl $0
80107416: 6a 00 push $0x0
pushl $184
80107418: 68 b8 00 00 00 push $0xb8
jmp alltraps
8010741d: e9 66 f2 ff ff jmp 80106688 <alltraps>
80107422 <vector185>:
.globl vector185
vector185:
pushl $0
80107422: 6a 00 push $0x0
pushl $185
80107424: 68 b9 00 00 00 push $0xb9
jmp alltraps
80107429: e9 5a f2 ff ff jmp 80106688 <alltraps>
8010742e <vector186>:
.globl vector186
vector186:
pushl $0
8010742e: 6a 00 push $0x0
pushl $186
80107430: 68 ba 00 00 00 push $0xba
jmp alltraps
80107435: e9 4e f2 ff ff jmp 80106688 <alltraps>
8010743a <vector187>:
.globl vector187
vector187:
pushl $0
8010743a: 6a 00 push $0x0
pushl $187
8010743c: 68 bb 00 00 00 push $0xbb
jmp alltraps
80107441: e9 42 f2 ff ff jmp 80106688 <alltraps>
80107446 <vector188>:
.globl vector188
vector188:
pushl $0
80107446: 6a 00 push $0x0
pushl $188
80107448: 68 bc 00 00 00 push $0xbc
jmp alltraps
8010744d: e9 36 f2 ff ff jmp 80106688 <alltraps>
80107452 <vector189>:
.globl vector189
vector189:
pushl $0
80107452: 6a 00 push $0x0
pushl $189
80107454: 68 bd 00 00 00 push $0xbd
jmp alltraps
80107459: e9 2a f2 ff ff jmp 80106688 <alltraps>
8010745e <vector190>:
.globl vector190
vector190:
pushl $0
8010745e: 6a 00 push $0x0
pushl $190
80107460: 68 be 00 00 00 push $0xbe
jmp alltraps
80107465: e9 1e f2 ff ff jmp 80106688 <alltraps>
8010746a <vector191>:
.globl vector191
vector191:
pushl $0
8010746a: 6a 00 push $0x0
pushl $191
8010746c: 68 bf 00 00 00 push $0xbf
jmp alltraps
80107471: e9 12 f2 ff ff jmp 80106688 <alltraps>
80107476 <vector192>:
.globl vector192
vector192:
pushl $0
80107476: 6a 00 push $0x0
pushl $192
80107478: 68 c0 00 00 00 push $0xc0
jmp alltraps
8010747d: e9 06 f2 ff ff jmp 80106688 <alltraps>
80107482 <vector193>:
.globl vector193
vector193:
pushl $0
80107482: 6a 00 push $0x0
pushl $193
80107484: 68 c1 00 00 00 push $0xc1
jmp alltraps
80107489: e9 fa f1 ff ff jmp 80106688 <alltraps>
8010748e <vector194>:
.globl vector194
vector194:
pushl $0
8010748e: 6a 00 push $0x0
pushl $194
80107490: 68 c2 00 00 00 push $0xc2
jmp alltraps
80107495: e9 ee f1 ff ff jmp 80106688 <alltraps>
8010749a <vector195>:
.globl vector195
vector195:
pushl $0
8010749a: 6a 00 push $0x0
pushl $195
8010749c: 68 c3 00 00 00 push $0xc3
jmp alltraps
801074a1: e9 e2 f1 ff ff jmp 80106688 <alltraps>
801074a6 <vector196>:
.globl vector196
vector196:
pushl $0
801074a6: 6a 00 push $0x0
pushl $196
801074a8: 68 c4 00 00 00 push $0xc4
jmp alltraps
801074ad: e9 d6 f1 ff ff jmp 80106688 <alltraps>
801074b2 <vector197>:
.globl vector197
vector197:
pushl $0
801074b2: 6a 00 push $0x0
pushl $197
801074b4: 68 c5 00 00 00 push $0xc5
jmp alltraps
801074b9: e9 ca f1 ff ff jmp 80106688 <alltraps>
801074be <vector198>:
.globl vector198
vector198:
pushl $0
801074be: 6a 00 push $0x0
pushl $198
801074c0: 68 c6 00 00 00 push $0xc6
jmp alltraps
801074c5: e9 be f1 ff ff jmp 80106688 <alltraps>
801074ca <vector199>:
.globl vector199
vector199:
pushl $0
801074ca: 6a 00 push $0x0
pushl $199
801074cc: 68 c7 00 00 00 push $0xc7
jmp alltraps
801074d1: e9 b2 f1 ff ff jmp 80106688 <alltraps>
801074d6 <vector200>:
.globl vector200
vector200:
pushl $0
801074d6: 6a 00 push $0x0
pushl $200
801074d8: 68 c8 00 00 00 push $0xc8
jmp alltraps
801074dd: e9 a6 f1 ff ff jmp 80106688 <alltraps>
801074e2 <vector201>:
.globl vector201
vector201:
pushl $0
801074e2: 6a 00 push $0x0
pushl $201
801074e4: 68 c9 00 00 00 push $0xc9
jmp alltraps
801074e9: e9 9a f1 ff ff jmp 80106688 <alltraps>
801074ee <vector202>:
.globl vector202
vector202:
pushl $0
801074ee: 6a 00 push $0x0
pushl $202
801074f0: 68 ca 00 00 00 push $0xca
jmp alltraps
801074f5: e9 8e f1 ff ff jmp 80106688 <alltraps>
801074fa <vector203>:
.globl vector203
vector203:
pushl $0
801074fa: 6a 00 push $0x0
pushl $203
801074fc: 68 cb 00 00 00 push $0xcb
jmp alltraps
80107501: e9 82 f1 ff ff jmp 80106688 <alltraps>
80107506 <vector204>:
.globl vector204
vector204:
pushl $0
80107506: 6a 00 push $0x0
pushl $204
80107508: 68 cc 00 00 00 push $0xcc
jmp alltraps
8010750d: e9 76 f1 ff ff jmp 80106688 <alltraps>
80107512 <vector205>:
.globl vector205
vector205:
pushl $0
80107512: 6a 00 push $0x0
pushl $205
80107514: 68 cd 00 00 00 push $0xcd
jmp alltraps
80107519: e9 6a f1 ff ff jmp 80106688 <alltraps>
8010751e <vector206>:
.globl vector206
vector206:
pushl $0
8010751e: 6a 00 push $0x0
pushl $206
80107520: 68 ce 00 00 00 push $0xce
jmp alltraps
80107525: e9 5e f1 ff ff jmp 80106688 <alltraps>
8010752a <vector207>:
.globl vector207
vector207:
pushl $0
8010752a: 6a 00 push $0x0
pushl $207
8010752c: 68 cf 00 00 00 push $0xcf
jmp alltraps
80107531: e9 52 f1 ff ff jmp 80106688 <alltraps>
80107536 <vector208>:
.globl vector208
vector208:
pushl $0
80107536: 6a 00 push $0x0
pushl $208
80107538: 68 d0 00 00 00 push $0xd0
jmp alltraps
8010753d: e9 46 f1 ff ff jmp 80106688 <alltraps>
80107542 <vector209>:
.globl vector209
vector209:
pushl $0
80107542: 6a 00 push $0x0
pushl $209
80107544: 68 d1 00 00 00 push $0xd1
jmp alltraps
80107549: e9 3a f1 ff ff jmp 80106688 <alltraps>
8010754e <vector210>:
.globl vector210
vector210:
pushl $0
8010754e: 6a 00 push $0x0
pushl $210
80107550: 68 d2 00 00 00 push $0xd2
jmp alltraps
80107555: e9 2e f1 ff ff jmp 80106688 <alltraps>
8010755a <vector211>:
.globl vector211
vector211:
pushl $0
8010755a: 6a 00 push $0x0
pushl $211
8010755c: 68 d3 00 00 00 push $0xd3
jmp alltraps
80107561: e9 22 f1 ff ff jmp 80106688 <alltraps>
80107566 <vector212>:
.globl vector212
vector212:
pushl $0
80107566: 6a 00 push $0x0
pushl $212
80107568: 68 d4 00 00 00 push $0xd4
jmp alltraps
8010756d: e9 16 f1 ff ff jmp 80106688 <alltraps>
80107572 <vector213>:
.globl vector213
vector213:
pushl $0
80107572: 6a 00 push $0x0
pushl $213
80107574: 68 d5 00 00 00 push $0xd5
jmp alltraps
80107579: e9 0a f1 ff ff jmp 80106688 <alltraps>
8010757e <vector214>:
.globl vector214
vector214:
pushl $0
8010757e: 6a 00 push $0x0
pushl $214
80107580: 68 d6 00 00 00 push $0xd6
jmp alltraps
80107585: e9 fe f0 ff ff jmp 80106688 <alltraps>
8010758a <vector215>:
.globl vector215
vector215:
pushl $0
8010758a: 6a 00 push $0x0
pushl $215
8010758c: 68 d7 00 00 00 push $0xd7
jmp alltraps
80107591: e9 f2 f0 ff ff jmp 80106688 <alltraps>
80107596 <vector216>:
.globl vector216
vector216:
pushl $0
80107596: 6a 00 push $0x0
pushl $216
80107598: 68 d8 00 00 00 push $0xd8
jmp alltraps
8010759d: e9 e6 f0 ff ff jmp 80106688 <alltraps>
801075a2 <vector217>:
.globl vector217
vector217:
pushl $0
801075a2: 6a 00 push $0x0
pushl $217
801075a4: 68 d9 00 00 00 push $0xd9
jmp alltraps
801075a9: e9 da f0 ff ff jmp 80106688 <alltraps>
801075ae <vector218>:
.globl vector218
vector218:
pushl $0
801075ae: 6a 00 push $0x0
pushl $218
801075b0: 68 da 00 00 00 push $0xda
jmp alltraps
801075b5: e9 ce f0 ff ff jmp 80106688 <alltraps>
801075ba <vector219>:
.globl vector219
vector219:
pushl $0
801075ba: 6a 00 push $0x0
pushl $219
801075bc: 68 db 00 00 00 push $0xdb
jmp alltraps
801075c1: e9 c2 f0 ff ff jmp 80106688 <alltraps>
801075c6 <vector220>:
.globl vector220
vector220:
pushl $0
801075c6: 6a 00 push $0x0
pushl $220
801075c8: 68 dc 00 00 00 push $0xdc
jmp alltraps
801075cd: e9 b6 f0 ff ff jmp 80106688 <alltraps>
801075d2 <vector221>:
.globl vector221
vector221:
pushl $0
801075d2: 6a 00 push $0x0
pushl $221
801075d4: 68 dd 00 00 00 push $0xdd
jmp alltraps
801075d9: e9 aa f0 ff ff jmp 80106688 <alltraps>
801075de <vector222>:
.globl vector222
vector222:
pushl $0
801075de: 6a 00 push $0x0
pushl $222
801075e0: 68 de 00 00 00 push $0xde
jmp alltraps
801075e5: e9 9e f0 ff ff jmp 80106688 <alltraps>
801075ea <vector223>:
.globl vector223
vector223:
pushl $0
801075ea: 6a 00 push $0x0
pushl $223
801075ec: 68 df 00 00 00 push $0xdf
jmp alltraps
801075f1: e9 92 f0 ff ff jmp 80106688 <alltraps>
801075f6 <vector224>:
.globl vector224
vector224:
pushl $0
801075f6: 6a 00 push $0x0
pushl $224
801075f8: 68 e0 00 00 00 push $0xe0
jmp alltraps
801075fd: e9 86 f0 ff ff jmp 80106688 <alltraps>
80107602 <vector225>:
.globl vector225
vector225:
pushl $0
80107602: 6a 00 push $0x0
pushl $225
80107604: 68 e1 00 00 00 push $0xe1
jmp alltraps
80107609: e9 7a f0 ff ff jmp 80106688 <alltraps>
8010760e <vector226>:
.globl vector226
vector226:
pushl $0
8010760e: 6a 00 push $0x0
pushl $226
80107610: 68 e2 00 00 00 push $0xe2
jmp alltraps
80107615: e9 6e f0 ff ff jmp 80106688 <alltraps>
8010761a <vector227>:
.globl vector227
vector227:
pushl $0
8010761a: 6a 00 push $0x0
pushl $227
8010761c: 68 e3 00 00 00 push $0xe3
jmp alltraps
80107621: e9 62 f0 ff ff jmp 80106688 <alltraps>
80107626 <vector228>:
.globl vector228
vector228:
pushl $0
80107626: 6a 00 push $0x0
pushl $228
80107628: 68 e4 00 00 00 push $0xe4
jmp alltraps
8010762d: e9 56 f0 ff ff jmp 80106688 <alltraps>
80107632 <vector229>:
.globl vector229
vector229:
pushl $0
80107632: 6a 00 push $0x0
pushl $229
80107634: 68 e5 00 00 00 push $0xe5
jmp alltraps
80107639: e9 4a f0 ff ff jmp 80106688 <alltraps>
8010763e <vector230>:
.globl vector230
vector230:
pushl $0
8010763e: 6a 00 push $0x0
pushl $230
80107640: 68 e6 00 00 00 push $0xe6
jmp alltraps
80107645: e9 3e f0 ff ff jmp 80106688 <alltraps>
8010764a <vector231>:
.globl vector231
vector231:
pushl $0
8010764a: 6a 00 push $0x0
pushl $231
8010764c: 68 e7 00 00 00 push $0xe7
jmp alltraps
80107651: e9 32 f0 ff ff jmp 80106688 <alltraps>
80107656 <vector232>:
.globl vector232
vector232:
pushl $0
80107656: 6a 00 push $0x0
pushl $232
80107658: 68 e8 00 00 00 push $0xe8
jmp alltraps
8010765d: e9 26 f0 ff ff jmp 80106688 <alltraps>
80107662 <vector233>:
.globl vector233
vector233:
pushl $0
80107662: 6a 00 push $0x0
pushl $233
80107664: 68 e9 00 00 00 push $0xe9
jmp alltraps
80107669: e9 1a f0 ff ff jmp 80106688 <alltraps>
8010766e <vector234>:
.globl vector234
vector234:
pushl $0
8010766e: 6a 00 push $0x0
pushl $234
80107670: 68 ea 00 00 00 push $0xea
jmp alltraps
80107675: e9 0e f0 ff ff jmp 80106688 <alltraps>
8010767a <vector235>:
.globl vector235
vector235:
pushl $0
8010767a: 6a 00 push $0x0
pushl $235
8010767c: 68 eb 00 00 00 push $0xeb
jmp alltraps
80107681: e9 02 f0 ff ff jmp 80106688 <alltraps>
80107686 <vector236>:
.globl vector236
vector236:
pushl $0
80107686: 6a 00 push $0x0
pushl $236
80107688: 68 ec 00 00 00 push $0xec
jmp alltraps
8010768d: e9 f6 ef ff ff jmp 80106688 <alltraps>
80107692 <vector237>:
.globl vector237
vector237:
pushl $0
80107692: 6a 00 push $0x0
pushl $237
80107694: 68 ed 00 00 00 push $0xed
jmp alltraps
80107699: e9 ea ef ff ff jmp 80106688 <alltraps>
8010769e <vector238>:
.globl vector238
vector238:
pushl $0
8010769e: 6a 00 push $0x0
pushl $238
801076a0: 68 ee 00 00 00 push $0xee
jmp alltraps
801076a5: e9 de ef ff ff jmp 80106688 <alltraps>
801076aa <vector239>:
.globl vector239
vector239:
pushl $0
801076aa: 6a 00 push $0x0
pushl $239
801076ac: 68 ef 00 00 00 push $0xef
jmp alltraps
801076b1: e9 d2 ef ff ff jmp 80106688 <alltraps>
801076b6 <vector240>:
.globl vector240
vector240:
pushl $0
801076b6: 6a 00 push $0x0
pushl $240
801076b8: 68 f0 00 00 00 push $0xf0
jmp alltraps
801076bd: e9 c6 ef ff ff jmp 80106688 <alltraps>
801076c2 <vector241>:
.globl vector241
vector241:
pushl $0
801076c2: 6a 00 push $0x0
pushl $241
801076c4: 68 f1 00 00 00 push $0xf1
jmp alltraps
801076c9: e9 ba ef ff ff jmp 80106688 <alltraps>
801076ce <vector242>:
.globl vector242
vector242:
pushl $0
801076ce: 6a 00 push $0x0
pushl $242
801076d0: 68 f2 00 00 00 push $0xf2
jmp alltraps
801076d5: e9 ae ef ff ff jmp 80106688 <alltraps>
801076da <vector243>:
.globl vector243
vector243:
pushl $0
801076da: 6a 00 push $0x0
pushl $243
801076dc: 68 f3 00 00 00 push $0xf3
jmp alltraps
801076e1: e9 a2 ef ff ff jmp 80106688 <alltraps>
801076e6 <vector244>:
.globl vector244
vector244:
pushl $0
801076e6: 6a 00 push $0x0
pushl $244
801076e8: 68 f4 00 00 00 push $0xf4
jmp alltraps
801076ed: e9 96 ef ff ff jmp 80106688 <alltraps>
801076f2 <vector245>:
.globl vector245
vector245:
pushl $0
801076f2: 6a 00 push $0x0
pushl $245
801076f4: 68 f5 00 00 00 push $0xf5
jmp alltraps
801076f9: e9 8a ef ff ff jmp 80106688 <alltraps>
801076fe <vector246>:
.globl vector246
vector246:
pushl $0
801076fe: 6a 00 push $0x0
pushl $246
80107700: 68 f6 00 00 00 push $0xf6
jmp alltraps
80107705: e9 7e ef ff ff jmp 80106688 <alltraps>
8010770a <vector247>:
.globl vector247
vector247:
pushl $0
8010770a: 6a 00 push $0x0
pushl $247
8010770c: 68 f7 00 00 00 push $0xf7
jmp alltraps
80107711: e9 72 ef ff ff jmp 80106688 <alltraps>
80107716 <vector248>:
.globl vector248
vector248:
pushl $0
80107716: 6a 00 push $0x0
pushl $248
80107718: 68 f8 00 00 00 push $0xf8
jmp alltraps
8010771d: e9 66 ef ff ff jmp 80106688 <alltraps>
80107722 <vector249>:
.globl vector249
vector249:
pushl $0
80107722: 6a 00 push $0x0
pushl $249
80107724: 68 f9 00 00 00 push $0xf9
jmp alltraps
80107729: e9 5a ef ff ff jmp 80106688 <alltraps>
8010772e <vector250>:
.globl vector250
vector250:
pushl $0
8010772e: 6a 00 push $0x0
pushl $250
80107730: 68 fa 00 00 00 push $0xfa
jmp alltraps
80107735: e9 4e ef ff ff jmp 80106688 <alltraps>
8010773a <vector251>:
.globl vector251
vector251:
pushl $0
8010773a: 6a 00 push $0x0
pushl $251
8010773c: 68 fb 00 00 00 push $0xfb
jmp alltraps
80107741: e9 42 ef ff ff jmp 80106688 <alltraps>
80107746 <vector252>:
.globl vector252
vector252:
pushl $0
80107746: 6a 00 push $0x0
pushl $252
80107748: 68 fc 00 00 00 push $0xfc
jmp alltraps
8010774d: e9 36 ef ff ff jmp 80106688 <alltraps>
80107752 <vector253>:
.globl vector253
vector253:
pushl $0
80107752: 6a 00 push $0x0
pushl $253
80107754: 68 fd 00 00 00 push $0xfd
jmp alltraps
80107759: e9 2a ef ff ff jmp 80106688 <alltraps>
8010775e <vector254>:
.globl vector254
vector254:
pushl $0
8010775e: 6a 00 push $0x0
pushl $254
80107760: 68 fe 00 00 00 push $0xfe
jmp alltraps
80107765: e9 1e ef ff ff jmp 80106688 <alltraps>
8010776a <vector255>:
.globl vector255
vector255:
pushl $0
8010776a: 6a 00 push $0x0
pushl $255
8010776c: 68 ff 00 00 00 push $0xff
jmp alltraps
80107771: e9 12 ef ff ff jmp 80106688 <alltraps>
...
80107778 <lgdt>:
struct segdesc;
static inline void
lgdt(struct segdesc *p, int size)
{
80107778: 55 push %ebp
80107779: 89 e5 mov %esp,%ebp
8010777b: 83 ec 10 sub $0x10,%esp
volatile ushort pd[3];
pd[0] = size-1;
8010777e: 8b 45 0c mov 0xc(%ebp),%eax
80107781: 83 e8 01 sub $0x1,%eax
80107784: 66 89 45 fa mov %ax,-0x6(%ebp)
pd[1] = (uint)p;
80107788: 8b 45 08 mov 0x8(%ebp),%eax
8010778b: 66 89 45 fc mov %ax,-0x4(%ebp)
pd[2] = (uint)p >> 16;
8010778f: 8b 45 08 mov 0x8(%ebp),%eax
80107792: c1 e8 10 shr $0x10,%eax
80107795: 66 89 45 fe mov %ax,-0x2(%ebp)
asm volatile("lgdt (%0)" : : "r" (pd));
80107799: 8d 45 fa lea -0x6(%ebp),%eax
8010779c: 0f 01 10 lgdtl (%eax)
}
8010779f: c9 leave
801077a0: c3 ret
801077a1 <ltr>:
asm volatile("lidt (%0)" : : "r" (pd));
}
static inline void
ltr(ushort sel)
{
801077a1: 55 push %ebp
801077a2: 89 e5 mov %esp,%ebp
801077a4: 83 ec 04 sub $0x4,%esp
801077a7: 8b 45 08 mov 0x8(%ebp),%eax
801077aa: 66 89 45 fc mov %ax,-0x4(%ebp)
asm volatile("ltr %0" : : "r" (sel));
801077ae: 0f b7 45 fc movzwl -0x4(%ebp),%eax
801077b2: 0f 00 d8 ltr %ax
}
801077b5: c9 leave
801077b6: c3 ret
801077b7 <loadgs>:
return eflags;
}
static inline void
loadgs(ushort v)
{
801077b7: 55 push %ebp
801077b8: 89 e5 mov %esp,%ebp
801077ba: 83 ec 04 sub $0x4,%esp
801077bd: 8b 45 08 mov 0x8(%ebp),%eax
801077c0: 66 89 45 fc mov %ax,-0x4(%ebp)
asm volatile("movw %0, %%gs" : : "r" (v));
801077c4: 0f b7 45 fc movzwl -0x4(%ebp),%eax
801077c8: 8e e8 mov %eax,%gs
}
801077ca: c9 leave
801077cb: c3 ret
801077cc <lcr3>:
return val;
}
static inline void
lcr3(uint val)
{
801077cc: 55 push %ebp
801077cd: 89 e5 mov %esp,%ebp
asm volatile("movl %0,%%cr3" : : "r" (val));
801077cf: 8b 45 08 mov 0x8(%ebp),%eax
801077d2: 0f 22 d8 mov %eax,%cr3
}
801077d5: 5d pop %ebp
801077d6: c3 ret
801077d7 <v2p>:
#define KERNBASE 0x80000000 // First kernel virtual address
#define KERNLINK (KERNBASE+EXTMEM) // Address where kernel is linked
#ifndef __ASSEMBLER__
static inline uint v2p(void *a) { return ((uint) (a)) - KERNBASE; }
801077d7: 55 push %ebp
801077d8: 89 e5 mov %esp,%ebp
801077da: 8b 45 08 mov 0x8(%ebp),%eax
801077dd: 2d 00 00 00 80 sub $0x80000000,%eax
801077e2: 5d pop %ebp
801077e3: c3 ret
801077e4 <p2v>:
static inline void *p2v(uint a) { return (void *) ((a) + KERNBASE); }
801077e4: 55 push %ebp
801077e5: 89 e5 mov %esp,%ebp
801077e7: 8b 45 08 mov 0x8(%ebp),%eax
801077ea: 2d 00 00 00 80 sub $0x80000000,%eax
801077ef: 5d pop %ebp
801077f0: c3 ret
801077f1 <seginit>:
// Set up CPU's kernel segment descriptors.
// Run once on entry on each CPU.
void
seginit(void)
{
801077f1: 55 push %ebp
801077f2: 89 e5 mov %esp,%ebp
801077f4: 53 push %ebx
801077f5: 83 ec 24 sub $0x24,%esp
// Map "logical" addresses to virtual addresses using identity map.
// Cannot share a CODE descriptor for both kernel and user
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpunum()];
801077f8: e8 87 b6 ff ff call 80102e84 <cpunum>
801077fd: 69 c0 bc 00 00 00 imul $0xbc,%eax,%eax
80107803: 05 40 f9 10 80 add $0x8010f940,%eax
80107808: 89 45 f4 mov %eax,-0xc(%ebp)
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
8010780b: 8b 45 f4 mov -0xc(%ebp),%eax
8010780e: 66 c7 40 78 ff ff movw $0xffff,0x78(%eax)
80107814: 8b 45 f4 mov -0xc(%ebp),%eax
80107817: 66 c7 40 7a 00 00 movw $0x0,0x7a(%eax)
8010781d: 8b 45 f4 mov -0xc(%ebp),%eax
80107820: c6 40 7c 00 movb $0x0,0x7c(%eax)
80107824: 8b 45 f4 mov -0xc(%ebp),%eax
80107827: 0f b6 50 7d movzbl 0x7d(%eax),%edx
8010782b: 83 e2 f0 and $0xfffffff0,%edx
8010782e: 83 ca 0a or $0xa,%edx
80107831: 88 50 7d mov %dl,0x7d(%eax)
80107834: 8b 45 f4 mov -0xc(%ebp),%eax
80107837: 0f b6 50 7d movzbl 0x7d(%eax),%edx
8010783b: 83 ca 10 or $0x10,%edx
8010783e: 88 50 7d mov %dl,0x7d(%eax)
80107841: 8b 45 f4 mov -0xc(%ebp),%eax
80107844: 0f b6 50 7d movzbl 0x7d(%eax),%edx
80107848: 83 e2 9f and $0xffffff9f,%edx
8010784b: 88 50 7d mov %dl,0x7d(%eax)
8010784e: 8b 45 f4 mov -0xc(%ebp),%eax
80107851: 0f b6 50 7d movzbl 0x7d(%eax),%edx
80107855: 83 ca 80 or $0xffffff80,%edx
80107858: 88 50 7d mov %dl,0x7d(%eax)
8010785b: 8b 45 f4 mov -0xc(%ebp),%eax
8010785e: 0f b6 50 7e movzbl 0x7e(%eax),%edx
80107862: 83 ca 0f or $0xf,%edx
80107865: 88 50 7e mov %dl,0x7e(%eax)
80107868: 8b 45 f4 mov -0xc(%ebp),%eax
8010786b: 0f b6 50 7e movzbl 0x7e(%eax),%edx
8010786f: 83 e2 ef and $0xffffffef,%edx
80107872: 88 50 7e mov %dl,0x7e(%eax)
80107875: 8b 45 f4 mov -0xc(%ebp),%eax
80107878: 0f b6 50 7e movzbl 0x7e(%eax),%edx
8010787c: 83 e2 df and $0xffffffdf,%edx
8010787f: 88 50 7e mov %dl,0x7e(%eax)
80107882: 8b 45 f4 mov -0xc(%ebp),%eax
80107885: 0f b6 50 7e movzbl 0x7e(%eax),%edx
80107889: 83 ca 40 or $0x40,%edx
8010788c: 88 50 7e mov %dl,0x7e(%eax)
8010788f: 8b 45 f4 mov -0xc(%ebp),%eax
80107892: 0f b6 50 7e movzbl 0x7e(%eax),%edx
80107896: 83 ca 80 or $0xffffff80,%edx
80107899: 88 50 7e mov %dl,0x7e(%eax)
8010789c: 8b 45 f4 mov -0xc(%ebp),%eax
8010789f: c6 40 7f 00 movb $0x0,0x7f(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
801078a3: 8b 45 f4 mov -0xc(%ebp),%eax
801078a6: 66 c7 80 80 00 00 00 movw $0xffff,0x80(%eax)
801078ad: ff ff
801078af: 8b 45 f4 mov -0xc(%ebp),%eax
801078b2: 66 c7 80 82 00 00 00 movw $0x0,0x82(%eax)
801078b9: 00 00
801078bb: 8b 45 f4 mov -0xc(%ebp),%eax
801078be: c6 80 84 00 00 00 00 movb $0x0,0x84(%eax)
801078c5: 8b 45 f4 mov -0xc(%ebp),%eax
801078c8: 0f b6 90 85 00 00 00 movzbl 0x85(%eax),%edx
801078cf: 83 e2 f0 and $0xfffffff0,%edx
801078d2: 83 ca 02 or $0x2,%edx
801078d5: 88 90 85 00 00 00 mov %dl,0x85(%eax)
801078db: 8b 45 f4 mov -0xc(%ebp),%eax
801078de: 0f b6 90 85 00 00 00 movzbl 0x85(%eax),%edx
801078e5: 83 ca 10 or $0x10,%edx
801078e8: 88 90 85 00 00 00 mov %dl,0x85(%eax)
801078ee: 8b 45 f4 mov -0xc(%ebp),%eax
801078f1: 0f b6 90 85 00 00 00 movzbl 0x85(%eax),%edx
801078f8: 83 e2 9f and $0xffffff9f,%edx
801078fb: 88 90 85 00 00 00 mov %dl,0x85(%eax)
80107901: 8b 45 f4 mov -0xc(%ebp),%eax
80107904: 0f b6 90 85 00 00 00 movzbl 0x85(%eax),%edx
8010790b: 83 ca 80 or $0xffffff80,%edx
8010790e: 88 90 85 00 00 00 mov %dl,0x85(%eax)
80107914: 8b 45 f4 mov -0xc(%ebp),%eax
80107917: 0f b6 90 86 00 00 00 movzbl 0x86(%eax),%edx
8010791e: 83 ca 0f or $0xf,%edx
80107921: 88 90 86 00 00 00 mov %dl,0x86(%eax)
80107927: 8b 45 f4 mov -0xc(%ebp),%eax
8010792a: 0f b6 90 86 00 00 00 movzbl 0x86(%eax),%edx
80107931: 83 e2 ef and $0xffffffef,%edx
80107934: 88 90 86 00 00 00 mov %dl,0x86(%eax)
8010793a: 8b 45 f4 mov -0xc(%ebp),%eax
8010793d: 0f b6 90 86 00 00 00 movzbl 0x86(%eax),%edx
80107944: 83 e2 df and $0xffffffdf,%edx
80107947: 88 90 86 00 00 00 mov %dl,0x86(%eax)
8010794d: 8b 45 f4 mov -0xc(%ebp),%eax
80107950: 0f b6 90 86 00 00 00 movzbl 0x86(%eax),%edx
80107957: 83 ca 40 or $0x40,%edx
8010795a: 88 90 86 00 00 00 mov %dl,0x86(%eax)
80107960: 8b 45 f4 mov -0xc(%ebp),%eax
80107963: 0f b6 90 86 00 00 00 movzbl 0x86(%eax),%edx
8010796a: 83 ca 80 or $0xffffff80,%edx
8010796d: 88 90 86 00 00 00 mov %dl,0x86(%eax)
80107973: 8b 45 f4 mov -0xc(%ebp),%eax
80107976: c6 80 87 00 00 00 00 movb $0x0,0x87(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
8010797d: 8b 45 f4 mov -0xc(%ebp),%eax
80107980: 66 c7 80 90 00 00 00 movw $0xffff,0x90(%eax)
80107987: ff ff
80107989: 8b 45 f4 mov -0xc(%ebp),%eax
8010798c: 66 c7 80 92 00 00 00 movw $0x0,0x92(%eax)
80107993: 00 00
80107995: 8b 45 f4 mov -0xc(%ebp),%eax
80107998: c6 80 94 00 00 00 00 movb $0x0,0x94(%eax)
8010799f: 8b 45 f4 mov -0xc(%ebp),%eax
801079a2: 0f b6 90 95 00 00 00 movzbl 0x95(%eax),%edx
801079a9: 83 e2 f0 and $0xfffffff0,%edx
801079ac: 83 ca 0a or $0xa,%edx
801079af: 88 90 95 00 00 00 mov %dl,0x95(%eax)
801079b5: 8b 45 f4 mov -0xc(%ebp),%eax
801079b8: 0f b6 90 95 00 00 00 movzbl 0x95(%eax),%edx
801079bf: 83 ca 10 or $0x10,%edx
801079c2: 88 90 95 00 00 00 mov %dl,0x95(%eax)
801079c8: 8b 45 f4 mov -0xc(%ebp),%eax
801079cb: 0f b6 90 95 00 00 00 movzbl 0x95(%eax),%edx
801079d2: 83 ca 60 or $0x60,%edx
801079d5: 88 90 95 00 00 00 mov %dl,0x95(%eax)
801079db: 8b 45 f4 mov -0xc(%ebp),%eax
801079de: 0f b6 90 95 00 00 00 movzbl 0x95(%eax),%edx
801079e5: 83 ca 80 or $0xffffff80,%edx
801079e8: 88 90 95 00 00 00 mov %dl,0x95(%eax)
801079ee: 8b 45 f4 mov -0xc(%ebp),%eax
801079f1: 0f b6 90 96 00 00 00 movzbl 0x96(%eax),%edx
801079f8: 83 ca 0f or $0xf,%edx
801079fb: 88 90 96 00 00 00 mov %dl,0x96(%eax)
80107a01: 8b 45 f4 mov -0xc(%ebp),%eax
80107a04: 0f b6 90 96 00 00 00 movzbl 0x96(%eax),%edx
80107a0b: 83 e2 ef and $0xffffffef,%edx
80107a0e: 88 90 96 00 00 00 mov %dl,0x96(%eax)
80107a14: 8b 45 f4 mov -0xc(%ebp),%eax
80107a17: 0f b6 90 96 00 00 00 movzbl 0x96(%eax),%edx
80107a1e: 83 e2 df and $0xffffffdf,%edx
80107a21: 88 90 96 00 00 00 mov %dl,0x96(%eax)
80107a27: 8b 45 f4 mov -0xc(%ebp),%eax
80107a2a: 0f b6 90 96 00 00 00 movzbl 0x96(%eax),%edx
80107a31: 83 ca 40 or $0x40,%edx
80107a34: 88 90 96 00 00 00 mov %dl,0x96(%eax)
80107a3a: 8b 45 f4 mov -0xc(%ebp),%eax
80107a3d: 0f b6 90 96 00 00 00 movzbl 0x96(%eax),%edx
80107a44: 83 ca 80 or $0xffffff80,%edx
80107a47: 88 90 96 00 00 00 mov %dl,0x96(%eax)
80107a4d: 8b 45 f4 mov -0xc(%ebp),%eax
80107a50: c6 80 97 00 00 00 00 movb $0x0,0x97(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80107a57: 8b 45 f4 mov -0xc(%ebp),%eax
80107a5a: 66 c7 80 98 00 00 00 movw $0xffff,0x98(%eax)
80107a61: ff ff
80107a63: 8b 45 f4 mov -0xc(%ebp),%eax
80107a66: 66 c7 80 9a 00 00 00 movw $0x0,0x9a(%eax)
80107a6d: 00 00
80107a6f: 8b 45 f4 mov -0xc(%ebp),%eax
80107a72: c6 80 9c 00 00 00 00 movb $0x0,0x9c(%eax)
80107a79: 8b 45 f4 mov -0xc(%ebp),%eax
80107a7c: 0f b6 90 9d 00 00 00 movzbl 0x9d(%eax),%edx
80107a83: 83 e2 f0 and $0xfffffff0,%edx
80107a86: 83 ca 02 or $0x2,%edx
80107a89: 88 90 9d 00 00 00 mov %dl,0x9d(%eax)
80107a8f: 8b 45 f4 mov -0xc(%ebp),%eax
80107a92: 0f b6 90 9d 00 00 00 movzbl 0x9d(%eax),%edx
80107a99: 83 ca 10 or $0x10,%edx
80107a9c: 88 90 9d 00 00 00 mov %dl,0x9d(%eax)
80107aa2: 8b 45 f4 mov -0xc(%ebp),%eax
80107aa5: 0f b6 90 9d 00 00 00 movzbl 0x9d(%eax),%edx
80107aac: 83 ca 60 or $0x60,%edx
80107aaf: 88 90 9d 00 00 00 mov %dl,0x9d(%eax)
80107ab5: 8b 45 f4 mov -0xc(%ebp),%eax
80107ab8: 0f b6 90 9d 00 00 00 movzbl 0x9d(%eax),%edx
80107abf: 83 ca 80 or $0xffffff80,%edx
80107ac2: 88 90 9d 00 00 00 mov %dl,0x9d(%eax)
80107ac8: 8b 45 f4 mov -0xc(%ebp),%eax
80107acb: 0f b6 90 9e 00 00 00 movzbl 0x9e(%eax),%edx
80107ad2: 83 ca 0f or $0xf,%edx
80107ad5: 88 90 9e 00 00 00 mov %dl,0x9e(%eax)
80107adb: 8b 45 f4 mov -0xc(%ebp),%eax
80107ade: 0f b6 90 9e 00 00 00 movzbl 0x9e(%eax),%edx
80107ae5: 83 e2 ef and $0xffffffef,%edx
80107ae8: 88 90 9e 00 00 00 mov %dl,0x9e(%eax)
80107aee: 8b 45 f4 mov -0xc(%ebp),%eax
80107af1: 0f b6 90 9e 00 00 00 movzbl 0x9e(%eax),%edx
80107af8: 83 e2 df and $0xffffffdf,%edx
80107afb: 88 90 9e 00 00 00 mov %dl,0x9e(%eax)
80107b01: 8b 45 f4 mov -0xc(%ebp),%eax
80107b04: 0f b6 90 9e 00 00 00 movzbl 0x9e(%eax),%edx
80107b0b: 83 ca 40 or $0x40,%edx
80107b0e: 88 90 9e 00 00 00 mov %dl,0x9e(%eax)
80107b14: 8b 45 f4 mov -0xc(%ebp),%eax
80107b17: 0f b6 90 9e 00 00 00 movzbl 0x9e(%eax),%edx
80107b1e: 83 ca 80 or $0xffffff80,%edx
80107b21: 88 90 9e 00 00 00 mov %dl,0x9e(%eax)
80107b27: 8b 45 f4 mov -0xc(%ebp),%eax
80107b2a: c6 80 9f 00 00 00 00 movb $0x0,0x9f(%eax)
// Map cpu, and curproc
c->gdt[SEG_KCPU] = SEG(STA_W, &c->cpu, 8, 0);
80107b31: 8b 45 f4 mov -0xc(%ebp),%eax
80107b34: 05 b4 00 00 00 add $0xb4,%eax
80107b39: 89 c3 mov %eax,%ebx
80107b3b: 8b 45 f4 mov -0xc(%ebp),%eax
80107b3e: 05 b4 00 00 00 add $0xb4,%eax
80107b43: c1 e8 10 shr $0x10,%eax
80107b46: 89 c1 mov %eax,%ecx
80107b48: 8b 45 f4 mov -0xc(%ebp),%eax
80107b4b: 05 b4 00 00 00 add $0xb4,%eax
80107b50: c1 e8 18 shr $0x18,%eax
80107b53: 89 c2 mov %eax,%edx
80107b55: 8b 45 f4 mov -0xc(%ebp),%eax
80107b58: 66 c7 80 88 00 00 00 movw $0x0,0x88(%eax)
80107b5f: 00 00
80107b61: 8b 45 f4 mov -0xc(%ebp),%eax
80107b64: 66 89 98 8a 00 00 00 mov %bx,0x8a(%eax)
80107b6b: 8b 45 f4 mov -0xc(%ebp),%eax
80107b6e: 88 88 8c 00 00 00 mov %cl,0x8c(%eax)
80107b74: 8b 45 f4 mov -0xc(%ebp),%eax
80107b77: 0f b6 88 8d 00 00 00 movzbl 0x8d(%eax),%ecx
80107b7e: 83 e1 f0 and $0xfffffff0,%ecx
80107b81: 83 c9 02 or $0x2,%ecx
80107b84: 88 88 8d 00 00 00 mov %cl,0x8d(%eax)
80107b8a: 8b 45 f4 mov -0xc(%ebp),%eax
80107b8d: 0f b6 88 8d 00 00 00 movzbl 0x8d(%eax),%ecx
80107b94: 83 c9 10 or $0x10,%ecx
80107b97: 88 88 8d 00 00 00 mov %cl,0x8d(%eax)
80107b9d: 8b 45 f4 mov -0xc(%ebp),%eax
80107ba0: 0f b6 88 8d 00 00 00 movzbl 0x8d(%eax),%ecx
80107ba7: 83 e1 9f and $0xffffff9f,%ecx
80107baa: 88 88 8d 00 00 00 mov %cl,0x8d(%eax)
80107bb0: 8b 45 f4 mov -0xc(%ebp),%eax
80107bb3: 0f b6 88 8d 00 00 00 movzbl 0x8d(%eax),%ecx
80107bba: 83 c9 80 or $0xffffff80,%ecx
80107bbd: 88 88 8d 00 00 00 mov %cl,0x8d(%eax)
80107bc3: 8b 45 f4 mov -0xc(%ebp),%eax
80107bc6: 0f b6 88 8e 00 00 00 movzbl 0x8e(%eax),%ecx
80107bcd: 83 e1 f0 and $0xfffffff0,%ecx
80107bd0: 88 88 8e 00 00 00 mov %cl,0x8e(%eax)
80107bd6: 8b 45 f4 mov -0xc(%ebp),%eax
80107bd9: 0f b6 88 8e 00 00 00 movzbl 0x8e(%eax),%ecx
80107be0: 83 e1 ef and $0xffffffef,%ecx
80107be3: 88 88 8e 00 00 00 mov %cl,0x8e(%eax)
80107be9: 8b 45 f4 mov -0xc(%ebp),%eax
80107bec: 0f b6 88 8e 00 00 00 movzbl 0x8e(%eax),%ecx
80107bf3: 83 e1 df and $0xffffffdf,%ecx
80107bf6: 88 88 8e 00 00 00 mov %cl,0x8e(%eax)
80107bfc: 8b 45 f4 mov -0xc(%ebp),%eax
80107bff: 0f b6 88 8e 00 00 00 movzbl 0x8e(%eax),%ecx
80107c06: 83 c9 40 or $0x40,%ecx
80107c09: 88 88 8e 00 00 00 mov %cl,0x8e(%eax)
80107c0f: 8b 45 f4 mov -0xc(%ebp),%eax
80107c12: 0f b6 88 8e 00 00 00 movzbl 0x8e(%eax),%ecx
80107c19: 83 c9 80 or $0xffffff80,%ecx
80107c1c: 88 88 8e 00 00 00 mov %cl,0x8e(%eax)
80107c22: 8b 45 f4 mov -0xc(%ebp),%eax
80107c25: 88 90 8f 00 00 00 mov %dl,0x8f(%eax)
lgdt(c->gdt, sizeof(c->gdt));
80107c2b: 8b 45 f4 mov -0xc(%ebp),%eax
80107c2e: 83 c0 70 add $0x70,%eax
80107c31: c7 44 24 04 38 00 00 movl $0x38,0x4(%esp)
80107c38: 00
80107c39: 89 04 24 mov %eax,(%esp)
80107c3c: e8 37 fb ff ff call 80107778 <lgdt>
loadgs(SEG_KCPU << 3);
80107c41: c7 04 24 18 00 00 00 movl $0x18,(%esp)
80107c48: e8 6a fb ff ff call 801077b7 <loadgs>
// Initialize cpu-local storage.
cpu = c;
80107c4d: 8b 45 f4 mov -0xc(%ebp),%eax
80107c50: 65 a3 00 00 00 00 mov %eax,%gs:0x0
proc = 0;
80107c56: 65 c7 05 04 00 00 00 movl $0x0,%gs:0x4
80107c5d: 00 00 00 00
}
80107c61: 83 c4 24 add $0x24,%esp
80107c64: 5b pop %ebx
80107c65: 5d pop %ebp
80107c66: c3 ret
80107c67 <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)
{
80107c67: 55 push %ebp
80107c68: 89 e5 mov %esp,%ebp
80107c6a: 83 ec 28 sub $0x28,%esp
pde_t *pde;
pte_t *pgtab;
pde = &pgdir[PDX(va)];
80107c6d: 8b 45 0c mov 0xc(%ebp),%eax
80107c70: c1 e8 16 shr $0x16,%eax
80107c73: c1 e0 02 shl $0x2,%eax
80107c76: 03 45 08 add 0x8(%ebp),%eax
80107c79: 89 45 f0 mov %eax,-0x10(%ebp)
if(*pde & PTE_P){
80107c7c: 8b 45 f0 mov -0x10(%ebp),%eax
80107c7f: 8b 00 mov (%eax),%eax
80107c81: 83 e0 01 and $0x1,%eax
80107c84: 84 c0 test %al,%al
80107c86: 74 17 je 80107c9f <walkpgdir+0x38>
pgtab = (pte_t*)p2v(PTE_ADDR(*pde));
80107c88: 8b 45 f0 mov -0x10(%ebp),%eax
80107c8b: 8b 00 mov (%eax),%eax
80107c8d: 25 00 f0 ff ff and $0xfffff000,%eax
80107c92: 89 04 24 mov %eax,(%esp)
80107c95: e8 4a fb ff ff call 801077e4 <p2v>
80107c9a: 89 45 f4 mov %eax,-0xc(%ebp)
80107c9d: eb 4b jmp 80107cea <walkpgdir+0x83>
} else {
if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
80107c9f: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
80107ca3: 74 0e je 80107cb3 <walkpgdir+0x4c>
80107ca5: e8 60 ae ff ff call 80102b0a <kalloc>
80107caa: 89 45 f4 mov %eax,-0xc(%ebp)
80107cad: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80107cb1: 75 07 jne 80107cba <walkpgdir+0x53>
return 0;
80107cb3: b8 00 00 00 00 mov $0x0,%eax
80107cb8: eb 41 jmp 80107cfb <walkpgdir+0x94>
// Make sure all those PTE_P bits are zero.
memset(pgtab, 0, PGSIZE);
80107cba: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80107cc1: 00
80107cc2: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80107cc9: 00
80107cca: 8b 45 f4 mov -0xc(%ebp),%eax
80107ccd: 89 04 24 mov %eax,(%esp)
80107cd0: e8 c9 d4 ff ff call 8010519e <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;
80107cd5: 8b 45 f4 mov -0xc(%ebp),%eax
80107cd8: 89 04 24 mov %eax,(%esp)
80107cdb: e8 f7 fa ff ff call 801077d7 <v2p>
80107ce0: 89 c2 mov %eax,%edx
80107ce2: 83 ca 07 or $0x7,%edx
80107ce5: 8b 45 f0 mov -0x10(%ebp),%eax
80107ce8: 89 10 mov %edx,(%eax)
}
return &pgtab[PTX(va)];
80107cea: 8b 45 0c mov 0xc(%ebp),%eax
80107ced: c1 e8 0c shr $0xc,%eax
80107cf0: 25 ff 03 00 00 and $0x3ff,%eax
80107cf5: c1 e0 02 shl $0x2,%eax
80107cf8: 03 45 f4 add -0xc(%ebp),%eax
}
80107cfb: c9 leave
80107cfc: c3 ret
80107cfd <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)
{
80107cfd: 55 push %ebp
80107cfe: 89 e5 mov %esp,%ebp
80107d00: 83 ec 28 sub $0x28,%esp
char *a, *last;
pte_t *pte;
a = (char*)PGROUNDDOWN((uint)va);
80107d03: 8b 45 0c mov 0xc(%ebp),%eax
80107d06: 25 00 f0 ff ff and $0xfffff000,%eax
80107d0b: 89 45 ec mov %eax,-0x14(%ebp)
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
80107d0e: 8b 45 0c mov 0xc(%ebp),%eax
80107d11: 03 45 10 add 0x10(%ebp),%eax
80107d14: 83 e8 01 sub $0x1,%eax
80107d17: 25 00 f0 ff ff and $0xfffff000,%eax
80107d1c: 89 45 f0 mov %eax,-0x10(%ebp)
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
80107d1f: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
80107d26: 00
80107d27: 8b 45 ec mov -0x14(%ebp),%eax
80107d2a: 89 44 24 04 mov %eax,0x4(%esp)
80107d2e: 8b 45 08 mov 0x8(%ebp),%eax
80107d31: 89 04 24 mov %eax,(%esp)
80107d34: e8 2e ff ff ff call 80107c67 <walkpgdir>
80107d39: 89 45 f4 mov %eax,-0xc(%ebp)
80107d3c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80107d40: 75 07 jne 80107d49 <mappages+0x4c>
return -1;
80107d42: b8 ff ff ff ff mov $0xffffffff,%eax
80107d47: eb 46 jmp 80107d8f <mappages+0x92>
if(*pte & PTE_P)
80107d49: 8b 45 f4 mov -0xc(%ebp),%eax
80107d4c: 8b 00 mov (%eax),%eax
80107d4e: 83 e0 01 and $0x1,%eax
80107d51: 84 c0 test %al,%al
80107d53: 74 0c je 80107d61 <mappages+0x64>
panic("remap");
80107d55: c7 04 24 ac 8b 10 80 movl $0x80108bac,(%esp)
80107d5c: e8 d9 87 ff ff call 8010053a <panic>
*pte = pa | perm | PTE_P;
80107d61: 8b 45 18 mov 0x18(%ebp),%eax
80107d64: 0b 45 14 or 0x14(%ebp),%eax
80107d67: 89 c2 mov %eax,%edx
80107d69: 83 ca 01 or $0x1,%edx
80107d6c: 8b 45 f4 mov -0xc(%ebp),%eax
80107d6f: 89 10 mov %edx,(%eax)
if(a == last)
80107d71: 8b 45 ec mov -0x14(%ebp),%eax
80107d74: 3b 45 f0 cmp -0x10(%ebp),%eax
80107d77: 74 10 je 80107d89 <mappages+0x8c>
break;
a += PGSIZE;
80107d79: 81 45 ec 00 10 00 00 addl $0x1000,-0x14(%ebp)
pa += PGSIZE;
80107d80: 81 45 14 00 10 00 00 addl $0x1000,0x14(%ebp)
}
80107d87: eb 96 jmp 80107d1f <mappages+0x22>
return -1;
if(*pte & PTE_P)
panic("remap");
*pte = pa | perm | PTE_P;
if(a == last)
break;
80107d89: 90 nop
a += PGSIZE;
pa += PGSIZE;
}
return 0;
80107d8a: b8 00 00 00 00 mov $0x0,%eax
}
80107d8f: c9 leave
80107d90: c3 ret
80107d91 <setupkvm>:
};
// Set up kernel part of a page table.
pde_t*
setupkvm(void)
{
80107d91: 55 push %ebp
80107d92: 89 e5 mov %esp,%ebp
80107d94: 53 push %ebx
80107d95: 83 ec 34 sub $0x34,%esp
pde_t *pgdir;
struct kmap *k;
if((pgdir = (pde_t*)kalloc()) == 0)
80107d98: e8 6d ad ff ff call 80102b0a <kalloc>
80107d9d: 89 45 f0 mov %eax,-0x10(%ebp)
80107da0: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
80107da4: 75 0a jne 80107db0 <setupkvm+0x1f>
return 0;
80107da6: b8 00 00 00 00 mov $0x0,%eax
80107dab: e9 99 00 00 00 jmp 80107e49 <setupkvm+0xb8>
memset(pgdir, 0, PGSIZE);
80107db0: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80107db7: 00
80107db8: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80107dbf: 00
80107dc0: 8b 45 f0 mov -0x10(%ebp),%eax
80107dc3: 89 04 24 mov %eax,(%esp)
80107dc6: e8 d3 d3 ff ff call 8010519e <memset>
if (p2v(PHYSTOP) > (void*)DEVSPACE)
80107dcb: c7 04 24 00 00 00 0e movl $0xe000000,(%esp)
80107dd2: e8 0d fa ff ff call 801077e4 <p2v>
80107dd7: 3d 00 00 00 fe cmp $0xfe000000,%eax
80107ddc: 76 0c jbe 80107dea <setupkvm+0x59>
panic("PHYSTOP too high");
80107dde: c7 04 24 b2 8b 10 80 movl $0x80108bb2,(%esp)
80107de5: e8 50 87 ff ff call 8010053a <panic>
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80107dea: c7 45 f4 c0 b4 10 80 movl $0x8010b4c0,-0xc(%ebp)
80107df1: eb 49 jmp 80107e3c <setupkvm+0xab>
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
80107df3: 8b 45 f4 mov -0xc(%ebp),%eax
80107df6: 8b 48 0c mov 0xc(%eax),%ecx
80107df9: 8b 45 f4 mov -0xc(%ebp),%eax
80107dfc: 8b 50 04 mov 0x4(%eax),%edx
80107dff: 8b 45 f4 mov -0xc(%ebp),%eax
80107e02: 8b 58 08 mov 0x8(%eax),%ebx
80107e05: 8b 45 f4 mov -0xc(%ebp),%eax
80107e08: 8b 40 04 mov 0x4(%eax),%eax
80107e0b: 29 c3 sub %eax,%ebx
80107e0d: 8b 45 f4 mov -0xc(%ebp),%eax
80107e10: 8b 00 mov (%eax),%eax
80107e12: 89 4c 24 10 mov %ecx,0x10(%esp)
80107e16: 89 54 24 0c mov %edx,0xc(%esp)
80107e1a: 89 5c 24 08 mov %ebx,0x8(%esp)
80107e1e: 89 44 24 04 mov %eax,0x4(%esp)
80107e22: 8b 45 f0 mov -0x10(%ebp),%eax
80107e25: 89 04 24 mov %eax,(%esp)
80107e28: e8 d0 fe ff ff call 80107cfd <mappages>
80107e2d: 85 c0 test %eax,%eax
80107e2f: 79 07 jns 80107e38 <setupkvm+0xa7>
(uint)k->phys_start, k->perm) < 0)
return 0;
80107e31: b8 00 00 00 00 mov $0x0,%eax
80107e36: eb 11 jmp 80107e49 <setupkvm+0xb8>
if((pgdir = (pde_t*)kalloc()) == 0)
return 0;
memset(pgdir, 0, PGSIZE);
if (p2v(PHYSTOP) > (void*)DEVSPACE)
panic("PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80107e38: 83 45 f4 10 addl $0x10,-0xc(%ebp)
80107e3c: b8 00 b5 10 80 mov $0x8010b500,%eax
80107e41: 39 45 f4 cmp %eax,-0xc(%ebp)
80107e44: 72 ad jb 80107df3 <setupkvm+0x62>
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
(uint)k->phys_start, k->perm) < 0)
return 0;
return pgdir;
80107e46: 8b 45 f0 mov -0x10(%ebp),%eax
}
80107e49: 83 c4 34 add $0x34,%esp
80107e4c: 5b pop %ebx
80107e4d: 5d pop %ebp
80107e4e: c3 ret
80107e4f <kvmalloc>:
// Allocate one page table for the machine for the kernel address
// space for scheduler processes.
void
kvmalloc(void)
{
80107e4f: 55 push %ebp
80107e50: 89 e5 mov %esp,%ebp
80107e52: 83 ec 08 sub $0x8,%esp
kpgdir = setupkvm();
80107e55: e8 37 ff ff ff call 80107d91 <setupkvm>
80107e5a: a3 18 29 11 80 mov %eax,0x80112918
switchkvm();
80107e5f: e8 02 00 00 00 call 80107e66 <switchkvm>
}
80107e64: c9 leave
80107e65: c3 ret
80107e66 <switchkvm>:
// Switch h/w page table register to the kernel-only page table,
// for when no process is running.
void
switchkvm(void)
{
80107e66: 55 push %ebp
80107e67: 89 e5 mov %esp,%ebp
80107e69: 83 ec 04 sub $0x4,%esp
lcr3(v2p(kpgdir)); // switch to the kernel page table
80107e6c: a1 18 29 11 80 mov 0x80112918,%eax
80107e71: 89 04 24 mov %eax,(%esp)
80107e74: e8 5e f9 ff ff call 801077d7 <v2p>
80107e79: 89 04 24 mov %eax,(%esp)
80107e7c: e8 4b f9 ff ff call 801077cc <lcr3>
}
80107e81: c9 leave
80107e82: c3 ret
80107e83 <switchuvm>:
// Switch TSS and h/w page table to correspond to process p.
void
switchuvm(struct proc *p)
{
80107e83: 55 push %ebp
80107e84: 89 e5 mov %esp,%ebp
80107e86: 53 push %ebx
80107e87: 83 ec 14 sub $0x14,%esp
pushcli();
80107e8a: e8 09 d2 ff ff call 80105098 <pushcli>
cpu->gdt[SEG_TSS] = SEG16(STS_T32A, &cpu->ts, sizeof(cpu->ts)-1, 0);
80107e8f: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80107e95: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
80107e9c: 83 c2 08 add $0x8,%edx
80107e9f: 89 d3 mov %edx,%ebx
80107ea1: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
80107ea8: 83 c2 08 add $0x8,%edx
80107eab: c1 ea 10 shr $0x10,%edx
80107eae: 89 d1 mov %edx,%ecx
80107eb0: 65 8b 15 00 00 00 00 mov %gs:0x0,%edx
80107eb7: 83 c2 08 add $0x8,%edx
80107eba: c1 ea 18 shr $0x18,%edx
80107ebd: 66 c7 80 a0 00 00 00 movw $0x67,0xa0(%eax)
80107ec4: 67 00
80107ec6: 66 89 98 a2 00 00 00 mov %bx,0xa2(%eax)
80107ecd: 88 88 a4 00 00 00 mov %cl,0xa4(%eax)
80107ed3: 0f b6 88 a5 00 00 00 movzbl 0xa5(%eax),%ecx
80107eda: 83 e1 f0 and $0xfffffff0,%ecx
80107edd: 83 c9 09 or $0x9,%ecx
80107ee0: 88 88 a5 00 00 00 mov %cl,0xa5(%eax)
80107ee6: 0f b6 88 a5 00 00 00 movzbl 0xa5(%eax),%ecx
80107eed: 83 c9 10 or $0x10,%ecx
80107ef0: 88 88 a5 00 00 00 mov %cl,0xa5(%eax)
80107ef6: 0f b6 88 a5 00 00 00 movzbl 0xa5(%eax),%ecx
80107efd: 83 e1 9f and $0xffffff9f,%ecx
80107f00: 88 88 a5 00 00 00 mov %cl,0xa5(%eax)
80107f06: 0f b6 88 a5 00 00 00 movzbl 0xa5(%eax),%ecx
80107f0d: 83 c9 80 or $0xffffff80,%ecx
80107f10: 88 88 a5 00 00 00 mov %cl,0xa5(%eax)
80107f16: 0f b6 88 a6 00 00 00 movzbl 0xa6(%eax),%ecx
80107f1d: 83 e1 f0 and $0xfffffff0,%ecx
80107f20: 88 88 a6 00 00 00 mov %cl,0xa6(%eax)
80107f26: 0f b6 88 a6 00 00 00 movzbl 0xa6(%eax),%ecx
80107f2d: 83 e1 ef and $0xffffffef,%ecx
80107f30: 88 88 a6 00 00 00 mov %cl,0xa6(%eax)
80107f36: 0f b6 88 a6 00 00 00 movzbl 0xa6(%eax),%ecx
80107f3d: 83 e1 df and $0xffffffdf,%ecx
80107f40: 88 88 a6 00 00 00 mov %cl,0xa6(%eax)
80107f46: 0f b6 88 a6 00 00 00 movzbl 0xa6(%eax),%ecx
80107f4d: 83 c9 40 or $0x40,%ecx
80107f50: 88 88 a6 00 00 00 mov %cl,0xa6(%eax)
80107f56: 0f b6 88 a6 00 00 00 movzbl 0xa6(%eax),%ecx
80107f5d: 83 e1 7f and $0x7f,%ecx
80107f60: 88 88 a6 00 00 00 mov %cl,0xa6(%eax)
80107f66: 88 90 a7 00 00 00 mov %dl,0xa7(%eax)
cpu->gdt[SEG_TSS].s = 0;
80107f6c: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80107f72: 0f b6 90 a5 00 00 00 movzbl 0xa5(%eax),%edx
80107f79: 83 e2 ef and $0xffffffef,%edx
80107f7c: 88 90 a5 00 00 00 mov %dl,0xa5(%eax)
cpu->ts.ss0 = SEG_KDATA << 3;
80107f82: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80107f88: 66 c7 40 10 10 00 movw $0x10,0x10(%eax)
cpu->ts.esp0 = (uint)proc->kstack + KSTACKSIZE;
80107f8e: 65 a1 00 00 00 00 mov %gs:0x0,%eax
80107f94: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
80107f9b: 8b 52 08 mov 0x8(%edx),%edx
80107f9e: 81 c2 00 10 00 00 add $0x1000,%edx
80107fa4: 89 50 0c mov %edx,0xc(%eax)
ltr(SEG_TSS << 3);
80107fa7: c7 04 24 30 00 00 00 movl $0x30,(%esp)
80107fae: e8 ee f7 ff ff call 801077a1 <ltr>
if(p->pgdir == 0)
80107fb3: 8b 45 08 mov 0x8(%ebp),%eax
80107fb6: 8b 40 04 mov 0x4(%eax),%eax
80107fb9: 85 c0 test %eax,%eax
80107fbb: 75 0c jne 80107fc9 <switchuvm+0x146>
panic("switchuvm: no pgdir");
80107fbd: c7 04 24 c3 8b 10 80 movl $0x80108bc3,(%esp)
80107fc4: e8 71 85 ff ff call 8010053a <panic>
lcr3(v2p(p->pgdir)); // switch to new address space
80107fc9: 8b 45 08 mov 0x8(%ebp),%eax
80107fcc: 8b 40 04 mov 0x4(%eax),%eax
80107fcf: 89 04 24 mov %eax,(%esp)
80107fd2: e8 00 f8 ff ff call 801077d7 <v2p>
80107fd7: 89 04 24 mov %eax,(%esp)
80107fda: e8 ed f7 ff ff call 801077cc <lcr3>
popcli();
80107fdf: e8 fc d0 ff ff call 801050e0 <popcli>
}
80107fe4: 83 c4 14 add $0x14,%esp
80107fe7: 5b pop %ebx
80107fe8: 5d pop %ebp
80107fe9: c3 ret
80107fea <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)
{
80107fea: 55 push %ebp
80107feb: 89 e5 mov %esp,%ebp
80107fed: 83 ec 38 sub $0x38,%esp
char *mem;
if(sz >= PGSIZE)
80107ff0: 81 7d 10 ff 0f 00 00 cmpl $0xfff,0x10(%ebp)
80107ff7: 76 0c jbe 80108005 <inituvm+0x1b>
panic("inituvm: more than a page");
80107ff9: c7 04 24 d7 8b 10 80 movl $0x80108bd7,(%esp)
80108000: e8 35 85 ff ff call 8010053a <panic>
mem = kalloc();
80108005: e8 00 ab ff ff call 80102b0a <kalloc>
8010800a: 89 45 f4 mov %eax,-0xc(%ebp)
memset(mem, 0, PGSIZE);
8010800d: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80108014: 00
80108015: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
8010801c: 00
8010801d: 8b 45 f4 mov -0xc(%ebp),%eax
80108020: 89 04 24 mov %eax,(%esp)
80108023: e8 76 d1 ff ff call 8010519e <memset>
mappages(pgdir, 0, PGSIZE, v2p(mem), PTE_W|PTE_U);
80108028: 8b 45 f4 mov -0xc(%ebp),%eax
8010802b: 89 04 24 mov %eax,(%esp)
8010802e: e8 a4 f7 ff ff call 801077d7 <v2p>
80108033: c7 44 24 10 06 00 00 movl $0x6,0x10(%esp)
8010803a: 00
8010803b: 89 44 24 0c mov %eax,0xc(%esp)
8010803f: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80108046: 00
80108047: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
8010804e: 00
8010804f: 8b 45 08 mov 0x8(%ebp),%eax
80108052: 89 04 24 mov %eax,(%esp)
80108055: e8 a3 fc ff ff call 80107cfd <mappages>
memmove(mem, init, sz);
8010805a: 8b 45 10 mov 0x10(%ebp),%eax
8010805d: 89 44 24 08 mov %eax,0x8(%esp)
80108061: 8b 45 0c mov 0xc(%ebp),%eax
80108064: 89 44 24 04 mov %eax,0x4(%esp)
80108068: 8b 45 f4 mov -0xc(%ebp),%eax
8010806b: 89 04 24 mov %eax,(%esp)
8010806e: e8 fe d1 ff ff call 80105271 <memmove>
}
80108073: c9 leave
80108074: c3 ret
80108075 <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)
{
80108075: 55 push %ebp
80108076: 89 e5 mov %esp,%ebp
80108078: 53 push %ebx
80108079: 83 ec 24 sub $0x24,%esp
uint i, pa, n;
pte_t *pte;
if((uint) addr % PGSIZE != 0)
8010807c: 8b 45 0c mov 0xc(%ebp),%eax
8010807f: 25 ff 0f 00 00 and $0xfff,%eax
80108084: 85 c0 test %eax,%eax
80108086: 74 0c je 80108094 <loaduvm+0x1f>
panic("loaduvm: addr must be page aligned");
80108088: c7 04 24 f4 8b 10 80 movl $0x80108bf4,(%esp)
8010808f: e8 a6 84 ff ff call 8010053a <panic>
for(i = 0; i < sz; i += PGSIZE){
80108094: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp)
8010809b: e9 ae 00 00 00 jmp 8010814e <loaduvm+0xd9>
if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
801080a0: 8b 45 e8 mov -0x18(%ebp),%eax
801080a3: 8b 55 0c mov 0xc(%ebp),%edx
801080a6: 8d 04 02 lea (%edx,%eax,1),%eax
801080a9: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
801080b0: 00
801080b1: 89 44 24 04 mov %eax,0x4(%esp)
801080b5: 8b 45 08 mov 0x8(%ebp),%eax
801080b8: 89 04 24 mov %eax,(%esp)
801080bb: e8 a7 fb ff ff call 80107c67 <walkpgdir>
801080c0: 89 45 f4 mov %eax,-0xc(%ebp)
801080c3: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801080c7: 75 0c jne 801080d5 <loaduvm+0x60>
panic("loaduvm: address should exist");
801080c9: c7 04 24 17 8c 10 80 movl $0x80108c17,(%esp)
801080d0: e8 65 84 ff ff call 8010053a <panic>
pa = PTE_ADDR(*pte);
801080d5: 8b 45 f4 mov -0xc(%ebp),%eax
801080d8: 8b 00 mov (%eax),%eax
801080da: 25 00 f0 ff ff and $0xfffff000,%eax
801080df: 89 45 ec mov %eax,-0x14(%ebp)
if(sz - i < PGSIZE)
801080e2: 8b 45 e8 mov -0x18(%ebp),%eax
801080e5: 8b 55 18 mov 0x18(%ebp),%edx
801080e8: 89 d1 mov %edx,%ecx
801080ea: 29 c1 sub %eax,%ecx
801080ec: 89 c8 mov %ecx,%eax
801080ee: 3d ff 0f 00 00 cmp $0xfff,%eax
801080f3: 77 11 ja 80108106 <loaduvm+0x91>
n = sz - i;
801080f5: 8b 45 e8 mov -0x18(%ebp),%eax
801080f8: 8b 55 18 mov 0x18(%ebp),%edx
801080fb: 89 d1 mov %edx,%ecx
801080fd: 29 c1 sub %eax,%ecx
801080ff: 89 c8 mov %ecx,%eax
80108101: 89 45 f0 mov %eax,-0x10(%ebp)
80108104: eb 07 jmp 8010810d <loaduvm+0x98>
else
n = PGSIZE;
80108106: c7 45 f0 00 10 00 00 movl $0x1000,-0x10(%ebp)
if(readi(ip, p2v(pa), offset+i, n) != n)
8010810d: 8b 45 e8 mov -0x18(%ebp),%eax
80108110: 8b 55 14 mov 0x14(%ebp),%edx
80108113: 8d 1c 02 lea (%edx,%eax,1),%ebx
80108116: 8b 45 ec mov -0x14(%ebp),%eax
80108119: 89 04 24 mov %eax,(%esp)
8010811c: e8 c3 f6 ff ff call 801077e4 <p2v>
80108121: 8b 55 f0 mov -0x10(%ebp),%edx
80108124: 89 54 24 0c mov %edx,0xc(%esp)
80108128: 89 5c 24 08 mov %ebx,0x8(%esp)
8010812c: 89 44 24 04 mov %eax,0x4(%esp)
80108130: 8b 45 10 mov 0x10(%ebp),%eax
80108133: 89 04 24 mov %eax,(%esp)
80108136: e8 39 9c ff ff call 80101d74 <readi>
8010813b: 3b 45 f0 cmp -0x10(%ebp),%eax
8010813e: 74 07 je 80108147 <loaduvm+0xd2>
return -1;
80108140: b8 ff ff ff ff mov $0xffffffff,%eax
80108145: eb 18 jmp 8010815f <loaduvm+0xea>
uint i, pa, n;
pte_t *pte;
if((uint) addr % PGSIZE != 0)
panic("loaduvm: addr must be page aligned");
for(i = 0; i < sz; i += PGSIZE){
80108147: 81 45 e8 00 10 00 00 addl $0x1000,-0x18(%ebp)
8010814e: 8b 45 e8 mov -0x18(%ebp),%eax
80108151: 3b 45 18 cmp 0x18(%ebp),%eax
80108154: 0f 82 46 ff ff ff jb 801080a0 <loaduvm+0x2b>
else
n = PGSIZE;
if(readi(ip, p2v(pa), offset+i, n) != n)
return -1;
}
return 0;
8010815a: b8 00 00 00 00 mov $0x0,%eax
}
8010815f: 83 c4 24 add $0x24,%esp
80108162: 5b pop %ebx
80108163: 5d pop %ebp
80108164: c3 ret
80108165 <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)
{
80108165: 55 push %ebp
80108166: 89 e5 mov %esp,%ebp
80108168: 83 ec 38 sub $0x38,%esp
char *mem;
uint a;
if(newsz >= KERNBASE)
8010816b: 8b 45 10 mov 0x10(%ebp),%eax
8010816e: 85 c0 test %eax,%eax
80108170: 79 0a jns 8010817c <allocuvm+0x17>
return 0;
80108172: b8 00 00 00 00 mov $0x0,%eax
80108177: e9 c1 00 00 00 jmp 8010823d <allocuvm+0xd8>
if(newsz < oldsz)
8010817c: 8b 45 10 mov 0x10(%ebp),%eax
8010817f: 3b 45 0c cmp 0xc(%ebp),%eax
80108182: 73 08 jae 8010818c <allocuvm+0x27>
return oldsz;
80108184: 8b 45 0c mov 0xc(%ebp),%eax
80108187: e9 b1 00 00 00 jmp 8010823d <allocuvm+0xd8>
a = PGROUNDUP(oldsz);
8010818c: 8b 45 0c mov 0xc(%ebp),%eax
8010818f: 05 ff 0f 00 00 add $0xfff,%eax
80108194: 25 00 f0 ff ff and $0xfffff000,%eax
80108199: 89 45 f4 mov %eax,-0xc(%ebp)
for(; a < newsz; a += PGSIZE){
8010819c: e9 8d 00 00 00 jmp 8010822e <allocuvm+0xc9>
mem = kalloc();
801081a1: e8 64 a9 ff ff call 80102b0a <kalloc>
801081a6: 89 45 f0 mov %eax,-0x10(%ebp)
if(mem == 0){
801081a9: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
801081ad: 75 2c jne 801081db <allocuvm+0x76>
cprintf("allocuvm out of memory\n");
801081af: c7 04 24 35 8c 10 80 movl $0x80108c35,(%esp)
801081b6: e8 df 81 ff ff call 8010039a <cprintf>
deallocuvm(pgdir, newsz, oldsz);
801081bb: 8b 45 0c mov 0xc(%ebp),%eax
801081be: 89 44 24 08 mov %eax,0x8(%esp)
801081c2: 8b 45 10 mov 0x10(%ebp),%eax
801081c5: 89 44 24 04 mov %eax,0x4(%esp)
801081c9: 8b 45 08 mov 0x8(%ebp),%eax
801081cc: 89 04 24 mov %eax,(%esp)
801081cf: e8 6b 00 00 00 call 8010823f <deallocuvm>
return 0;
801081d4: b8 00 00 00 00 mov $0x0,%eax
801081d9: eb 62 jmp 8010823d <allocuvm+0xd8>
}
memset(mem, 0, PGSIZE);
801081db: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
801081e2: 00
801081e3: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
801081ea: 00
801081eb: 8b 45 f0 mov -0x10(%ebp),%eax
801081ee: 89 04 24 mov %eax,(%esp)
801081f1: e8 a8 cf ff ff call 8010519e <memset>
mappages(pgdir, (char*)a, PGSIZE, v2p(mem), PTE_W|PTE_U);
801081f6: 8b 45 f0 mov -0x10(%ebp),%eax
801081f9: 89 04 24 mov %eax,(%esp)
801081fc: e8 d6 f5 ff ff call 801077d7 <v2p>
80108201: 8b 55 f4 mov -0xc(%ebp),%edx
80108204: c7 44 24 10 06 00 00 movl $0x6,0x10(%esp)
8010820b: 00
8010820c: 89 44 24 0c mov %eax,0xc(%esp)
80108210: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
80108217: 00
80108218: 89 54 24 04 mov %edx,0x4(%esp)
8010821c: 8b 45 08 mov 0x8(%ebp),%eax
8010821f: 89 04 24 mov %eax,(%esp)
80108222: e8 d6 fa ff ff call 80107cfd <mappages>
return 0;
if(newsz < oldsz)
return oldsz;
a = PGROUNDUP(oldsz);
for(; a < newsz; a += PGSIZE){
80108227: 81 45 f4 00 10 00 00 addl $0x1000,-0xc(%ebp)
8010822e: 8b 45 f4 mov -0xc(%ebp),%eax
80108231: 3b 45 10 cmp 0x10(%ebp),%eax
80108234: 0f 82 67 ff ff ff jb 801081a1 <allocuvm+0x3c>
return 0;
}
memset(mem, 0, PGSIZE);
mappages(pgdir, (char*)a, PGSIZE, v2p(mem), PTE_W|PTE_U);
}
return newsz;
8010823a: 8b 45 10 mov 0x10(%ebp),%eax
}
8010823d: c9 leave
8010823e: c3 ret
8010823f <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)
{
8010823f: 55 push %ebp
80108240: 89 e5 mov %esp,%ebp
80108242: 83 ec 28 sub $0x28,%esp
pte_t *pte;
uint a, pa;
if(newsz >= oldsz)
80108245: 8b 45 10 mov 0x10(%ebp),%eax
80108248: 3b 45 0c cmp 0xc(%ebp),%eax
8010824b: 72 08 jb 80108255 <deallocuvm+0x16>
return oldsz;
8010824d: 8b 45 0c mov 0xc(%ebp),%eax
80108250: e9 a4 00 00 00 jmp 801082f9 <deallocuvm+0xba>
a = PGROUNDUP(newsz);
80108255: 8b 45 10 mov 0x10(%ebp),%eax
80108258: 05 ff 0f 00 00 add $0xfff,%eax
8010825d: 25 00 f0 ff ff and $0xfffff000,%eax
80108262: 89 45 ec mov %eax,-0x14(%ebp)
for(; a < oldsz; a += PGSIZE){
80108265: e9 80 00 00 00 jmp 801082ea <deallocuvm+0xab>
pte = walkpgdir(pgdir, (char*)a, 0);
8010826a: 8b 45 ec mov -0x14(%ebp),%eax
8010826d: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80108274: 00
80108275: 89 44 24 04 mov %eax,0x4(%esp)
80108279: 8b 45 08 mov 0x8(%ebp),%eax
8010827c: 89 04 24 mov %eax,(%esp)
8010827f: e8 e3 f9 ff ff call 80107c67 <walkpgdir>
80108284: 89 45 e8 mov %eax,-0x18(%ebp)
if(!pte)
80108287: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
8010828b: 75 09 jne 80108296 <deallocuvm+0x57>
a += (NPTENTRIES - 1) * PGSIZE;
8010828d: 81 45 ec 00 f0 3f 00 addl $0x3ff000,-0x14(%ebp)
80108294: eb 4d jmp 801082e3 <deallocuvm+0xa4>
else if((*pte & PTE_P) != 0){
80108296: 8b 45 e8 mov -0x18(%ebp),%eax
80108299: 8b 00 mov (%eax),%eax
8010829b: 83 e0 01 and $0x1,%eax
8010829e: 84 c0 test %al,%al
801082a0: 74 41 je 801082e3 <deallocuvm+0xa4>
pa = PTE_ADDR(*pte);
801082a2: 8b 45 e8 mov -0x18(%ebp),%eax
801082a5: 8b 00 mov (%eax),%eax
801082a7: 25 00 f0 ff ff and $0xfffff000,%eax
801082ac: 89 45 f0 mov %eax,-0x10(%ebp)
if(pa == 0)
801082af: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
801082b3: 75 0c jne 801082c1 <deallocuvm+0x82>
panic("kfree");
801082b5: c7 04 24 4d 8c 10 80 movl $0x80108c4d,(%esp)
801082bc: e8 79 82 ff ff call 8010053a <panic>
char *v = p2v(pa);
801082c1: 8b 45 f0 mov -0x10(%ebp),%eax
801082c4: 89 04 24 mov %eax,(%esp)
801082c7: e8 18 f5 ff ff call 801077e4 <p2v>
801082cc: 89 45 f4 mov %eax,-0xc(%ebp)
kfree(v);
801082cf: 8b 45 f4 mov -0xc(%ebp),%eax
801082d2: 89 04 24 mov %eax,(%esp)
801082d5: e8 97 a7 ff ff call 80102a71 <kfree>
*pte = 0;
801082da: 8b 45 e8 mov -0x18(%ebp),%eax
801082dd: c7 00 00 00 00 00 movl $0x0,(%eax)
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
for(; a < oldsz; a += PGSIZE){
801082e3: 81 45 ec 00 10 00 00 addl $0x1000,-0x14(%ebp)
801082ea: 8b 45 ec mov -0x14(%ebp),%eax
801082ed: 3b 45 0c cmp 0xc(%ebp),%eax
801082f0: 0f 82 74 ff ff ff jb 8010826a <deallocuvm+0x2b>
char *v = p2v(pa);
kfree(v);
*pte = 0;
}
}
return newsz;
801082f6: 8b 45 10 mov 0x10(%ebp),%eax
}
801082f9: c9 leave
801082fa: c3 ret
801082fb <freevm>:
// Free a page table and all the physical memory pages
// in the user part.
void
freevm(pde_t *pgdir)
{
801082fb: 55 push %ebp
801082fc: 89 e5 mov %esp,%ebp
801082fe: 83 ec 28 sub $0x28,%esp
uint i;
if(pgdir == 0)
80108301: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
80108305: 75 0c jne 80108313 <freevm+0x18>
panic("freevm: no pgdir");
80108307: c7 04 24 53 8c 10 80 movl $0x80108c53,(%esp)
8010830e: e8 27 82 ff ff call 8010053a <panic>
deallocuvm(pgdir, KERNBASE, 0);
80108313: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
8010831a: 00
8010831b: c7 44 24 04 00 00 00 movl $0x80000000,0x4(%esp)
80108322: 80
80108323: 8b 45 08 mov 0x8(%ebp),%eax
80108326: 89 04 24 mov %eax,(%esp)
80108329: e8 11 ff ff ff call 8010823f <deallocuvm>
for(i = 0; i < NPDENTRIES; i++){
8010832e: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
80108335: eb 3c jmp 80108373 <freevm+0x78>
if(pgdir[i] & PTE_P){
80108337: 8b 45 f0 mov -0x10(%ebp),%eax
8010833a: c1 e0 02 shl $0x2,%eax
8010833d: 03 45 08 add 0x8(%ebp),%eax
80108340: 8b 00 mov (%eax),%eax
80108342: 83 e0 01 and $0x1,%eax
80108345: 84 c0 test %al,%al
80108347: 74 26 je 8010836f <freevm+0x74>
char * v = p2v(PTE_ADDR(pgdir[i]));
80108349: 8b 45 f0 mov -0x10(%ebp),%eax
8010834c: c1 e0 02 shl $0x2,%eax
8010834f: 03 45 08 add 0x8(%ebp),%eax
80108352: 8b 00 mov (%eax),%eax
80108354: 25 00 f0 ff ff and $0xfffff000,%eax
80108359: 89 04 24 mov %eax,(%esp)
8010835c: e8 83 f4 ff ff call 801077e4 <p2v>
80108361: 89 45 f4 mov %eax,-0xc(%ebp)
kfree(v);
80108364: 8b 45 f4 mov -0xc(%ebp),%eax
80108367: 89 04 24 mov %eax,(%esp)
8010836a: e8 02 a7 ff ff call 80102a71 <kfree>
uint i;
if(pgdir == 0)
panic("freevm: no pgdir");
deallocuvm(pgdir, KERNBASE, 0);
for(i = 0; i < NPDENTRIES; i++){
8010836f: 83 45 f0 01 addl $0x1,-0x10(%ebp)
80108373: 81 7d f0 ff 03 00 00 cmpl $0x3ff,-0x10(%ebp)
8010837a: 76 bb jbe 80108337 <freevm+0x3c>
if(pgdir[i] & PTE_P){
char * v = p2v(PTE_ADDR(pgdir[i]));
kfree(v);
}
}
kfree((char*)pgdir);
8010837c: 8b 45 08 mov 0x8(%ebp),%eax
8010837f: 89 04 24 mov %eax,(%esp)
80108382: e8 ea a6 ff ff call 80102a71 <kfree>
}
80108387: c9 leave
80108388: c3 ret
80108389 <clearpteu>:
// Clear PTE_U on a page. Used to create an inaccessible
// page beneath the user stack.
void
clearpteu(pde_t *pgdir, char *uva)
{
80108389: 55 push %ebp
8010838a: 89 e5 mov %esp,%ebp
8010838c: 83 ec 28 sub $0x28,%esp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
8010838f: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80108396: 00
80108397: 8b 45 0c mov 0xc(%ebp),%eax
8010839a: 89 44 24 04 mov %eax,0x4(%esp)
8010839e: 8b 45 08 mov 0x8(%ebp),%eax
801083a1: 89 04 24 mov %eax,(%esp)
801083a4: e8 be f8 ff ff call 80107c67 <walkpgdir>
801083a9: 89 45 f4 mov %eax,-0xc(%ebp)
if(pte == 0)
801083ac: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
801083b0: 75 0c jne 801083be <clearpteu+0x35>
panic("clearpteu");
801083b2: c7 04 24 64 8c 10 80 movl $0x80108c64,(%esp)
801083b9: e8 7c 81 ff ff call 8010053a <panic>
*pte &= ~PTE_U;
801083be: 8b 45 f4 mov -0xc(%ebp),%eax
801083c1: 8b 00 mov (%eax),%eax
801083c3: 89 c2 mov %eax,%edx
801083c5: 83 e2 fb and $0xfffffffb,%edx
801083c8: 8b 45 f4 mov -0xc(%ebp),%eax
801083cb: 89 10 mov %edx,(%eax)
}
801083cd: c9 leave
801083ce: c3 ret
801083cf <copyuvm>:
// Given a parent process's page table, create a copy
// of it for a child.
pde_t*
copyuvm(pde_t *pgdir, uint sz)
{
801083cf: 55 push %ebp
801083d0: 89 e5 mov %esp,%ebp
801083d2: 53 push %ebx
801083d3: 83 ec 44 sub $0x44,%esp
pde_t *d;
pte_t *pte;
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
801083d6: e8 b6 f9 ff ff call 80107d91 <setupkvm>
801083db: 89 45 e0 mov %eax,-0x20(%ebp)
801083de: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
801083e2: 75 0a jne 801083ee <copyuvm+0x1f>
return 0;
801083e4: b8 00 00 00 00 mov $0x0,%eax
801083e9: e9 fd 00 00 00 jmp 801084eb <copyuvm+0x11c>
for(i = PGSIZE; i < sz; i += PGSIZE){
801083ee: c7 45 ec 00 10 00 00 movl $0x1000,-0x14(%ebp)
801083f5: e9 cc 00 00 00 jmp 801084c6 <copyuvm+0xf7>
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
801083fa: 8b 45 ec mov -0x14(%ebp),%eax
801083fd: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80108404: 00
80108405: 89 44 24 04 mov %eax,0x4(%esp)
80108409: 8b 45 08 mov 0x8(%ebp),%eax
8010840c: 89 04 24 mov %eax,(%esp)
8010840f: e8 53 f8 ff ff call 80107c67 <walkpgdir>
80108414: 89 45 e4 mov %eax,-0x1c(%ebp)
80108417: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
8010841b: 75 0c jne 80108429 <copyuvm+0x5a>
panic("copyuvm: pte should exist");
8010841d: c7 04 24 6e 8c 10 80 movl $0x80108c6e,(%esp)
80108424: e8 11 81 ff ff call 8010053a <panic>
if(!(*pte & PTE_P))
80108429: 8b 45 e4 mov -0x1c(%ebp),%eax
8010842c: 8b 00 mov (%eax),%eax
8010842e: 83 e0 01 and $0x1,%eax
80108431: 85 c0 test %eax,%eax
80108433: 75 0c jne 80108441 <copyuvm+0x72>
panic("copyuvm: page not present");
80108435: c7 04 24 88 8c 10 80 movl $0x80108c88,(%esp)
8010843c: e8 f9 80 ff ff call 8010053a <panic>
pa = PTE_ADDR(*pte);
80108441: 8b 45 e4 mov -0x1c(%ebp),%eax
80108444: 8b 00 mov (%eax),%eax
80108446: 25 00 f0 ff ff and $0xfffff000,%eax
8010844b: 89 45 e8 mov %eax,-0x18(%ebp)
flags = PTE_FLAGS(*pte);
8010844e: 8b 45 e4 mov -0x1c(%ebp),%eax
80108451: 8b 00 mov (%eax),%eax
80108453: 25 ff 0f 00 00 and $0xfff,%eax
80108458: 89 45 f0 mov %eax,-0x10(%ebp)
if((mem = kalloc()) == 0)
8010845b: e8 aa a6 ff ff call 80102b0a <kalloc>
80108460: 89 45 f4 mov %eax,-0xc(%ebp)
80108463: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
80108467: 74 6e je 801084d7 <copyuvm+0x108>
goto bad;
memmove(mem, (char*)p2v(pa), PGSIZE);
80108469: 8b 45 e8 mov -0x18(%ebp),%eax
8010846c: 89 04 24 mov %eax,(%esp)
8010846f: e8 70 f3 ff ff call 801077e4 <p2v>
80108474: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
8010847b: 00
8010847c: 89 44 24 04 mov %eax,0x4(%esp)
80108480: 8b 45 f4 mov -0xc(%ebp),%eax
80108483: 89 04 24 mov %eax,(%esp)
80108486: e8 e6 cd ff ff call 80105271 <memmove>
if(mappages(d, (void*)i, PGSIZE, v2p(mem), flags) < 0)
8010848b: 8b 5d f0 mov -0x10(%ebp),%ebx
8010848e: 8b 45 f4 mov -0xc(%ebp),%eax
80108491: 89 04 24 mov %eax,(%esp)
80108494: e8 3e f3 ff ff call 801077d7 <v2p>
80108499: 8b 55 ec mov -0x14(%ebp),%edx
8010849c: 89 5c 24 10 mov %ebx,0x10(%esp)
801084a0: 89 44 24 0c mov %eax,0xc(%esp)
801084a4: c7 44 24 08 00 10 00 movl $0x1000,0x8(%esp)
801084ab: 00
801084ac: 89 54 24 04 mov %edx,0x4(%esp)
801084b0: 8b 45 e0 mov -0x20(%ebp),%eax
801084b3: 89 04 24 mov %eax,(%esp)
801084b6: e8 42 f8 ff ff call 80107cfd <mappages>
801084bb: 85 c0 test %eax,%eax
801084bd: 78 1b js 801084da <copyuvm+0x10b>
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
return 0;
for(i = PGSIZE; i < sz; i += PGSIZE){
801084bf: 81 45 ec 00 10 00 00 addl $0x1000,-0x14(%ebp)
801084c6: 8b 45 ec mov -0x14(%ebp),%eax
801084c9: 3b 45 0c cmp 0xc(%ebp),%eax
801084cc: 0f 82 28 ff ff ff jb 801083fa <copyuvm+0x2b>
goto bad;
memmove(mem, (char*)p2v(pa), PGSIZE);
if(mappages(d, (void*)i, PGSIZE, v2p(mem), flags) < 0)
goto bad;
}
return d;
801084d2: 8b 45 e0 mov -0x20(%ebp),%eax
801084d5: eb 14 jmp 801084eb <copyuvm+0x11c>
if(!(*pte & PTE_P))
panic("copyuvm: page not present");
pa = PTE_ADDR(*pte);
flags = PTE_FLAGS(*pte);
if((mem = kalloc()) == 0)
goto bad;
801084d7: 90 nop
801084d8: eb 01 jmp 801084db <copyuvm+0x10c>
memmove(mem, (char*)p2v(pa), PGSIZE);
if(mappages(d, (void*)i, PGSIZE, v2p(mem), flags) < 0)
goto bad;
801084da: 90 nop
}
return d;
bad:
freevm(d);
801084db: 8b 45 e0 mov -0x20(%ebp),%eax
801084de: 89 04 24 mov %eax,(%esp)
801084e1: e8 15 fe ff ff call 801082fb <freevm>
return 0;
801084e6: b8 00 00 00 00 mov $0x0,%eax
}
801084eb: 83 c4 44 add $0x44,%esp
801084ee: 5b pop %ebx
801084ef: 5d pop %ebp
801084f0: c3 ret
801084f1 <uva2ka>:
//PAGEBREAK!
// Map user virtual address to kernel address.
char*
uva2ka(pde_t *pgdir, char *uva)
{
801084f1: 55 push %ebp
801084f2: 89 e5 mov %esp,%ebp
801084f4: 83 ec 28 sub $0x28,%esp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
801084f7: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
801084fe: 00
801084ff: 8b 45 0c mov 0xc(%ebp),%eax
80108502: 89 44 24 04 mov %eax,0x4(%esp)
80108506: 8b 45 08 mov 0x8(%ebp),%eax
80108509: 89 04 24 mov %eax,(%esp)
8010850c: e8 56 f7 ff ff call 80107c67 <walkpgdir>
80108511: 89 45 f4 mov %eax,-0xc(%ebp)
if((*pte & PTE_P) == 0)
80108514: 8b 45 f4 mov -0xc(%ebp),%eax
80108517: 8b 00 mov (%eax),%eax
80108519: 83 e0 01 and $0x1,%eax
8010851c: 85 c0 test %eax,%eax
8010851e: 75 07 jne 80108527 <uva2ka+0x36>
return 0;
80108520: b8 00 00 00 00 mov $0x0,%eax
80108525: eb 25 jmp 8010854c <uva2ka+0x5b>
if((*pte & PTE_U) == 0)
80108527: 8b 45 f4 mov -0xc(%ebp),%eax
8010852a: 8b 00 mov (%eax),%eax
8010852c: 83 e0 04 and $0x4,%eax
8010852f: 85 c0 test %eax,%eax
80108531: 75 07 jne 8010853a <uva2ka+0x49>
return 0;
80108533: b8 00 00 00 00 mov $0x0,%eax
80108538: eb 12 jmp 8010854c <uva2ka+0x5b>
return (char*)p2v(PTE_ADDR(*pte));
8010853a: 8b 45 f4 mov -0xc(%ebp),%eax
8010853d: 8b 00 mov (%eax),%eax
8010853f: 25 00 f0 ff ff and $0xfffff000,%eax
80108544: 89 04 24 mov %eax,(%esp)
80108547: e8 98 f2 ff ff call 801077e4 <p2v>
}
8010854c: c9 leave
8010854d: c3 ret
8010854e <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)
{
8010854e: 55 push %ebp
8010854f: 89 e5 mov %esp,%ebp
80108551: 83 ec 28 sub $0x28,%esp
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
80108554: 8b 45 10 mov 0x10(%ebp),%eax
80108557: 89 45 e8 mov %eax,-0x18(%ebp)
while(len > 0){
8010855a: e9 8b 00 00 00 jmp 801085ea <copyout+0x9c>
va0 = (uint)PGROUNDDOWN(va);
8010855f: 8b 45 0c mov 0xc(%ebp),%eax
80108562: 25 00 f0 ff ff and $0xfffff000,%eax
80108567: 89 45 f4 mov %eax,-0xc(%ebp)
pa0 = uva2ka(pgdir, (char*)va0);
8010856a: 8b 45 f4 mov -0xc(%ebp),%eax
8010856d: 89 44 24 04 mov %eax,0x4(%esp)
80108571: 8b 45 08 mov 0x8(%ebp),%eax
80108574: 89 04 24 mov %eax,(%esp)
80108577: e8 75 ff ff ff call 801084f1 <uva2ka>
8010857c: 89 45 ec mov %eax,-0x14(%ebp)
if(pa0 == 0)
8010857f: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
80108583: 75 07 jne 8010858c <copyout+0x3e>
return -1;
80108585: b8 ff ff ff ff mov $0xffffffff,%eax
8010858a: eb 6d jmp 801085f9 <copyout+0xab>
n = PGSIZE - (va - va0);
8010858c: 8b 45 0c mov 0xc(%ebp),%eax
8010858f: 8b 55 f4 mov -0xc(%ebp),%edx
80108592: 89 d1 mov %edx,%ecx
80108594: 29 c1 sub %eax,%ecx
80108596: 89 c8 mov %ecx,%eax
80108598: 05 00 10 00 00 add $0x1000,%eax
8010859d: 89 45 f0 mov %eax,-0x10(%ebp)
if(n > len)
801085a0: 8b 45 f0 mov -0x10(%ebp),%eax
801085a3: 3b 45 14 cmp 0x14(%ebp),%eax
801085a6: 76 06 jbe 801085ae <copyout+0x60>
n = len;
801085a8: 8b 45 14 mov 0x14(%ebp),%eax
801085ab: 89 45 f0 mov %eax,-0x10(%ebp)
memmove(pa0 + (va - va0), buf, n);
801085ae: 8b 45 f4 mov -0xc(%ebp),%eax
801085b1: 8b 55 0c mov 0xc(%ebp),%edx
801085b4: 89 d1 mov %edx,%ecx
801085b6: 29 c1 sub %eax,%ecx
801085b8: 89 c8 mov %ecx,%eax
801085ba: 03 45 ec add -0x14(%ebp),%eax
801085bd: 8b 55 f0 mov -0x10(%ebp),%edx
801085c0: 89 54 24 08 mov %edx,0x8(%esp)
801085c4: 8b 55 e8 mov -0x18(%ebp),%edx
801085c7: 89 54 24 04 mov %edx,0x4(%esp)
801085cb: 89 04 24 mov %eax,(%esp)
801085ce: e8 9e cc ff ff call 80105271 <memmove>
len -= n;
801085d3: 8b 45 f0 mov -0x10(%ebp),%eax
801085d6: 29 45 14 sub %eax,0x14(%ebp)
buf += n;
801085d9: 8b 45 f0 mov -0x10(%ebp),%eax
801085dc: 01 45 e8 add %eax,-0x18(%ebp)
va = va0 + PGSIZE;
801085df: 8b 45 f4 mov -0xc(%ebp),%eax
801085e2: 05 00 10 00 00 add $0x1000,%eax
801085e7: 89 45 0c mov %eax,0xc(%ebp)
{
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
801085ea: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
801085ee: 0f 85 6b ff ff ff jne 8010855f <copyout+0x11>
memmove(pa0 + (va - va0), buf, n);
len -= n;
buf += n;
va = va0 + PGSIZE;
}
return 0;
801085f4: b8 00 00 00 00 mov $0x0,%eax
}
801085f9: c9 leave
801085fa: c3 ret
| 37.52097
| 74
| 0.537367
|
947a0293f362cf2bc2abf2c99ed1786f03f9a412
| 556
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/arch/zx/misc/z80/asm_zx_cls.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/arch/zx/misc/z80/asm_zx_cls.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/arch/zx/misc/z80/asm_zx_cls.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
; ===============================================================
; 2014
; ===============================================================
;
; void zx_cls(uchar attr)
;
; Clear screen using attibute.
;
; ===============================================================
SECTION code_arch
PUBLIC asm_zx_cls
EXTERN asm_memset
asm_zx_cls:
; enter : l = attr
;
; uses : af, bc, de, hl
; attributes
ld e,l
ld hl,$5800
ld bc,768
call asm_memset
; pixels
ld e,0
ld hl,$4000
ld bc,6144
jp asm_memset
| 14.25641
| 65
| 0.374101
|
d6a173372ffdb8da5d42a95884c82d6921bc1715
| 1,100
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/z80/asm_esx_disk_stream_end.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/z80/asm_esx_disk_stream_end.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/z80/asm_esx_disk_stream_end.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
; unsigned char esx_disk_stream_end(void)
INCLUDE "config_private.inc"
SECTION code_esxdos
PUBLIC asm_esx_disk_stream_end
EXTERN __esx_stream_card_flags
EXTERN error_mnc
EXTERN __esxdos_error_zc
asm_esx_disk_stream_end:
; enter : none
;
; exit : success
;
; hl = -1
; carry reset
;
; fail
;
; hl = 0
; carry set, errno set
;
; uses : af, bc, de, hl
ld a,(__esx_stream_card_flags)
rst __ESX_RST_SYS
defb __ESX_DISK_STRMEND
jp nc, error_mnc
jp __esxdos_error_zc
; ***************************************************************************
; * DISK_STRMEND ($87) *
; ***************************************************************************
; Stop current streaming operation.
; Entry: A=card flags
; Exit (success): Fc=0
; Exit (failure): Fc=1, A=esx_edevicebusy
;
; NOTES:
; This call must be made to terminate a streaming operation.
; Please see example application code, stream.asm, for full usage information
; (available separately or at the end of this document).
| 21.568627
| 77
| 0.564545
|
db5af3849f4969f2e41a6482b22c9e8d15b5b902
| 5,806
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1214.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_0x84_notsx.log_21829_1214.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_0x84_notsx.log_21829_1214.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 %r15
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1a62b, %r13
nop
nop
nop
nop
nop
dec %rsi
movw $0x6162, (%r13)
nop
nop
nop
inc %r8
lea addresses_WC_ht+0x18f6b, %r9
nop
nop
nop
nop
nop
and %r15, %r15
movb (%r9), %al
nop
nop
nop
nop
xor $33651, %rax
lea addresses_normal_ht+0x1ceb, %r10
nop
nop
nop
and $19311, %rsi
vmovups (%r10), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %r9
nop
nop
sub $38416, %r10
lea addresses_UC_ht+0x13002, %rsi
lea addresses_WT_ht+0x191cb, %rdi
nop
nop
nop
nop
sub $64672, %r8
mov $9, %rcx
rep movsq
and %r10, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r15
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %r8
push %r9
push %rbp
push %rcx
// Store
lea addresses_A+0x11b6b, %r8
nop
nop
nop
and %r14, %r14
movw $0x5152, (%r8)
nop
nop
nop
nop
add $34679, %r14
// Store
lea addresses_UC+0x1e96b, %rbp
lfence
movw $0x5152, (%rbp)
nop
nop
xor $38948, %r14
// Store
lea addresses_A+0x1d02b, %r14
nop
nop
sub $44744, %rcx
movl $0x51525354, (%r14)
inc %r14
// Load
lea addresses_UC+0x1fb6b, %r8
nop
sub %rcx, %rcx
mov (%r8), %r9d
sub %rcx, %rcx
// Faulty Load
lea addresses_WC+0xe36b, %r14
nop
xor $4868, %rbp
movb (%r14), %r8b
lea oracles, %rcx
and $0xff, %r8
shlq $12, %r8
mov (%rcx,%r8,1), %r8
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WC', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 2, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_WC', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 6, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 1, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
| 38.450331
| 2,999
| 0.653979
|
08d63939c40dc4c26cf72d5408d5efdab144bf9e
| 5,829
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_248_1254.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_248_1254.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_248_1254.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 %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x18dc0, %rbp
nop
nop
nop
nop
cmp $30365, %r11
mov (%rbp), %r9w
nop
nop
nop
nop
nop
add %r10, %r10
lea addresses_normal_ht+0xfb10, %r8
nop
nop
nop
nop
nop
and %rcx, %rcx
mov (%r8), %r11d
cmp %r10, %r10
lea addresses_WC_ht+0x2bd0, %rsi
lea addresses_UC_ht+0x19410, %rdi
clflush (%rdi)
nop
nop
nop
nop
add $23717, %r8
mov $87, %rcx
rep movsb
nop
nop
nop
nop
nop
and $28193, %r9
lea addresses_D_ht+0xf810, %r8
nop
nop
nop
nop
nop
xor $55127, %rdi
movups (%r8), %xmm1
vpextrq $0, %xmm1, %rsi
nop
nop
nop
and %r9, %r9
lea addresses_WT_ht+0x1bee0, %rsi
lea addresses_WT_ht+0x14410, %rdi
nop
nop
nop
nop
nop
add $5637, %r8
mov $47, %rcx
rep movsl
nop
nop
nop
nop
xor %r9, %r9
lea addresses_normal_ht+0x3610, %rcx
nop
cmp $53274, %r9
vmovups (%rcx), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %r11
nop
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_WC_ht+0x19200, %rdi
nop
nop
nop
xor %r11, %r11
movb (%rdi), %r10b
nop
nop
nop
nop
dec %r9
lea addresses_A_ht+0x3c10, %rsi
lea addresses_WT_ht+0x13180, %rdi
nop
sub %r9, %r9
mov $113, %rcx
rep movsq
nop
nop
nop
and %r8, %r8
lea addresses_WT_ht+0x76ca, %rbp
and $8946, %r9
movl $0x61626364, (%rbp)
nop
nop
sub %rsi, %rsi
lea addresses_WC_ht+0x1ba10, %r9
nop
nop
nop
nop
nop
dec %rbp
mov $0x6162636465666768, %r11
movq %r11, %xmm1
vmovups %ymm1, (%r9)
nop
nop
nop
xor $31772, %r11
lea addresses_A_ht+0xda58, %r10
nop
nop
nop
nop
nop
cmp %rsi, %rsi
vmovups (%r10), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %rcx
nop
nop
nop
nop
cmp $61578, %rsi
lea addresses_WC_ht+0x16610, %r9
cmp %r11, %r11
movb $0x61, (%r9)
nop
nop
nop
add %rbp, %rbp
lea addresses_normal_ht+0x1eb90, %rsi
lea addresses_UC_ht+0x181d0, %rdi
nop
nop
nop
nop
dec %r9
mov $64, %rcx
rep movsb
nop
dec %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r8
push %rbp
push %rbx
push %rdx
// Store
mov $0x6eb, %rbp
nop
nop
nop
nop
nop
xor $14183, %r8
movw $0x5152, (%rbp)
nop
nop
nop
nop
nop
cmp %r12, %r12
// Load
lea addresses_PSE+0x1e810, %r8
nop
nop
nop
nop
and %rdx, %rdx
movups (%r8), %xmm6
vpextrq $1, %xmm6, %rbp
nop
nop
nop
nop
sub $26765, %r12
// Store
mov $0x4f371000000082d, %r15
nop
nop
nop
nop
inc %rdx
movl $0x51525354, (%r15)
nop
nop
and $52087, %rdx
// Faulty Load
lea addresses_D+0xb410, %r8
nop
nop
nop
nop
nop
dec %r11
movb (%r8), %dl
lea oracles, %rbx
and $0xff, %rdx
shlq $12, %rdx
mov (%rbx,%rdx,1), %rdx
pop %rdx
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 1, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}}
{'36': 248}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 21.273723
| 743
| 0.649511
|
b9500770e8062187769c2454d156c949889cacf7
| 451
|
asm
|
Assembly
|
oeis/070/A070293.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/070/A070293.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/070/A070293.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A070293: a(n) = lcm(30,n)/gcd(30,n).
; Submitted by Simon Strandgaard
; 30,15,10,30,6,5,210,60,30,3,330,10,390,105,2,120,510,15,570,6,70,165,690,20,30,195,90,210,870,1,930,240,110,255,42,30,1110,285,130,12,1230,35,1290,330,6,345,1410,40,1470,15
mov $1,1
add $1,$0
mov $0,1
seq $0,118616 ; Start with 1 and repeatedly reverse the digits and add 29 to get the next term.
mov $2,$0
mul $0,91
gcd $2,$1
mul $1,$0
pow $2,2
div $1,$2
mov $0,$1
div $0,91
| 26.529412
| 174
| 0.667406
|
a694c4c27b899bddc455ede85cfa6719d7faebe6
| 559
|
asm
|
Assembly
|
Module 2/3. FunWithStack/ExecveBashStack.asm
|
hoangcuongflp/SLAE
|
8687f207748b2d46660a6a03d0a0d0855d7d3b24
|
[
"MIT"
] | 47
|
2017-05-04T09:15:53.000Z
|
2022-02-21T22:19:51.000Z
|
Module 2/3. FunWithStack/ExecveBashStack.asm
|
TaharAmine/SLAE
|
8687f207748b2d46660a6a03d0a0d0855d7d3b24
|
[
"MIT"
] | null | null | null |
Module 2/3. FunWithStack/ExecveBashStack.asm
|
TaharAmine/SLAE
|
8687f207748b2d46660a6a03d0a0d0855d7d3b24
|
[
"MIT"
] | 18
|
2017-05-10T04:32:06.000Z
|
2021-07-27T17:52:09.000Z
|
; ExecveBashStack.asm
; by Abatchy
;
; nasm -felf32 ExecveBashStack.asm && ld -o ExecveBashStack ExecveBashStack.o
; Generated shellcode: "\x31\xc0\x50\x68\x62\x61\x73\x68\x68\x62\x69\x6e\x2f\x68\x2f\x2f\x2f\x2f\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80"
global _start
section .text
_start:
xor eax, eax
push eax
; PUSH ////bin/bash (size: 12)
push 0x68736162
push 0x2f6e6962
push 0x2f2f2f2f
mov ebx, esp
push eax
mov edx, esp
push ebx
mov ecx, esp
mov al, 0xb
int 0x80
| 18.032258
| 145
| 0.63864
|
5b0238272bbb6f6c1442a7ac8ad55b53049a2316
| 3,216
|
asm
|
Assembly
|
vp9/encoder/x86/vp9_error_sse2.asm
|
golden1232004/libvpx
|
61a8b8673411110823d31ffd9d3e28d5023c5e9f
|
[
"BSD-3-Clause"
] | 83
|
2015-08-04T06:19:59.000Z
|
2022-03-25T03:33:55.000Z
|
vp9/encoder/x86/vp9_error_sse2.asm
|
golden1232004/libvpx
|
61a8b8673411110823d31ffd9d3e28d5023c5e9f
|
[
"BSD-3-Clause"
] | 32
|
2015-07-31T22:47:16.000Z
|
2022-03-16T01:57:49.000Z
|
vp9/encoder/x86/vp9_error_sse2.asm
|
golden1232004/libvpx
|
61a8b8673411110823d31ffd9d3e28d5023c5e9f
|
[
"BSD-3-Clause"
] | 40
|
2015-07-25T03:01:48.000Z
|
2022-03-29T07:55:34.000Z
|
;
; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
%define private_prefix vp9
%include "third_party/x86inc/x86inc.asm"
SECTION .text
; int64_t vp9_block_error(int16_t *coeff, int16_t *dqcoeff, intptr_t block_size,
; int64_t *ssz)
INIT_XMM sse2
cglobal block_error, 3, 3, 8, uqc, dqc, size, ssz
pxor m4, m4 ; sse accumulator
pxor m6, m6 ; ssz accumulator
pxor m5, m5 ; dedicated zero register
lea uqcq, [uqcq+sizeq*2]
lea dqcq, [dqcq+sizeq*2]
neg sizeq
.loop:
mova m2, [uqcq+sizeq*2]
mova m0, [dqcq+sizeq*2]
mova m3, [uqcq+sizeq*2+mmsize]
mova m1, [dqcq+sizeq*2+mmsize]
psubw m0, m2
psubw m1, m3
; individual errors are max. 15bit+sign, so squares are 30bit, and
; thus the sum of 2 should fit in a 31bit integer (+ unused sign bit)
pmaddwd m0, m0
pmaddwd m1, m1
pmaddwd m2, m2
pmaddwd m3, m3
; accumulate in 64bit
punpckldq m7, m0, m5
punpckhdq m0, m5
paddq m4, m7
punpckldq m7, m1, m5
paddq m4, m0
punpckhdq m1, m5
paddq m4, m7
punpckldq m7, m2, m5
paddq m4, m1
punpckhdq m2, m5
paddq m6, m7
punpckldq m7, m3, m5
paddq m6, m2
punpckhdq m3, m5
paddq m6, m7
paddq m6, m3
add sizeq, mmsize
jl .loop
; accumulate horizontally and store in return value
movhlps m5, m4
movhlps m7, m6
paddq m4, m5
paddq m6, m7
%if ARCH_X86_64
movq rax, m4
movq [sszq], m6
%else
mov eax, sszm
pshufd m5, m4, 0x1
movq [eax], m6
movd eax, m4
movd edx, m5
%endif
RET
; Compute the sum of squared difference between two int16_t vectors.
; int64_t vp9_block_error_fp(int16_t *coeff, int16_t *dqcoeff,
; intptr_t block_size)
INIT_XMM sse2
cglobal block_error_fp, 3, 3, 6, uqc, dqc, size
pxor m4, m4 ; sse accumulator
pxor m5, m5 ; dedicated zero register
lea uqcq, [uqcq+sizeq*2]
lea dqcq, [dqcq+sizeq*2]
neg sizeq
.loop:
mova m2, [uqcq+sizeq*2]
mova m0, [dqcq+sizeq*2]
mova m3, [uqcq+sizeq*2+mmsize]
mova m1, [dqcq+sizeq*2+mmsize]
psubw m0, m2
psubw m1, m3
; individual errors are max. 15bit+sign, so squares are 30bit, and
; thus the sum of 2 should fit in a 31bit integer (+ unused sign bit)
pmaddwd m0, m0
pmaddwd m1, m1
; accumulate in 64bit
punpckldq m3, m0, m5
punpckhdq m0, m5
paddq m4, m3
punpckldq m3, m1, m5
paddq m4, m0
punpckhdq m1, m5
paddq m4, m3
paddq m4, m1
add sizeq, mmsize
jl .loop
; accumulate horizontally and store in return value
movhlps m5, m4
paddq m4, m5
%if ARCH_X86_64
movq rax, m4
%else
pshufd m5, m4, 0x1
movd eax, m4
movd edx, m5
%endif
RET
| 26.146341
| 80
| 0.618159
|
5bef70d7e935da85aac3405976a053e3e49dcfee
| 674
|
asm
|
Assembly
|
oeis/076/A076756.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/076/A076756.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/076/A076756.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A076756: Triangle of coefficients of characteristic polynomial of M_n, the n X n matrix M_(i,j) = min(i,j).
; Submitted by Christian Krause
; 1,-1,1,1,-3,1,-1,5,-6,1,1,-7,15,-10,1,-1,9,-28,35,-15,1,1,-11,45,-84,70,-21,1,-1,13,-66,165,-210,126,-28,1,1,-15,91,-286,495,-462,210,-36,1,-1,17,-120,455,-1001,1287,-924,330,-45,1,1,-19,153,-680,1820,-3003,3003,-1716,495,-55,1,-1,21,-190,969,-3060,6188,-8008,6435,-3003,715,-66,1,1,-23,231,-1330,4845,-11628,18564,-19448,12870,-5005,1001,-78,1,-1,25,-276,1771,-7315,20349,-38760,50388,-43758
lpb $0
add $1,1
sub $0,$1
mov $2,$1
sub $2,$0
lpe
add $1,$2
bin $1,$0
mul $2,-1
mod $2,2
mul $2,$1
mul $2,2
add $2,$1
mov $0,$2
| 35.473684
| 394
| 0.623145
|
8a3166589466669616a7ea4cebaee1fc27825e80
| 1,403
|
asm
|
Assembly
|
PIC16-ASSEMBLY/37_watchDogTimer.asm
|
EnesMercan/PIC-MCU-Projects
|
8edb6017cd362cb975d6f4e613f78d0e529f6ac9
|
[
"MIT"
] | 1
|
2022-01-03T08:03:11.000Z
|
2022-01-03T08:03:11.000Z
|
PIC16-ASSEMBLY/37_watchDogTimer.asm
|
EnesMercan/PIC-MCU-Projects
|
8edb6017cd362cb975d6f4e613f78d0e529f6ac9
|
[
"MIT"
] | null | null | null |
PIC16-ASSEMBLY/37_watchDogTimer.asm
|
EnesMercan/PIC-MCU-Projects
|
8edb6017cd362cb975d6f4e613f78d0e529f6ac9
|
[
"MIT"
] | null | null | null |
; ra0 butonuna 2.3 sn'yi gecmeyen araliklarla basildiginda rb0'daki
; led'in devamli yanmasini saglar. Bu sureden saha uzun basildiginda WDT
; devreye girerek sistemi reset eder. Sistem reset olunca rb3'teki buzzer
; uyari sesi verir. sonra program sonsuz donguye girer. MCLR basarak
; harici reset atilir
;
LIST P = 16F628A
#include "p16f628a.inc"
; CONFIG
; __config 0x3F34
__CONFIG _FOSC_INTOSCIO & _WDTE_ON & _PWRTE_ON & _MCLRE_ON
& _BOREN_OFF & _LVP_OFF & _CPD_OFF & _CP_OFF
;-----------------------------------------------------------------------
ORG H'0000'
SAYAC EQU H'20'
CLRF PORTB
BANKSEL TRISB
CLRF TRISB
MOVLW H'FF'
MOVWF TRISA
BANKSEL PORTB
MOVLW H'07'
MOVWF CMCON
;check WDT
BTFSS STATUS,4 ; T0 is zero?
GOTO BUZZER_SES ; yes, wdt overflow occured
BASLA
BANKSEL OPTION_REG
CLRWDT
MOVLW B'00001111' ; WDT=ON, RESCALER=1/128
MOVWF OPTION_REG
BANKSEL PORTB
BTFSC PORTA,0
GOTO RA0_TEST
CLRWDT
BANKSEL TRISB
MOVLW B'00001111'
MOVWF OPTION_REG
BANKSEL PORTB
BSF PORTB,0
GOTO RA0_TEST
BUZZER_SES
CLRWDT
BSF PORTB,3
CALL GECIKME
BCF PORTB,3
CALL GECIKME
GOTO BUZZER_SES
GECIKME
MOVLW H'FF'
MOVWF SAYAC
LOOP
DECFSZ SAYAC,F
GOTO DONGU
RETURN
END
| 19.760563
| 75
| 0.609408
|
2044f37049d076c57b8d71a41c9cec5b5c035f88
| 303
|
asm
|
Assembly
|
programs/oeis/226/A226279.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/226/A226279.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/226/A226279.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A226279: a(4n) = a(4n+2) = 2*n , a(4n+1) = a(4n+3) = 2*n-1.
; 0,-1,0,-1,2,1,2,1,4,3,4,3,6,5,6,5,8,7,8,7,10,9,10,9,12,11,12,11,14,13,14,13,16,15,16,15,18,17,18,17,20,19,20,19,22,21,22,21,24,23,24,23,26,25,26,25,28,27,28,27,30,29,30,29
mov $1,$0
div $0,4
mul $0,2
gcd $1,2
add $1,$0
sub $1,2
mov $0,$1
| 27.545455
| 173
| 0.554455
|
fe07f442908509a016a5ac6535fc3064f6bcf07e
| 976
|
asm
|
Assembly
|
programs/oeis/008/A008384.asm
|
ckrause/cm
|
0021b6ca0be0fbe79164e647ddfd0e65869304fe
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/008/A008384.asm
|
ckrause/cm
|
0021b6ca0be0fbe79164e647ddfd0e65869304fe
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/008/A008384.asm
|
ckrause/cm
|
0021b6ca0be0fbe79164e647ddfd0e65869304fe
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A008384: Crystal ball sequence for A_4 lattice.
; 1,21,131,471,1251,2751,5321,9381,15421,24001,35751,51371,71631,97371,129501,169001,216921,274381,342571,422751,516251,624471,748881,891021,1052501,1235001,1440271,1670131,1926471,2211251,2526501,2874321,3256881,3676421,4135251,4635751,5180371,5771631,6412121,7104501,7851501,8655921,9520631,10448571,11442751,12506251,13642221,14853881,16144521,17517501,18976251,20524271,22165131,23902471,25740001,27681501,29730821,31891881,34168671,36565251,39085751,41734371,44515381,47433121,50492001,53696501,57051171,60560631,64229571,68062751,72065001,76241221,80596381,85135521,89863751,94786251,99908271,105235131,110772221,116525001,122499001,128699821,135133131,141804671,148720251,155885751,163307121,170990381,178941621,187167001,195672751,204465171,213550631,222935571,232626501,242630001,252952721,263601381,274582771,285903751
mov $2,1
add $2,$0
mul $2,$0
mul $2,7
add $2,5
pow $2,2
mov $0,$2
div $0,168
mul $0,10
add $0,1
| 69.714286
| 828
| 0.839139
|
4a3bbab4c1efac11836e19dfed0d7075b96e3fde
| 1,977
|
asm
|
Assembly
|
programs/oeis/163/A163655.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/163/A163655.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/163/A163655.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A163655: a(n) = n*(2*n^2 + 5*n + 13)/2.
; 0,10,31,69,130,220,345,511,724,990,1315,1705,2166,2704,3325,4035,4840,5746,6759,7885,9130,10500,12001,13639,15420,17350,19435,21681,24094,26680,29445,32395,35536,38874,42415,46165,50130,54316,58729,63375,68260,73390,78771,84409,90310,96480,102925,109651,116664,123970,131575,139485,147706,156244,165105,174295,183820,193686,203899,214465,225390,236680,248341,260379,272800,285610,298815,312421,326434,340860,355705,370975,386676,402814,419395,436425,453910,471856,490269,509155,528520,548370,568711,589549,610890,632740,655105,677991,701404,725350,749835,774865,800446,826584,853285,880555,908400,936826,965839,995445,1025650,1056460,1087881,1119919,1152580,1185870,1219795,1254361,1289574,1325440,1361965,1399155,1437016,1475554,1514775,1554685,1595290,1636596,1678609,1721335,1764780,1808950,1853851,1899489,1945870,1993000,2040885,2089531,2138944,2189130,2240095,2291845,2344386,2397724,2451865,2506815,2562580,2619166,2676579,2734825,2793910,2853840,2914621,2976259,3038760,3102130,3166375,3231501,3297514,3364420,3432225,3500935,3570556,3641094,3712555,3784945,3858270,3932536,4007749,4083915,4161040,4239130,4318191,4398229,4479250,4561260,4644265,4728271,4813284,4899310,4986355,5074425,5163526,5253664,5344845,5437075,5530360,5624706,5720119,5816605,5914170,6012820,6112561,6213399,6315340,6418390,6522555,6627841,6734254,6841800,6950485,7060315,7171296,7283434,7396735,7511205,7626850,7743676,7861689,7980895,8101300,8222910,8345731,8469769,8595030,8721520,8849245,8978211,9108424,9239890,9372615,9506605,9641866,9778404,9916225,10055335,10195740,10337446,10480459,10624785,10770430,10917400,11065701,11215339,11366320,11518650,11672335,11827381,11983794,12141580,12300745,12461295,12623236,12786574,12951315,13117465,13285030,13454016,13624429,13796275,13969560,14144290,14320471,14498109,14677210,14857780,15039825,15223351,15408364,15594870
mov $3,5
lpb $0,1
sub $0,1
add $1,5
add $2,$3
add $1,$2
add $3,6
lpe
| 164.75
| 1,854
| 0.83915
|
1652a5e1d45293057c6e2f97c518697259888992
| 867
|
asm
|
Assembly
|
oeis/067/A067353.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/067/A067353.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/067/A067353.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A067353: Divide the natural numbers in sets of consecutive numbers starting with {1,2} as the first set. The number of elements of the n-th set is equal to the sum of the n-1 final numbers in the (n-1)st set. The final number of the n-th set gives a(n).
; Submitted by Jon Maiga
; 2,4,11,41,199,1184,8273,66163,595439,5954354,65497849,785974133,10217663663,143047291204,2145709367969,34331349887399,583632948085663,10505393065541798,199602468245294009,3992049364905880009,83833036663023479999,1844326806586516559768,42419516551489880874433,1018068397235757140986139,25451709930893928524653199,661744458203242141640982874,17867100371487537824306537273,500278810401651059080583043293,14508085501647880713336908255119,435242565049436421400107247653164
mov $1,3
mov $2,1
mov $3,1
lpb $0
sub $0,1
add $2,1
mul $1,$2
sub $1,$3
add $3,$2
lpe
mov $0,$1
sub $0,1
| 51
| 469
| 0.813149
|
a0e73834024d8a6f68a1f0b06b96ee4f4752f420
| 6,897
|
asm
|
Assembly
|
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_857.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_857.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_857.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 %r12
push %r14
push %r15
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x52b8, %r14
clflush (%r14)
nop
nop
nop
nop
and $30132, %rcx
movl $0x61626364, (%r14)
nop
and $31640, %rcx
lea addresses_WC_ht+0x4038, %rsi
nop
nop
nop
add $63238, %r15
mov $0x6162636465666768, %r11
movq %r11, %xmm4
and $0xffffffffffffffc0, %rsi
vmovaps %ymm4, (%rsi)
nop
nop
nop
sub $2455, %r11
lea addresses_UC_ht+0xee18, %rsi
lea addresses_WC_ht+0x22a0, %rdi
nop
nop
nop
nop
nop
add %r15, %r15
mov $7, %rcx
rep movsb
nop
nop
cmp $21836, %rdi
lea addresses_WC_ht+0x104b8, %rsi
lea addresses_D_ht+0xf685, %rdi
nop
nop
sub %r12, %r12
mov $98, %rcx
rep movsq
nop
nop
nop
cmp $28897, %r8
lea addresses_normal_ht+0x194b8, %r11
nop
nop
nop
nop
and $54944, %rdi
movb $0x61, (%r11)
nop
nop
add %r15, %r15
lea addresses_WT_ht+0x8fb8, %rsi
lea addresses_A_ht+0x173e6, %rdi
nop
nop
add $57609, %r11
mov $98, %rcx
rep movsl
nop
inc %rcx
lea addresses_D_ht+0xb6b8, %r8
nop
sub $35068, %r14
mov $0x6162636465666768, %rdi
movq %rdi, (%r8)
nop
nop
nop
nop
and $18500, %r11
lea addresses_UC_ht+0x4499, %r11
nop
nop
nop
nop
nop
add $62976, %rdi
movw $0x6162, (%r11)
nop
nop
nop
nop
and %r12, %r12
lea addresses_A_ht+0x180b8, %rdi
xor $63183, %r12
vmovups (%rdi), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r11
nop
nop
nop
nop
nop
sub $57567, %r14
lea addresses_WC_ht+0x104b8, %r8
nop
nop
xor %rdi, %rdi
and $0xffffffffffffffc0, %r8
movntdqa (%r8), %xmm4
vpextrq $1, %xmm4, %r11
nop
nop
nop
nop
xor $55547, %r15
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r8
push %rcx
push %rdi
push %rsi
// REPMOV
mov $0xa6f, %rsi
lea addresses_A+0x113b8, %rdi
nop
nop
nop
nop
lfence
mov $100, %rcx
rep movsw
nop
nop
add $36942, %rcx
// Faulty Load
lea addresses_normal+0x3cb8, %r14
nop
nop
nop
add $53835, %r12
mov (%r14), %si
lea oracles, %r14
and $0xff, %rsi
shlq $12, %rsi
mov (%r14,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_P', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 10, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'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.833333
| 2,999
| 0.660142
|
1a96d7d168faee6b366038991eb3a129d1c4247a
| 691
|
asm
|
Assembly
|
oeis/123/A123746.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/123/A123746.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/123/A123746.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A123746: Numerators of partial sums of a series for 1/sqrt(2).
; Submitted by Christian Krause
; 1,1,7,9,107,151,835,1241,26291,40427,207897,327615,3296959,5293843,26189947,42685049,1666461763,2749521971,13266871709,22115585443,211386315749,355490397193,1684973959237,2855358497999,53747636888759,91693947972799,428765608509709,735847502916411,6842866348426343,11806528540631371,54617650510329323,94690664981431737,6976514629282926435,12148172150061786435,55705948969057289925,97388613211031724171,889737040757462988169,1561207760972972700109,7106408624978548469761,12511753820632157438547
seq $0,91520 ; Expansion of 1 / ((1 - 4*x) * sqrt(1 + 4*x)) in powers of x.
lpb $0
dif $0,2
lpe
| 76.777778
| 494
| 0.84081
|
6f2812bce5f4b2a720c70d2b64d3dc38ec7c5e5c
| 312
|
asm
|
Assembly
|
oeis/139/A139292.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/139/A139292.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/139/A139292.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A139292: 2^(2p - 1)/8, where p is prime.
; 1,4,64,1024,262144,4194304,1073741824,17179869184,4398046511104,18014398509481984,288230376151711744,1180591620717411303424,302231454903657293676544,4835703278458516698824704
seq $0,6005 ; The odd prime numbers together with 1.
trn $0,2
mov $2,4
pow $2,$0
mov $0,$2
| 34.666667
| 176
| 0.785256
|
95409931419176477725e6ca2c299e650dda0a46
| 820
|
asm
|
Assembly
|
oeis/142/A142064.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/142/A142064.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/142/A142064.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A142064: Primes congruent to 26 mod 33.
; Submitted by Jon Maiga
; 59,191,257,389,521,587,653,719,983,1049,1181,1511,1709,1907,1973,2039,2237,2633,2699,2897,2963,3359,3491,3557,3623,3821,4019,4217,4283,4349,4481,4547,4679,4877,4943,5009,5273,5471,5669,5801,5867,6131,6197,6263,6329,6659,6791,6857,7121,7187,7253,7451,7517,7583,7649,8111,8243,8573,8837,8969,9431,9497,9629,10091,10223,10289,10487,10883,10949,11213,11279,11411,11807,11939,12071,12203,12269,12401,13127,13259,13457,13523,13721,14051,14249,14447,14843,15107,15173,15569,15767,16097,16229,16361,16427
mov $2,$0
add $2,2
pow $2,2
lpb $2
mul $1,$4
mov $3,$1
add $3,58
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,66
sub $2,1
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
sub $0,7
| 35.652174
| 498
| 0.720732
|
140fcc0641947e8bf1f92172c6b9e4ffac7e8cb5
| 2,114
|
asm
|
Assembly
|
src/coreclr/src/vm/amd64/JitHelpers_SingleAppDomain.asm
|
abock/runtime
|
b3346807be96f6089fc1538946b3611f607389e2
|
[
"MIT"
] | 6
|
2016-07-25T08:33:10.000Z
|
2022-02-10T10:10:51.000Z
|
src/coreclr/src/vm/amd64/JitHelpers_SingleAppDomain.asm
|
abock/runtime
|
b3346807be96f6089fc1538946b3611f607389e2
|
[
"MIT"
] | 15
|
2017-01-27T20:18:50.000Z
|
2019-11-14T00:52:58.000Z
|
src/coreclr/src/vm/amd64/JitHelpers_SingleAppDomain.asm
|
abock/runtime
|
b3346807be96f6089fc1538946b3611f607389e2
|
[
"MIT"
] | 3
|
2021-02-10T16:20:05.000Z
|
2021-03-12T07:55:36.000Z
|
; Licensed to the .NET Foundation under one or more agreements.
; The .NET Foundation licenses this file to you under the MIT license.
; See the LICENSE file in the project root for more information.
; ==++==
;
;
; ==--==
; ***********************************************************************
; File: JitHelpers_SingleAppDomain.asm
;
; Notes: JIT Static access helpers when coreclr host specifies single
; appdomain flag
; ***********************************************************************
include AsmMacros.inc
include asmconstants.inc
; Min amount of stack space that a nested function should allocate.
MIN_SIZE equ 28h
extern JIT_GetSharedNonGCStaticBase_Helper:proc
extern JIT_GetSharedGCStaticBase_Helper:proc
LEAF_ENTRY JIT_GetSharedNonGCStaticBase_SingleAppDomain, _TEXT
; If class is not initialized, bail to C++ helper
test byte ptr [rcx + OFFSETOF__DomainLocalModule__m_pDataBlob + rdx], 1
jz CallHelper
mov rax, rcx
REPRET
align 16
CallHelper:
; Tail call JIT_GetSharedNonGCStaticBase_Helper
jmp JIT_GetSharedNonGCStaticBase_Helper
LEAF_END JIT_GetSharedNonGCStaticBase_SingleAppDomain, _TEXT
LEAF_ENTRY JIT_GetSharedNonGCStaticBaseNoCtor_SingleAppDomain, _TEXT
mov rax, rcx
ret
LEAF_END JIT_GetSharedNonGCStaticBaseNoCtor_SingleAppDomain, _TEXT
LEAF_ENTRY JIT_GetSharedGCStaticBase_SingleAppDomain, _TEXT
; If class is not initialized, bail to C++ helper
test byte ptr [rcx + OFFSETOF__DomainLocalModule__m_pDataBlob + rdx], 1
jz CallHelper
mov rax, [rcx + OFFSETOF__DomainLocalModule__m_pGCStatics]
REPRET
align 16
CallHelper:
; Tail call Jit_GetSharedGCStaticBase_Helper
jmp JIT_GetSharedGCStaticBase_Helper
LEAF_END JIT_GetSharedGCStaticBase_SingleAppDomain, _TEXT
LEAF_ENTRY JIT_GetSharedGCStaticBaseNoCtor_SingleAppDomain, _TEXT
mov rax, [rcx + OFFSETOF__DomainLocalModule__m_pGCStatics]
ret
LEAF_END JIT_GetSharedGCStaticBaseNoCtor_SingleAppDomain, _TEXT
end
| 32.523077
| 82
| 0.69631
|
59bac64000552a01aaff31b58f8a0b52e4c99030
| 759
|
asm
|
Assembly
|
oeis/054/A054479.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/054/A054479.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/054/A054479.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A054479: Number of sets of cycle graphs of 2n nodes where the 2-colored edges alternate colors.
; Submitted by Christian Krause
; 1,0,6,120,6300,514080,62785800,10676746080,2413521910800,700039083744000,253445583029839200,112033456760809584000,59382041886244720843200,37175286835046004765120000,27139206193305890195912400000,22852066417535931447551359680000,21984366159341876104806521930400000,23963575910509477418542728468986880000,29379981392583633602701598994301195200000,40251317123869351796050991861633360352000000,61263473877255310326718109418194151779260800000,103046571401941392676693120885308478646101632000000
mov $1,1
lpb $0
mov $2,$3
add $3,$1
mov $1,$0
sub $0,1
add $1,$0
mul $3,2
mul $3,$1
mul $1,$2
mul $3,$0
lpe
mov $0,$1
| 42.166667
| 491
| 0.833992
|
945c6434efd0042816f1f46425d180022e9a7e71
| 1,175
|
asm
|
Assembly
|
programs/oeis/112/A112653.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/112/A112653.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/112/A112653.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A112653: a(n) squared is congruent to a(n) (mod 13).
; 0,1,13,14,26,27,39,40,52,53,65,66,78,79,91,92,104,105,117,118,130,131,143,144,156,157,169,170,182,183,195,196,208,209,221,222,234,235,247,248,260,261,273,274,286,287,299,300,312,313,325,326,338,339,351,352,364,365,377,378,390,391,403,404,416,417,429,430,442,443,455,456,468,469,481,482,494,495,507,508,520,521,533,534,546,547,559,560,572,573,585,586,598,599,611,612,624,625,637,638,650,651,663,664,676,677,689,690,702,703,715,716,728,729,741,742,754,755,767,768,780,781,793,794,806,807,819,820,832,833,845,846,858,859,871,872,884,885,897,898,910,911,923,924,936,937,949,950,962,963,975,976,988,989,1001,1002,1014,1015,1027,1028,1040,1041,1053,1054,1066,1067,1079,1080,1092,1093,1105,1106,1118,1119,1131,1132,1144,1145,1157,1158,1170,1171,1183,1184,1196,1197,1209,1210,1222,1223,1235,1236,1248,1249,1261,1262,1274,1275,1287,1288,1300,1301,1313,1314,1326,1327,1339,1340,1352,1353,1365,1366,1378,1379,1391,1392,1404,1405,1417,1418,1430,1431,1443,1444,1456,1457,1469,1470,1482,1483,1495,1496,1508,1509,1521,1522,1534,1535,1547,1548,1560,1561,1573,1574,1586,1587,1599,1600,1612,1613
mov $1,$0
div $0,2
mul $0,11
add $1,$0
| 146.875
| 1,079
| 0.753191
|
8f796944af4ecaa781abe603c940f41e7f06eafc
| 168
|
asm
|
Assembly
|
sw/552tests/inst_tests/unaligned/jalr_35.asm
|
JPShen-UWM/ThreadKraken
|
849c510531f28e36d3469535737b2120bd774935
|
[
"MIT"
] | 1
|
2022-02-15T16:03:25.000Z
|
2022-02-15T16:03:25.000Z
|
sw/552tests/inst_tests/unaligned/jalr_35.asm
|
JPShen-UWM/ThreadKraken
|
849c510531f28e36d3469535737b2120bd774935
|
[
"MIT"
] | null | null | null |
sw/552tests/inst_tests/unaligned/jalr_35.asm
|
JPShen-UWM/ThreadKraken
|
849c510531f28e36d3469535737b2120bd774935
|
[
"MIT"
] | null | null | null |
// Original test: ./ullmer/hw4/problem6/jalr_3.asm
// Author: ullmer
// Test source code follows
//test jump and link
//with unaligned target
lbi r0, 24
jalr r0, 13
| 16.8
| 50
| 0.714286
|
90ce07f81af7f853f9f5f172a06bef6131467373
| 3,879
|
asm
|
Assembly
|
PipeLine-CPU/msub_for_wjj.asm
|
MyLife97/MipsPipelineCPU
|
ac9db6234fc041e130bd13bfee6d09f1de1efcfd
|
[
"MIT"
] | null | null | null |
PipeLine-CPU/msub_for_wjj.asm
|
MyLife97/MipsPipelineCPU
|
ac9db6234fc041e130bd13bfee6d09f1de1efcfd
|
[
"MIT"
] | null | null | null |
PipeLine-CPU/msub_for_wjj.asm
|
MyLife97/MipsPipelineCPU
|
ac9db6234fc041e130bd13bfee6d09f1de1efcfd
|
[
"MIT"
] | null | null | null |
init:
addu $27,$0,$0
addu $28,$0,$0
addu $29,$0,$0
addu $30,$0,$0
addu $31,$0,$0
ori $28,$28,4
nop
nop
nop
block_0:
lui $31,0xdd7f
ori $31,$31,0x94ee
lui $12,0x0480
ori $12,$12,0x16da
jal jump_block_0
nop
jump_back_0:
sw $31,0($29)
addu $29,$29,$28
j block_1
ori $30,$0,18
jump_block_0:
msub $31,$12
nop
j jump_back_0
nop
block_1:
lui $31,0x798f
ori $31,$31,0xfcc8
lui $12,0x30b9
ori $12,$12,0xb1dd
jal jump_block_1
nop
jump_back_1:
sw $31,0($29)
addu $29,$29,$28
j block_2
ori $30,$0,78
jump_block_1:
ori $30,$0,28
msub $31,$12
ori $30,$0,47
j jump_back_1
nop
block_2:
lui $23,0x4402
ori $23,$23,0x49f8
lui $13,0xbc7f
ori $13,$13,0xa3b9
jal jump_block_2
nop
jump_back_2:
sw $31,0($29)
addu $29,$29,$28
j block_3
ori $30,$0,44
jump_block_2:
msub $23,$13
nop
j jump_back_2
nop
block_3:
lui $23,0xe1e1
ori $23,$23,0x534a
lui $13,0xfa7f
ori $13,$13,0xdf5b
jal jump_block_3
nop
jump_back_3:
sw $31,0($29)
addu $29,$29,$28
j block_4
nop
jump_block_3:
ori $30,$0,97
msub $23,$13
nop
j jump_back_3
nop
block_4:
lui $31,0x8d8a
ori $31,$31,0x168f
lui $14,0xfad6
ori $14,$14,0x45cc
jal jump_block_4
nop
jump_back_4:
sw $31,0($29)
addu $29,$29,$28
j block_5
ori $30,$0,49
jump_block_4:
msub $31,$14
nop
j jump_back_4
nop
block_5:
lui $31,0x4f89
ori $31,$31,0x71cd
lui $14,0xdfc4
ori $14,$14,0x6ad9
jal jump_block_5
nop
jump_back_5:
sw $31,0($29)
addu $29,$29,$28
j block_6
nop
jump_block_5:
nop
msub $31,$14
nop
j jump_back_5
nop
block_6:
lui $5,0x8ac4
ori $5,$5,0x515c
lui $2,0x16b3
ori $2,$2,0x9499
j jump_block_6
nop
jr_back_6:
addu $8,$0,$31
jalr $5,$8
nop
jump_back_6:
sw $5,0($29)
addu $29,$29,$28
j block_7
ori $30,$0,11
jump_block_6:
jal jr_back_6
nop
msub $5,$2
nop
j jump_back_6
nop
block_7:
lui $5,0xa455
ori $5,$5,0x1228
lui $2,0x1ba2
ori $2,$2,0x51ee
j jump_block_7
nop
jr_back_7:
addu $8,$0,$31
jalr $5,$8
nop
jump_back_7:
sw $5,0($29)
addu $29,$29,$28
j block_8
ori $30,$0,11
jump_block_7:
jal jr_back_7
nop
nop
msub $5,$2
ori $30,$0,44
j jump_back_7
nop
block_8:
lui $0,0x2219
ori $0,$0,0xf94b
lui $22,0xbdd5
ori $22,$22,0xbcff
j jump_block_8
nop
jr_back_8:
addu $13,$0,$31
jalr $0,$13
nop
jump_back_8:
sw $0,0($29)
addu $29,$29,$28
j block_9
ori $30,$0,93
jump_block_8:
jal jr_back_8
nop
msub $0,$22
nop
j jump_back_8
nop
block_9:
lui $0,0xcb75
ori $0,$0,0x9328
lui $22,0x6051
ori $22,$22,0xb61f
j jump_block_9
nop
jr_back_9:
addu $13,$0,$31
jalr $0,$13
nop
jump_back_9:
sw $0,0($29)
addu $29,$29,$28
j block_10
ori $30,$0,50
jump_block_9:
jal jr_back_9
nop
ori $30,$0,57
msub $0,$22
ori $30,$0,67
j jump_back_9
nop
block_10:
lui $24,0x981d
ori $24,$24,0x4fb9
lui $4,0xf558
ori $4,$4,0x2f48
j jump_block_10
nop
jr_back_10:
addu $14,$0,$31
jalr $21,$14
nop
jump_back_10:
sw $21,0($29)
addu $29,$29,$28
j block_11
ori $30,$0,81
jump_block_10:
jal jr_back_10
nop
msub $24,$4
ori $30,$0,24
j jump_back_10
nop
block_11:
| 14.473881
| 23
| 0.513792
|
c2a74f3512ad09c912175c8334fbd6917a3cbc69
| 726
|
asm
|
Assembly
|
tigermoth.asm
|
pmprog/TigerMothC64
|
1acaeb7d5faf069f3406cfd68dbdb6c6a88344df
|
[
"MIT"
] | null | null | null |
tigermoth.asm
|
pmprog/TigerMothC64
|
1acaeb7d5faf069f3406cfd68dbdb6c6a88344df
|
[
"MIT"
] | null | null | null |
tigermoth.asm
|
pmprog/TigerMothC64
|
1acaeb7d5faf069f3406cfd68dbdb6c6a88344df
|
[
"MIT"
] | null | null | null |
VIC = $D000
.org $07FE
.word $0800 ; Program Startup
; -------------------------------------------------------------------[ Boot loader
.byte $00, $0C, $08, $66, $19, $9E, $32, $30, $36, $34
.org $0810
jmp start
.org $0840
.INCLUDE "game_sprites.inc"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Application
.org $4000
start
.INCLUDE "screen_polymath.inc"
menu_loop
jsr titlescreen_start
; cmp #$00
; bne game_notplaying
jsr game_startnewgame
jmp menu_loop
.INCLUDE "screen_title.inc"
.INCLUDE "screen_game.inc"
.INCLUDE "tools_bitmap.inc"
.INCLUDE "tools_charmap.inc"
.INCLUDE "tools_maths.inc"
.INCLUDE "tools_maths_trig.inc"
.INCLUDE "tools_scoring.inc"
.INCLUDE "tools_timing.inc"
.end
| 15.782609
| 82
| 0.590909
|
8d4451ceadeb78394761d19a7458fe3609ece787
| 429
|
asm
|
Assembly
|
src/SonicBoomRiseOfLyric/Mods/FixPauseStateReset/patch_FixPauseStateReset.asm
|
lilystudent2016/cemu_graphic_packs
|
a7aaa6d07df0d5ca3f6475d741fb8b80fadd1a46
|
[
"CC0-1.0"
] | 1,002
|
2017-01-10T13:10:55.000Z
|
2020-11-20T18:34:19.000Z
|
src/SonicBoomRiseOfLyric/Mods/FixPauseStateReset/patch_FixPauseStateReset.asm
|
lilystudent2016/cemu_graphic_packs
|
a7aaa6d07df0d5ca3f6475d741fb8b80fadd1a46
|
[
"CC0-1.0"
] | 347
|
2017-01-11T21:13:20.000Z
|
2020-11-27T11:33:05.000Z
|
src/SonicBoomRiseOfLyric/Mods/FixPauseStateReset/patch_FixPauseStateReset.asm
|
lilystudent2016/cemu_graphic_packs
|
a7aaa6d07df0d5ca3f6475d741fb8b80fadd1a46
|
[
"CC0-1.0"
] | 850
|
2017-01-10T06:06:43.000Z
|
2020-11-06T21:16:49.000Z
|
[WiiULauncher0US]
moduleMatches = 0x90DAC5CE
; Skip CBrbAICompanion::ForceIdle subroutine
0x306EBA0 = nop
[WiiULauncher0EU]
moduleMatches = 0x8F7D2702
; Skip CBrbAICompanion::ForceIdle subroutine
0x306EB80 = nop
[WiiULauncher0JP]
moduleMatches = 0x0D395735
; Skip CBrbAICompanion::ForceIdle subroutine
0x306EA30 = nop
[WiiULauncher16]
moduleMatches = 0x113CC316
; Skip CBrbAICompanion::ForceIdle subroutine
0x306EDBC = nop
| 18.652174
| 44
| 0.818182
|
0885fe0e795282cd28c665e72d97f786dd400fb2
| 701
|
asm
|
Assembly
|
programs/oeis/294/A294629.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/294/A294629.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/294/A294629.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A294629: Partial sums of A294628.
; 4,16,28,56,68,120,132,192,228,296,308,440,452,536,612,736,748,920,932,1112,1204,1320,1332,1624,1676,1808,1916,2144,2156,2496,2508,2760,2884,3048,3156,3600,3612,3792,3932,4336,4348,4784,4796,5120,5388,5600,5612,6224,6292,6640,6812,7184,7196,7728,7868,8384,8572,8832,8844,9712,9724,10000,10332,10840,10996,11624,11636,12104,12324,12920,12932,13920,13932,14256,14652,15168,15324,16048,16060,16912,17236,17592,17604,18728,18916,19288,19556,20296,20308,21464,21636,22248,22532,22936,23140,24392,24404,24992,25452,26392
seq $0,294016 ; a(n) = sum of all divisors of all positive integers <= n, minus the sum of remainders of n mod k, for k = 1, 2, 3, ..., n.
mul $0,4
| 116.833333
| 515
| 0.761769
|
174dae9acb1fde2d15b8e0be163b88c61e3d1cd8
| 10,261
|
asm
|
Assembly
|
Appl/Preferences/PrefMgr/prefmgrSerial.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Appl/Preferences/PrefMgr/prefmgrSerial.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Appl/Preferences/PrefMgr/prefmgrSerial.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 73
|
2018-11-19T20:46:53.000Z
|
2022-03-29T00:59:26.000Z
|
COMMENT @--------------------------------------------------------------------
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE:
AUTHOR: Cheng, 6/90
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 6/90 Initial revision
DESCRIPTION:
$Id: prefmgrSerial.asm,v 1.1 97/04/04 16:27:27 newdeal Exp $
----------------------------------------------------------------------------@
CheckHack <offset SF_LENGTH eq 0>
;
; If this hack ain't true, change every occurrence of SL_8BITS (etc)
; to be shifted left by the offset SF_LENGTH
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialSetOptionsCategory
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the initfile category for the serial options
CALLED BY: INTNERAL
PASS: CX:DX = Pointer to category hodling serial options
(DBCS if DBCS)
RETURN: Nothing
DESTROYED: AX, BX, DI, SI, BP
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialSetOptionsCategory proc near
uses cx, dx
.enter
; First set the initfile category
;
push cx, dx
mov ax, MSG_PREF_SET_INIT_FILE_CATEGORY
call SerialOptionsObjMessageCall
; Now set the text
;
mov bx, handle ComPortText
mov si, offset ComPortText
pop dx, bp
call SetText
.leave
ret
SerialSetOptionsCategory endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialSaveOptions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Save the options stored in the UI gadgets to the initfile
CALLED BY: GLOBAL
PASS: Nothing
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, DI, SI, BP
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
Assumes that the initfile category has already been set
with an earlier call to SerialSetOptionsCategory
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialSaveOptions proc near
mov ax, MSG_META_SAVE_OPTIONS
GOTO SerialOptionsObjMessageCall
SerialSaveOptions endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefMgrSerialSetWordLength
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Deal with a selection of the word length
CALLED BY: GLOBAL (MSG_SERIAL_SET_WORD_LENGTH)
PASS: DS, ES = DGroup
CX = Word length
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, DI, SI, BP
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefMgrSerialSetWordLength method dynamic PrefMgrClass,
MSG_SERIAL_SET_WORD_LENGTH
.enter
cmp cx, SL_5BITS shl offset SF_LENGTH
jne not5
;if entry '2' has the exclusive, move it to '1'
;
mov cx, SB_2
jmp checkEntrySelected
;if entry '1.5' has the exclusive, move it to '1'
not5:
mov cx, SB_1_5
checkEntrySelected:
mov ax, MSG_GEN_ITEM_GROUP_IS_ITEM_SELECTED
mov bx, handle StopBitsList
mov si, offset StopBitsList
mov di, mask MF_CALL
call ObjMessage
jnc done
mov cx, SB_1
call UtilSetSelection
done:
.leave
ret
PrefMgrSerialSetWordLength endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefMgrSerialSetStopRemote
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: If neither of the "stop remote" things are set, then
turn off the HARDWARE item
CALLED BY: GLOBAL (MSG_SERIAL_SET_STOP_REMOTE)
PASS: DS, ES = DGroup
CX = Selection, or GIGS_NONE if none
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, DI, SI, BP
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefMgrSerialSetStopRemote method dynamic PrefMgrClass,
MSG_SERIAL_SET_STOP_REMOTE
.enter
; Turn off the HARDWARE item in the handshake list.
;
cmp cx, GIGS_NONE
jne done
mov ax, MSG_GEN_ITEM_GROUP_SET_ITEM_STATE
mov cx, mask SFC_HARDWARE
clr dx
mov bx, handle HandshakeList
mov si, offset HandshakeList
clr di
call ObjMessage
done:
.leave
ret
PrefMgrSerialSetStopRemote endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialObtainSettings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get all the setttings for a serial port
CALLED BY: VerifyPortSelection
PASS: BP = Local data
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, DI, SI
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 4/30/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialObtainSettings proc near
installing local word ; non-zero if we're installing a printer
portParams local PrintPortInfo
.enter inherit
; for serial ports, we need to fetch a whole lot more data.
; assume all the UI objects are in one resource
mov serialParams.SPP_portNum, cx
mov bx, handle SerialUI
; query the various UI objects to get the other pieces. Start
; with the baud rate.
mov si, offset SerialUI:BaudRateList
call UtilGetSelection ; cx <- baud rate
mov serialParams.SPP_baud, cx
; next get the parity setting
mov si, offset SerialUI:ParityList
call UtilGetSelection ; cl <- parity setting
mov serialParams.SPP_format, cl
; next get the word length setting
mov si, offset SerialUI:WordLengthList
call UtilGetSelection ; cl <- word length
or serialParams.SPP_format, cl
mov serialParams.SPP_mode, SM_COOKED ; assume cooked
cmp cl, SL_7BITS ; if seven bits
je getStopBits ; then we're OK
mov serialParams.SPP_mode, SM_RAW ; must be raw
; check for extra stop bits
getStopBits:
mov si, offset SerialUI:StopBitsList
call UtilGetSelection
tst cl
jz afterExtra
or serialParams.SPP_format, mask SF_EXTRA_STOP
afterExtra:
; get the handshake bits.
mov bx, handle HandshakeList
mov si, offset HandshakeList
call UtilGetSelectedBooleansFromItemGroup
mov serialParams.SPP_flow, al
mov bx, handle StopRemoteList
mov si, offset StopRemoteList
call UtilGetSelectedBooleansFromItemGroup
mov serialParams.SPP_stopRem, al ; assume DTR
mov bx, handle StopLocalList
mov si, offset StopLocalList
call UtilGetSelectedBooleansFromItemGroup
mov serialParams.SPP_stopLoc, al
.leave
ret
SerialObtainSettings endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialOptionsObjMessageCall
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calls the serial dialog box with the passed message
CALLED BY: INTERNAL
PASS: AX = Message
RETURN: see message documentation
DESTROYED: see messaage documentation, BX, SI, DI
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialOptionsObjMessageCall proc near
mov bx, handle SerialPortDialog
mov si, offset SerialPortDialog
mov di, mask MF_CALL
call ObjMessage
ret
SerialOptionsObjMessageCall endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UtilGetSelectedBooleansFromItemGroup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: return the bitwise OR of all the identifiers of all
the selected items in a non-exclusive item group, for
those times when you need to use PrefStringItem children
and so can't use a PrefBooleanGroup
CALLED BY:
PASS: ^lbx:si - item group
RETURN: ax - selected booleans
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CDB 4/20/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UGSBFIG_MAX_SELECTIONS equ 16 ; at most 16 bits, so...
UtilGetSelectedBooleansFromItemGroup proc near
uses cx,dx,bp
.enter
mov bp, UGSBFIG_MAX_SELECTIONS
sub sp, size word * UGSBFIG_MAX_SELECTIONS
mov cx, ss
mov dx, sp
mov ax, MSG_GEN_ITEM_GROUP_GET_MULTIPLE_SELECTIONS
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
mov bp, UGSBFIG_MAX_SELECTIONS
sub bp, ax ; bp <- number of extra words to clear
mov_tr cx, ax
clr ax
jcxz mergeDone
mergeLoop:
pop dx
or ax, dx
loop mergeLoop
mergeDone:
shl bp
add sp, bp
.leave
ret
UtilGetSelectedBooleansFromItemGroup endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialLoadOptions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Load the options for the a serial port
CALLED BY: INTERNAL
PASS: Nothing
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, DI, SI, BP
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
Assumes that the initfile category has already been set
with an earlier call to SerialSetOptionsCategory
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialLoadOptions proc near
mov ax, MSG_META_LOAD_OPTIONS
GOTO SerialOptionsObjMessageCall
SerialLoadOptions endp
| 23.480549
| 78
| 0.575675
|
1958c8e843fb4a71854abb909045f352bb65d211
| 591
|
asm
|
Assembly
|
oeis/027/A027966.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/027/A027966.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/027/A027966.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A027966: T(n, 2*n-4), T given by A027960.
; 1,4,11,26,54,101,174,281,431,634,901,1244,1676,2211,2864,3651,4589,5696,6991,8494,10226,12209,14466,17021,19899,23126,26729,30736,35176,40079,45476,51399,57881,64956,72659,81026,90094,99901,110486,121889,134151,147314,161421,176516,192644,209851,228184,247691,268421,290424,313751,338454,364586,392201,421354,452101,484499,518606,554481,592184,631776,673319,716876,762511,810289,860276,912539,967146,1024166,1083669,1145726,1210409,1277791,1347946,1420949,1496876,1575804,1657811,1742976,1831379
mov $1,$0
add $0,4
bin $0,$1
pow $1,2
sub $0,$1
| 65.666667
| 497
| 0.791878
|
09d9c8e799ab92b183eea4fc60a71ed1e44916c9
| 479
|
asm
|
Assembly
|
oeis/349/A349541.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/349/A349541.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/349/A349541.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A349541: E.g.f.: exp(x) * (BesselI(0,8*x) + BesselI(1,8*x)).
; Submitted by Christian Krause
; 1,5,41,301,2513,20181,170745,1423101,12161441,103344037,889924553,7650373325,66271512433,574065261173,4996181205657,43511277885597,380108373809985,3323551100483397,29122753514303337,255427680480306285,2243831648555990289,19728657265135701525
mov $1,1
mov $3,$0
lpb $3
mul $1,$3
cmp $2,0
add $5,$2
div $1,$5
add $4,$1
mul $1,4
sub $3,1
lpe
mov $0,$4
mul $0,4
add $0,1
| 25.210526
| 243
| 0.724426
|
f8fce5b93a8cb110857798216e5a99ecf4d26bef
| 624
|
asm
|
Assembly
|
src/util/oli/qdos/jbase.asm
|
olifink/qspread
|
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
|
[
"MIT"
] | null | null | null |
src/util/oli/qdos/jbase.asm
|
olifink/qspread
|
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
|
[
"MIT"
] | null | null | null |
src/util/oli/qdos/jbase.asm
|
olifink/qspread
|
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
|
[
"MIT"
] | null | null | null |
* base address of job
*
include win1_keys_qdos_sms
include win1_mac_oli
section utility
xdef ut_jbase
;+++
; find base address of job
;
; Entry Exit
; d1.l job ID (or -1) preserved
; a1 base address of job
;
; errors: ijob
;---
ut_jbase subr d1-d3/a0
moveq #0,d2 ; system job at top of tree
moveq #sms.injb,d0 ; information on job
trap #do.sms2
move.l a0,a1
tst.l d0
subend
end
| 21.517241
| 67
| 0.4375
|
ed5ea73ef735bbb591c52fcda4eeb1bb5dc34c79
| 5,657
|
asm
|
Assembly
|
Windows/FastFind8.asm
|
clayne/FastExtrema
|
9d38cdcd095f7ea07e94c9690b79bcd9ac1228b3
|
[
"MIT"
] | 6
|
2021-04-02T16:09:13.000Z
|
2022-01-24T11:15:48.000Z
|
Windows/FastFind8.asm
|
komrad36/FastArrayOps
|
9d38cdcd095f7ea07e94c9690b79bcd9ac1228b3
|
[
"MIT"
] | null | null | null |
Windows/FastFind8.asm
|
komrad36/FastArrayOps
|
9d38cdcd095f7ea07e94c9690b79bcd9ac1228b3
|
[
"MIT"
] | 1
|
2021-02-17T21:51:17.000Z
|
2021-02-17T21:51:17.000Z
|
; /*******************************************************************
; *
; * Author: Kareem Omar
; * kareem.h.omar@gmail.com
; * https://github.com/komrad36
; *
; * Last updated Mar 12, 2021
; *******************************************************************/
_TEXT$FastFind8 SEGMENT ALIGN(64)
FastFind8 PROC
vmovd xmm0,r8d
vpbroadcastb ymm0,xmm0
cmp rdx,256
jae CASE_LARGE
lea r9,JUMP_TABLE
movzx eax,word ptr [r9+2*rdx]
add r9,rax
xor eax,eax
lea r10,[rax-1]
jmp r9
db 24 DUP (0CCh)
JUMP_TABLE:
dw 1 DUP ( CASE_0 - JUMP_TABLE)
dw 1 DUP ( CASE_1 - JUMP_TABLE)
dw 1 DUP ( CASE_2 - JUMP_TABLE)
dw 1 DUP ( CASE_3 - JUMP_TABLE)
dw 4 DUP ( CASE_4 - JUMP_TABLE)
dw 8 DUP ( CASE_8 - JUMP_TABLE)
dw 16 DUP ( CASE_16 - JUMP_TABLE)
dw 32 DUP ( CASE_32 - JUMP_TABLE)
dw 32 DUP ( CASE_64 - JUMP_TABLE)
dw 32 DUP ( CASE_96 - JUMP_TABLE)
dw 32 DUP (CASE_128 - JUMP_TABLE)
dw 32 DUP (CASE_160 - JUMP_TABLE)
dw 32 DUP (CASE_192 - JUMP_TABLE)
dw 32 DUP (CASE_224 - JUMP_TABLE)
CASE_224:
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx]
vptest ymm1,ymm1
jnz FOUND_SMALL
add eax,32
CASE_192:
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx+rax]
vptest ymm1,ymm1
jnz FOUND_SMALL
add eax,32
CASE_160:
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx+rax]
vptest ymm1,ymm1
jnz FOUND_SMALL
add eax,32
CASE_128:
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx+rax]
vptest ymm1,ymm1
jnz FOUND_SMALL
add eax,32
CASE_96:
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx+rax]
vptest ymm1,ymm1
jnz FOUND_SMALL
add eax,32
CASE_64:
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx+rax]
vptest ymm1,ymm1
jnz FOUND_SMALL
add eax,32
CASE_32:
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx+rax]
vptest ymm1,ymm1
jnz FOUND_SMALL
lea eax,[rdx-32]
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx+rax]
vptest ymm1,ymm1
jnz FOUND_SMALL
mov rax,r10
ret
CASE_16:
vpcmpeqb xmm1,xmm0,xmmword ptr [rcx]
vptest xmm1,xmm1
jnz FOUND_SMALL
lea eax,[rdx-16]
vpcmpeqb xmm1,xmm0,xmmword ptr [rcx+rax]
vptest xmm1,xmm1
jnz FOUND_SMALL
mov rax,r10
ret
CASE_8:
vpbroadcastq xmm1,qword ptr [rcx]
vpcmpeqb xmm1,xmm0,xmm1
vptest xmm1,xmm1
jnz FOUND_SMALL
lea eax,[rdx-8]
vpbroadcastq xmm1,qword ptr [rcx+rax]
vpcmpeqb xmm1,xmm0,xmm1
vptest xmm1,xmm1
jnz FOUND_SMALL
mov rax,r10
ret
CASE_4:
vpbroadcastd xmm1,dword ptr [rcx]
vpcmpeqb xmm1,xmm0,xmm1
vptest xmm1,xmm1
jnz FOUND_SMALL
lea eax,[rdx-4]
vpbroadcastd xmm1,dword ptr [rcx+rax]
vpcmpeqb xmm1,xmm0,xmm1
vptest xmm1,xmm1
jnz FOUND_SMALL
mov rax,r10
ret
CASE_3:
cmp r8b,byte ptr [rcx]
je FOUND_SMALL_SCALAR
inc eax
CASE_2:
cmp r8b,byte ptr [rcx+rax]
je FOUND_SMALL_SCALAR
inc eax
CASE_1:
cmp r8b,byte ptr [rcx+rax]
je FOUND_SMALL_SCALAR
CASE_0:
mov rax,r10
FOUND_SMALL_SCALAR:
ret
FOUND_SMALL:
vpmovmskb ecx,ymm1
tzcnt ecx,ecx
add eax,ecx
ret
CASE_LARGE:
lea rdx,[rcx+rdx]
add rcx,256
mov r11,rcx
LOOP_TOP:
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx-256]
vpcmpeqb ymm2,ymm0,ymmword ptr [rcx-224]
vpor ymm1,ymm1,ymm2
vpcmpeqb ymm3,ymm0,ymmword ptr [rcx-192]
vpcmpeqb ymm4,ymm0,ymmword ptr [rcx-160]
vpor ymm3,ymm3,ymm4
vpor ymm1,ymm1,ymm3
vpcmpeqb ymm2,ymm0,ymmword ptr [rcx-128]
vpcmpeqb ymm3,ymm0,ymmword ptr [rcx-96]
vpor ymm2,ymm2,ymm3
vpcmpeqb ymm4,ymm0,ymmword ptr [rcx-64]
vpcmpeqb ymm5,ymm0,ymmword ptr [rcx-32]
vpor ymm4,ymm4,ymm5
vpor ymm2,ymm2,ymm4
vpor ymm1,ymm1,ymm2
vptest ymm1,ymm1
jnz FOUND
add rcx,256
cmp rcx,rdx
jb LOOP_TOP
mov rcx,rdx
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx-256]
vpcmpeqb ymm2,ymm0,ymmword ptr [rcx-224]
vpor ymm1,ymm1,ymm2
vpcmpeqb ymm3,ymm0,ymmword ptr [rcx-192]
vpcmpeqb ymm4,ymm0,ymmword ptr [rcx-160]
vpor ymm3,ymm3,ymm4
vpor ymm1,ymm1,ymm3
vpcmpeqb ymm2,ymm0,ymmword ptr [rcx-128]
vpcmpeqb ymm3,ymm0,ymmword ptr [rcx-96]
vpor ymm2,ymm2,ymm3
vpcmpeqb ymm4,ymm0,ymmword ptr [rcx-64]
vpcmpeqb ymm5,ymm0,ymmword ptr [rcx-32]
vpor ymm4,ymm4,ymm5
vpor ymm2,ymm2,ymm4
vpor ymm1,ymm1,ymm2
vptest ymm1,ymm1
jnz FOUND
mov rax,-1
ret
FOUND:
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx-256]
vpmovmskb eax,ymm1
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx-224]
vpmovmskb edx,ymm1
shl rdx,32
or rax,rdx
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx-192]
vpmovmskb edx,ymm1
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx-160]
vpmovmskb r8d,ymm1
shl r8,32
or rdx,r8
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx-128]
vpmovmskb r8d,ymm1
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx-96]
vpmovmskb r9d,ymm1
shl r9,32
or r8,r9
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx-64]
vpmovmskb r9d,ymm1
vpcmpeqb ymm1,ymm0,ymmword ptr [rcx-32]
vpmovmskb r10d,ymm1
shl r10,32
or r9,r10
tzcnt r9,r9
add r9b,192
tzcnt r8,r8
lea r8d,[r8+128]
cmovnc r9d,r8d
tzcnt rdx,rdx
lea edx,[rdx+64]
cmovnc r9d,edx
tzcnt rax,rax
cmovc eax,r9d
sub rcx,r11
add rax,rcx
ret
FastFind8 ENDP
_TEXT$FastFind8 ENDS
END
| 24.811404
| 70
| 0.601732
|
949572225093e83048bdcd7b2151942f5f1681c0
| 4,855
|
asm
|
Assembly
|
fast_addr.asm
|
healym/8051-fast-adder
|
6ae717805277ceb219dc475f1d737b0696d48d9a
|
[
"MIT"
] | null | null | null |
fast_addr.asm
|
healym/8051-fast-adder
|
6ae717805277ceb219dc475f1d737b0696d48d9a
|
[
"MIT"
] | null | null | null |
fast_addr.asm
|
healym/8051-fast-adder
|
6ae717805277ceb219dc475f1d737b0696d48d9a
|
[
"MIT"
] | null | null | null |
; Author: Matthew Healy <mhealy@mst.edu>
; Jaxson Johnston <jnjt37@mst.edu>
; Lukas Grbesa <lgqq3@mst.edu>
; Group: NULL
; Date: 29 November 2017
; License: MIT License
; Description: This program simulates the functionality of a
; carry lookahead fast adder using an 8051 microcontroller.
; Since this is a software simulation, it does not perform as
; quickly as an implementation in logic gates, but it serves
; as a proof-of-concept.
MOV 40H, #00H ; Input A
MOV 41H, #00H
MOV 42H, #00H
MOV 43H, #00H
MOV 44H, #00H
MOV 45H, #00H
MOV 46H, #00H
MOV 47H, #00H
MOV 48H, #00H ; Input B
MOV 49H, #00H
MOV 4AH, #00H
MOV 4BH, #00H
MOV 4CH, #00H
MOV 4DH, #00H
MOV 4EH, #00H
MOV 4FH, #00H
MOV R2, #8H ; Length of longest operand in bytes
MOV R0, #40H
MOV R1, #48H
MOV A, R2
MOV R5, A ; length of operands stored in R2
SETUP: MOV SCON, #10000010B
MOV TMOD, #00010000B
MOV TL1, #00H ; start timer at 0
MOV TH1, #00H ; start timer at 0
INPUTA: JNB TI, $ ; wait until ready to transmit
CLR TI
MOV A, @R0
MOV C, P
MOV TB8, C ; set odd parity bit
MOV SBUF, A ; output byte of A
INC R0 ; move to next byte
DJNZ R5, INPUTA
MOV R0, #40H ; reset to beginning of A
MOV A, R2 ; reset counter
MOV R5, A
INPUTB: JNB TI, $ ; wait until ready to transmit
CLR TI
MOV A, @R1
MOV C, P
MOV TB8, C ; set odd parity bit
MOV SBUF, A ; output byte of B
INC R1
DJNZ R5, INPUTB
MOV R1, #48H ; reset to beginning of B
SETB TR1 ; start timer
MOV A, R2 ; init counter
MOV R5, A
LOAD: MOV A, @R0 ; temp hold for byte of R6 data
MOV R4, A
MOV A, @R0
XRL A, @R1 ; propagate
MOV @R0, A
MOV A, @R1
ANL A, R4 ; generate
MOV @R1, A
INC R0 ; move to next bit of P
INC R1 ; move to next bit of G
DJNZ R5, LOAD
MOV A, R2 ; reset R5
MOV R5, A
CLR C ; C will be used as Ci in boolean equation
MOV A, R2
DEC A
ADD A, #40H
MOV R0, A ; point at least significant byte
MOV A, R2
DEC A
ADD A, #48H
MOV R1, A ; point at least significant byte
CARRY: MOV B, @R1
MOV A, @R0
MOV R4, #8H ; set counter for 8 rotations
MOV 0D6H, C ; store carry-in
BITE: ANL C, 0E0H ; intermediate = Ci AND P(i+1)
ORL C, 0F0H
MOV 0F0H, C ; save Ci into C as well as R3.0
RR A ; rotate P byte
MOV @R1, A ; store P byte in mem
MOV A, B ; move G/C to A for rotation
RR A ; rotate G/C byte
MOV B, A ; replace byte in R3
MOV A, @R1 ; reload P from mem
DJNZ R4, BITE ; repeat for whole byte
MOV A, B
MOV 0D5H, C ; store carry-out
CLR C
RLC A ; rotate C/G string to align carrys over correct bits
MOV C, 0D5H ; restore carry-out
JNB 0D6H, NOINC
INC A ; increment if there was a carry-in
NOINC: MOV @R1, A ; replace C/G in memory
DEC R0
DEC R1
DJNZ R5, CARRY
MOV R0, #40H ; return to beginning of P
MOV R1, #48H ; return to beginning of C/G
MOV A, R2
MOV R5, A
SUM: MOV A, @R0
XRL A, @R1
MOV @R0, A ; compute final sum
INC R0 ; move to next bit of P
INC R1 ; move to next bit of Carry string
DJNZ R5, SUM
CLR TR1 ; stop timer
TIME: JNB TI, $ ; wait until ready to transmit
CLR TI
MOV A, TH1
MOV C, P
MOV TB8, C ; set odd parity bit
MOV SBUF, A ; output high byte of time
JNB TI, $ ; wait until ready to transmit
CLR TI
MOV A, TL1
MOV C, P ; set odd parity bit
MOV TB8, C
MOV SBUF, A ; output low byte of time
MOV A, R2
MOV R5, A
MOV R0, #40H ; reset R0 to beginning of result string
OUT: JNB TI, $ ; wait until ready to transmit
CLR TI
MOV A, @R0
MOV C, P
MOV TB8, C ; set odd parity bit
MOV SBUF, A ; output byte of result
INC R0
DJNZ R5, OUT
FLUSH: MOV A, #0FFH
MOV C, P
MOV TB8, C
MOV SBUF, A ; output dummy byte to flush output
END
| 29.785276
| 76
| 0.491658
|
57223131b10e90d9a2a68b9efe9be4a290dd1b90
| 5,733
|
asm
|
Assembly
|
Tests/yasm-regression/amd-fma4.asm
|
13xforever/x86-assembly-textmate-bundle
|
f1bb62f77b776d87d0fd85b0276d4237ff72c43c
|
[
"MIT"
] | 69
|
2015-04-16T18:01:22.000Z
|
2022-02-15T07:54:26.000Z
|
Tests/yasm-regression/amd-fma4.asm
|
javiercbk/x86-assembly-textmate-bundle
|
62d700e0196f62ef4353a9b95c2e64beb0a6afda
|
[
"MIT"
] | 17
|
2016-09-20T08:49:09.000Z
|
2021-02-19T15:01:04.000Z
|
Tests/yasm-regression/amd-fma4.asm
|
javiercbk/x86-assembly-textmate-bundle
|
62d700e0196f62ef4353a9b95c2e64beb0a6afda
|
[
"MIT"
] | 19
|
2016-05-31T07:11:14.000Z
|
2021-07-19T10:17:12.000Z
|
[bits 64]
vfmaddpd xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 69 c2 30
vfmaddpd xmm0, xmm1, [rax], xmm3 ; out: c4 e3 71 69 00 30
vfmaddpd xmm0, xmm1, dqword [rax], xmm3 ; out: c4 e3 71 69 00 30
vfmaddpd xmm0, xmm1, xmm2, [rax] ; out: c4 e3 f1 69 00 20
vfmaddpd xmm0, xmm1, xmm2, dqword [rax] ; out: c4 e3 f1 69 00 20
vfmaddpd ymm0, ymm1, ymm2, ymm3 ; out: c4 e3 75 69 c2 30
vfmaddpd ymm0, ymm1, [rax], ymm3 ; out: c4 e3 75 69 00 30
vfmaddpd ymm0, ymm1, yword [rax], ymm3 ; out: c4 e3 75 69 00 30
vfmaddpd ymm0, ymm1, ymm2, [rax] ; out: c4 e3 f5 69 00 20
vfmaddpd ymm0, ymm1, ymm2, yword [rax] ; out: c4 e3 f5 69 00 20
vfmaddps xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 68 c2 30
vfmaddps xmm0, xmm1, dqword [rax], xmm3 ; out: c4 e3 71 68 00 30
vfmaddps xmm0, xmm1, xmm2, dqword [rax] ; out: c4 e3 f1 68 00 20
vfmaddps ymm0, ymm1, ymm2, ymm3 ; out: c4 e3 75 68 c2 30
vfmaddps ymm0, ymm1, yword [rax], ymm3 ; out: c4 e3 75 68 00 30
vfmaddps ymm0, ymm1, ymm2, yword [rax] ; out: c4 e3 f5 68 00 20
vfmaddsd xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 6b c2 30
vfmaddsd xmm0, xmm1, [rax], xmm3 ; out: c4 e3 71 6b 00 30
vfmaddsd xmm0, xmm1, qword [rax], xmm3 ; out: c4 e3 71 6b 00 30
vfmaddsd xmm0, xmm1, xmm2, [rax] ; out: c4 e3 f1 6b 00 20
vfmaddsd xmm0, xmm1, xmm2, qword [rax] ; out: c4 e3 f1 6b 00 20
vfmaddss xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 6a c2 30
vfmaddss xmm0, xmm1, dword [rax], xmm3 ; out: c4 e3 71 6a 00 30
vfmaddss xmm0, xmm1, xmm2, dword [rax] ; out: c4 e3 f1 6a 00 20
vfmaddsubpd xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 5d c2 30
vfmaddsubpd xmm0, xmm1, dqword [rax], xmm3 ; out: c4 e3 71 5d 00 30
vfmaddsubpd xmm0, xmm1, xmm2, dqword [rax] ; out: c4 e3 f1 5d 00 20
vfmaddsubpd ymm0, ymm1, ymm2, ymm3 ; out: c4 e3 75 5d c2 30
vfmaddsubpd ymm0, ymm1, yword [rax], ymm3 ; out: c4 e3 75 5d 00 30
vfmaddsubpd ymm0, ymm1, ymm2, yword [rax] ; out: c4 e3 f5 5d 00 20
vfmaddsubps xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 5c c2 30
vfmaddsubps xmm0, xmm1, dqword [rax], xmm3 ; out: c4 e3 71 5c 00 30
vfmaddsubps xmm0, xmm1, xmm2, dqword [rax] ; out: c4 e3 f1 5c 00 20
vfmaddsubps ymm0, ymm1, ymm2, ymm3 ; out: c4 e3 75 5c c2 30
vfmaddsubps ymm0, ymm1, yword [rax], ymm3 ; out: c4 e3 75 5c 00 30
vfmaddsubps ymm0, ymm1, ymm2, yword [rax] ; out: c4 e3 f5 5c 00 20
vfmsubpd xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 6d c2 30
vfmsubpd xmm0, xmm1, dqword [rax], xmm3 ; out: c4 e3 71 6d 00 30
vfmsubpd xmm0, xmm1, xmm2, dqword [rax] ; out: c4 e3 f1 6d 00 20
vfmsubpd ymm0, ymm1, ymm2, ymm3 ; out: c4 e3 75 6d c2 30
vfmsubpd ymm0, ymm1, yword [rax], ymm3 ; out: c4 e3 75 6d 00 30
vfmsubpd ymm0, ymm1, ymm2, yword [rax] ; out: c4 e3 f5 6d 00 20
vfmsubps xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 6c c2 30
vfmsubps xmm0, xmm1, dqword [rax], xmm3 ; out: c4 e3 71 6c 00 30
vfmsubps xmm0, xmm1, xmm2, dqword [rax] ; out: c4 e3 f1 6c 00 20
vfmsubps ymm0, ymm1, ymm2, ymm3 ; out: c4 e3 75 6c c2 30
vfmsubps ymm0, ymm1, yword [rax], ymm3 ; out: c4 e3 75 6c 00 30
vfmsubps ymm0, ymm1, ymm2, yword [rax] ; out: c4 e3 f5 6c 00 20
vfmsubsd xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 6f c2 30
vfmsubsd xmm0, xmm1, qword [rax], xmm3 ; out: c4 e3 71 6f 00 30
vfmsubsd xmm0, xmm1, xmm2, qword [rax] ; out: c4 e3 f1 6f 00 20
vfmsubss xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 6e c2 30
vfmsubss xmm0, xmm1, dword [rax], xmm3 ; out: c4 e3 71 6e 00 30
vfmsubss xmm0, xmm1, xmm2, dword [rax] ; out: c4 e3 f1 6e 00 20
vfnmaddpd xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 79 c2 30
vfnmaddpd xmm0, xmm1, dqword [rax], xmm3 ; out: c4 e3 71 79 00 30
vfnmaddpd xmm0, xmm1, xmm2, dqword [rax] ; out: c4 e3 f1 79 00 20
vfnmaddpd ymm0, ymm1, ymm2, ymm3 ; out: c4 e3 75 79 c2 30
vfnmaddpd ymm0, ymm1, yword [rax], ymm3 ; out: c4 e3 75 79 00 30
vfnmaddpd ymm0, ymm1, ymm2, yword [rax] ; out: c4 e3 f5 79 00 20
vfnmaddps xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 78 c2 30
vfnmaddps xmm0, xmm1, dqword [rax], xmm3 ; out: c4 e3 71 78 00 30
vfnmaddps xmm0, xmm1, xmm2, dqword [rax] ; out: c4 e3 f1 78 00 20
vfnmaddps ymm0, ymm1, ymm2, ymm3 ; out: c4 e3 75 78 c2 30
vfnmaddps ymm0, ymm1, yword [rax], ymm3 ; out: c4 e3 75 78 00 30
vfnmaddps ymm0, ymm1, ymm2, yword [rax] ; out: c4 e3 f5 78 00 20
vfnmaddsd xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 7b c2 30
vfnmaddsd xmm0, xmm1, qword [rax], xmm3 ; out: c4 e3 71 7b 00 30
vfnmaddsd xmm0, xmm1, xmm2, qword [rax] ; out: c4 e3 f1 7b 00 20
vfnmaddss xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 7a c2 30
vfnmaddss xmm0, xmm1, dword [rax], xmm3 ; out: c4 e3 71 7a 00 30
vfnmaddss xmm0, xmm1, xmm2, dword [rax] ; out: c4 e3 f1 7a 00 20
vfnmsubpd xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 7d c2 30
vfnmsubpd xmm0, xmm1, dqword [rax], xmm3 ; out: c4 e3 71 7d 00 30
vfnmsubpd xmm0, xmm1, xmm2, dqword [rax] ; out: c4 e3 f1 7d 00 20
vfnmsubpd ymm0, ymm1, ymm2, ymm3 ; out: c4 e3 75 7d c2 30
vfnmsubpd ymm0, ymm1, yword [rax], ymm3 ; out: c4 e3 75 7d 00 30
vfnmsubpd ymm0, ymm1, ymm2, yword [rax] ; out: c4 e3 f5 7d 00 20
vfnmsubps xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 7c c2 30
vfnmsubps xmm0, xmm1, dqword [rax], xmm3 ; out: c4 e3 71 7c 00 30
vfnmsubps xmm0, xmm1, xmm2, dqword [rax] ; out: c4 e3 f1 7c 00 20
vfnmsubps ymm0, ymm1, ymm2, ymm3 ; out: c4 e3 75 7c c2 30
vfnmsubps ymm0, ymm1, yword [rax], ymm3 ; out: c4 e3 75 7c 00 30
vfnmsubps ymm0, ymm1, ymm2, yword [rax] ; out: c4 e3 f5 7c 00 20
vfnmsubsd xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 7f c2 30
vfnmsubsd xmm0, xmm1, qword [rax], xmm3 ; out: c4 e3 71 7f 00 30
vfnmsubsd xmm0, xmm1, xmm2, qword [rax] ; out: c4 e3 f1 7f 00 20
vfnmsubss xmm0, xmm1, xmm2, xmm3 ; out: c4 e3 71 7e c2 30
vfnmsubss xmm0, xmm1, dword [rax], xmm3 ; out: c4 e3 71 7e 00 30
vfnmsubss xmm0, xmm1, xmm2, dword [rax] ; out: c4 e3 f1 7e 00 20
| 52.59633
| 67
| 0.667364
|
daeb29b611e785c3ff17a247b7fbaa3e8f8bfde2
| 2,752
|
asm
|
Assembly
|
examples/kernel/drivers/soc/adc/adc.asm
|
rostislav-nikitin/socOS
|
75e3bbaa16086df5dd1a476ee86052b3073ce075
|
[
"MIT"
] | 1
|
2020-07-29T12:30:42.000Z
|
2020-07-29T12:30:42.000Z
|
examples/kernel/drivers/soc/adc/adc.asm
|
rostislav-nikitin/socOS
|
75e3bbaa16086df5dd1a476ee86052b3073ce075
|
[
"MIT"
] | null | null | null |
examples/kernel/drivers/soc/adc/adc.asm
|
rostislav-nikitin/socOS
|
75e3bbaa16086df5dd1a476ee86052b3073ce075
|
[
"MIT"
] | null | null | null |
.cseg
.org 0x00
rcall main_thread
; include components interrupts
;.include "../../../../../src/kernel/drivers/{driver_name}_int.asm"
.include "../../../../../src/kernel/drivers/soc/adc_int.asm"
; include components definitions
.include "../../../../../src/kernel/kernel_def.asm"
;.include "../../../../../src/kernel/drivers/{driver_name}_def.asm"
.include "../../../../../src/kernel/drivers/device_def.asm"
.include "../../../../../src/kernel/drivers/io/device_io_def.asm"
.include "../../../../../src/kernel/drivers/io/in_bit_def.asm"
.include "../../../../../src/kernel/drivers/io/hid/button_def.asm"
.include "../../../../../src/kernel/drivers/io/out_bit_def.asm"
.include "../../../../../src/kernel/drivers/io/hid/led_def.asm"
.include "../../../../../src/kernel/drivers/soc/adc_def.asm"
;.include components data segments
;.include "../../../../../src/kernel/{driver_name}_dseg.asm"
.include "../../../../../src/kernel/drivers/soc/adc_dseg.asm"
; custom data & descriptors
.dseg
led1: .BYTE SZ_ST_LED
led2: .BYTE SZ_ST_LED
; main thread
.cseg
; skip interrupts vector
.org 0x14
; include components code segments
.include "../../../../../src/kernel/kernel_cseg.asm"
;.include "../../../../../src/kernel/drivers/{driver_name}_cseg.asm"
.include "../../../../../src/kernel/drivers/device_cseg.asm"
.include "../../../../../src/kernel/drivers/io/device_io_cseg.asm"
.include "../../../../../src/kernel/drivers/io/in_bit_cseg.asm"
.include "../../../../../src/kernel/drivers/io/hid/button_cseg.asm"
.include "../../../../../src/kernel/drivers/io/out_bit_cseg.asm"
.include "../../../../../src/kernel/drivers/io/hid/led_cseg.asm"
.include "../../../../../src/kernel/drivers/soc/adc_cseg.asm"
main_thread:
; stack initialization
m_init_stack
; init leds
m_led_init led1, DDRC, PORTC, (1 << BIT5)
m_led_init led2, DDRC, PORTC, (1 << BIT4)
m_adc_init ADC_INPUT_NEGATIVE_REG_2_56V, ADC_INPUT_POSITIVE_PINC0, ADC_FREQUNCY_X128, ADC_OUTPUT_VALUE_ORDER_HIGH_FULL, ADC_CONTINUOUS_MEASUREMENT_TRUE, adc_on_changed_handler
m_adc_enable
m_adc_continuous_measurement_enable
m_adc_interrupts_enable
; init global interrupts
m_init_interrupts
m_adc_start_conversion
main_thread_loop:
nop
nop
main_thread_loop_end:
m_adc_output_value_get r16, r17
cpi r17, 0x00
breq main_thread_loop_adc_zero
main_thread_loop_adc_non_zero:
m_led_on led2
rjmp main_thread_loop
main_thread_loop_adc_zero:
m_led_off led2
rjmp main_thread_loop
ret
adc_on_changed_handler:
cpi YH, 0x00
breq adc_on_changed_handler_zero
adc_on_changed_handler_non_zero:
m_led_on led1
rjmp adc_on_changed_handler_end
adc_on_changed_handler_zero:
m_led_off led1
rjmp adc_on_changed_handler_end
adc_on_changed_handler_end:
ret
| 31.632184
| 176
| 0.704942
|
290fec25844c342bfd655c13d779024d1fb4362d
| 438
|
asm
|
Assembly
|
oeis/180/A180353.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/180/A180353.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/180/A180353.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A180353: a(n) = n^n * prime(n).
; Submitted by Christian Krause
; 2,12,135,1792,34375,606528,14000231,318767104,8910671247,290000000000,8844661788941,329895716585472,12417879370282373,477816293498994688,20581012847900390625,977677435906606235648,48807175451293869086443,2400130892593088792100864
mov $2,$0
seq $0,6005 ; The odd prime numbers together with 1.
max $0,2
add $2,1
pow $2,$2
mul $2,4
add $3,$0
mul $2,$3
mov $0,$2
div $0,4
| 29.2
| 231
| 0.773973
|
790071b1ab15920f2983daddac9daa03bc236b99
| 8,629
|
asm
|
Assembly
|
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i7-7700_9_0xca_notsx.log_21829_766.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_notsx.log_21829_766.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_notsx.log_21829_766.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 %r14
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x4245, %rsi
lea addresses_UC_ht+0x11b2d, %rdi
nop
nop
and %r10, %r10
mov $23, %rcx
rep movsb
nop
nop
and %rcx, %rcx
lea addresses_A_ht+0x1ef2d, %r11
sub $36713, %r15
mov (%r11), %r14w
and $4584, %r15
lea addresses_A_ht+0x13744, %r11
nop
nop
nop
xor %rsi, %rsi
movw $0x6162, (%r11)
nop
nop
nop
and %rcx, %rcx
lea addresses_UC_ht+0x38fd, %rcx
nop
cmp $29238, %rsi
movups (%rcx), %xmm7
vpextrq $1, %xmm7, %rdi
nop
nop
nop
nop
inc %r14
lea addresses_A_ht+0x1bcfd, %rsi
lea addresses_A_ht+0x9815, %rdi
nop
nop
add %rax, %rax
mov $81, %rcx
rep movsw
nop
nop
nop
nop
xor $1282, %r15
lea addresses_A_ht+0x2305, %rsi
lea addresses_D_ht+0x1c6ad, %rdi
nop
nop
nop
xor $38352, %r11
mov $44, %rcx
rep movsq
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0x3f2d, %rdi
clflush (%rdi)
nop
nop
nop
nop
inc %rax
movb $0x61, (%rdi)
nop
nop
add $5686, %r11
lea addresses_WC_ht+0x7cad, %rcx
clflush (%rcx)
nop
nop
nop
and %r15, %r15
mov $0x6162636465666768, %rax
movq %rax, %xmm0
movups %xmm0, (%rcx)
nop
nop
nop
xor $56490, %rax
lea addresses_normal_ht+0x2f2d, %rdi
nop
and %r14, %r14
mov (%rdi), %r15d
nop
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_A_ht+0xd32d, %r11
nop
inc %rcx
movb $0x61, (%r11)
nop
nop
nop
xor $63596, %rcx
lea addresses_WC_ht+0xa52d, %rax
nop
nop
nop
nop
add $11409, %rcx
mov $0x6162636465666768, %r11
movq %r11, %xmm2
movups %xmm2, (%rax)
nop
add %rdi, %rdi
lea addresses_WT_ht+0x3011, %rcx
nop
nop
sub $28729, %rdi
mov (%rcx), %r11w
nop
nop
nop
nop
nop
xor $2804, %r15
lea addresses_WT_ht+0x1b2d, %rsi
lea addresses_A_ht+0xcced, %rdi
nop
nop
nop
add $42359, %r10
mov $24, %rcx
rep movsl
nop
nop
nop
nop
nop
xor %r11, %r11
lea addresses_A_ht+0x1512d, %r15
nop
nop
sub %r14, %r14
mov $0x6162636465666768, %rsi
movq %rsi, %xmm0
movups %xmm0, (%r15)
nop
nop
nop
cmp %rax, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %rax
push %rbp
push %rcx
push %rsi
// Store
lea addresses_D+0x20d, %r10
clflush (%r10)
nop
nop
xor %r15, %r15
mov $0x5152535455565758, %rsi
movq %rsi, %xmm4
movups %xmm4, (%r10)
and %rcx, %rcx
// Store
lea addresses_PSE+0x8efd, %r13
nop
add %rax, %rax
mov $0x5152535455565758, %rbp
movq %rbp, (%r13)
nop
nop
nop
nop
dec %rcx
// Store
lea addresses_PSE+0x5e75, %r13
nop
dec %r15
movw $0x5152, (%r13)
nop
nop
nop
xor $19877, %rax
// Store
lea addresses_WT+0x1f42d, %rcx
nop
nop
nop
nop
nop
cmp %r15, %r15
movl $0x51525354, (%rcx)
nop
nop
nop
nop
dec %r13
// Faulty Load
lea addresses_UC+0xb72d, %r13
nop
nop
nop
and $32924, %r10
vmovntdqa (%r13), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %rax
lea oracles, %rcx
and $0xff, %rax
shlq $12, %rax
mov (%rcx,%rax,1), %rax
pop %rsi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 5, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'NT': True, 'AVXalign': True, 'size': 4, 'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'00': 1148, '45': 19426, '47': 34, '49': 1221}
00 45 45 00 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 00 49 45 45 45 45 45 45 00 45 45 49 45 45 45 45 49 45 45 45 45 45 49 45 49 45 45 00 45 45 45 45 45 45 00 45 45 49 45 45 49 45 45 45 45 49 45 45 45 45 00 45 45 45 00 45 45 00 49 45 45 45 45 45 45 45 49 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 49 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 00 45 45 45 45 45 45 00 45 00 45 45 45 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 00 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 49 45 45 45 45 00 45 45 45 45 45 45 49 49 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 00 45 49 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 00 45 45 00 45 45 45 49 45 45 45 00 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 00 45 45 45 45 45 49 45 45 45 45 45 45 45 00 45 45 49 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 49 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 49 45 49 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 00 45 45 45 00 45 45 45 45 49 00 45 45 00 45 45 49 45 45 45 47 45 49 45 45 49 45 45 45 45 45 45 45 45 45 45 45 47 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 00 45 45 45 45 45 45 00 45 45 45 45 45 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 00 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 49 45 45 49 45 45 45 45 00 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 49 45 45 45 45 45 45 45 45 45 45 00 45 45 49 45 45 45 45 45 00 45 45 45 45 45 45 49 45 45 45 49 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 49 45 49 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45
*/
| 31.151625
| 2,999
| 0.653958
|
94d865d9d08373ab4912de314cbe1bff57175fd2
| 550
|
asm
|
Assembly
|
programs/oeis/068/A068346.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/068/A068346.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/068/A068346.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A068346: a(n) = n'' = second arithmetic derivative of n.
; 0,0,0,0,4,0,1,0,16,5,1,0,32,0,6,12,80,0,10,0,44,7,1,0,48,7,8,27,80,0,1,0,176,9,1,16,92,0,10,32,72,0,1,0,112,16,10,0,240,9,39,24,92,0,108,32,96,13,1,0,96,0,14,20,640,21,1,0,156,15,1,0,220,0,16,16,176,21,1,0,368,216,1,0,128,13,39,80,188,0,44,24,272,19,14,44,560,0,18,55
seq $0,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m).
seq $0,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m).
| 91.666667
| 269
| 0.576364
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.