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
72e2b0ecb396a4c51251e52633f789ff3c2dc051
595
asm
Assembly
oeis/024/A024081.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/024/A024081.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/024/A024081.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A024081: a(n) = 7^n - n^6. ; 1,6,-15,-386,-1695,1182,70993,705894,5502657,39822166,281475249,1975555182,13838301217,96884183598,678215543313,4747550119318,33232913792385,232630489849638,1628413563898225,11398895138327262,79792266233612001,558545863997517886,3909821048469608145,27368747339932880454,191581231380375311425,1341068619663720760182,9387480337647445389873,65712362363533892719054,459986536544739479086497,3219905755813179132014286,22539340290692257358863249,157775382034845805727539062,1104427674243920645231557377 mov $1,7 pow $1,$0 pow $0,6 add $0,1 sub $1,$0 add $1,1 mov $0,$1
54.090909
498
0.855462
4b93568e4b1385e3a918a50d46b8dd27084cf61a
748
asm
Assembly
oeis/243/A243953.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/243/A243953.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/243/A243953.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A243953: E.g.f.: exp( Sum_{n>=1} A000108(n-1)*x^n/n ), where A000108(n) = binomial(2*n,n)/(n+1) forms the Catalan numbers. ; Submitted by Christian Krause ; 1,1,2,8,56,592,8512,155584,3456896,90501632,2728876544,93143809024,3550380249088,149488545697792,6890674623094784,345131685337530368,18664673706719019008,1083931601731053223936,67278418002152175960064,4444711314548967826259968,311398905690436356542038016,23061297866350486255415853056,1800026829198099673348604690432,147694445185709575159607248027648,12708922393287815862419617749139456,1144393793176646265918404026414661632,107623852248177900259779656953974751232 lpb $0 sub $0,1 add $3,1 mov $1,$3 mul $1,$0 add $2,$1 add $4,2 mul $3,$4 add $3,$2 lpe mov $0,$2 add $0,1
44
466
0.802139
d76528f470b35847f6660c1909f66fd35cea04c3
707
asm
Assembly
HBlankCopy.asm
009342/Pokemon-Hangul-Code
a44f476a0ae8cc4c59c6a53f0895bb70cbf9eeb7
[ "MIT" ]
2
2018-11-30T19:07:00.000Z
2021-02-18T16:02:58.000Z
HBlankCopy.asm
009342/Pokemon-Hangul-Code
a44f476a0ae8cc4c59c6a53f0895bb70cbf9eeb7
[ "MIT" ]
null
null
null
HBlankCopy.asm
009342/Pokemon-Hangul-Code
a44f476a0ae8cc4c59c6a53f0895bb70cbf9eeb7
[ "MIT" ]
null
null
null
HBlankCopyDouble:: ld a,[H_LOADEDROMBANK] push af ld a,b call BankswitchCommon ld a,[rLCDC] bit rLCDC_ENABLE,a sla c sla c sla c jr nz,.LCDOn .loop ;8bytes : 1 ld a,[de] ld [hli],a ld [hli],a inc de dec c jr nz,.loop jr .Done .LCDOn ;if LCD is on ld a,[rSTAT] and a,%00000011 cp a,$00 ;is H-Blank Period? jr z,.LCDOn .WaitForHBlank ld a,[rSTAT] and a,%00000011 cp a,$00 jr nz,.WaitForHBlank ;Wait For H-Blank Period .HBlankLoop ld a,[de] ld [hli],a ld [hli],a .CheckHBlank ld a,[rSTAT] and a,%00000011 cp a,$00 ;is H-Blank Period? jr nz,.ReWrite inc de dec c jr nz,.HBlankLoop .Done pop af call BankswitchCommon ret .ReWrite dec hl dec hl jr .WaitForHBlank
13.339623
29
0.664781
bd2e9cba35d72a78410854af36a9d25682211a27
640
asm
Assembly
oeis/157/A157741.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/157/A157741.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/157/A157741.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A157741: a(n) = 388962*n^2 + 1764*n + 1. ; 390727,1559377,3505951,6230449,9732871,14013217,19071487,24907681,31521799,38913841,47083807,56031697,65757511,76261249,87542911,99602497,112440007,126055441,140448799,155620081,171569287,188296417,205801471,224084449,243145351,262984177,283600927,304995601,327168199,350118721,373847167,398353537,423637831,449700049,476540191,504158257,532554247,561728161,591679999,622409761,653917447,686203057,719266591,753108049,787727431,823124737,859299967,896253121,933984199,972493201,1011780127,1051844977 seq $0,157740 ; 18522n + 42. pow $0,2 sub $0,344622096 div $0,777924 mul $0,882 add $0,390727
64
501
0.834375
1d443c50fde1ff5226d5d4b25210577de331daa2
5,516
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1164.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1164.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1164.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x18c1e, %rsi lea addresses_UC_ht+0x388, %rdi clflush (%rdi) nop nop nop nop nop inc %rax mov $59, %rcx rep movsw nop nop nop nop add $28285, %rcx lea addresses_WC_ht+0x978a, %rsi lea addresses_UC_ht+0xb94a, %rdi nop nop nop nop nop and %r10, %r10 mov $30, %rcx rep movsl nop nop nop and $31383, %rax lea addresses_WC_ht+0x5eca, %rdi clflush (%rdi) xor $13819, %rsi movb (%rdi), %al nop and $63213, %r10 lea addresses_UC_ht+0x11b8a, %rsi lea addresses_normal_ht+0x17c7e, %rdi nop nop and $40005, %rbp mov $51, %rcx rep movsl nop nop nop nop and %rcx, %rcx lea addresses_WT_ht+0x9afe, %rax xor $53386, %r12 mov (%rax), %ecx nop nop nop nop xor $34465, %r12 lea addresses_D_ht+0xa68a, %rsi lea addresses_UC_ht+0x15c32, %rdi clflush (%rdi) nop nop xor %r13, %r13 mov $111, %rcx rep movsb nop nop add %r12, %r12 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r9 push %rdx push %rsi // Faulty Load lea addresses_UC+0x8b8a, %r13 nop nop nop add %r9, %r9 mov (%r13), %rsi lea oracles, %r12 and $0xff, %rsi shlq $12, %rsi mov (%r12,%rsi,1), %rsi pop %rsi pop %rdx pop %r9 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': True, 'same': False, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}} {'src': {'same': True, 'congruent': 8, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
41.787879
2,999
0.661893
8e2c352d3a1f443fc330a43d6da03416801dc3e6
2,138
asm
Assembly
programs/oeis/202/A202201.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/202/A202201.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/202/A202201.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A202201: Number of (n+2) X 9 binary arrays avoiding patterns 001 and 101 in rows and columns. ; 2430,11880,44550,138996,378378,926640,2084940,4375800,8664084,16325712,29476980,51279480,86337900,141210432,225054126,350430300,534298050,799227000,1174863690,1699689420,2423110950,3407929200,4733235000,6497785008,8823915144,11862053280,15795897480,20848330800,27288148536,35437678848,45681382890,58475525940,74359016550,93965516424,118036929582,147438385380,183174836130,226409396400,278483557572,340939417896,415544075100,504316335600,609555901500,733875203880,880234058340,1051977326400,1252875774150,1487170327500,1759619931498,2075553229464,2440924286130,2862372587580,3347287559550,3903877854576,4541245667568,5269466348640,6099673591440,7044150484800,8116426725264,9331382297952,10705357943280,12256272737280,14003749123650,15969245746212,18176198441166,20650169759400,23419007400150,26513011948500,29965114320570,33811063331760,38089623815100,42842785728600,48115984702500,53958334489488,60422871793284,67566813963480,75451830057180,84144325780800,93715742838366,104242873225788,115808189023890,128500188256440,142413757393050,157650551090604,174319389780822,192536675725680,212426828176680,234122738288400,257766244451352,283508628723936,311511135058200,341945510029200,374994566793000,410852773013760,449726863515930,491836478433300,537414827642550,586709382285000,639982594196478,697512644081604,759594219285330,826539322031280,898678109013300,976359763243656,1059953399078508,1149849001358640,1246458399620940,1350216278353800,1461581224287444,1581036811728192,1709092726963830,1846285932785580,1993181874190650,2150375726347992,2318493685928706,2498194306921500,2690169882072750,2895147871110000,3113892376927200,3347205670929600,3595929768756000,3860948057616000,4143186976500000,4443617750539968,4763258180819424,5103174490951680,5464483231766130,5848353245463300,6256007690620446,6688726129450728,7147846678740390,7634768225909940,8150952711667050,8697927480740784 mov $3,$0 mov $0,1 add $0,$3 add $0,9 mov $2,$0 bin $0,8 mov $3,$0 mov $0,0 mov $1,$3 sub $2,8 add $0,$2 mul $0,$3 add $1,$0 sub $1,135 mul $1,18 add $1,2430
106.9
1,882
0.89102
5ae58c09c098cb7d9040d7b6ee228a3776c806f9
831
asm
Assembly
lib/metasm/samples/source.asm
truekonrads/mirv-metasploit
36bcc1f7f57d67636f4479afc75c2832f12ea466
[ "BSD-3-Clause" ]
308
2015-01-01T14:39:50.000Z
2021-08-10T03:50:02.000Z
lib/metasm/samples/source.asm
truekonrads/mirv-metasploit
36bcc1f7f57d67636f4479afc75c2832f12ea466
[ "BSD-3-Clause" ]
24
2015-01-07T20:07:31.000Z
2019-02-10T02:31:49.000Z
lib/metasm/samples/source.asm
truekonrads/mirv-metasploit
36bcc1f7f57d67636f4479afc75c2832f12ea466
[ "BSD-3-Clause" ]
107
2015-01-20T03:20:44.000Z
2021-09-09T06:50:11.000Z
.pt_gnu_stack rw // elf-specific instruction //.interp none // request minimal elf, no section/dynamic/interpreter #define __i386__ #include <asm/unistd.h> // can use the C preprocessor stdout equ 1 // 'equ' constant definition syscall macro nr // asm-style macros mov eax, nr ; the syscall number goes in eax int 80h endm #define syscall1(nr, arg) mov ebx, arg syscall(__NR_##nr) // c++-style macros #define syscall3(nr, arg1, arg2, arg3) mov edx, arg3 mov ecx, arg2 syscall1(nr, arg1) .entrypoint // the elf entrypoint nop nop call 1f // 1f is the first label named '1' found forward toto_str db "toto\n" toto_str_len equ $ - toto_str // $ is the address of the start of the current instruction/data 1: pop ebp syscall3(write, stdout, ebp, toto_str_len) /* ; hang forever jmp $ */ syscall1(exit, 0) hlt
23.742857
94
0.712395
ed2224aa5ec858621cee2237a91d6cfbb59f358b
385
asm
Assembly
programs/oeis/212/A212742.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/212/A212742.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/212/A212742.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A212742: Number of (w,x,y,z) with all terms in {0,...,n} and max{w,x,y,z}<=2*min{w,x,y,z}. ; 1,2,17,32,97,162,337,512,881,1250,1921,2592,3697,4802,6497,8192,10657,13122,16561,20000,24641,29282,35377,41472,49297,57122,66977,76832,89041,101250,116161,131072,149057,167042,188497,209952,235297 lpb $0 add $2,$0 sub $0,2 lpe add $2,1 pow $2,2 mov $3,$2 add $3,$2 add $0,$3 sub $0,1
27.5
199
0.677922
c546627e89603375f9da37ddebeaa1b2a45abe5e
6,625
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_661.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_661.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_661.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 %r15 push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0x1725, %rsi lea addresses_D_ht+0x1bb3d, %rdi clflush (%rdi) nop nop nop nop inc %rdx mov $15, %rcx rep movsb nop nop nop xor $50031, %rsi lea addresses_normal_ht+0x1327d, %r14 inc %rdi mov (%r14), %r15 mfence lea addresses_D_ht+0x43d, %rsi lea addresses_WT_ht+0xb33d, %rdi clflush (%rdi) nop nop add $11986, %r13 mov $37, %rcx rep movsl nop nop nop nop and $19761, %rsi lea addresses_UC_ht+0x1cd5d, %rcx nop nop nop nop nop and %r13, %r13 vmovups (%rcx), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %r15 cmp $37567, %rsi lea addresses_WC_ht+0x833d, %r14 inc %rcx mov (%r14), %rdi xor $49392, %rdi lea addresses_UC_ht+0x873d, %r14 sub $1915, %r13 movups (%r14), %xmm7 vpextrq $1, %xmm7, %rdi nop mfence lea addresses_UC_ht+0x15837, %rdx nop nop nop nop cmp $28932, %r14 mov $0x6162636465666768, %r15 movq %r15, %xmm3 vmovups %ymm3, (%rdx) nop nop nop inc %rdx lea addresses_UC_ht+0x1bc85, %rdx nop nop nop nop dec %rdi movw $0x6162, (%rdx) nop nop nop add %rdx, %rdx lea addresses_normal_ht+0x7c5d, %r15 nop nop nop cmp %rdx, %rdx mov (%r15), %rsi nop nop nop nop nop xor %r14, %r14 pop %rsi pop %rdx pop %rdi pop %rcx pop %r15 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r8 push %rax push %rbp push %rcx push %rdx // Load lea addresses_WC+0x22bd, %r13 xor $39620, %rax mov (%r13), %edx nop nop cmp $21446, %r13 // Store lea addresses_A+0xd73d, %rcx nop dec %rbp mov $0x5152535455565758, %r13 movq %r13, %xmm6 movntdq %xmm6, (%rcx) nop nop nop sub $22156, %rbp // Faulty Load lea addresses_A+0x1233d, %rbp nop nop cmp %r14, %r14 movb (%rbp), %dl lea oracles, %rcx and $0xff, %rdx shlq $12, %rdx mov (%rcx,%rdx,1), %rdx pop %rdx pop %rcx pop %rbp pop %rax pop %r8 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_A'}, 'OP': 'LOAD'} {'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_A'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 9, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 1, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
37.429379
2,999
0.656302
7aa4c6f67affb714b751e8cc77a4d0951aac1b26
159
asm
Assembly
bdshemu_test/basic/test_64_eicar.asm
andreaswimmer/bddisasm
960e9eaeee4f87d8269095031cd6cfb8aabb998b
[ "Apache-2.0" ]
1
2020-11-18T21:57:38.000Z
2020-11-18T21:57:38.000Z
bdshemu_test/basic/test_64_eicar.asm
andreaswimmer/bddisasm
960e9eaeee4f87d8269095031cd6cfb8aabb998b
[ "Apache-2.0" ]
null
null
null
bdshemu_test/basic/test_64_eicar.asm
andreaswimmer/bddisasm
960e9eaeee4f87d8269095031cd6cfb8aabb998b
[ "Apache-2.0" ]
1
2020-08-20T15:22:02.000Z
2020-08-20T15:22:02.000Z
bits 64 retn dq 0 db "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" dq 0 db "This is a HVI test file",0
15.9
74
0.553459
f133fcee53fdf1ad0f772dce442a3602c228026d
5,656
asm
Assembly
src/debug/serial.asm
RyanSchuster/vos64
66a2df43d88836746170278fa7169fb97ec702c4
[ "BSD-3-Clause" ]
1
2019-10-23T06:19:01.000Z
2019-10-23T06:19:01.000Z
src/debug/serial.asm
RyanSchuster/vos64
66a2df43d88836746170278fa7169fb97ec702c4
[ "BSD-3-Clause" ]
27
2015-12-06T04:20:11.000Z
2015-12-24T20:07:33.000Z
src/debug/serial.asm
RyanSchuster/vos64
66a2df43d88836746170278fa7169fb97ec702c4
[ "BSD-3-Clause" ]
null
null
null
%define MOD_SERIAL ; module: Serial %include "debug/serial.inc" ;------------------------------------------------------------------------------- ; Local macro constants ; ; Got a bit carried away here... ; Default base addresses (don't trust these) %define PORT_COM1 0x03F8 %define PORT_COM2 0x02F8 %define PORT_COM3 0x03E8 %define PORT_COM4 0x02E8 ; Register offsets %define COM_RBR_THR 0x0000 ; DLAB = 0, rx buf/tx holding register %define COM_IER 0x0001 ; DLAB = 0, interrupt enable %define COM_DL_LSB 0x0000 ; DLAB = 1, divisor latch lsb %define COM_DL_MSB 0x0001 ; DLAB = 1, divisor latch msb %define COM_IIR_FCR 0x0002 ; interrupt id/fifo control register %define COM_LCR 0x0003 ; line control register %define COM_MCR 0x0004 ; modem control register %define COM_LSR 0x0005 ; line status register %define COM_MSR 0x0006 ; modem status register %define COM_SCR 0x0007 ; scratch register ; Register bitfields %define IER_ERBFI 0x01 ; enable rx buffer full interrupt %define IER_ETBEI 0x02 ; enable tx buffer empty interrupt %define IER_ELSI 0x04 ; enable line status interrupt %define IER_EDSSI 0x08 ; enable delta status signals interrupt %define DL_115200 0x0001 ; is this enough bauds for you? %define DL_57600 0x0002 %define DL_38400 0x0003 %define DL_19200 0x0006 %define DL_9600 0x000C %define DL_7200 0x0010 %define DL_4800 0x0018 %define DL_3600 0x0020 %define DL_2400 0x0030 %define DL_2000 0x003A %define DL_1800 0x0040 %define DL_1200 0x0060 %define DL_600 0x00C0 %define DL_300 0x0180 %define DL_150 0x0300 %define DL_134P5 0x0359 %define DL_110 0x0417 %define DL_75 0x0600 %define DL_50 0x0900 %define IIR_PEND 0x01 ; interrupt pending if zero %define IIR_IID_MASK 0x0E ; interrupt id mask %define IIR_IID_STAT 0x06 ; status interrupt highest %define IIR_IID_RX 0x04 ; rx buf full second highest %define IIR_IID_FIFO 0x0C ; no rx, buf fifo full second highest %define IIR_IID_TX 0x02 ; tx buf empty third highest %define IIR_IID_MODEM 0x00 ; delta flags set lowest %define IIR_FIFO_EN 0xC0 %define FCR_ENABLE 0x01 ; enable fifos %define FCR_RFRES 0x02 ; receive fifo reset %define FCR_TFRES 0x04 ; transmit fifo reset %define FCR_DMASEL 0x08 ; DMA mode select %define FCF_RXTRIG_MASK 0xC0 ; bytes before rx int is fired %define FCR_RXTRIG_1 0x00 %define FCR_RXTRIG_4 0x40 %define FCR_RXTRIG_8 0x80 %define FCR_RXTRIG_14 0xC0 %define LCR_SIZE_MASK 0x03 ; for pulling out all size bits %define LCR_SIZE_5BIT 0x00 %define LCR_SIZE_6BIT 0x01 %define LCR_SIZE_7BIT 0x02 %define LCR_SIZE_8BIT 0x03 %define LCR_1STOP 0x00 %define LCR_2STOP 0x04 ; long (2 or 1.5) stop bits %define LCR_PARITY_MASK 0x38 ; for extracting parity bits %define LCR_PARITY_NONE 0x00 %define LCR_PARITY_ODD 0x08 %define LCR_PARITY_EVEN 0x18 %define LCR_PARITY_MARK 0x28 %define LCR_PARITY_SPACE 0x38 %define LCR_SBR 0x40 ; set break %define LCR_DLAB 0x80 ; divisor latch access bit %define MCR_DTR 0x01 ; data terminal ready %define MCR_RTS 0x02 ; request to send %define MCR_OUT_1 0x04 ; don't know, just write a 1 %define MCR_OUT_2 0x08 ; interrupts? just write a 1 %define MCR_LOOP 0x10 ; local loopback for self-test %define LSR_RBF 0x01 ; receiver buffer full %define LSR_OE 0x02 ; overrun error %define LSR_PE 0x04 ; parity error %define LSR_FE 0x08 ; framing error %define LSR_BREAK 0x10 ; broken line detected %define LSR_THRE 0x20 ; tx holding register empty %define LSR_TEMT 0x40 ; transmitter empty %define LSR_FIFOERR 0x80 ; error(s) in the rx fifo chain %define MSR_DCTS 0x01 ; data clear to send %define MSR_DDSR 0x02 ; delta data set ready %define MSR_TERI 0x04 ; trailing edge ring indicator %define MSR_DDCD 0x08 ; delta data carrier detect %define MSR_CTS 0x10 ; clear to send %define MSR_DSR 0x20 ; data set ready %define MSR_RI 0x40 ; ring indicator %define MSR_DCD 0x80 ; data carrier detect [section .text] [bits 64] [global SerialInit] SerialInit: push rax push rdx ; Disable interrupts xor al, al mov dx, PORT_COM1 + COM_LCR out dx, al ; clear DLAB just in case mov dx, PORT_COM1 + COM_IER out dx, al ; Set the DLAB bit so we can set the baud rate mov dx, PORT_COM1 + COM_LCR mov al, LCR_DLAB out dx, al ; Set baud to 115200 (divisor of 1) mov dx, PORT_COM1 + COM_DL_LSB mov ax, DL_115200 out dx, ax ; Set trigger threshold, reset, and enable fifos mov dx, PORT_COM1 + COM_IIR_FCR mov al, FCR_RXTRIG_14 | FCR_TFRES | FCR_RFRES | FCR_ENABLE out dx, al ; Clear DLAB and set the line properties mov dx, PORT_COM1 + COM_LCR mov al, LCR_PARITY_NONE | LCR_1STOP | LCR_SIZE_8BIT out dx, al pop rdx pop rax ret [global SerialPutChar] SerialPutChar: push rax push rdx mov ah, al ; Wait until the tx buffer is empty .wait: mov dx, PORT_COM1 + COM_LSR in al, dx test al, LSR_THRE jz .wait ; Write the character mov al, ah mov dx, PORT_COM1 + COM_RBR_THR out dx, al pop rdx pop rax ret [global SerialClrScr] SerialClrScr: push rax ; Do something here? pop rax ret [section .data] [section .bss]
28.139303
80
0.669731
5188c98ef05d7f21e7df219459044ae098979a9d
3,142
asm
Assembly
binutils-2.21.1/gcc-4.5.1/gcc/config/rs6000/darwin-tramp.asm
cberner12/xv6
53c4dfef0d48287ca0d0f9d27eab7a6ed7fee845
[ "MIT-0" ]
51
2015-01-31T01:51:39.000Z
2022-02-18T02:01:50.000Z
binutils-2.21.1/gcc-4.5.1/gcc/config/rs6000/darwin-tramp.asm
cberner12/xv6
53c4dfef0d48287ca0d0f9d27eab7a6ed7fee845
[ "MIT-0" ]
7
2017-05-29T09:29:00.000Z
2019-03-11T16:01:39.000Z
binutils-2.21.1/gcc-4.5.1/gcc/config/rs6000/darwin-tramp.asm
cberner12/xv6
53c4dfef0d48287ca0d0f9d27eab7a6ed7fee845
[ "MIT-0" ]
12
2015-03-26T08:05:38.000Z
2022-02-18T02:01:51.000Z
/* Special support for trampolines * * Copyright (C) 1996, 1997, 2000, 2004, 2005, 2009 Free Software Foundation, Inc. * Written By Michael Meissner * * This file is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3, or (at your option) any * later version. * * This file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Under Section 7 of GPL version 3, you are granted additional * permissions described in the GCC Runtime Library Exception, version * 3.1, as published by the Free Software Foundation. * * You should have received a copy of the GNU General Public License and * a copy of the GCC Runtime Library Exception along with this program; * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see * <http://www.gnu.org/licenses/>. */ #include "darwin-asm.h" /* Set up trampolines. */ .text .align LOG2_GPR_BYTES Ltrampoline_initial: mflr r0 bl 1f Lfunc = .-Ltrampoline_initial .g_long 0 /* will be replaced with function address */ Lchain = .-Ltrampoline_initial .g_long 0 /* will be replaced with static chain */ 1: mflr r11 lg r12,0(r11) /* function address */ mtlr r0 mtctr r12 lg r11,GPR_BYTES(r11) /* static chain */ bctr trampoline_size = .-Ltrampoline_initial /* R3 = stack address to store trampoline */ /* R4 = length of trampoline area */ /* R5 = function address */ /* R6 = static chain */ .globl ___trampoline_setup ___trampoline_setup: mflr r0 /* save return address */ bcl 20,31,LCF0 /* load up __trampoline_initial into r7 */ LCF0: mflr r11 addis r7,r11,ha16(LTRAMP-LCF0) lg r7,lo16(LTRAMP-LCF0)(r7) subi r7,r7,4 li r8,trampoline_size /* verify trampoline big enough */ cmpg cr1,r8,r4 srwi r4,r4,2 /* # words to move (insns always 4-byte) */ addi r9,r3,-4 /* adjust pointer for lgu */ mtctr r4 blt cr1,Labort mtlr r0 /* Copy the instructions to the stack */ Lmove: lwzu r10,4(r7) stwu r10,4(r9) bdnz Lmove /* Store correct function and static chain */ stg r5,Lfunc(r3) stg r6,Lchain(r3) /* Now flush both caches */ mtctr r4 Lcache: icbi 0,r3 dcbf 0,r3 addi r3,r3,4 bdnz Lcache /* Ensure cache-flushing has finished. */ sync isync /* Make stack writeable. */ b ___enable_execute_stack Labort: #ifdef __DYNAMIC__ bl L_abort$stub .data .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 .align 2 L_abort$stub: .indirect_symbol _abort mflr r0 bcl 20,31,L0$_abort L0$_abort: mflr r11 addis r11,r11,ha16(L_abort$lazy_ptr-L0$_abort) mtlr r0 lgu r12,lo16(L_abort$lazy_ptr-L0$_abort)(r11) mtctr r12 bctr .data .lazy_symbol_pointer L_abort$lazy_ptr: .indirect_symbol _abort .g_long dyld_stub_binding_helper #else bl _abort #endif .data .align LOG2_GPR_BYTES LTRAMP: .g_long Ltrampoline_initial
24.936508
84
0.709421
48b6398da838b169372ebb8f931dde0b597b69a0
526
asm
Assembly
src/test/ref/typedef-1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/test/ref/typedef-1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/test/ref/typedef-1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
// Commodore 64 PRG executable file .file [name="typedef-1.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) .const OFFSET_STRUCT_POINTDEF_Y = 1 .segment Code main: { .const p_x = 4 .const p_y = 7 .label SCREEN = $400 // *SCREEN = p lda #p_x sta SCREEN lda #p_y sta SCREEN+OFFSET_STRUCT_POINTDEF_Y // } rts }
22.869565
60
0.665399
ecefef226dd1f6f83a457bdd10666c2a580cd05c
721
asm
Assembly
test/CPIR.asm
takamin/mz700-js
d4441d1b796299a382c4c2dee52da27981dd6a57
[ "MIT" ]
18
2016-08-15T07:36:48.000Z
2020-06-20T10:09:15.000Z
test/CPIR.asm
takamin/mz700-js
d4441d1b796299a382c4c2dee52da27981dd6a57
[ "MIT" ]
66
2016-08-03T16:39:07.000Z
2022-02-12T02:38:04.000Z
test/CPIR.asm
takamin/mz700-js
d4441d1b796299a382c4c2dee52da27981dd6a57
[ "MIT" ]
2
2020-11-29T11:47:29.000Z
2020-11-29T11:56:59.000Z
ORG 1200H TESTCPIR: ENT LD HL,1400H LD BC,0010H LD A, 0FH CPIR LD A, 10H CP L JR Z,HLINCMATCH LD A, 0EH ;=='N' JR SHOWRESULT HLINCMATCH: ENT LD A, 19H ;=='Y' SHOWRESULT: ENT LD (D000H), A HALT ORG 1400H SEARCH: ENT DEFB 00H DEFB 01H DEFB 02H DEFB 03H DEFB 04H DEFB 05H DEFB 06H DEFB 07H DEFB 08H DEFB 09H DEFB 0AH DEFB 0BH DEFB 0CH DEFB 0DH DEFB 0EH DEFB 0FH
20.6
38
0.363384
a4ffbd9cf294d6acb4c194971fc664506d759dcd
550
asm
Assembly
oeis/010/A010968.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/010/A010968.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/010/A010968.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A010968: a(n) = binomial(n,15). ; 1,16,136,816,3876,15504,54264,170544,490314,1307504,3268760,7726160,17383860,37442160,77558760,155117520,300540195,565722720,1037158320,1855967520,3247943160,5567902560,9364199760,15471286560,25140840660,40225345056,63432274896,98672427616,151532656696,229911617056,344867425584,511738760544,751616304549,1093260079344,1575580702584,2250829575120,3188675231420,4481381406320,6250347750920,8654327655120,11899700525790,16253249498640,22057981462440,29752626158640,39895566894540,53194089192720 add $0,15 bin $0,15
91.666667
494
0.870909
b3a8ea3c235950254407043741b60c3b7edb7fd0
357
asm
Assembly
programs/oeis/047/A047343.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/047/A047343.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/047/A047343.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A047343: Numbers that are congruent to {1, 3, 4} mod 7. ; 1,3,4,8,10,11,15,17,18,22,24,25,29,31,32,36,38,39,43,45,46,50,52,53,57,59,60,64,66,67,71,73,74,78,80,81,85,87,88,92,94,95,99,101,102,106,108,109,113,115,116,120,122,123,127,129,130,134,136,137,141 mov $2,$0 add $2,1 lpb $2 add $1,$0 mov $0,2 add $1,$2 trn $2,2 sub $1,$2 trn $2,1 lpe
25.5
198
0.621849
f11c0db4a09500599b06f93227cf3a7d577716d9
113
asm
Assembly
tests/nasm/fptan.asm
brenden7158/v86
c9e274dc6e8cc619d1b36d57a69299aee6a45a91
[ "BSD-2-Clause" ]
12,700
2015-01-04T15:03:42.000Z
2022-03-31T06:43:06.000Z
tests/nasm/fptan.asm
brenden7158/v86
c9e274dc6e8cc619d1b36d57a69299aee6a45a91
[ "BSD-2-Clause" ]
566
2015-01-01T18:16:40.000Z
2022-03-31T19:59:10.000Z
tests/nasm/fptan.asm
brenden7158/v86
c9e274dc6e8cc619d1b36d57a69299aee6a45a91
[ "BSD-2-Clause" ]
1,182
2015-01-05T09:20:48.000Z
2022-03-31T12:16:52.000Z
global _start %include "header.inc" fldpi fptan fldpi fldpi fpatan %include "footer.inc"
8.692308
21
0.619469
0e2e7d0cf64ca0f51af66f34181f9cae4a2dbd73
2,947
asm
Assembly
bfintrinsics/src/arch/x64/portio.asm
chp-io/hypervisor
7c1dce35e9e54601de1c4655565fde803ab446f0
[ "MIT" ]
5
2020-03-28T18:31:24.000Z
2022-03-16T07:51:29.000Z
bfintrinsics/src/arch/x64/portio.asm
chp-io/hypervisor
7c1dce35e9e54601de1c4655565fde803ab446f0
[ "MIT" ]
7
2017-11-07T00:25:25.000Z
2018-02-14T18:37:18.000Z
bfintrinsics/src/arch/x64/portio.asm
chp-io/hypervisor
7c1dce35e9e54601de1c4655565fde803ab446f0
[ "MIT" ]
2
2020-05-21T22:57:04.000Z
2020-06-17T15:04:38.000Z
; ; Copyright (C) 2019 Assured Information Security, Inc. ; ; Permission is hereby granted, free of charge, to any person obtaining a copy ; of this software and associated documentation files (the "Software"), to deal ; in the Software without restriction, including without limitation the rights ; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ; copies of the Software, and to permit persons to whom the Software is ; furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in all ; copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ; SOFTWARE. bits 64 default rel section .text global _inb _inb: xor rax, rax mov rdx, rdi in al, dx ret global _inw _inw: xor rax, rax mov rdx, rdi in ax, dx ret global _ind _ind: xor rax, rax mov rdx, rdi in eax, dx ret global _insb _insb: mov rdx, rdi mov rdi, rsi insb xor rax, rax ret global _insw _insw: mov rdx, rdi mov rdi, rsi insw xor rax, rax ret global _insd _insd: mov rdx, rdi mov rdi, rsi insd xor rax, rax ret global _insbrep _insbrep: mov rcx, rdx mov rdx, rdi mov rdi, rsi cld rep insb xor rax, rax ret global _inswrep _inswrep: mov rcx, rdx mov rdx, rdi mov rdi, rsi cld rep insw xor rax, rax ret global _insdrep _insdrep: mov rcx, rdx mov rdx, rdi mov rdi, rsi cld rep insd xor rax, rax ret global _outb _outb: mov rdx, rdi mov rax, rsi out dx, al xor rax, rax ret global _outw _outw: mov rdx, rdi mov rax, rsi out dx, ax xor rax, rax ret global _outd _outd: mov rdx, rdi mov rax, rsi out dx, eax xor rax, rax ret global _outsb _outsb: mov rdx, rdi mov rdi, rsi outsb xor rax, rax ret global _outsw _outsw: mov rdx, rdi mov rdi, rsi outsw xor rax, rax ret global _outsd _outsd: mov rdx, rdi mov rdi, rsi outsd xor rax, rax ret global _outsbrep _outsbrep: mov rcx, rdx mov rdx, rdi mov rdi, rsi cld outsb xor rax, rax ret global _outswrep _outswrep: mov rcx, rdx mov rdx, rdi mov rdi, rsi cld outsw xor rax, rax ret global _outsdrep _outsdrep: mov rcx, rdx mov rdx, rdi mov rdi, rsi cld outsd xor rax, rax ret
16.463687
80
0.649813
e5cb8917750da5d9afe5b8db65c7798345063f8b
498
asm
Assembly
hi/index.asm
Softwave/C64
8edb6d435f9605f59b65040824b1c388c6242f9d
[ "MIT" ]
null
null
null
hi/index.asm
Softwave/C64
8edb6d435f9605f59b65040824b1c388c6242f9d
[ "MIT" ]
null
null
null
hi/index.asm
Softwave/C64
8edb6d435f9605f59b65040824b1c388c6242f9d
[ "MIT" ]
null
null
null
;;; Hello world program ;;; This code from DUST asm template !cpu 6502 !to "build/hello.prg",cbm ; output file ;;; BASIC loader with start address $c000 * = $0801 ; BASIC start address (#2049) !byte $0d,$08,$dc,$07,$9e,$20,$34,$39 ; BASIC loader to start at $c000... !byte $31,$35,$32,$00,$00,$00 ; puts BASIC line 2012 SYS 49152 * = $c000 ; start address for 6502 code ;;; Main code !source "code/main.asm" ;;; Any additional
27.666667
75
0.572289
950e66d611e239768ba6e8e30a2bed84a3305f2d
65
asm
Assembly
test/gameboy/ds.asm
gb-archive/asmotor
c821d8be10b7b66d93e0b68777c8643d9a53955f
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
test/gameboy/ds.asm
gb-archive/asmotor
c821d8be10b7b66d93e0b68777c8643d9a53955f
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
test/gameboy/ds.asm
gb-archive/asmotor
c821d8be10b7b66d93e0b68777c8643d9a53955f
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
SECTION "Test",CODE jr nz,.skip nop nop .skip jr nz,.skip
8.125
20
0.630769
f797eb4957df8ae61cecabf2812ee7fad9b76b00
7,528
asm
Assembly
Third course/5th semester/Unix programming/Lab2/yal.asm
tekcellat/University
9a0196a45c9cf33ac58018d636c3e4857eba0330
[ "MIT" ]
null
null
null
Third course/5th semester/Unix programming/Lab2/yal.asm
tekcellat/University
9a0196a45c9cf33ac58018d636c3e4857eba0330
[ "MIT" ]
null
null
null
Third course/5th semester/Unix programming/Lab2/yal.asm
tekcellat/University
9a0196a45c9cf33ac58018d636c3e4857eba0330
[ "MIT" ]
7
2020-12-04T07:26:46.000Z
2022-03-08T17:47:47.000Z
.386p descr struc ; декскриптор сегмента limit dw 0 base_l dw 0 base_m db 0 attr_1 db 0 attr_2 db 0 base_h db 0 descr ends int_descr struc ; декскриптор прерывания offs_l dw 0 sel dw 0 rsrv db 0 iattr db 0 offs_h dw 0 int_descr ends protected_seg SEGMENT PARA PUBLIC 'CODE' USE32 ASSUME CS:protected_seg gdt label byte ; глобальная таблица дескрипторов gdt_null descr <0,0,0,0,0,0> ; нулевой дескриптор gdt_ds descr <0FFFFh,0,0,92h,11001111b,0> ; для защищенного режима, 92h = 10010010b gdt_cs16 descr <real_seg_size-1,0,0,98h,0,0> ; для кода реального режима, 98h = 10011010b gdt_cs32 descr <protected_seg_size-1,0,0,98h,01000000b,0> ; для защищенного режима gdt_ds32 descr <protected_seg_size-1,0,0,92h,01000000b,0> gdt_ss32 descr <stack_size-1,0,0, 92h, 01000000b,0> gdt_size = $-gdt gdtr df 0 idt label byte ; таблица дескрипторов прерываний int_descr 32 dup (<0, 24, 0, 8Eh, 0>) int08h int_descr <0, 24, 0, 8Eh, 0> int09h int_descr <0, 24, 0, 8Eh, 0> idt_size = $-idt idtr df 0 idtr_r dw 3FFh,0,0 ; регистр таблицы дескрипторов прерываний master db 0 ; маски прерываний ведущего и ведомого контроллеров slave db 0 s db ? exit_flag db 0 time_08h dd 0 mes_protected db 'PROTECTED MODE ' mes_real db 'REAL MODE$' string db '**** ****-**** ****-**** ****' ASCII_table db 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 45, 61, 32, 0 ; ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, db 113, 119, 101, 114, 116, 121, 117, 105, 111, 112, 91, 93, 0, 0, 97, 115 ; q, w, e, r, t, y, u, i, o, p, [, ], a, s db 100, 102, 103, 104, 106, 107, 108, 59, 39, 96, 0, 92, 122, 120, 99 ; d, f, g, h, j, k, l, ;, ', \, z, x, c db 118, 98, 110, 109, 44, 46, 47, 0, 0, 0, 32 ; v, b, n, m, ,, ., /, space pos dd 2h protected_mode: mov ax, 32 mov ds, ax mov ax, 8 mov es, ax mov ax, 40 mov ss, ax mov ebx, stack_size mov esp, ebx sti mov ebp, 160 * 18 + 2 * 37 ; печатаем PROTECTED MODE mov ecx, 0 add ebp, 0B8000h print_protected: mov al, mes_protected[ecx] mov es:[ebp], al add ebp, 2 inc ecx cmp ecx, 23 jne print_protected push ds ; объем доступной физ. памяти mov ax, 8 mov ds, ax mov ebx, 100001h mov dl, 00010111b mov ecx, 0FFEFFFFEh try_write: mov dh, ds:[ebx] mov ds:[ebx], dl cmp ds:[ebx], dl jnz memory_end mov ds:[ebx], dh inc ebx loop try_write memory_end: pop ds xor edx, edx ; печать результата mov eax, ebx mov ebx, 160 * 18 + 2 * 68 add ebx, 0B8000h mov ECX, 10 print_digit: div ECX add DX, '0' mov s, DL mov DX, word ptr s mov ES:[EBX], Dl sub EBX, 2 mov EDX, 0 cmp EAX, 0 jnz print_digit wait_for_exit: test exit_flag, 1 ; ждем команду пользователя на выход jz wait_for_exit home: cli db 0EAh ; Дальний переход для того, чтобы заново загрузить селектор в регистр CS dd offset real_end dw 16 new_int08h: ; обработчик прерывания от системного таймера push eax push ebp mov ebp, 160 * 19 + 2 * 61 add ebp, 0B8000h test time_08h, 01h jnz skip_1 mov al, 2Ah jmp skip_2 skip_1: mov al, 20h skip_2: mov es:[ebp], al mov es:[ebp + 2], al mov es:[ebp + 4], al inc time_08h mov al, 20h ; EoI ведущему контроллеру прерываний out 20h, al pop ebp pop eax iretd new_int09h: ; обработчик прерывания клавиатуры push eax push ebx push ebp push edx in al, 60h xor ah, ah xor ebp, ebp mov bp, ax mov dh, 5h cmp al, 0Eh je delete_key cmp al, 1Ch jne print_key mov exit_flag, 1 jmp continue print_key: cmp al, 80h jnbe continue mov dl, ASCII_table[ebp] mov ebp, 0B8000h + 160 * 24 add ebp, pos mov es:[ebp], dl add pos, 2 jmp continue delete_key: mov dl, ASCII_table[ebp] mov ebp, 0B8000h + 160 * 24 sub pos, 2 add ebp, pos mov es:[ebp], dl continue: in al, 61h or al, 80h out 61h, al mov al, 20h ; EoI ведущему контроллеру прерываний out 20h, al pop edx pop ebp pop ebx pop eax iretd protected_seg_size = $-GDT protected_seg ENDS stack_seg SEGMENT PARA STACK 'STACK' stack_start db 100h dup(?) stack_size = $-stack_start stack_seg ENDS real_seg SEGMENT PARA PUBLIC 'CODE' USE16 ASSUME CS:real_seg, DS:protected_seg, SS:stack_seg begin: mov ax, protected_seg mov ds, ax mov ah, 09h mov edx, offset mes_real int 21h mov ax, protected_seg mov ds, ax xor eax, eax ; вычислим линейный адрес сегмента и загрузим его дескриптор в ГТД mov ax, real_seg shl eax, 4 mov word ptr gdt_cs16.base_l, ax shr eax, 16 mov byte ptr gdt_cs16.base_m, al mov ax, protected_seg shl eax, 4 push eax mov word ptr GDT_cs32.base_l, ax mov word ptr GDT_ss32.base_l, ax mov word ptr GDT_ds32.base_l, ax shr eax, 16 mov byte ptr GDT_cs32.base_m, al mov byte ptr GDT_ss32.base_m, al mov byte ptr GDT_ds32.base_m, al pop eax push eax add eax, offset GDT mov dword ptr gdtr + 2, eax ; полный линейный адрес в младшие 4 байта gdtr mov word ptr gdtr, gdt_size - 1 ; размер gdt в старшие 2 байта lgdt fword ptr gdtr ; загрузка gdt pop eax add eax, offset IDT mov dword ptr idtr + 2, eax mov word ptr idtr, idt_size - 1 mov eax, offset new_int08h mov int08h.offs_l, ax shr eax, 16 mov int08h.offs_h, ax mov eax, offset new_int09h mov int09h.offs_l, ax shr eax, 16 mov int09h.offs_h, ax in al, 21h ; сохранение масок прерываний контроллеров mov master, al in al, 0A1h mov slave, al mov al, 11h ; перепрограммирование ведущего контроллера out 20h, al mov al, 20h out 21h, al mov al, 4 out 21h, al mov al, 1 out 21h, al mov al, 0FCh ; запрет прерываний ведущего контр., кроме таймера и клав. out 21h, al mov al, 0FFh ; запрет всех в ведомом out 0A1h, al lidt fword ptr idtr ; загрузка idtr mov al, 0D1h ; открыть линию А20 out 64, al mov al, 0DFh out 60h, al cli in al, 70h ; запрет немаскируемых прерываний or al, 80h out 70h, al mov eax, cr0 or al, 1 mov cr0, eax db 66h ; дальний переход db 0EAh dd offset protected_mode dw 24 real_end: mov eax, cr0 ; сброс флага and al, 0FEh mov cr0, eax db 0EAh ; Дальний переход для того, чтобы заново загрузить селектор в регистр CS dw offset return dw real_seg return: mov ax, protected_seg mov ds, ax mov es, ax mov ax, stack_seg mov ss, ax mov bx, stack_size mov sp, bx mov al, 11h ; перепрограммируем ведущий контроллер out 20h, al mov al, 8 out 21h, al mov al, 4 out 21h, al mov al, 1 out 21h, al mov al, master ; восстановление масок контроллеров прерываний out 21h, al mov al, slave out 0A1h, al lidt fword ptr idtr_r ; восстанавливаем idt sti mov AL, 0 out 70h, AL mov ah, 09h mov edx, offset mes_real int 21h mov ah, 4Ch int 21h real_seg_size = $-begin real_seg ENDS END begin
20.401084
123
0.60441
69a8023fd9e55130762c0f63b871ba40f7e770e9
2,013
asm
Assembly
products/AMW007/bootloader/EFM8UB2_WGX_Bootloader/src/boot_startup.asm
markltownsend/wireless-xpress
6e1979e7cb995faef9097dae0d7d79d11576525e
[ "Apache-2.0" ]
21
2019-01-09T04:19:30.000Z
2022-02-16T15:57:08.000Z
products/AMW007/bootloader/EFM8UB2_WGX_Bootloader/src/boot_startup.asm
markltownsend/wireless-xpress
6e1979e7cb995faef9097dae0d7d79d11576525e
[ "Apache-2.0" ]
null
null
null
products/AMW007/bootloader/EFM8UB2_WGX_Bootloader/src/boot_startup.asm
markltownsend/wireless-xpress
6e1979e7cb995faef9097dae0d7d79d11576525e
[ "Apache-2.0" ]
30
2018-11-08T03:07:27.000Z
2021-11-07T10:47:08.000Z
$NOMOD51 ; #include "hboot_config.h" #include "efm8_device.h" #define BL_SIGNATURE 0xA5 NAME BOOT_STARTUP PUBLIC boot_otp PUBLIC ?C_STARTUP EXTRN CODE (?C_START) ; Declare and locate all memory segments used by the bootloader ?BL_EXTRA SEGMENT CODE AT BL_LIMIT_ADDRESS ?BL_START SEGMENT CODE AT BL_START_ADDRESS ?BL_RSVD SEGMENT CODE AT BL_LOCK_ADDRESS-2 ?BL_STACK SEGMENT IDATA ; Create idata segment for stack RSEG ?BL_STACK DS 16 #if (BL_LIMIT_ADDRESS != BL_START_ADDRESS) ; Create code segment for firmware that doesn't fit in security page RSEG ?BL_EXTRA boot_extra: LJMP ?C_STARTUP #endif ; Bootloader entry point (boot_vector) RSEG ?BL_START ?C_STARTUP: USING 0 ; Start bootloader if reset vector is not programmed MOV DPTR,#00H CLR A MOVC A,@A+DPTR CPL A JZ boot_start ; Start bootloader if software reset and R0 == signature MOV A,RSTSRC CJNE A,#010H,pin_test MOV A,R0 XRL A,#BL_SIGNATURE JZ boot_start ; Start the application by jumping to the reset vector app_start: LJMP 00H #ifdef LOAD_DEFAULT_ON_STARTUP ; Start bootloader if POR|Pin reset pin_test: ANL A,#03H ; A = RSTSRC JZ app_start ; POR or PINR only #else ; Start bootloader if POR|Pin reset and boot pin held low pin_test: ANL A,#03H ; A = RSTSRC JZ app_start ; POR or PINR only MOV R0,#(BL_PIN_LOW_CYCLES / 7) ?C0001: ; deglitch loop JB BL_START_PIN,app_start ; +3 DJNZ R0,?C0001 ; +4 = 7 cycles per loop #endif ; Setup the stack and jump to the bootloader boot_start: MOV SP, #?BL_STACK-1 LJMP ?C_START ; Reserved Bytes (bl_revision, bl_signature, lock_byte) RSEG ?BL_RSVD boot_rev: DB BL_REVISION boot_otp: DB BL_SIGNATURE lock_byte: DB 0xFF END
23.406977
68
0.629409
0e5d4f5ca225db292b42561b77f1546848446ef2
1,855
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0xca_notsx.log_376_485.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0xca_notsx.log_376_485.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0xca_notsx.log_376_485.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: ret .global s_faulty_load s_faulty_load: push %r10 push %r8 push %r9 push %rcx push %rdi // Faulty Load lea addresses_normal+0x1cb7f, %r9 nop add %rcx, %rcx vmovntdqa (%r9), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %r8 lea oracles, %r9 and $0xff, %r8 shlq $12, %r8 mov (%r9,%r8,1), %r8 pop %rdi pop %rcx pop %r9 pop %r8 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_normal', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_normal', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'00': 376} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
45.243902
1,127
0.660916
b50596f13fd3bafae78a9c139021f3d1006cf28a
21,486
asm
Assembly
monster.asm
mariahassan54/Super-Mario-Game-in-Assembly-Language
1e037e9acdd9e2bd172c9c2f928a546e5b53a36e
[ "MIT" ]
null
null
null
monster.asm
mariahassan54/Super-Mario-Game-in-Assembly-Language
1e037e9acdd9e2bd172c9c2f928a546e5b53a36e
[ "MIT" ]
null
null
null
monster.asm
mariahassan54/Super-Mario-Game-in-Assembly-Language
1e037e9acdd9e2bd172c9c2f928a546e5b53a36e
[ "MIT" ]
null
null
null
.model small .stack 120h .data Mcolor1 byte 2d ;green Mcolor2 byte 1d ;black ;blue instead of white Mcolor3 byte 4d ;brownn Mcolor4 byte 15d ;white unique byte 13d .code main proc mov AX, @data mov DS, AX mov AX, 0 mov ah, 0 mov al, 13H int 10h mov CX, 160d mov DX, 100d push CX mov ah, 0ch add CX,20 mov al,Mcolor4 ;row 1 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX ;row 2 push CX dec DX add CX,21 mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX int 10h ;; inc CX int 10h pop CX ;row 3 push CX dec DX add CX,17 mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h ;;; inc CX int 10h inc CX int 10h pop CX ;row 4 push CX dec DX add CX,18 mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h ;;; inc CX int 10h inc CX int 10h inc CX int 10h pop CX ;row 5 push CX dec DX add CX,17 mov al,Mcolor3 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h ;;; inc CX int 10h inc CX int 10h inc CX int 10h pop CX ;row 6 push CX dec DX add CX,17 mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h ;; inc CX int 10h pop CX ;row 7 push CX dec DX add CX,18 mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h ;; inc CX int 10h pop CX ;row 8 push CX dec DX add CX,17 mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h ;; inc CX int 10h pop CX ;row 9 push CX dec DX add CX,13 mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX mov al,Mcolor3 int 10h ;; inc CX int 10h pop CX ;row 10 push CX dec DX add CX,10 mov al,Mcolor4 int 10h inc CX mov al,Mcolor2 int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h ;; inc CX int 10h inc CX int 10h pop CX ;row 11 push CX dec DX add CX,9 mov al,Mcolor3 int 10h inc CX mov al,Mcolor2 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h ;; inc CX int 10h pop CX ;row 12 push CX dec DX add CX,9 mov al,Mcolor3 int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor2 int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h ;; inc CX int 10h pop CX ;row 13 push CX dec DX add CX,9 mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor2 int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor2 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h ;; inc CX int 10h pop CX ;row 14 push CX dec DX add CX,9 mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor2 int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor2 int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX ;row 15 push CX dec DX add CX,10 mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor2 int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h pop CX ;row 16 push CX dec DX add CX,14 mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX pop CX ;row 17 push CX dec DX add CX,8 mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX pop CX ;row 18 push CX dec DX add CX,7 mov al,Mcolor4 int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX ;row 19 push CX dec DX add CX,9 mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX pop CX ;row 20 push CX dec DX add CX,9 mov al,Mcolor4 int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX mov al,Mcolor4 int 10h pop CX ;row 21 push CX dec DX add CX,5 mov al,Mcolor4 int 10h add CX,4 mov al,Mcolor1 int 10h add CX,1 mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX pop CX ;row 22 push CX dec DX add CX,2 mov al,Mcolor4 int 10h add CX,2 mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor3 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h pop CX ;row 23 push CX dec DX add CX,2 mov al,Mcolor4 int 10h add CX,2 mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h pop CX ;row 24 push CX dec DX add CX,1 mov al,Mcolor4 int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor1 int 10h inc CX mov al,Mcolor3 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX pop CX ;row 25 push CX dec DX add CX,1 mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX pop CX ;row 26 push CX dec DX add CX,1 mov al,Mcolor3 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX ;row 27 push CX dec DX add CX,1 mov al,Mcolor3 int 10h inc CX mov al,Mcolor4 int 10h inc CX mov al,Mcolor3 int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX ;row 28 push CX dec DX add CX,2 mov al,Mcolor3 int 10h add CX,3 mov al,Mcolor1 int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX ;row 29 push CX dec DX add CX,6 mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX mov al,Mcolor1 int 10h pop CX ;row 30 push CX dec DX add CX,8 mov al,Mcolor1 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX int 10h inc CX pop CX ;row 31 push CX dec DX add CX,9 mov al,Mcolor1 int 10h inc CX int 10h inc CX mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h inc CX mov al,Mcolor3 int 10h inc CX pop CX ;row 31 push CX dec DX add CX,13 mov al,Mcolor4 int 10h inc CX int 10h inc CX int 10h Exit: mov ah, 04ch int 21h main endp end
12.758907
59
0.432328
d7e1ec1354bcf0e144c5ba5f4585d5b42ead7338
605
asm
Assembly
oeis/145/A145071.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/145/A145071.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/145/A145071.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A145071: Partial sums of A000051, starting at n=1. ; 3,8,17,34,67,132,261,518,1031,2056,4105,8202,16395,32780,65549,131086,262159,524304,1048593,2097170,4194323,8388628,16777237,33554454,67108887,134217752,268435481,536870938,1073741851,2147483676,4294967325,8589934622,17179869215,34359738400,68719476769,137438953506,274877906979,549755813924,1099511627813,2199023255590,4398046511143,8796093022248,17592186044457,35184372088874,70368744177707,140737488355372,281474976710701,562949953421358,1125899906842671,2251799813685296,4503599627370545 mov $1,2 pow $1,$0 mul $1,4 add $1,$0 sub $1,1 mov $0,$1
60.5
493
0.842975
9ce1f9a2db43a4993eaeb5b57622eff27922bb70
410
asm
Assembly
unordnung_auch_assembler/asm/attiny13/versuche/blinkIRQ.asm
no-go/Blink_atmega328p
a81e41906c4a6d843a7fb87962288a0894105bd7
[ "Unlicense" ]
null
null
null
unordnung_auch_assembler/asm/attiny13/versuche/blinkIRQ.asm
no-go/Blink_atmega328p
a81e41906c4a6d843a7fb87962288a0894105bd7
[ "Unlicense" ]
null
null
null
unordnung_auch_assembler/asm/attiny13/versuche/blinkIRQ.asm
no-go/Blink_atmega328p
a81e41906c4a6d843a7fb87962288a0894105bd7
[ "Unlicense" ]
null
null
null
.include "myTiny13.h" ;irq Vector .org 0000 rjmp OnReset .org 0003 rjmp TimerOVF .org 0010 TimerOVF: ; toggle ldi A, 0b00010000 in B, PINB eor A, B out PORTB, A reti .org 0030 OnReset: sbi DDRB, 4 ; PortB4 is output ldi A, 0b00000101 ; timer auf clock/1024 out TCCR0B, A ldi A, 0b00000010 ; enable timer-overfl IRQ out TIMSK0, A sei ; IRQ allow MainLoop: nop rjmp MainLoop
13.225806
45
0.67561
959937460ba7731b4e44967447755b89c690b8fe
3,961
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_1_267.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_1_267.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_1_267.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 %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x1063e, %rsi lea addresses_A_ht+0x6466, %rdi nop nop add $53709, %rdx mov $43, %rcx rep movsw nop nop xor %r9, %r9 lea addresses_D_ht+0xc98a, %r12 nop nop nop nop nop xor $45063, %rbx mov $0x6162636465666768, %rdx movq %rdx, %xmm5 and $0xffffffffffffffc0, %r12 movntdq %xmm5, (%r12) nop nop add $8361, %r9 lea addresses_WC_ht+0x9086, %rsi lea addresses_WC_ht+0x14a86, %rdi nop sub $57359, %r12 mov $44, %rcx rep movsb nop nop nop nop sub %rbx, %rbx lea addresses_WC_ht+0x6806, %rdi clflush (%rdi) nop nop nop nop add %r9, %r9 mov $0x6162636465666768, %rsi movq %rsi, %xmm7 vmovups %ymm7, (%rdi) nop nop nop nop add %rsi, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r14 push %r15 push %rbx push %rdx // Store lea addresses_PSE+0x15d86, %r10 nop nop nop nop cmp $7180, %r15 movw $0x5152, (%r10) nop nop nop nop nop and $5082, %r10 // Store lea addresses_US+0x509a, %r10 nop cmp %rdx, %rdx mov $0x5152535455565758, %r11 movq %r11, %xmm1 vmovups %ymm1, (%r10) nop nop nop nop nop and %r15, %r15 // Store lea addresses_WC+0x17c06, %r11 nop nop nop nop nop sub %r15, %r15 mov $0x5152535455565758, %rdx movq %rdx, (%r11) nop nop nop nop dec %rdx // Store mov $0x3157b0000000c06, %r15 nop nop nop nop nop xor $43555, %r13 mov $0x5152535455565758, %r11 movq %r11, %xmm0 vmovups %ymm0, (%r15) nop nop nop nop dec %rdx // Store mov $0x6, %rdx nop nop nop nop nop dec %r15 mov $0x5152535455565758, %r11 movq %r11, %xmm4 movups %xmm4, (%rdx) and %r15, %r15 // Load lea addresses_D+0x16c7c, %r11 clflush (%r11) nop nop nop dec %r10 vmovups (%r11), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $0, %xmm7, %rbx nop nop nop and $32398, %r15 // Store lea addresses_RW+0x9127, %r15 cmp %rbx, %rbx movw $0x5152, (%r15) nop nop nop sub $18690, %r15 // Faulty Load lea addresses_A+0x1e086, %r13 nop nop nop nop sub $24846, %rbx movaps (%r13), %xmm0 vpextrq $0, %xmm0, %r15 lea oracles, %r13 and $0xff, %r15 shlq $12, %r15 mov (%r13,%r15,1), %r15 pop %rdx pop %rbx pop %r15 pop %r14 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_P', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': True, 'type': 'addresses_RW', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A', 'same': True, 'AVXalign': True, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 3}, 'dst': {'same': True, 'type': 'addresses_A_ht', 'congruent': 5}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': True, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 9}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 6}} {'00': 1} 00 */
17.923077
149
0.648321
a4bf1997abe3c1da0769b4cf4a37c1e5048dac5d
349
asm
Assembly
programs/oeis/189/A189345.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/189/A189345.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/189/A189345.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A189345: Number of ways to choose four points in an n X n grid (or geoplane). ; 0,1,126,1820,12650,58905,211876,635376,1663740,3921225,8495410,17178876,32795126,59626385,103962600,174792640,284660376,450710001,695946630,1050739900,1554599970,2258257001,3226076876,4538847600,6296972500,8624108025,11671285626 add $0,1 pow $0,2 bin $0,4 mov $1,$0
43.625
230
0.802292
e9048028a3436011cb2d7298c43a2b50ce6b32ee
638
asm
Assembly
ALINK/t2.asm
DarkRiDDeR/mandelbrotin-fractal-generation-NASM
69f4e4cb98ad8bae983b3e76e7c38c5a7861acb6
[ "MIT" ]
3
2016-07-19T06:49:01.000Z
2018-04-25T06:46:25.000Z
ALINK/t2.asm
DarkRiDDeR/mandelbrotin-fractal-generation-NASM
69f4e4cb98ad8bae983b3e76e7c38c5a7861acb6
[ "MIT" ]
null
null
null
ALINK/t2.asm
DarkRiDDeR/mandelbrotin-fractal-generation-NASM
69f4e4cb98ad8bae983b3e76e7c38c5a7861acb6
[ "MIT" ]
null
null
null
; t2.asm ; assemble with: ; nasm -fobj t2.asm ; ; link with ; alink -oPE t2 ; ; run with ; t2 ; ; expected output is four message boxes. First two say "Hello" in title ; last two say "Bye" in title import start tdll.dll import title1 tdll.dll extern start extern title1 segment code public use32 class=CODE ..start: exestart: call [start] ;display two message boxes ;need to call [start], since start gives address ;of Import Address Table entry, a pointer to routine mov ebx,[title1] ;get address of title1 from IAT mov [ebx],byte 'B' mov [ebx+1],byte 'y' mov [ebx+2],byte 'e' mov [ebx+3],byte 0 call [start] ret
17.243243
71
0.69279
7187056365c567ba5861a45d8106f33f221e0593
318
asm
Assembly
oeis/174/A174785.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/174/A174785.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/174/A174785.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A174785: Expansion of (1+2x-x^2+x^3-x^4-x^5)/(1+x^3)^2. ; 1,2,-1,-1,-5,1,1,8,-1,-1,-11,1,1,14,-1,-1,-17,1,1,20,-1,-1,-23,1,1,26,-1,-1,-29,1,1,32,-1,-1,-35,1,1,38,-1,-1,-41,1,1,44,-1,-1,-47,1,1,50,-1 mul $0,2 mov $2,2 mov $3,$0 lpb $0 sub $0,1 trn $0,2 add $2,$3 sub $3,$2 sub $3,$2 lpe mov $0,$2 div $0,2
19.875
142
0.487421
b7eae1f6efa722ce69ceb224fddb4fa85aa81065
7,410
asm
Assembly
snapgear_linux/lib/libgmp/mpn/x86/k7/aorsmul_1.asm
impedimentToProgress/UCI-BlueChip
53e5d48b79079eaf60d42f7cb65bb795743d19fc
[ "MIT" ]
null
null
null
snapgear_linux/lib/libgmp/mpn/x86/k7/aorsmul_1.asm
impedimentToProgress/UCI-BlueChip
53e5d48b79079eaf60d42f7cb65bb795743d19fc
[ "MIT" ]
null
null
null
snapgear_linux/lib/libgmp/mpn/x86/k7/aorsmul_1.asm
impedimentToProgress/UCI-BlueChip
53e5d48b79079eaf60d42f7cb65bb795743d19fc
[ "MIT" ]
3
2016-06-13T13:20:56.000Z
2019-12-05T02:31:23.000Z
# AMD K7 mpn_addmul_1/mpn_submul_1 -- add or subtract mpn multiple. # # K7: 3.9 cycles/limb. # # Future: It should be possible to avoid the separate mul after the unrolled # loop by moving the movl/adcl to the top. # Copyright (C) 1999, 2000 Free Software Foundation, Inc. # # This file is part of the GNU MP Library. # # The GNU MP Library is free software; you can redistribute it and/or modify # it under the terms of the GNU Library General Public License as published by # the Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # The GNU MP Library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public # License for more details. # # You should have received a copy of the GNU Library General Public License # along with the GNU MP Library; see the file COPYING.LIB. If not, write to # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA. include(`../config.m4') dnl K7: UNROLL_COUNT cycles/limb dnl 4 4.42 dnl 8 4.16 dnl 16 3.9 dnl 32 3.9 dnl 64 3.87 dnl Maximum possible with the current code is 64. deflit(UNROLL_COUNT, 16) ifdef(`OPERATION_addmul_1',` define(M4_inst, addl) define(M4_function_1, mpn_addmul_1) define(M4_function_1c, mpn_addmul_1c) define(M4_description, add it to) define(M4_desc_retval, carry) ',`ifdef(`OPERATION_submul_1',` define(M4_inst, subl) define(M4_function_1, mpn_submul_1) define(M4_function_1c, mpn_submul_1c) define(M4_description, subtract it from) define(M4_desc_retval, borrow) ',`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1 ')')') MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c) `#' mp_limb_t M4_function_1 (mp_ptr dst, mp_srcptr src, mp_size_t size, `#' mp_limb_t mult); `#' mp_limb_t M4_function_1c (mp_ptr dst, mp_srcptr src, mp_size_t size, `#' mp_limb_t mult, mp_limb_t carry); `#' `#' Calculate src,size multiplied by mult and M4_description dst,size. `#' Return the M4_desc_retval limb from the top of the result. ifdef(`PIC',` deflit(UNROLL_THRESHOLD, 9) ',` deflit(UNROLL_THRESHOLD, 6) ') defframe(PARAM_CARRY, 20) defframe(PARAM_MULTIPLIER,16) defframe(PARAM_SIZE, 12) defframe(PARAM_SRC, 8) defframe(PARAM_DST, 4) deflit(`FRAME',0) defframe(SAVE_EBX, -4) defframe(SAVE_ESI, -8) defframe(SAVE_EDI, -12) defframe(SAVE_EBP, -16) deflit(SAVE_SIZE, 16) .text ALIGN(32) PROLOGUE(M4_function_1) movl PARAM_SIZE, %edx movl PARAM_SRC, %eax xorl %ecx, %ecx decl %edx jnz LF(M4_function_1c,start_1) movl (%eax), %eax movl PARAM_DST, %ecx mull PARAM_MULTIPLIER M4_inst %eax, (%ecx) adcl $0, %edx movl %edx, %eax ret EPILOGUE() ALIGN(16) PROLOGUE(M4_function_1c) movl PARAM_SIZE, %edx movl PARAM_SRC, %eax decl %edx jnz L(more_than_one_limb) movl (%eax), %eax movl PARAM_DST, %ecx mull PARAM_MULTIPLIER addl PARAM_CARRY, %eax adcl $0, %edx M4_inst %eax, (%ecx) adcl $0, %edx movl %edx, %eax ret # offset 0x44 so close enough to aligned L(more_than_one_limb): movl PARAM_CARRY, %ecx L(start_1): # eax src # ecx initial carry # edx size-1 subl $SAVE_SIZE, %esp deflit(`FRAME',16) movl %ebx, SAVE_EBX movl %esi, SAVE_ESI movl %edx, %ebx # size-1 movl PARAM_SRC, %esi movl %ebp, SAVE_EBP cmpl $UNROLL_THRESHOLD, %edx movl PARAM_MULTIPLIER, %ebp movl %edi, SAVE_EDI movl (%esi), %eax # src low limb movl PARAM_DST, %edi ja L(unroll) # simple loop leal 4(%esi,%ebx,4), %esi # point one limb past last leal (%edi,%ebx,4), %edi # point at last limb negl %ebx # The movl to load the next source limb is done well ahead of the # mul. This is necessary for full speed, and leads to one limb # handled separately at the end. L(simple): # eax src limb # ebx loop counter # ecx carry limb # edx scratch # esi src # edi dst # ebp multiplier mull %ebp addl %eax, %ecx adcl $0, %edx M4_inst %ecx, (%edi,%ebx,4) movl (%esi,%ebx,4), %eax adcl $0, %edx incl %ebx movl %edx, %ecx jnz L(simple) mull %ebp movl SAVE_EBX, %ebx movl SAVE_ESI, %esi movl SAVE_EBP, %ebp addl %eax, %ecx adcl $0, %edx M4_inst %ecx, (%edi) adcl $0, %edx movl SAVE_EDI, %edi addl $SAVE_SIZE, %esp movl %edx, %eax ret #----------------------------------------------------------------------- ALIGN(16) L(unroll): # eax src low limb # ebx size-1 # ecx carry # edx size-1 # esi src # edi dst # ebp multiplier dnl overlapping with parameters no longer needed define(VAR_COUNTER,`PARAM_SIZE') define(VAR_JUMP, `PARAM_MULTIPLIER') subl $2, %ebx # (size-2)-1 decl %edx # size-2 shrl $UNROLL_LOG2, %ebx negl %edx movl %ebx, VAR_COUNTER andl $UNROLL_MASK, %edx movl %edx, %ebx shll $4, %edx ifdef(`PIC',` call L(pic_calc) L(here): ',` leal L(entry) (%edx,%ebx,1), %edx ') negl %ebx movl %edx, VAR_JUMP mull %ebp addl %eax, %ecx # initial carry, becomes low carry adcl $0, %edx testb $1, %bl movl 4(%esi), %eax # src second limb leal ifelse(UNROLL_BYTES,256,128+) 8(%esi,%ebx,4), %esi leal ifelse(UNROLL_BYTES,256,128) (%edi,%ebx,4), %edi movl %edx, %ebx # high carry cmovnz_ecx_ebx # high,low carry other way around cmovnz_edx_ecx jmp *VAR_JUMP ifdef(`PIC',` L(pic_calc): # See README.family about old gas bugs leal (%edx,%ebx,1), %edx addl $L(entry)-L(here), %edx addl (%esp), %edx ret ') #----------------------------------------------------------------------- # This code uses a "two carry limbs" scheme. At the top of the loop the # carries are ebx=lo, ecx=hi, then they swap for each limb processed. For # the computed jump an odd size means they start one way around, an even # size the other. Either way one limb is handled separately at the start of # the loop. # # The positioning of the movl to load the next source limb is important. # Moving it after the adcl with a view to avoiding a separate mul at the end # of the loop slows the code down. ALIGN(32) L(top): # eax src limb # ebx carry high # ecx carry low # edx scratch # esi src+8 # edi dst # ebp multiplier # # VAR_COUNTER loop counter # # 17 bytes each limb L(entry): deflit(CHUNK_COUNT,2) forloop(`i', 0, UNROLL_COUNT/CHUNK_COUNT-1, ` deflit(`disp0', eval(i*CHUNK_COUNT*4 ifelse(UNROLL_BYTES,256,-128))) deflit(`disp1', eval(disp0 + 4)) mull %ebp Zdisp( M4_inst,%ecx, disp0,(%edi)) movl $0, %ecx adcl %eax, %ebx Zdisp( movl, disp0,(%esi), %eax) adcl %edx, %ecx mull %ebp M4_inst %ebx, disp1(%edi) movl $0, %ebx adcl %eax, %ecx movl disp1(%esi), %eax adcl %edx, %ebx ') decl VAR_COUNTER leal UNROLL_BYTES(%esi), %esi leal UNROLL_BYTES(%edi), %edi jns L(top) # eax src limb # ebx carry high # ecx carry low # edx # esi # edi dst (points at second last limb) # ebp multiplier deflit(`disp0', ifelse(UNROLL_BYTES,256,-128)) deflit(`disp1', eval(disp0-0 + 4)) mull %ebp M4_inst %ecx, disp0(%edi) movl SAVE_EBP, %ebp adcl %ebx, %eax movl SAVE_EBX, %ebx movl SAVE_ESI, %esi adcl $0, %edx M4_inst %eax, disp1(%edi) movl SAVE_EDI, %edi adcl $0, %edx addl $SAVE_SIZE, %esp movl %edx, %eax ret EPILOGUE()
20.30137
78
0.667341
de51fad1bde6ed5cfe289548b635529c10c4037c
659
asm
Assembly
oeis/102/A102743.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/102/A102743.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/102/A102743.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A102743: Expansion of LambertW(-x)/(x*(x-1)). ; Submitted by Christian Krause ; 1,2,7,37,273,2661,32773,491555,8715409,178438681,4142334501,107483043735,3081956918857,96759352320437,3300826000845493,121569984050610331,4807542796319581089,203167758634027130289,9137406513197290531141,435754723750748520091679,21963591115345996527414361,1166664912108669971283649357,65138212187086225255489875477,3813692381779170896933700248547,233637164314720138700633659480753,14947614877405218424315655523113801,996904774525893388151891036219820133,69193881862777405743586680750083875495 add $0,1 mov $1,$0 seq $1,277505 ; E.g.f.: -LambertW(-x)/(1-x). div $1,$0 mov $0,$1
65.9
493
0.855842
3e04c14675ea74b3ec723ba03ab556408d630dca
6,991
asm
Assembly
files/commboy.asm
jrsharp/jrsharp.github.io
847eb458b64e6167fd622f7b35555042445bcd71
[ "MIT" ]
null
null
null
files/commboy.asm
jrsharp/jrsharp.github.io
847eb458b64e6167fd622f7b35555042445bcd71
[ "MIT" ]
null
null
null
files/commboy.asm
jrsharp/jrsharp.github.io
847eb458b64e6167fd622f7b35555042445bcd71
[ "MIT" ]
null
null
null
;************************************* ;* CommBoy * ;* an RS232 Terminal Program for GBC * ;* for use with Ken Kaarvik's * ;* serial port circuit * ;* * ;* Jon Sharp 11/23/00 * ;* * ;* Original code (and most * ;* substantial portion) * ;* written by Ken Kaarvik * ;************************************* blank equ 16 SECTION "Org $0",HOME ret ; Button Push Interrupt - For sending out data while ; waiting for input SECTION "Org $60",HOME[$60] push af call pad_Read call send_test xor a ldh [$00],a pop af reti INCLUDE "HARDWARE.INC" INCLUDE "IBMPC1.INC" INCLUDE "ADDSUB1.INC" SECTION "Header",HOME[$0100] nop jp Startup DB $CE,$ED,$66,$66,$CC,$0D,$00,$0B,$03,$73,$00,$83,$00,$0C,$00,$0D DB $00,$08,$11,$1F,$88,$89,$00,$0E,$DC,$CC,$6E,$E6,$DD,$DD,$D9,$99 DB $BB,$BB,$67,$63,$6E,$0E,$EC,$CC,$DD,$DC,$99,$9F,$BB,$B9,$33,$3E ;0123456789ABCDE DB "CommBoy " DB $80 ;$80=Color GB DB 0,0,0 ;SuperGameboy DB 0 ;CARTTYPE ;-------- ;0 - ROM ONLY ;1 - ROM+MBC1 ;2 - ROM+MBC1+RAM ;3 - ROM+MBC1+RAM+BATTERY ;5 - ROM+MBC2 ;6 - ROM+MBC2+BATTERY DB 0 ;ROMSIZE ;------- ;0 - 256 kBit ( 32 kByte, 2 banks) ;1 - 512 kBit ( 64 kByte, 4 banks) ;2 - 1 MBit (128 kByte, 8 banks) ;3 - 2 MBit (256 kByte, 16 banks) ;3 - 4 MBit (512 kByte, 32 banks) DB 0 ;RAMSIZE ;------- ;0 - NONE ;1 - 16 kBit ( 2 kByte, 1 bank ) ;2 - 64 kBit ( 8 kByte, 1 bank ) ;3 - 256 kBit (32 kByte, 4 banks) DW $0000 ;Manufacturer DB 0 ;Version DB 0 ;Complement check DW 0 ;Checksum INCLUDE "MEMORY1.ASM" INCLUDE "KEYPAD.ASM" SECTION "Main",home[$0150] Startup call initialize Main call inc_counter call read_rs232 call wait_vb call write_to_screen jp Main ret send_test ld a,[_PadDataEdge] ;_PadData] cp 0 ret z cp PADF_A jp z,service_button_a cp PADF_B jp z,service_button_b cp PADF_START jp z,service_start cp PADF_SELECT jp z,service_select cp PADF_UP jp z,service_up cp PADF_DOWN jp z,service_down cp PADF_LEFT jp z,service_left cp PADF_RIGHT jp z,service_right ret service_button_a ld a,[inputchar] inc a ld [inputchar],a call print_inputchar ret service_button_b ld a,[inputchar] dec a ld [inputchar],a call print_inputchar ret service_start ld a,[inputchar] ld b,a call send_rs232 ret service_select ld a,$FF ld b,a call send_rs232 ret service_up ;use joypad to scroll around screen - JS ld a,[rSCY] sub 32 ld [rSCY],a ret service_down ld a,[rSCY] add 32 ld [rSCY],a ret service_left ld a,[rSCX] sub 32 ld [rSCX],a ret service_right ld a,[rSCX] add 32 ld [rSCX],a ret clear_ram ld a,blank ld hl,raw_data ld bc,36 call mem_Set ret read_rs232 ;read in byte at pin4 ld b,$80 ;$01 ei wait_for_start_bit ldh a,[$56] bit 4,a jp nz,wait_for_start_bit di call delay_130us read_next_bit ldh a,[$56] swap a rr a ;put pin 4 into carry rr b jp c,wait_for_stop_bit call delay_104us jp read_next_bit wait_for_stop_bit call delay_104us call delay_104us wait_for_after_stop_bit ld a,b ld [raw_data],a ret send_rs232 ;send byte in B out Sout ld e,8 ld a,0 ;send start bit ldh [$01],a ld a,$83 ldh [$02],a call delay_104us_send send_next_bit rr b ld a,0 jp nc,keep_it_zero ld a,$FF keep_it_zero ldh [$01],a ld a,$83 ldh [$02],a call delay_104us_send dec e jp nz,send_next_bit ld a,$FF ;send stop bit ldh [$01],a ld a,$83 ldh [$02],a call delay_104us_send ret delay_130us ld d,23 d130 dec d jp nz,d130 ret delay_104us ld d,17 d104 dec d jp nz,d104 ret delay_104us_send ld d,16 d104s dec d jp nz,d104s ret inc_counter ld a,[counter] inc a ld [counter],a ret inc_charcounter ld a,[charcounter] inc a ld [charcounter],a ret write_to_screen call inc_charcounter call print_inputchar call shift_curs_right call wrap_text_to_nextline ld a,[raw_data] call display_char ret shift_curs_right ;print incoming text to the right - JS ld a,[hladdr] ld h,a ld a,[hladdr+1] ld l,a inc hl ld a,h ld [hladdr],a ld a,l ld [hladdr+1],a ret wrap_text_to_nextline ld a,[charcounter] cp 22 jp z,.next cp 42 jp z,.next cp 62 jp z,.next cp 82 jp z,.next cp 102 jp z,.next cp 122 jp z,.next cp 142 jp z,.next cp 162 jp z,.next cp 182 jp z,.next cp 202 jp z,.next cp 222 jp z,.next cp 242 jp z,.first ret .first xor a ld [charcounter],a ld hl,$9800+(32*2) ld a,h ld [hladdr],a ld a,l ld [hladdr+1],a ret .next add16i hl,12 ld a,h ld [hladdr],a ld a,l ld [hladdr+1],a ret print_inputchar lcd_WaitVRAM ld a,[inputchar] ; add 20 ld de,$9800+(32*18)+10 ld [de],a ret display_byte ;enter with value in [de] lcd_WaitVRAM ld a,[de] ld b,a and $F0 swap a ld [hl+],a lcd_WaitVRAM ld a,b and $0F ld [hl],a ret display_char bit 7,a ;don't look up non print chars ret nz push af lcd_WaitVRAM pop af ld [hl],a ret initialize di .wait ldh a,[$44] ;LY LCDC compare cp 144 jr nc,.wait ld a,0 ldh [$40],a ;LCDC lcd control ld a,%10000000 ldh [$68],a ;BCPS ld a,%00000000 ;palette 0 0 bg ldh [$69],a ;BCPD ld a,%00000000 ldh [$69],a ld a,%11111110 ;palette 0 1 ldh [$69],a ld a,%00011110 ldh [$69],a ld a,%11111111 ;palette 0 2 fg test font ldh [$69],a ld a,%01111111 ldh [$69],a ld a,%11111111 ;palette 0 3 fg ibm font ldh [$69],a ld a,%01111111 ldh [$69],a ld hl,ibm_characters ;load ibm font ld de,$8000 ld bc,8*128 call mem_CopyMono ld a,$FF ;blank char ld hl,$9800 ld bc,20*32*32 call mem_Set ld a,0 ldh [$42],a ;SCY Scroll Y ldh [$43],a ;SCX Scroll X ld a,%00000011 ldh [$47],a ;BGP ld a,$00000000 ldh [$FF],a ;IE ld a,%10010001 ldh [$40],a xor a ld [$FF24],a xor a ld [counter],a xor a ld [charcounter],a ld a,%11000000 ldh [$56],a ld a,$FF ;send stop bit ldh [$01],a ld a,$83 ldh [$02],a ld a,IEF_HILO ldh [rIE],a ld a,$98 ;fill hladdr - JS ld [hladdr],a ld a,$3D ld [hladdr+1],a ld a,$40 ;init inputchar - JS ld [inputchar],a ret wait_vb ldh a,[$44] cp 144 jp nz,wait_vb ret ibm_characters chr_IBMPC1 1,8 SECTION "GB_ram",BSS counter DS 1 raw_data DS 1 inputchar DS 1 ;added for keypad input handling - JS charcounter DS 1 ;added to wrap lines around - JS hladdr DS 2 ;added for output scrolling - JS
14.656184
68
0.582177
4a25bfe533fa5f83bf493e8e94141c8b8b3b18f7
544
asm
Assembly
programs/oeis/027/A027861.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/027/A027861.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/027/A027861.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A027861: Numbers k such that k^2 + (k+1)^2 is prime. ; 1,2,4,5,7,9,12,14,17,19,22,24,25,29,30,32,34,35,39,42,47,50,60,65,69,70,72,79,82,84,85,87,90,97,99,100,102,104,109,110,115,122,130,135,137,139,144,149,154,157,160,162,164,167,172,174,185,187,189,195,199,202,204,207,212,217,220,222,224,225,229,230,235,259,260,264,267,272,279,284,285,287,289,290,297,304,315,319,320,324,330,334,342,344,347,349,355,357,369,372 seq $0,129307 ; Intersection of A000217 and A005098. seq $0,25676 ; Exponent of 8 (value of i) in n-th number of form 8^i*9^j.
90.666667
360
0.705882
d627ccacbfb9640f4385cbee66353c77f33280bf
2,406
asm
Assembly
engine/engine/interrupt/declarations/state.asm
neomura/atmega328p-cartridge
e7152425e5253cd4e513cad41dc03d306003e91e
[ "MIT" ]
null
null
null
engine/engine/interrupt/declarations/state.asm
neomura/atmega328p-cartridge
e7152425e5253cd4e513cad41dc03d306003e91e
[ "MIT" ]
2
2021-04-17T09:31:24.000Z
2021-04-17T09:31:53.000Z
engine/engine/interrupt/declarations/state.asm
neomura/atmega328p-cartridge
e7152425e5253cd4e513cad41dc03d306003e91e
[ "MIT" ]
null
null
null
; Selects the alternative palette when set; written from the row event handler when video_next_row is odd (1, 3, 5) and the frame event handler and read from by the interrupt when video_next_row is even (0, 2, 4). .equ INTERRUPT_FLAG_PALETTE_A = 0 ; Selects the alternative palette when set; written from the row event handler when video_next_row is even (0, 2, 4) and the frame event handler and read from by the interrupt when video_next_row is odd (1, 3, 5). .equ INTERRUPT_FLAG_PALETTE_B = 1 ; Alternates between set and cleared once per line when the video standard is PAL. .equ INTERRUPT_FLAG_ALTERNATE_LINE = 2 ; Flags used internally by the interrupt. See INTERRUPT_FLAG_*. .def interrupt_flags = r18 ; The number of VSYNC lines per frame. .equ INTERRUPT_VSYNC_LINES = 3 ; The number of lines between the VSYNC and active lines. .equ INTERRUPT_PRE_BLANK_LINES = 27 ; The number of lines between the VSYNC and active lines. .equ INTERRUPT_POST_BLANK_LINES = 9 ; The first VSYNC line. .equ INTERRUPT_STATE_VSYNC_START = 0 ; The last VSYNC line. .equ INTERRUPT_STATE_VSYNC_END = INTERRUPT_VSYNC_LINES - 1 ; The first pre-active blank line. .equ INTERRUPT_STATE_PRE_BLANK_START = INTERRUPT_VSYNC_LINES ; The last pre-active blank line. .equ INTERRUPT_STATE_PRE_BLANK_END = INTERRUPT_STATE_VSYNC_END + INTERRUPT_PRE_BLANK_LINES ; The first repeat of an active line. .equ INTERRUPT_STATE_ACTIVE_A = INTERRUPT_STATE_PRE_BLANK_END + 1 ; The second repeat of an active line. .equ INTERRUPT_STATE_ACTIVE_B = INTERRUPT_STATE_ACTIVE_A + 1 ; The first post-active blank line. .equ INTERRUPT_STATE_POST_BLANK_START = INTERRUPT_STATE_ACTIVE_B + 1 ; The last post-active blank line. .equ INTERRUPT_STATE_POST_BLANK_END = INTERRUPT_STATE_ACTIVE_B + INTERRUPT_POST_BLANK_LINES ; Tracks the progress through the current frame (see INTERRUPT_STATE_**). .def interrupt_state = r17 ; Pixel data, packed 4 pixels per byte, for a row being written to by the main loop when video_next_row is odd (1, 3, 5) and read from by the interrupt when video_next_row is even (0, 2, 4). interrupt_framebuffer_a: .byte VIDEO_COLUMNS / VIDEO_PIXELS_PER_BYTE ; Pixel data, packed 4 pixels per byte, for a row being written to by the main loop when video_next_row is even (0, 2, 4) and read from by the interrupt when video_next_row is odd (1, 3, 5). interrupt_framebuffer_b: .byte VIDEO_COLUMNS / VIDEO_PIXELS_PER_BYTE
44.555556
213
0.793017
71095fcb3aedf5356f29150e6ac2f59e56725c8c
342
asm
Assembly
oeis/350/A350384.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/350/A350384.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/350/A350384.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A350384: a(n) = (-1728)^n. ; Submitted by Christian Krause ; 1,-1728,2985984,-5159780352,8916100448256,-15407021574586368,26623333280885243904,-46005119909369701466112,79496847203390844133441536,-137370551967459378662586974208,237376313799769806328950291431424,-410186270246002225336426103593500672 mul $0,3 mov $2,-12 pow $2,$0 mov $0,$2
38
239
0.821637
31c693cd719d52a2bfe0e49037c935429f1a154d
39,858
asm
Assembly
user/sleep.asm
joshiamey/xv6-riscv-fall19
c7098eff109b6548bd16b25996ce47e64925e854
[ "MIT-0" ]
1
2020-10-23T12:35:52.000Z
2020-10-23T12:35:52.000Z
user/sleep.asm
joshiamey/xv6-riscv-fall19
c7098eff109b6548bd16b25996ce47e64925e854
[ "MIT-0" ]
null
null
null
user/sleep.asm
joshiamey/xv6-riscv-fall19
c7098eff109b6548bd16b25996ce47e64925e854
[ "MIT-0" ]
null
null
null
user/_sleep: file format elf64-littleriscv Disassembly of section .text: 0000000000000000 <main>: #include "user/user.h" int main(int argc, char *argv[]) { 0: 1101 addi sp,sp,-32 2: ec06 sd ra,24(sp) 4: e822 sd s0,16(sp) 6: e426 sd s1,8(sp) 8: 1000 addi s0,sp,32 int time_to_sleep; if(argc < 2){ a: 4785 li a5,1 c: 02a7dc63 bge a5,a0,44 <main+0x44> fprintf(2, "Usage: sleep <time> \n"); exit(1); } time_to_sleep = atoi(argv[1]); 10: 6588 ld a0,8(a1) 12: 00000097 auipc ra,0x0 16: 1c4080e7 jalr 452(ra) # 1d6 <atoi> 1a: 84aa mv s1,a0 fprintf(1,"User sleep for %d \n", time_to_sleep); 1c: 862a mv a2,a0 1e: 00000597 auipc a1,0x0 22: 7f258593 addi a1,a1,2034 # 810 <malloc+0xfc> 26: 4505 li a0,1 28: 00000097 auipc ra,0x0 2c: 600080e7 jalr 1536(ra) # 628 <fprintf> sleep(time_to_sleep); 30: 8526 mv a0,s1 32: 00000097 auipc ra,0x0 36: 334080e7 jalr 820(ra) # 366 <sleep> exit(0); 3a: 4501 li a0,0 3c: 00000097 auipc ra,0x0 40: 29a080e7 jalr 666(ra) # 2d6 <exit> fprintf(2, "Usage: sleep <time> \n"); 44: 00000597 auipc a1,0x0 48: 7b458593 addi a1,a1,1972 # 7f8 <malloc+0xe4> 4c: 4509 li a0,2 4e: 00000097 auipc ra,0x0 52: 5da080e7 jalr 1498(ra) # 628 <fprintf> exit(1); 56: 4505 li a0,1 58: 00000097 auipc ra,0x0 5c: 27e080e7 jalr 638(ra) # 2d6 <exit> 0000000000000060 <strcpy>: #include "kernel/fcntl.h" #include "user/user.h" char* strcpy(char *s, const char *t) { 60: 1141 addi sp,sp,-16 62: e422 sd s0,8(sp) 64: 0800 addi s0,sp,16 char *os; os = s; while((*s++ = *t++) != 0) 66: 87aa mv a5,a0 68: 0585 addi a1,a1,1 6a: 0785 addi a5,a5,1 6c: fff5c703 lbu a4,-1(a1) 70: fee78fa3 sb a4,-1(a5) 74: fb75 bnez a4,68 <strcpy+0x8> ; return os; } 76: 6422 ld s0,8(sp) 78: 0141 addi sp,sp,16 7a: 8082 ret 000000000000007c <strcmp>: int strcmp(const char *p, const char *q) { 7c: 1141 addi sp,sp,-16 7e: e422 sd s0,8(sp) 80: 0800 addi s0,sp,16 while(*p && *p == *q) 82: 00054783 lbu a5,0(a0) 86: cb91 beqz a5,9a <strcmp+0x1e> 88: 0005c703 lbu a4,0(a1) 8c: 00f71763 bne a4,a5,9a <strcmp+0x1e> p++, q++; 90: 0505 addi a0,a0,1 92: 0585 addi a1,a1,1 while(*p && *p == *q) 94: 00054783 lbu a5,0(a0) 98: fbe5 bnez a5,88 <strcmp+0xc> return (uchar)*p - (uchar)*q; 9a: 0005c503 lbu a0,0(a1) } 9e: 40a7853b subw a0,a5,a0 a2: 6422 ld s0,8(sp) a4: 0141 addi sp,sp,16 a6: 8082 ret 00000000000000a8 <strlen>: uint strlen(const char *s) { a8: 1141 addi sp,sp,-16 aa: e422 sd s0,8(sp) ac: 0800 addi s0,sp,16 int n; for(n = 0; s[n]; n++) ae: 00054783 lbu a5,0(a0) b2: cf91 beqz a5,ce <strlen+0x26> b4: 0505 addi a0,a0,1 b6: 87aa mv a5,a0 b8: 4685 li a3,1 ba: 9e89 subw a3,a3,a0 bc: 00f6853b addw a0,a3,a5 c0: 0785 addi a5,a5,1 c2: fff7c703 lbu a4,-1(a5) c6: fb7d bnez a4,bc <strlen+0x14> ; return n; } c8: 6422 ld s0,8(sp) ca: 0141 addi sp,sp,16 cc: 8082 ret for(n = 0; s[n]; n++) ce: 4501 li a0,0 d0: bfe5 j c8 <strlen+0x20> 00000000000000d2 <memset>: void* memset(void *dst, int c, uint n) { d2: 1141 addi sp,sp,-16 d4: e422 sd s0,8(sp) d6: 0800 addi s0,sp,16 char *cdst = (char *) dst; int i; for(i = 0; i < n; i++){ d8: ce09 beqz a2,f2 <memset+0x20> da: 87aa mv a5,a0 dc: fff6071b addiw a4,a2,-1 e0: 1702 slli a4,a4,0x20 e2: 9301 srli a4,a4,0x20 e4: 0705 addi a4,a4,1 e6: 972a add a4,a4,a0 cdst[i] = c; e8: 00b78023 sb a1,0(a5) for(i = 0; i < n; i++){ ec: 0785 addi a5,a5,1 ee: fee79de3 bne a5,a4,e8 <memset+0x16> } return dst; } f2: 6422 ld s0,8(sp) f4: 0141 addi sp,sp,16 f6: 8082 ret 00000000000000f8 <strchr>: char* strchr(const char *s, char c) { f8: 1141 addi sp,sp,-16 fa: e422 sd s0,8(sp) fc: 0800 addi s0,sp,16 for(; *s; s++) fe: 00054783 lbu a5,0(a0) 102: cb99 beqz a5,118 <strchr+0x20> if(*s == c) 104: 00f58763 beq a1,a5,112 <strchr+0x1a> for(; *s; s++) 108: 0505 addi a0,a0,1 10a: 00054783 lbu a5,0(a0) 10e: fbfd bnez a5,104 <strchr+0xc> return (char*)s; return 0; 110: 4501 li a0,0 } 112: 6422 ld s0,8(sp) 114: 0141 addi sp,sp,16 116: 8082 ret return 0; 118: 4501 li a0,0 11a: bfe5 j 112 <strchr+0x1a> 000000000000011c <gets>: char* gets(char *buf, int max) { 11c: 711d addi sp,sp,-96 11e: ec86 sd ra,88(sp) 120: e8a2 sd s0,80(sp) 122: e4a6 sd s1,72(sp) 124: e0ca sd s2,64(sp) 126: fc4e sd s3,56(sp) 128: f852 sd s4,48(sp) 12a: f456 sd s5,40(sp) 12c: f05a sd s6,32(sp) 12e: ec5e sd s7,24(sp) 130: 1080 addi s0,sp,96 132: 8baa mv s7,a0 134: 8a2e mv s4,a1 int i, cc; char c; for(i=0; i+1 < max; ){ 136: 892a mv s2,a0 138: 4481 li s1,0 cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; if(c == '\n' || c == '\r') 13a: 4aa9 li s5,10 13c: 4b35 li s6,13 for(i=0; i+1 < max; ){ 13e: 89a6 mv s3,s1 140: 2485 addiw s1,s1,1 142: 0344d863 bge s1,s4,172 <gets+0x56> cc = read(0, &c, 1); 146: 4605 li a2,1 148: faf40593 addi a1,s0,-81 14c: 4501 li a0,0 14e: 00000097 auipc ra,0x0 152: 1a0080e7 jalr 416(ra) # 2ee <read> if(cc < 1) 156: 00a05e63 blez a0,172 <gets+0x56> buf[i++] = c; 15a: faf44783 lbu a5,-81(s0) 15e: 00f90023 sb a5,0(s2) if(c == '\n' || c == '\r') 162: 01578763 beq a5,s5,170 <gets+0x54> 166: 0905 addi s2,s2,1 168: fd679be3 bne a5,s6,13e <gets+0x22> for(i=0; i+1 < max; ){ 16c: 89a6 mv s3,s1 16e: a011 j 172 <gets+0x56> 170: 89a6 mv s3,s1 break; } buf[i] = '\0'; 172: 99de add s3,s3,s7 174: 00098023 sb zero,0(s3) return buf; } 178: 855e mv a0,s7 17a: 60e6 ld ra,88(sp) 17c: 6446 ld s0,80(sp) 17e: 64a6 ld s1,72(sp) 180: 6906 ld s2,64(sp) 182: 79e2 ld s3,56(sp) 184: 7a42 ld s4,48(sp) 186: 7aa2 ld s5,40(sp) 188: 7b02 ld s6,32(sp) 18a: 6be2 ld s7,24(sp) 18c: 6125 addi sp,sp,96 18e: 8082 ret 0000000000000190 <stat>: int stat(const char *n, struct stat *st) { 190: 1101 addi sp,sp,-32 192: ec06 sd ra,24(sp) 194: e822 sd s0,16(sp) 196: e426 sd s1,8(sp) 198: e04a sd s2,0(sp) 19a: 1000 addi s0,sp,32 19c: 892e mv s2,a1 int fd; int r; fd = open(n, O_RDONLY); 19e: 4581 li a1,0 1a0: 00000097 auipc ra,0x0 1a4: 176080e7 jalr 374(ra) # 316 <open> if(fd < 0) 1a8: 02054563 bltz a0,1d2 <stat+0x42> 1ac: 84aa mv s1,a0 return -1; r = fstat(fd, st); 1ae: 85ca mv a1,s2 1b0: 00000097 auipc ra,0x0 1b4: 17e080e7 jalr 382(ra) # 32e <fstat> 1b8: 892a mv s2,a0 close(fd); 1ba: 8526 mv a0,s1 1bc: 00000097 auipc ra,0x0 1c0: 142080e7 jalr 322(ra) # 2fe <close> return r; } 1c4: 854a mv a0,s2 1c6: 60e2 ld ra,24(sp) 1c8: 6442 ld s0,16(sp) 1ca: 64a2 ld s1,8(sp) 1cc: 6902 ld s2,0(sp) 1ce: 6105 addi sp,sp,32 1d0: 8082 ret return -1; 1d2: 597d li s2,-1 1d4: bfc5 j 1c4 <stat+0x34> 00000000000001d6 <atoi>: int atoi(const char *s) { 1d6: 1141 addi sp,sp,-16 1d8: e422 sd s0,8(sp) 1da: 0800 addi s0,sp,16 int n; n = 0; while('0' <= *s && *s <= '9') 1dc: 00054603 lbu a2,0(a0) 1e0: fd06079b addiw a5,a2,-48 1e4: 0ff7f793 andi a5,a5,255 1e8: 4725 li a4,9 1ea: 02f76963 bltu a4,a5,21c <atoi+0x46> 1ee: 86aa mv a3,a0 n = 0; 1f0: 4501 li a0,0 while('0' <= *s && *s <= '9') 1f2: 45a5 li a1,9 n = n*10 + *s++ - '0'; 1f4: 0685 addi a3,a3,1 1f6: 0025179b slliw a5,a0,0x2 1fa: 9fa9 addw a5,a5,a0 1fc: 0017979b slliw a5,a5,0x1 200: 9fb1 addw a5,a5,a2 202: fd07851b addiw a0,a5,-48 while('0' <= *s && *s <= '9') 206: 0006c603 lbu a2,0(a3) 20a: fd06071b addiw a4,a2,-48 20e: 0ff77713 andi a4,a4,255 212: fee5f1e3 bgeu a1,a4,1f4 <atoi+0x1e> return n; } 216: 6422 ld s0,8(sp) 218: 0141 addi sp,sp,16 21a: 8082 ret n = 0; 21c: 4501 li a0,0 21e: bfe5 j 216 <atoi+0x40> 0000000000000220 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 220: 1141 addi sp,sp,-16 222: e422 sd s0,8(sp) 224: 0800 addi s0,sp,16 char *dst; const char *src; dst = vdst; src = vsrc; if (src > dst) { 226: 02b57663 bgeu a0,a1,252 <memmove+0x32> while(n-- > 0) 22a: 02c05163 blez a2,24c <memmove+0x2c> 22e: fff6079b addiw a5,a2,-1 232: 1782 slli a5,a5,0x20 234: 9381 srli a5,a5,0x20 236: 0785 addi a5,a5,1 238: 97aa add a5,a5,a0 dst = vdst; 23a: 872a mv a4,a0 *dst++ = *src++; 23c: 0585 addi a1,a1,1 23e: 0705 addi a4,a4,1 240: fff5c683 lbu a3,-1(a1) 244: fed70fa3 sb a3,-1(a4) while(n-- > 0) 248: fee79ae3 bne a5,a4,23c <memmove+0x1c> src += n; while(n-- > 0) *--dst = *--src; } return vdst; } 24c: 6422 ld s0,8(sp) 24e: 0141 addi sp,sp,16 250: 8082 ret dst += n; 252: 00c50733 add a4,a0,a2 src += n; 256: 95b2 add a1,a1,a2 while(n-- > 0) 258: fec05ae3 blez a2,24c <memmove+0x2c> 25c: fff6079b addiw a5,a2,-1 260: 1782 slli a5,a5,0x20 262: 9381 srli a5,a5,0x20 264: fff7c793 not a5,a5 268: 97ba add a5,a5,a4 *--dst = *--src; 26a: 15fd addi a1,a1,-1 26c: 177d addi a4,a4,-1 26e: 0005c683 lbu a3,0(a1) 272: 00d70023 sb a3,0(a4) while(n-- > 0) 276: fee79ae3 bne a5,a4,26a <memmove+0x4a> 27a: bfc9 j 24c <memmove+0x2c> 000000000000027c <memcmp>: int memcmp(const void *s1, const void *s2, uint n) { 27c: 1141 addi sp,sp,-16 27e: e422 sd s0,8(sp) 280: 0800 addi s0,sp,16 const char *p1 = s1, *p2 = s2; while (n-- > 0) { 282: ca05 beqz a2,2b2 <memcmp+0x36> 284: fff6069b addiw a3,a2,-1 288: 1682 slli a3,a3,0x20 28a: 9281 srli a3,a3,0x20 28c: 0685 addi a3,a3,1 28e: 96aa add a3,a3,a0 if (*p1 != *p2) { 290: 00054783 lbu a5,0(a0) 294: 0005c703 lbu a4,0(a1) 298: 00e79863 bne a5,a4,2a8 <memcmp+0x2c> return *p1 - *p2; } p1++; 29c: 0505 addi a0,a0,1 p2++; 29e: 0585 addi a1,a1,1 while (n-- > 0) { 2a0: fed518e3 bne a0,a3,290 <memcmp+0x14> } return 0; 2a4: 4501 li a0,0 2a6: a019 j 2ac <memcmp+0x30> return *p1 - *p2; 2a8: 40e7853b subw a0,a5,a4 } 2ac: 6422 ld s0,8(sp) 2ae: 0141 addi sp,sp,16 2b0: 8082 ret return 0; 2b2: 4501 li a0,0 2b4: bfe5 j 2ac <memcmp+0x30> 00000000000002b6 <memcpy>: void * memcpy(void *dst, const void *src, uint n) { 2b6: 1141 addi sp,sp,-16 2b8: e406 sd ra,8(sp) 2ba: e022 sd s0,0(sp) 2bc: 0800 addi s0,sp,16 return memmove(dst, src, n); 2be: 00000097 auipc ra,0x0 2c2: f62080e7 jalr -158(ra) # 220 <memmove> } 2c6: 60a2 ld ra,8(sp) 2c8: 6402 ld s0,0(sp) 2ca: 0141 addi sp,sp,16 2cc: 8082 ret 00000000000002ce <fork>: # generated by usys.pl - do not edit #include "kernel/syscall.h" .global fork fork: li a7, SYS_fork 2ce: 4885 li a7,1 ecall 2d0: 00000073 ecall ret 2d4: 8082 ret 00000000000002d6 <exit>: .global exit exit: li a7, SYS_exit 2d6: 4889 li a7,2 ecall 2d8: 00000073 ecall ret 2dc: 8082 ret 00000000000002de <wait>: .global wait wait: li a7, SYS_wait 2de: 488d li a7,3 ecall 2e0: 00000073 ecall ret 2e4: 8082 ret 00000000000002e6 <pipe>: .global pipe pipe: li a7, SYS_pipe 2e6: 4891 li a7,4 ecall 2e8: 00000073 ecall ret 2ec: 8082 ret 00000000000002ee <read>: .global read read: li a7, SYS_read 2ee: 4895 li a7,5 ecall 2f0: 00000073 ecall ret 2f4: 8082 ret 00000000000002f6 <write>: .global write write: li a7, SYS_write 2f6: 48c1 li a7,16 ecall 2f8: 00000073 ecall ret 2fc: 8082 ret 00000000000002fe <close>: .global close close: li a7, SYS_close 2fe: 48d5 li a7,21 ecall 300: 00000073 ecall ret 304: 8082 ret 0000000000000306 <kill>: .global kill kill: li a7, SYS_kill 306: 4899 li a7,6 ecall 308: 00000073 ecall ret 30c: 8082 ret 000000000000030e <exec>: .global exec exec: li a7, SYS_exec 30e: 489d li a7,7 ecall 310: 00000073 ecall ret 314: 8082 ret 0000000000000316 <open>: .global open open: li a7, SYS_open 316: 48bd li a7,15 ecall 318: 00000073 ecall ret 31c: 8082 ret 000000000000031e <mknod>: .global mknod mknod: li a7, SYS_mknod 31e: 48c5 li a7,17 ecall 320: 00000073 ecall ret 324: 8082 ret 0000000000000326 <unlink>: .global unlink unlink: li a7, SYS_unlink 326: 48c9 li a7,18 ecall 328: 00000073 ecall ret 32c: 8082 ret 000000000000032e <fstat>: .global fstat fstat: li a7, SYS_fstat 32e: 48a1 li a7,8 ecall 330: 00000073 ecall ret 334: 8082 ret 0000000000000336 <link>: .global link link: li a7, SYS_link 336: 48cd li a7,19 ecall 338: 00000073 ecall ret 33c: 8082 ret 000000000000033e <mkdir>: .global mkdir mkdir: li a7, SYS_mkdir 33e: 48d1 li a7,20 ecall 340: 00000073 ecall ret 344: 8082 ret 0000000000000346 <chdir>: .global chdir chdir: li a7, SYS_chdir 346: 48a5 li a7,9 ecall 348: 00000073 ecall ret 34c: 8082 ret 000000000000034e <dup>: .global dup dup: li a7, SYS_dup 34e: 48a9 li a7,10 ecall 350: 00000073 ecall ret 354: 8082 ret 0000000000000356 <getpid>: .global getpid getpid: li a7, SYS_getpid 356: 48ad li a7,11 ecall 358: 00000073 ecall ret 35c: 8082 ret 000000000000035e <sbrk>: .global sbrk sbrk: li a7, SYS_sbrk 35e: 48b1 li a7,12 ecall 360: 00000073 ecall ret 364: 8082 ret 0000000000000366 <sleep>: .global sleep sleep: li a7, SYS_sleep 366: 48b5 li a7,13 ecall 368: 00000073 ecall ret 36c: 8082 ret 000000000000036e <uptime>: .global uptime uptime: li a7, SYS_uptime 36e: 48b9 li a7,14 ecall 370: 00000073 ecall ret 374: 8082 ret 0000000000000376 <ntas>: .global ntas ntas: li a7, SYS_ntas 376: 48d9 li a7,22 ecall 378: 00000073 ecall ret 37c: 8082 ret 000000000000037e <putc>: static char digits[] = "0123456789ABCDEF"; static void putc(int fd, char c) { 37e: 1101 addi sp,sp,-32 380: ec06 sd ra,24(sp) 382: e822 sd s0,16(sp) 384: 1000 addi s0,sp,32 386: feb407a3 sb a1,-17(s0) write(fd, &c, 1); 38a: 4605 li a2,1 38c: fef40593 addi a1,s0,-17 390: 00000097 auipc ra,0x0 394: f66080e7 jalr -154(ra) # 2f6 <write> } 398: 60e2 ld ra,24(sp) 39a: 6442 ld s0,16(sp) 39c: 6105 addi sp,sp,32 39e: 8082 ret 00000000000003a0 <printint>: static void printint(int fd, int xx, int base, int sgn) { 3a0: 7139 addi sp,sp,-64 3a2: fc06 sd ra,56(sp) 3a4: f822 sd s0,48(sp) 3a6: f426 sd s1,40(sp) 3a8: f04a sd s2,32(sp) 3aa: ec4e sd s3,24(sp) 3ac: 0080 addi s0,sp,64 3ae: 84aa mv s1,a0 char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 3b0: c299 beqz a3,3b6 <printint+0x16> 3b2: 0805c863 bltz a1,442 <printint+0xa2> neg = 1; x = -xx; } else { x = xx; 3b6: 2581 sext.w a1,a1 neg = 0; 3b8: 4881 li a7,0 3ba: fc040693 addi a3,s0,-64 } i = 0; 3be: 4701 li a4,0 do{ buf[i++] = digits[x % base]; 3c0: 2601 sext.w a2,a2 3c2: 00000517 auipc a0,0x0 3c6: 46e50513 addi a0,a0,1134 # 830 <digits> 3ca: 883a mv a6,a4 3cc: 2705 addiw a4,a4,1 3ce: 02c5f7bb remuw a5,a1,a2 3d2: 1782 slli a5,a5,0x20 3d4: 9381 srli a5,a5,0x20 3d6: 97aa add a5,a5,a0 3d8: 0007c783 lbu a5,0(a5) 3dc: 00f68023 sb a5,0(a3) }while((x /= base) != 0); 3e0: 0005879b sext.w a5,a1 3e4: 02c5d5bb divuw a1,a1,a2 3e8: 0685 addi a3,a3,1 3ea: fec7f0e3 bgeu a5,a2,3ca <printint+0x2a> if(neg) 3ee: 00088b63 beqz a7,404 <printint+0x64> buf[i++] = '-'; 3f2: fd040793 addi a5,s0,-48 3f6: 973e add a4,a4,a5 3f8: 02d00793 li a5,45 3fc: fef70823 sb a5,-16(a4) 400: 0028071b addiw a4,a6,2 while(--i >= 0) 404: 02e05863 blez a4,434 <printint+0x94> 408: fc040793 addi a5,s0,-64 40c: 00e78933 add s2,a5,a4 410: fff78993 addi s3,a5,-1 414: 99ba add s3,s3,a4 416: 377d addiw a4,a4,-1 418: 1702 slli a4,a4,0x20 41a: 9301 srli a4,a4,0x20 41c: 40e989b3 sub s3,s3,a4 putc(fd, buf[i]); 420: fff94583 lbu a1,-1(s2) 424: 8526 mv a0,s1 426: 00000097 auipc ra,0x0 42a: f58080e7 jalr -168(ra) # 37e <putc> while(--i >= 0) 42e: 197d addi s2,s2,-1 430: ff3918e3 bne s2,s3,420 <printint+0x80> } 434: 70e2 ld ra,56(sp) 436: 7442 ld s0,48(sp) 438: 74a2 ld s1,40(sp) 43a: 7902 ld s2,32(sp) 43c: 69e2 ld s3,24(sp) 43e: 6121 addi sp,sp,64 440: 8082 ret x = -xx; 442: 40b005bb negw a1,a1 neg = 1; 446: 4885 li a7,1 x = -xx; 448: bf8d j 3ba <printint+0x1a> 000000000000044a <vprintf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void vprintf(int fd, const char *fmt, va_list ap) { 44a: 7119 addi sp,sp,-128 44c: fc86 sd ra,120(sp) 44e: f8a2 sd s0,112(sp) 450: f4a6 sd s1,104(sp) 452: f0ca sd s2,96(sp) 454: ecce sd s3,88(sp) 456: e8d2 sd s4,80(sp) 458: e4d6 sd s5,72(sp) 45a: e0da sd s6,64(sp) 45c: fc5e sd s7,56(sp) 45e: f862 sd s8,48(sp) 460: f466 sd s9,40(sp) 462: f06a sd s10,32(sp) 464: ec6e sd s11,24(sp) 466: 0100 addi s0,sp,128 char *s; int c, i, state; state = 0; for(i = 0; fmt[i]; i++){ 468: 0005c903 lbu s2,0(a1) 46c: 18090f63 beqz s2,60a <vprintf+0x1c0> 470: 8aaa mv s5,a0 472: 8b32 mv s6,a2 474: 00158493 addi s1,a1,1 state = 0; 478: 4981 li s3,0 if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 47a: 02500a13 li s4,37 if(c == 'd'){ 47e: 06400c13 li s8,100 printint(fd, va_arg(ap, int), 10, 1); } else if(c == 'l') { 482: 06c00c93 li s9,108 printint(fd, va_arg(ap, uint64), 10, 0); } else if(c == 'x') { 486: 07800d13 li s10,120 printint(fd, va_arg(ap, int), 16, 0); } else if(c == 'p') { 48a: 07000d93 li s11,112 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 48e: 00000b97 auipc s7,0x0 492: 3a2b8b93 addi s7,s7,930 # 830 <digits> 496: a839 j 4b4 <vprintf+0x6a> putc(fd, c); 498: 85ca mv a1,s2 49a: 8556 mv a0,s5 49c: 00000097 auipc ra,0x0 4a0: ee2080e7 jalr -286(ra) # 37e <putc> 4a4: a019 j 4aa <vprintf+0x60> } else if(state == '%'){ 4a6: 01498f63 beq s3,s4,4c4 <vprintf+0x7a> for(i = 0; fmt[i]; i++){ 4aa: 0485 addi s1,s1,1 4ac: fff4c903 lbu s2,-1(s1) 4b0: 14090d63 beqz s2,60a <vprintf+0x1c0> c = fmt[i] & 0xff; 4b4: 0009079b sext.w a5,s2 if(state == 0){ 4b8: fe0997e3 bnez s3,4a6 <vprintf+0x5c> if(c == '%'){ 4bc: fd479ee3 bne a5,s4,498 <vprintf+0x4e> state = '%'; 4c0: 89be mv s3,a5 4c2: b7e5 j 4aa <vprintf+0x60> if(c == 'd'){ 4c4: 05878063 beq a5,s8,504 <vprintf+0xba> } else if(c == 'l') { 4c8: 05978c63 beq a5,s9,520 <vprintf+0xd6> } else if(c == 'x') { 4cc: 07a78863 beq a5,s10,53c <vprintf+0xf2> } else if(c == 'p') { 4d0: 09b78463 beq a5,s11,558 <vprintf+0x10e> printptr(fd, va_arg(ap, uint64)); } else if(c == 's'){ 4d4: 07300713 li a4,115 4d8: 0ce78663 beq a5,a4,5a4 <vprintf+0x15a> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 4dc: 06300713 li a4,99 4e0: 0ee78e63 beq a5,a4,5dc <vprintf+0x192> putc(fd, va_arg(ap, uint)); } else if(c == '%'){ 4e4: 11478863 beq a5,s4,5f4 <vprintf+0x1aa> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 4e8: 85d2 mv a1,s4 4ea: 8556 mv a0,s5 4ec: 00000097 auipc ra,0x0 4f0: e92080e7 jalr -366(ra) # 37e <putc> putc(fd, c); 4f4: 85ca mv a1,s2 4f6: 8556 mv a0,s5 4f8: 00000097 auipc ra,0x0 4fc: e86080e7 jalr -378(ra) # 37e <putc> } state = 0; 500: 4981 li s3,0 502: b765 j 4aa <vprintf+0x60> printint(fd, va_arg(ap, int), 10, 1); 504: 008b0913 addi s2,s6,8 508: 4685 li a3,1 50a: 4629 li a2,10 50c: 000b2583 lw a1,0(s6) 510: 8556 mv a0,s5 512: 00000097 auipc ra,0x0 516: e8e080e7 jalr -370(ra) # 3a0 <printint> 51a: 8b4a mv s6,s2 state = 0; 51c: 4981 li s3,0 51e: b771 j 4aa <vprintf+0x60> printint(fd, va_arg(ap, uint64), 10, 0); 520: 008b0913 addi s2,s6,8 524: 4681 li a3,0 526: 4629 li a2,10 528: 000b2583 lw a1,0(s6) 52c: 8556 mv a0,s5 52e: 00000097 auipc ra,0x0 532: e72080e7 jalr -398(ra) # 3a0 <printint> 536: 8b4a mv s6,s2 state = 0; 538: 4981 li s3,0 53a: bf85 j 4aa <vprintf+0x60> printint(fd, va_arg(ap, int), 16, 0); 53c: 008b0913 addi s2,s6,8 540: 4681 li a3,0 542: 4641 li a2,16 544: 000b2583 lw a1,0(s6) 548: 8556 mv a0,s5 54a: 00000097 auipc ra,0x0 54e: e56080e7 jalr -426(ra) # 3a0 <printint> 552: 8b4a mv s6,s2 state = 0; 554: 4981 li s3,0 556: bf91 j 4aa <vprintf+0x60> printptr(fd, va_arg(ap, uint64)); 558: 008b0793 addi a5,s6,8 55c: f8f43423 sd a5,-120(s0) 560: 000b3983 ld s3,0(s6) putc(fd, '0'); 564: 03000593 li a1,48 568: 8556 mv a0,s5 56a: 00000097 auipc ra,0x0 56e: e14080e7 jalr -492(ra) # 37e <putc> putc(fd, 'x'); 572: 85ea mv a1,s10 574: 8556 mv a0,s5 576: 00000097 auipc ra,0x0 57a: e08080e7 jalr -504(ra) # 37e <putc> 57e: 4941 li s2,16 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 580: 03c9d793 srli a5,s3,0x3c 584: 97de add a5,a5,s7 586: 0007c583 lbu a1,0(a5) 58a: 8556 mv a0,s5 58c: 00000097 auipc ra,0x0 590: df2080e7 jalr -526(ra) # 37e <putc> for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) 594: 0992 slli s3,s3,0x4 596: 397d addiw s2,s2,-1 598: fe0914e3 bnez s2,580 <vprintf+0x136> printptr(fd, va_arg(ap, uint64)); 59c: f8843b03 ld s6,-120(s0) state = 0; 5a0: 4981 li s3,0 5a2: b721 j 4aa <vprintf+0x60> s = va_arg(ap, char*); 5a4: 008b0993 addi s3,s6,8 5a8: 000b3903 ld s2,0(s6) if(s == 0) 5ac: 02090163 beqz s2,5ce <vprintf+0x184> while(*s != 0){ 5b0: 00094583 lbu a1,0(s2) 5b4: c9a1 beqz a1,604 <vprintf+0x1ba> putc(fd, *s); 5b6: 8556 mv a0,s5 5b8: 00000097 auipc ra,0x0 5bc: dc6080e7 jalr -570(ra) # 37e <putc> s++; 5c0: 0905 addi s2,s2,1 while(*s != 0){ 5c2: 00094583 lbu a1,0(s2) 5c6: f9e5 bnez a1,5b6 <vprintf+0x16c> s = va_arg(ap, char*); 5c8: 8b4e mv s6,s3 state = 0; 5ca: 4981 li s3,0 5cc: bdf9 j 4aa <vprintf+0x60> s = "(null)"; 5ce: 00000917 auipc s2,0x0 5d2: 25a90913 addi s2,s2,602 # 828 <malloc+0x114> while(*s != 0){ 5d6: 02800593 li a1,40 5da: bff1 j 5b6 <vprintf+0x16c> putc(fd, va_arg(ap, uint)); 5dc: 008b0913 addi s2,s6,8 5e0: 000b4583 lbu a1,0(s6) 5e4: 8556 mv a0,s5 5e6: 00000097 auipc ra,0x0 5ea: d98080e7 jalr -616(ra) # 37e <putc> 5ee: 8b4a mv s6,s2 state = 0; 5f0: 4981 li s3,0 5f2: bd65 j 4aa <vprintf+0x60> putc(fd, c); 5f4: 85d2 mv a1,s4 5f6: 8556 mv a0,s5 5f8: 00000097 auipc ra,0x0 5fc: d86080e7 jalr -634(ra) # 37e <putc> state = 0; 600: 4981 li s3,0 602: b565 j 4aa <vprintf+0x60> s = va_arg(ap, char*); 604: 8b4e mv s6,s3 state = 0; 606: 4981 li s3,0 608: b54d j 4aa <vprintf+0x60> } } } 60a: 70e6 ld ra,120(sp) 60c: 7446 ld s0,112(sp) 60e: 74a6 ld s1,104(sp) 610: 7906 ld s2,96(sp) 612: 69e6 ld s3,88(sp) 614: 6a46 ld s4,80(sp) 616: 6aa6 ld s5,72(sp) 618: 6b06 ld s6,64(sp) 61a: 7be2 ld s7,56(sp) 61c: 7c42 ld s8,48(sp) 61e: 7ca2 ld s9,40(sp) 620: 7d02 ld s10,32(sp) 622: 6de2 ld s11,24(sp) 624: 6109 addi sp,sp,128 626: 8082 ret 0000000000000628 <fprintf>: void fprintf(int fd, const char *fmt, ...) { 628: 715d addi sp,sp,-80 62a: ec06 sd ra,24(sp) 62c: e822 sd s0,16(sp) 62e: 1000 addi s0,sp,32 630: e010 sd a2,0(s0) 632: e414 sd a3,8(s0) 634: e818 sd a4,16(s0) 636: ec1c sd a5,24(s0) 638: 03043023 sd a6,32(s0) 63c: 03143423 sd a7,40(s0) va_list ap; va_start(ap, fmt); 640: fe843423 sd s0,-24(s0) vprintf(fd, fmt, ap); 644: 8622 mv a2,s0 646: 00000097 auipc ra,0x0 64a: e04080e7 jalr -508(ra) # 44a <vprintf> } 64e: 60e2 ld ra,24(sp) 650: 6442 ld s0,16(sp) 652: 6161 addi sp,sp,80 654: 8082 ret 0000000000000656 <printf>: void printf(const char *fmt, ...) { 656: 711d addi sp,sp,-96 658: ec06 sd ra,24(sp) 65a: e822 sd s0,16(sp) 65c: 1000 addi s0,sp,32 65e: e40c sd a1,8(s0) 660: e810 sd a2,16(s0) 662: ec14 sd a3,24(s0) 664: f018 sd a4,32(s0) 666: f41c sd a5,40(s0) 668: 03043823 sd a6,48(s0) 66c: 03143c23 sd a7,56(s0) va_list ap; va_start(ap, fmt); 670: 00840613 addi a2,s0,8 674: fec43423 sd a2,-24(s0) vprintf(1, fmt, ap); 678: 85aa mv a1,a0 67a: 4505 li a0,1 67c: 00000097 auipc ra,0x0 680: dce080e7 jalr -562(ra) # 44a <vprintf> } 684: 60e2 ld ra,24(sp) 686: 6442 ld s0,16(sp) 688: 6125 addi sp,sp,96 68a: 8082 ret 000000000000068c <free>: static Header base; static Header *freep; void free(void *ap) { 68c: 1141 addi sp,sp,-16 68e: e422 sd s0,8(sp) 690: 0800 addi s0,sp,16 Header *bp, *p; bp = (Header*)ap - 1; 692: ff050693 addi a3,a0,-16 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 696: 00000797 auipc a5,0x0 69a: 1b27b783 ld a5,434(a5) # 848 <freep> 69e: a805 j 6ce <free+0x42> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 6a0: 4618 lw a4,8(a2) 6a2: 9db9 addw a1,a1,a4 6a4: feb52c23 sw a1,-8(a0) bp->s.ptr = p->s.ptr->s.ptr; 6a8: 6398 ld a4,0(a5) 6aa: 6318 ld a4,0(a4) 6ac: fee53823 sd a4,-16(a0) 6b0: a091 j 6f4 <free+0x68> } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ p->s.size += bp->s.size; 6b2: ff852703 lw a4,-8(a0) 6b6: 9e39 addw a2,a2,a4 6b8: c790 sw a2,8(a5) p->s.ptr = bp->s.ptr; 6ba: ff053703 ld a4,-16(a0) 6be: e398 sd a4,0(a5) 6c0: a099 j 706 <free+0x7a> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6c2: 6398 ld a4,0(a5) 6c4: 00e7e463 bltu a5,a4,6cc <free+0x40> 6c8: 00e6ea63 bltu a3,a4,6dc <free+0x50> { 6cc: 87ba mv a5,a4 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6ce: fed7fae3 bgeu a5,a3,6c2 <free+0x36> 6d2: 6398 ld a4,0(a5) 6d4: 00e6e463 bltu a3,a4,6dc <free+0x50> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6d8: fee7eae3 bltu a5,a4,6cc <free+0x40> if(bp + bp->s.size == p->s.ptr){ 6dc: ff852583 lw a1,-8(a0) 6e0: 6390 ld a2,0(a5) 6e2: 02059713 slli a4,a1,0x20 6e6: 9301 srli a4,a4,0x20 6e8: 0712 slli a4,a4,0x4 6ea: 9736 add a4,a4,a3 6ec: fae60ae3 beq a2,a4,6a0 <free+0x14> bp->s.ptr = p->s.ptr; 6f0: fec53823 sd a2,-16(a0) if(p + p->s.size == bp){ 6f4: 4790 lw a2,8(a5) 6f6: 02061713 slli a4,a2,0x20 6fa: 9301 srli a4,a4,0x20 6fc: 0712 slli a4,a4,0x4 6fe: 973e add a4,a4,a5 700: fae689e3 beq a3,a4,6b2 <free+0x26> } else p->s.ptr = bp; 704: e394 sd a3,0(a5) freep = p; 706: 00000717 auipc a4,0x0 70a: 14f73123 sd a5,322(a4) # 848 <freep> } 70e: 6422 ld s0,8(sp) 710: 0141 addi sp,sp,16 712: 8082 ret 0000000000000714 <malloc>: return freep; } void* malloc(uint nbytes) { 714: 7139 addi sp,sp,-64 716: fc06 sd ra,56(sp) 718: f822 sd s0,48(sp) 71a: f426 sd s1,40(sp) 71c: f04a sd s2,32(sp) 71e: ec4e sd s3,24(sp) 720: e852 sd s4,16(sp) 722: e456 sd s5,8(sp) 724: e05a sd s6,0(sp) 726: 0080 addi s0,sp,64 Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 728: 02051493 slli s1,a0,0x20 72c: 9081 srli s1,s1,0x20 72e: 04bd addi s1,s1,15 730: 8091 srli s1,s1,0x4 732: 0014899b addiw s3,s1,1 736: 0485 addi s1,s1,1 if((prevp = freep) == 0){ 738: 00000517 auipc a0,0x0 73c: 11053503 ld a0,272(a0) # 848 <freep> 740: c515 beqz a0,76c <malloc+0x58> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 742: 611c ld a5,0(a0) if(p->s.size >= nunits){ 744: 4798 lw a4,8(a5) 746: 02977f63 bgeu a4,s1,784 <malloc+0x70> 74a: 8a4e mv s4,s3 74c: 0009871b sext.w a4,s3 750: 6685 lui a3,0x1 752: 00d77363 bgeu a4,a3,758 <malloc+0x44> 756: 6a05 lui s4,0x1 758: 000a0b1b sext.w s6,s4 p = sbrk(nu * sizeof(Header)); 75c: 004a1a1b slliw s4,s4,0x4 p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 760: 00000917 auipc s2,0x0 764: 0e890913 addi s2,s2,232 # 848 <freep> if(p == (char*)-1) 768: 5afd li s5,-1 76a: a88d j 7dc <malloc+0xc8> base.s.ptr = freep = prevp = &base; 76c: 00000797 auipc a5,0x0 770: 0e478793 addi a5,a5,228 # 850 <base> 774: 00000717 auipc a4,0x0 778: 0cf73a23 sd a5,212(a4) # 848 <freep> 77c: e39c sd a5,0(a5) base.s.size = 0; 77e: 0007a423 sw zero,8(a5) if(p->s.size >= nunits){ 782: b7e1 j 74a <malloc+0x36> if(p->s.size == nunits) 784: 02e48b63 beq s1,a4,7ba <malloc+0xa6> p->s.size -= nunits; 788: 4137073b subw a4,a4,s3 78c: c798 sw a4,8(a5) p += p->s.size; 78e: 1702 slli a4,a4,0x20 790: 9301 srli a4,a4,0x20 792: 0712 slli a4,a4,0x4 794: 97ba add a5,a5,a4 p->s.size = nunits; 796: 0137a423 sw s3,8(a5) freep = prevp; 79a: 00000717 auipc a4,0x0 79e: 0aa73723 sd a0,174(a4) # 848 <freep> return (void*)(p + 1); 7a2: 01078513 addi a0,a5,16 if((p = morecore(nunits)) == 0) return 0; } } 7a6: 70e2 ld ra,56(sp) 7a8: 7442 ld s0,48(sp) 7aa: 74a2 ld s1,40(sp) 7ac: 7902 ld s2,32(sp) 7ae: 69e2 ld s3,24(sp) 7b0: 6a42 ld s4,16(sp) 7b2: 6aa2 ld s5,8(sp) 7b4: 6b02 ld s6,0(sp) 7b6: 6121 addi sp,sp,64 7b8: 8082 ret prevp->s.ptr = p->s.ptr; 7ba: 6398 ld a4,0(a5) 7bc: e118 sd a4,0(a0) 7be: bff1 j 79a <malloc+0x86> hp->s.size = nu; 7c0: 01652423 sw s6,8(a0) free((void*)(hp + 1)); 7c4: 0541 addi a0,a0,16 7c6: 00000097 auipc ra,0x0 7ca: ec6080e7 jalr -314(ra) # 68c <free> return freep; 7ce: 00093503 ld a0,0(s2) if((p = morecore(nunits)) == 0) 7d2: d971 beqz a0,7a6 <malloc+0x92> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7d4: 611c ld a5,0(a0) if(p->s.size >= nunits){ 7d6: 4798 lw a4,8(a5) 7d8: fa9776e3 bgeu a4,s1,784 <malloc+0x70> if(p == freep) 7dc: 00093703 ld a4,0(s2) 7e0: 853e mv a0,a5 7e2: fef719e3 bne a4,a5,7d4 <malloc+0xc0> p = sbrk(nu * sizeof(Header)); 7e6: 8552 mv a0,s4 7e8: 00000097 auipc ra,0x0 7ec: b76080e7 jalr -1162(ra) # 35e <sbrk> if(p == (char*)-1) 7f0: fd5518e3 bne a0,s5,7c0 <malloc+0xac> return 0; 7f4: 4501 li a0,0 7f6: bf45 j 7a6 <malloc+0x92>
29.480769
60
0.459958
0cf689d61d1baad8c46eb9706a25ef6e2e3759d4
886
asm
Assembly
oeis/267/A267443.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/267/A267443.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/267/A267443.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A267443: Binary representation of the middle column of the "Rule 129" elementary cellular automaton starting with a single ON (black) cell. ; Submitted by Simon Strandgaard ; 1,10,101,1010,10101,101011,1010111,10101110,101011101,1010111011,10101110111,101011101111,1010111011111,10101110111111,101011101111111,1010111011111110,10101110111111101,101011101111111011,1010111011111110111,10101110111111101111,101011101111111011111,1010111011111110111111,10101110111111101111111,101011101111111011111111,1010111011111110111111111,10101110111111101111111111,101011101111111011111111111,1010111011111110111111111111,10101110111111101111111111111,101011101111111011111111111111 mov $2,$0 mov $4,$0 add $4,1 lpb $4 mov $0,$2 add $3,2 sub $4,1 sub $0,$4 add $0,2 mov $5,$0 mov $0,4 mul $1,10 mod $3,$5 trn $0,$3 mov $5,$0 div $5,4 pow $5,$0 add $1,$5 lpe mov $0,$1
35.44
496
0.793454
72a217a97404e2745f4b91ba2081059ba74db949
518
asm
Assembly
libsrc/_DEVELOPMENT/l/sdcc/____sdcc_ll_add_deix_hlix.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/l/sdcc/____sdcc_ll_add_deix_hlix.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/l/sdcc/____sdcc_ll_add_deix_hlix.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_clib SECTION code_l_sdcc PUBLIC ____sdcc_ll_add_deix_hlix EXTERN l_add_64_mde_mhl ____sdcc_ll_add_deix_hlix: ; deix = deix + hlix push de ; save deix IFDEF __SDCC_IX push ix pop de ; de = ix ELSE push iy pop de ENDIF add hl,de ex (sp),hl ; save hlix + ix add hl,de ex de,hl ; de = deix + ix pop hl ; hl = hlix + ix jp l_add_64_mde_mhl
14.388889
47
0.505792
5e8a49f0a6917e848380a8f0635fec643b06ab02
1,499
asm
Assembly
Documentation/Tut32/fibonacci.asm
geoffthorpe/ant-architecture
d85952e3050c352d5d715d9749171a335e6768f7
[ "BSD-3-Clause" ]
null
null
null
Documentation/Tut32/fibonacci.asm
geoffthorpe/ant-architecture
d85952e3050c352d5d715d9749171a335e6768f7
[ "BSD-3-Clause" ]
null
null
null
Documentation/Tut32/fibonacci.asm
geoffthorpe/ant-architecture
d85952e3050c352d5d715d9749171a335e6768f7
[ "BSD-3-Clause" ]
1
2020-07-15T04:09:05.000Z
2020-07-15T04:09:05.000Z
# Dan Ellard # fibonacci.asm - An Ant-32 program to recursively compute fibonacci numbers. # # To compute fibonacci(5), push the 5 on the stack and then use "call" # to invoke the fibonacci function. In this program, since we don't # use g1 after calling the fibonacci function, we don't need to save # and restore it. main: lc g1, 5 push g1 call $fibonacci # Call Fibonacci(5) addi sp, sp, 4 # Restore stack pointer halt # and halt. # The fibonacci function: computes the X'th Fibonacci number as the # sum of the (X-1)'th and (X-2)'th Fibonacci numbers. The base case # is that if 0'th and 1'st Fibonacci numbers are 1. # # Takes a single argument X, accessible at fp + 8. Assumes that X is # positive or zero. If negative, this function will fail! Try it if # you want to see what stack overflow looks like... fibonacci: entry 0 ld4 g1, fp, 8 # g1 gets a copy of the current X # If g1 is 0 or 1, then we've reached a base case. jezi g1, $fibonacci_basecase subi g1, g1, 1 # decrement g1 (computing X-1) jezi g1, $fibonacci_basecase fibonacci_recurse: push g1 # push argument (X-1) call $fibonacci # recursively call fibonacci pop g1 # pop argument (X-1) mov g2, g0 # save value of fibonacci(X-1) in g2 subi g1, g1, 1 # g1 = X-2 push g2 # preserve g2 push g1 # push argument (X-2) call $fibonacci pop g1 # pop (X-2) pop g2 # restore g2 add g0, g0, g2 # compute fibonacci(X-2) + fibonacci(X-1) return g0 # return the sum... fibonacci_basecase: return 1
31.229167
77
0.700467
b286d5374d8ee0a83bac910219e52b1bf918359f
874
asm
Assembly
programs/oeis/066/A066492.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/066/A066492.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/066/A066492.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A066492: A056524(n)/11. ; 1,2,3,4,5,6,7,8,9,91,101,111,121,131,141,151,161,171,181,182,192,202,212,222,232,242,252,262,272,273,283,293,303,313,323,333,343,353,363,364,374,384,394,404,414,424,434,444,454,455,465,475,485,495,505,515 mov $15,$0 mov $17,$0 add $17,1 lpb $17,1 mov $0,$15 sub $17,1 sub $0,$17 mov $11,$0 mov $13,2 lpb $13,1 clr $0,11 mov $0,$11 sub $13,1 add $0,$13 sub $0,1 lpb $0,1 mov $2,$0 mov $0,8 add $2,9 mov $4,$2 mov $10,9 mul $10,$2 trn $2,$10 add $2,1 sub $4,8 mov $10,$4 lpe mov $0,$10 div $0,10 mov $1,$10 sub $1,$0 trn $1,1 add $1,$2 mov $14,$13 lpb $14,1 mov $12,$1 sub $14,1 lpe lpe lpb $11,1 mov $11,0 sub $12,$1 lpe mov $1,$12 mul $1,9 add $1,1 add $16,$1 lpe mov $1,$16
16.490566
206
0.495423
5bff49fc12462e61ec93736f586a690302916004
652
asm
Assembly
oeis/179/A179608.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/179/A179608.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/179/A179608.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A179608: a(n) = (7 + (-1)^n + 6*n)*2^(n-3). ; Submitted by Jon Maiga ; 1,3,10,24,64,144,352,768,1792,3840,8704,18432,40960,86016,188416,393216,851968,1769472,3801088,7864320,16777216,34603008,73400320,150994944,318767104,654311424,1375731712,2818572288,5905580032,12079595520,25232932864,51539607552,107374182400,219043332096,455266533376,927712935936,1924145348608,3917010173952,8108898254848,16492674416640,34084860461056,69269232549888,142936511610880,290271069732864,598134325510144,1213860837064704,2498090418307072,5066549580791808,10414574138294272 mov $1,$0 div $0,2 lpb $1 add $0,2 mul $0,2 sub $1,1 add $0,$1 lpe div $0,2 add $0,1
43.466667
486
0.796012
c567cb07d6344bb78c340d9dc300607b888ba2b9
2,100
asm
Assembly
bootdict/tc/search.asm
ikysil/ikforth
165e049fc007003cd05f59332dc856d553d8aac8
[ "Unlicense" ]
8
2017-08-03T08:49:06.000Z
2021-12-17T12:02:19.000Z
bootdict/tc/search.asm
clstrfsck/ikforth
165e049fc007003cd05f59332dc856d553d8aac8
[ "Unlicense" ]
58
2016-04-21T20:03:54.000Z
2022-01-16T00:40:50.000Z
bootdict/tc/search.asm
clstrfsck/ikforth
165e049fc007003cd05f59332dc856d553d8aac8
[ "Unlicense" ]
1
2018-07-25T21:07:00.000Z
2018-07-25T21:07:00.000Z
;****************************************************************************** ; ; search.asm ; IKForth ; ; Unlicense since 1999 by Illya Kysil ; ;****************************************************************************** ; Words search ;****************************************************************************** $VAR 'LAST-WORDLIST',,LATEST_WL ; WID>XT-SEARCH ; D: ( wid -- xt-search ) $COLON 'WID>XT-SEARCH',$WID_TO_XT_SEARCH CW $WID_TO_VT, $FETCH, $FETCH $END_COLON ; WID>XT-TRAVERSE ; D: ( wid -- xt-traverse ) $COLON 'WID>XT-TRAVERSE',$WID_TO_XT_TRAVERSE CW $WID_TO_VT, $FETCH, $CELL_PLUS, $FETCH $END_COLON ; 16.6.1.2192 SEARCH-WORDLIST ; D: ( c-addr u wid -- 0 | xt 1 | xt -1 ) $COLON 'SEARCH-WORDLIST',$SEARCH_WORDLIST CW $DUPE, $WID_TO_XT_SEARCH, $EXECUTE $END_COLON ; 15.6.2.2297 TRAVERSE-WORDLIST ; ( i * x xt wid -- j * x ) $COLON 'TRAVERSE-WORDLIST',$TRAVERSE_WORDLIST CW $DUPE, $WID_TO_XT_TRAVERSE, $EXECUTE $END_COLON $CREATE 'WORDLIST-VT',$WORDLIST_VT CW $STDWL_SEARCH_ASM CW $STDWL_TRAVERSE ; D: ( c-addr u -- 0 | xt 1 | xt -1 ) $COLON '(SEARCH-NAME)',$PSEARCH_NAME CW $FORTH_WORDLIST, $SEARCH_WORDLIST $END_COLON ; SEARCH-NAME ; D: ( c-addr u -- 0 | xt 1 | xt -1 ) $DEFER 'SEARCH-NAME',$SEARCH_NAME,$PSEARCH_NAME ; 6.1.1550 FIND ; D: ( c-addr -- c-addr 0 | xt 1 | xt -1 ) $COLON 'FIND',$FIND CW $DUPE, $TO_R, $COUNT, $SEARCH_NAME, $DUPE, $ZERO_NOT_EQUALS _IF FF_FOUND CW $R_FROM, $DROP _ELSE FF_FOUND CW $R_FROM, $SWAP _THEN FF_FOUND $END_COLON
34.42623
87
0.404762
fe550e6c87f8216e11ebaef9040c52e2080e3a26
2,661
asm
Assembly
MP/Assignment_6/Assignment_6.asm
pratt3000/PICT_SE-Labs
e720414549fe07351055f2075d45755ba181876a
[ "MIT" ]
3
2019-10-15T08:18:52.000Z
2020-02-16T09:34:45.000Z
MP/Assignment_6/Assignment_6.asm
pratt3000/PICT_SE-Labs
e720414549fe07351055f2075d45755ba181876a
[ "MIT" ]
null
null
null
MP/Assignment_6/Assignment_6.asm
pratt3000/PICT_SE-Labs
e720414549fe07351055f2075d45755ba181876a
[ "MIT" ]
2
2019-10-18T15:06:46.000Z
2020-01-16T06:29:26.000Z
;--------------------------------------------Messages---------------------------------------------- SECTION .data msg1: db "GDTR: " len1: equ $-msg1 msg2: db "LDTR: " len2: equ $-msg2 msg3: db "IDTR: " len3: equ $-msg3 newl: db "", 10 lenn: equ $-newl mswmsg db "Contents of MSW:" mswlen equ $-mswmsg trmsg db "Contents of TR:" trlen equ $-trmsg ;--------------------------------------------Variables--------------------------------------------- SECTION .bss cnt: resb 4 result: resb 8 gdtr: resw 1 resd 1 ldtr: resw 1 idtr: resw 1 resd 1 tr: resw 1 msw: resw 1 %macro print 4 MOV RAX, %1 MOV RDI, %2 MOV RSI, %3 MOV RDX, %4 syscall %endmacro ;---------------------------------------------Program---------------------------------------------- SECTION .text global _start _start: SGDT [gdtr] SLDT [ldtr] SIDT [idtr] STR [tr] SMSW word[msw] ;-----------------------------------------------GDT------------------------------------------------ print 1, 1, msg1, len1 MOV BX, word[gdtr+4] CALL HtoA print 1, 1, result, 4 MOV BX, word[gdtr+2] CALL HtoA print 1, 1, result, 4 MOV BX, word [gdtr] CALL HtoA print 1, 1, result, 4 print 1, 1, newl, lenn ;-----------------------------------------------LDT------------------------------------------------ print 1, 1, msg2, len2 MOV BX, word [ldtr] CALL HtoA print 1, 1, result, 4 print 1, 1, newl, lenn ;-----------------------------------------------IDT------------------------------------------------ print 1, 1, msg3, len3 MOV BX, word[idtr+4] CALL HtoA print 1, 1, result, 4 MOV BX, word[idtr+2] CALL HtoA print 1, 1, result, 4 MOV BX, word [idtr] CALL HtoA print 1, 1, result, 4 print 1, 1, newl, lenn ;-----------------------------------------------MSW------------------------------------------------ print 1,1,trmsg,trlen MOV BX,word[tr] CALL HtoA print 1,1,result,4 print 1,1,newl,lenn ;-----------------------------------------------TR------------------------------------------------- print 1,1,mswmsg,mswlen print 1,1,newl,lenn MOV AX,word[msw] CALL HtoA print 1,1,result,4 print 1,1,newl,lenn ;-----------------------------------------------exit----------------------------------------------- MOV RAX, 60 MOV RDI, 0 SYSCALL ;-----------------------------------------------HtoA----------------------------------------------- HtoA: MOV RSI,result MOV byte[cnt], 04H up: ROL BX, 04H MOV DL, BL AND DL, 0FH CMP DL, 09H JBE down ADD DL, 07H down: ADD DL, 30H MOV byte[RSI], DL INC RSI DEC byte[cnt] JNZ up RET ;-----------------------------------------------done-----------------------------------------------
23.758929
99
0.394213
3826ecb4b8c5cc0fd95c4871e8edc01b5789f478
864
asm
Assembly
programs/oeis/270/A270473.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/270/A270473.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/270/A270473.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A270473: Expansion of (1-5*x)/(1-9*x). ; 1,4,36,324,2916,26244,236196,2125764,19131876,172186884,1549681956,13947137604,125524238436,1129718145924,10167463313316,91507169819844,823564528378596,7412080755407364,66708726798666276,600378541187996484,5403406870691968356,48630661836227715204,437675956526049436836,3939083608734444931524,35451752478610004383716,319065772307490039453444,2871591950767410355080996,25844327556906693195728964,232598948012160238761560676,2093390532109442148854046084,18840514788984979339686414756,169564633100864814057177732804,1526081697907783326514599595236,13734735281170049938631396357124,123612617530530449447682567214116,1112513557774774045029143104927044,10012622019972966405262287944343396,90113598179756697647360591499090564,811022383617810278826245323491815076 mov $1,9 pow $1,$0 sub $1,1 mul $1,4 div $1,9 add $1,1 mov $0,$1
78.545455
756
0.896991
da9d2ab2eba2c12d54208f755e9ef2cb287b9646
253
asm
Assembly
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_aaddrcup.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_aaddrcup.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/ts2068/display/c/sccz80/tshc_aaddrcup.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void *tshc_aaddrcup(void *saddr) SECTION code_clib SECTION code_arch PUBLIC tshc_aaddrcup EXTERN zx_saddrcup defc tshc_aaddrcup = zx_saddrcup ; SDCC bridge for Classic IF __CLASSIC PUBLIC _tshc_aaddrcup defc _tshc_aaddrcup = tshc_aaddrcup ENDIF
14.055556
35
0.826087
d02eb9ac88b57fe41a54409ca18e96f974c6c6f7
702
asm
Assembly
oeis/020/A020071.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/020/A020071.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/020/A020071.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A020071: a(n) = floor( Gamma(n+5/8)/Gamma(5/8) ). ; Submitted by Simon Strandgaard ; 1,0,1,2,9,44,251,1665,12700,109544,1054363,11202616,130230419,1644159040,22401666926,327624378797,5119130918712,85105551523594,1499985345603353,27937227061862467,548268081089050917,11308029172461675173,244536130854483725628,5532629960582694292333,130708382818766152656388,3218693926912116509163573,82479031877122985547316573,2196004223728399490197303772,60664616680497035916700516724,1736524652479227653115552291251,51444542829697119223548236628331,1575489124159474276221164746742638 mov $1,1 mov $3,1 lpb $0 mul $1,3 mov $2,$0 sub $0,1 mul $2,24 sub $2,9 mul $1,$2 mul $3,72 lpe div $1,$3 mov $0,$1
39
485
0.814815
e5daf0147d869b8b6856f3d87f4b83c297665f5a
723
asm
Assembly
engine/battle/moveEffects/pay_day_effect.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
16
2018-08-28T21:47:01.000Z
2022-02-20T20:29:59.000Z
engine/battle/moveEffects/pay_day_effect.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
engine/battle/moveEffects/pay_day_effect.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2019-12-09T19:46:02.000Z
2020-12-05T21:36:30.000Z
PayDayEffect_: xor a ld hl, wcd6d ld [hli], a ld a, [H_WHOSETURN] and a ld a, [wBattleMonLevel] jr z, .payDayEffect ld a, [wEnemyMonLevel] .payDayEffect ; level * 2 add a ld [H_DIVIDEND + 3], a xor a ld [H_DIVIDEND], a ld [H_DIVIDEND + 1], a ld [H_DIVIDEND + 2], a ; convert to BCD ld a, 100 ld [H_DIVISOR], a ld b, $4 call Divide ld a, [H_QUOTIENT + 3] ld [hli], a ld a, [H_REMAINDER] ld [H_DIVIDEND + 3], a ld a, 10 ld [H_DIVISOR], a ld b, $4 call Divide ld a, [H_QUOTIENT + 3] swap a ld b, a ld a, [H_REMAINDER] add b ld [hl], a ld de, wTotalPayDayMoney + 2 ld c, $3 predef AddBCDPredef ld hl, CoinsScatteredText jp PrintText CoinsScatteredText: TX_FAR _CoinsScatteredText db "@"
15.717391
29
0.652835
ed4143401a3b6f6751acee313e7b009a4fc32ec8
101
asm
Assembly
standalone/pruntime/rizin/binrz/preload/trap-darwin-x86-64.asm
ndkazu/guessNumber-vs-Bot
6e756977ce849137c62edb0716df6926583da9b2
[ "Apache-2.0" ]
null
null
null
standalone/pruntime/rizin/binrz/preload/trap-darwin-x86-64.asm
ndkazu/guessNumber-vs-Bot
6e756977ce849137c62edb0716df6926583da9b2
[ "Apache-2.0" ]
1
2021-12-17T00:14:27.000Z
2021-12-17T00:14:27.000Z
standalone/pruntime/rizin/binrz/preload/trap-darwin-x86-64.asm
ndkazu/guessNumber-vs-Bot
6e756977ce849137c62edb0716df6926583da9b2
[ "Apache-2.0" ]
null
null
null
.os darwin .arch x86 .bits 64 mov rax, $sys.getpid syscall mov rdi, $sys.kill xchg rax, rdi syscall
10.1
20
0.722772
0849a06b7fa62a20b230132e4fa864d4f395e8c3
144
asm
Assembly
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Result.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Result.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Result.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
Name: Result.asm Type: file Size: 69870 Last-Modified: '1992-11-18T01:48:25Z' SHA-1: 8C56CA9E028D7F07EAC4448E3D1F8FB5A15C7AE7 Description: null
20.571429
47
0.8125
917c759de58c0f8ff2113bd3d1f682989b1e9945
494
asm
Assembly
programs/oeis/120/A120178.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/120/A120178.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/120/A120178.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A120178: a(n)=ceiling( sum_{i=1..n-1} a(i)/6), a(1)=1. ; 1,1,1,1,1,1,1,2,2,2,3,3,4,4,5,6,7,8,9,11,13,15,17,20,23,27,32,37,43,50,59,69,80,93,109,127,148,173,202,235,275,320,374,436,509,594,693,808,943,1100,1283,1497,1747,2038,2377,2774,3236,3775,4404,5138,5995,6994 seq $0,279077 ; Maximum starting value of X such that repeated replacement of X with X-ceiling(X/7) requires n steps to reach 0. sub $0,2 lpb $0 add $0,2 div $0,7 add $1,$0 add $0,$2 mov $2,$0 lpe add $1,1 mov $0,$1
32.933333
209
0.651822
8a3bd884b61699fd347629d5d1699367e17971ce
3,800
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca_notsx.log_11_245.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca_notsx.log_11_245.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca_notsx.log_11_245.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 %rax push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x18712, %rax nop nop nop nop sub $40302, %r9 vmovups (%rax), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $0, %xmm0, %rdi nop nop nop nop nop and %rbx, %rbx lea addresses_normal_ht+0x8512, %rsi lea addresses_UC_ht+0x1836a, %rdi nop nop nop mfence mov $91, %rcx rep movsw nop nop nop nop nop dec %rcx lea addresses_normal_ht+0x134ea, %rbx nop nop add %r14, %r14 mov (%rbx), %ecx nop nop nop nop nop dec %rax lea addresses_D_ht+0x158ea, %r14 nop nop nop nop add $20985, %rcx mov $0x6162636465666768, %rax movq %rax, %xmm4 movups %xmm4, (%r14) nop nop dec %rcx lea addresses_UC_ht+0x1395a, %rsi nop add $10079, %rdi mov (%rsi), %r9w nop nop nop nop xor $35750, %r9 lea addresses_D_ht+0x88ea, %rdi nop nop nop nop and %r9, %r9 movw $0x6162, (%rdi) nop nop xor %rax, %rax lea addresses_WT_ht+0x468a, %rsi clflush (%rsi) nop nop nop dec %rcx mov $0x6162636465666768, %rbx movq %rbx, %xmm7 vmovups %ymm7, (%rsi) nop nop nop nop nop dec %rdi lea addresses_normal_ht+0x17722, %rbx dec %rdi mov (%rbx), %ecx nop nop nop nop nop cmp %rsi, %rsi lea addresses_WT_ht+0x2b6a, %rsi lea addresses_WC_ht+0x1b432, %rdi nop nop nop nop inc %r13 mov $7, %rcx rep movsw and %rdi, %rdi lea addresses_UC_ht+0x10d8a, %rsi lea addresses_UC_ht+0xff8e, %rdi nop nop nop nop dec %rax mov $9, %rcx rep movsl nop nop nop nop nop sub %rdi, %rdi lea addresses_normal_ht+0x1abd6, %rsi lea addresses_UC_ht+0x144c7, %rdi nop nop xor $32349, %r13 mov $80, %rcx rep movsl nop xor $42712, %r9 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r14 push %r9 push %rsi // Faulty Load lea addresses_US+0x170ea, %r9 add $5432, %r10 mov (%r9), %r11 lea oracles, %r9 and $0xff, %r11 shlq $12, %r11 mov (%r9,%r11,1), %r11 pop %rsi pop %r9 pop %r14 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_US', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_UC_ht'}} {'00': 11} 00 00 00 00 00 00 00 00 00 00 00 */
19.587629
152
0.656316
bd989b26d1dbf3700a813c31d56d4c39d9b12e8a
98
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/dload.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/dload.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/dload.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
SECTION code_fp_math48 PUBLIC dload EXTERN cm48_sdccixp_dload defc dload = cm48_sdccixp_dload
10.888889
31
0.846939
eef885e16ce4ef318aa9ceca1530199922a082ed
1,785
asm
Assembly
anim.asm
AleffCorrea/BrickBreaker
625eec4e6c7c0053720a378c91f530f6ce58bcbe
[ "MIT" ]
4
2017-07-20T07:27:21.000Z
2021-04-18T03:59:44.000Z
anim.asm
AleffCorrea/BrickBreaker
625eec4e6c7c0053720a378c91f530f6ce58bcbe
[ "MIT" ]
null
null
null
anim.asm
AleffCorrea/BrickBreaker
625eec4e6c7c0053720a378c91f530f6ce58bcbe
[ "MIT" ]
1
2021-04-18T04:00:08.000Z
2021-04-18T04:00:08.000Z
;Anim.asm ;Animation for object metasprites ;X = Object Slot # ;Y = new Animation id # ;Call this to change the animation id without causing bugs. ChangeAnimation: LDA #0 STA OBJ_ANIMTIMER, x STA OBJ_ANIMFRAME, x TYA STA OBJ_ANIMATION, x RTS ;X = Object Slot # ;This loads the correct Metasprite id for the current animation state. AnimateObject: FrameQ = TEMP_BYTE AnimPtr = TEMP_PTR LDA OBJ_ANIMATION, x CMP #$FF BNE .start STA OBJ_METASPRITE, x ;Invalid (255) animation #, metasprite = 255 RTS .start ;Loads Animation pointer A from table into AnimPtr TZP16 AnimPtr, Animation_Table .loadFrameQ LDY #0 ;Load animation data from pointer LDA [AnimPtr], y STA <FrameQ ;# of metasprite frames INC16 AnimPtr ;Decides if current frame is maintained or there's a transition to next one ;OBJ_ANIMFRAME *MUST* start at 0 and only this subroutine can manipulate it, ; because frame # wraparound ( > FrameQ) is only checked when transitioning! LDY OBJ_ANIMFRAME, x .getCurFrame LDA [AnimPtr], y CMP OBJ_ANIMTIMER, x ;Is Timer limit >= Timer? BCC .transition ;Timer exceeds or is equal to limit, set next frame. BEQ .transition JMP .updateMetasprite ;Timer doesn't exceed limit, keep current frame #. .transition: INY CPY <FrameQ BCC .transition2 ;No overflow LDY #0 ;Overflow = wraparound to zero .transition2 TYA STA OBJ_ANIMFRAME, x ;Store updated frame #. LDA #0 STA OBJ_ANIMTIMER, x ;Clear timer. .updateMetasprite: TYA ;Y = frame #. CLC ADC <FrameQ TAY LDA [AnimPtr], y ;Metasprite id for the current anim. frame STA OBJ_METASPRITE, x ;Error in timer or animation table entry RTS ;X = Object Slot # ;Timer stops at 255 (no overflow) AnimTimer_Tick: INC OBJ_ANIMTIMER, x BEQ .overflow RTS .overflow DEC OBJ_ANIMTIMER, x RTS
22.594937
78
0.741737
8f1133b838e465954860358bf18ab1c46ec2ae14
7,297
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_401.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_401.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_401.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r14 push %r8 push %rax push %rcx push %rdi push %rsi lea addresses_UC_ht+0x835, %r10 cmp $30020, %rsi movb $0x61, (%r10) nop nop nop sub $22953, %r14 lea addresses_A_ht+0x16800, %r12 nop nop nop nop nop and $40848, %r8 movb $0x61, (%r12) nop nop nop nop sub $57569, %rdi lea addresses_UC_ht+0x95d8, %rsi lea addresses_WT_ht+0x12cd8, %rdi nop inc %rax mov $101, %rcx rep movsb nop nop sub %r8, %r8 lea addresses_WC_ht+0x2480, %rcx clflush (%rcx) nop add $31925, %r10 movw $0x6162, (%rcx) nop nop nop nop sub %r12, %r12 lea addresses_WC_ht+0xbb58, %rsi lea addresses_normal_ht+0xee18, %rdi nop nop and $36208, %r12 mov $69, %rcx rep movsb nop nop nop nop nop cmp %rcx, %rcx lea addresses_WT_ht+0x1bb3e, %rsi lea addresses_D_ht+0x5558, %rdi nop nop dec %r14 mov $91, %rcx rep movsw nop nop nop cmp $60654, %rax pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r14 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %rbp push %rcx push %rdx push %rsi // Store mov $0x46a, %rbp nop nop inc %r12 movb $0x51, (%rbp) nop nop nop and %rbp, %rbp // Load mov $0x5cc4240000000558, %rcx add %rsi, %rsi mov (%rcx), %r12w nop nop nop nop nop add %rbp, %rbp // Store lea addresses_A+0x19158, %rbp nop sub $43750, %rcx mov $0x5152535455565758, %r12 movq %r12, %xmm5 vmovups %ymm5, (%rbp) nop add $27402, %rdx // Store lea addresses_A+0x1e428, %r12 xor $54427, %rdx mov $0x5152535455565758, %r11 movq %r11, %xmm6 movups %xmm6, (%r12) nop nop nop nop nop cmp %r14, %r14 // Store mov $0xd58, %r12 nop nop nop nop nop and %r14, %r14 movb $0x51, (%r12) nop nop nop nop nop cmp $54057, %rdx // Store mov $0x576c540000000178, %rcx cmp %rsi, %rsi mov $0x5152535455565758, %r11 movq %r11, %xmm0 movups %xmm0, (%rcx) nop nop nop nop nop sub %rdx, %rdx // Store lea addresses_UC+0x1558, %r12 nop nop xor %rdx, %rdx mov $0x5152535455565758, %r14 movq %r14, %xmm6 vmovups %ymm6, (%r12) nop nop nop cmp $7815, %rcx // Faulty Load lea addresses_UC+0x1558, %r12 nop nop cmp $7050, %rsi vmovups (%r12), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $0, %xmm5, %rdx lea oracles, %rcx and $0xff, %rdx shlq $12, %rdx mov (%rcx,%rdx,1), %rdx pop %rsi pop %rdx pop %rcx pop %rbp pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': True, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
32.431111
2,999
0.653145
7ad599a99bbc00d9fdb2b593f859ffc899370aca
1,632
asm
Assembly
Quiz and Lab Assessment/Solution/1.asm
NasirSunny50/CSE331L-Section-1-Fall20-NSU
cede019f310e694ac660292b19c181bbf1579a00
[ "MIT" ]
null
null
null
Quiz and Lab Assessment/Solution/1.asm
NasirSunny50/CSE331L-Section-1-Fall20-NSU
cede019f310e694ac660292b19c181bbf1579a00
[ "MIT" ]
null
null
null
Quiz and Lab Assessment/Solution/1.asm
NasirSunny50/CSE331L-Section-1-Fall20-NSU
cede019f310e694ac660292b19c181bbf1579a00
[ "MIT" ]
null
null
null
.MODEL SMALL .STACK 64 DATA SEGMENT STRING DB ? SYM DB '$' INPUT_M DB 0ah,0dh,0AH,0DH, 'ENTER INPUT STRING: ',0DH,0AH,'$' STRLEN1 DW $-STR1 STRREV DB 20 DUP(' ') STR_PALIN DB 'STRING IS PALINDROME.','$' STR_NOT_PALIN DB 'STRING IS NOT PALINDROME.','$' DATA ENDS CODE SEGMENT ASSUME CS:CODE, DS:DATA BEGIN: MOV AX, @DATA MOV DS, AX MOV DX, OFFSET INPUT_M MOV AH, 9 INT 21H LEA SI, STRING INPUT: MOV AH, 1 INT 21H MOV [SI], AL INC SI CMP AL, 0DH JNZ INPUT MOV AL, SYM MOV [SI],'$' OUTPUT: MOV DL, 0AH MOV AH, 02H INT 21H MOV DX, OFFSET STRING MOV AH, 9 INT 21H MOV AX, DATA MOV DS, AX MOV ES, AX MOV CX, STRLEN1 ADD CX, -2 LEA SI, INPUT_M LEA DI, STRREV ADD SI, STRLEN1 ADD SI, -2 L1: MOV AL, [SI] MOV [DI], AL DEC SI INC DI LOOP L1 MOV AL, [SI] MOV [DI], AL INC DI MOV DL, '$' MOV [DI], DL MOV CX, STRLEN1 PALIN_CHECK: LEA SI, INPUT_M LEA DI, STRREV REPE CMPSB JNE NOT_PALIN PALIN: MOV AH, 09H LEA DX, STR_PALIN INT 21H JMP EXIT NOT_PALIN: MOV AH, 09H LEA DX, STR_NOT_PALIN INT 21H EXIT: MOV AX, 4CH INT 21H CODE ENDS END BEGIN
16.32
62
0.438725
1f232f3444f7ed6697431f44752af23790a70514
721
asm
Assembly
x86/Castling.asm
lantonov/asm
b9ddd4ed9a8c73cbd3600608847769f4690c293c
[ "BSD-3-Clause" ]
150
2016-11-26T05:41:31.000Z
2022-02-09T20:54:53.000Z
x86/Castling.asm
lantonov/asm
b9ddd4ed9a8c73cbd3600608847769f4690c293c
[ "BSD-3-Clause" ]
199
2016-12-07T22:13:00.000Z
2022-03-22T15:42:18.000Z
x86/Castling.asm
lantonov/asm
b9ddd4ed9a8c73cbd3600608847769f4690c293c
[ "BSD-3-Clause" ]
95
2016-11-24T22:57:13.000Z
2022-01-24T19:42:10.000Z
; castling functions ; they assume that the side to move is not in chess ; that the castling path is clear ; and that castling rights are available calign 16 CastleOOLegal_White: CastlingJmp 2*White+0, .Good, .Done .Good: or eax, -1 ret .Done: xor eax, eax ret calign 16 CastleOOLegal_Black: CastlingJmp 2*Black+0, .Good, .Done .Good: or eax, -1 ret .Done: xor eax, eax ret calign 16 CastleOOOLegal_White: CastlingJmp 2*White+1, .Good, .Done .Good: or eax, -1 ret .Done: xor eax, eax ret calign 16 CastleOOOLegal_Black: CastlingJmp 2*Black+1, .Good, .Done .Good: or eax, -1 ret .Done: xor eax, eax ret
18.025
52
0.617198
8ab30d22fdceeadcfe408ce9c00459365593757b
760
asm
Assembly
asm/otbn_mulqacc_256x256.asm
felixmiller/ot-dsim
1d33f9cac6565b85691cd905b1eb195b341ec3d2
[ "Apache-2.0" ]
null
null
null
asm/otbn_mulqacc_256x256.asm
felixmiller/ot-dsim
1d33f9cac6565b85691cd905b1eb195b341ec3d2
[ "Apache-2.0" ]
null
null
null
asm/otbn_mulqacc_256x256.asm
felixmiller/ot-dsim
1d33f9cac6565b85691cd905b1eb195b341ec3d2
[ "Apache-2.0" ]
1
2020-07-24T06:52:36.000Z
2020-07-24T06:52:36.000Z
* load first operand from dmem[0] ADDI x4, x0, 0 BN.LID x4, 0(x0) * load second operand from dmem[1] ADDI x4, x0, 1 BN.LID x4, 1(x0) break * run multiplication BN.MULQACC.Z w0.0, w1.0, 0 BN.MULQACC w0.1, w1.0, 64 BN.MULQACC.SO w2.l, w0.0, w1.1, 64 BN.MULQACC w0.2, w1.0, 0 BN.MULQACC w0.1, w1.1, 0 BN.MULQACC w0.0, w1.2, 0 BN.MULQACC w0.3, w1.0, 64 BN.MULQACC w0.2, w1.1, 64 BN.MULQACC w0.1, w1.2, 64 BN.MULQACC.SO w2.u, w0.0, w1.3, 64 BN.MULQACC w0.3, w1.1, 0 BN.MULQACC w0.2, w1.2, 0 BN.MULQACC w0.1, w1.3, 0 BN.MULQACC w0.3, w1.2, 64 BN.MULQACC.SO w3.l, w0.2, w1.3, 64 BN.MULQACC.SO w3.u, w0.3, w1.3, 0 * store lower 256 bit of result in dmem [2] ADDI x4, x0, 2 BN.SID x4, 2(x0) * store upper 256 bit of result in dmem [3] ADDI x4, x0, 3 BN.SID x4, 3(x0)
23.030303
43
0.652632
7913e1592a3295e210c559be7c35cedfd993c6d6
1,238
asm
Assembly
programs/oeis/001/A001954.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/001/A001954.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/001/A001954.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A001954: Wythoff game. ; 1,5,8,11,15,18,22,25,29,32,35,39,42,46,49,52,56,59,63,66,69,73,76,80,83,87,90,93,97,100,104,107,110,114,117,121,124,128,131,134,138,141,145,148,151,155,158,162,165,169,172,175,179,182,186,189,192,196,199,203,206,209,213,216,220,223,227,230,233,237,240,244,247,250,254,257,261,264,268,271,274,278,281,285,288,291,295,298,302,305,308,312,315,319,322,326,329,332,336,339,343,346,349,353,356,360,363,367,370,373,377,380,384,387,390,394,397,401,404,407,411,414,418,421,425,428,431,435,438,442,445,448,452,455,459,462,466,469,472,476,479,483,486,489,493,496,500,503,507,510,513,517,520,524,527,530,534,537,541,544,547,551,554,558,561,565,568,571,575,578,582,585,588,592,595,599,602,606,609,612,616,619,623,626,629,633,636,640,643,646,650,653,657,660,664,667,670,674,677,681,684,687,691,694,698,701,705,708,711,715,718,722,725,728,732,735,739,742,746,749,752,756,759,763,766,769,773,776,780,783,786,790,793,797,800,804,807,810,814,817,821,824,827,831,834,838,841,845,848,851 mov $2,8 mov $4,$0 add $4,$0 add $4,1 mov $5,$0 mov $6,$0 mul $6,$0 lpb $2 add $0,$2 lpb $6 add $0,2 add $4,2 trn $6,$4 lpe mov $2,1 lpe add $0,5 mov $1,$0 sub $1,10 mov $3,$5 mul $3,5 add $1,$3 sub $1,3 div $1,2 add $1,1
42.689655
969
0.691438
1f278a1a039af0e238aff63f3af24c1758546180
19
asm
Assembly
test/test_basic.asm
haramako/fc
54c8ab98de7e912cf40602f63c48d0b2b6641a65
[ "MIT" ]
2
2015-07-13T01:10:00.000Z
2018-03-10T17:14:34.000Z
test/test_basic.asm
haramako/fc
54c8ab98de7e912cf40602f63c48d0b2b6641a65
[ "MIT" ]
null
null
null
test/test_basic.asm
haramako/fc
54c8ab98de7e912cf40602f63c48d0b2b6641a65
[ "MIT" ]
null
null
null
;;; dummy asm file
9.5
18
0.631579
a652e98664954e1b860843d8324c634a48fce922
207
asm
Assembly
libsrc/_DEVELOPMENT/string/c/sdcc_iy/strnset_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/string/c/sdcc_iy/strnset_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/string/c/sdcc_iy/strnset_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; char *strnset_callee(char *s, int c, size_t n) SECTION code_string PUBLIC _strnset_callee EXTERN asm_strnset _strnset_callee: pop af pop hl pop de pop bc push af jp asm_strnset
10.894737
48
0.695652
5b9ce5854df96ff9a33c20f772cca2d4c707b039
15,295
asm
Assembly
Driver/IFS/DOS/Common/dosConvertGB.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Driver/IFS/DOS/Common/dosConvertGB.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Driver/IFS/DOS/Common/dosConvertGB.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) MyTurn.com 2001. All rights reserved. MYTURN.COM CONFIDENTIAL PROJECT: GlobalPC MODULE: FS driver FILE: dosConvertGB.asm AUTHOR: Allen Yuen, Feb 20, 2001 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- ayuen 2/20/01 Initial revision DESCRIPTION: Code for GB support (specifically, GB 2312-1980 EUC encoding). $Id$ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ Resident segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DosGBToGeosChar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert a GB DOS character to a GEOS character CALLED BY: DCSConvertToGEOSChar PASS: bx = DosCodePage to use (not used) ax = GB 2312 EUC character RETURN: carry set if error al = DTGSS_INVALID_CHARACTER ah = 0 carry clear if okay ax = GEOS character (Chars) DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: According to the document CJK.INF Version 2.1 (July 12, 1996) by Ken Lunde, the valid ranges for GB 2312 EUC format are: 0x21-0x7E: ASCII or GB 1988-1989 (Why is 0x20 excluded?) 0xA1A1-0xFEFE: GB 2312-1980 We ignore the differences between GB 1988 and ASCII. (Do we need to specially handle 0x24, which is dollar sign in ASCII but Yuan in GB 1988?) REVISION HISTORY: Name Date Description ---- ---- ----------- ayuen 2/20/01 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DosGBToGeosChar proc near uses bx, si, ds .enter ; ; Special case: Need to allow all low characters to pass through, ; even though not all of them are in GB 2312 EUC code set 0 ; strictly speaking. ; cmp ax, MIN_DOS_TO_GEOS_CHAR jb doneConvert ; ; Check if char is in GB 2312 EUC range ; cmp ax, GB_2312_EUC_CODE_SET_1_START jb notGB2312EUCChar cmp ax, GB_2312_EUC_CODE_SET_1_END ja notGB2312EUCChar ; ; Check if char is in proper EUC format. We already know the high ; byte is in the proper format, so we only need to check the low ; byte. ; test al, HIGH_BIT_MASK jz notGB2312EUCChar ; ; Char is GB 2312 EUC. First convert it back to GB 2312. ; andnf ax, not ((HIGH_BIT_MASK shl 8) or HIGH_BIT_MASK) ; ax = GBChars, possible invalid ; ; Scan the section start table to see which section it falls into. ; segmov ds, <segment Resident> clr si ; start at first section start table sectionStartLoop: cmp ax, ds:[gbSectionStartTable][si] jb startPassed CheckHack <size GBChars eq 2> inc si inc si ; si = next index cmp si, size gbSectionStartTable jb sectionStartLoop startPassed: tst si ; char below first section start? jz notGB2312Char ; => yes ; ; si-2 is the index for the start value that this character fits. ; Now check the end value to see if the character actually fits in ; the range. ; mov bx, ds:[gbSectionEndTable][si - size GBChars] cmp ax, bx ja notGB2312Char ; => above section end, invalid ; ; Section found. See if the section is single-row or multi-row. ; (Row number of a GB char is the high byte of the char minus 0x20.) ; cmp bh, ds:[gbSectionStartTable][si - size GBChars].high jne multiRow ; ; Single-row section. Just look up the Unicode by indexing into it. ; ; Make sure the element size of gbSectionTable is same as ; that of gbSectionStartTable, so that we can re-use SI as ; offset within gbSectionTable. CheckHack <type gbSectionTable eq type gbSectionStartTable> mov bx, ds:[gbSectionTable][si - size nptr] sub ax, ds:[gbSectionStartTable][si - size GBChars] shl ax ; ax = index into section mov_tr si, ax ; si = index into section mov ax, ds:[bx][si] ; ax = Chars jmp hasUnicode multiRow: ; ; Multi-row section. See if the character falls into the gaps between ; row sub-sections, which means it has no entry in the table, hence ; invalid. ; cmp al, GB_2312_LOW_BYTE_MIN jb notGB2312Char cmp al, GB_2312_LOW_BYTE_MAX ja notGB2312Char ; ; The character has an entry in the table (but it may still be ; invalid.) Calculate the index based on the offset of the row ; sub-section and the offset within the sub-section. ; sub ax, ds:[gbSectionStartTable][si - size GBChars] ; ah = row # in section, al = char # ; in row mov bl, al ; bl = char # in row mov al, (GB_2312_LOW_BYTE_MAX - GB_2312_LOW_BYTE_MIN + 1) \ * size GBChars ; al = size of a row mul ah ; ax = offset of row clr bh ; bx = char # in row CheckHack <size GBChars eq 2> shl bx ; bx *= size GBChars, bx = offset of ; char in row add bx, ax ; bx = offset of char in section mov si, ds:[gbSectionTable][si - size GBChars] mov ax, ds:[si][bx] ; ax = Chars hasUnicode: ; ; See if such a GB 2312 character exists. ; cmp ax, C_NOT_A_CHARACTER je notGB2312Char ; => no such GB 2312 char doneConvert: clc ; success exit: .leave ret notGB2312Char: notGB2312EUCChar: mov ax, DTGSS_INVALID_CHARACTER or (0 shl 8) stc ; error jmp exit DosGBToGeosChar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GeosToDosGBChar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert a GEOS character to a GB DOS character. CALLED BY: DCSConvertToDOSChar PASS: bx = DosCodePage to use ax = GEOS character (Chars) RETURN: carry set if error al = DTGSS_SUBSTITUTIONS ah = 0 carry clear if okay ax = GB 2312 EUC character DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ayuen 2/26/01 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GeosToDosGBChar proc near uses cx, si, di, ds, es .enter ; ; Special case: Need to allow all low characters to pass through, ; even though not all of them have equivalents in GB 2312 EUC ; strictly speaking. ; cmp ax, MIN_DOS_TO_GEOS_CHAR jb doneConvert ; ; Go through all the section tables to find a match. ; segmov ds, <segment Resident> clr si ; start at first section table segmov es, ds sectionLoop: mov di, ds:[gbSectionTable][si] ; es:di = section table ; Make sure the element size of gbSectionEnd/StartTable is ; same as that of gbSectionTable, so that we can re-use SI as ; offset within gbSectionEnd/StartTable. CheckHack <type gbSectionEndTable eq type gbSectionTable> CheckHack <type gbSectionStartTable eq type gbSectionTable> mov cx, ds:[gbSectionEndTable][si] sub cx, ds:[gbSectionStartTable][si] inc cx ; cx = length (if single-row) cmp cx, GB_2312_LOW_BYTE_MAX - GB_2312_LOW_BYTE_MIN + 1 ja multiRow ; ; Single-row seciton. Scan the table. ; repne scasw jne nextSection ; => not in this section ; ; Found. di-2 is the offset of the Chars that matches. Now ; calculate the equivalet GB 2312 character from the index. ; mov_tr ax, di sub ax, ds:[gbSectionTable][si] ; ax = offset in table CheckHack <size Chars eq 2> shr ax dec ax ; ax = (ax - size Chars) / size Chars add ax, ds:[gbSectionStartTable][si] ; ax = GBChars jmp convertToEUC multiRow: ; ; Multi-row section. Calculate the length appropriately. ; ; ch = # rows - 1, cl = length of last row push ax ; save Chars to find mov al, GB_2312_LOW_BYTE_MAX - GB_2312_LOW_BYTE_MIN + 1 ; al = len. of a row mul ch ; ax = total len. of rows except last clr ch ; cx = len. of last row add cx, ax ; cx = len. of section ; ; Scan the table. ; pop ax ; ax = Chars to find repne scasw jne nextSection ; => not in this section ; ; Found. di-2 is the offset of the Chars that matches. Now ; calculate the equivalet GB 2312 character from the index. ; mov_tr ax, di sub ax, ds:[gbSectionTable][si] ; ax = offset in table CheckHack <size Chars eq 2> shr ax dec ax ; ax = (ax - size Chars) / size Chars, ; # of Chars from start of section mov cl, GB_2312_LOW_BYTE_MAX - GB_2312_LOW_BYTE_MIN + 1 div cl ; al = row offset, ah = Chars offset ; in last row (won't overflow) xchg ah, al ; ah = row offset, al = Chars offset ; in last row add ax, ds:[gbSectionStartTable][si] ; ax = GBChars jmp convertToEUC nextSection: ; ; Loop to next section table ; CheckHack <size nptr eq 2> inc si inc si ; si = next index cmp si, size gbSectionTable jb sectionLoop ; ; GEOS character not found in any of the tables. Can't convert. ; mov ax, DTGSS_SUBSTITUTIONS or (0 shl 8) stc ; error jmp exit convertToEUC: ; ; Convert GBChars to EUC format. ; ornf ax, (HIGH_BIT_MASK shl 8) or HIGH_BIT_MASK ; ax = GB 2312 EUC doneConvert: clc ; success exit: .leave ret GeosToDosGBChar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DosGBToGeosCharString %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert a GB DOS character in a string to a GEOS character CALLED BY: DCSConvertToGEOS, DCSDosToGeosCharString PASS: bx = DosCodePage to use (not used) ds:si = DOS string es:di = GEOS buffer cx = max # of bytes to read RETURN: carry set if error al = DTGSS_CHARACTER_INCOMPLETE ah = # characters to back up al = DTGSS_INVALID_CHARACTER ah = 0 carry clear if okay ax = GEOS character (Chars) ds:si = next character es:di = next character cx updated if >1 bytes read DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ayuen 2/22/01 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DosGBToGeosCharString proc near .enter ; ; Get a byte, and see if it is the 1st byte of a 2-byte char. ; clr ah ; assume 1 byte lodsb ; ax = al = 1st byte cmp al, GB_2312_EUC_CODE_SET_1_START shr 8 jb gotChar ; => 1 byte char, maybe invalid cmp al, GB_2312_EUC_CODE_SET_1_END shr 8 ja gotChar ; => invalid char, let DosGBToGeosChar ; handle it to save code. ; ; Character is 2 bytes. Get the 2nd byte. ; dec cx ; cx = 1 more byte read jz partialChar ; => incomplete mov ah, al ; ah = high byte lodsb ; ax = char, maybe invalid gotChar: ; ; Convert the possibly invalid character to GEOS and store it. ; call DosGBToGeosChar ; ax = Chars, CF if error jc done ; => error stosw ; store GEOS char done: .leave ret partialChar: ; ; Read first byte of a two byte character, but second byte ; is not there to read. We increment cx because although ; the character was supposed to be a 2-byte character, ; the second byte wasn't there so we haven't read it. ; inc cx ; cx = one more byte mov ax, DTGSS_CHARACTER_INCOMPLETE or (1 shl 8) stc ; error jmp done DosGBToGeosCharString endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GeosToDosGBCharString %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert a GEOS character in a string to a GB DOS character CALLED BY: DCSConvertToDOS PASS: bx = DosCodePage ds:si = GEOS string es:di = DOS buffer RETURN: carry set if error al = DTGSS_SUBSTITUTIONS ah = 0 carry clear if okay ax = GB 2312 EUC character ds:si = ptr to next character es:di = ptr to next character DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ayuen 2/26/01 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GeosToDosGBCharString proc near ; ; Get the GEOS character from the string ; lodsw ; ax = Chars ; ; Convert the character ; call GeosToDosGBChar ; ax = DOS char jc done ; => error ; ; Store the character in as few bytes as it will fit in ; tst_clc ah ; one byte? jz oneByte ; => yes xchg al, ah ; high byte goes first stosw ; store two bytes ret oneByte: stosb ; store one byte done: ret GeosToDosGBCharString endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GeosToDosGBCharFileString %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert a GEOS character in a string to a GB DOS char suitable for a filename CALLED BY: DCSGeosToDosCharFileStringCurBX, DCSGeosToDosCharFileString PASS: bx = DosCodePage ds:si = GEOS string es:di = DOS byffer cx = size of DOS buffer in bytes RETURN: carry set if error ax = '_' carry clear if okay ax = DOS character (ah = 0) ds:si = next character es:di = next character cx = # of bytes updated if >1 byte read DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ayuen 2/27/01 Initial version (copied from GeosToDosSJISCharFileString) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GeosToDosGBCharFileString proc near ; ; Get the character ; lodsw ; ax = Chars ; ; allow null ; tst_clc ax jz storeOneByte ; => null ; ; Make sure it is a legal DOS filename character, special ; casing that we know none of the illegal DOS characters ; are above 0x80. ; cmp ax, MIN_DOS_TO_GEOS_CHAR ja gotChar call DOSVirtCheckLegalDosFileChar jnc illegalChar ; ; Upcase it first since DOS is goofy and does not support lowercase. ; We cannot use LocalUpcaseChar() since it is in a movable resource ; and therefore may need to be loaded by us. ; cmp ax, C_LATIN_SMALL_LETTER_Z ja gotChar cmp ax, C_LATIN_SMALL_LETTER_A jb gotChar sub ax, C_LATIN_SMALL_LETTER_A - C_LATIN_CAPITAL_LETTER_A ; ax = lowercase letter gotChar: ; ; Convert the character to GB ; call GeosToDosGBChar jc illegalChar ; ; Store the character in as few bytes as it will fit in ; tst_clc ah ; one byte? jz storeOneByte ; => yes ; ; Make sure a 2-byte character will fit. If not, flag ; an error and replace it with a 1-byte character. ; dec cx ; cx = less byte jz legalCharWontFit ; => no space ; ; Store a two-byte character ; xchg al, ah ; high byte goes first stosw ; store two bytes ret legalCharWontFit: ; ; It is a legal character, but it won't fit. ; inc cx ; cx = 1 more byte illegalChar: ; ; The character did not map or fit -- replace with '_' ; stc ; error mov ax, '_' ; ax = default char ; ; Store a one-byte character ; storeOneByte: stosb ; store one byte ret GeosToDosGBCharFileString endp Resident ends
25.239274
79
0.610788
bf9d658e28cc104be546e6ec2ba8b4b500e0cfbe
527
asm
Assembly
oeis/160/A160155.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/160/A160155.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/160/A160155.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A160155: Decimal expansion of the one real root of x^5-x-1. ; Submitted by Jon Maiga ; 1,1,6,7,3,0,3,9,7,8,2,6,1,4,1,8,6,8,4,2,5,6,0,4,5,8,9,9,8,5,4,8,4,2,1,8,0,7,2,0,5,6,0,3,7,1,5,2,5,4,8,9,0,3,9,1,4,0,0,8,2,4,4,9,2,7,5,6,5,1,9,0,3,4,2,9,5,2,7,0,5,3,1,8,0,6,8,5,2,0,5,0,4,9,7,2,8,6,7,2 mov $3,$0 mul $3,3 mov $7,10 lpb $3 add $6,$2 add $1,$6 add $2,$7 add $1,$2 add $2,$1 sub $3,1 add $5,$2 add $6,$5 add $7,$1 lpe mov $1,$5 add $2,10 mov $4,10 pow $4,$0 div $2,$4 div $1,$2 mov $0,$1 add $0,$4 mod $0,10
18.821429
201
0.531309
ed8f997def8eaadeccd54c2314cab46c06e77897
455
asm
Assembly
programs/oeis/095/A095002.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/095/A095002.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/095/A095002.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A095002: a(n) = 9*a(n-1) - 9*a(n-2) + a(n-3); given a(1) = 1, a(2) = 3, a(3) = 19. ; 1,3,19,145,1137,8947,70435,554529,4365793,34371811,270608691,2130497713,16773373009,132056486355,1039678517827,8185371656257,64443294732225,507360986201539,3994444594880083,31448195772839121,247591121587832881,1949280776929823923 seq $0,253654 ; Indices of pentagonal numbers (A000326) which are also centered pentagonal numbers (A005891). div $0,5 mul $0,2 add $0,1
56.875
231
0.758242
7b16062527f8d8a022ef98b218d60fb9f63a5274
1,748
asm
Assembly
source/words/store.asm
paulscottrobson/rpl-65
73f85a6b0f230fa03a41e1a9416c2511cf67f0c0
[ "MIT" ]
1
2019-11-20T09:18:22.000Z
2019-11-20T09:18:22.000Z
source/words/store.asm
paulscottrobson/rpl-65
73f85a6b0f230fa03a41e1a9416c2511cf67f0c0
[ "MIT" ]
null
null
null
source/words/store.asm
paulscottrobson/rpl-65
73f85a6b0f230fa03a41e1a9416c2511cf67f0c0
[ "MIT" ]
null
null
null
; ****************************************************************************** ; ****************************************************************************** ; ; Name : store.asm ; Purpose : Store to Memory ; Author : Paul Robson (paul@robsons.org.uk) ; Created : 13th November 2019 ; ; ****************************************************************************** ; ****************************************************************************** ; ****************************************************************************** ; ; Store to memory ; ; ****************************************************************************** Command_Store: ;; [^] StartCommand lda (codePtr),y ; next character cmp #$E0 ; is it a single letter variable ? bcc _CSLongVariable ; ; Single variable ; iny ; get the next lda (codePtr),y dey cmp #KWD_LSQPAREN ; followed by indexing, use long variable beq _CSLongVariable ; lda (codePtr),y ; get variable back. iny ; skip over it and push on stack phy asl a ; double it, now C0-FE tay ; put in Y ; lda lowStack,x ; copy TOS into it sta FastVariables-$C0,y lda highStack,x sta FastVariables-$C0+1,y dex ; pop off stack ply ; restore position and do next NextCommand ; ; Long named variable ; _CSLongVariable: sec ; create variable if not found. jsr VariableFind ; find it - create if not - is in zTemp0 jsr IndexCheck ; check indexing. ; lda lowStack,x ; write it out. sta (zTemp0) phy ldy #1 lda highStack,x sta (zTemp0),y ply dex ; pop off stack NextCommand ; do next command.
28.193548
80
0.426773
b8a8753502436ccd5e8a1c0cf4e2479dc90e67f2
834
asm
Assembly
programs/oeis/141/A141958.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/141/A141958.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/141/A141958.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A141958: Primes congruent to 16 mod 27. ; 43,97,151,313,367,421,691,853,907,1069,1123,1231,1447,1609,1663,1879,1933,1987,2203,2311,2473,2689,2797,2851,3067,3121,3229,3391,3499,3607,3769,3823,3877,3931,4093,4201,4363,4903,4957,5011,5119,5227,5281,5443,5659,5821,6037,6091,6199,6361,6469,6577,6793,7333,7549,7603,7873,7927,8089,8467,8521,8629,8737,9007,9277,9439,9547,9601,9817,9871,10141,10303,10357,10627,10789,11059,11113,11329,11383,11437,11491,11923,12301,12409,12517,12841,13003,13219,13327,13381,13597,13759,13921,14029,14083,14407,14461,14731,14947,15217 mov $2,$0 add $2,2 pow $2,2 lpb $2 add $1,15 sub $2,1 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,12 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe div $1,2 sub $1,22 mul $1,2 add $1,33 mov $0,$1
34.75
520
0.720624
2c9676eb57630e29a711e6453b6c851f40e74838
362
nasm
Assembly
Projetos/src/F-Assembly/src/nasm/mod.nasm
Fogelman/Z01.1
5a40e721a6bf000ba1016c2addad579a25618d49
[ "Unlicense" ]
null
null
null
Projetos/src/F-Assembly/src/nasm/mod.nasm
Fogelman/Z01.1
5a40e721a6bf000ba1016c2addad579a25618d49
[ "Unlicense" ]
91
2018-08-24T11:41:28.000Z
2018-12-09T15:09:02.000Z
Projetos/src/F-Assembly/src/nasm/mod.nasm
Fogelman/Z01.1
5a40e721a6bf000ba1016c2addad579a25618d49
[ "Unlicense" ]
1
2018-12-05T19:22:27.000Z
2018-12-05T19:22:27.000Z
; Arquivo: Mod.nasm ; Curso: Elementos de Sistemas ; Criado por: Luciano Soares ; Data: 27/03/2017 ; Divide o número posicionado na RAM[1] pelo número posicionado no RAM[2] e armazena o resultado na RAM[0]. leaw $R1, %A movw (%A), %D loop: movw %D, %S leaw $R2 , %A subw %D,(%A), %D leaw $loop, %A jge %D nop leaw $R0, %A movw %S, (%A)
15.73913
107
0.607735
fad57c65ad6218bd2c9d03db392d7a30d742ab97
1,130
asm
Assembly
ctx_swap_x64.asm
shadow-yuan/ctx_swap
7c4d57ea116b70ec462d62c3221d7e8577935e1a
[ "BSD-3-Clause" ]
null
null
null
ctx_swap_x64.asm
shadow-yuan/ctx_swap
7c4d57ea116b70ec462d62c3221d7e8577935e1a
[ "BSD-3-Clause" ]
null
null
null
ctx_swap_x64.asm
shadow-yuan/ctx_swap
7c4d57ea116b70ec462d62c3221d7e8577935e1a
[ "BSD-3-Clause" ]
null
null
null
; windows x64 version of the ctx_swap function ; ctx_swap(rcx, rdx); .CODE ctx_swap PROC mov rax, qword ptr[rsp] mov qword ptr[rcx + 104], rax mov qword ptr[rcx + 96], rbx mov qword ptr[rcx + 88], rcx mov qword ptr[rcx + 80], rdx mov rax, qword ptr [rax] mov qword ptr[rcx + 72], rax mov qword ptr[rcx + 64], rsi mov qword ptr[rcx + 56], rdi mov qword ptr[rcx + 48], rbp mov qword ptr[rcx + 40], r8 mov qword ptr[rcx + 32], r9 mov qword ptr[rcx + 24], r12 mov qword ptr[rcx + 16], r13 mov qword ptr[rcx + 8], r14 mov qword ptr[rcx], r15 xor rax, rax mov rbp, qword ptr[rdx + 48] mov rsp, qword ptr[rdx + 104] mov r15, qword ptr[rdx] mov r14, qword ptr[rdx + 8] mov r13, qword ptr[rdx + 16] mov r12, qword ptr[rdx + 24] mov r9, qword ptr[rdx + 32] mov r8, qword ptr[rdx + 40] mov rdi, qword ptr[rdx + 56] mov rsi, qword ptr[rdx + 64] mov rcx, qword ptr[rdx + 88] mov rbx, qword ptr[rdx + 96] ;mov rsp, qword ptr[rsp + 8] push qword ptr[rdx + 72] mov rdx, qword ptr[rdx + 80] ret ctx_swap ENDP END
26.27907
46
0.592035
63d1804f94ce3f977d5c737f89410e4ff28d1b75
541
asm
Assembly
oeis/118/A118747.asm
loda-lang/loda-programs
773fe0baed2ca30c72b7faf16c0801749f2e6f9a
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/118/A118747.asm
loda-lang/loda-programs
773fe0baed2ca30c72b7faf16c0801749f2e6f9a
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/118/A118747.asm
loda-lang/loda-programs
773fe0baed2ca30c72b7faf16c0801749f2e6f9a
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A118747: a(n) = product[k=1..n] P(k), where P(k) is the largest prime <= 2*k. a(n) = product[k=1..n] A060308(k). ; Submitted by Jon Maiga ; 2,6,30,210,1470,16170,210210,2732730,46456410,882671790,16770764010,385727572230,8871734161290,204049885709670,5917446685580430,183440847252993330,5686666264842793230,176286654210126590130 mul $0,2 add $0,1 mov $3,1 lpb $0 sub $0,1 div $0,2 mul $0,2 mov $2,$0 trn $0,1 seq $0,151799 ; Version 2 of the "previous prime" function: largest prime < n. mul $3,$0 mov $0,$2 lpe mov $0,$3
28.473684
190
0.695009
b49915f3173b0c0ce3f9dfc8a92286c29d29da1a
5,490
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1932.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1932.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1932.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r14 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0x17660, %rsi lea addresses_D_ht+0x17440, %rdi nop nop nop nop nop add %r8, %r8 mov $64, %rcx rep movsw nop nop nop nop nop add %r11, %r11 lea addresses_WT_ht+0x13960, %rax nop nop nop and $64064, %rbx vmovups (%rax), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %rdi nop nop nop and %rax, %rax lea addresses_A_ht+0xe4fc, %rsi lea addresses_D_ht+0x3dc0, %rdi nop sub $26006, %r14 mov $110, %rcx rep movsl add %rdi, %rdi lea addresses_D_ht+0xd260, %rcx nop nop nop nop and %rbx, %rbx and $0xffffffffffffffc0, %rcx vmovntdqa (%rcx), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %r14 nop nop nop nop and %rcx, %rcx lea addresses_normal_ht+0x1e460, %r11 nop nop nop nop nop cmp %rax, %rax mov (%r11), %bx nop xor %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r14 pop %r11 ret .global s_faulty_load s_faulty_load: push %r14 push %r8 push %rbp push %rdi push %rdx push %rsi // Load lea addresses_D+0x16698, %r8 sub $25801, %rdi mov (%r8), %rsi nop nop nop dec %r14 // Faulty Load lea addresses_WT+0x3e60, %rdx nop nop nop nop nop inc %rsi movb (%rdx), %r8b lea oracles, %rbp and $0xff, %r8 shlq $12, %r8 mov (%rbp,%r8,1), %r8 pop %rsi pop %rdx pop %rdi pop %rbp pop %r8 pop %r14 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 10}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 9}} {'39': 21829} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
40.367647
2,999
0.659381
5362e4cb06d8800a0361d20824694555252bed66
953
asm
Assembly
programs/oeis/003/A003132.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/003/A003132.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/003/A003132.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A003132: Sum of squares of digits of n. ; 0,1,4,9,16,25,36,49,64,81,1,2,5,10,17,26,37,50,65,82,4,5,8,13,20,29,40,53,68,85,9,10,13,18,25,34,45,58,73,90,16,17,20,25,32,41,52,65,80,97,25,26,29,34,41,50,61,74,89,106,36,37,40,45,52,61,72,85,100,117,49,50,53,58,65,74,85,98,113,130,64,65,68,73,80,89,100,113,128,145,81,82,85,90,97,106,117,130,145,162,1,2,5,10,17,26,37,50,65,82,2,3,6,11,18,27,38,51,66,83,5,6,9,14,21,30,41,54,69,86,10,11,14,19,26,35,46,59,74,91,17,18,21,26,33,42,53,66,81,98,26,27,30,35,42,51,62,75,90,107,37,38,41,46,53,62,73,86,101,118,50,51,54,59,66,75,86,99,114,131,65,66,69,74,81,90,101,114,129,146,82,83,86,91,98,107,118,131,146,163,4,5,8,13,20,29,40,53,68,85,5,6,9,14,21,30,41,54,69,86,8,9,12,17,24,33,44,57,72,89,13,14,17,22,29,38,49,62,77,94,20,21,24,29,36,45,56,69,84,101 mov $3,1 lpb $0 mov $2,$0 div $0,10 mod $2,10 pow $2,2 add $2,7 add $3,7 sub $3,$2 lpe mov $1,1 sub $1,$3 add $1,2 mul $1,6 sub $1,12 div $1,6
47.65
752
0.641133
5445c3c57fc663ea56fee720162a4517ea99c130
216
asm
Assembly
programs/oeis/010/A010858.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/010/A010858.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/010/A010858.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A010858: Constant sequence: a(n) = 19. ; 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19 mov $1,19
43.2
163
0.652778
df1ba33cfbf09e0cf0fb8bb92e32e78ead2ac2e6
46,816
asm
Assembly
target/cos_117/disasm/iop_overlay1/CLOCK.asm
jrrk2/cray-sim
52c9639808d6890517092637b188282c00cce4f7
[ "BSL-1.0" ]
49
2020-10-09T12:29:16.000Z
2022-03-12T02:33:35.000Z
target/cos_117/disasm/iop_overlay1/CLOCK.asm
jrrk2/cray-sim
52c9639808d6890517092637b188282c00cce4f7
[ "BSL-1.0" ]
1
2021-12-29T15:59:25.000Z
2021-12-29T15:59:25.000Z
target/cos_117/disasm/iop_overlay1/CLOCK.asm
jrrk2/cray-sim
52c9639808d6890517092637b188282c00cce4f7
[ "BSL-1.0" ]
6
2021-04-12T06:10:32.000Z
2022-02-08T23:11:19.000Z
0x0000 (0x000000) 0x0400- f:00002 d: 0 | I = 0 0x0001 (0x000002) 0x0000- f:00000 d: 0 | PASS 0x0002 (0x000004) 0x1800-0x0D1C f:00014 d: 0 | A = 3356 (0x0D1C) 0x0004 (0x000008) 0x2908- f:00024 d: 264 | OR[264] = A 0x0005 (0x00000A) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0006 (0x00000C) 0x291C- f:00024 d: 284 | OR[284] = A 0x0007 (0x00000E) 0x211C- f:00020 d: 284 | A = OR[284] 0x0008 (0x000010) 0x1E00-0x0D1C f:00017 d: 0 | A = A - 3356 (0x0D1C) 0x000A (0x000014) 0x8410- f:00102 d: 16 | P = P + 16 (0x001A), A = 0 0x000B (0x000016) 0x211C- f:00020 d: 284 | A = OR[284] 0x000C (0x000018) 0xB434- f:00132 d: 52 | R = OR[52], A = 0 0x000D (0x00001A) 0x0000- f:00000 d: 0 | PASS 0x000E (0x00001C) 0x211C- f:00020 d: 284 | A = OR[284] 0x000F (0x00001E) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003) 0x0010 (0x000020) 0x2908- f:00024 d: 264 | OR[264] = A 0x0011 (0x000022) 0x3F08- f:00037 d: 264 | (OR[264]) = (OR[264]) - 1 0x0012 (0x000024) 0x2914- f:00024 d: 276 | OR[276] = A 0x0013 (0x000026) 0x211C- f:00020 d: 284 | A = OR[284] 0x0014 (0x000028) 0x2913- f:00024 d: 275 | OR[275] = A 0x0015 (0x00002A) 0x311C- f:00030 d: 284 | A = (OR[284]) 0x0016 (0x00002C) 0x291C- f:00024 d: 284 | OR[284] = A 0x0017 (0x00002E) 0x2114- f:00020 d: 276 | A = OR[276] 0x0018 (0x000030) 0x95C1- f:00112 d: 449 | R = P + 449 (0x01D9), A = 0 0x0019 (0x000032) 0x7212- f:00071 d: 18 | P = P - 18 (0x0007) 0x001A (0x000034) 0x0600- f:00003 d: 0 | I = 1 0x001B (0x000036) 0x2C44- f:00026 d: 68 | OR[68] = OR[68] + 1 0x001C (0x000038) 0x160A- f:00013 d: 10 | A = A - 10 (0x000A) 0x001D (0x00003A) 0x8402- f:00102 d: 2 | P = P + 2 (0x001F), A = 0 0x001E (0x00003C) 0x7004- f:00070 d: 4 | P = P + 4 (0x0022) 0x001F (0x00003E) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0020 (0x000040) 0x2844- f:00024 d: 68 | OR[68] = A 0x0021 (0x000042) 0x7003- f:00070 d: 3 | P = P + 3 (0x0024) 0x0022 (0x000044) 0x7A00-0x1A40 f:00075 d: 0 | P = OR[0]+6720 (0x1A40) 0x0024 (0x000048) 0x204B- f:00020 d: 75 | A = OR[75] 0x0025 (0x00004A) 0x2649- f:00023 d: 73 | A = A - OR[73] 0x0026 (0x00004C) 0x8003- f:00100 d: 3 | P = P + 3 (0x0029), C = 0 0x0027 (0x00004E) 0x8402- f:00102 d: 2 | P = P + 2 (0x0029), A = 0 0x0028 (0x000050) 0x7002- f:00070 d: 2 | P = P + 2 (0x002A) 0x0029 (0x000052) 0x7003- f:00070 d: 3 | P = P + 3 (0x002C) 0x002A (0x000054) 0x7010- f:00070 d: 16 | P = P + 16 (0x003A) 0x002B (0x000056) 0x700F- f:00070 d: 15 | P = P + 15 (0x003A) 0x002C (0x000058) 0x204B- f:00020 d: 75 | A = OR[75] 0x002D (0x00005A) 0x2649- f:00023 d: 73 | A = A - OR[73] 0x002E (0x00005C) 0x8402- f:00102 d: 2 | P = P + 2 (0x0030), A = 0 0x002F (0x00005E) 0x7007- f:00070 d: 7 | P = P + 7 (0x0036) 0x0030 (0x000060) 0x204C- f:00020 d: 76 | A = OR[76] 0x0031 (0x000062) 0x264A- f:00023 d: 74 | A = A - OR[74] 0x0032 (0x000064) 0x8202- f:00101 d: 2 | P = P + 2 (0x0034), C = 1 0x0033 (0x000066) 0x7003- f:00070 d: 3 | P = P + 3 (0x0036) 0x0034 (0x000068) 0x7006- f:00070 d: 6 | P = P + 6 (0x003A) 0x0035 (0x00006A) 0x7005- f:00070 d: 5 | P = P + 5 (0x003A) 0x0036 (0x00006C) 0x2049- f:00020 d: 73 | A = OR[73] 0x0037 (0x00006E) 0x284B- f:00024 d: 75 | OR[75] = A 0x0038 (0x000070) 0x204A- f:00020 d: 74 | A = OR[74] 0x0039 (0x000072) 0x284C- f:00024 d: 76 | OR[76] = A 0x003A (0x000074) 0x2049- f:00020 d: 73 | A = OR[73] 0x003B (0x000076) 0x284E- f:00024 d: 78 | OR[78] = A 0x003C (0x000078) 0x204A- f:00020 d: 74 | A = OR[74] 0x003D (0x00007A) 0x284F- f:00024 d: 79 | OR[79] = A 0x003E (0x00007C) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x003F (0x00007E) 0x2849- f:00024 d: 73 | OR[73] = A 0x0040 (0x000080) 0x284A- f:00024 d: 74 | OR[74] = A 0x0041 (0x000082) 0x2055- f:00020 d: 85 | A = OR[85] 0x0042 (0x000084) 0x2857- f:00024 d: 87 | OR[87] = A 0x0043 (0x000086) 0x2056- f:00020 d: 86 | A = OR[86] 0x0044 (0x000088) 0x2858- f:00024 d: 88 | OR[88] = A 0x0045 (0x00008A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0046 (0x00008C) 0x2855- f:00024 d: 85 | OR[85] = A 0x0047 (0x00008E) 0x2856- f:00024 d: 86 | OR[86] = A 0x0048 (0x000090) 0x2059- f:00020 d: 89 | A = OR[89] 0x0049 (0x000092) 0x285B- f:00024 d: 91 | OR[91] = A 0x004A (0x000094) 0x205A- f:00020 d: 90 | A = OR[90] 0x004B (0x000096) 0x285C- f:00024 d: 92 | OR[92] = A 0x004C (0x000098) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x004D (0x00009A) 0x2859- f:00024 d: 89 | OR[89] = A 0x004E (0x00009C) 0x285A- f:00024 d: 90 | OR[90] = A 0x004F (0x00009E) 0x2061- f:00020 d: 97 | A = OR[97] 0x0050 (0x0000A0) 0x2863- f:00024 d: 99 | OR[99] = A 0x0051 (0x0000A2) 0x2062- f:00020 d: 98 | A = OR[98] 0x0052 (0x0000A4) 0x2864- f:00024 d: 100 | OR[100] = A 0x0053 (0x0000A6) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0054 (0x0000A8) 0x2861- f:00024 d: 97 | OR[97] = A 0x0055 (0x0000AA) 0x2862- f:00024 d: 98 | OR[98] = A 0x0056 (0x0000AC) 0x2065- f:00020 d: 101 | A = OR[101] 0x0057 (0x0000AE) 0x2867- f:00024 d: 103 | OR[103] = A 0x0058 (0x0000B0) 0x2066- f:00020 d: 102 | A = OR[102] 0x0059 (0x0000B2) 0x2868- f:00024 d: 104 | OR[104] = A 0x005A (0x0000B4) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x005B (0x0000B6) 0x2865- f:00024 d: 101 | OR[101] = A 0x005C (0x0000B8) 0x2866- f:00024 d: 102 | OR[102] = A 0x005D (0x0000BA) 0x3083- f:00030 d: 131 | A = (OR[131]) 0x005E (0x0000BC) 0x080D- f:00004 d: 13 | A = A > 13 (0x000D) 0x005F (0x0000BE) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x0060 (0x0000C0) 0x8602- f:00103 d: 2 | P = P + 2 (0x0062), A # 0 0x0061 (0x0000C2) 0x7009- f:00070 d: 9 | P = P + 9 (0x006A) 0x0062 (0x0000C4) 0x1800-0xFFFF f:00014 d: 0 | A = 65535 (0xFFFF) 0x0064 (0x0000C8) 0x2918- f:00024 d: 280 | OR[280] = A 0x0065 (0x0000CA) 0x7563- f:00072 d: 355 | R = P + 355 (0x01C8) 0x0066 (0x0000CC) 0x3083- f:00030 d: 131 | A = (OR[131]) 0x0067 (0x0000CE) 0x1A00-0xDFFF f:00015 d: 0 | A = A & 57343 (0xDFFF) 0x0069 (0x0000D2) 0x3883- f:00034 d: 131 | (OR[131]) = A 0x006A (0x0000D4) 0x2047- f:00020 d: 71 | A = OR[71] 0x006B (0x0000D6) 0x8402- f:00102 d: 2 | P = P + 2 (0x006D), A = 0 0x006C (0x0000D8) 0x703A- f:00070 d: 58 | P = P + 58 (0x00A6) 0x006D (0x0000DA) 0x1800-0x0D26 f:00014 d: 0 | A = 3366 (0x0D26) 0x006F (0x0000DE) 0x2908- f:00024 d: 264 | OR[264] = A 0x0070 (0x0000E0) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0071 (0x0000E2) 0x8402- f:00102 d: 2 | P = P + 2 (0x0073), A = 0 0x0072 (0x0000E4) 0x7034- f:00070 d: 52 | P = P + 52 (0x00A6) 0x0073 (0x0000E6) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0074 (0x0000E8) 0x2843- f:00024 d: 67 | OR[67] = A 0x0075 (0x0000EA) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0076 (0x0000EC) 0x2918- f:00024 d: 280 | OR[280] = A 0x0077 (0x0000EE) 0x2118- f:00020 d: 280 | A = OR[280] 0x0078 (0x0000F0) 0x1604- f:00013 d: 4 | A = A - 4 (0x0004) 0x0079 (0x0000F2) 0x842D- f:00102 d: 45 | P = P + 45 (0x00A6), A = 0 0x007A (0x0000F4) 0x2118- f:00020 d: 280 | A = OR[280] 0x007B (0x0000F6) 0x1C00-0x0DD3 f:00016 d: 0 | A = A + 3539 (0x0DD3) 0x007D (0x0000FA) 0x2908- f:00024 d: 264 | OR[264] = A 0x007E (0x0000FC) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x007F (0x0000FE) 0x8602- f:00103 d: 2 | P = P + 2 (0x0081), A # 0 0x0080 (0x000100) 0x7024- f:00070 d: 36 | P = P + 36 (0x00A4) 0x0081 (0x000102) 0x0400- f:00002 d: 0 | I = 0 0x0082 (0x000104) 0x0000- f:00000 d: 0 | PASS 0x0083 (0x000106) 0x2118- f:00020 d: 280 | A = OR[280] 0x0084 (0x000108) 0x281E- f:00024 d: 30 | OR[30] = A 0x0085 (0x00010A) 0x1017- f:00010 d: 23 | A = 23 (0x0017) 0x0086 (0x00010C) 0x281D- f:00024 d: 29 | OR[29] = A 0x0087 (0x00010E) 0x7E00-0x0685 f:00077 d: 0 | R = OR[0]+1669 (0x0685) 0x0089 (0x000112) 0x2118- f:00020 d: 280 | A = OR[280] 0x008A (0x000114) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001) 0x008B (0x000116) 0x5800- f:00054 d: 0 | B = A 0x008C (0x000118) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x008D (0x00011A) 0x4A00- f:00045 d: 0 | A = A < B 0x008E (0x00011C) 0x2913- f:00024 d: 275 | OR[275] = A 0x008F (0x00011E) 0x1800-0x39DE f:00014 d: 0 | A = 14814 (0x39DE) 0x0091 (0x000122) 0x2908- f:00024 d: 264 | OR[264] = A 0x0092 (0x000124) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0093 (0x000126) 0x2914- f:00024 d: 276 | OR[276] = A 0x0094 (0x000128) 0x1800-0x39DE f:00014 d: 0 | A = 14814 (0x39DE) 0x0096 (0x00012C) 0x2908- f:00024 d: 264 | OR[264] = A 0x0097 (0x00012E) 0x1800-0xFFFF f:00014 d: 0 | A = 65535 (0xFFFF) 0x0099 (0x000132) 0x2713- f:00023 d: 275 | A = A - OR[275] 0x009A (0x000134) 0x2314- f:00021 d: 276 | A = A & OR[276] 0x009B (0x000136) 0x2513- f:00022 d: 275 | A = A + OR[275] 0x009C (0x000138) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x009D (0x00013A) 0x0600- f:00003 d: 0 | I = 1 0x009E (0x00013C) 0x2113- f:00020 d: 275 | A = OR[275] 0x009F (0x00013E) 0x2314- f:00021 d: 276 | A = A & OR[276] 0x00A0 (0x000140) 0x2908- f:00024 d: 264 | OR[264] = A 0x00A1 (0x000142) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00A2 (0x000144) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x00A3 (0x000146) 0x9725- f:00113 d: 293 | R = P + 293 (0x01C8), A # 0 0x00A4 (0x000148) 0x2D18- f:00026 d: 280 | OR[280] = OR[280] + 1 0x00A5 (0x00014A) 0x722E- f:00071 d: 46 | P = P - 46 (0x0077) 0x00A6 (0x00014C) 0x2047- f:00020 d: 71 | A = OR[71] 0x00A7 (0x00014E) 0x8402- f:00102 d: 2 | P = P + 2 (0x00A9), A = 0 0x00A8 (0x000150) 0x70A0- f:00070 d: 160 | P = P + 160 (0x0148) 0x00A9 (0x000152) 0x1800-0x0D26 f:00014 d: 0 | A = 3366 (0x0D26) 0x00AB (0x000156) 0x2908- f:00024 d: 264 | OR[264] = A 0x00AC (0x000158) 0x3D08- f:00036 d: 264 | (OR[264]) = (OR[264]) + 1 0x00AD (0x00015A) 0x163C- f:00013 d: 60 | A = A - 60 (0x003C) 0x00AE (0x00015C) 0x8402- f:00102 d: 2 | P = P + 2 (0x00B0), A = 0 0x00AF (0x00015E) 0x7088- f:00070 d: 136 | P = P + 136 (0x0137) 0x00B0 (0x000160) 0x1800-0x0D26 f:00014 d: 0 | A = 3366 (0x0D26) 0x00B2 (0x000164) 0x2908- f:00024 d: 264 | OR[264] = A 0x00B3 (0x000166) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00B4 (0x000168) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x00B5 (0x00016A) 0x1800-0x0D25 f:00014 d: 0 | A = 3365 (0x0D25) 0x00B7 (0x00016E) 0x2908- f:00024 d: 264 | OR[264] = A 0x00B8 (0x000170) 0x3D08- f:00036 d: 264 | (OR[264]) = (OR[264]) + 1 0x00B9 (0x000172) 0x1207- f:00011 d: 7 | A = A & 7 (0x0007) 0x00BA (0x000174) 0x2908- f:00024 d: 264 | OR[264] = A 0x00BB (0x000176) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00BC (0x000178) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x00BD (0x00017A) 0x8402- f:00102 d: 2 | P = P + 2 (0x00BF), A = 0 0x00BE (0x00017C) 0x700F- f:00070 d: 15 | P = P + 15 (0x00CD) 0x00BF (0x00017E) 0x102D- f:00010 d: 45 | A = 45 (0x002D) 0x00C0 (0x000180) 0x2921- f:00024 d: 289 | OR[289] = A 0x00C1 (0x000182) 0x1800-0x0014 f:00014 d: 0 | A = 20 (0x0014) 0x00C3 (0x000186) 0x2922- f:00024 d: 290 | OR[290] = A 0x00C4 (0x000188) 0x1008- f:00010 d: 8 | A = 8 (0x0008) 0x00C5 (0x00018A) 0x2923- f:00024 d: 291 | OR[291] = A 0x00C6 (0x00018C) 0x1800-0xFFFF f:00014 d: 0 | A = 65535 (0xFFFF) 0x00C8 (0x000190) 0x2924- f:00024 d: 292 | OR[292] = A 0x00C9 (0x000192) 0x1121- f:00010 d: 289 | A = 289 (0x0121) 0x00CA (0x000194) 0x5800- f:00054 d: 0 | B = A 0x00CB (0x000196) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00CC (0x000198) 0x7C09- f:00076 d: 9 | R = OR[9] 0x00CD (0x00019A) 0x1800-0x0D25 f:00014 d: 0 | A = 3365 (0x0D25) 0x00CF (0x00019E) 0x2908- f:00024 d: 264 | OR[264] = A 0x00D0 (0x0001A0) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00D1 (0x0001A2) 0x163C- f:00013 d: 60 | A = A - 60 (0x003C) 0x00D2 (0x0001A4) 0x8402- f:00102 d: 2 | P = P + 2 (0x00D4), A = 0 0x00D3 (0x0001A6) 0x7064- f:00070 d: 100 | P = P + 100 (0x0137) 0x00D4 (0x0001A8) 0x1800-0x0D25 f:00014 d: 0 | A = 3365 (0x0D25) 0x00D6 (0x0001AC) 0x2908- f:00024 d: 264 | OR[264] = A 0x00D7 (0x0001AE) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00D8 (0x0001B0) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x00D9 (0x0001B2) 0x1800-0x0D24 f:00014 d: 0 | A = 3364 (0x0D24) 0x00DB (0x0001B6) 0x2908- f:00024 d: 264 | OR[264] = A 0x00DC (0x0001B8) 0x3D08- f:00036 d: 264 | (OR[264]) = (OR[264]) + 1 0x00DD (0x0001BA) 0x1618- f:00013 d: 24 | A = A - 24 (0x0018) 0x00DE (0x0001BC) 0x8402- f:00102 d: 2 | P = P + 2 (0x00E0), A = 0 0x00DF (0x0001BE) 0x7058- f:00070 d: 88 | P = P + 88 (0x0137) 0x00E0 (0x0001C0) 0x1800-0x0D24 f:00014 d: 0 | A = 3364 (0x0D24) 0x00E2 (0x0001C4) 0x2908- f:00024 d: 264 | OR[264] = A 0x00E3 (0x0001C6) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00E4 (0x0001C8) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x00E5 (0x0001CA) 0x1800-0x0D22 f:00014 d: 0 | A = 3362 (0x0D22) 0x00E7 (0x0001CE) 0x2908- f:00024 d: 264 | OR[264] = A 0x00E8 (0x0001D0) 0x3D08- f:00036 d: 264 | (OR[264]) = (OR[264]) + 1 0x00E9 (0x0001D2) 0x4200- f:00041 d: 0 | C = 1, io 0000 (IOR) = BZ 0x00EA (0x0001D4) 0x161C- f:00013 d: 28 | A = A - 28 (0x001C) 0x00EB (0x0001D6) 0x8003- f:00100 d: 3 | P = P + 3 (0x00EE), C = 0 0x00EC (0x0001D8) 0x8402- f:00102 d: 2 | P = P + 2 (0x00EE), A = 0 0x00ED (0x0001DA) 0x7002- f:00070 d: 2 | P = P + 2 (0x00EF) 0x00EE (0x0001DC) 0x7049- f:00070 d: 73 | P = P + 73 (0x0137) 0x00EF (0x0001DE) 0x1800-0x0D22 f:00014 d: 0 | A = 3362 (0x0D22) 0x00F1 (0x0001E2) 0x2908- f:00024 d: 264 | OR[264] = A 0x00F2 (0x0001E4) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00F3 (0x0001E6) 0x291B- f:00024 d: 283 | OR[283] = A 0x00F4 (0x0001E8) 0x1800-0x0D21 f:00014 d: 0 | A = 3361 (0x0D21) 0x00F6 (0x0001EC) 0x2908- f:00024 d: 264 | OR[264] = A 0x00F7 (0x0001EE) 0x1800-0x0268 f:00014 d: 0 | A = 616 (0x0268) 0x00F9 (0x0001F2) 0x3508- f:00032 d: 264 | A = A + (OR[264]) 0x00FA (0x0001F4) 0x2403- f:00022 d: 3 | A = A + OR[3] 0x00FB (0x0001F6) 0x2919- f:00024 d: 281 | OR[281] = A 0x00FC (0x0001F8) 0x3119- f:00030 d: 281 | A = (OR[281]) 0x00FD (0x0001FA) 0x2919- f:00024 d: 281 | OR[281] = A 0x00FE (0x0001FC) 0x1800-0x0D21 f:00014 d: 0 | A = 3361 (0x0D21) 0x0100 (0x000200) 0x2908- f:00024 d: 264 | OR[264] = A 0x0101 (0x000202) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0102 (0x000204) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002) 0x0103 (0x000206) 0x8402- f:00102 d: 2 | P = P + 2 (0x0105), A = 0 0x0104 (0x000208) 0x700E- f:00070 d: 14 | P = P + 14 (0x0112) 0x0105 (0x00020A) 0x1800-0x0D23 f:00014 d: 0 | A = 3363 (0x0D23) 0x0107 (0x00020E) 0x2908- f:00024 d: 264 | OR[264] = A 0x0108 (0x000210) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0109 (0x000212) 0x1207- f:00011 d: 7 | A = A & 7 (0x0007) 0x010A (0x000214) 0x291A- f:00024 d: 282 | OR[282] = A 0x010B (0x000216) 0x211A- f:00020 d: 282 | A = OR[282] 0x010C (0x000218) 0x8405- f:00102 d: 5 | P = P + 5 (0x0111), A = 0 0x010D (0x00021A) 0x211A- f:00020 d: 282 | A = OR[282] 0x010E (0x00021C) 0x1604- f:00013 d: 4 | A = A - 4 (0x0004) 0x010F (0x00021E) 0x8402- f:00102 d: 2 | P = P + 2 (0x0111), A = 0 0x0110 (0x000220) 0x7002- f:00070 d: 2 | P = P + 2 (0x0112) 0x0111 (0x000222) 0x2D19- f:00026 d: 281 | OR[281] = OR[281] + 1 0x0112 (0x000224) 0x2119- f:00020 d: 281 | A = OR[281] 0x0113 (0x000226) 0x271B- f:00023 d: 283 | A = A - OR[283] 0x0114 (0x000228) 0x8402- f:00102 d: 2 | P = P + 2 (0x0116), A = 0 0x0115 (0x00022A) 0x700A- f:00070 d: 10 | P = P + 10 (0x011F) 0x0116 (0x00022C) 0x1800-0x0D21 f:00014 d: 0 | A = 3361 (0x0D21) 0x0118 (0x000230) 0x2908- f:00024 d: 264 | OR[264] = A 0x0119 (0x000232) 0x3D08- f:00036 d: 264 | (OR[264]) = (OR[264]) + 1 0x011A (0x000234) 0x1800-0x0D22 f:00014 d: 0 | A = 3362 (0x0D22) 0x011C (0x000238) 0x2908- f:00024 d: 264 | OR[264] = A 0x011D (0x00023A) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x011E (0x00023C) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x011F (0x00023E) 0x1800-0x0D21 f:00014 d: 0 | A = 3361 (0x0D21) 0x0121 (0x000242) 0x2908- f:00024 d: 264 | OR[264] = A 0x0122 (0x000244) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0123 (0x000246) 0x160D- f:00013 d: 13 | A = A - 13 (0x000D) 0x0124 (0x000248) 0x8402- f:00102 d: 2 | P = P + 2 (0x0126), A = 0 0x0125 (0x00024A) 0x7012- f:00070 d: 18 | P = P + 18 (0x0137) 0x0126 (0x00024C) 0x1800-0x0D21 f:00014 d: 0 | A = 3361 (0x0D21) 0x0128 (0x000250) 0x2908- f:00024 d: 264 | OR[264] = A 0x0129 (0x000252) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x012A (0x000254) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x012B (0x000256) 0x1800-0x0D23 f:00014 d: 0 | A = 3363 (0x0D23) 0x012D (0x00025A) 0x2908- f:00024 d: 264 | OR[264] = A 0x012E (0x00025C) 0x3D08- f:00036 d: 264 | (OR[264]) = (OR[264]) + 1 0x012F (0x00025E) 0x1800-0x0D23 f:00014 d: 0 | A = 3363 (0x0D23) 0x0131 (0x000262) 0x2908- f:00024 d: 264 | OR[264] = A 0x0132 (0x000264) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0133 (0x000266) 0x1664- f:00013 d: 100 | A = A - 100 (0x0064) 0x0134 (0x000268) 0x8603- f:00103 d: 3 | P = P + 3 (0x0137), A # 0 0x0135 (0x00026A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0136 (0x00026C) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0137 (0x00026E) 0x1027- f:00010 d: 39 | A = 39 (0x0027) 0x0138 (0x000270) 0x2921- f:00024 d: 289 | OR[289] = A 0x0139 (0x000272) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x013A (0x000274) 0x2922- f:00024 d: 290 | OR[290] = A 0x013B (0x000276) 0x2032- f:00020 d: 50 | A = OR[50] 0x013C (0x000278) 0x0802- f:00004 d: 2 | A = A > 2 (0x0002) 0x013D (0x00027A) 0x2923- f:00024 d: 291 | OR[291] = A 0x013E (0x00027C) 0x2032- f:00020 d: 50 | A = OR[50] 0x013F (0x00027E) 0x2924- f:00024 d: 292 | OR[292] = A 0x0140 (0x000280) 0x1002- f:00010 d: 2 | A = 2 (0x0002) 0x0141 (0x000282) 0x2925- f:00024 d: 293 | OR[293] = A 0x0142 (0x000284) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0143 (0x000286) 0x2926- f:00024 d: 294 | OR[294] = A 0x0144 (0x000288) 0x1121- f:00010 d: 289 | A = 289 (0x0121) 0x0145 (0x00028A) 0x5800- f:00054 d: 0 | B = A 0x0146 (0x00028C) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0147 (0x00028E) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0148 (0x000290) 0x2047- f:00020 d: 71 | A = OR[71] 0x0149 (0x000292) 0x8402- f:00102 d: 2 | P = P + 2 (0x014B), A = 0 0x014A (0x000294) 0x7003- f:00070 d: 3 | P = P + 3 (0x014D) 0x014B (0x000296) 0x7A00-0x1A40 f:00075 d: 0 | P = OR[0]+6720 (0x1A40) 0x014D (0x00029A) 0x1800-0x0C85 f:00014 d: 0 | A = 3205 (0x0C85) 0x014F (0x00029E) 0x291C- f:00024 d: 284 | OR[284] = A 0x0150 (0x0002A0) 0x311C- f:00030 d: 284 | A = (OR[284]) 0x0151 (0x0002A2) 0x291D- f:00024 d: 285 | OR[285] = A 0x0152 (0x0002A4) 0x860B- f:00103 d: 11 | P = P + 11 (0x015D), A # 0 0x0153 (0x0002A6) 0x2D1C- f:00026 d: 284 | OR[284] = OR[284] + 1 0x0154 (0x0002A8) 0x1800-0x0C85 f:00014 d: 0 | A = 3205 (0x0C85) 0x0156 (0x0002AC) 0x1410- f:00012 d: 16 | A = A + 16 (0x0010) 0x0157 (0x0002AE) 0x2908- f:00024 d: 264 | OR[264] = A 0x0158 (0x0002B0) 0x211C- f:00020 d: 284 | A = OR[284] 0x0159 (0x0002B2) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x015A (0x0002B4) 0x8E0A- f:00107 d: 10 | P = P - 10 (0x0150), A # 0 0x015B (0x0002B6) 0x7A00-0x1A40 f:00075 d: 0 | P = OR[0]+6720 (0x1A40) 0x015D (0x0002BA) 0x311D- f:00030 d: 285 | A = (OR[285]) 0x015E (0x0002BC) 0x8E0B- f:00107 d: 11 | P = P - 11 (0x0153), A # 0 0x015F (0x0002BE) 0x211D- f:00020 d: 285 | A = OR[285] 0x0160 (0x0002C0) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007) 0x0161 (0x0002C2) 0x2908- f:00024 d: 264 | OR[264] = A 0x0162 (0x0002C4) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0163 (0x0002C6) 0x1A00-0x8000 f:00015 d: 0 | A = A & 32768 (0x8000) 0x0165 (0x0002CA) 0x291E- f:00024 d: 286 | OR[286] = A 0x0166 (0x0002CC) 0x211E- f:00020 d: 286 | A = OR[286] 0x0167 (0x0002CE) 0x8E14- f:00107 d: 20 | P = P - 20 (0x0153), A # 0 0x0168 (0x0002D0) 0x211D- f:00020 d: 285 | A = OR[285] 0x0169 (0x0002D2) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007) 0x016A (0x0002D4) 0x2908- f:00024 d: 264 | OR[264] = A 0x016B (0x0002D6) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x016C (0x0002D8) 0x1A00-0x4000 f:00015 d: 0 | A = A & 16384 (0x4000) 0x016E (0x0002DC) 0x291E- f:00024 d: 286 | OR[286] = A 0x016F (0x0002DE) 0x8608- f:00103 d: 8 | P = P + 8 (0x0177), A # 0 0x0170 (0x0002E0) 0x211D- f:00020 d: 285 | A = OR[285] 0x0171 (0x0002E2) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007) 0x0172 (0x0002E4) 0x2908- f:00024 d: 264 | OR[264] = A 0x0173 (0x0002E6) 0x1800-0x4000 f:00014 d: 0 | A = 16384 (0x4000) 0x0175 (0x0002EA) 0x3B08- f:00035 d: 264 | (OR[264]) = A + (OR[264]) 0x0176 (0x0002EC) 0x7223- f:00071 d: 35 | P = P - 35 (0x0153) 0x0177 (0x0002EE) 0x0400- f:00002 d: 0 | I = 0 0x0178 (0x0002F0) 0x0000- f:00000 d: 0 | PASS 0x0179 (0x0002F2) 0x211D- f:00020 d: 285 | A = OR[285] 0x017A (0x0002F4) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007) 0x017B (0x0002F6) 0x2908- f:00024 d: 264 | OR[264] = A 0x017C (0x0002F8) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x017D (0x0002FA) 0x0809- f:00004 d: 9 | A = A > 9 (0x0009) 0x017E (0x0002FC) 0x121F- f:00011 d: 31 | A = A & 31 (0x001F) 0x017F (0x0002FE) 0x291E- f:00024 d: 286 | OR[286] = A 0x0180 (0x000300) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001) 0x0181 (0x000302) 0x841A- f:00102 d: 26 | P = P + 26 (0x019B), A = 0 0x0182 (0x000304) 0x211E- f:00020 d: 286 | A = OR[286] 0x0183 (0x000306) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002) 0x0184 (0x000308) 0x8417- f:00102 d: 23 | P = P + 23 (0x019B), A = 0 0x0185 (0x00030A) 0x1800-0x0008 f:00014 d: 0 | A = 8 (0x0008) 0x0187 (0x00030E) 0x1C00-0x0CDA f:00016 d: 0 | A = A + 3290 (0x0CDA) 0x0189 (0x000312) 0x291E- f:00024 d: 286 | OR[286] = A 0x018A (0x000314) 0x311E- f:00030 d: 286 | A = (OR[286]) 0x018B (0x000316) 0x8602- f:00103 d: 2 | P = P + 2 (0x018D), A # 0 0x018C (0x000318) 0x700E- f:00070 d: 14 | P = P + 14 (0x019A) 0x018D (0x00031A) 0x211D- f:00020 d: 285 | A = OR[285] 0x018E (0x00031C) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x018F (0x00031E) 0x2908- f:00024 d: 264 | OR[264] = A 0x0190 (0x000320) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0191 (0x000322) 0x0E0E- f:00007 d: 14 | A = A << 14 (0x000E) 0x0192 (0x000324) 0x0A01- f:00005 d: 1 | A = A < 1 (0x0001) 0x0193 (0x000326) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x0194 (0x000328) 0x0C0F- f:00006 d: 15 | A = A >> 15 (0x000F) 0x0195 (0x00032A) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0196 (0x00032C) 0x211D- f:00020 d: 285 | A = OR[285] 0x0197 (0x00032E) 0x2897- f:00024 d: 151 | OR[151] = A 0x0198 (0x000330) 0x7E00-0x1947 f:00077 d: 0 | R = OR[0]+6471 (0x1947) 0x019A (0x000334) 0x7247- f:00071 d: 71 | P = P - 71 (0x0153) 0x019B (0x000336) 0x211D- f:00020 d: 285 | A = OR[285] 0x019C (0x000338) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007) 0x019D (0x00033A) 0x2908- f:00024 d: 264 | OR[264] = A 0x019E (0x00033C) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x019F (0x00033E) 0x13FF- f:00011 d: 511 | A = A & 511 (0x01FF) 0x01A0 (0x000340) 0x291F- f:00024 d: 287 | OR[287] = A 0x01A1 (0x000342) 0x1800-0x0FFF f:00014 d: 0 | A = 4095 (0x0FFF) 0x01A3 (0x000346) 0x2920- f:00024 d: 288 | OR[288] = A 0x01A4 (0x000348) 0x211F- f:00020 d: 287 | A = OR[287] 0x01A5 (0x00034A) 0x5800- f:00054 d: 0 | B = A 0x01A6 (0x00034C) 0xEC00- f:00166 d: 0 | IOB , fn006 0x01A7 (0x00034E) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x01A8 (0x000350) 0xE200- f:00161 d: 0 | IOB , fn001 0x01A9 (0x000352) 0x0600- f:00003 d: 0 | I = 1 0x01AA (0x000354) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008) 0x01AB (0x000356) 0x2F20- f:00027 d: 288 | OR[288] = OR[288] - 1 0x01AC (0x000358) 0x2120- f:00020 d: 288 | A = OR[288] 0x01AD (0x00035A) 0x8407- f:00102 d: 7 | P = P + 7 (0x01B4), A = 0 0x01AE (0x00035C) 0x0400- f:00002 d: 0 | I = 0 0x01AF (0x00035E) 0x0000- f:00000 d: 0 | PASS 0x01B0 (0x000360) 0x211F- f:00020 d: 287 | A = OR[287] 0x01B1 (0x000362) 0x5800- f:00054 d: 0 | B = A 0x01B2 (0x000364) 0x4400- f:00042 d: 0 | C = 1, IOB = DN 0x01B3 (0x000366) 0x880A- f:00104 d: 10 | P = P - 10 (0x01A9), C = 0 0x01B4 (0x000368) 0xE000- f:00160 d: 0 | IOB , fn000 0x01B5 (0x00036A) 0x0000- f:00000 d: 0 | PASS 0x01B6 (0x00036C) 0xEE00- f:00167 d: 0 | IOB , fn007 0x01B7 (0x00036E) 0x211D- f:00020 d: 285 | A = OR[285] 0x01B8 (0x000370) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007) 0x01B9 (0x000372) 0x2908- f:00024 d: 264 | OR[264] = A 0x01BA (0x000374) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01BB (0x000376) 0x1A00-0x3FFF f:00015 d: 0 | A = A & 16383 (0x3FFF) 0x01BD (0x00037A) 0x1C00-0x8000 f:00016 d: 0 | A = A + 32768 (0x8000) 0x01BF (0x00037E) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x01C0 (0x000380) 0x211D- f:00020 d: 285 | A = OR[285] 0x01C1 (0x000382) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x01C2 (0x000384) 0x2908- f:00024 d: 264 | OR[264] = A 0x01C3 (0x000386) 0x1800-0xFFFF f:00014 d: 0 | A = 65535 (0xFFFF) 0x01C5 (0x00038A) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x01C6 (0x00038C) 0x0600- f:00003 d: 0 | I = 1 0x01C7 (0x00038E) 0x7274- f:00071 d: 116 | P = P - 116 (0x0153) 0x01C8 (0x000390) 0x102D- f:00010 d: 45 | A = 45 (0x002D) 0x01C9 (0x000392) 0x2921- f:00024 d: 289 | OR[289] = A 0x01CA (0x000394) 0x1800-0x0031 f:00014 d: 0 | A = 49 (0x0031) 0x01CC (0x000398) 0x2922- f:00024 d: 290 | OR[290] = A 0x01CD (0x00039A) 0x1008- f:00010 d: 8 | A = 8 (0x0008) 0x01CE (0x00039C) 0x2923- f:00024 d: 291 | OR[291] = A 0x01CF (0x00039E) 0x1800-0xFFFF f:00014 d: 0 | A = 65535 (0xFFFF) 0x01D1 (0x0003A2) 0x2924- f:00024 d: 292 | OR[292] = A 0x01D2 (0x0003A4) 0x2118- f:00020 d: 280 | A = OR[280] 0x01D3 (0x0003A6) 0x2925- f:00024 d: 293 | OR[293] = A 0x01D4 (0x0003A8) 0x1121- f:00010 d: 289 | A = 289 (0x0121) 0x01D5 (0x0003AA) 0x5800- f:00054 d: 0 | B = A 0x01D6 (0x0003AC) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x01D7 (0x0003AE) 0x7C09- f:00076 d: 9 | R = OR[9] 0x01D8 (0x0003B0) 0x0200- f:00001 d: 0 | EXIT 0x01D9 (0x0003B2) 0x2113- f:00020 d: 275 | A = OR[275] 0x01DA (0x0003B4) 0x281D- f:00024 d: 29 | OR[29] = A 0x01DB (0x0003B6) 0x3113- f:00030 d: 275 | A = (OR[275]) 0x01DC (0x0003B8) 0x290D- f:00024 d: 269 | OR[269] = A 0x01DD (0x0003BA) 0x2113- f:00020 d: 275 | A = OR[275] 0x01DE (0x0003BC) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x01DF (0x0003BE) 0x2908- f:00024 d: 264 | OR[264] = A 0x01E0 (0x0003C0) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01E1 (0x0003C2) 0x290E- f:00024 d: 270 | OR[270] = A 0x01E2 (0x0003C4) 0x210D- f:00020 d: 269 | A = OR[269] 0x01E3 (0x0003C6) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x01E4 (0x0003C8) 0x210D- f:00020 d: 269 | A = OR[269] 0x01E5 (0x0003CA) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x01E6 (0x0003CC) 0x2908- f:00024 d: 264 | OR[264] = A 0x01E7 (0x0003CE) 0x210E- f:00020 d: 270 | A = OR[270] 0x01E8 (0x0003D0) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x01E9 (0x0003D2) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x01EA (0x0003D4) 0x3913- f:00034 d: 275 | (OR[275]) = A 0x01EB (0x0003D6) 0x2113- f:00020 d: 275 | A = OR[275] 0x01EC (0x0003D8) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x01ED (0x0003DA) 0x2908- f:00024 d: 264 | OR[264] = A 0x01EE (0x0003DC) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01EF (0x0003DE) 0x2914- f:00024 d: 276 | OR[276] = A 0x01F0 (0x0003E0) 0x0400- f:00002 d: 0 | I = 0 0x01F1 (0x0003E2) 0x0000- f:00000 d: 0 | PASS 0x01F2 (0x0003E4) 0x1027- f:00010 d: 39 | A = 39 (0x0027) 0x01F3 (0x0003E6) 0x29C3- f:00024 d: 451 | OR[451] = A 0x01F4 (0x0003E8) 0x2113- f:00020 d: 275 | A = OR[275] 0x01F5 (0x0003EA) 0x29C4- f:00024 d: 452 | OR[452] = A 0x01F6 (0x0003EC) 0x2114- f:00020 d: 276 | A = OR[276] 0x01F7 (0x0003EE) 0x29C5- f:00024 d: 453 | OR[453] = A 0x01F8 (0x0003F0) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x01F9 (0x0003F2) 0x29C6- f:00024 d: 454 | OR[454] = A 0x01FA (0x0003F4) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x01FB (0x0003F6) 0x29C7- f:00024 d: 455 | OR[455] = A 0x01FC (0x0003F8) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x01FD (0x0003FA) 0x29C8- f:00024 d: 456 | OR[456] = A 0x01FE (0x0003FC) 0x7DC2- f:00076 d: 450 | R = OR[450] 0x01FF (0x0003FE) 0x2114- f:00020 d: 276 | A = OR[276] 0x0200 (0x000400) 0x8602- f:00103 d: 2 | P = P + 2 (0x0202), A # 0 0x0201 (0x000402) 0x7003- f:00070 d: 3 | P = P + 3 (0x0204) 0x0202 (0x000404) 0x7D14- f:00076 d: 276 | R = OR[276] 0x0203 (0x000406) 0x7046- f:00070 d: 70 | P = P + 70 (0x0249) 0x0204 (0x000408) 0x2113- f:00020 d: 275 | A = OR[275] 0x0205 (0x00040A) 0x160C- f:00013 d: 12 | A = A - 12 (0x000C) 0x0206 (0x00040C) 0x2917- f:00024 d: 279 | OR[279] = A 0x0207 (0x00040E) 0x2117- f:00020 d: 279 | A = OR[279] 0x0208 (0x000410) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x0209 (0x000412) 0x2908- f:00024 d: 264 | OR[264] = A 0x020A (0x000414) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x020B (0x000416) 0x2914- f:00024 d: 276 | OR[276] = A 0x020C (0x000418) 0x2117- f:00020 d: 279 | A = OR[279] 0x020D (0x00041A) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x020E (0x00041C) 0x2908- f:00024 d: 264 | OR[264] = A 0x020F (0x00041E) 0x1800-0x0044 f:00014 d: 0 | A = 68 (0x0044) 0x0211 (0x000422) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0212 (0x000424) 0x2114- f:00020 d: 276 | A = OR[276] 0x0213 (0x000426) 0x8602- f:00103 d: 2 | P = P + 2 (0x0215), A # 0 0x0214 (0x000428) 0x7031- f:00070 d: 49 | P = P + 49 (0x0245) 0x0215 (0x00042A) 0x2114- f:00020 d: 276 | A = OR[276] 0x0216 (0x00042C) 0x2915- f:00024 d: 277 | OR[277] = A 0x0217 (0x00042E) 0x3114- f:00030 d: 276 | A = (OR[276]) 0x0218 (0x000430) 0x2916- f:00024 d: 278 | OR[278] = A 0x0219 (0x000432) 0x2117- f:00020 d: 279 | A = OR[279] 0x021A (0x000434) 0x140A- f:00012 d: 10 | A = A + 10 (0x000A) 0x021B (0x000436) 0x2908- f:00024 d: 264 | OR[264] = A 0x021C (0x000438) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x021D (0x00043A) 0x1624- f:00013 d: 36 | A = A - 36 (0x0024) 0x021E (0x00043C) 0x8602- f:00103 d: 2 | P = P + 2 (0x0220), A # 0 0x021F (0x00043E) 0x700D- f:00070 d: 13 | P = P + 13 (0x022C) 0x0220 (0x000440) 0x2116- f:00020 d: 278 | A = OR[278] 0x0221 (0x000442) 0x2717- f:00023 d: 279 | A = A - OR[279] 0x0222 (0x000444) 0x8408- f:00102 d: 8 | P = P + 8 (0x022A), A = 0 0x0223 (0x000446) 0x2116- f:00020 d: 278 | A = OR[278] 0x0224 (0x000448) 0x8406- f:00102 d: 6 | P = P + 6 (0x022A), A = 0 0x0225 (0x00044A) 0x2116- f:00020 d: 278 | A = OR[278] 0x0226 (0x00044C) 0x2914- f:00024 d: 276 | OR[276] = A 0x0227 (0x00044E) 0x3114- f:00030 d: 276 | A = (OR[276]) 0x0228 (0x000450) 0x2916- f:00024 d: 278 | OR[278] = A 0x0229 (0x000452) 0x7209- f:00071 d: 9 | P = P - 9 (0x0220) 0x022A (0x000454) 0x7420- f:00072 d: 32 | R = P + 32 (0x024A) 0x022B (0x000456) 0x701A- f:00070 d: 26 | P = P + 26 (0x0245) 0x022C (0x000458) 0x2116- f:00020 d: 278 | A = OR[278] 0x022D (0x00045A) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x022E (0x00045C) 0x2908- f:00024 d: 264 | OR[264] = A 0x022F (0x00045E) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0230 (0x000460) 0x2919- f:00024 d: 281 | OR[281] = A 0x0231 (0x000462) 0x2119- f:00020 d: 281 | A = OR[281] 0x0232 (0x000464) 0x2717- f:00023 d: 279 | A = A - OR[279] 0x0233 (0x000466) 0x840D- f:00102 d: 13 | P = P + 13 (0x0240), A = 0 0x0234 (0x000468) 0x2116- f:00020 d: 278 | A = OR[278] 0x0235 (0x00046A) 0x840B- f:00102 d: 11 | P = P + 11 (0x0240), A = 0 0x0236 (0x00046C) 0x2116- f:00020 d: 278 | A = OR[278] 0x0237 (0x00046E) 0x2914- f:00024 d: 276 | OR[276] = A 0x0238 (0x000470) 0x3114- f:00030 d: 276 | A = (OR[276]) 0x0239 (0x000472) 0x2916- f:00024 d: 278 | OR[278] = A 0x023A (0x000474) 0x2116- f:00020 d: 278 | A = OR[278] 0x023B (0x000476) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x023C (0x000478) 0x2908- f:00024 d: 264 | OR[264] = A 0x023D (0x00047A) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x023E (0x00047C) 0x2919- f:00024 d: 281 | OR[281] = A 0x023F (0x00047E) 0x720E- f:00071 d: 14 | P = P - 14 (0x0231) 0x0240 (0x000480) 0x740A- f:00072 d: 10 | R = P + 10 (0x024A) 0x0241 (0x000482) 0x2115- f:00020 d: 277 | A = OR[277] 0x0242 (0x000484) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x0243 (0x000486) 0x2908- f:00024 d: 264 | OR[264] = A 0x0244 (0x000488) 0x3F08- f:00037 d: 264 | (OR[264]) = (OR[264]) - 1 0x0245 (0x00048A) 0x2117- f:00020 d: 279 | A = OR[279] 0x0246 (0x00048C) 0x281D- f:00024 d: 29 | OR[29] = A 0x0247 (0x00048E) 0x7E00-0x1D88 f:00077 d: 0 | R = OR[0]+7560 (0x1D88) 0x0249 (0x000492) 0x0200- f:00001 d: 0 | EXIT 0x024A (0x000494) 0x2116- f:00020 d: 278 | A = OR[278] 0x024B (0x000496) 0xB434- f:00132 d: 52 | R = OR[52], A = 0 0x024C (0x000498) 0x0000- f:00000 d: 0 | PASS 0x024D (0x00049A) 0x3116- f:00030 d: 278 | A = (OR[278]) 0x024E (0x00049C) 0x3914- f:00034 d: 276 | (OR[276]) = A 0x024F (0x00049E) 0x2115- f:00020 d: 277 | A = OR[277] 0x0250 (0x0004A0) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x0251 (0x0004A2) 0x2908- f:00024 d: 264 | OR[264] = A 0x0252 (0x0004A4) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0253 (0x0004A6) 0x2716- f:00023 d: 278 | A = A - OR[278] 0x0254 (0x0004A8) 0x8603- f:00103 d: 3 | P = P + 3 (0x0257), A # 0 0x0255 (0x0004AA) 0x2114- f:00020 d: 276 | A = OR[276] 0x0256 (0x0004AC) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0257 (0x0004AE) 0x3115- f:00030 d: 277 | A = (OR[277]) 0x0258 (0x0004B0) 0x8606- f:00103 d: 6 | P = P + 6 (0x025E), A # 0 0x0259 (0x0004B2) 0x2115- f:00020 d: 277 | A = OR[277] 0x025A (0x0004B4) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x025B (0x0004B6) 0x2908- f:00024 d: 264 | OR[264] = A 0x025C (0x0004B8) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x025D (0x0004BA) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x025E (0x0004BC) 0x0200- f:00001 d: 0 | EXIT 0x025F (0x0004BE) 0x0000- f:00000 d: 0 | PASS 0x0260 (0x0004C0) 0x0000- f:00000 d: 0 | PASS 0x0261 (0x0004C2) 0x0000- f:00000 d: 0 | PASS 0x0262 (0x0004C4) 0x0000- f:00000 d: 0 | PASS 0x0263 (0x0004C6) 0x0020- f:00000 d: 32 | PASS | **** non-standard encoding with D:0x0020 **** 0x0264 (0x0004C8) 0x001D- f:00000 d: 29 | PASS | **** non-standard encoding with D:0x001D **** 0x0265 (0x0004CA) 0x0020- f:00000 d: 32 | PASS | **** non-standard encoding with D:0x0020 **** 0x0266 (0x0004CC) 0x001F- f:00000 d: 31 | PASS | **** non-standard encoding with D:0x001F **** 0x0267 (0x0004CE) 0x0020- f:00000 d: 32 | PASS | **** non-standard encoding with D:0x0020 **** 0x0268 (0x0004D0) 0x001F- f:00000 d: 31 | PASS | **** non-standard encoding with D:0x001F **** 0x0269 (0x0004D2) 0x0020- f:00000 d: 32 | PASS | **** non-standard encoding with D:0x0020 **** 0x026A (0x0004D4) 0x0020- f:00000 d: 32 | PASS | **** non-standard encoding with D:0x0020 **** 0x026B (0x0004D6) 0x001F- f:00000 d: 31 | PASS | **** non-standard encoding with D:0x001F **** 0x026C (0x0004D8) 0x0020- f:00000 d: 32 | PASS | **** non-standard encoding with D:0x0020 **** 0x026D (0x0004DA) 0x001F- f:00000 d: 31 | PASS | **** non-standard encoding with D:0x001F **** 0x026E (0x0004DC) 0x0020- f:00000 d: 32 | PASS | **** non-standard encoding with D:0x0020 **** 0x026F (0x0004DE) 0x0000- f:00000 d: 0 | PASS 0x0270 (0x0004E0) 0x0000- f:00000 d: 0 | PASS 0x0271 (0x0004E2) 0x0000- f:00000 d: 0 | PASS 0x0272 (0x0004E4) 0x0000- f:00000 d: 0 | PASS 0x0273 (0x0004E6) 0x0000- f:00000 d: 0 | PASS
80.856649
127
0.465781
1dbacca75e41af13360dcb982d5fe9c6f0df83a6
1,190
asm
Assembly
libsrc/_DEVELOPMENT/adt/b_vector/z80/asm_b_vector_read_block.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/adt/b_vector/z80/asm_b_vector_read_block.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/adt/b_vector/z80/asm_b_vector_read_block.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; =============================================================== ; Mar 2014 ; =============================================================== ; ; size_t b_vector_read_block(void *dst, size_t n, b_vector_t *v, size_t idx) ; ; Copy at most n bytes from the vector at index idx to address ; dst. Returns number of bytes actually copied, which may be ; less than n if the vector does not contain n bytes of data at ; idx. ; ; =============================================================== SECTION code_clib SECTION code_adt_b_vector PUBLIC asm_b_vector_read_block EXTERN asm_b_array_read_block defc asm_b_vector_read_block = asm_b_array_read_block ; enter : de'= void *dst ; hl = vector * ; de = n ; bc = idx ; ; exit : bc = idx ; de = n ; ; success ; ; hl = number of bytes read ; hl'= void *dst ; de'= ptr in dst to one byte after last one written ; carry reset ; ; fail if idx out of range ; ; hl = 0 ; de'= void *dst ; carry set, errno = EINVAL ; ; uses : af, bc, de, hl, bc', de', hl'
25.869565
76
0.463025
bd2c9a7e8c090397cd3edf97780794dedf04fb27
500
asm
Assembly
programs/oeis/135/A135628.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/135/A135628.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/135/A135628.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A135628: Multiples of 28. ; 0,28,56,84,112,140,168,196,224,252,280,308,336,364,392,420,448,476,504,532,560,588,616,644,672,700,728,756,784,812,840,868,896,924,952,980,1008,1036,1064,1092,1120,1148,1176,1204,1232,1260,1288,1316,1344,1372,1400,1428,1456,1484,1512,1540,1568,1596,1624,1652,1680,1708,1736,1764,1792,1820,1848,1876,1904,1932,1960,1988,2016,2044,2072,2100,2128,2156,2184,2212,2240,2268,2296,2324,2352,2380,2408,2436,2464,2492,2520,2548,2576,2604,2632,2660,2688,2716,2744,2772 mul $0,28
100
460
0.77
5600a8c25279b7919aa2eb01a63f1a7305da9fae
310,544
asm
Assembly
oslab6/obj/fs/fs.asm
jasha64/OperatingSystems-lab
25a473adb754171d5c10c6bde391e0e07a2a43de
[ "MIT" ]
null
null
null
oslab6/obj/fs/fs.asm
jasha64/OperatingSystems-lab
25a473adb754171d5c10c6bde391e0e07a2a43de
[ "MIT" ]
null
null
null
oslab6/obj/fs/fs.asm
jasha64/OperatingSystems-lab
25a473adb754171d5c10c6bde391e0e07a2a43de
[ "MIT" ]
null
null
null
obj/fs/fs: 文件格式 elf32-i386 Disassembly of section .text: 00800020 <_start>: // starts us running when we are initially loaded into a new environment. .text .globl _start _start: // See if we were started with arguments on the stack cmpl $USTACKTOP, %esp 800020: 81 fc 00 e0 bf ee cmp $0xeebfe000,%esp jne args_exist 800026: 75 04 jne 80002c <args_exist> // If not, push dummy argc/argv arguments. // This happens when we are loaded by the kernel, // because the kernel does not know about passing arguments. pushl $0 800028: 6a 00 push $0x0 pushl $0 80002a: 6a 00 push $0x0 0080002c <args_exist>: args_exist: call libmain 80002c: e8 d2 1a 00 00 call 801b03 <libmain> 1: jmp 1b 800031: eb fe jmp 800031 <args_exist+0x5> 00800033 <ide_wait_ready>: static int diskno = 1; static int ide_wait_ready(bool check_error) { 800033: 55 push %ebp 800034: 89 e5 mov %esp,%ebp 800036: 53 push %ebx 800037: 89 c1 mov %eax,%ecx static inline uint8_t inb(int port) { uint8_t data; asm volatile("inb %w1,%0" : "=a" (data) : "d" (port)); 800039: ba f7 01 00 00 mov $0x1f7,%edx 80003e: ec in (%dx),%al 80003f: 89 c3 mov %eax,%ebx int r; while (((r = inb(0x1F7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 800041: 83 e0 c0 and $0xffffffc0,%eax 800044: 3c 40 cmp $0x40,%al 800046: 75 f6 jne 80003e <ide_wait_ready+0xb> /* do nothing */; if (check_error && (r & (IDE_DF|IDE_ERR)) != 0) return -1; return 0; 800048: b8 00 00 00 00 mov $0x0,%eax if (check_error && (r & (IDE_DF|IDE_ERR)) != 0) 80004d: 84 c9 test %cl,%cl 80004f: 74 0b je 80005c <ide_wait_ready+0x29> 800051: f6 c3 21 test $0x21,%bl 800054: 0f 95 c0 setne %al 800057: 0f b6 c0 movzbl %al,%eax 80005a: f7 d8 neg %eax } 80005c: 5b pop %ebx 80005d: 5d pop %ebp 80005e: c3 ret 0080005f <ide_probe_disk1>: bool ide_probe_disk1(void) { 80005f: 55 push %ebp 800060: 89 e5 mov %esp,%ebp 800062: 53 push %ebx 800063: 83 ec 04 sub $0x4,%esp int r, x; // wait for Device 0 to be ready ide_wait_ready(0); 800066: b8 00 00 00 00 mov $0x0,%eax 80006b: e8 c3 ff ff ff call 800033 <ide_wait_ready> } static inline void outb(int port, uint8_t data) { asm volatile("outb %0,%w1" : : "a" (data), "d" (port)); 800070: b8 f0 ff ff ff mov $0xfffffff0,%eax 800075: ba f6 01 00 00 mov $0x1f6,%edx 80007a: ee out %al,(%dx) // switch to Device 1 outb(0x1F6, 0xE0 | (1<<4)); // check for Device 1 to be ready for a while for (x = 0; 80007b: b9 00 00 00 00 mov $0x0,%ecx asm volatile("inb %w1,%0" : "=a" (data) : "d" (port)); 800080: ba f7 01 00 00 mov $0x1f7,%edx 800085: ec in (%dx),%al x < 1000 && ((r = inb(0x1F7)) & (IDE_BSY|IDE_DF|IDE_ERR)) != 0; 800086: a8 a1 test $0xa1,%al 800088: 74 0b je 800095 <ide_probe_disk1+0x36> x++) 80008a: 83 c1 01 add $0x1,%ecx for (x = 0; 80008d: 81 f9 e8 03 00 00 cmp $0x3e8,%ecx 800093: 75 f0 jne 800085 <ide_probe_disk1+0x26> asm volatile("outb %0,%w1" : : "a" (data), "d" (port)); 800095: b8 e0 ff ff ff mov $0xffffffe0,%eax 80009a: ba f6 01 00 00 mov $0x1f6,%edx 80009f: ee out %al,(%dx) /* do nothing */; // switch back to Device 0 outb(0x1F6, 0xE0 | (0<<4)); cprintf("Device 1 presence: %d\n", (x < 1000)); 8000a0: 81 f9 e7 03 00 00 cmp $0x3e7,%ecx 8000a6: 0f 9e c3 setle %bl 8000a9: 83 ec 08 sub $0x8,%esp 8000ac: 0f b6 c3 movzbl %bl,%eax 8000af: 50 push %eax 8000b0: 68 40 39 80 00 push $0x803940 8000b5: e8 7c 1b 00 00 call 801c36 <cprintf> return (x < 1000); } 8000ba: 89 d8 mov %ebx,%eax 8000bc: 8b 5d fc mov -0x4(%ebp),%ebx 8000bf: c9 leave 8000c0: c3 ret 008000c1 <ide_set_disk>: void ide_set_disk(int d) { 8000c1: 55 push %ebp 8000c2: 89 e5 mov %esp,%ebp 8000c4: 83 ec 08 sub $0x8,%esp 8000c7: 8b 45 08 mov 0x8(%ebp),%eax if (d != 0 && d != 1) 8000ca: 83 f8 01 cmp $0x1,%eax 8000cd: 77 07 ja 8000d6 <ide_set_disk+0x15> panic("bad disk number"); diskno = d; 8000cf: a3 00 50 80 00 mov %eax,0x805000 } 8000d4: c9 leave 8000d5: c3 ret panic("bad disk number"); 8000d6: 83 ec 04 sub $0x4,%esp 8000d9: 68 57 39 80 00 push $0x803957 8000de: 6a 3a push $0x3a 8000e0: 68 67 39 80 00 push $0x803967 8000e5: e8 71 1a 00 00 call 801b5b <_panic> 008000ea <ide_read>: int ide_read(uint32_t secno, void *dst, size_t nsecs) { 8000ea: 55 push %ebp 8000eb: 89 e5 mov %esp,%ebp 8000ed: 57 push %edi 8000ee: 56 push %esi 8000ef: 53 push %ebx 8000f0: 83 ec 0c sub $0xc,%esp 8000f3: 8b 7d 08 mov 0x8(%ebp),%edi 8000f6: 8b 5d 0c mov 0xc(%ebp),%ebx 8000f9: 8b 75 10 mov 0x10(%ebp),%esi int r; assert(nsecs <= 256); 8000fc: 81 fe 00 01 00 00 cmp $0x100,%esi 800102: 0f 87 87 00 00 00 ja 80018f <ide_read+0xa5> ide_wait_ready(0); 800108: b8 00 00 00 00 mov $0x0,%eax 80010d: e8 21 ff ff ff call 800033 <ide_wait_ready> 800112: ba f2 01 00 00 mov $0x1f2,%edx 800117: 89 f0 mov %esi,%eax 800119: ee out %al,(%dx) 80011a: ba f3 01 00 00 mov $0x1f3,%edx 80011f: 89 f8 mov %edi,%eax 800121: ee out %al,(%dx) outb(0x1F2, nsecs); outb(0x1F3, secno & 0xFF); outb(0x1F4, (secno >> 8) & 0xFF); 800122: 89 f8 mov %edi,%eax 800124: c1 e8 08 shr $0x8,%eax 800127: ba f4 01 00 00 mov $0x1f4,%edx 80012c: ee out %al,(%dx) outb(0x1F5, (secno >> 16) & 0xFF); 80012d: 89 f8 mov %edi,%eax 80012f: c1 e8 10 shr $0x10,%eax 800132: ba f5 01 00 00 mov $0x1f5,%edx 800137: ee out %al,(%dx) outb(0x1F6, 0xE0 | ((diskno&1)<<4) | ((secno>>24)&0x0F)); 800138: 0f b6 05 00 50 80 00 movzbl 0x805000,%eax 80013f: c1 e0 04 shl $0x4,%eax 800142: 83 e0 10 and $0x10,%eax 800145: 83 c8 e0 or $0xffffffe0,%eax 800148: c1 ef 18 shr $0x18,%edi 80014b: 83 e7 0f and $0xf,%edi 80014e: 09 f8 or %edi,%eax 800150: ba f6 01 00 00 mov $0x1f6,%edx 800155: ee out %al,(%dx) 800156: b8 20 00 00 00 mov $0x20,%eax 80015b: ba f7 01 00 00 mov $0x1f7,%edx 800160: ee out %al,(%dx) 800161: c1 e6 09 shl $0x9,%esi 800164: 01 de add %ebx,%esi outb(0x1F7, 0x20); // CMD 0x20 means read sector for (; nsecs > 0; nsecs--, dst += SECTSIZE) { 800166: 39 f3 cmp %esi,%ebx 800168: 74 3b je 8001a5 <ide_read+0xbb> if ((r = ide_wait_ready(1)) < 0) 80016a: b8 01 00 00 00 mov $0x1,%eax 80016f: e8 bf fe ff ff call 800033 <ide_wait_ready> 800174: 85 c0 test %eax,%eax 800176: 78 32 js 8001aa <ide_read+0xc0> asm volatile("cld\n\trepne\n\tinsl" 800178: 89 df mov %ebx,%edi 80017a: b9 80 00 00 00 mov $0x80,%ecx 80017f: ba f0 01 00 00 mov $0x1f0,%edx 800184: fc cld 800185: f2 6d repnz insl (%dx),%es:(%edi) for (; nsecs > 0; nsecs--, dst += SECTSIZE) { 800187: 81 c3 00 02 00 00 add $0x200,%ebx 80018d: eb d7 jmp 800166 <ide_read+0x7c> assert(nsecs <= 256); 80018f: 68 70 39 80 00 push $0x803970 800194: 68 7d 39 80 00 push $0x80397d 800199: 6a 44 push $0x44 80019b: 68 67 39 80 00 push $0x803967 8001a0: e8 b6 19 00 00 call 801b5b <_panic> return r; insl(0x1F0, dst, SECTSIZE/4); } return 0; 8001a5: b8 00 00 00 00 mov $0x0,%eax } 8001aa: 8d 65 f4 lea -0xc(%ebp),%esp 8001ad: 5b pop %ebx 8001ae: 5e pop %esi 8001af: 5f pop %edi 8001b0: 5d pop %ebp 8001b1: c3 ret 008001b2 <ide_write>: int ide_write(uint32_t secno, const void *src, size_t nsecs) { 8001b2: 55 push %ebp 8001b3: 89 e5 mov %esp,%ebp 8001b5: 57 push %edi 8001b6: 56 push %esi 8001b7: 53 push %ebx 8001b8: 83 ec 0c sub $0xc,%esp 8001bb: 8b 75 08 mov 0x8(%ebp),%esi 8001be: 8b 5d 0c mov 0xc(%ebp),%ebx 8001c1: 8b 7d 10 mov 0x10(%ebp),%edi int r; assert(nsecs <= 256); 8001c4: 81 ff 00 01 00 00 cmp $0x100,%edi 8001ca: 0f 87 87 00 00 00 ja 800257 <ide_write+0xa5> ide_wait_ready(0); 8001d0: b8 00 00 00 00 mov $0x0,%eax 8001d5: e8 59 fe ff ff call 800033 <ide_wait_ready> asm volatile("outb %0,%w1" : : "a" (data), "d" (port)); 8001da: ba f2 01 00 00 mov $0x1f2,%edx 8001df: 89 f8 mov %edi,%eax 8001e1: ee out %al,(%dx) 8001e2: ba f3 01 00 00 mov $0x1f3,%edx 8001e7: 89 f0 mov %esi,%eax 8001e9: ee out %al,(%dx) outb(0x1F2, nsecs); outb(0x1F3, secno & 0xFF); outb(0x1F4, (secno >> 8) & 0xFF); 8001ea: 89 f0 mov %esi,%eax 8001ec: c1 e8 08 shr $0x8,%eax 8001ef: ba f4 01 00 00 mov $0x1f4,%edx 8001f4: ee out %al,(%dx) outb(0x1F5, (secno >> 16) & 0xFF); 8001f5: 89 f0 mov %esi,%eax 8001f7: c1 e8 10 shr $0x10,%eax 8001fa: ba f5 01 00 00 mov $0x1f5,%edx 8001ff: ee out %al,(%dx) outb(0x1F6, 0xE0 | ((diskno&1)<<4) | ((secno>>24)&0x0F)); 800200: 0f b6 05 00 50 80 00 movzbl 0x805000,%eax 800207: c1 e0 04 shl $0x4,%eax 80020a: 83 e0 10 and $0x10,%eax 80020d: 83 c8 e0 or $0xffffffe0,%eax 800210: c1 ee 18 shr $0x18,%esi 800213: 83 e6 0f and $0xf,%esi 800216: 09 f0 or %esi,%eax 800218: ba f6 01 00 00 mov $0x1f6,%edx 80021d: ee out %al,(%dx) 80021e: b8 30 00 00 00 mov $0x30,%eax 800223: ba f7 01 00 00 mov $0x1f7,%edx 800228: ee out %al,(%dx) 800229: c1 e7 09 shl $0x9,%edi 80022c: 01 df add %ebx,%edi outb(0x1F7, 0x30); // CMD 0x30 means write sector for (; nsecs > 0; nsecs--, src += SECTSIZE) { 80022e: 39 fb cmp %edi,%ebx 800230: 74 3b je 80026d <ide_write+0xbb> if ((r = ide_wait_ready(1)) < 0) 800232: b8 01 00 00 00 mov $0x1,%eax 800237: e8 f7 fd ff ff call 800033 <ide_wait_ready> 80023c: 85 c0 test %eax,%eax 80023e: 78 32 js 800272 <ide_write+0xc0> } static inline void outsl(int port, const void *addr, int cnt) { asm volatile("cld\n\trepne\n\toutsl" 800240: 89 de mov %ebx,%esi 800242: b9 80 00 00 00 mov $0x80,%ecx 800247: ba f0 01 00 00 mov $0x1f0,%edx 80024c: fc cld 80024d: f2 6f repnz outsl %ds:(%esi),(%dx) for (; nsecs > 0; nsecs--, src += SECTSIZE) { 80024f: 81 c3 00 02 00 00 add $0x200,%ebx 800255: eb d7 jmp 80022e <ide_write+0x7c> assert(nsecs <= 256); 800257: 68 70 39 80 00 push $0x803970 80025c: 68 7d 39 80 00 push $0x80397d 800261: 6a 5d push $0x5d 800263: 68 67 39 80 00 push $0x803967 800268: e8 ee 18 00 00 call 801b5b <_panic> return r; outsl(0x1F0, src, SECTSIZE/4); } return 0; 80026d: b8 00 00 00 00 mov $0x0,%eax } 800272: 8d 65 f4 lea -0xc(%ebp),%esp 800275: 5b pop %ebx 800276: 5e pop %esi 800277: 5f pop %edi 800278: 5d pop %ebp 800279: c3 ret 0080027a <bc_pgfault>: // Fault any disk block that is read in to memory by // loading it from disk. static void bc_pgfault(struct UTrapframe *utf) { 80027a: 55 push %ebp 80027b: 89 e5 mov %esp,%ebp 80027d: 56 push %esi 80027e: 53 push %ebx 80027f: 8b 55 08 mov 0x8(%ebp),%edx void *addr = (void *) utf->utf_fault_va; 800282: 8b 1a mov (%edx),%ebx uint32_t blockno = ((uint32_t)addr - DISKMAP) / BLKSIZE; 800284: 8d 83 00 00 00 f0 lea -0x10000000(%ebx),%eax 80028a: 89 c6 mov %eax,%esi 80028c: c1 ee 0c shr $0xc,%esi int r; // Check that the fault was within the block cache region if (addr < (void*)DISKMAP || addr >= (void*)(DISKMAP + DISKSIZE)) 80028f: 3d ff ff ff bf cmp $0xbfffffff,%eax 800294: 0f 87 95 00 00 00 ja 80032f <bc_pgfault+0xb5> panic("page fault in FS: eip %08x, va %08x, err %04x", utf->utf_eip, addr, utf->utf_err); // Sanity check the block number. if (super && blockno >= super->s_nblocks) 80029a: a1 08 a0 80 00 mov 0x80a008,%eax 80029f: 85 c0 test %eax,%eax 8002a1: 74 09 je 8002ac <bc_pgfault+0x32> 8002a3: 39 70 04 cmp %esi,0x4(%eax) 8002a6: 0f 86 9e 00 00 00 jbe 80034a <bc_pgfault+0xd0> // of the block from the disk into that page. // Hint: first round addr to page boundary. fs/ide.c has code to read // the disk. // // LAB 5: you code here: addr = ROUNDDOWN(addr, PGSIZE); 8002ac: 81 e3 00 f0 ff ff and $0xfffff000,%ebx if ((r = sys_page_alloc(0, addr, PTE_W | PTE_P | PTE_U)) < 0) 8002b2: 83 ec 04 sub $0x4,%esp 8002b5: 6a 07 push $0x7 8002b7: 53 push %ebx 8002b8: 6a 00 push $0x0 8002ba: e8 8f 23 00 00 call 80264e <sys_page_alloc> 8002bf: 83 c4 10 add $0x10,%esp 8002c2: 85 c0 test %eax,%eax 8002c4: 0f 88 92 00 00 00 js 80035c <bc_pgfault+0xe2> panic("page alloc failed: %e, va %08x", r, addr); if ((r = ide_read(blockno * BLKSECTS, addr, BLKSECTS)) < 0) 8002ca: 83 ec 04 sub $0x4,%esp 8002cd: 6a 08 push $0x8 8002cf: 53 push %ebx 8002d0: 8d 04 f5 00 00 00 00 lea 0x0(,%esi,8),%eax 8002d7: 50 push %eax 8002d8: e8 0d fe ff ff call 8000ea <ide_read> 8002dd: 83 c4 10 add $0x10,%esp 8002e0: 85 c0 test %eax,%eax 8002e2: 0f 88 8a 00 00 00 js 800372 <bc_pgfault+0xf8> panic("ide read failed: %e, va %08x", r, addr); // Clear the dirty bit for the disk block page since we just read the // block from disk if ((r = sys_page_map(0, addr, 0, addr, uvpt[PGNUM(addr)] & PTE_SYSCALL)) < 0) 8002e8: 89 d8 mov %ebx,%eax 8002ea: c1 e8 0c shr $0xc,%eax 8002ed: 8b 04 85 00 00 40 ef mov -0x10c00000(,%eax,4),%eax 8002f4: 83 ec 0c sub $0xc,%esp 8002f7: 25 07 0e 00 00 and $0xe07,%eax 8002fc: 50 push %eax 8002fd: 53 push %ebx 8002fe: 6a 00 push $0x0 800300: 53 push %ebx 800301: 6a 00 push $0x0 800303: e8 89 23 00 00 call 802691 <sys_page_map> 800308: 83 c4 20 add $0x20,%esp 80030b: 85 c0 test %eax,%eax 80030d: 78 79 js 800388 <bc_pgfault+0x10e> panic("in bc_pgfault, sys_page_map: %e", r); // Check that the block we read was allocated. (exercise for // the reader: why do we do this *after* reading the block // in?) if (bitmap && block_is_free(blockno)) 80030f: 83 3d 04 a0 80 00 00 cmpl $0x0,0x80a004 800316: 74 10 je 800328 <bc_pgfault+0xae> 800318: 83 ec 0c sub $0xc,%esp 80031b: 56 push %esi 80031c: e8 19 05 00 00 call 80083a <block_is_free> 800321: 83 c4 10 add $0x10,%esp 800324: 84 c0 test %al,%al 800326: 75 72 jne 80039a <bc_pgfault+0x120> panic("reading free block %08x\n", blockno); } 800328: 8d 65 f8 lea -0x8(%ebp),%esp 80032b: 5b pop %ebx 80032c: 5e pop %esi 80032d: 5d pop %ebp 80032e: c3 ret panic("page fault in FS: eip %08x, va %08x, err %04x", 80032f: 83 ec 08 sub $0x8,%esp 800332: ff 72 04 pushl 0x4(%edx) 800335: 53 push %ebx 800336: ff 72 28 pushl 0x28(%edx) 800339: 68 94 39 80 00 push $0x803994 80033e: 6a 27 push $0x27 800340: 68 94 3a 80 00 push $0x803a94 800345: e8 11 18 00 00 call 801b5b <_panic> panic("reading non-existent block %08x\n", blockno); 80034a: 56 push %esi 80034b: 68 c4 39 80 00 push $0x8039c4 800350: 6a 2b push $0x2b 800352: 68 94 3a 80 00 push $0x803a94 800357: e8 ff 17 00 00 call 801b5b <_panic> panic("page alloc failed: %e, va %08x", r, addr); 80035c: 83 ec 0c sub $0xc,%esp 80035f: 53 push %ebx 800360: 50 push %eax 800361: 68 e8 39 80 00 push $0x8039e8 800366: 6a 35 push $0x35 800368: 68 94 3a 80 00 push $0x803a94 80036d: e8 e9 17 00 00 call 801b5b <_panic> panic("ide read failed: %e, va %08x", r, addr); 800372: 83 ec 0c sub $0xc,%esp 800375: 53 push %ebx 800376: 50 push %eax 800377: 68 9c 3a 80 00 push $0x803a9c 80037c: 6a 37 push $0x37 80037e: 68 94 3a 80 00 push $0x803a94 800383: e8 d3 17 00 00 call 801b5b <_panic> panic("in bc_pgfault, sys_page_map: %e", r); 800388: 50 push %eax 800389: 68 08 3a 80 00 push $0x803a08 80038e: 6a 3c push $0x3c 800390: 68 94 3a 80 00 push $0x803a94 800395: e8 c1 17 00 00 call 801b5b <_panic> panic("reading free block %08x\n", blockno); 80039a: 56 push %esi 80039b: 68 b9 3a 80 00 push $0x803ab9 8003a0: 6a 42 push $0x42 8003a2: 68 94 3a 80 00 push $0x803a94 8003a7: e8 af 17 00 00 call 801b5b <_panic> 008003ac <diskaddr>: { 8003ac: 55 push %ebp 8003ad: 89 e5 mov %esp,%ebp 8003af: 83 ec 08 sub $0x8,%esp 8003b2: 8b 45 08 mov 0x8(%ebp),%eax if (blockno == 0 || (super && blockno >= super->s_nblocks)) 8003b5: 85 c0 test %eax,%eax 8003b7: 74 19 je 8003d2 <diskaddr+0x26> 8003b9: 8b 15 08 a0 80 00 mov 0x80a008,%edx 8003bf: 85 d2 test %edx,%edx 8003c1: 74 05 je 8003c8 <diskaddr+0x1c> 8003c3: 39 42 04 cmp %eax,0x4(%edx) 8003c6: 76 0a jbe 8003d2 <diskaddr+0x26> return (char*) (DISKMAP + blockno * BLKSIZE); 8003c8: 05 00 00 01 00 add $0x10000,%eax 8003cd: c1 e0 0c shl $0xc,%eax } 8003d0: c9 leave 8003d1: c3 ret panic("bad block number %08x in diskaddr", blockno); 8003d2: 50 push %eax 8003d3: 68 28 3a 80 00 push $0x803a28 8003d8: 6a 09 push $0x9 8003da: 68 94 3a 80 00 push $0x803a94 8003df: e8 77 17 00 00 call 801b5b <_panic> 008003e4 <va_is_mapped>: { 8003e4: 55 push %ebp 8003e5: 89 e5 mov %esp,%ebp 8003e7: 8b 55 08 mov 0x8(%ebp),%edx return (uvpd[PDX(va)] & PTE_P) && (uvpt[PGNUM(va)] & PTE_P); 8003ea: 89 d0 mov %edx,%eax 8003ec: c1 e8 16 shr $0x16,%eax 8003ef: 8b 0c 85 00 d0 7b ef mov -0x10843000(,%eax,4),%ecx 8003f6: b8 00 00 00 00 mov $0x0,%eax 8003fb: f6 c1 01 test $0x1,%cl 8003fe: 74 0d je 80040d <va_is_mapped+0x29> 800400: c1 ea 0c shr $0xc,%edx 800403: 8b 04 95 00 00 40 ef mov -0x10c00000(,%edx,4),%eax 80040a: 83 e0 01 and $0x1,%eax 80040d: 83 e0 01 and $0x1,%eax } 800410: 5d pop %ebp 800411: c3 ret 00800412 <va_is_dirty>: { 800412: 55 push %ebp 800413: 89 e5 mov %esp,%ebp return (uvpt[PGNUM(va)] & PTE_D) != 0; 800415: 8b 45 08 mov 0x8(%ebp),%eax 800418: c1 e8 0c shr $0xc,%eax 80041b: 8b 04 85 00 00 40 ef mov -0x10c00000(,%eax,4),%eax 800422: c1 e8 06 shr $0x6,%eax 800425: 83 e0 01 and $0x1,%eax } 800428: 5d pop %ebp 800429: c3 ret 0080042a <flush_block>: // Hint: Use va_is_mapped, va_is_dirty, and ide_write. // Hint: Use the PTE_SYSCALL constant when calling sys_page_map. // Hint: Don't forget to round addr down. void flush_block(void *addr) { 80042a: 55 push %ebp 80042b: 89 e5 mov %esp,%ebp 80042d: 56 push %esi 80042e: 53 push %ebx 80042f: 8b 5d 08 mov 0x8(%ebp),%ebx uint32_t blockno = ((uint32_t)addr - DISKMAP) / BLKSIZE; if (addr < (void*)DISKMAP || addr >= (void*)(DISKMAP + DISKSIZE)) 800432: 8d 83 00 00 00 f0 lea -0x10000000(%ebx),%eax 800438: 3d ff ff ff bf cmp $0xbfffffff,%eax 80043d: 77 1f ja 80045e <flush_block+0x34> panic("flush_block of bad va %08x", addr); // LAB 5: Your code here. int r; addr = ROUNDDOWN(addr, PGSIZE); 80043f: 89 de mov %ebx,%esi 800441: 81 e6 00 f0 ff ff and $0xfffff000,%esi if (!va_is_mapped(addr) || !va_is_dirty(addr)) return; 800447: 83 ec 0c sub $0xc,%esp 80044a: 56 push %esi 80044b: e8 94 ff ff ff call 8003e4 <va_is_mapped> 800450: 83 c4 10 add $0x10,%esp 800453: 84 c0 test %al,%al 800455: 75 19 jne 800470 <flush_block+0x46> if ((r = ide_write(blockno * BLKSECTS, addr, BLKSECTS)) < 0) panic("ide write failed: %e, va %08x", r, addr); if ((r = sys_page_map(0, addr, 0, addr, uvpt[PGNUM(addr)] & PTE_SYSCALL)) < 0) panic("in flush_block, sys_page_map: %e", r); } 800457: 8d 65 f8 lea -0x8(%ebp),%esp 80045a: 5b pop %ebx 80045b: 5e pop %esi 80045c: 5d pop %ebp 80045d: c3 ret panic("flush_block of bad va %08x", addr); 80045e: 53 push %ebx 80045f: 68 d2 3a 80 00 push $0x803ad2 800464: 6a 52 push $0x52 800466: 68 94 3a 80 00 push $0x803a94 80046b: e8 eb 16 00 00 call 801b5b <_panic> if (!va_is_mapped(addr) || !va_is_dirty(addr)) return; 800470: 83 ec 0c sub $0xc,%esp 800473: 56 push %esi 800474: e8 99 ff ff ff call 800412 <va_is_dirty> 800479: 83 c4 10 add $0x10,%esp 80047c: 84 c0 test %al,%al 80047e: 74 d7 je 800457 <flush_block+0x2d> if ((r = ide_write(blockno * BLKSECTS, addr, BLKSECTS)) < 0) 800480: 83 ec 04 sub $0x4,%esp 800483: 6a 08 push $0x8 800485: 56 push %esi uint32_t blockno = ((uint32_t)addr - DISKMAP) / BLKSIZE; 800486: 81 eb 00 00 00 10 sub $0x10000000,%ebx 80048c: c1 eb 0c shr $0xc,%ebx if ((r = ide_write(blockno * BLKSECTS, addr, BLKSECTS)) < 0) 80048f: c1 e3 03 shl $0x3,%ebx 800492: 53 push %ebx 800493: e8 1a fd ff ff call 8001b2 <ide_write> 800498: 83 c4 10 add $0x10,%esp 80049b: 85 c0 test %eax,%eax 80049d: 78 39 js 8004d8 <flush_block+0xae> if ((r = sys_page_map(0, addr, 0, addr, uvpt[PGNUM(addr)] & PTE_SYSCALL)) < 0) 80049f: 89 f0 mov %esi,%eax 8004a1: c1 e8 0c shr $0xc,%eax 8004a4: 8b 04 85 00 00 40 ef mov -0x10c00000(,%eax,4),%eax 8004ab: 83 ec 0c sub $0xc,%esp 8004ae: 25 07 0e 00 00 and $0xe07,%eax 8004b3: 50 push %eax 8004b4: 56 push %esi 8004b5: 6a 00 push $0x0 8004b7: 56 push %esi 8004b8: 6a 00 push $0x0 8004ba: e8 d2 21 00 00 call 802691 <sys_page_map> 8004bf: 83 c4 20 add $0x20,%esp 8004c2: 85 c0 test %eax,%eax 8004c4: 79 91 jns 800457 <flush_block+0x2d> panic("in flush_block, sys_page_map: %e", r); 8004c6: 50 push %eax 8004c7: 68 4c 3a 80 00 push $0x803a4c 8004cc: 6a 5c push $0x5c 8004ce: 68 94 3a 80 00 push $0x803a94 8004d3: e8 83 16 00 00 call 801b5b <_panic> panic("ide write failed: %e, va %08x", r, addr); 8004d8: 83 ec 0c sub $0xc,%esp 8004db: 56 push %esi 8004dc: 50 push %eax 8004dd: 68 ed 3a 80 00 push $0x803aed 8004e2: 6a 5a push $0x5a 8004e4: 68 94 3a 80 00 push $0x803a94 8004e9: e8 6d 16 00 00 call 801b5b <_panic> 008004ee <bc_init>: cprintf("block cache is good\n"); } void bc_init(void) { 8004ee: 55 push %ebp 8004ef: 89 e5 mov %esp,%ebp 8004f1: 53 push %ebx 8004f2: 81 ec 20 02 00 00 sub $0x220,%esp struct Super super; set_pgfault_handler(bc_pgfault); 8004f8: 68 7a 02 80 00 push $0x80027a 8004fd: e8 3d 23 00 00 call 80283f <set_pgfault_handler> memmove(&backup, diskaddr(1), sizeof backup); 800502: c7 04 24 01 00 00 00 movl $0x1,(%esp) 800509: e8 9e fe ff ff call 8003ac <diskaddr> 80050e: 83 c4 0c add $0xc,%esp 800511: 68 08 01 00 00 push $0x108 800516: 50 push %eax 800517: 8d 85 e8 fd ff ff lea -0x218(%ebp),%eax 80051d: 50 push %eax 80051e: e8 c0 1e 00 00 call 8023e3 <memmove> strcpy(diskaddr(1), "OOPS!\n"); 800523: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80052a: e8 7d fe ff ff call 8003ac <diskaddr> 80052f: 83 c4 08 add $0x8,%esp 800532: 68 0b 3b 80 00 push $0x803b0b 800537: 50 push %eax 800538: e8 18 1d 00 00 call 802255 <strcpy> flush_block(diskaddr(1)); 80053d: c7 04 24 01 00 00 00 movl $0x1,(%esp) 800544: e8 63 fe ff ff call 8003ac <diskaddr> 800549: 89 04 24 mov %eax,(%esp) 80054c: e8 d9 fe ff ff call 80042a <flush_block> assert(va_is_mapped(diskaddr(1))); 800551: c7 04 24 01 00 00 00 movl $0x1,(%esp) 800558: e8 4f fe ff ff call 8003ac <diskaddr> 80055d: 89 04 24 mov %eax,(%esp) 800560: e8 7f fe ff ff call 8003e4 <va_is_mapped> 800565: 83 c4 10 add $0x10,%esp 800568: 84 c0 test %al,%al 80056a: 0f 84 d1 01 00 00 je 800741 <bc_init+0x253> assert(!va_is_dirty(diskaddr(1))); 800570: 83 ec 0c sub $0xc,%esp 800573: 6a 01 push $0x1 800575: e8 32 fe ff ff call 8003ac <diskaddr> 80057a: 89 04 24 mov %eax,(%esp) 80057d: e8 90 fe ff ff call 800412 <va_is_dirty> 800582: 83 c4 10 add $0x10,%esp 800585: 84 c0 test %al,%al 800587: 0f 85 ca 01 00 00 jne 800757 <bc_init+0x269> sys_page_unmap(0, diskaddr(1)); 80058d: 83 ec 0c sub $0xc,%esp 800590: 6a 01 push $0x1 800592: e8 15 fe ff ff call 8003ac <diskaddr> 800597: 83 c4 08 add $0x8,%esp 80059a: 50 push %eax 80059b: 6a 00 push $0x0 80059d: e8 31 21 00 00 call 8026d3 <sys_page_unmap> assert(!va_is_mapped(diskaddr(1))); 8005a2: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8005a9: e8 fe fd ff ff call 8003ac <diskaddr> 8005ae: 89 04 24 mov %eax,(%esp) 8005b1: e8 2e fe ff ff call 8003e4 <va_is_mapped> 8005b6: 83 c4 10 add $0x10,%esp 8005b9: 84 c0 test %al,%al 8005bb: 0f 85 ac 01 00 00 jne 80076d <bc_init+0x27f> assert(strcmp(diskaddr(1), "OOPS!\n") == 0); 8005c1: 83 ec 0c sub $0xc,%esp 8005c4: 6a 01 push $0x1 8005c6: e8 e1 fd ff ff call 8003ac <diskaddr> 8005cb: 83 c4 08 add $0x8,%esp 8005ce: 68 0b 3b 80 00 push $0x803b0b 8005d3: 50 push %eax 8005d4: e8 22 1d 00 00 call 8022fb <strcmp> 8005d9: 83 c4 10 add $0x10,%esp 8005dc: 85 c0 test %eax,%eax 8005de: 0f 85 9f 01 00 00 jne 800783 <bc_init+0x295> memmove(diskaddr(1), &backup, sizeof backup); 8005e4: 83 ec 0c sub $0xc,%esp 8005e7: 6a 01 push $0x1 8005e9: e8 be fd ff ff call 8003ac <diskaddr> 8005ee: 83 c4 0c add $0xc,%esp 8005f1: 68 08 01 00 00 push $0x108 8005f6: 8d 9d e8 fd ff ff lea -0x218(%ebp),%ebx 8005fc: 53 push %ebx 8005fd: 50 push %eax 8005fe: e8 e0 1d 00 00 call 8023e3 <memmove> flush_block(diskaddr(1)); 800603: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80060a: e8 9d fd ff ff call 8003ac <diskaddr> 80060f: 89 04 24 mov %eax,(%esp) 800612: e8 13 fe ff ff call 80042a <flush_block> memmove(&backup, diskaddr(1), sizeof backup); 800617: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80061e: e8 89 fd ff ff call 8003ac <diskaddr> 800623: 83 c4 0c add $0xc,%esp 800626: 68 08 01 00 00 push $0x108 80062b: 50 push %eax 80062c: 53 push %ebx 80062d: e8 b1 1d 00 00 call 8023e3 <memmove> strcpy(diskaddr(1), "OOPS!\n"); 800632: c7 04 24 01 00 00 00 movl $0x1,(%esp) 800639: e8 6e fd ff ff call 8003ac <diskaddr> 80063e: 83 c4 08 add $0x8,%esp 800641: 68 0b 3b 80 00 push $0x803b0b 800646: 50 push %eax 800647: e8 09 1c 00 00 call 802255 <strcpy> flush_block(diskaddr(1) + 20); 80064c: c7 04 24 01 00 00 00 movl $0x1,(%esp) 800653: e8 54 fd ff ff call 8003ac <diskaddr> 800658: 83 c0 14 add $0x14,%eax 80065b: 89 04 24 mov %eax,(%esp) 80065e: e8 c7 fd ff ff call 80042a <flush_block> assert(va_is_mapped(diskaddr(1))); 800663: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80066a: e8 3d fd ff ff call 8003ac <diskaddr> 80066f: 89 04 24 mov %eax,(%esp) 800672: e8 6d fd ff ff call 8003e4 <va_is_mapped> 800677: 83 c4 10 add $0x10,%esp 80067a: 84 c0 test %al,%al 80067c: 0f 84 17 01 00 00 je 800799 <bc_init+0x2ab> sys_page_unmap(0, diskaddr(1)); 800682: 83 ec 0c sub $0xc,%esp 800685: 6a 01 push $0x1 800687: e8 20 fd ff ff call 8003ac <diskaddr> 80068c: 83 c4 08 add $0x8,%esp 80068f: 50 push %eax 800690: 6a 00 push $0x0 800692: e8 3c 20 00 00 call 8026d3 <sys_page_unmap> assert(!va_is_mapped(diskaddr(1))); 800697: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80069e: e8 09 fd ff ff call 8003ac <diskaddr> 8006a3: 89 04 24 mov %eax,(%esp) 8006a6: e8 39 fd ff ff call 8003e4 <va_is_mapped> 8006ab: 83 c4 10 add $0x10,%esp 8006ae: 84 c0 test %al,%al 8006b0: 0f 85 fc 00 00 00 jne 8007b2 <bc_init+0x2c4> assert(strcmp(diskaddr(1), "OOPS!\n") == 0); 8006b6: 83 ec 0c sub $0xc,%esp 8006b9: 6a 01 push $0x1 8006bb: e8 ec fc ff ff call 8003ac <diskaddr> 8006c0: 83 c4 08 add $0x8,%esp 8006c3: 68 0b 3b 80 00 push $0x803b0b 8006c8: 50 push %eax 8006c9: e8 2d 1c 00 00 call 8022fb <strcmp> 8006ce: 83 c4 10 add $0x10,%esp 8006d1: 85 c0 test %eax,%eax 8006d3: 0f 85 f2 00 00 00 jne 8007cb <bc_init+0x2dd> memmove(diskaddr(1), &backup, sizeof backup); 8006d9: 83 ec 0c sub $0xc,%esp 8006dc: 6a 01 push $0x1 8006de: e8 c9 fc ff ff call 8003ac <diskaddr> 8006e3: 83 c4 0c add $0xc,%esp 8006e6: 68 08 01 00 00 push $0x108 8006eb: 8d 95 e8 fd ff ff lea -0x218(%ebp),%edx 8006f1: 52 push %edx 8006f2: 50 push %eax 8006f3: e8 eb 1c 00 00 call 8023e3 <memmove> flush_block(diskaddr(1)); 8006f8: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8006ff: e8 a8 fc ff ff call 8003ac <diskaddr> 800704: 89 04 24 mov %eax,(%esp) 800707: e8 1e fd ff ff call 80042a <flush_block> cprintf("block cache is good\n"); 80070c: c7 04 24 47 3b 80 00 movl $0x803b47,(%esp) 800713: e8 1e 15 00 00 call 801c36 <cprintf> check_bc(); // cache the super block by reading it once memmove(&super, diskaddr(1), sizeof super); 800718: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80071f: e8 88 fc ff ff call 8003ac <diskaddr> 800724: 83 c4 0c add $0xc,%esp 800727: 68 08 01 00 00 push $0x108 80072c: 50 push %eax 80072d: 8d 85 f0 fe ff ff lea -0x110(%ebp),%eax 800733: 50 push %eax 800734: e8 aa 1c 00 00 call 8023e3 <memmove> } 800739: 83 c4 10 add $0x10,%esp 80073c: 8b 5d fc mov -0x4(%ebp),%ebx 80073f: c9 leave 800740: c3 ret assert(va_is_mapped(diskaddr(1))); 800741: 68 2d 3b 80 00 push $0x803b2d 800746: 68 7d 39 80 00 push $0x80397d 80074b: 6a 6c push $0x6c 80074d: 68 94 3a 80 00 push $0x803a94 800752: e8 04 14 00 00 call 801b5b <_panic> assert(!va_is_dirty(diskaddr(1))); 800757: 68 12 3b 80 00 push $0x803b12 80075c: 68 7d 39 80 00 push $0x80397d 800761: 6a 6d push $0x6d 800763: 68 94 3a 80 00 push $0x803a94 800768: e8 ee 13 00 00 call 801b5b <_panic> assert(!va_is_mapped(diskaddr(1))); 80076d: 68 2c 3b 80 00 push $0x803b2c 800772: 68 7d 39 80 00 push $0x80397d 800777: 6a 71 push $0x71 800779: 68 94 3a 80 00 push $0x803a94 80077e: e8 d8 13 00 00 call 801b5b <_panic> assert(strcmp(diskaddr(1), "OOPS!\n") == 0); 800783: 68 70 3a 80 00 push $0x803a70 800788: 68 7d 39 80 00 push $0x80397d 80078d: 6a 74 push $0x74 80078f: 68 94 3a 80 00 push $0x803a94 800794: e8 c2 13 00 00 call 801b5b <_panic> assert(va_is_mapped(diskaddr(1))); 800799: 68 2d 3b 80 00 push $0x803b2d 80079e: 68 7d 39 80 00 push $0x80397d 8007a3: 68 85 00 00 00 push $0x85 8007a8: 68 94 3a 80 00 push $0x803a94 8007ad: e8 a9 13 00 00 call 801b5b <_panic> assert(!va_is_mapped(diskaddr(1))); 8007b2: 68 2c 3b 80 00 push $0x803b2c 8007b7: 68 7d 39 80 00 push $0x80397d 8007bc: 68 8d 00 00 00 push $0x8d 8007c1: 68 94 3a 80 00 push $0x803a94 8007c6: e8 90 13 00 00 call 801b5b <_panic> assert(strcmp(diskaddr(1), "OOPS!\n") == 0); 8007cb: 68 70 3a 80 00 push $0x803a70 8007d0: 68 7d 39 80 00 push $0x80397d 8007d5: 68 90 00 00 00 push $0x90 8007da: 68 94 3a 80 00 push $0x803a94 8007df: e8 77 13 00 00 call 801b5b <_panic> 008007e4 <check_super>: // -------------------------------------------------------------- // Validate the file system super-block. void check_super(void) { 8007e4: 55 push %ebp 8007e5: 89 e5 mov %esp,%ebp 8007e7: 83 ec 08 sub $0x8,%esp if (super->s_magic != FS_MAGIC) 8007ea: a1 08 a0 80 00 mov 0x80a008,%eax 8007ef: 81 38 ae 30 05 4a cmpl $0x4a0530ae,(%eax) 8007f5: 75 1b jne 800812 <check_super+0x2e> panic("bad file system magic number"); if (super->s_nblocks > DISKSIZE/BLKSIZE) 8007f7: 81 78 04 00 00 0c 00 cmpl $0xc0000,0x4(%eax) 8007fe: 77 26 ja 800826 <check_super+0x42> panic("file system is too large"); cprintf("superblock is good\n"); 800800: 83 ec 0c sub $0xc,%esp 800803: 68 9a 3b 80 00 push $0x803b9a 800808: e8 29 14 00 00 call 801c36 <cprintf> } 80080d: 83 c4 10 add $0x10,%esp 800810: c9 leave 800811: c3 ret panic("bad file system magic number"); 800812: 83 ec 04 sub $0x4,%esp 800815: 68 5c 3b 80 00 push $0x803b5c 80081a: 6a 0f push $0xf 80081c: 68 79 3b 80 00 push $0x803b79 800821: e8 35 13 00 00 call 801b5b <_panic> panic("file system is too large"); 800826: 83 ec 04 sub $0x4,%esp 800829: 68 81 3b 80 00 push $0x803b81 80082e: 6a 12 push $0x12 800830: 68 79 3b 80 00 push $0x803b79 800835: e8 21 13 00 00 call 801b5b <_panic> 0080083a <block_is_free>: // Check to see if the block bitmap indicates that block 'blockno' is free. // Return 1 if the block is free, 0 if not. bool block_is_free(uint32_t blockno) { 80083a: 55 push %ebp 80083b: 89 e5 mov %esp,%ebp 80083d: 53 push %ebx 80083e: 8b 4d 08 mov 0x8(%ebp),%ecx if (super == 0 || blockno >= super->s_nblocks) 800841: 8b 15 08 a0 80 00 mov 0x80a008,%edx return 0; 800847: b8 00 00 00 00 mov $0x0,%eax if (super == 0 || blockno >= super->s_nblocks) 80084c: 85 d2 test %edx,%edx 80084e: 74 1d je 80086d <block_is_free+0x33> 800850: 39 4a 04 cmp %ecx,0x4(%edx) 800853: 76 18 jbe 80086d <block_is_free+0x33> if (bitmap[blockno / 32] & (1 << (blockno % 32))) 800855: 89 cb mov %ecx,%ebx 800857: c1 eb 05 shr $0x5,%ebx 80085a: b8 01 00 00 00 mov $0x1,%eax 80085f: d3 e0 shl %cl,%eax 800861: 8b 15 04 a0 80 00 mov 0x80a004,%edx 800867: 85 04 9a test %eax,(%edx,%ebx,4) 80086a: 0f 95 c0 setne %al return 1; return 0; } 80086d: 5b pop %ebx 80086e: 5d pop %ebp 80086f: c3 ret 00800870 <free_block>: // Mark a block free in the bitmap void free_block(uint32_t blockno) { 800870: 55 push %ebp 800871: 89 e5 mov %esp,%ebp 800873: 53 push %ebx 800874: 83 ec 04 sub $0x4,%esp 800877: 8b 4d 08 mov 0x8(%ebp),%ecx // Blockno zero is the null pointer of block numbers. if (blockno == 0) 80087a: 85 c9 test %ecx,%ecx 80087c: 74 1a je 800898 <free_block+0x28> panic("attempt to free zero block"); bitmap[blockno/32] |= 1<<(blockno%32); 80087e: 89 cb mov %ecx,%ebx 800880: c1 eb 05 shr $0x5,%ebx 800883: 8b 15 04 a0 80 00 mov 0x80a004,%edx 800889: b8 01 00 00 00 mov $0x1,%eax 80088e: d3 e0 shl %cl,%eax 800890: 09 04 9a or %eax,(%edx,%ebx,4) } 800893: 8b 5d fc mov -0x4(%ebp),%ebx 800896: c9 leave 800897: c3 ret panic("attempt to free zero block"); 800898: 83 ec 04 sub $0x4,%esp 80089b: 68 ae 3b 80 00 push $0x803bae 8008a0: 6a 2d push $0x2d 8008a2: 68 79 3b 80 00 push $0x803b79 8008a7: e8 af 12 00 00 call 801b5b <_panic> 008008ac <alloc_block>: // -E_NO_DISK if we are out of blocks. // // Hint: use free_block as an example for manipulating the bitmap. int alloc_block(void) { 8008ac: 55 push %ebp 8008ad: 89 e5 mov %esp,%ebp 8008af: 56 push %esi 8008b0: 53 push %ebx // The bitmap consists of one or more blocks. A single bitmap block // contains the in-use bits for BLKBITSIZE blocks. There are // super->s_nblocks blocks in the disk altogether. // LAB 5: Your code here. int nblock_bitmap = (super->s_nblocks + BLKBITSIZE - 1) / BLKBITSIZE; 8008b1: a1 08 a0 80 00 mov 0x80a008,%eax 8008b6: 8b 70 04 mov 0x4(%eax),%esi 8008b9: 8d 9e ff 7f 00 00 lea 0x7fff(%esi),%ebx 8008bf: c1 eb 0f shr $0xf,%ebx for (uint32_t i = 2 + nblock_bitmap; i < super->s_nblocks; i++) 8008c2: 83 c3 02 add $0x2,%ebx 8008c5: 39 de cmp %ebx,%esi 8008c7: 76 45 jbe 80090e <alloc_block+0x62> if (block_is_free(i)) 8008c9: 53 push %ebx 8008ca: e8 6b ff ff ff call 80083a <block_is_free> 8008cf: 83 c4 04 add $0x4,%esp 8008d2: 84 c0 test %al,%al 8008d4: 75 05 jne 8008db <alloc_block+0x2f> for (uint32_t i = 2 + nblock_bitmap; i < super->s_nblocks; i++) 8008d6: 83 c3 01 add $0x1,%ebx 8008d9: eb ea jmp 8008c5 <alloc_block+0x19> { bitmap[i/32] &= ~(1 << (i%32)); 8008db: 89 d8 mov %ebx,%eax 8008dd: c1 e8 05 shr $0x5,%eax 8008e0: c1 e0 02 shl $0x2,%eax 8008e3: 89 c6 mov %eax,%esi 8008e5: 03 35 04 a0 80 00 add 0x80a004,%esi 8008eb: ba 01 00 00 00 mov $0x1,%edx 8008f0: 89 d9 mov %ebx,%ecx 8008f2: d3 e2 shl %cl,%edx 8008f4: f7 d2 not %edx 8008f6: 21 16 and %edx,(%esi) flush_block(bitmap + i/32); 8008f8: 83 ec 0c sub $0xc,%esp 8008fb: 03 05 04 a0 80 00 add 0x80a004,%eax 800901: 50 push %eax 800902: e8 23 fb ff ff call 80042a <flush_block> return i; 800907: 89 d8 mov %ebx,%eax 800909: 83 c4 10 add $0x10,%esp 80090c: eb 05 jmp 800913 <alloc_block+0x67> } return -E_NO_DISK; 80090e: b8 f7 ff ff ff mov $0xfffffff7,%eax } 800913: 8d 65 f8 lea -0x8(%ebp),%esp 800916: 5b pop %ebx 800917: 5e pop %esi 800918: 5d pop %ebp 800919: c3 ret 0080091a <file_block_walk>: // // Analogy: This is like pgdir_walk for files. // Hint: Don't forget to clear any block you allocate. static int file_block_walk(struct File *f, uint32_t filebno, uint32_t **ppdiskbno, bool alloc) { 80091a: 55 push %ebp 80091b: 89 e5 mov %esp,%ebp 80091d: 57 push %edi 80091e: 56 push %esi 80091f: 53 push %ebx 800920: 83 ec 1c sub $0x1c,%esp 800923: 8b 7d 08 mov 0x8(%ebp),%edi // LAB 5: Your code here. if (filebno >= NDIRECT + NINDIRECT) return -E_INVAL; 800926: 81 fa 09 04 00 00 cmp $0x409,%edx 80092c: 0f 87 8f 00 00 00 ja 8009c1 <file_block_walk+0xa7> if (filebno < NDIRECT) 800932: 83 fa 09 cmp $0x9,%edx 800935: 76 7a jbe 8009b1 <file_block_walk+0x97> 800937: 89 4d e4 mov %ecx,-0x1c(%ebp) 80093a: 89 d3 mov %edx,%ebx 80093c: 89 c6 mov %eax,%esi { *ppdiskbno = f->f_direct + filebno; return 0; } if (f->f_indirect == 0) 80093e: 83 b8 b0 00 00 00 00 cmpl $0x0,0xb0(%eax) 800945: 75 43 jne 80098a <file_block_walk+0x70> { if (!alloc) return -E_NOT_FOUND; 800947: 89 f8 mov %edi,%eax 800949: 84 c0 test %al,%al 80094b: 74 7b je 8009c8 <file_block_walk+0xae> int r; if ((r = alloc_block()) < 0) return -E_NO_DISK; 80094d: e8 5a ff ff ff call 8008ac <alloc_block> 800952: 89 c7 mov %eax,%edi 800954: 85 c0 test %eax,%eax 800956: 78 77 js 8009cf <file_block_walk+0xb5> f->f_indirect = r; 800958: 89 86 b0 00 00 00 mov %eax,0xb0(%esi) memset(diskaddr(r), 0, BLKSIZE); 80095e: 83 ec 0c sub $0xc,%esp 800961: 50 push %eax 800962: e8 45 fa ff ff call 8003ac <diskaddr> 800967: 83 c4 0c add $0xc,%esp 80096a: 68 00 10 00 00 push $0x1000 80096f: 6a 00 push $0x0 800971: 50 push %eax 800972: e8 1f 1a 00 00 call 802396 <memset> flush_block(diskaddr(r)); 800977: 89 3c 24 mov %edi,(%esp) 80097a: e8 2d fa ff ff call 8003ac <diskaddr> 80097f: 89 04 24 mov %eax,(%esp) 800982: e8 a3 fa ff ff call 80042a <flush_block> 800987: 83 c4 10 add $0x10,%esp } *ppdiskbno = (uint32_t*)diskaddr(f->f_indirect) + (filebno - NDIRECT); 80098a: 83 ec 0c sub $0xc,%esp 80098d: ff b6 b0 00 00 00 pushl 0xb0(%esi) 800993: e8 14 fa ff ff call 8003ac <diskaddr> 800998: 8d 44 98 d8 lea -0x28(%eax,%ebx,4),%eax 80099c: 8b 5d e4 mov -0x1c(%ebp),%ebx 80099f: 89 03 mov %eax,(%ebx) return 0; 8009a1: 83 c4 10 add $0x10,%esp 8009a4: b8 00 00 00 00 mov $0x0,%eax } 8009a9: 8d 65 f4 lea -0xc(%ebp),%esp 8009ac: 5b pop %ebx 8009ad: 5e pop %esi 8009ae: 5f pop %edi 8009af: 5d pop %ebp 8009b0: c3 ret *ppdiskbno = f->f_direct + filebno; 8009b1: 8d 84 90 88 00 00 00 lea 0x88(%eax,%edx,4),%eax 8009b8: 89 01 mov %eax,(%ecx) return 0; 8009ba: b8 00 00 00 00 mov $0x0,%eax 8009bf: eb e8 jmp 8009a9 <file_block_walk+0x8f> if (filebno >= NDIRECT + NINDIRECT) return -E_INVAL; 8009c1: b8 fd ff ff ff mov $0xfffffffd,%eax 8009c6: eb e1 jmp 8009a9 <file_block_walk+0x8f> if (!alloc) return -E_NOT_FOUND; 8009c8: b8 f5 ff ff ff mov $0xfffffff5,%eax 8009cd: eb da jmp 8009a9 <file_block_walk+0x8f> if ((r = alloc_block()) < 0) return -E_NO_DISK; 8009cf: b8 f7 ff ff ff mov $0xfffffff7,%eax 8009d4: eb d3 jmp 8009a9 <file_block_walk+0x8f> 008009d6 <check_bitmap>: { 8009d6: 55 push %ebp 8009d7: 89 e5 mov %esp,%ebp 8009d9: 56 push %esi 8009da: 53 push %ebx for (i = 0; i * BLKBITSIZE < super->s_nblocks; i++) 8009db: a1 08 a0 80 00 mov 0x80a008,%eax 8009e0: 8b 70 04 mov 0x4(%eax),%esi 8009e3: bb 00 00 00 00 mov $0x0,%ebx 8009e8: 89 d8 mov %ebx,%eax 8009ea: c1 e0 0f shl $0xf,%eax 8009ed: 39 c6 cmp %eax,%esi 8009ef: 76 2b jbe 800a1c <check_bitmap+0x46> assert(!block_is_free(2+i)); 8009f1: 8d 43 02 lea 0x2(%ebx),%eax 8009f4: 50 push %eax 8009f5: e8 40 fe ff ff call 80083a <block_is_free> 8009fa: 83 c4 04 add $0x4,%esp 8009fd: 84 c0 test %al,%al 8009ff: 75 05 jne 800a06 <check_bitmap+0x30> for (i = 0; i * BLKBITSIZE < super->s_nblocks; i++) 800a01: 83 c3 01 add $0x1,%ebx 800a04: eb e2 jmp 8009e8 <check_bitmap+0x12> assert(!block_is_free(2+i)); 800a06: 68 c9 3b 80 00 push $0x803bc9 800a0b: 68 7d 39 80 00 push $0x80397d 800a10: 6a 59 push $0x59 800a12: 68 79 3b 80 00 push $0x803b79 800a17: e8 3f 11 00 00 call 801b5b <_panic> assert(!block_is_free(0)); 800a1c: 83 ec 0c sub $0xc,%esp 800a1f: 6a 00 push $0x0 800a21: e8 14 fe ff ff call 80083a <block_is_free> 800a26: 83 c4 10 add $0x10,%esp 800a29: 84 c0 test %al,%al 800a2b: 75 28 jne 800a55 <check_bitmap+0x7f> assert(!block_is_free(1)); 800a2d: 83 ec 0c sub $0xc,%esp 800a30: 6a 01 push $0x1 800a32: e8 03 fe ff ff call 80083a <block_is_free> 800a37: 83 c4 10 add $0x10,%esp 800a3a: 84 c0 test %al,%al 800a3c: 75 2d jne 800a6b <check_bitmap+0x95> cprintf("bitmap is good\n"); 800a3e: 83 ec 0c sub $0xc,%esp 800a41: 68 01 3c 80 00 push $0x803c01 800a46: e8 eb 11 00 00 call 801c36 <cprintf> } 800a4b: 83 c4 10 add $0x10,%esp 800a4e: 8d 65 f8 lea -0x8(%ebp),%esp 800a51: 5b pop %ebx 800a52: 5e pop %esi 800a53: 5d pop %ebp 800a54: c3 ret assert(!block_is_free(0)); 800a55: 68 dd 3b 80 00 push $0x803bdd 800a5a: 68 7d 39 80 00 push $0x80397d 800a5f: 6a 5c push $0x5c 800a61: 68 79 3b 80 00 push $0x803b79 800a66: e8 f0 10 00 00 call 801b5b <_panic> assert(!block_is_free(1)); 800a6b: 68 ef 3b 80 00 push $0x803bef 800a70: 68 7d 39 80 00 push $0x80397d 800a75: 6a 5d push $0x5d 800a77: 68 79 3b 80 00 push $0x803b79 800a7c: e8 da 10 00 00 call 801b5b <_panic> 00800a81 <fs_init>: { 800a81: 55 push %ebp 800a82: 89 e5 mov %esp,%ebp 800a84: 83 ec 08 sub $0x8,%esp if (ide_probe_disk1()) 800a87: e8 d3 f5 ff ff call 80005f <ide_probe_disk1> 800a8c: 84 c0 test %al,%al 800a8e: 75 41 jne 800ad1 <fs_init+0x50> ide_set_disk(0); 800a90: 83 ec 0c sub $0xc,%esp 800a93: 6a 00 push $0x0 800a95: e8 27 f6 ff ff call 8000c1 <ide_set_disk> 800a9a: 83 c4 10 add $0x10,%esp bc_init(); 800a9d: e8 4c fa ff ff call 8004ee <bc_init> super = diskaddr(1); 800aa2: 83 ec 0c sub $0xc,%esp 800aa5: 6a 01 push $0x1 800aa7: e8 00 f9 ff ff call 8003ac <diskaddr> 800aac: a3 08 a0 80 00 mov %eax,0x80a008 check_super(); 800ab1: e8 2e fd ff ff call 8007e4 <check_super> bitmap = diskaddr(2); 800ab6: c7 04 24 02 00 00 00 movl $0x2,(%esp) 800abd: e8 ea f8 ff ff call 8003ac <diskaddr> 800ac2: a3 04 a0 80 00 mov %eax,0x80a004 check_bitmap(); 800ac7: e8 0a ff ff ff call 8009d6 <check_bitmap> } 800acc: 83 c4 10 add $0x10,%esp 800acf: c9 leave 800ad0: c3 ret ide_set_disk(1); 800ad1: 83 ec 0c sub $0xc,%esp 800ad4: 6a 01 push $0x1 800ad6: e8 e6 f5 ff ff call 8000c1 <ide_set_disk> 800adb: 83 c4 10 add $0x10,%esp 800ade: eb bd jmp 800a9d <fs_init+0x1c> 00800ae0 <file_get_block>: // -E_INVAL if filebno is out of range. // // Hint: Use file_block_walk and alloc_block. int file_get_block(struct File *f, uint32_t filebno, char **blk) { 800ae0: 55 push %ebp 800ae1: 89 e5 mov %esp,%ebp 800ae3: 53 push %ebx 800ae4: 83 ec 20 sub $0x20,%esp // LAB 5: Your code here. int r; uint32_t* pdiskbno; if ((r = file_block_walk(f, filebno, &pdiskbno, 1)) < 0) return r; 800ae7: 6a 01 push $0x1 800ae9: 8d 4d f4 lea -0xc(%ebp),%ecx 800aec: 8b 55 0c mov 0xc(%ebp),%edx 800aef: 8b 45 08 mov 0x8(%ebp),%eax 800af2: e8 23 fe ff ff call 80091a <file_block_walk> 800af7: 89 c3 mov %eax,%ebx 800af9: 83 c4 10 add $0x10,%esp 800afc: 85 c0 test %eax,%eax 800afe: 78 5e js 800b5e <file_get_block+0x7e> if (*pdiskbno == 0) 800b00: 8b 45 f4 mov -0xc(%ebp),%eax 800b03: 83 38 00 cmpl $0x0,(%eax) 800b06: 75 3c jne 800b44 <file_get_block+0x64> { if ((r = alloc_block()) < 0) return r; 800b08: e8 9f fd ff ff call 8008ac <alloc_block> 800b0d: 89 c3 mov %eax,%ebx 800b0f: 85 c0 test %eax,%eax 800b11: 78 4b js 800b5e <file_get_block+0x7e> *pdiskbno = r; 800b13: 8b 45 f4 mov -0xc(%ebp),%eax 800b16: 89 18 mov %ebx,(%eax) memset(diskaddr(r), 0, BLKSIZE); 800b18: 83 ec 0c sub $0xc,%esp 800b1b: 53 push %ebx 800b1c: e8 8b f8 ff ff call 8003ac <diskaddr> 800b21: 83 c4 0c add $0xc,%esp 800b24: 68 00 10 00 00 push $0x1000 800b29: 6a 00 push $0x0 800b2b: 50 push %eax 800b2c: e8 65 18 00 00 call 802396 <memset> flush_block(diskaddr(r)); 800b31: 89 1c 24 mov %ebx,(%esp) 800b34: e8 73 f8 ff ff call 8003ac <diskaddr> 800b39: 89 04 24 mov %eax,(%esp) 800b3c: e8 e9 f8 ff ff call 80042a <flush_block> 800b41: 83 c4 10 add $0x10,%esp } *blk = diskaddr(*pdiskbno); 800b44: 83 ec 0c sub $0xc,%esp 800b47: 8b 45 f4 mov -0xc(%ebp),%eax 800b4a: ff 30 pushl (%eax) 800b4c: e8 5b f8 ff ff call 8003ac <diskaddr> 800b51: 8b 55 10 mov 0x10(%ebp),%edx 800b54: 89 02 mov %eax,(%edx) return 0; 800b56: 83 c4 10 add $0x10,%esp 800b59: bb 00 00 00 00 mov $0x0,%ebx } 800b5e: 89 d8 mov %ebx,%eax 800b60: 8b 5d fc mov -0x4(%ebp),%ebx 800b63: c9 leave 800b64: c3 ret 00800b65 <walk_path>: // If we cannot find the file but find the directory // it should be in, set *pdir and copy the final path // element into lastelem. static int walk_path(const char *path, struct File **pdir, struct File **pf, char *lastelem) { 800b65: 55 push %ebp 800b66: 89 e5 mov %esp,%ebp 800b68: 57 push %edi 800b69: 56 push %esi 800b6a: 53 push %ebx 800b6b: 81 ec bc 00 00 00 sub $0xbc,%esp 800b71: 89 95 40 ff ff ff mov %edx,-0xc0(%ebp) 800b77: 89 8d 3c ff ff ff mov %ecx,-0xc4(%ebp) 800b7d: eb 03 jmp 800b82 <walk_path+0x1d> p++; 800b7f: 83 c0 01 add $0x1,%eax while (*p == '/') 800b82: 80 38 2f cmpb $0x2f,(%eax) 800b85: 74 f8 je 800b7f <walk_path+0x1a> int r; // if (*path != '/') // return -E_BAD_PATH; path = skip_slash(path); f = &super->s_root; 800b87: 8b 0d 08 a0 80 00 mov 0x80a008,%ecx 800b8d: 83 c1 08 add $0x8,%ecx 800b90: 89 8d 4c ff ff ff mov %ecx,-0xb4(%ebp) dir = 0; name[0] = 0; 800b96: c6 85 68 ff ff ff 00 movb $0x0,-0x98(%ebp) if (pdir) 800b9d: 8b 8d 40 ff ff ff mov -0xc0(%ebp),%ecx 800ba3: 85 c9 test %ecx,%ecx 800ba5: 74 06 je 800bad <walk_path+0x48> *pdir = 0; 800ba7: c7 01 00 00 00 00 movl $0x0,(%ecx) *pf = 0; 800bad: 8b 8d 3c ff ff ff mov -0xc4(%ebp),%ecx 800bb3: c7 01 00 00 00 00 movl $0x0,(%ecx) dir = 0; 800bb9: ba 00 00 00 00 mov $0x0,%edx while (*path != '\0') { 800bbe: e9 b4 01 00 00 jmp 800d77 <walk_path+0x212> dir = f; p = path; while (*path != '/' && *path != '\0') path++; 800bc3: 83 c7 01 add $0x1,%edi while (*path != '/' && *path != '\0') 800bc6: 0f b6 17 movzbl (%edi),%edx 800bc9: 80 fa 2f cmp $0x2f,%dl 800bcc: 74 04 je 800bd2 <walk_path+0x6d> 800bce: 84 d2 test %dl,%dl 800bd0: 75 f1 jne 800bc3 <walk_path+0x5e> if (path - p >= MAXNAMELEN) 800bd2: 89 fb mov %edi,%ebx 800bd4: 29 c3 sub %eax,%ebx 800bd6: 83 fb 7f cmp $0x7f,%ebx 800bd9: 0f 8f 70 01 00 00 jg 800d4f <walk_path+0x1ea> return -E_BAD_PATH; memmove(name, p, path - p); 800bdf: 83 ec 04 sub $0x4,%esp 800be2: 53 push %ebx 800be3: 50 push %eax 800be4: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 800bea: 50 push %eax 800beb: e8 f3 17 00 00 call 8023e3 <memmove> name[path - p] = '\0'; 800bf0: c6 84 1d 68 ff ff ff movb $0x0,-0x98(%ebp,%ebx,1) 800bf7: 00 800bf8: 83 c4 10 add $0x10,%esp 800bfb: eb 03 jmp 800c00 <walk_path+0x9b> p++; 800bfd: 83 c7 01 add $0x1,%edi while (*p == '/') 800c00: 80 3f 2f cmpb $0x2f,(%edi) 800c03: 74 f8 je 800bfd <walk_path+0x98> path = skip_slash(path); if (dir->f_type != FTYPE_DIR) 800c05: 8b 85 4c ff ff ff mov -0xb4(%ebp),%eax 800c0b: 83 b8 84 00 00 00 01 cmpl $0x1,0x84(%eax) 800c12: 0f 85 3e 01 00 00 jne 800d56 <walk_path+0x1f1> assert((dir->f_size % BLKSIZE) == 0); 800c18: 8b 80 80 00 00 00 mov 0x80(%eax),%eax 800c1e: a9 ff 0f 00 00 test $0xfff,%eax 800c23: 0f 85 98 00 00 00 jne 800cc1 <walk_path+0x15c> nblock = dir->f_size / BLKSIZE; 800c29: 8d 90 ff 0f 00 00 lea 0xfff(%eax),%edx 800c2f: 85 c0 test %eax,%eax 800c31: 0f 48 c2 cmovs %edx,%eax 800c34: c1 f8 0c sar $0xc,%eax 800c37: 89 85 48 ff ff ff mov %eax,-0xb8(%ebp) for (i = 0; i < nblock; i++) { 800c3d: c7 85 50 ff ff ff 00 movl $0x0,-0xb0(%ebp) 800c44: 00 00 00 if (strcmp(f[j].f_name, name) == 0) { 800c47: 8d b5 68 ff ff ff lea -0x98(%ebp),%esi 800c4d: 89 bd 44 ff ff ff mov %edi,-0xbc(%ebp) for (i = 0; i < nblock; i++) { 800c53: 8b 8d 50 ff ff ff mov -0xb0(%ebp),%ecx 800c59: 39 8d 48 ff ff ff cmp %ecx,-0xb8(%ebp) 800c5f: 74 79 je 800cda <walk_path+0x175> if ((r = file_get_block(dir, i, &blk)) < 0) 800c61: 83 ec 04 sub $0x4,%esp 800c64: 8d 85 64 ff ff ff lea -0x9c(%ebp),%eax 800c6a: 50 push %eax 800c6b: ff b5 50 ff ff ff pushl -0xb0(%ebp) 800c71: ff b5 4c ff ff ff pushl -0xb4(%ebp) 800c77: e8 64 fe ff ff call 800ae0 <file_get_block> 800c7c: 83 c4 10 add $0x10,%esp 800c7f: 85 c0 test %eax,%eax 800c81: 0f 88 fc 00 00 00 js 800d83 <walk_path+0x21e> 800c87: 8b 9d 64 ff ff ff mov -0x9c(%ebp),%ebx 800c8d: 8d bb 00 10 00 00 lea 0x1000(%ebx),%edi if (strcmp(f[j].f_name, name) == 0) { 800c93: 89 9d 54 ff ff ff mov %ebx,-0xac(%ebp) 800c99: 83 ec 08 sub $0x8,%esp 800c9c: 56 push %esi 800c9d: 53 push %ebx 800c9e: e8 58 16 00 00 call 8022fb <strcmp> 800ca3: 83 c4 10 add $0x10,%esp 800ca6: 85 c0 test %eax,%eax 800ca8: 0f 84 af 00 00 00 je 800d5d <walk_path+0x1f8> 800cae: 81 c3 00 01 00 00 add $0x100,%ebx for (j = 0; j < BLKFILES; j++) 800cb4: 39 fb cmp %edi,%ebx 800cb6: 75 db jne 800c93 <walk_path+0x12e> for (i = 0; i < nblock; i++) { 800cb8: 83 85 50 ff ff ff 01 addl $0x1,-0xb0(%ebp) 800cbf: eb 92 jmp 800c53 <walk_path+0xee> assert((dir->f_size % BLKSIZE) == 0); 800cc1: 68 11 3c 80 00 push $0x803c11 800cc6: 68 7d 39 80 00 push $0x80397d 800ccb: 68 d1 00 00 00 push $0xd1 800cd0: 68 79 3b 80 00 push $0x803b79 800cd5: e8 81 0e 00 00 call 801b5b <_panic> 800cda: 8b bd 44 ff ff ff mov -0xbc(%ebp),%edi *pdir = dir; if (lastelem) strcpy(lastelem, name); *pf = 0; } return r; 800ce0: b8 f5 ff ff ff mov $0xfffffff5,%eax if (r == -E_NOT_FOUND && *path == '\0') { 800ce5: 80 3f 00 cmpb $0x0,(%edi) 800ce8: 0f 85 a4 00 00 00 jne 800d92 <walk_path+0x22d> if (pdir) 800cee: 8b 85 40 ff ff ff mov -0xc0(%ebp),%eax 800cf4: 85 c0 test %eax,%eax 800cf6: 74 08 je 800d00 <walk_path+0x19b> *pdir = dir; 800cf8: 8b 8d 4c ff ff ff mov -0xb4(%ebp),%ecx 800cfe: 89 08 mov %ecx,(%eax) if (lastelem) 800d00: 83 7d 08 00 cmpl $0x0,0x8(%ebp) 800d04: 74 15 je 800d1b <walk_path+0x1b6> strcpy(lastelem, name); 800d06: 83 ec 08 sub $0x8,%esp 800d09: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 800d0f: 50 push %eax 800d10: ff 75 08 pushl 0x8(%ebp) 800d13: e8 3d 15 00 00 call 802255 <strcpy> 800d18: 83 c4 10 add $0x10,%esp *pf = 0; 800d1b: 8b 85 3c ff ff ff mov -0xc4(%ebp),%eax 800d21: c7 00 00 00 00 00 movl $0x0,(%eax) return r; 800d27: b8 f5 ff ff ff mov $0xfffffff5,%eax 800d2c: eb 64 jmp 800d92 <walk_path+0x22d> } } if (pdir) 800d2e: 8b 85 40 ff ff ff mov -0xc0(%ebp),%eax 800d34: 85 c0 test %eax,%eax 800d36: 74 02 je 800d3a <walk_path+0x1d5> *pdir = dir; 800d38: 89 10 mov %edx,(%eax) *pf = f; 800d3a: 8b 85 3c ff ff ff mov -0xc4(%ebp),%eax 800d40: 8b 8d 4c ff ff ff mov -0xb4(%ebp),%ecx 800d46: 89 08 mov %ecx,(%eax) return 0; 800d48: b8 00 00 00 00 mov $0x0,%eax 800d4d: eb 43 jmp 800d92 <walk_path+0x22d> return -E_BAD_PATH; 800d4f: b8 f4 ff ff ff mov $0xfffffff4,%eax 800d54: eb 3c jmp 800d92 <walk_path+0x22d> return -E_NOT_FOUND; 800d56: b8 f5 ff ff ff mov $0xfffffff5,%eax 800d5b: eb 35 jmp 800d92 <walk_path+0x22d> 800d5d: 8b bd 44 ff ff ff mov -0xbc(%ebp),%edi 800d63: 89 f8 mov %edi,%eax 800d65: 8b 95 4c ff ff ff mov -0xb4(%ebp),%edx if (strcmp(f[j].f_name, name) == 0) { 800d6b: 8b 8d 54 ff ff ff mov -0xac(%ebp),%ecx 800d71: 89 8d 4c ff ff ff mov %ecx,-0xb4(%ebp) while (*path != '\0') { 800d77: 80 38 00 cmpb $0x0,(%eax) 800d7a: 74 b2 je 800d2e <walk_path+0x1c9> 800d7c: 89 c7 mov %eax,%edi 800d7e: e9 43 fe ff ff jmp 800bc6 <walk_path+0x61> 800d83: 8b bd 44 ff ff ff mov -0xbc(%ebp),%edi if (r == -E_NOT_FOUND && *path == '\0') { 800d89: 83 f8 f5 cmp $0xfffffff5,%eax 800d8c: 0f 84 4e ff ff ff je 800ce0 <walk_path+0x17b> } 800d92: 8d 65 f4 lea -0xc(%ebp),%esp 800d95: 5b pop %ebx 800d96: 5e pop %esi 800d97: 5f pop %edi 800d98: 5d pop %ebp 800d99: c3 ret 00800d9a <file_open>: // Open "path". On success set *pf to point at the file and return 0. // On error return < 0. int file_open(const char *path, struct File **pf) { 800d9a: 55 push %ebp 800d9b: 89 e5 mov %esp,%ebp 800d9d: 83 ec 14 sub $0x14,%esp return walk_path(path, 0, pf, 0); 800da0: 6a 00 push $0x0 800da2: 8b 4d 0c mov 0xc(%ebp),%ecx 800da5: ba 00 00 00 00 mov $0x0,%edx 800daa: 8b 45 08 mov 0x8(%ebp),%eax 800dad: e8 b3 fd ff ff call 800b65 <walk_path> } 800db2: c9 leave 800db3: c3 ret 00800db4 <file_read>: // Read count bytes from f into buf, starting from seek position // offset. This meant to mimic the standard pread function. // Returns the number of bytes read, < 0 on error. ssize_t file_read(struct File *f, void *buf, size_t count, off_t offset) { 800db4: 55 push %ebp 800db5: 89 e5 mov %esp,%ebp 800db7: 57 push %edi 800db8: 56 push %esi 800db9: 53 push %ebx 800dba: 83 ec 2c sub $0x2c,%esp 800dbd: 8b 7d 0c mov 0xc(%ebp),%edi 800dc0: 8b 4d 14 mov 0x14(%ebp),%ecx int r, bn; off_t pos; char *blk; if (offset >= f->f_size) 800dc3: 8b 45 08 mov 0x8(%ebp),%eax 800dc6: 8b 90 80 00 00 00 mov 0x80(%eax),%edx return 0; 800dcc: b8 00 00 00 00 mov $0x0,%eax if (offset >= f->f_size) 800dd1: 39 ca cmp %ecx,%edx 800dd3: 0f 8e 80 00 00 00 jle 800e59 <file_read+0xa5> count = MIN(count, f->f_size - offset); 800dd9: 29 ca sub %ecx,%edx 800ddb: 3b 55 10 cmp 0x10(%ebp),%edx 800dde: 89 d0 mov %edx,%eax 800de0: 0f 47 45 10 cmova 0x10(%ebp),%eax 800de4: 89 45 d0 mov %eax,-0x30(%ebp) for (pos = offset; pos < offset + count; ) { 800de7: 89 ce mov %ecx,%esi 800de9: 01 c1 add %eax,%ecx 800deb: 89 4d d4 mov %ecx,-0x2c(%ebp) 800dee: 89 f3 mov %esi,%ebx 800df0: 39 75 d4 cmp %esi,-0x2c(%ebp) 800df3: 76 61 jbe 800e56 <file_read+0xa2> if ((r = file_get_block(f, pos / BLKSIZE, &blk)) < 0) 800df5: 83 ec 04 sub $0x4,%esp 800df8: 8d 45 e4 lea -0x1c(%ebp),%eax 800dfb: 50 push %eax 800dfc: 8d 86 ff 0f 00 00 lea 0xfff(%esi),%eax 800e02: 85 f6 test %esi,%esi 800e04: 0f 49 c6 cmovns %esi,%eax 800e07: c1 f8 0c sar $0xc,%eax 800e0a: 50 push %eax 800e0b: ff 75 08 pushl 0x8(%ebp) 800e0e: e8 cd fc ff ff call 800ae0 <file_get_block> 800e13: 83 c4 10 add $0x10,%esp 800e16: 85 c0 test %eax,%eax 800e18: 78 3f js 800e59 <file_read+0xa5> return r; bn = MIN(BLKSIZE - pos % BLKSIZE, offset + count - pos); 800e1a: 89 f2 mov %esi,%edx 800e1c: c1 fa 1f sar $0x1f,%edx 800e1f: c1 ea 14 shr $0x14,%edx 800e22: 8d 04 16 lea (%esi,%edx,1),%eax 800e25: 25 ff 0f 00 00 and $0xfff,%eax 800e2a: 29 d0 sub %edx,%eax 800e2c: ba 00 10 00 00 mov $0x1000,%edx 800e31: 29 c2 sub %eax,%edx 800e33: 8b 4d d4 mov -0x2c(%ebp),%ecx 800e36: 29 d9 sub %ebx,%ecx 800e38: 89 cb mov %ecx,%ebx 800e3a: 39 ca cmp %ecx,%edx 800e3c: 0f 46 da cmovbe %edx,%ebx memmove(buf, blk + pos % BLKSIZE, bn); 800e3f: 83 ec 04 sub $0x4,%esp 800e42: 53 push %ebx 800e43: 03 45 e4 add -0x1c(%ebp),%eax 800e46: 50 push %eax 800e47: 57 push %edi 800e48: e8 96 15 00 00 call 8023e3 <memmove> pos += bn; 800e4d: 01 de add %ebx,%esi buf += bn; 800e4f: 01 df add %ebx,%edi 800e51: 83 c4 10 add $0x10,%esp 800e54: eb 98 jmp 800dee <file_read+0x3a> } return count; 800e56: 8b 45 d0 mov -0x30(%ebp),%eax } 800e59: 8d 65 f4 lea -0xc(%ebp),%esp 800e5c: 5b pop %ebx 800e5d: 5e pop %esi 800e5e: 5f pop %edi 800e5f: 5d pop %ebp 800e60: c3 ret 00800e61 <file_set_size>: } // Set the size of file f, truncating or extending as necessary. int file_set_size(struct File *f, off_t newsize) { 800e61: 55 push %ebp 800e62: 89 e5 mov %esp,%ebp 800e64: 57 push %edi 800e65: 56 push %esi 800e66: 53 push %ebx 800e67: 83 ec 2c sub $0x2c,%esp 800e6a: 8b 75 08 mov 0x8(%ebp),%esi if (f->f_size > newsize) 800e6d: 8b 86 80 00 00 00 mov 0x80(%esi),%eax 800e73: 3b 45 0c cmp 0xc(%ebp),%eax 800e76: 7f 1f jg 800e97 <file_set_size+0x36> file_truncate_blocks(f, newsize); f->f_size = newsize; 800e78: 8b 45 0c mov 0xc(%ebp),%eax 800e7b: 89 86 80 00 00 00 mov %eax,0x80(%esi) flush_block(f); 800e81: 83 ec 0c sub $0xc,%esp 800e84: 56 push %esi 800e85: e8 a0 f5 ff ff call 80042a <flush_block> return 0; } 800e8a: b8 00 00 00 00 mov $0x0,%eax 800e8f: 8d 65 f4 lea -0xc(%ebp),%esp 800e92: 5b pop %ebx 800e93: 5e pop %esi 800e94: 5f pop %edi 800e95: 5d pop %ebp 800e96: c3 ret old_nblocks = (f->f_size + BLKSIZE - 1) / BLKSIZE; 800e97: 8d b8 fe 1f 00 00 lea 0x1ffe(%eax),%edi 800e9d: 05 ff 0f 00 00 add $0xfff,%eax 800ea2: 0f 49 f8 cmovns %eax,%edi 800ea5: c1 ff 0c sar $0xc,%edi new_nblocks = (newsize + BLKSIZE - 1) / BLKSIZE; 800ea8: 8b 45 0c mov 0xc(%ebp),%eax 800eab: 05 fe 1f 00 00 add $0x1ffe,%eax 800eb0: 8b 55 0c mov 0xc(%ebp),%edx 800eb3: 81 c2 ff 0f 00 00 add $0xfff,%edx 800eb9: 0f 49 c2 cmovns %edx,%eax 800ebc: c1 f8 0c sar $0xc,%eax 800ebf: 89 45 d4 mov %eax,-0x2c(%ebp) for (bno = new_nblocks; bno < old_nblocks; bno++) 800ec2: 89 c3 mov %eax,%ebx 800ec4: eb 3c jmp 800f02 <file_set_size+0xa1> if (new_nblocks <= NDIRECT && f->f_indirect) { 800ec6: 83 7d d4 0a cmpl $0xa,-0x2c(%ebp) 800eca: 77 ac ja 800e78 <file_set_size+0x17> 800ecc: 8b 86 b0 00 00 00 mov 0xb0(%esi),%eax 800ed2: 85 c0 test %eax,%eax 800ed4: 74 a2 je 800e78 <file_set_size+0x17> free_block(f->f_indirect); 800ed6: 83 ec 0c sub $0xc,%esp 800ed9: 50 push %eax 800eda: e8 91 f9 ff ff call 800870 <free_block> f->f_indirect = 0; 800edf: c7 86 b0 00 00 00 00 movl $0x0,0xb0(%esi) 800ee6: 00 00 00 800ee9: 83 c4 10 add $0x10,%esp 800eec: eb 8a jmp 800e78 <file_set_size+0x17> cprintf("warning: file_free_block: %e", r); 800eee: 83 ec 08 sub $0x8,%esp 800ef1: 50 push %eax 800ef2: 68 2e 3c 80 00 push $0x803c2e 800ef7: e8 3a 0d 00 00 call 801c36 <cprintf> 800efc: 83 c4 10 add $0x10,%esp for (bno = new_nblocks; bno < old_nblocks; bno++) 800eff: 83 c3 01 add $0x1,%ebx 800f02: 39 df cmp %ebx,%edi 800f04: 76 c0 jbe 800ec6 <file_set_size+0x65> if ((r = file_block_walk(f, filebno, &ptr, 0)) < 0) 800f06: 83 ec 0c sub $0xc,%esp 800f09: 6a 00 push $0x0 800f0b: 8d 4d e4 lea -0x1c(%ebp),%ecx 800f0e: 89 da mov %ebx,%edx 800f10: 89 f0 mov %esi,%eax 800f12: e8 03 fa ff ff call 80091a <file_block_walk> 800f17: 83 c4 10 add $0x10,%esp 800f1a: 85 c0 test %eax,%eax 800f1c: 78 d0 js 800eee <file_set_size+0x8d> if (*ptr) { 800f1e: 8b 45 e4 mov -0x1c(%ebp),%eax 800f21: 8b 00 mov (%eax),%eax 800f23: 85 c0 test %eax,%eax 800f25: 74 d8 je 800eff <file_set_size+0x9e> free_block(*ptr); 800f27: 83 ec 0c sub $0xc,%esp 800f2a: 50 push %eax 800f2b: e8 40 f9 ff ff call 800870 <free_block> *ptr = 0; 800f30: 8b 45 e4 mov -0x1c(%ebp),%eax 800f33: c7 00 00 00 00 00 movl $0x0,(%eax) 800f39: 83 c4 10 add $0x10,%esp 800f3c: eb c1 jmp 800eff <file_set_size+0x9e> 00800f3e <file_write>: { 800f3e: 55 push %ebp 800f3f: 89 e5 mov %esp,%ebp 800f41: 57 push %edi 800f42: 56 push %esi 800f43: 53 push %ebx 800f44: 83 ec 2c sub $0x2c,%esp 800f47: 8b 7d 0c mov 0xc(%ebp),%edi 800f4a: 8b 75 14 mov 0x14(%ebp),%esi if (offset + count > f->f_size) 800f4d: 89 f0 mov %esi,%eax 800f4f: 03 45 10 add 0x10(%ebp),%eax 800f52: 89 45 d4 mov %eax,-0x2c(%ebp) 800f55: 8b 4d 08 mov 0x8(%ebp),%ecx 800f58: 3b 81 80 00 00 00 cmp 0x80(%ecx),%eax 800f5e: 77 68 ja 800fc8 <file_write+0x8a> for (pos = offset; pos < offset + count; ) { 800f60: 89 f3 mov %esi,%ebx 800f62: 39 75 d4 cmp %esi,-0x2c(%ebp) 800f65: 76 74 jbe 800fdb <file_write+0x9d> if ((r = file_get_block(f, pos / BLKSIZE, &blk)) < 0) 800f67: 83 ec 04 sub $0x4,%esp 800f6a: 8d 45 e4 lea -0x1c(%ebp),%eax 800f6d: 50 push %eax 800f6e: 8d 86 ff 0f 00 00 lea 0xfff(%esi),%eax 800f74: 85 f6 test %esi,%esi 800f76: 0f 49 c6 cmovns %esi,%eax 800f79: c1 f8 0c sar $0xc,%eax 800f7c: 50 push %eax 800f7d: ff 75 08 pushl 0x8(%ebp) 800f80: e8 5b fb ff ff call 800ae0 <file_get_block> 800f85: 83 c4 10 add $0x10,%esp 800f88: 85 c0 test %eax,%eax 800f8a: 78 52 js 800fde <file_write+0xa0> bn = MIN(BLKSIZE - pos % BLKSIZE, offset + count - pos); 800f8c: 89 f2 mov %esi,%edx 800f8e: c1 fa 1f sar $0x1f,%edx 800f91: c1 ea 14 shr $0x14,%edx 800f94: 8d 04 16 lea (%esi,%edx,1),%eax 800f97: 25 ff 0f 00 00 and $0xfff,%eax 800f9c: 29 d0 sub %edx,%eax 800f9e: b9 00 10 00 00 mov $0x1000,%ecx 800fa3: 29 c1 sub %eax,%ecx 800fa5: 8b 55 d4 mov -0x2c(%ebp),%edx 800fa8: 29 da sub %ebx,%edx 800faa: 39 d1 cmp %edx,%ecx 800fac: 89 d3 mov %edx,%ebx 800fae: 0f 46 d9 cmovbe %ecx,%ebx memmove(blk + pos % BLKSIZE, buf, bn); 800fb1: 83 ec 04 sub $0x4,%esp 800fb4: 53 push %ebx 800fb5: 57 push %edi 800fb6: 03 45 e4 add -0x1c(%ebp),%eax 800fb9: 50 push %eax 800fba: e8 24 14 00 00 call 8023e3 <memmove> pos += bn; 800fbf: 01 de add %ebx,%esi buf += bn; 800fc1: 01 df add %ebx,%edi 800fc3: 83 c4 10 add $0x10,%esp 800fc6: eb 98 jmp 800f60 <file_write+0x22> if ((r = file_set_size(f, offset + count)) < 0) 800fc8: 83 ec 08 sub $0x8,%esp 800fcb: 50 push %eax 800fcc: 51 push %ecx 800fcd: e8 8f fe ff ff call 800e61 <file_set_size> 800fd2: 83 c4 10 add $0x10,%esp 800fd5: 85 c0 test %eax,%eax 800fd7: 79 87 jns 800f60 <file_write+0x22> 800fd9: eb 03 jmp 800fde <file_write+0xa0> return count; 800fdb: 8b 45 10 mov 0x10(%ebp),%eax } 800fde: 8d 65 f4 lea -0xc(%ebp),%esp 800fe1: 5b pop %ebx 800fe2: 5e pop %esi 800fe3: 5f pop %edi 800fe4: 5d pop %ebp 800fe5: c3 ret 00800fe6 <file_flush>: // Loop over all the blocks in file. // Translate the file block number into a disk block number // and then check whether that disk block is dirty. If so, write it out. void file_flush(struct File *f) { 800fe6: 55 push %ebp 800fe7: 89 e5 mov %esp,%ebp 800fe9: 56 push %esi 800fea: 53 push %ebx 800feb: 83 ec 10 sub $0x10,%esp 800fee: 8b 75 08 mov 0x8(%ebp),%esi int i; uint32_t *pdiskbno; for (i = 0; i < (f->f_size + BLKSIZE - 1) / BLKSIZE; i++) { 800ff1: bb 00 00 00 00 mov $0x0,%ebx 800ff6: eb 03 jmp 800ffb <file_flush+0x15> 800ff8: 83 c3 01 add $0x1,%ebx 800ffb: 8b 96 80 00 00 00 mov 0x80(%esi),%edx 801001: 8d 8a ff 0f 00 00 lea 0xfff(%edx),%ecx 801007: 8d 82 fe 1f 00 00 lea 0x1ffe(%edx),%eax 80100d: 85 c9 test %ecx,%ecx 80100f: 0f 49 c1 cmovns %ecx,%eax 801012: c1 f8 0c sar $0xc,%eax 801015: 39 d8 cmp %ebx,%eax 801017: 7e 3b jle 801054 <file_flush+0x6e> if (file_block_walk(f, i, &pdiskbno, 0) < 0 || 801019: 83 ec 0c sub $0xc,%esp 80101c: 6a 00 push $0x0 80101e: 8d 4d f4 lea -0xc(%ebp),%ecx 801021: 89 da mov %ebx,%edx 801023: 89 f0 mov %esi,%eax 801025: e8 f0 f8 ff ff call 80091a <file_block_walk> 80102a: 83 c4 10 add $0x10,%esp 80102d: 85 c0 test %eax,%eax 80102f: 78 c7 js 800ff8 <file_flush+0x12> pdiskbno == NULL || *pdiskbno == 0) 801031: 8b 45 f4 mov -0xc(%ebp),%eax if (file_block_walk(f, i, &pdiskbno, 0) < 0 || 801034: 85 c0 test %eax,%eax 801036: 74 c0 je 800ff8 <file_flush+0x12> pdiskbno == NULL || *pdiskbno == 0) 801038: 8b 00 mov (%eax),%eax 80103a: 85 c0 test %eax,%eax 80103c: 74 ba je 800ff8 <file_flush+0x12> continue; flush_block(diskaddr(*pdiskbno)); 80103e: 83 ec 0c sub $0xc,%esp 801041: 50 push %eax 801042: e8 65 f3 ff ff call 8003ac <diskaddr> 801047: 89 04 24 mov %eax,(%esp) 80104a: e8 db f3 ff ff call 80042a <flush_block> 80104f: 83 c4 10 add $0x10,%esp 801052: eb a4 jmp 800ff8 <file_flush+0x12> } flush_block(f); 801054: 83 ec 0c sub $0xc,%esp 801057: 56 push %esi 801058: e8 cd f3 ff ff call 80042a <flush_block> if (f->f_indirect) 80105d: 8b 86 b0 00 00 00 mov 0xb0(%esi),%eax 801063: 83 c4 10 add $0x10,%esp 801066: 85 c0 test %eax,%eax 801068: 75 07 jne 801071 <file_flush+0x8b> flush_block(diskaddr(f->f_indirect)); } 80106a: 8d 65 f8 lea -0x8(%ebp),%esp 80106d: 5b pop %ebx 80106e: 5e pop %esi 80106f: 5d pop %ebp 801070: c3 ret flush_block(diskaddr(f->f_indirect)); 801071: 83 ec 0c sub $0xc,%esp 801074: 50 push %eax 801075: e8 32 f3 ff ff call 8003ac <diskaddr> 80107a: 89 04 24 mov %eax,(%esp) 80107d: e8 a8 f3 ff ff call 80042a <flush_block> 801082: 83 c4 10 add $0x10,%esp } 801085: eb e3 jmp 80106a <file_flush+0x84> 00801087 <file_create>: { 801087: 55 push %ebp 801088: 89 e5 mov %esp,%ebp 80108a: 57 push %edi 80108b: 56 push %esi 80108c: 53 push %ebx 80108d: 81 ec b8 00 00 00 sub $0xb8,%esp if ((r = walk_path(path, &dir, &f, name)) == 0) 801093: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 801099: 50 push %eax 80109a: 8d 8d 60 ff ff ff lea -0xa0(%ebp),%ecx 8010a0: 8d 95 64 ff ff ff lea -0x9c(%ebp),%edx 8010a6: 8b 45 08 mov 0x8(%ebp),%eax 8010a9: e8 b7 fa ff ff call 800b65 <walk_path> 8010ae: 83 c4 10 add $0x10,%esp 8010b1: 85 c0 test %eax,%eax 8010b3: 0f 84 0e 01 00 00 je 8011c7 <file_create+0x140> if (r != -E_NOT_FOUND || dir == 0) 8010b9: 83 f8 f5 cmp $0xfffffff5,%eax 8010bc: 74 08 je 8010c6 <file_create+0x3f> } 8010be: 8d 65 f4 lea -0xc(%ebp),%esp 8010c1: 5b pop %ebx 8010c2: 5e pop %esi 8010c3: 5f pop %edi 8010c4: 5d pop %ebp 8010c5: c3 ret if (r != -E_NOT_FOUND || dir == 0) 8010c6: 8b 9d 64 ff ff ff mov -0x9c(%ebp),%ebx 8010cc: 85 db test %ebx,%ebx 8010ce: 74 ee je 8010be <file_create+0x37> assert((dir->f_size % BLKSIZE) == 0); 8010d0: 8b 83 80 00 00 00 mov 0x80(%ebx),%eax 8010d6: a9 ff 0f 00 00 test $0xfff,%eax 8010db: 75 5c jne 801139 <file_create+0xb2> nblock = dir->f_size / BLKSIZE; 8010dd: 8d 90 ff 0f 00 00 lea 0xfff(%eax),%edx 8010e3: 85 c0 test %eax,%eax 8010e5: 0f 48 c2 cmovs %edx,%eax 8010e8: c1 f8 0c sar $0xc,%eax 8010eb: 89 85 54 ff ff ff mov %eax,-0xac(%ebp) for (i = 0; i < nblock; i++) { 8010f1: be 00 00 00 00 mov $0x0,%esi if ((r = file_get_block(dir, i, &blk)) < 0) 8010f6: 8d bd 5c ff ff ff lea -0xa4(%ebp),%edi for (i = 0; i < nblock; i++) { 8010fc: 39 b5 54 ff ff ff cmp %esi,-0xac(%ebp) 801102: 0f 84 8b 00 00 00 je 801193 <file_create+0x10c> if ((r = file_get_block(dir, i, &blk)) < 0) 801108: 83 ec 04 sub $0x4,%esp 80110b: 57 push %edi 80110c: 56 push %esi 80110d: 53 push %ebx 80110e: e8 cd f9 ff ff call 800ae0 <file_get_block> 801113: 83 c4 10 add $0x10,%esp 801116: 85 c0 test %eax,%eax 801118: 78 a4 js 8010be <file_create+0x37> 80111a: 8b 85 5c ff ff ff mov -0xa4(%ebp),%eax 801120: 8d 88 00 10 00 00 lea 0x1000(%eax),%ecx if (f[j].f_name[0] == '\0') { 801126: 80 38 00 cmpb $0x0,(%eax) 801129: 74 27 je 801152 <file_create+0xcb> 80112b: 05 00 01 00 00 add $0x100,%eax for (j = 0; j < BLKFILES; j++) 801130: 39 c8 cmp %ecx,%eax 801132: 75 f2 jne 801126 <file_create+0x9f> for (i = 0; i < nblock; i++) { 801134: 83 c6 01 add $0x1,%esi 801137: eb c3 jmp 8010fc <file_create+0x75> assert((dir->f_size % BLKSIZE) == 0); 801139: 68 11 3c 80 00 push $0x803c11 80113e: 68 7d 39 80 00 push $0x80397d 801143: 68 ea 00 00 00 push $0xea 801148: 68 79 3b 80 00 push $0x803b79 80114d: e8 09 0a 00 00 call 801b5b <_panic> *file = &f[j]; 801152: 89 85 60 ff ff ff mov %eax,-0xa0(%ebp) strcpy(f->f_name, name); 801158: 83 ec 08 sub $0x8,%esp 80115b: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 801161: 50 push %eax 801162: ff b5 60 ff ff ff pushl -0xa0(%ebp) 801168: e8 e8 10 00 00 call 802255 <strcpy> *pf = f; 80116d: 8b 45 0c mov 0xc(%ebp),%eax 801170: 8b 95 60 ff ff ff mov -0xa0(%ebp),%edx 801176: 89 10 mov %edx,(%eax) file_flush(dir); 801178: 83 c4 04 add $0x4,%esp 80117b: ff b5 64 ff ff ff pushl -0x9c(%ebp) 801181: e8 60 fe ff ff call 800fe6 <file_flush> return 0; 801186: 83 c4 10 add $0x10,%esp 801189: b8 00 00 00 00 mov $0x0,%eax 80118e: e9 2b ff ff ff jmp 8010be <file_create+0x37> dir->f_size += BLKSIZE; 801193: 81 83 80 00 00 00 00 addl $0x1000,0x80(%ebx) 80119a: 10 00 00 if ((r = file_get_block(dir, i, &blk)) < 0) 80119d: 83 ec 04 sub $0x4,%esp 8011a0: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax 8011a6: 50 push %eax 8011a7: 56 push %esi 8011a8: 53 push %ebx 8011a9: e8 32 f9 ff ff call 800ae0 <file_get_block> 8011ae: 83 c4 10 add $0x10,%esp 8011b1: 85 c0 test %eax,%eax 8011b3: 0f 88 05 ff ff ff js 8010be <file_create+0x37> *file = &f[0]; 8011b9: 8b 85 5c ff ff ff mov -0xa4(%ebp),%eax 8011bf: 89 85 60 ff ff ff mov %eax,-0xa0(%ebp) 8011c5: eb 91 jmp 801158 <file_create+0xd1> return -E_FILE_EXISTS; 8011c7: b8 f3 ff ff ff mov $0xfffffff3,%eax 8011cc: e9 ed fe ff ff jmp 8010be <file_create+0x37> 008011d1 <fs_sync>: // Sync the entire file system. A big hammer. void fs_sync(void) { 8011d1: 55 push %ebp 8011d2: 89 e5 mov %esp,%ebp 8011d4: 53 push %ebx 8011d5: 83 ec 04 sub $0x4,%esp int i; for (i = 1; i < super->s_nblocks; i++) 8011d8: bb 01 00 00 00 mov $0x1,%ebx 8011dd: eb 17 jmp 8011f6 <fs_sync+0x25> flush_block(diskaddr(i)); 8011df: 83 ec 0c sub $0xc,%esp 8011e2: 53 push %ebx 8011e3: e8 c4 f1 ff ff call 8003ac <diskaddr> 8011e8: 89 04 24 mov %eax,(%esp) 8011eb: e8 3a f2 ff ff call 80042a <flush_block> for (i = 1; i < super->s_nblocks; i++) 8011f0: 83 c3 01 add $0x1,%ebx 8011f3: 83 c4 10 add $0x10,%esp 8011f6: a1 08 a0 80 00 mov 0x80a008,%eax 8011fb: 39 58 04 cmp %ebx,0x4(%eax) 8011fe: 77 df ja 8011df <fs_sync+0xe> } 801200: 8b 5d fc mov -0x4(%ebp),%ebx 801203: c9 leave 801204: c3 ret 00801205 <serve_sync>: } int serve_sync(envid_t envid, union Fsipc *req) { 801205: 55 push %ebp 801206: 89 e5 mov %esp,%ebp 801208: 83 ec 08 sub $0x8,%esp fs_sync(); 80120b: e8 c1 ff ff ff call 8011d1 <fs_sync> return 0; } 801210: b8 00 00 00 00 mov $0x0,%eax 801215: c9 leave 801216: c3 ret 00801217 <serve_init>: { 801217: 55 push %ebp 801218: 89 e5 mov %esp,%ebp 80121a: ba 60 50 80 00 mov $0x805060,%edx uintptr_t va = FILEVA; 80121f: b9 00 00 00 d0 mov $0xd0000000,%ecx for (i = 0; i < MAXOPEN; i++) { 801224: b8 00 00 00 00 mov $0x0,%eax opentab[i].o_fileid = i; 801229: 89 02 mov %eax,(%edx) opentab[i].o_fd = (struct Fd*) va; 80122b: 89 4a 0c mov %ecx,0xc(%edx) va += PGSIZE; 80122e: 81 c1 00 10 00 00 add $0x1000,%ecx for (i = 0; i < MAXOPEN; i++) { 801234: 83 c0 01 add $0x1,%eax 801237: 83 c2 10 add $0x10,%edx 80123a: 3d 00 04 00 00 cmp $0x400,%eax 80123f: 75 e8 jne 801229 <serve_init+0x12> } 801241: 5d pop %ebp 801242: c3 ret 00801243 <openfile_alloc>: { 801243: 55 push %ebp 801244: 89 e5 mov %esp,%ebp 801246: 57 push %edi 801247: 56 push %esi 801248: 53 push %ebx 801249: 83 ec 0c sub $0xc,%esp 80124c: 8b 7d 08 mov 0x8(%ebp),%edi for (i = 0; i < MAXOPEN; i++) { 80124f: bb 00 00 00 00 mov $0x0,%ebx 801254: 89 de mov %ebx,%esi 801256: c1 e6 04 shl $0x4,%esi switch (pageref(opentab[i].o_fd)) { 801259: 83 ec 0c sub $0xc,%esp 80125c: ff b6 6c 50 80 00 pushl 0x80506c(%esi) 801262: e8 f3 19 00 00 call 802c5a <pageref> 801267: 83 c4 10 add $0x10,%esp 80126a: 85 c0 test %eax,%eax 80126c: 74 17 je 801285 <openfile_alloc+0x42> 80126e: 83 f8 01 cmp $0x1,%eax 801271: 74 30 je 8012a3 <openfile_alloc+0x60> for (i = 0; i < MAXOPEN; i++) { 801273: 83 c3 01 add $0x1,%ebx 801276: 81 fb 00 04 00 00 cmp $0x400,%ebx 80127c: 75 d6 jne 801254 <openfile_alloc+0x11> return -E_MAX_OPEN; 80127e: b8 f6 ff ff ff mov $0xfffffff6,%eax 801283: eb 4f jmp 8012d4 <openfile_alloc+0x91> if ((r = sys_page_alloc(0, opentab[i].o_fd, PTE_P|PTE_U|PTE_W)) < 0) 801285: 83 ec 04 sub $0x4,%esp 801288: 6a 07 push $0x7 80128a: 89 d8 mov %ebx,%eax 80128c: c1 e0 04 shl $0x4,%eax 80128f: ff b0 6c 50 80 00 pushl 0x80506c(%eax) 801295: 6a 00 push $0x0 801297: e8 b2 13 00 00 call 80264e <sys_page_alloc> 80129c: 83 c4 10 add $0x10,%esp 80129f: 85 c0 test %eax,%eax 8012a1: 78 31 js 8012d4 <openfile_alloc+0x91> opentab[i].o_fileid += MAXOPEN; 8012a3: c1 e3 04 shl $0x4,%ebx 8012a6: 81 83 60 50 80 00 00 addl $0x400,0x805060(%ebx) 8012ad: 04 00 00 *o = &opentab[i]; 8012b0: 81 c6 60 50 80 00 add $0x805060,%esi 8012b6: 89 37 mov %esi,(%edi) memset(opentab[i].o_fd, 0, PGSIZE); 8012b8: 83 ec 04 sub $0x4,%esp 8012bb: 68 00 10 00 00 push $0x1000 8012c0: 6a 00 push $0x0 8012c2: ff b3 6c 50 80 00 pushl 0x80506c(%ebx) 8012c8: e8 c9 10 00 00 call 802396 <memset> return (*o)->o_fileid; 8012cd: 8b 07 mov (%edi),%eax 8012cf: 8b 00 mov (%eax),%eax 8012d1: 83 c4 10 add $0x10,%esp } 8012d4: 8d 65 f4 lea -0xc(%ebp),%esp 8012d7: 5b pop %ebx 8012d8: 5e pop %esi 8012d9: 5f pop %edi 8012da: 5d pop %ebp 8012db: c3 ret 008012dc <openfile_lookup>: { 8012dc: 55 push %ebp 8012dd: 89 e5 mov %esp,%ebp 8012df: 57 push %edi 8012e0: 56 push %esi 8012e1: 53 push %ebx 8012e2: 83 ec 18 sub $0x18,%esp 8012e5: 8b 7d 0c mov 0xc(%ebp),%edi o = &opentab[fileid % MAXOPEN]; 8012e8: 89 fb mov %edi,%ebx 8012ea: 81 e3 ff 03 00 00 and $0x3ff,%ebx 8012f0: 89 de mov %ebx,%esi 8012f2: c1 e6 04 shl $0x4,%esi if (pageref(o->o_fd) <= 1 || o->o_fileid != fileid) 8012f5: ff b6 6c 50 80 00 pushl 0x80506c(%esi) o = &opentab[fileid % MAXOPEN]; 8012fb: 81 c6 60 50 80 00 add $0x805060,%esi if (pageref(o->o_fd) <= 1 || o->o_fileid != fileid) 801301: e8 54 19 00 00 call 802c5a <pageref> 801306: 83 c4 10 add $0x10,%esp 801309: 83 f8 01 cmp $0x1,%eax 80130c: 7e 1d jle 80132b <openfile_lookup+0x4f> 80130e: c1 e3 04 shl $0x4,%ebx 801311: 39 bb 60 50 80 00 cmp %edi,0x805060(%ebx) 801317: 75 19 jne 801332 <openfile_lookup+0x56> *po = o; 801319: 8b 45 10 mov 0x10(%ebp),%eax 80131c: 89 30 mov %esi,(%eax) return 0; 80131e: b8 00 00 00 00 mov $0x0,%eax } 801323: 8d 65 f4 lea -0xc(%ebp),%esp 801326: 5b pop %ebx 801327: 5e pop %esi 801328: 5f pop %edi 801329: 5d pop %ebp 80132a: c3 ret return -E_INVAL; 80132b: b8 fd ff ff ff mov $0xfffffffd,%eax 801330: eb f1 jmp 801323 <openfile_lookup+0x47> 801332: b8 fd ff ff ff mov $0xfffffffd,%eax 801337: eb ea jmp 801323 <openfile_lookup+0x47> 00801339 <serve_set_size>: { 801339: 55 push %ebp 80133a: 89 e5 mov %esp,%ebp 80133c: 53 push %ebx 80133d: 83 ec 18 sub $0x18,%esp 801340: 8b 5d 0c mov 0xc(%ebp),%ebx if ((r = openfile_lookup(envid, req->req_fileid, &o)) < 0) 801343: 8d 45 f4 lea -0xc(%ebp),%eax 801346: 50 push %eax 801347: ff 33 pushl (%ebx) 801349: ff 75 08 pushl 0x8(%ebp) 80134c: e8 8b ff ff ff call 8012dc <openfile_lookup> 801351: 83 c4 10 add $0x10,%esp 801354: 85 c0 test %eax,%eax 801356: 78 14 js 80136c <serve_set_size+0x33> return file_set_size(o->o_file, req->req_size); 801358: 83 ec 08 sub $0x8,%esp 80135b: ff 73 04 pushl 0x4(%ebx) 80135e: 8b 45 f4 mov -0xc(%ebp),%eax 801361: ff 70 04 pushl 0x4(%eax) 801364: e8 f8 fa ff ff call 800e61 <file_set_size> 801369: 83 c4 10 add $0x10,%esp } 80136c: 8b 5d fc mov -0x4(%ebp),%ebx 80136f: c9 leave 801370: c3 ret 00801371 <serve_read>: { 801371: 55 push %ebp 801372: 89 e5 mov %esp,%ebp 801374: 53 push %ebx 801375: 83 ec 18 sub $0x18,%esp 801378: 8b 5d 0c mov 0xc(%ebp),%ebx if ((r = openfile_lookup(envid, req->req_fileid, &o)) < 0) 80137b: 8d 45 f4 lea -0xc(%ebp),%eax 80137e: 50 push %eax 80137f: ff 33 pushl (%ebx) 801381: ff 75 08 pushl 0x8(%ebp) 801384: e8 53 ff ff ff call 8012dc <openfile_lookup> 801389: 83 c4 10 add $0x10,%esp 80138c: 85 c0 test %eax,%eax 80138e: 78 25 js 8013b5 <serve_read+0x44> if ((r = file_read(o->o_file, ret->ret_buf, req->req_n, o->o_fd->fd_offset)) < 0) 801390: 8b 45 f4 mov -0xc(%ebp),%eax 801393: 8b 50 0c mov 0xc(%eax),%edx 801396: ff 72 04 pushl 0x4(%edx) 801399: ff 73 04 pushl 0x4(%ebx) 80139c: 53 push %ebx 80139d: ff 70 04 pushl 0x4(%eax) 8013a0: e8 0f fa ff ff call 800db4 <file_read> 8013a5: 83 c4 10 add $0x10,%esp 8013a8: 85 c0 test %eax,%eax 8013aa: 78 09 js 8013b5 <serve_read+0x44> o->o_fd->fd_offset += r; 8013ac: 8b 55 f4 mov -0xc(%ebp),%edx 8013af: 8b 52 0c mov 0xc(%edx),%edx 8013b2: 01 42 04 add %eax,0x4(%edx) } 8013b5: 8b 5d fc mov -0x4(%ebp),%ebx 8013b8: c9 leave 8013b9: c3 ret 008013ba <serve_write>: { 8013ba: 55 push %ebp 8013bb: 89 e5 mov %esp,%ebp 8013bd: 53 push %ebx 8013be: 83 ec 18 sub $0x18,%esp 8013c1: 8b 5d 0c mov 0xc(%ebp),%ebx if ((r = openfile_lookup(envid, req->req_fileid, &o)) < 0) 8013c4: 8d 45 f4 lea -0xc(%ebp),%eax 8013c7: 50 push %eax 8013c8: ff 33 pushl (%ebx) 8013ca: ff 75 08 pushl 0x8(%ebp) 8013cd: e8 0a ff ff ff call 8012dc <openfile_lookup> 8013d2: 83 c4 10 add $0x10,%esp 8013d5: 85 c0 test %eax,%eax 8013d7: 78 28 js 801401 <serve_write+0x47> if ((r = file_write(o->o_file, req->req_buf, req->req_n, o->o_fd->fd_offset)) < 0) 8013d9: 8b 45 f4 mov -0xc(%ebp),%eax 8013dc: 8b 50 0c mov 0xc(%eax),%edx 8013df: ff 72 04 pushl 0x4(%edx) 8013e2: ff 73 04 pushl 0x4(%ebx) 8013e5: 83 c3 08 add $0x8,%ebx 8013e8: 53 push %ebx 8013e9: ff 70 04 pushl 0x4(%eax) 8013ec: e8 4d fb ff ff call 800f3e <file_write> 8013f1: 83 c4 10 add $0x10,%esp 8013f4: 85 c0 test %eax,%eax 8013f6: 78 09 js 801401 <serve_write+0x47> o->o_fd->fd_offset += r; 8013f8: 8b 55 f4 mov -0xc(%ebp),%edx 8013fb: 8b 52 0c mov 0xc(%edx),%edx 8013fe: 01 42 04 add %eax,0x4(%edx) } 801401: 8b 5d fc mov -0x4(%ebp),%ebx 801404: c9 leave 801405: c3 ret 00801406 <serve_stat>: { 801406: 55 push %ebp 801407: 89 e5 mov %esp,%ebp 801409: 53 push %ebx 80140a: 83 ec 18 sub $0x18,%esp 80140d: 8b 5d 0c mov 0xc(%ebp),%ebx if ((r = openfile_lookup(envid, req->req_fileid, &o)) < 0) 801410: 8d 45 f4 lea -0xc(%ebp),%eax 801413: 50 push %eax 801414: ff 33 pushl (%ebx) 801416: ff 75 08 pushl 0x8(%ebp) 801419: e8 be fe ff ff call 8012dc <openfile_lookup> 80141e: 83 c4 10 add $0x10,%esp 801421: 85 c0 test %eax,%eax 801423: 78 3f js 801464 <serve_stat+0x5e> strcpy(ret->ret_name, o->o_file->f_name); 801425: 83 ec 08 sub $0x8,%esp 801428: 8b 45 f4 mov -0xc(%ebp),%eax 80142b: ff 70 04 pushl 0x4(%eax) 80142e: 53 push %ebx 80142f: e8 21 0e 00 00 call 802255 <strcpy> ret->ret_size = o->o_file->f_size; 801434: 8b 45 f4 mov -0xc(%ebp),%eax 801437: 8b 50 04 mov 0x4(%eax),%edx 80143a: 8b 92 80 00 00 00 mov 0x80(%edx),%edx 801440: 89 93 80 00 00 00 mov %edx,0x80(%ebx) ret->ret_isdir = (o->o_file->f_type == FTYPE_DIR); 801446: 8b 40 04 mov 0x4(%eax),%eax 801449: 83 c4 10 add $0x10,%esp 80144c: 83 b8 84 00 00 00 01 cmpl $0x1,0x84(%eax) 801453: 0f 94 c0 sete %al 801456: 0f b6 c0 movzbl %al,%eax 801459: 89 83 84 00 00 00 mov %eax,0x84(%ebx) return 0; 80145f: b8 00 00 00 00 mov $0x0,%eax } 801464: 8b 5d fc mov -0x4(%ebp),%ebx 801467: c9 leave 801468: c3 ret 00801469 <serve_flush>: { 801469: 55 push %ebp 80146a: 89 e5 mov %esp,%ebp 80146c: 83 ec 1c sub $0x1c,%esp if ((r = openfile_lookup(envid, req->req_fileid, &o)) < 0) 80146f: 8d 45 f4 lea -0xc(%ebp),%eax 801472: 50 push %eax 801473: 8b 45 0c mov 0xc(%ebp),%eax 801476: ff 30 pushl (%eax) 801478: ff 75 08 pushl 0x8(%ebp) 80147b: e8 5c fe ff ff call 8012dc <openfile_lookup> 801480: 83 c4 10 add $0x10,%esp 801483: 85 c0 test %eax,%eax 801485: 78 16 js 80149d <serve_flush+0x34> file_flush(o->o_file); 801487: 83 ec 0c sub $0xc,%esp 80148a: 8b 45 f4 mov -0xc(%ebp),%eax 80148d: ff 70 04 pushl 0x4(%eax) 801490: e8 51 fb ff ff call 800fe6 <file_flush> return 0; 801495: 83 c4 10 add $0x10,%esp 801498: b8 00 00 00 00 mov $0x0,%eax } 80149d: c9 leave 80149e: c3 ret 0080149f <serve_open>: { 80149f: 55 push %ebp 8014a0: 89 e5 mov %esp,%ebp 8014a2: 53 push %ebx 8014a3: 81 ec 18 04 00 00 sub $0x418,%esp 8014a9: 8b 5d 0c mov 0xc(%ebp),%ebx memmove(path, req->req_path, MAXPATHLEN); 8014ac: 68 00 04 00 00 push $0x400 8014b1: 53 push %ebx 8014b2: 8d 85 f8 fb ff ff lea -0x408(%ebp),%eax 8014b8: 50 push %eax 8014b9: e8 25 0f 00 00 call 8023e3 <memmove> path[MAXPATHLEN-1] = 0; 8014be: c6 45 f7 00 movb $0x0,-0x9(%ebp) if ((r = openfile_alloc(&o)) < 0) { 8014c2: 8d 85 f0 fb ff ff lea -0x410(%ebp),%eax 8014c8: 89 04 24 mov %eax,(%esp) 8014cb: e8 73 fd ff ff call 801243 <openfile_alloc> 8014d0: 83 c4 10 add $0x10,%esp 8014d3: 85 c0 test %eax,%eax 8014d5: 0f 88 f0 00 00 00 js 8015cb <serve_open+0x12c> if (req->req_omode & O_CREAT) { 8014db: f6 83 01 04 00 00 01 testb $0x1,0x401(%ebx) 8014e2: 74 33 je 801517 <serve_open+0x78> if ((r = file_create(path, &f)) < 0) { 8014e4: 83 ec 08 sub $0x8,%esp 8014e7: 8d 85 f4 fb ff ff lea -0x40c(%ebp),%eax 8014ed: 50 push %eax 8014ee: 8d 85 f8 fb ff ff lea -0x408(%ebp),%eax 8014f4: 50 push %eax 8014f5: e8 8d fb ff ff call 801087 <file_create> 8014fa: 83 c4 10 add $0x10,%esp 8014fd: 85 c0 test %eax,%eax 8014ff: 79 37 jns 801538 <serve_open+0x99> if (!(req->req_omode & O_EXCL) && r == -E_FILE_EXISTS) 801501: f6 83 01 04 00 00 04 testb $0x4,0x401(%ebx) 801508: 0f 85 bd 00 00 00 jne 8015cb <serve_open+0x12c> 80150e: 83 f8 f3 cmp $0xfffffff3,%eax 801511: 0f 85 b4 00 00 00 jne 8015cb <serve_open+0x12c> if ((r = file_open(path, &f)) < 0) { 801517: 83 ec 08 sub $0x8,%esp 80151a: 8d 85 f4 fb ff ff lea -0x40c(%ebp),%eax 801520: 50 push %eax 801521: 8d 85 f8 fb ff ff lea -0x408(%ebp),%eax 801527: 50 push %eax 801528: e8 6d f8 ff ff call 800d9a <file_open> 80152d: 83 c4 10 add $0x10,%esp 801530: 85 c0 test %eax,%eax 801532: 0f 88 93 00 00 00 js 8015cb <serve_open+0x12c> if (req->req_omode & O_TRUNC) { 801538: f6 83 01 04 00 00 02 testb $0x2,0x401(%ebx) 80153f: 74 17 je 801558 <serve_open+0xb9> if ((r = file_set_size(f, 0)) < 0) { 801541: 83 ec 08 sub $0x8,%esp 801544: 6a 00 push $0x0 801546: ff b5 f4 fb ff ff pushl -0x40c(%ebp) 80154c: e8 10 f9 ff ff call 800e61 <file_set_size> 801551: 83 c4 10 add $0x10,%esp 801554: 85 c0 test %eax,%eax 801556: 78 73 js 8015cb <serve_open+0x12c> if ((r = file_open(path, &f)) < 0) { 801558: 83 ec 08 sub $0x8,%esp 80155b: 8d 85 f4 fb ff ff lea -0x40c(%ebp),%eax 801561: 50 push %eax 801562: 8d 85 f8 fb ff ff lea -0x408(%ebp),%eax 801568: 50 push %eax 801569: e8 2c f8 ff ff call 800d9a <file_open> 80156e: 83 c4 10 add $0x10,%esp 801571: 85 c0 test %eax,%eax 801573: 78 56 js 8015cb <serve_open+0x12c> o->o_file = f; 801575: 8b 85 f0 fb ff ff mov -0x410(%ebp),%eax 80157b: 8b 95 f4 fb ff ff mov -0x40c(%ebp),%edx 801581: 89 50 04 mov %edx,0x4(%eax) o->o_fd->fd_file.id = o->o_fileid; 801584: 8b 50 0c mov 0xc(%eax),%edx 801587: 8b 08 mov (%eax),%ecx 801589: 89 4a 0c mov %ecx,0xc(%edx) o->o_fd->fd_omode = req->req_omode & O_ACCMODE; 80158c: 8b 48 0c mov 0xc(%eax),%ecx 80158f: 8b 93 00 04 00 00 mov 0x400(%ebx),%edx 801595: 83 e2 03 and $0x3,%edx 801598: 89 51 08 mov %edx,0x8(%ecx) o->o_fd->fd_dev_id = devfile.dev_id; 80159b: 8b 40 0c mov 0xc(%eax),%eax 80159e: 8b 15 64 90 80 00 mov 0x809064,%edx 8015a4: 89 10 mov %edx,(%eax) o->o_mode = req->req_omode; 8015a6: 8b 85 f0 fb ff ff mov -0x410(%ebp),%eax 8015ac: 8b 93 00 04 00 00 mov 0x400(%ebx),%edx 8015b2: 89 50 08 mov %edx,0x8(%eax) *pg_store = o->o_fd; 8015b5: 8b 50 0c mov 0xc(%eax),%edx 8015b8: 8b 45 10 mov 0x10(%ebp),%eax 8015bb: 89 10 mov %edx,(%eax) *perm_store = PTE_P|PTE_U|PTE_W|PTE_SHARE; 8015bd: 8b 45 14 mov 0x14(%ebp),%eax 8015c0: c7 00 07 04 00 00 movl $0x407,(%eax) return 0; 8015c6: b8 00 00 00 00 mov $0x0,%eax } 8015cb: 8b 5d fc mov -0x4(%ebp),%ebx 8015ce: c9 leave 8015cf: c3 ret 008015d0 <serve>: [FSREQ_SYNC] = serve_sync }; void serve(void) { 8015d0: 55 push %ebp 8015d1: 89 e5 mov %esp,%ebp 8015d3: 56 push %esi 8015d4: 53 push %ebx 8015d5: 83 ec 10 sub $0x10,%esp int perm, r; void *pg; while (1) { perm = 0; req = ipc_recv((int32_t *) &whom, fsreq, &perm); 8015d8: 8d 5d f0 lea -0x10(%ebp),%ebx 8015db: 8d 75 f4 lea -0xc(%ebp),%esi 8015de: eb 68 jmp 801648 <serve+0x78> cprintf("fs req %d from %08x [page %08x: %s]\n", req, whom, uvpt[PGNUM(fsreq)], fsreq); // All requests must contain an argument page if (!(perm & PTE_P)) { cprintf("Invalid request from %08x: no argument page\n", 8015e0: 83 ec 08 sub $0x8,%esp 8015e3: ff 75 f4 pushl -0xc(%ebp) 8015e6: 68 4c 3c 80 00 push $0x803c4c 8015eb: e8 46 06 00 00 call 801c36 <cprintf> whom); continue; // just leave it hanging... 8015f0: 83 c4 10 add $0x10,%esp 8015f3: eb 53 jmp 801648 <serve+0x78> } pg = NULL; if (req == FSREQ_OPEN) { r = serve_open(whom, (struct Fsreq_open*)fsreq, &pg, &perm); 8015f5: 53 push %ebx 8015f6: 8d 45 ec lea -0x14(%ebp),%eax 8015f9: 50 push %eax 8015fa: ff 35 44 50 80 00 pushl 0x805044 801600: ff 75 f4 pushl -0xc(%ebp) 801603: e8 97 fe ff ff call 80149f <serve_open> 801608: 83 c4 10 add $0x10,%esp 80160b: eb 19 jmp 801626 <serve+0x56> } else if (req < ARRAY_SIZE(handlers) && handlers[req]) { r = handlers[req](whom, fsreq); } else { cprintf("Invalid request code %d from %08x\n", req, whom); 80160d: 83 ec 04 sub $0x4,%esp 801610: ff 75 f4 pushl -0xc(%ebp) 801613: 50 push %eax 801614: 68 7c 3c 80 00 push $0x803c7c 801619: e8 18 06 00 00 call 801c36 <cprintf> 80161e: 83 c4 10 add $0x10,%esp r = -E_INVAL; 801621: b8 fd ff ff ff mov $0xfffffffd,%eax } ipc_send(whom, r, pg, perm); 801626: ff 75 f0 pushl -0x10(%ebp) 801629: ff 75 ec pushl -0x14(%ebp) 80162c: 50 push %eax 80162d: ff 75 f4 pushl -0xc(%ebp) 801630: e8 f0 12 00 00 call 802925 <ipc_send> sys_page_unmap(0, fsreq); 801635: 83 c4 08 add $0x8,%esp 801638: ff 35 44 50 80 00 pushl 0x805044 80163e: 6a 00 push $0x0 801640: e8 8e 10 00 00 call 8026d3 <sys_page_unmap> 801645: 83 c4 10 add $0x10,%esp perm = 0; 801648: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) req = ipc_recv((int32_t *) &whom, fsreq, &perm); 80164f: 83 ec 04 sub $0x4,%esp 801652: 53 push %ebx 801653: ff 35 44 50 80 00 pushl 0x805044 801659: 56 push %esi 80165a: e8 5d 12 00 00 call 8028bc <ipc_recv> if (!(perm & PTE_P)) { 80165f: 83 c4 10 add $0x10,%esp 801662: f6 45 f0 01 testb $0x1,-0x10(%ebp) 801666: 0f 84 74 ff ff ff je 8015e0 <serve+0x10> pg = NULL; 80166c: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) if (req == FSREQ_OPEN) { 801673: 83 f8 01 cmp $0x1,%eax 801676: 0f 84 79 ff ff ff je 8015f5 <serve+0x25> } else if (req < ARRAY_SIZE(handlers) && handlers[req]) { 80167c: 83 f8 08 cmp $0x8,%eax 80167f: 77 8c ja 80160d <serve+0x3d> 801681: 8b 14 85 20 50 80 00 mov 0x805020(,%eax,4),%edx 801688: 85 d2 test %edx,%edx 80168a: 74 81 je 80160d <serve+0x3d> r = handlers[req](whom, fsreq); 80168c: 83 ec 08 sub $0x8,%esp 80168f: ff 35 44 50 80 00 pushl 0x805044 801695: ff 75 f4 pushl -0xc(%ebp) 801698: ff d2 call *%edx 80169a: 83 c4 10 add $0x10,%esp 80169d: eb 87 jmp 801626 <serve+0x56> 0080169f <umain>: } } void umain(int argc, char **argv) { 80169f: 55 push %ebp 8016a0: 89 e5 mov %esp,%ebp 8016a2: 83 ec 14 sub $0x14,%esp static_assert(sizeof(struct File) == 256); binaryname = "fs"; 8016a5: c7 05 60 90 80 00 9f movl $0x803c9f,0x809060 8016ac: 3c 80 00 cprintf("FS is running\n"); 8016af: 68 a2 3c 80 00 push $0x803ca2 8016b4: e8 7d 05 00 00 call 801c36 <cprintf> asm volatile("outw %0,%w1" : : "a" (data), "d" (port)); 8016b9: b8 00 8a ff ff mov $0xffff8a00,%eax 8016be: ba 00 8a 00 00 mov $0x8a00,%edx 8016c3: 66 ef out %ax,(%dx) // Check that we are able to do I/O outw(0x8A00, 0x8A00); cprintf("FS can do I/O\n"); 8016c5: c7 04 24 b1 3c 80 00 movl $0x803cb1,(%esp) 8016cc: e8 65 05 00 00 call 801c36 <cprintf> serve_init(); 8016d1: e8 41 fb ff ff call 801217 <serve_init> fs_init(); 8016d6: e8 a6 f3 ff ff call 800a81 <fs_init> fs_test(); 8016db: e8 05 00 00 00 call 8016e5 <fs_test> serve(); 8016e0: e8 eb fe ff ff call 8015d0 <serve> 008016e5 <fs_test>: static char *msg = "This is the NEW message of the day!\n\n"; void fs_test(void) { 8016e5: 55 push %ebp 8016e6: 89 e5 mov %esp,%ebp 8016e8: 53 push %ebx 8016e9: 83 ec 18 sub $0x18,%esp int r; char *blk; uint32_t *bits; // back up bitmap if ((r = sys_page_alloc(0, (void*) PGSIZE, PTE_P|PTE_U|PTE_W)) < 0) 8016ec: 6a 07 push $0x7 8016ee: 68 00 10 00 00 push $0x1000 8016f3: 6a 00 push $0x0 8016f5: e8 54 0f 00 00 call 80264e <sys_page_alloc> 8016fa: 83 c4 10 add $0x10,%esp 8016fd: 85 c0 test %eax,%eax 8016ff: 0f 88 6a 02 00 00 js 80196f <fs_test+0x28a> panic("sys_page_alloc: %e", r); bits = (uint32_t*) PGSIZE; memmove(bits, bitmap, PGSIZE); 801705: 83 ec 04 sub $0x4,%esp 801708: 68 00 10 00 00 push $0x1000 80170d: ff 35 04 a0 80 00 pushl 0x80a004 801713: 68 00 10 00 00 push $0x1000 801718: e8 c6 0c 00 00 call 8023e3 <memmove> // allocate block if ((r = alloc_block()) < 0) 80171d: e8 8a f1 ff ff call 8008ac <alloc_block> 801722: 83 c4 10 add $0x10,%esp 801725: 85 c0 test %eax,%eax 801727: 0f 88 54 02 00 00 js 801981 <fs_test+0x29c> panic("alloc_block: %e", r); // check that block was free assert(bits[r/32] & (1 << (r%32))); 80172d: 8d 50 1f lea 0x1f(%eax),%edx 801730: 85 c0 test %eax,%eax 801732: 0f 49 d0 cmovns %eax,%edx 801735: c1 fa 05 sar $0x5,%edx 801738: 89 c3 mov %eax,%ebx 80173a: c1 fb 1f sar $0x1f,%ebx 80173d: c1 eb 1b shr $0x1b,%ebx 801740: 8d 0c 18 lea (%eax,%ebx,1),%ecx 801743: 83 e1 1f and $0x1f,%ecx 801746: 29 d9 sub %ebx,%ecx 801748: b8 01 00 00 00 mov $0x1,%eax 80174d: d3 e0 shl %cl,%eax 80174f: 85 04 95 00 10 00 00 test %eax,0x1000(,%edx,4) 801756: 0f 84 37 02 00 00 je 801993 <fs_test+0x2ae> // and is not free any more assert(!(bitmap[r/32] & (1 << (r%32)))); 80175c: 8b 0d 04 a0 80 00 mov 0x80a004,%ecx 801762: 85 04 91 test %eax,(%ecx,%edx,4) 801765: 0f 85 3e 02 00 00 jne 8019a9 <fs_test+0x2c4> cprintf("alloc_block is good\n"); 80176b: 83 ec 0c sub $0xc,%esp 80176e: 68 08 3d 80 00 push $0x803d08 801773: e8 be 04 00 00 call 801c36 <cprintf> if ((r = file_open("/not-found", &f)) < 0 && r != -E_NOT_FOUND) 801778: 83 c4 08 add $0x8,%esp 80177b: 8d 45 f4 lea -0xc(%ebp),%eax 80177e: 50 push %eax 80177f: 68 1d 3d 80 00 push $0x803d1d 801784: e8 11 f6 ff ff call 800d9a <file_open> 801789: 83 c4 10 add $0x10,%esp 80178c: 83 f8 f5 cmp $0xfffffff5,%eax 80178f: 74 08 je 801799 <fs_test+0xb4> 801791: 85 c0 test %eax,%eax 801793: 0f 88 26 02 00 00 js 8019bf <fs_test+0x2da> panic("file_open /not-found: %e", r); else if (r == 0) 801799: 85 c0 test %eax,%eax 80179b: 0f 84 30 02 00 00 je 8019d1 <fs_test+0x2ec> panic("file_open /not-found succeeded!"); if ((r = file_open("/newmotd", &f)) < 0) 8017a1: 83 ec 08 sub $0x8,%esp 8017a4: 8d 45 f4 lea -0xc(%ebp),%eax 8017a7: 50 push %eax 8017a8: 68 41 3d 80 00 push $0x803d41 8017ad: e8 e8 f5 ff ff call 800d9a <file_open> 8017b2: 83 c4 10 add $0x10,%esp 8017b5: 85 c0 test %eax,%eax 8017b7: 0f 88 28 02 00 00 js 8019e5 <fs_test+0x300> panic("file_open /newmotd: %e", r); cprintf("file_open is good\n"); 8017bd: 83 ec 0c sub $0xc,%esp 8017c0: 68 61 3d 80 00 push $0x803d61 8017c5: e8 6c 04 00 00 call 801c36 <cprintf> if ((r = file_get_block(f, 0, &blk)) < 0) 8017ca: 83 c4 0c add $0xc,%esp 8017cd: 8d 45 f0 lea -0x10(%ebp),%eax 8017d0: 50 push %eax 8017d1: 6a 00 push $0x0 8017d3: ff 75 f4 pushl -0xc(%ebp) 8017d6: e8 05 f3 ff ff call 800ae0 <file_get_block> 8017db: 83 c4 10 add $0x10,%esp 8017de: 85 c0 test %eax,%eax 8017e0: 0f 88 11 02 00 00 js 8019f7 <fs_test+0x312> panic("file_get_block: %e", r); if (strcmp(blk, msg) != 0) 8017e6: 83 ec 08 sub $0x8,%esp 8017e9: 68 a8 3e 80 00 push $0x803ea8 8017ee: ff 75 f0 pushl -0x10(%ebp) 8017f1: e8 05 0b 00 00 call 8022fb <strcmp> 8017f6: 83 c4 10 add $0x10,%esp 8017f9: 85 c0 test %eax,%eax 8017fb: 0f 85 08 02 00 00 jne 801a09 <fs_test+0x324> panic("file_get_block returned wrong data"); cprintf("file_get_block is good\n"); 801801: 83 ec 0c sub $0xc,%esp 801804: 68 87 3d 80 00 push $0x803d87 801809: e8 28 04 00 00 call 801c36 <cprintf> *(volatile char*)blk = *(volatile char*)blk; 80180e: 8b 45 f0 mov -0x10(%ebp),%eax 801811: 0f b6 10 movzbl (%eax),%edx 801814: 88 10 mov %dl,(%eax) assert((uvpt[PGNUM(blk)] & PTE_D)); 801816: 8b 45 f0 mov -0x10(%ebp),%eax 801819: c1 e8 0c shr $0xc,%eax 80181c: 8b 04 85 00 00 40 ef mov -0x10c00000(,%eax,4),%eax 801823: 83 c4 10 add $0x10,%esp 801826: a8 40 test $0x40,%al 801828: 0f 84 ef 01 00 00 je 801a1d <fs_test+0x338> file_flush(f); 80182e: 83 ec 0c sub $0xc,%esp 801831: ff 75 f4 pushl -0xc(%ebp) 801834: e8 ad f7 ff ff call 800fe6 <file_flush> assert(!(uvpt[PGNUM(blk)] & PTE_D)); 801839: 8b 45 f0 mov -0x10(%ebp),%eax 80183c: c1 e8 0c shr $0xc,%eax 80183f: 8b 04 85 00 00 40 ef mov -0x10c00000(,%eax,4),%eax 801846: 83 c4 10 add $0x10,%esp 801849: a8 40 test $0x40,%al 80184b: 0f 85 e2 01 00 00 jne 801a33 <fs_test+0x34e> cprintf("file_flush is good\n"); 801851: 83 ec 0c sub $0xc,%esp 801854: 68 bb 3d 80 00 push $0x803dbb 801859: e8 d8 03 00 00 call 801c36 <cprintf> if ((r = file_set_size(f, 0)) < 0) 80185e: 83 c4 08 add $0x8,%esp 801861: 6a 00 push $0x0 801863: ff 75 f4 pushl -0xc(%ebp) 801866: e8 f6 f5 ff ff call 800e61 <file_set_size> 80186b: 83 c4 10 add $0x10,%esp 80186e: 85 c0 test %eax,%eax 801870: 0f 88 d3 01 00 00 js 801a49 <fs_test+0x364> panic("file_set_size: %e", r); assert(f->f_direct[0] == 0); 801876: 8b 45 f4 mov -0xc(%ebp),%eax 801879: 83 b8 88 00 00 00 00 cmpl $0x0,0x88(%eax) 801880: 0f 85 d5 01 00 00 jne 801a5b <fs_test+0x376> assert(!(uvpt[PGNUM(f)] & PTE_D)); 801886: c1 e8 0c shr $0xc,%eax 801889: 8b 04 85 00 00 40 ef mov -0x10c00000(,%eax,4),%eax 801890: a8 40 test $0x40,%al 801892: 0f 85 d9 01 00 00 jne 801a71 <fs_test+0x38c> cprintf("file_truncate is good\n"); 801898: 83 ec 0c sub $0xc,%esp 80189b: 68 0f 3e 80 00 push $0x803e0f 8018a0: e8 91 03 00 00 call 801c36 <cprintf> if ((r = file_set_size(f, strlen(msg))) < 0) 8018a5: c7 04 24 a8 3e 80 00 movl $0x803ea8,(%esp) 8018ac: e8 6d 09 00 00 call 80221e <strlen> 8018b1: 83 c4 08 add $0x8,%esp 8018b4: 50 push %eax 8018b5: ff 75 f4 pushl -0xc(%ebp) 8018b8: e8 a4 f5 ff ff call 800e61 <file_set_size> 8018bd: 83 c4 10 add $0x10,%esp 8018c0: 85 c0 test %eax,%eax 8018c2: 0f 88 bf 01 00 00 js 801a87 <fs_test+0x3a2> panic("file_set_size 2: %e", r); assert(!(uvpt[PGNUM(f)] & PTE_D)); 8018c8: 8b 45 f4 mov -0xc(%ebp),%eax 8018cb: 89 c2 mov %eax,%edx 8018cd: c1 ea 0c shr $0xc,%edx 8018d0: 8b 14 95 00 00 40 ef mov -0x10c00000(,%edx,4),%edx 8018d7: f6 c2 40 test $0x40,%dl 8018da: 0f 85 b9 01 00 00 jne 801a99 <fs_test+0x3b4> if ((r = file_get_block(f, 0, &blk)) < 0) 8018e0: 83 ec 04 sub $0x4,%esp 8018e3: 8d 55 f0 lea -0x10(%ebp),%edx 8018e6: 52 push %edx 8018e7: 6a 00 push $0x0 8018e9: 50 push %eax 8018ea: e8 f1 f1 ff ff call 800ae0 <file_get_block> 8018ef: 83 c4 10 add $0x10,%esp 8018f2: 85 c0 test %eax,%eax 8018f4: 0f 88 b5 01 00 00 js 801aaf <fs_test+0x3ca> panic("file_get_block 2: %e", r); strcpy(blk, msg); 8018fa: 83 ec 08 sub $0x8,%esp 8018fd: 68 a8 3e 80 00 push $0x803ea8 801902: ff 75 f0 pushl -0x10(%ebp) 801905: e8 4b 09 00 00 call 802255 <strcpy> assert((uvpt[PGNUM(blk)] & PTE_D)); 80190a: 8b 45 f0 mov -0x10(%ebp),%eax 80190d: c1 e8 0c shr $0xc,%eax 801910: 8b 04 85 00 00 40 ef mov -0x10c00000(,%eax,4),%eax 801917: 83 c4 10 add $0x10,%esp 80191a: a8 40 test $0x40,%al 80191c: 0f 84 9f 01 00 00 je 801ac1 <fs_test+0x3dc> file_flush(f); 801922: 83 ec 0c sub $0xc,%esp 801925: ff 75 f4 pushl -0xc(%ebp) 801928: e8 b9 f6 ff ff call 800fe6 <file_flush> assert(!(uvpt[PGNUM(blk)] & PTE_D)); 80192d: 8b 45 f0 mov -0x10(%ebp),%eax 801930: c1 e8 0c shr $0xc,%eax 801933: 8b 04 85 00 00 40 ef mov -0x10c00000(,%eax,4),%eax 80193a: 83 c4 10 add $0x10,%esp 80193d: a8 40 test $0x40,%al 80193f: 0f 85 92 01 00 00 jne 801ad7 <fs_test+0x3f2> assert(!(uvpt[PGNUM(f)] & PTE_D)); 801945: 8b 45 f4 mov -0xc(%ebp),%eax 801948: c1 e8 0c shr $0xc,%eax 80194b: 8b 04 85 00 00 40 ef mov -0x10c00000(,%eax,4),%eax 801952: a8 40 test $0x40,%al 801954: 0f 85 93 01 00 00 jne 801aed <fs_test+0x408> cprintf("file rewrite is good\n"); 80195a: 83 ec 0c sub $0xc,%esp 80195d: 68 4f 3e 80 00 push $0x803e4f 801962: e8 cf 02 00 00 call 801c36 <cprintf> } 801967: 83 c4 10 add $0x10,%esp 80196a: 8b 5d fc mov -0x4(%ebp),%ebx 80196d: c9 leave 80196e: c3 ret panic("sys_page_alloc: %e", r); 80196f: 50 push %eax 801970: 68 c0 3c 80 00 push $0x803cc0 801975: 6a 12 push $0x12 801977: 68 d3 3c 80 00 push $0x803cd3 80197c: e8 da 01 00 00 call 801b5b <_panic> panic("alloc_block: %e", r); 801981: 50 push %eax 801982: 68 dd 3c 80 00 push $0x803cdd 801987: 6a 17 push $0x17 801989: 68 d3 3c 80 00 push $0x803cd3 80198e: e8 c8 01 00 00 call 801b5b <_panic> assert(bits[r/32] & (1 << (r%32))); 801993: 68 ed 3c 80 00 push $0x803ced 801998: 68 7d 39 80 00 push $0x80397d 80199d: 6a 19 push $0x19 80199f: 68 d3 3c 80 00 push $0x803cd3 8019a4: e8 b2 01 00 00 call 801b5b <_panic> assert(!(bitmap[r/32] & (1 << (r%32)))); 8019a9: 68 68 3e 80 00 push $0x803e68 8019ae: 68 7d 39 80 00 push $0x80397d 8019b3: 6a 1b push $0x1b 8019b5: 68 d3 3c 80 00 push $0x803cd3 8019ba: e8 9c 01 00 00 call 801b5b <_panic> panic("file_open /not-found: %e", r); 8019bf: 50 push %eax 8019c0: 68 28 3d 80 00 push $0x803d28 8019c5: 6a 1f push $0x1f 8019c7: 68 d3 3c 80 00 push $0x803cd3 8019cc: e8 8a 01 00 00 call 801b5b <_panic> panic("file_open /not-found succeeded!"); 8019d1: 83 ec 04 sub $0x4,%esp 8019d4: 68 88 3e 80 00 push $0x803e88 8019d9: 6a 21 push $0x21 8019db: 68 d3 3c 80 00 push $0x803cd3 8019e0: e8 76 01 00 00 call 801b5b <_panic> panic("file_open /newmotd: %e", r); 8019e5: 50 push %eax 8019e6: 68 4a 3d 80 00 push $0x803d4a 8019eb: 6a 23 push $0x23 8019ed: 68 d3 3c 80 00 push $0x803cd3 8019f2: e8 64 01 00 00 call 801b5b <_panic> panic("file_get_block: %e", r); 8019f7: 50 push %eax 8019f8: 68 74 3d 80 00 push $0x803d74 8019fd: 6a 27 push $0x27 8019ff: 68 d3 3c 80 00 push $0x803cd3 801a04: e8 52 01 00 00 call 801b5b <_panic> panic("file_get_block returned wrong data"); 801a09: 83 ec 04 sub $0x4,%esp 801a0c: 68 d0 3e 80 00 push $0x803ed0 801a11: 6a 29 push $0x29 801a13: 68 d3 3c 80 00 push $0x803cd3 801a18: e8 3e 01 00 00 call 801b5b <_panic> assert((uvpt[PGNUM(blk)] & PTE_D)); 801a1d: 68 a0 3d 80 00 push $0x803da0 801a22: 68 7d 39 80 00 push $0x80397d 801a27: 6a 2d push $0x2d 801a29: 68 d3 3c 80 00 push $0x803cd3 801a2e: e8 28 01 00 00 call 801b5b <_panic> assert(!(uvpt[PGNUM(blk)] & PTE_D)); 801a33: 68 9f 3d 80 00 push $0x803d9f 801a38: 68 7d 39 80 00 push $0x80397d 801a3d: 6a 2f push $0x2f 801a3f: 68 d3 3c 80 00 push $0x803cd3 801a44: e8 12 01 00 00 call 801b5b <_panic> panic("file_set_size: %e", r); 801a49: 50 push %eax 801a4a: 68 cf 3d 80 00 push $0x803dcf 801a4f: 6a 33 push $0x33 801a51: 68 d3 3c 80 00 push $0x803cd3 801a56: e8 00 01 00 00 call 801b5b <_panic> assert(f->f_direct[0] == 0); 801a5b: 68 e1 3d 80 00 push $0x803de1 801a60: 68 7d 39 80 00 push $0x80397d 801a65: 6a 34 push $0x34 801a67: 68 d3 3c 80 00 push $0x803cd3 801a6c: e8 ea 00 00 00 call 801b5b <_panic> assert(!(uvpt[PGNUM(f)] & PTE_D)); 801a71: 68 f5 3d 80 00 push $0x803df5 801a76: 68 7d 39 80 00 push $0x80397d 801a7b: 6a 35 push $0x35 801a7d: 68 d3 3c 80 00 push $0x803cd3 801a82: e8 d4 00 00 00 call 801b5b <_panic> panic("file_set_size 2: %e", r); 801a87: 50 push %eax 801a88: 68 26 3e 80 00 push $0x803e26 801a8d: 6a 39 push $0x39 801a8f: 68 d3 3c 80 00 push $0x803cd3 801a94: e8 c2 00 00 00 call 801b5b <_panic> assert(!(uvpt[PGNUM(f)] & PTE_D)); 801a99: 68 f5 3d 80 00 push $0x803df5 801a9e: 68 7d 39 80 00 push $0x80397d 801aa3: 6a 3a push $0x3a 801aa5: 68 d3 3c 80 00 push $0x803cd3 801aaa: e8 ac 00 00 00 call 801b5b <_panic> panic("file_get_block 2: %e", r); 801aaf: 50 push %eax 801ab0: 68 3a 3e 80 00 push $0x803e3a 801ab5: 6a 3c push $0x3c 801ab7: 68 d3 3c 80 00 push $0x803cd3 801abc: e8 9a 00 00 00 call 801b5b <_panic> assert((uvpt[PGNUM(blk)] & PTE_D)); 801ac1: 68 a0 3d 80 00 push $0x803da0 801ac6: 68 7d 39 80 00 push $0x80397d 801acb: 6a 3e push $0x3e 801acd: 68 d3 3c 80 00 push $0x803cd3 801ad2: e8 84 00 00 00 call 801b5b <_panic> assert(!(uvpt[PGNUM(blk)] & PTE_D)); 801ad7: 68 9f 3d 80 00 push $0x803d9f 801adc: 68 7d 39 80 00 push $0x80397d 801ae1: 6a 40 push $0x40 801ae3: 68 d3 3c 80 00 push $0x803cd3 801ae8: e8 6e 00 00 00 call 801b5b <_panic> assert(!(uvpt[PGNUM(f)] & PTE_D)); 801aed: 68 f5 3d 80 00 push $0x803df5 801af2: 68 7d 39 80 00 push $0x80397d 801af7: 6a 41 push $0x41 801af9: 68 d3 3c 80 00 push $0x803cd3 801afe: e8 58 00 00 00 call 801b5b <_panic> 00801b03 <libmain>: const volatile struct Env *thisenv; const char *binaryname = "<unknown>"; void libmain(int argc, char **argv) { 801b03: 55 push %ebp 801b04: 89 e5 mov %esp,%ebp 801b06: 56 push %esi 801b07: 53 push %ebx 801b08: 8b 5d 08 mov 0x8(%ebp),%ebx 801b0b: 8b 75 0c mov 0xc(%ebp),%esi // set thisenv to point at our Env structure in envs[]. // LAB 3: Your code here. envid_t envid = sys_getenvid(); 801b0e: e8 fd 0a 00 00 call 802610 <sys_getenvid> thisenv = envs + ENVX(envid); 801b13: 25 ff 03 00 00 and $0x3ff,%eax 801b18: 6b c0 7c imul $0x7c,%eax,%eax 801b1b: 05 00 00 c0 ee add $0xeec00000,%eax 801b20: a3 0c a0 80 00 mov %eax,0x80a00c // save the name of the program so that panic() can use it if (argc > 0) 801b25: 85 db test %ebx,%ebx 801b27: 7e 07 jle 801b30 <libmain+0x2d> binaryname = argv[0]; 801b29: 8b 06 mov (%esi),%eax 801b2b: a3 60 90 80 00 mov %eax,0x809060 // call user main routine umain(argc, argv); 801b30: 83 ec 08 sub $0x8,%esp 801b33: 56 push %esi 801b34: 53 push %ebx 801b35: e8 65 fb ff ff call 80169f <umain> // exit gracefully exit(); 801b3a: e8 0a 00 00 00 call 801b49 <exit> } 801b3f: 83 c4 10 add $0x10,%esp 801b42: 8d 65 f8 lea -0x8(%ebp),%esp 801b45: 5b pop %ebx 801b46: 5e pop %esi 801b47: 5d pop %ebp 801b48: c3 ret 00801b49 <exit>: #include <inc/lib.h> void exit(void) { 801b49: 55 push %ebp 801b4a: 89 e5 mov %esp,%ebp 801b4c: 83 ec 14 sub $0x14,%esp // close_all(); sys_env_destroy(0); 801b4f: 6a 00 push $0x0 801b51: e8 79 0a 00 00 call 8025cf <sys_env_destroy> } 801b56: 83 c4 10 add $0x10,%esp 801b59: c9 leave 801b5a: c3 ret 00801b5b <_panic>: * It prints "panic: <message>", then causes a breakpoint exception, * which causes JOS to enter the JOS kernel monitor. */ void _panic(const char *file, int line, const char *fmt, ...) { 801b5b: 55 push %ebp 801b5c: 89 e5 mov %esp,%ebp 801b5e: 56 push %esi 801b5f: 53 push %ebx va_list ap; va_start(ap, fmt); 801b60: 8d 5d 14 lea 0x14(%ebp),%ebx // Print the panic message cprintf("[%08x] user panic in %s at %s:%d: ", 801b63: 8b 35 60 90 80 00 mov 0x809060,%esi 801b69: e8 a2 0a 00 00 call 802610 <sys_getenvid> 801b6e: 83 ec 0c sub $0xc,%esp 801b71: ff 75 0c pushl 0xc(%ebp) 801b74: ff 75 08 pushl 0x8(%ebp) 801b77: 56 push %esi 801b78: 50 push %eax 801b79: 68 00 3f 80 00 push $0x803f00 801b7e: e8 b3 00 00 00 call 801c36 <cprintf> sys_getenvid(), binaryname, file, line); vcprintf(fmt, ap); 801b83: 83 c4 18 add $0x18,%esp 801b86: 53 push %ebx 801b87: ff 75 10 pushl 0x10(%ebp) 801b8a: e8 56 00 00 00 call 801be5 <vcprintf> cprintf("\n"); 801b8f: c7 04 24 10 3b 80 00 movl $0x803b10,(%esp) 801b96: e8 9b 00 00 00 call 801c36 <cprintf> 801b9b: 83 c4 10 add $0x10,%esp // Cause a breakpoint exception while (1) asm volatile("int3"); 801b9e: cc int3 801b9f: eb fd jmp 801b9e <_panic+0x43> 00801ba1 <putch>: }; static void putch(int ch, struct printbuf *b) { 801ba1: 55 push %ebp 801ba2: 89 e5 mov %esp,%ebp 801ba4: 53 push %ebx 801ba5: 83 ec 04 sub $0x4,%esp 801ba8: 8b 5d 0c mov 0xc(%ebp),%ebx b->buf[b->idx++] = ch; 801bab: 8b 13 mov (%ebx),%edx 801bad: 8d 42 01 lea 0x1(%edx),%eax 801bb0: 89 03 mov %eax,(%ebx) 801bb2: 8b 4d 08 mov 0x8(%ebp),%ecx 801bb5: 88 4c 13 08 mov %cl,0x8(%ebx,%edx,1) if (b->idx == 256-1) { 801bb9: 3d ff 00 00 00 cmp $0xff,%eax 801bbe: 74 09 je 801bc9 <putch+0x28> sys_cputs(b->buf, b->idx); b->idx = 0; } b->cnt++; 801bc0: 83 43 04 01 addl $0x1,0x4(%ebx) } 801bc4: 8b 5d fc mov -0x4(%ebp),%ebx 801bc7: c9 leave 801bc8: c3 ret sys_cputs(b->buf, b->idx); 801bc9: 83 ec 08 sub $0x8,%esp 801bcc: 68 ff 00 00 00 push $0xff 801bd1: 8d 43 08 lea 0x8(%ebx),%eax 801bd4: 50 push %eax 801bd5: e8 b8 09 00 00 call 802592 <sys_cputs> b->idx = 0; 801bda: c7 03 00 00 00 00 movl $0x0,(%ebx) 801be0: 83 c4 10 add $0x10,%esp 801be3: eb db jmp 801bc0 <putch+0x1f> 00801be5 <vcprintf>: int vcprintf(const char *fmt, va_list ap) { 801be5: 55 push %ebp 801be6: 89 e5 mov %esp,%ebp 801be8: 81 ec 18 01 00 00 sub $0x118,%esp struct printbuf b; b.idx = 0; 801bee: c7 85 f0 fe ff ff 00 movl $0x0,-0x110(%ebp) 801bf5: 00 00 00 b.cnt = 0; 801bf8: c7 85 f4 fe ff ff 00 movl $0x0,-0x10c(%ebp) 801bff: 00 00 00 vprintfmt((void*)putch, &b, fmt, ap); 801c02: ff 75 0c pushl 0xc(%ebp) 801c05: ff 75 08 pushl 0x8(%ebp) 801c08: 8d 85 f0 fe ff ff lea -0x110(%ebp),%eax 801c0e: 50 push %eax 801c0f: 68 a1 1b 80 00 push $0x801ba1 801c14: e8 1a 01 00 00 call 801d33 <vprintfmt> sys_cputs(b.buf, b.idx); 801c19: 83 c4 08 add $0x8,%esp 801c1c: ff b5 f0 fe ff ff pushl -0x110(%ebp) 801c22: 8d 85 f8 fe ff ff lea -0x108(%ebp),%eax 801c28: 50 push %eax 801c29: e8 64 09 00 00 call 802592 <sys_cputs> return b.cnt; } 801c2e: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax 801c34: c9 leave 801c35: c3 ret 00801c36 <cprintf>: int cprintf(const char *fmt, ...) { 801c36: 55 push %ebp 801c37: 89 e5 mov %esp,%ebp 801c39: 83 ec 10 sub $0x10,%esp va_list ap; int cnt; va_start(ap, fmt); 801c3c: 8d 45 0c lea 0xc(%ebp),%eax cnt = vcprintf(fmt, ap); 801c3f: 50 push %eax 801c40: ff 75 08 pushl 0x8(%ebp) 801c43: e8 9d ff ff ff call 801be5 <vcprintf> va_end(ap); return cnt; } 801c48: c9 leave 801c49: c3 ret 00801c4a <printnum>: * using specified putch function and associated pointer putdat. */ static void printnum(void (*putch)(int, void*), void *putdat, unsigned long long num, unsigned base, int width, int padc) { 801c4a: 55 push %ebp 801c4b: 89 e5 mov %esp,%ebp 801c4d: 57 push %edi 801c4e: 56 push %esi 801c4f: 53 push %ebx 801c50: 83 ec 1c sub $0x1c,%esp 801c53: 89 c7 mov %eax,%edi 801c55: 89 d6 mov %edx,%esi 801c57: 8b 45 08 mov 0x8(%ebp),%eax 801c5a: 8b 55 0c mov 0xc(%ebp),%edx 801c5d: 89 45 d8 mov %eax,-0x28(%ebp) 801c60: 89 55 dc mov %edx,-0x24(%ebp) // first recursively print all preceding (more significant) digits if (num >= base) { 801c63: 8b 4d 10 mov 0x10(%ebp),%ecx 801c66: bb 00 00 00 00 mov $0x0,%ebx 801c6b: 89 4d e0 mov %ecx,-0x20(%ebp) 801c6e: 89 5d e4 mov %ebx,-0x1c(%ebp) 801c71: 39 d3 cmp %edx,%ebx 801c73: 72 05 jb 801c7a <printnum+0x30> 801c75: 39 45 10 cmp %eax,0x10(%ebp) 801c78: 77 7a ja 801cf4 <printnum+0xaa> printnum(putch, putdat, num / base, base, width - 1, padc); 801c7a: 83 ec 0c sub $0xc,%esp 801c7d: ff 75 18 pushl 0x18(%ebp) 801c80: 8b 45 14 mov 0x14(%ebp),%eax 801c83: 8d 58 ff lea -0x1(%eax),%ebx 801c86: 53 push %ebx 801c87: ff 75 10 pushl 0x10(%ebp) 801c8a: 83 ec 08 sub $0x8,%esp 801c8d: ff 75 e4 pushl -0x1c(%ebp) 801c90: ff 75 e0 pushl -0x20(%ebp) 801c93: ff 75 dc pushl -0x24(%ebp) 801c96: ff 75 d8 pushl -0x28(%ebp) 801c99: e8 62 1a 00 00 call 803700 <__udivdi3> 801c9e: 83 c4 18 add $0x18,%esp 801ca1: 52 push %edx 801ca2: 50 push %eax 801ca3: 89 f2 mov %esi,%edx 801ca5: 89 f8 mov %edi,%eax 801ca7: e8 9e ff ff ff call 801c4a <printnum> 801cac: 83 c4 20 add $0x20,%esp 801caf: eb 13 jmp 801cc4 <printnum+0x7a> } else { // print any needed pad characters before first digit while (--width > 0) putch(padc, putdat); 801cb1: 83 ec 08 sub $0x8,%esp 801cb4: 56 push %esi 801cb5: ff 75 18 pushl 0x18(%ebp) 801cb8: ff d7 call *%edi 801cba: 83 c4 10 add $0x10,%esp while (--width > 0) 801cbd: 83 eb 01 sub $0x1,%ebx 801cc0: 85 db test %ebx,%ebx 801cc2: 7f ed jg 801cb1 <printnum+0x67> } // then print this (the least significant) digit putch("0123456789abcdef"[num % base], putdat); 801cc4: 83 ec 08 sub $0x8,%esp 801cc7: 56 push %esi 801cc8: 83 ec 04 sub $0x4,%esp 801ccb: ff 75 e4 pushl -0x1c(%ebp) 801cce: ff 75 e0 pushl -0x20(%ebp) 801cd1: ff 75 dc pushl -0x24(%ebp) 801cd4: ff 75 d8 pushl -0x28(%ebp) 801cd7: e8 44 1b 00 00 call 803820 <__umoddi3> 801cdc: 83 c4 14 add $0x14,%esp 801cdf: 0f be 80 23 3f 80 00 movsbl 0x803f23(%eax),%eax 801ce6: 50 push %eax 801ce7: ff d7 call *%edi } 801ce9: 83 c4 10 add $0x10,%esp 801cec: 8d 65 f4 lea -0xc(%ebp),%esp 801cef: 5b pop %ebx 801cf0: 5e pop %esi 801cf1: 5f pop %edi 801cf2: 5d pop %ebp 801cf3: c3 ret 801cf4: 8b 5d 14 mov 0x14(%ebp),%ebx 801cf7: eb c4 jmp 801cbd <printnum+0x73> 00801cf9 <sprintputch>: int cnt; }; static void sprintputch(int ch, struct sprintbuf *b) { 801cf9: 55 push %ebp 801cfa: 89 e5 mov %esp,%ebp 801cfc: 8b 45 0c mov 0xc(%ebp),%eax b->cnt++; 801cff: 83 40 08 01 addl $0x1,0x8(%eax) if (b->buf < b->ebuf) 801d03: 8b 10 mov (%eax),%edx 801d05: 3b 50 04 cmp 0x4(%eax),%edx 801d08: 73 0a jae 801d14 <sprintputch+0x1b> *b->buf++ = ch; 801d0a: 8d 4a 01 lea 0x1(%edx),%ecx 801d0d: 89 08 mov %ecx,(%eax) 801d0f: 8b 45 08 mov 0x8(%ebp),%eax 801d12: 88 02 mov %al,(%edx) } 801d14: 5d pop %ebp 801d15: c3 ret 00801d16 <printfmt>: { 801d16: 55 push %ebp 801d17: 89 e5 mov %esp,%ebp 801d19: 83 ec 08 sub $0x8,%esp va_start(ap, fmt); 801d1c: 8d 45 14 lea 0x14(%ebp),%eax vprintfmt(putch, putdat, fmt, ap); 801d1f: 50 push %eax 801d20: ff 75 10 pushl 0x10(%ebp) 801d23: ff 75 0c pushl 0xc(%ebp) 801d26: ff 75 08 pushl 0x8(%ebp) 801d29: e8 05 00 00 00 call 801d33 <vprintfmt> } 801d2e: 83 c4 10 add $0x10,%esp 801d31: c9 leave 801d32: c3 ret 00801d33 <vprintfmt>: { 801d33: 55 push %ebp 801d34: 89 e5 mov %esp,%ebp 801d36: 57 push %edi 801d37: 56 push %esi 801d38: 53 push %ebx 801d39: 83 ec 2c sub $0x2c,%esp 801d3c: 8b 75 08 mov 0x8(%ebp),%esi 801d3f: 8b 5d 0c mov 0xc(%ebp),%ebx 801d42: 8b 7d 10 mov 0x10(%ebp),%edi 801d45: e9 c1 03 00 00 jmp 80210b <vprintfmt+0x3d8> padc = ' '; 801d4a: c6 45 d4 20 movb $0x20,-0x2c(%ebp) altflag = 0; 801d4e: c7 45 d8 00 00 00 00 movl $0x0,-0x28(%ebp) precision = -1; 801d55: c7 45 d0 ff ff ff ff movl $0xffffffff,-0x30(%ebp) width = -1; 801d5c: c7 45 e0 ff ff ff ff movl $0xffffffff,-0x20(%ebp) lflag = 0; 801d63: b9 00 00 00 00 mov $0x0,%ecx switch (ch = *(unsigned char *) fmt++) { 801d68: 8d 47 01 lea 0x1(%edi),%eax 801d6b: 89 45 e4 mov %eax,-0x1c(%ebp) 801d6e: 0f b6 17 movzbl (%edi),%edx 801d71: 8d 42 dd lea -0x23(%edx),%eax 801d74: 3c 55 cmp $0x55,%al 801d76: 0f 87 12 04 00 00 ja 80218e <vprintfmt+0x45b> 801d7c: 0f b6 c0 movzbl %al,%eax 801d7f: ff 24 85 60 40 80 00 jmp *0x804060(,%eax,4) 801d86: 8b 7d e4 mov -0x1c(%ebp),%edi padc = '-'; 801d89: c6 45 d4 2d movb $0x2d,-0x2c(%ebp) 801d8d: eb d9 jmp 801d68 <vprintfmt+0x35> switch (ch = *(unsigned char *) fmt++) { 801d8f: 8b 7d e4 mov -0x1c(%ebp),%edi padc = '0'; 801d92: c6 45 d4 30 movb $0x30,-0x2c(%ebp) 801d96: eb d0 jmp 801d68 <vprintfmt+0x35> switch (ch = *(unsigned char *) fmt++) { 801d98: 0f b6 d2 movzbl %dl,%edx 801d9b: 8b 7d e4 mov -0x1c(%ebp),%edi for (precision = 0; ; ++fmt) { 801d9e: b8 00 00 00 00 mov $0x0,%eax 801da3: 89 4d e4 mov %ecx,-0x1c(%ebp) precision = precision * 10 + ch - '0'; 801da6: 8d 04 80 lea (%eax,%eax,4),%eax 801da9: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax ch = *fmt; 801dad: 0f be 17 movsbl (%edi),%edx if (ch < '0' || ch > '9') 801db0: 8d 4a d0 lea -0x30(%edx),%ecx 801db3: 83 f9 09 cmp $0x9,%ecx 801db6: 77 55 ja 801e0d <vprintfmt+0xda> for (precision = 0; ; ++fmt) { 801db8: 83 c7 01 add $0x1,%edi precision = precision * 10 + ch - '0'; 801dbb: eb e9 jmp 801da6 <vprintfmt+0x73> precision = va_arg(ap, int); 801dbd: 8b 45 14 mov 0x14(%ebp),%eax 801dc0: 8b 00 mov (%eax),%eax 801dc2: 89 45 d0 mov %eax,-0x30(%ebp) 801dc5: 8b 45 14 mov 0x14(%ebp),%eax 801dc8: 8d 40 04 lea 0x4(%eax),%eax 801dcb: 89 45 14 mov %eax,0x14(%ebp) switch (ch = *(unsigned char *) fmt++) { 801dce: 8b 7d e4 mov -0x1c(%ebp),%edi if (width < 0) 801dd1: 83 7d e0 00 cmpl $0x0,-0x20(%ebp) 801dd5: 79 91 jns 801d68 <vprintfmt+0x35> width = precision, precision = -1; 801dd7: 8b 45 d0 mov -0x30(%ebp),%eax 801dda: 89 45 e0 mov %eax,-0x20(%ebp) 801ddd: c7 45 d0 ff ff ff ff movl $0xffffffff,-0x30(%ebp) 801de4: eb 82 jmp 801d68 <vprintfmt+0x35> 801de6: 8b 45 e0 mov -0x20(%ebp),%eax 801de9: 85 c0 test %eax,%eax 801deb: ba 00 00 00 00 mov $0x0,%edx 801df0: 0f 49 d0 cmovns %eax,%edx 801df3: 89 55 e0 mov %edx,-0x20(%ebp) switch (ch = *(unsigned char *) fmt++) { 801df6: 8b 7d e4 mov -0x1c(%ebp),%edi 801df9: e9 6a ff ff ff jmp 801d68 <vprintfmt+0x35> 801dfe: 8b 7d e4 mov -0x1c(%ebp),%edi altflag = 1; 801e01: c7 45 d8 01 00 00 00 movl $0x1,-0x28(%ebp) goto reswitch; 801e08: e9 5b ff ff ff jmp 801d68 <vprintfmt+0x35> 801e0d: 8b 4d e4 mov -0x1c(%ebp),%ecx 801e10: 89 45 d0 mov %eax,-0x30(%ebp) 801e13: eb bc jmp 801dd1 <vprintfmt+0x9e> lflag++; 801e15: 83 c1 01 add $0x1,%ecx switch (ch = *(unsigned char *) fmt++) { 801e18: 8b 7d e4 mov -0x1c(%ebp),%edi goto reswitch; 801e1b: e9 48 ff ff ff jmp 801d68 <vprintfmt+0x35> putch(va_arg(ap, int), putdat); 801e20: 8b 45 14 mov 0x14(%ebp),%eax 801e23: 8d 78 04 lea 0x4(%eax),%edi 801e26: 83 ec 08 sub $0x8,%esp 801e29: 53 push %ebx 801e2a: ff 30 pushl (%eax) 801e2c: ff d6 call *%esi break; 801e2e: 83 c4 10 add $0x10,%esp putch(va_arg(ap, int), putdat); 801e31: 89 7d 14 mov %edi,0x14(%ebp) break; 801e34: e9 cf 02 00 00 jmp 802108 <vprintfmt+0x3d5> err = va_arg(ap, int); 801e39: 8b 45 14 mov 0x14(%ebp),%eax 801e3c: 8d 78 04 lea 0x4(%eax),%edi 801e3f: 8b 00 mov (%eax),%eax 801e41: 99 cltd 801e42: 31 d0 xor %edx,%eax 801e44: 29 d0 sub %edx,%eax if (err >= MAXERROR || (p = error_string[err]) == NULL) 801e46: 83 f8 0f cmp $0xf,%eax 801e49: 7f 23 jg 801e6e <vprintfmt+0x13b> 801e4b: 8b 14 85 c0 41 80 00 mov 0x8041c0(,%eax,4),%edx 801e52: 85 d2 test %edx,%edx 801e54: 74 18 je 801e6e <vprintfmt+0x13b> printfmt(putch, putdat, "%s", p); 801e56: 52 push %edx 801e57: 68 8f 39 80 00 push $0x80398f 801e5c: 53 push %ebx 801e5d: 56 push %esi 801e5e: e8 b3 fe ff ff call 801d16 <printfmt> 801e63: 83 c4 10 add $0x10,%esp err = va_arg(ap, int); 801e66: 89 7d 14 mov %edi,0x14(%ebp) 801e69: e9 9a 02 00 00 jmp 802108 <vprintfmt+0x3d5> printfmt(putch, putdat, "error %d", err); 801e6e: 50 push %eax 801e6f: 68 3b 3f 80 00 push $0x803f3b 801e74: 53 push %ebx 801e75: 56 push %esi 801e76: e8 9b fe ff ff call 801d16 <printfmt> 801e7b: 83 c4 10 add $0x10,%esp err = va_arg(ap, int); 801e7e: 89 7d 14 mov %edi,0x14(%ebp) printfmt(putch, putdat, "error %d", err); 801e81: e9 82 02 00 00 jmp 802108 <vprintfmt+0x3d5> if ((p = va_arg(ap, char *)) == NULL) 801e86: 8b 45 14 mov 0x14(%ebp),%eax 801e89: 83 c0 04 add $0x4,%eax 801e8c: 89 45 cc mov %eax,-0x34(%ebp) 801e8f: 8b 45 14 mov 0x14(%ebp),%eax 801e92: 8b 38 mov (%eax),%edi p = "(null)"; 801e94: 85 ff test %edi,%edi 801e96: b8 34 3f 80 00 mov $0x803f34,%eax 801e9b: 0f 44 f8 cmove %eax,%edi if (width > 0 && padc != '-') 801e9e: 83 7d e0 00 cmpl $0x0,-0x20(%ebp) 801ea2: 0f 8e bd 00 00 00 jle 801f65 <vprintfmt+0x232> 801ea8: 80 7d d4 2d cmpb $0x2d,-0x2c(%ebp) 801eac: 75 0e jne 801ebc <vprintfmt+0x189> 801eae: 89 75 08 mov %esi,0x8(%ebp) 801eb1: 8b 75 d0 mov -0x30(%ebp),%esi 801eb4: 89 5d 0c mov %ebx,0xc(%ebp) 801eb7: 8b 5d e0 mov -0x20(%ebp),%ebx 801eba: eb 6d jmp 801f29 <vprintfmt+0x1f6> for (width -= strnlen(p, precision); width > 0; width--) 801ebc: 83 ec 08 sub $0x8,%esp 801ebf: ff 75 d0 pushl -0x30(%ebp) 801ec2: 57 push %edi 801ec3: e8 6e 03 00 00 call 802236 <strnlen> 801ec8: 8b 4d e0 mov -0x20(%ebp),%ecx 801ecb: 29 c1 sub %eax,%ecx 801ecd: 89 4d c8 mov %ecx,-0x38(%ebp) 801ed0: 83 c4 10 add $0x10,%esp putch(padc, putdat); 801ed3: 0f be 45 d4 movsbl -0x2c(%ebp),%eax 801ed7: 89 45 e0 mov %eax,-0x20(%ebp) 801eda: 89 7d d4 mov %edi,-0x2c(%ebp) 801edd: 89 cf mov %ecx,%edi for (width -= strnlen(p, precision); width > 0; width--) 801edf: eb 0f jmp 801ef0 <vprintfmt+0x1bd> putch(padc, putdat); 801ee1: 83 ec 08 sub $0x8,%esp 801ee4: 53 push %ebx 801ee5: ff 75 e0 pushl -0x20(%ebp) 801ee8: ff d6 call *%esi for (width -= strnlen(p, precision); width > 0; width--) 801eea: 83 ef 01 sub $0x1,%edi 801eed: 83 c4 10 add $0x10,%esp 801ef0: 85 ff test %edi,%edi 801ef2: 7f ed jg 801ee1 <vprintfmt+0x1ae> 801ef4: 8b 7d d4 mov -0x2c(%ebp),%edi 801ef7: 8b 4d c8 mov -0x38(%ebp),%ecx 801efa: 85 c9 test %ecx,%ecx 801efc: b8 00 00 00 00 mov $0x0,%eax 801f01: 0f 49 c1 cmovns %ecx,%eax 801f04: 29 c1 sub %eax,%ecx 801f06: 89 75 08 mov %esi,0x8(%ebp) 801f09: 8b 75 d0 mov -0x30(%ebp),%esi 801f0c: 89 5d 0c mov %ebx,0xc(%ebp) 801f0f: 89 cb mov %ecx,%ebx 801f11: eb 16 jmp 801f29 <vprintfmt+0x1f6> if (altflag && (ch < ' ' || ch > '~')) 801f13: 83 7d d8 00 cmpl $0x0,-0x28(%ebp) 801f17: 75 31 jne 801f4a <vprintfmt+0x217> putch(ch, putdat); 801f19: 83 ec 08 sub $0x8,%esp 801f1c: ff 75 0c pushl 0xc(%ebp) 801f1f: 50 push %eax 801f20: ff 55 08 call *0x8(%ebp) 801f23: 83 c4 10 add $0x10,%esp for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--) 801f26: 83 eb 01 sub $0x1,%ebx 801f29: 83 c7 01 add $0x1,%edi 801f2c: 0f b6 57 ff movzbl -0x1(%edi),%edx 801f30: 0f be c2 movsbl %dl,%eax 801f33: 85 c0 test %eax,%eax 801f35: 74 59 je 801f90 <vprintfmt+0x25d> 801f37: 85 f6 test %esi,%esi 801f39: 78 d8 js 801f13 <vprintfmt+0x1e0> 801f3b: 83 ee 01 sub $0x1,%esi 801f3e: 79 d3 jns 801f13 <vprintfmt+0x1e0> 801f40: 89 df mov %ebx,%edi 801f42: 8b 75 08 mov 0x8(%ebp),%esi 801f45: 8b 5d 0c mov 0xc(%ebp),%ebx 801f48: eb 37 jmp 801f81 <vprintfmt+0x24e> if (altflag && (ch < ' ' || ch > '~')) 801f4a: 0f be d2 movsbl %dl,%edx 801f4d: 83 ea 20 sub $0x20,%edx 801f50: 83 fa 5e cmp $0x5e,%edx 801f53: 76 c4 jbe 801f19 <vprintfmt+0x1e6> putch('?', putdat); 801f55: 83 ec 08 sub $0x8,%esp 801f58: ff 75 0c pushl 0xc(%ebp) 801f5b: 6a 3f push $0x3f 801f5d: ff 55 08 call *0x8(%ebp) 801f60: 83 c4 10 add $0x10,%esp 801f63: eb c1 jmp 801f26 <vprintfmt+0x1f3> 801f65: 89 75 08 mov %esi,0x8(%ebp) 801f68: 8b 75 d0 mov -0x30(%ebp),%esi 801f6b: 89 5d 0c mov %ebx,0xc(%ebp) 801f6e: 8b 5d e0 mov -0x20(%ebp),%ebx 801f71: eb b6 jmp 801f29 <vprintfmt+0x1f6> putch(' ', putdat); 801f73: 83 ec 08 sub $0x8,%esp 801f76: 53 push %ebx 801f77: 6a 20 push $0x20 801f79: ff d6 call *%esi for (; width > 0; width--) 801f7b: 83 ef 01 sub $0x1,%edi 801f7e: 83 c4 10 add $0x10,%esp 801f81: 85 ff test %edi,%edi 801f83: 7f ee jg 801f73 <vprintfmt+0x240> if ((p = va_arg(ap, char *)) == NULL) 801f85: 8b 45 cc mov -0x34(%ebp),%eax 801f88: 89 45 14 mov %eax,0x14(%ebp) 801f8b: e9 78 01 00 00 jmp 802108 <vprintfmt+0x3d5> 801f90: 89 df mov %ebx,%edi 801f92: 8b 75 08 mov 0x8(%ebp),%esi 801f95: 8b 5d 0c mov 0xc(%ebp),%ebx 801f98: eb e7 jmp 801f81 <vprintfmt+0x24e> if (lflag >= 2) 801f9a: 83 f9 01 cmp $0x1,%ecx 801f9d: 7e 3f jle 801fde <vprintfmt+0x2ab> return va_arg(*ap, long long); 801f9f: 8b 45 14 mov 0x14(%ebp),%eax 801fa2: 8b 50 04 mov 0x4(%eax),%edx 801fa5: 8b 00 mov (%eax),%eax 801fa7: 89 45 d8 mov %eax,-0x28(%ebp) 801faa: 89 55 dc mov %edx,-0x24(%ebp) 801fad: 8b 45 14 mov 0x14(%ebp),%eax 801fb0: 8d 40 08 lea 0x8(%eax),%eax 801fb3: 89 45 14 mov %eax,0x14(%ebp) if ((long long) num < 0) { 801fb6: 83 7d dc 00 cmpl $0x0,-0x24(%ebp) 801fba: 79 5c jns 802018 <vprintfmt+0x2e5> putch('-', putdat); 801fbc: 83 ec 08 sub $0x8,%esp 801fbf: 53 push %ebx 801fc0: 6a 2d push $0x2d 801fc2: ff d6 call *%esi num = -(long long) num; 801fc4: 8b 55 d8 mov -0x28(%ebp),%edx 801fc7: 8b 4d dc mov -0x24(%ebp),%ecx 801fca: f7 da neg %edx 801fcc: 83 d1 00 adc $0x0,%ecx 801fcf: f7 d9 neg %ecx 801fd1: 83 c4 10 add $0x10,%esp base = 10; 801fd4: b8 0a 00 00 00 mov $0xa,%eax 801fd9: e9 10 01 00 00 jmp 8020ee <vprintfmt+0x3bb> else if (lflag) 801fde: 85 c9 test %ecx,%ecx 801fe0: 75 1b jne 801ffd <vprintfmt+0x2ca> return va_arg(*ap, int); 801fe2: 8b 45 14 mov 0x14(%ebp),%eax 801fe5: 8b 00 mov (%eax),%eax 801fe7: 89 45 d8 mov %eax,-0x28(%ebp) 801fea: 89 c1 mov %eax,%ecx 801fec: c1 f9 1f sar $0x1f,%ecx 801fef: 89 4d dc mov %ecx,-0x24(%ebp) 801ff2: 8b 45 14 mov 0x14(%ebp),%eax 801ff5: 8d 40 04 lea 0x4(%eax),%eax 801ff8: 89 45 14 mov %eax,0x14(%ebp) 801ffb: eb b9 jmp 801fb6 <vprintfmt+0x283> return va_arg(*ap, long); 801ffd: 8b 45 14 mov 0x14(%ebp),%eax 802000: 8b 00 mov (%eax),%eax 802002: 89 45 d8 mov %eax,-0x28(%ebp) 802005: 89 c1 mov %eax,%ecx 802007: c1 f9 1f sar $0x1f,%ecx 80200a: 89 4d dc mov %ecx,-0x24(%ebp) 80200d: 8b 45 14 mov 0x14(%ebp),%eax 802010: 8d 40 04 lea 0x4(%eax),%eax 802013: 89 45 14 mov %eax,0x14(%ebp) 802016: eb 9e jmp 801fb6 <vprintfmt+0x283> num = getint(&ap, lflag); 802018: 8b 55 d8 mov -0x28(%ebp),%edx 80201b: 8b 4d dc mov -0x24(%ebp),%ecx base = 10; 80201e: b8 0a 00 00 00 mov $0xa,%eax 802023: e9 c6 00 00 00 jmp 8020ee <vprintfmt+0x3bb> if (lflag >= 2) 802028: 83 f9 01 cmp $0x1,%ecx 80202b: 7e 18 jle 802045 <vprintfmt+0x312> return va_arg(*ap, unsigned long long); 80202d: 8b 45 14 mov 0x14(%ebp),%eax 802030: 8b 10 mov (%eax),%edx 802032: 8b 48 04 mov 0x4(%eax),%ecx 802035: 8d 40 08 lea 0x8(%eax),%eax 802038: 89 45 14 mov %eax,0x14(%ebp) base = 10; 80203b: b8 0a 00 00 00 mov $0xa,%eax 802040: e9 a9 00 00 00 jmp 8020ee <vprintfmt+0x3bb> else if (lflag) 802045: 85 c9 test %ecx,%ecx 802047: 75 1a jne 802063 <vprintfmt+0x330> return va_arg(*ap, unsigned int); 802049: 8b 45 14 mov 0x14(%ebp),%eax 80204c: 8b 10 mov (%eax),%edx 80204e: b9 00 00 00 00 mov $0x0,%ecx 802053: 8d 40 04 lea 0x4(%eax),%eax 802056: 89 45 14 mov %eax,0x14(%ebp) base = 10; 802059: b8 0a 00 00 00 mov $0xa,%eax 80205e: e9 8b 00 00 00 jmp 8020ee <vprintfmt+0x3bb> return va_arg(*ap, unsigned long); 802063: 8b 45 14 mov 0x14(%ebp),%eax 802066: 8b 10 mov (%eax),%edx 802068: b9 00 00 00 00 mov $0x0,%ecx 80206d: 8d 40 04 lea 0x4(%eax),%eax 802070: 89 45 14 mov %eax,0x14(%ebp) base = 10; 802073: b8 0a 00 00 00 mov $0xa,%eax 802078: eb 74 jmp 8020ee <vprintfmt+0x3bb> if (lflag >= 2) 80207a: 83 f9 01 cmp $0x1,%ecx 80207d: 7e 15 jle 802094 <vprintfmt+0x361> return va_arg(*ap, unsigned long long); 80207f: 8b 45 14 mov 0x14(%ebp),%eax 802082: 8b 10 mov (%eax),%edx 802084: 8b 48 04 mov 0x4(%eax),%ecx 802087: 8d 40 08 lea 0x8(%eax),%eax 80208a: 89 45 14 mov %eax,0x14(%ebp) base = 8; 80208d: b8 08 00 00 00 mov $0x8,%eax 802092: eb 5a jmp 8020ee <vprintfmt+0x3bb> else if (lflag) 802094: 85 c9 test %ecx,%ecx 802096: 75 17 jne 8020af <vprintfmt+0x37c> return va_arg(*ap, unsigned int); 802098: 8b 45 14 mov 0x14(%ebp),%eax 80209b: 8b 10 mov (%eax),%edx 80209d: b9 00 00 00 00 mov $0x0,%ecx 8020a2: 8d 40 04 lea 0x4(%eax),%eax 8020a5: 89 45 14 mov %eax,0x14(%ebp) base = 8; 8020a8: b8 08 00 00 00 mov $0x8,%eax 8020ad: eb 3f jmp 8020ee <vprintfmt+0x3bb> return va_arg(*ap, unsigned long); 8020af: 8b 45 14 mov 0x14(%ebp),%eax 8020b2: 8b 10 mov (%eax),%edx 8020b4: b9 00 00 00 00 mov $0x0,%ecx 8020b9: 8d 40 04 lea 0x4(%eax),%eax 8020bc: 89 45 14 mov %eax,0x14(%ebp) base = 8; 8020bf: b8 08 00 00 00 mov $0x8,%eax 8020c4: eb 28 jmp 8020ee <vprintfmt+0x3bb> putch('0', putdat); 8020c6: 83 ec 08 sub $0x8,%esp 8020c9: 53 push %ebx 8020ca: 6a 30 push $0x30 8020cc: ff d6 call *%esi putch('x', putdat); 8020ce: 83 c4 08 add $0x8,%esp 8020d1: 53 push %ebx 8020d2: 6a 78 push $0x78 8020d4: ff d6 call *%esi num = (unsigned long long) 8020d6: 8b 45 14 mov 0x14(%ebp),%eax 8020d9: 8b 10 mov (%eax),%edx 8020db: b9 00 00 00 00 mov $0x0,%ecx goto number; 8020e0: 83 c4 10 add $0x10,%esp (uintptr_t) va_arg(ap, void *); 8020e3: 8d 40 04 lea 0x4(%eax),%eax 8020e6: 89 45 14 mov %eax,0x14(%ebp) base = 16; 8020e9: b8 10 00 00 00 mov $0x10,%eax printnum(putch, putdat, num, base, width, padc); 8020ee: 83 ec 0c sub $0xc,%esp 8020f1: 0f be 7d d4 movsbl -0x2c(%ebp),%edi 8020f5: 57 push %edi 8020f6: ff 75 e0 pushl -0x20(%ebp) 8020f9: 50 push %eax 8020fa: 51 push %ecx 8020fb: 52 push %edx 8020fc: 89 da mov %ebx,%edx 8020fe: 89 f0 mov %esi,%eax 802100: e8 45 fb ff ff call 801c4a <printnum> break; 802105: 83 c4 20 add $0x20,%esp err = va_arg(ap, int); 802108: 8b 7d e4 mov -0x1c(%ebp),%edi while ((ch = *(unsigned char *) fmt++) != '%') { //先将非格式化字符输出到控制台。 80210b: 83 c7 01 add $0x1,%edi 80210e: 0f b6 47 ff movzbl -0x1(%edi),%eax 802112: 83 f8 25 cmp $0x25,%eax 802115: 0f 84 2f fc ff ff je 801d4a <vprintfmt+0x17> if (ch == '\0') //如果没有格式化字符直接返回 80211b: 85 c0 test %eax,%eax 80211d: 0f 84 8b 00 00 00 je 8021ae <vprintfmt+0x47b> putch(ch, putdat); 802123: 83 ec 08 sub $0x8,%esp 802126: 53 push %ebx 802127: 50 push %eax 802128: ff d6 call *%esi 80212a: 83 c4 10 add $0x10,%esp 80212d: eb dc jmp 80210b <vprintfmt+0x3d8> if (lflag >= 2) 80212f: 83 f9 01 cmp $0x1,%ecx 802132: 7e 15 jle 802149 <vprintfmt+0x416> return va_arg(*ap, unsigned long long); 802134: 8b 45 14 mov 0x14(%ebp),%eax 802137: 8b 10 mov (%eax),%edx 802139: 8b 48 04 mov 0x4(%eax),%ecx 80213c: 8d 40 08 lea 0x8(%eax),%eax 80213f: 89 45 14 mov %eax,0x14(%ebp) base = 16; 802142: b8 10 00 00 00 mov $0x10,%eax 802147: eb a5 jmp 8020ee <vprintfmt+0x3bb> else if (lflag) 802149: 85 c9 test %ecx,%ecx 80214b: 75 17 jne 802164 <vprintfmt+0x431> return va_arg(*ap, unsigned int); 80214d: 8b 45 14 mov 0x14(%ebp),%eax 802150: 8b 10 mov (%eax),%edx 802152: b9 00 00 00 00 mov $0x0,%ecx 802157: 8d 40 04 lea 0x4(%eax),%eax 80215a: 89 45 14 mov %eax,0x14(%ebp) base = 16; 80215d: b8 10 00 00 00 mov $0x10,%eax 802162: eb 8a jmp 8020ee <vprintfmt+0x3bb> return va_arg(*ap, unsigned long); 802164: 8b 45 14 mov 0x14(%ebp),%eax 802167: 8b 10 mov (%eax),%edx 802169: b9 00 00 00 00 mov $0x0,%ecx 80216e: 8d 40 04 lea 0x4(%eax),%eax 802171: 89 45 14 mov %eax,0x14(%ebp) base = 16; 802174: b8 10 00 00 00 mov $0x10,%eax 802179: e9 70 ff ff ff jmp 8020ee <vprintfmt+0x3bb> putch(ch, putdat); 80217e: 83 ec 08 sub $0x8,%esp 802181: 53 push %ebx 802182: 6a 25 push $0x25 802184: ff d6 call *%esi break; 802186: 83 c4 10 add $0x10,%esp 802189: e9 7a ff ff ff jmp 802108 <vprintfmt+0x3d5> putch('%', putdat); 80218e: 83 ec 08 sub $0x8,%esp 802191: 53 push %ebx 802192: 6a 25 push $0x25 802194: ff d6 call *%esi for (fmt--; fmt[-1] != '%'; fmt--) 802196: 83 c4 10 add $0x10,%esp 802199: 89 f8 mov %edi,%eax 80219b: eb 03 jmp 8021a0 <vprintfmt+0x46d> 80219d: 83 e8 01 sub $0x1,%eax 8021a0: 80 78 ff 25 cmpb $0x25,-0x1(%eax) 8021a4: 75 f7 jne 80219d <vprintfmt+0x46a> 8021a6: 89 45 e4 mov %eax,-0x1c(%ebp) 8021a9: e9 5a ff ff ff jmp 802108 <vprintfmt+0x3d5> } 8021ae: 8d 65 f4 lea -0xc(%ebp),%esp 8021b1: 5b pop %ebx 8021b2: 5e pop %esi 8021b3: 5f pop %edi 8021b4: 5d pop %ebp 8021b5: c3 ret 008021b6 <vsnprintf>: int vsnprintf(char *buf, int n, const char *fmt, va_list ap) { 8021b6: 55 push %ebp 8021b7: 89 e5 mov %esp,%ebp 8021b9: 83 ec 18 sub $0x18,%esp 8021bc: 8b 45 08 mov 0x8(%ebp),%eax 8021bf: 8b 55 0c mov 0xc(%ebp),%edx struct sprintbuf b = {buf, buf+n-1, 0}; 8021c2: 89 45 ec mov %eax,-0x14(%ebp) 8021c5: 8d 4c 10 ff lea -0x1(%eax,%edx,1),%ecx 8021c9: 89 4d f0 mov %ecx,-0x10(%ebp) 8021cc: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) if (buf == NULL || n < 1) 8021d3: 85 c0 test %eax,%eax 8021d5: 74 26 je 8021fd <vsnprintf+0x47> 8021d7: 85 d2 test %edx,%edx 8021d9: 7e 22 jle 8021fd <vsnprintf+0x47> return -E_INVAL; // print the string to the buffer vprintfmt((void*)sprintputch, &b, fmt, ap); 8021db: ff 75 14 pushl 0x14(%ebp) 8021de: ff 75 10 pushl 0x10(%ebp) 8021e1: 8d 45 ec lea -0x14(%ebp),%eax 8021e4: 50 push %eax 8021e5: 68 f9 1c 80 00 push $0x801cf9 8021ea: e8 44 fb ff ff call 801d33 <vprintfmt> // null terminate the buffer *b.buf = '\0'; 8021ef: 8b 45 ec mov -0x14(%ebp),%eax 8021f2: c6 00 00 movb $0x0,(%eax) return b.cnt; 8021f5: 8b 45 f4 mov -0xc(%ebp),%eax 8021f8: 83 c4 10 add $0x10,%esp } 8021fb: c9 leave 8021fc: c3 ret return -E_INVAL; 8021fd: b8 fd ff ff ff mov $0xfffffffd,%eax 802202: eb f7 jmp 8021fb <vsnprintf+0x45> 00802204 <snprintf>: int snprintf(char *buf, int n, const char *fmt, ...) { 802204: 55 push %ebp 802205: 89 e5 mov %esp,%ebp 802207: 83 ec 08 sub $0x8,%esp va_list ap; int rc; va_start(ap, fmt); 80220a: 8d 45 14 lea 0x14(%ebp),%eax rc = vsnprintf(buf, n, fmt, ap); 80220d: 50 push %eax 80220e: ff 75 10 pushl 0x10(%ebp) 802211: ff 75 0c pushl 0xc(%ebp) 802214: ff 75 08 pushl 0x8(%ebp) 802217: e8 9a ff ff ff call 8021b6 <vsnprintf> va_end(ap); return rc; } 80221c: c9 leave 80221d: c3 ret 0080221e <strlen>: // Primespipe runs 3x faster this way. #define ASM 1 int strlen(const char *s) { 80221e: 55 push %ebp 80221f: 89 e5 mov %esp,%ebp 802221: 8b 55 08 mov 0x8(%ebp),%edx int n; for (n = 0; *s != '\0'; s++) 802224: b8 00 00 00 00 mov $0x0,%eax 802229: eb 03 jmp 80222e <strlen+0x10> n++; 80222b: 83 c0 01 add $0x1,%eax for (n = 0; *s != '\0'; s++) 80222e: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 802232: 75 f7 jne 80222b <strlen+0xd> return n; } 802234: 5d pop %ebp 802235: c3 ret 00802236 <strnlen>: int strnlen(const char *s, size_t size) { 802236: 55 push %ebp 802237: 89 e5 mov %esp,%ebp 802239: 8b 4d 08 mov 0x8(%ebp),%ecx 80223c: 8b 55 0c mov 0xc(%ebp),%edx int n; for (n = 0; size > 0 && *s != '\0'; s++, size--) 80223f: b8 00 00 00 00 mov $0x0,%eax 802244: eb 03 jmp 802249 <strnlen+0x13> n++; 802246: 83 c0 01 add $0x1,%eax for (n = 0; size > 0 && *s != '\0'; s++, size--) 802249: 39 d0 cmp %edx,%eax 80224b: 74 06 je 802253 <strnlen+0x1d> 80224d: 80 3c 01 00 cmpb $0x0,(%ecx,%eax,1) 802251: 75 f3 jne 802246 <strnlen+0x10> return n; } 802253: 5d pop %ebp 802254: c3 ret 00802255 <strcpy>: char * strcpy(char *dst, const char *src) { 802255: 55 push %ebp 802256: 89 e5 mov %esp,%ebp 802258: 53 push %ebx 802259: 8b 45 08 mov 0x8(%ebp),%eax 80225c: 8b 4d 0c mov 0xc(%ebp),%ecx char *ret; ret = dst; while ((*dst++ = *src++) != '\0') 80225f: 89 c2 mov %eax,%edx 802261: 83 c1 01 add $0x1,%ecx 802264: 83 c2 01 add $0x1,%edx 802267: 0f b6 59 ff movzbl -0x1(%ecx),%ebx 80226b: 88 5a ff mov %bl,-0x1(%edx) 80226e: 84 db test %bl,%bl 802270: 75 ef jne 802261 <strcpy+0xc> /* do nothing */; return ret; } 802272: 5b pop %ebx 802273: 5d pop %ebp 802274: c3 ret 00802275 <strcat>: char * strcat(char *dst, const char *src) { 802275: 55 push %ebp 802276: 89 e5 mov %esp,%ebp 802278: 53 push %ebx 802279: 8b 5d 08 mov 0x8(%ebp),%ebx int len = strlen(dst); 80227c: 53 push %ebx 80227d: e8 9c ff ff ff call 80221e <strlen> 802282: 83 c4 04 add $0x4,%esp strcpy(dst + len, src); 802285: ff 75 0c pushl 0xc(%ebp) 802288: 01 d8 add %ebx,%eax 80228a: 50 push %eax 80228b: e8 c5 ff ff ff call 802255 <strcpy> return dst; } 802290: 89 d8 mov %ebx,%eax 802292: 8b 5d fc mov -0x4(%ebp),%ebx 802295: c9 leave 802296: c3 ret 00802297 <strncpy>: char * strncpy(char *dst, const char *src, size_t size) { 802297: 55 push %ebp 802298: 89 e5 mov %esp,%ebp 80229a: 56 push %esi 80229b: 53 push %ebx 80229c: 8b 75 08 mov 0x8(%ebp),%esi 80229f: 8b 4d 0c mov 0xc(%ebp),%ecx 8022a2: 89 f3 mov %esi,%ebx 8022a4: 03 5d 10 add 0x10(%ebp),%ebx size_t i; char *ret; ret = dst; for (i = 0; i < size; i++) { 8022a7: 89 f2 mov %esi,%edx 8022a9: eb 0f jmp 8022ba <strncpy+0x23> *dst++ = *src; 8022ab: 83 c2 01 add $0x1,%edx 8022ae: 0f b6 01 movzbl (%ecx),%eax 8022b1: 88 42 ff mov %al,-0x1(%edx) // If strlen(src) < size, null-pad 'dst' out to 'size' chars if (*src != '\0') src++; 8022b4: 80 39 01 cmpb $0x1,(%ecx) 8022b7: 83 d9 ff sbb $0xffffffff,%ecx for (i = 0; i < size; i++) { 8022ba: 39 da cmp %ebx,%edx 8022bc: 75 ed jne 8022ab <strncpy+0x14> } return ret; } 8022be: 89 f0 mov %esi,%eax 8022c0: 5b pop %ebx 8022c1: 5e pop %esi 8022c2: 5d pop %ebp 8022c3: c3 ret 008022c4 <strlcpy>: size_t strlcpy(char *dst, const char *src, size_t size) { 8022c4: 55 push %ebp 8022c5: 89 e5 mov %esp,%ebp 8022c7: 56 push %esi 8022c8: 53 push %ebx 8022c9: 8b 75 08 mov 0x8(%ebp),%esi 8022cc: 8b 55 0c mov 0xc(%ebp),%edx 8022cf: 8b 4d 10 mov 0x10(%ebp),%ecx 8022d2: 89 f0 mov %esi,%eax 8022d4: 8d 5c 0e ff lea -0x1(%esi,%ecx,1),%ebx char *dst_in; dst_in = dst; if (size > 0) { 8022d8: 85 c9 test %ecx,%ecx 8022da: 75 0b jne 8022e7 <strlcpy+0x23> 8022dc: eb 17 jmp 8022f5 <strlcpy+0x31> while (--size > 0 && *src != '\0') *dst++ = *src++; 8022de: 83 c2 01 add $0x1,%edx 8022e1: 83 c0 01 add $0x1,%eax 8022e4: 88 48 ff mov %cl,-0x1(%eax) while (--size > 0 && *src != '\0') 8022e7: 39 d8 cmp %ebx,%eax 8022e9: 74 07 je 8022f2 <strlcpy+0x2e> 8022eb: 0f b6 0a movzbl (%edx),%ecx 8022ee: 84 c9 test %cl,%cl 8022f0: 75 ec jne 8022de <strlcpy+0x1a> *dst = '\0'; 8022f2: c6 00 00 movb $0x0,(%eax) } return dst - dst_in; 8022f5: 29 f0 sub %esi,%eax } 8022f7: 5b pop %ebx 8022f8: 5e pop %esi 8022f9: 5d pop %ebp 8022fa: c3 ret 008022fb <strcmp>: int strcmp(const char *p, const char *q) { 8022fb: 55 push %ebp 8022fc: 89 e5 mov %esp,%ebp 8022fe: 8b 4d 08 mov 0x8(%ebp),%ecx 802301: 8b 55 0c mov 0xc(%ebp),%edx while (*p && *p == *q) 802304: eb 06 jmp 80230c <strcmp+0x11> p++, q++; 802306: 83 c1 01 add $0x1,%ecx 802309: 83 c2 01 add $0x1,%edx while (*p && *p == *q) 80230c: 0f b6 01 movzbl (%ecx),%eax 80230f: 84 c0 test %al,%al 802311: 74 04 je 802317 <strcmp+0x1c> 802313: 3a 02 cmp (%edx),%al 802315: 74 ef je 802306 <strcmp+0xb> return (int) ((unsigned char) *p - (unsigned char) *q); 802317: 0f b6 c0 movzbl %al,%eax 80231a: 0f b6 12 movzbl (%edx),%edx 80231d: 29 d0 sub %edx,%eax } 80231f: 5d pop %ebp 802320: c3 ret 00802321 <strncmp>: int strncmp(const char *p, const char *q, size_t n) { 802321: 55 push %ebp 802322: 89 e5 mov %esp,%ebp 802324: 53 push %ebx 802325: 8b 45 08 mov 0x8(%ebp),%eax 802328: 8b 55 0c mov 0xc(%ebp),%edx 80232b: 89 c3 mov %eax,%ebx 80232d: 03 5d 10 add 0x10(%ebp),%ebx while (n > 0 && *p && *p == *q) 802330: eb 06 jmp 802338 <strncmp+0x17> n--, p++, q++; 802332: 83 c0 01 add $0x1,%eax 802335: 83 c2 01 add $0x1,%edx while (n > 0 && *p && *p == *q) 802338: 39 d8 cmp %ebx,%eax 80233a: 74 16 je 802352 <strncmp+0x31> 80233c: 0f b6 08 movzbl (%eax),%ecx 80233f: 84 c9 test %cl,%cl 802341: 74 04 je 802347 <strncmp+0x26> 802343: 3a 0a cmp (%edx),%cl 802345: 74 eb je 802332 <strncmp+0x11> if (n == 0) return 0; else return (int) ((unsigned char) *p - (unsigned char) *q); 802347: 0f b6 00 movzbl (%eax),%eax 80234a: 0f b6 12 movzbl (%edx),%edx 80234d: 29 d0 sub %edx,%eax } 80234f: 5b pop %ebx 802350: 5d pop %ebp 802351: c3 ret return 0; 802352: b8 00 00 00 00 mov $0x0,%eax 802357: eb f6 jmp 80234f <strncmp+0x2e> 00802359 <strchr>: // Return a pointer to the first occurrence of 'c' in 's', // or a null pointer if the string has no 'c'. char * strchr(const char *s, char c) { 802359: 55 push %ebp 80235a: 89 e5 mov %esp,%ebp 80235c: 8b 45 08 mov 0x8(%ebp),%eax 80235f: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx for (; *s; s++) 802363: 0f b6 10 movzbl (%eax),%edx 802366: 84 d2 test %dl,%dl 802368: 74 09 je 802373 <strchr+0x1a> if (*s == c) 80236a: 38 ca cmp %cl,%dl 80236c: 74 0a je 802378 <strchr+0x1f> for (; *s; s++) 80236e: 83 c0 01 add $0x1,%eax 802371: eb f0 jmp 802363 <strchr+0xa> return (char *) s; return 0; 802373: b8 00 00 00 00 mov $0x0,%eax } 802378: 5d pop %ebp 802379: c3 ret 0080237a <strfind>: // Return a pointer to the first occurrence of 'c' in 's', // or a pointer to the string-ending null character if the string has no 'c'. char * strfind(const char *s, char c) { 80237a: 55 push %ebp 80237b: 89 e5 mov %esp,%ebp 80237d: 8b 45 08 mov 0x8(%ebp),%eax 802380: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx for (; *s; s++) 802384: eb 03 jmp 802389 <strfind+0xf> 802386: 83 c0 01 add $0x1,%eax 802389: 0f b6 10 movzbl (%eax),%edx if (*s == c) 80238c: 38 ca cmp %cl,%dl 80238e: 74 04 je 802394 <strfind+0x1a> 802390: 84 d2 test %dl,%dl 802392: 75 f2 jne 802386 <strfind+0xc> break; return (char *) s; } 802394: 5d pop %ebp 802395: c3 ret 00802396 <memset>: #if ASM void * memset(void *v, int c, size_t n) { 802396: 55 push %ebp 802397: 89 e5 mov %esp,%ebp 802399: 57 push %edi 80239a: 56 push %esi 80239b: 53 push %ebx 80239c: 8b 7d 08 mov 0x8(%ebp),%edi 80239f: 8b 4d 10 mov 0x10(%ebp),%ecx char *p; if (n == 0) 8023a2: 85 c9 test %ecx,%ecx 8023a4: 74 13 je 8023b9 <memset+0x23> return v; if ((int)v%4 == 0 && n%4 == 0) { 8023a6: f7 c7 03 00 00 00 test $0x3,%edi 8023ac: 75 05 jne 8023b3 <memset+0x1d> 8023ae: f6 c1 03 test $0x3,%cl 8023b1: 74 0d je 8023c0 <memset+0x2a> c = (c<<24)|(c<<16)|(c<<8)|c; asm volatile("cld; rep stosl\n" :: "D" (v), "a" (c), "c" (n/4) : "cc", "memory"); } else asm volatile("cld; rep stosb\n" 8023b3: 8b 45 0c mov 0xc(%ebp),%eax 8023b6: fc cld 8023b7: f3 aa rep stos %al,%es:(%edi) :: "D" (v), "a" (c), "c" (n) : "cc", "memory"); return v; } 8023b9: 89 f8 mov %edi,%eax 8023bb: 5b pop %ebx 8023bc: 5e pop %esi 8023bd: 5f pop %edi 8023be: 5d pop %ebp 8023bf: c3 ret c &= 0xFF; 8023c0: 0f b6 55 0c movzbl 0xc(%ebp),%edx c = (c<<24)|(c<<16)|(c<<8)|c; 8023c4: 89 d3 mov %edx,%ebx 8023c6: c1 e3 08 shl $0x8,%ebx 8023c9: 89 d0 mov %edx,%eax 8023cb: c1 e0 18 shl $0x18,%eax 8023ce: 89 d6 mov %edx,%esi 8023d0: c1 e6 10 shl $0x10,%esi 8023d3: 09 f0 or %esi,%eax 8023d5: 09 c2 or %eax,%edx 8023d7: 09 da or %ebx,%edx :: "D" (v), "a" (c), "c" (n/4) 8023d9: c1 e9 02 shr $0x2,%ecx asm volatile("cld; rep stosl\n" 8023dc: 89 d0 mov %edx,%eax 8023de: fc cld 8023df: f3 ab rep stos %eax,%es:(%edi) 8023e1: eb d6 jmp 8023b9 <memset+0x23> 008023e3 <memmove>: void * memmove(void *dst, const void *src, size_t n) { 8023e3: 55 push %ebp 8023e4: 89 e5 mov %esp,%ebp 8023e6: 57 push %edi 8023e7: 56 push %esi 8023e8: 8b 45 08 mov 0x8(%ebp),%eax 8023eb: 8b 75 0c mov 0xc(%ebp),%esi 8023ee: 8b 4d 10 mov 0x10(%ebp),%ecx const char *s; char *d; s = src; d = dst; if (s < d && s + n > d) { 8023f1: 39 c6 cmp %eax,%esi 8023f3: 73 35 jae 80242a <memmove+0x47> 8023f5: 8d 14 0e lea (%esi,%ecx,1),%edx 8023f8: 39 c2 cmp %eax,%edx 8023fa: 76 2e jbe 80242a <memmove+0x47> s += n; d += n; 8023fc: 8d 3c 08 lea (%eax,%ecx,1),%edi if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0) 8023ff: 89 d6 mov %edx,%esi 802401: 09 fe or %edi,%esi 802403: f7 c6 03 00 00 00 test $0x3,%esi 802409: 74 0c je 802417 <memmove+0x34> asm volatile("std; rep movsl\n" :: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory"); else asm volatile("std; rep movsb\n" :: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory"); 80240b: 83 ef 01 sub $0x1,%edi 80240e: 8d 72 ff lea -0x1(%edx),%esi asm volatile("std; rep movsb\n" 802411: fd std 802412: f3 a4 rep movsb %ds:(%esi),%es:(%edi) // Some versions of GCC rely on DF being clear asm volatile("cld" ::: "cc"); 802414: fc cld 802415: eb 21 jmp 802438 <memmove+0x55> if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0) 802417: f6 c1 03 test $0x3,%cl 80241a: 75 ef jne 80240b <memmove+0x28> :: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory"); 80241c: 83 ef 04 sub $0x4,%edi 80241f: 8d 72 fc lea -0x4(%edx),%esi 802422: c1 e9 02 shr $0x2,%ecx asm volatile("std; rep movsl\n" 802425: fd std 802426: f3 a5 rep movsl %ds:(%esi),%es:(%edi) 802428: eb ea jmp 802414 <memmove+0x31> } else { if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0) 80242a: 89 f2 mov %esi,%edx 80242c: 09 c2 or %eax,%edx 80242e: f6 c2 03 test $0x3,%dl 802431: 74 09 je 80243c <memmove+0x59> asm volatile("cld; rep movsl\n" :: "D" (d), "S" (s), "c" (n/4) : "cc", "memory"); else asm volatile("cld; rep movsb\n" 802433: 89 c7 mov %eax,%edi 802435: fc cld 802436: f3 a4 rep movsb %ds:(%esi),%es:(%edi) :: "D" (d), "S" (s), "c" (n) : "cc", "memory"); } return dst; } 802438: 5e pop %esi 802439: 5f pop %edi 80243a: 5d pop %ebp 80243b: c3 ret if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0) 80243c: f6 c1 03 test $0x3,%cl 80243f: 75 f2 jne 802433 <memmove+0x50> :: "D" (d), "S" (s), "c" (n/4) : "cc", "memory"); 802441: c1 e9 02 shr $0x2,%ecx asm volatile("cld; rep movsl\n" 802444: 89 c7 mov %eax,%edi 802446: fc cld 802447: f3 a5 rep movsl %ds:(%esi),%es:(%edi) 802449: eb ed jmp 802438 <memmove+0x55> 0080244b <memcpy>: } #endif void * memcpy(void *dst, const void *src, size_t n) { 80244b: 55 push %ebp 80244c: 89 e5 mov %esp,%ebp return memmove(dst, src, n); 80244e: ff 75 10 pushl 0x10(%ebp) 802451: ff 75 0c pushl 0xc(%ebp) 802454: ff 75 08 pushl 0x8(%ebp) 802457: e8 87 ff ff ff call 8023e3 <memmove> } 80245c: c9 leave 80245d: c3 ret 0080245e <memcmp>: int memcmp(const void *v1, const void *v2, size_t n) { 80245e: 55 push %ebp 80245f: 89 e5 mov %esp,%ebp 802461: 56 push %esi 802462: 53 push %ebx 802463: 8b 45 08 mov 0x8(%ebp),%eax 802466: 8b 55 0c mov 0xc(%ebp),%edx 802469: 89 c6 mov %eax,%esi 80246b: 03 75 10 add 0x10(%ebp),%esi const uint8_t *s1 = (const uint8_t *) v1; const uint8_t *s2 = (const uint8_t *) v2; while (n-- > 0) { 80246e: 39 f0 cmp %esi,%eax 802470: 74 1c je 80248e <memcmp+0x30> if (*s1 != *s2) 802472: 0f b6 08 movzbl (%eax),%ecx 802475: 0f b6 1a movzbl (%edx),%ebx 802478: 38 d9 cmp %bl,%cl 80247a: 75 08 jne 802484 <memcmp+0x26> return (int) *s1 - (int) *s2; s1++, s2++; 80247c: 83 c0 01 add $0x1,%eax 80247f: 83 c2 01 add $0x1,%edx 802482: eb ea jmp 80246e <memcmp+0x10> return (int) *s1 - (int) *s2; 802484: 0f b6 c1 movzbl %cl,%eax 802487: 0f b6 db movzbl %bl,%ebx 80248a: 29 d8 sub %ebx,%eax 80248c: eb 05 jmp 802493 <memcmp+0x35> } return 0; 80248e: b8 00 00 00 00 mov $0x0,%eax } 802493: 5b pop %ebx 802494: 5e pop %esi 802495: 5d pop %ebp 802496: c3 ret 00802497 <memfind>: void * memfind(const void *s, int c, size_t n) { 802497: 55 push %ebp 802498: 89 e5 mov %esp,%ebp 80249a: 8b 45 08 mov 0x8(%ebp),%eax 80249d: 8b 4d 0c mov 0xc(%ebp),%ecx const void *ends = (const char *) s + n; 8024a0: 89 c2 mov %eax,%edx 8024a2: 03 55 10 add 0x10(%ebp),%edx for (; s < ends; s++) 8024a5: 39 d0 cmp %edx,%eax 8024a7: 73 09 jae 8024b2 <memfind+0x1b> if (*(const unsigned char *) s == (unsigned char) c) 8024a9: 38 08 cmp %cl,(%eax) 8024ab: 74 05 je 8024b2 <memfind+0x1b> for (; s < ends; s++) 8024ad: 83 c0 01 add $0x1,%eax 8024b0: eb f3 jmp 8024a5 <memfind+0xe> break; return (void *) s; } 8024b2: 5d pop %ebp 8024b3: c3 ret 008024b4 <strtol>: long strtol(const char *s, char **endptr, int base) { 8024b4: 55 push %ebp 8024b5: 89 e5 mov %esp,%ebp 8024b7: 57 push %edi 8024b8: 56 push %esi 8024b9: 53 push %ebx 8024ba: 8b 4d 08 mov 0x8(%ebp),%ecx 8024bd: 8b 5d 10 mov 0x10(%ebp),%ebx int neg = 0; long val = 0; // gobble initial whitespace while (*s == ' ' || *s == '\t') 8024c0: eb 03 jmp 8024c5 <strtol+0x11> s++; 8024c2: 83 c1 01 add $0x1,%ecx while (*s == ' ' || *s == '\t') 8024c5: 0f b6 01 movzbl (%ecx),%eax 8024c8: 3c 20 cmp $0x20,%al 8024ca: 74 f6 je 8024c2 <strtol+0xe> 8024cc: 3c 09 cmp $0x9,%al 8024ce: 74 f2 je 8024c2 <strtol+0xe> // plus/minus sign if (*s == '+') 8024d0: 3c 2b cmp $0x2b,%al 8024d2: 74 2e je 802502 <strtol+0x4e> int neg = 0; 8024d4: bf 00 00 00 00 mov $0x0,%edi s++; else if (*s == '-') 8024d9: 3c 2d cmp $0x2d,%al 8024db: 74 2f je 80250c <strtol+0x58> s++, neg = 1; // hex or octal base prefix if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) 8024dd: f7 c3 ef ff ff ff test $0xffffffef,%ebx 8024e3: 75 05 jne 8024ea <strtol+0x36> 8024e5: 80 39 30 cmpb $0x30,(%ecx) 8024e8: 74 2c je 802516 <strtol+0x62> s += 2, base = 16; else if (base == 0 && s[0] == '0') 8024ea: 85 db test %ebx,%ebx 8024ec: 75 0a jne 8024f8 <strtol+0x44> s++, base = 8; else if (base == 0) base = 10; 8024ee: bb 0a 00 00 00 mov $0xa,%ebx else if (base == 0 && s[0] == '0') 8024f3: 80 39 30 cmpb $0x30,(%ecx) 8024f6: 74 28 je 802520 <strtol+0x6c> base = 10; 8024f8: b8 00 00 00 00 mov $0x0,%eax 8024fd: 89 5d 10 mov %ebx,0x10(%ebp) 802500: eb 50 jmp 802552 <strtol+0x9e> s++; 802502: 83 c1 01 add $0x1,%ecx int neg = 0; 802505: bf 00 00 00 00 mov $0x0,%edi 80250a: eb d1 jmp 8024dd <strtol+0x29> s++, neg = 1; 80250c: 83 c1 01 add $0x1,%ecx 80250f: bf 01 00 00 00 mov $0x1,%edi 802514: eb c7 jmp 8024dd <strtol+0x29> if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) 802516: 80 79 01 78 cmpb $0x78,0x1(%ecx) 80251a: 74 0e je 80252a <strtol+0x76> else if (base == 0 && s[0] == '0') 80251c: 85 db test %ebx,%ebx 80251e: 75 d8 jne 8024f8 <strtol+0x44> s++, base = 8; 802520: 83 c1 01 add $0x1,%ecx 802523: bb 08 00 00 00 mov $0x8,%ebx 802528: eb ce jmp 8024f8 <strtol+0x44> s += 2, base = 16; 80252a: 83 c1 02 add $0x2,%ecx 80252d: bb 10 00 00 00 mov $0x10,%ebx 802532: eb c4 jmp 8024f8 <strtol+0x44> while (1) { int dig; if (*s >= '0' && *s <= '9') dig = *s - '0'; else if (*s >= 'a' && *s <= 'z') 802534: 8d 72 9f lea -0x61(%edx),%esi 802537: 89 f3 mov %esi,%ebx 802539: 80 fb 19 cmp $0x19,%bl 80253c: 77 29 ja 802567 <strtol+0xb3> dig = *s - 'a' + 10; 80253e: 0f be d2 movsbl %dl,%edx 802541: 83 ea 57 sub $0x57,%edx else if (*s >= 'A' && *s <= 'Z') dig = *s - 'A' + 10; else break; if (dig >= base) 802544: 3b 55 10 cmp 0x10(%ebp),%edx 802547: 7d 30 jge 802579 <strtol+0xc5> break; s++, val = (val * base) + dig; 802549: 83 c1 01 add $0x1,%ecx 80254c: 0f af 45 10 imul 0x10(%ebp),%eax 802550: 01 d0 add %edx,%eax if (*s >= '0' && *s <= '9') 802552: 0f b6 11 movzbl (%ecx),%edx 802555: 8d 72 d0 lea -0x30(%edx),%esi 802558: 89 f3 mov %esi,%ebx 80255a: 80 fb 09 cmp $0x9,%bl 80255d: 77 d5 ja 802534 <strtol+0x80> dig = *s - '0'; 80255f: 0f be d2 movsbl %dl,%edx 802562: 83 ea 30 sub $0x30,%edx 802565: eb dd jmp 802544 <strtol+0x90> else if (*s >= 'A' && *s <= 'Z') 802567: 8d 72 bf lea -0x41(%edx),%esi 80256a: 89 f3 mov %esi,%ebx 80256c: 80 fb 19 cmp $0x19,%bl 80256f: 77 08 ja 802579 <strtol+0xc5> dig = *s - 'A' + 10; 802571: 0f be d2 movsbl %dl,%edx 802574: 83 ea 37 sub $0x37,%edx 802577: eb cb jmp 802544 <strtol+0x90> // we don't properly detect overflow! } if (endptr) 802579: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 80257d: 74 05 je 802584 <strtol+0xd0> *endptr = (char *) s; 80257f: 8b 75 0c mov 0xc(%ebp),%esi 802582: 89 0e mov %ecx,(%esi) return (neg ? -val : val); 802584: 89 c2 mov %eax,%edx 802586: f7 da neg %edx 802588: 85 ff test %edi,%edi 80258a: 0f 45 c2 cmovne %edx,%eax } 80258d: 5b pop %ebx 80258e: 5e pop %esi 80258f: 5f pop %edi 802590: 5d pop %ebp 802591: c3 ret 00802592 <sys_cputs>: return ret; } void sys_cputs(const char *s, size_t len) { 802592: 55 push %ebp 802593: 89 e5 mov %esp,%ebp 802595: 57 push %edi 802596: 56 push %esi 802597: 53 push %ebx asm volatile("int %1\n" //执行int T_SYSCALL指令 802598: b8 00 00 00 00 mov $0x0,%eax 80259d: 8b 55 08 mov 0x8(%ebp),%edx 8025a0: 8b 4d 0c mov 0xc(%ebp),%ecx 8025a3: 89 c3 mov %eax,%ebx 8025a5: 89 c7 mov %eax,%edi 8025a7: 89 c6 mov %eax,%esi 8025a9: cd 30 int $0x30 syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0); } 8025ab: 5b pop %ebx 8025ac: 5e pop %esi 8025ad: 5f pop %edi 8025ae: 5d pop %ebp 8025af: c3 ret 008025b0 <sys_cgetc>: int sys_cgetc(void) { 8025b0: 55 push %ebp 8025b1: 89 e5 mov %esp,%ebp 8025b3: 57 push %edi 8025b4: 56 push %esi 8025b5: 53 push %ebx asm volatile("int %1\n" //执行int T_SYSCALL指令 8025b6: ba 00 00 00 00 mov $0x0,%edx 8025bb: b8 01 00 00 00 mov $0x1,%eax 8025c0: 89 d1 mov %edx,%ecx 8025c2: 89 d3 mov %edx,%ebx 8025c4: 89 d7 mov %edx,%edi 8025c6: 89 d6 mov %edx,%esi 8025c8: cd 30 int $0x30 return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0); } 8025ca: 5b pop %ebx 8025cb: 5e pop %esi 8025cc: 5f pop %edi 8025cd: 5d pop %ebp 8025ce: c3 ret 008025cf <sys_env_destroy>: int sys_env_destroy(envid_t envid) { 8025cf: 55 push %ebp 8025d0: 89 e5 mov %esp,%ebp 8025d2: 57 push %edi 8025d3: 56 push %esi 8025d4: 53 push %ebx 8025d5: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 8025d8: b9 00 00 00 00 mov $0x0,%ecx 8025dd: 8b 55 08 mov 0x8(%ebp),%edx 8025e0: b8 03 00 00 00 mov $0x3,%eax 8025e5: 89 cb mov %ecx,%ebx 8025e7: 89 cf mov %ecx,%edi 8025e9: 89 ce mov %ecx,%esi 8025eb: cd 30 int $0x30 if(check && ret > 0) 8025ed: 85 c0 test %eax,%eax 8025ef: 7f 08 jg 8025f9 <sys_env_destroy+0x2a> return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0); } 8025f1: 8d 65 f4 lea -0xc(%ebp),%esp 8025f4: 5b pop %ebx 8025f5: 5e pop %esi 8025f6: 5f pop %edi 8025f7: 5d pop %ebp 8025f8: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 8025f9: 83 ec 0c sub $0xc,%esp 8025fc: 50 push %eax 8025fd: 6a 03 push $0x3 8025ff: 68 1f 42 80 00 push $0x80421f 802604: 6a 23 push $0x23 802606: 68 3c 42 80 00 push $0x80423c 80260b: e8 4b f5 ff ff call 801b5b <_panic> 00802610 <sys_getenvid>: envid_t sys_getenvid(void) { 802610: 55 push %ebp 802611: 89 e5 mov %esp,%ebp 802613: 57 push %edi 802614: 56 push %esi 802615: 53 push %ebx asm volatile("int %1\n" //执行int T_SYSCALL指令 802616: ba 00 00 00 00 mov $0x0,%edx 80261b: b8 02 00 00 00 mov $0x2,%eax 802620: 89 d1 mov %edx,%ecx 802622: 89 d3 mov %edx,%ebx 802624: 89 d7 mov %edx,%edi 802626: 89 d6 mov %edx,%esi 802628: cd 30 int $0x30 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0); } 80262a: 5b pop %ebx 80262b: 5e pop %esi 80262c: 5f pop %edi 80262d: 5d pop %ebp 80262e: c3 ret 0080262f <sys_yield>: void sys_yield(void) { 80262f: 55 push %ebp 802630: 89 e5 mov %esp,%ebp 802632: 57 push %edi 802633: 56 push %esi 802634: 53 push %ebx asm volatile("int %1\n" //执行int T_SYSCALL指令 802635: ba 00 00 00 00 mov $0x0,%edx 80263a: b8 0b 00 00 00 mov $0xb,%eax 80263f: 89 d1 mov %edx,%ecx 802641: 89 d3 mov %edx,%ebx 802643: 89 d7 mov %edx,%edi 802645: 89 d6 mov %edx,%esi 802647: cd 30 int $0x30 syscall(SYS_yield, 0, 0, 0, 0, 0, 0); } 802649: 5b pop %ebx 80264a: 5e pop %esi 80264b: 5f pop %edi 80264c: 5d pop %ebp 80264d: c3 ret 0080264e <sys_page_alloc>: int sys_page_alloc(envid_t envid, void *va, int perm) { 80264e: 55 push %ebp 80264f: 89 e5 mov %esp,%ebp 802651: 57 push %edi 802652: 56 push %esi 802653: 53 push %ebx 802654: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 802657: be 00 00 00 00 mov $0x0,%esi 80265c: 8b 55 08 mov 0x8(%ebp),%edx 80265f: 8b 4d 0c mov 0xc(%ebp),%ecx 802662: b8 04 00 00 00 mov $0x4,%eax 802667: 8b 5d 10 mov 0x10(%ebp),%ebx 80266a: 89 f7 mov %esi,%edi 80266c: cd 30 int $0x30 if(check && ret > 0) 80266e: 85 c0 test %eax,%eax 802670: 7f 08 jg 80267a <sys_page_alloc+0x2c> return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0); } 802672: 8d 65 f4 lea -0xc(%ebp),%esp 802675: 5b pop %ebx 802676: 5e pop %esi 802677: 5f pop %edi 802678: 5d pop %ebp 802679: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 80267a: 83 ec 0c sub $0xc,%esp 80267d: 50 push %eax 80267e: 6a 04 push $0x4 802680: 68 1f 42 80 00 push $0x80421f 802685: 6a 23 push $0x23 802687: 68 3c 42 80 00 push $0x80423c 80268c: e8 ca f4 ff ff call 801b5b <_panic> 00802691 <sys_page_map>: int sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm) { 802691: 55 push %ebp 802692: 89 e5 mov %esp,%ebp 802694: 57 push %edi 802695: 56 push %esi 802696: 53 push %ebx 802697: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 80269a: 8b 55 08 mov 0x8(%ebp),%edx 80269d: 8b 4d 0c mov 0xc(%ebp),%ecx 8026a0: b8 05 00 00 00 mov $0x5,%eax 8026a5: 8b 5d 10 mov 0x10(%ebp),%ebx 8026a8: 8b 7d 14 mov 0x14(%ebp),%edi 8026ab: 8b 75 18 mov 0x18(%ebp),%esi 8026ae: cd 30 int $0x30 if(check && ret > 0) 8026b0: 85 c0 test %eax,%eax 8026b2: 7f 08 jg 8026bc <sys_page_map+0x2b> return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm); } 8026b4: 8d 65 f4 lea -0xc(%ebp),%esp 8026b7: 5b pop %ebx 8026b8: 5e pop %esi 8026b9: 5f pop %edi 8026ba: 5d pop %ebp 8026bb: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 8026bc: 83 ec 0c sub $0xc,%esp 8026bf: 50 push %eax 8026c0: 6a 05 push $0x5 8026c2: 68 1f 42 80 00 push $0x80421f 8026c7: 6a 23 push $0x23 8026c9: 68 3c 42 80 00 push $0x80423c 8026ce: e8 88 f4 ff ff call 801b5b <_panic> 008026d3 <sys_page_unmap>: int sys_page_unmap(envid_t envid, void *va) { 8026d3: 55 push %ebp 8026d4: 89 e5 mov %esp,%ebp 8026d6: 57 push %edi 8026d7: 56 push %esi 8026d8: 53 push %ebx 8026d9: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 8026dc: bb 00 00 00 00 mov $0x0,%ebx 8026e1: 8b 55 08 mov 0x8(%ebp),%edx 8026e4: 8b 4d 0c mov 0xc(%ebp),%ecx 8026e7: b8 06 00 00 00 mov $0x6,%eax 8026ec: 89 df mov %ebx,%edi 8026ee: 89 de mov %ebx,%esi 8026f0: cd 30 int $0x30 if(check && ret > 0) 8026f2: 85 c0 test %eax,%eax 8026f4: 7f 08 jg 8026fe <sys_page_unmap+0x2b> return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0); } 8026f6: 8d 65 f4 lea -0xc(%ebp),%esp 8026f9: 5b pop %ebx 8026fa: 5e pop %esi 8026fb: 5f pop %edi 8026fc: 5d pop %ebp 8026fd: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 8026fe: 83 ec 0c sub $0xc,%esp 802701: 50 push %eax 802702: 6a 06 push $0x6 802704: 68 1f 42 80 00 push $0x80421f 802709: 6a 23 push $0x23 80270b: 68 3c 42 80 00 push $0x80423c 802710: e8 46 f4 ff ff call 801b5b <_panic> 00802715 <sys_env_set_status>: // sys_exofork is inlined in lib.h int sys_env_set_status(envid_t envid, int status) { 802715: 55 push %ebp 802716: 89 e5 mov %esp,%ebp 802718: 57 push %edi 802719: 56 push %esi 80271a: 53 push %ebx 80271b: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 80271e: bb 00 00 00 00 mov $0x0,%ebx 802723: 8b 55 08 mov 0x8(%ebp),%edx 802726: 8b 4d 0c mov 0xc(%ebp),%ecx 802729: b8 08 00 00 00 mov $0x8,%eax 80272e: 89 df mov %ebx,%edi 802730: 89 de mov %ebx,%esi 802732: cd 30 int $0x30 if(check && ret > 0) 802734: 85 c0 test %eax,%eax 802736: 7f 08 jg 802740 <sys_env_set_status+0x2b> return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0); } 802738: 8d 65 f4 lea -0xc(%ebp),%esp 80273b: 5b pop %ebx 80273c: 5e pop %esi 80273d: 5f pop %edi 80273e: 5d pop %ebp 80273f: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 802740: 83 ec 0c sub $0xc,%esp 802743: 50 push %eax 802744: 6a 08 push $0x8 802746: 68 1f 42 80 00 push $0x80421f 80274b: 6a 23 push $0x23 80274d: 68 3c 42 80 00 push $0x80423c 802752: e8 04 f4 ff ff call 801b5b <_panic> 00802757 <sys_env_set_trapframe>: int sys_env_set_trapframe(envid_t envid, struct Trapframe *tf) { 802757: 55 push %ebp 802758: 89 e5 mov %esp,%ebp 80275a: 57 push %edi 80275b: 56 push %esi 80275c: 53 push %ebx 80275d: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 802760: bb 00 00 00 00 mov $0x0,%ebx 802765: 8b 55 08 mov 0x8(%ebp),%edx 802768: 8b 4d 0c mov 0xc(%ebp),%ecx 80276b: b8 09 00 00 00 mov $0x9,%eax 802770: 89 df mov %ebx,%edi 802772: 89 de mov %ebx,%esi 802774: cd 30 int $0x30 if(check && ret > 0) 802776: 85 c0 test %eax,%eax 802778: 7f 08 jg 802782 <sys_env_set_trapframe+0x2b> return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0); } 80277a: 8d 65 f4 lea -0xc(%ebp),%esp 80277d: 5b pop %ebx 80277e: 5e pop %esi 80277f: 5f pop %edi 802780: 5d pop %ebp 802781: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 802782: 83 ec 0c sub $0xc,%esp 802785: 50 push %eax 802786: 6a 09 push $0x9 802788: 68 1f 42 80 00 push $0x80421f 80278d: 6a 23 push $0x23 80278f: 68 3c 42 80 00 push $0x80423c 802794: e8 c2 f3 ff ff call 801b5b <_panic> 00802799 <sys_env_set_pgfault_upcall>: int sys_env_set_pgfault_upcall(envid_t envid, void *upcall) { 802799: 55 push %ebp 80279a: 89 e5 mov %esp,%ebp 80279c: 57 push %edi 80279d: 56 push %esi 80279e: 53 push %ebx 80279f: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 8027a2: bb 00 00 00 00 mov $0x0,%ebx 8027a7: 8b 55 08 mov 0x8(%ebp),%edx 8027aa: 8b 4d 0c mov 0xc(%ebp),%ecx 8027ad: b8 0a 00 00 00 mov $0xa,%eax 8027b2: 89 df mov %ebx,%edi 8027b4: 89 de mov %ebx,%esi 8027b6: cd 30 int $0x30 if(check && ret > 0) 8027b8: 85 c0 test %eax,%eax 8027ba: 7f 08 jg 8027c4 <sys_env_set_pgfault_upcall+0x2b> return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0); } 8027bc: 8d 65 f4 lea -0xc(%ebp),%esp 8027bf: 5b pop %ebx 8027c0: 5e pop %esi 8027c1: 5f pop %edi 8027c2: 5d pop %ebp 8027c3: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 8027c4: 83 ec 0c sub $0xc,%esp 8027c7: 50 push %eax 8027c8: 6a 0a push $0xa 8027ca: 68 1f 42 80 00 push $0x80421f 8027cf: 6a 23 push $0x23 8027d1: 68 3c 42 80 00 push $0x80423c 8027d6: e8 80 f3 ff ff call 801b5b <_panic> 008027db <sys_ipc_try_send>: int sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm) { 8027db: 55 push %ebp 8027dc: 89 e5 mov %esp,%ebp 8027de: 57 push %edi 8027df: 56 push %esi 8027e0: 53 push %ebx asm volatile("int %1\n" //执行int T_SYSCALL指令 8027e1: 8b 55 08 mov 0x8(%ebp),%edx 8027e4: 8b 4d 0c mov 0xc(%ebp),%ecx 8027e7: b8 0c 00 00 00 mov $0xc,%eax 8027ec: be 00 00 00 00 mov $0x0,%esi 8027f1: 8b 5d 10 mov 0x10(%ebp),%ebx 8027f4: 8b 7d 14 mov 0x14(%ebp),%edi 8027f7: cd 30 int $0x30 return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0); } 8027f9: 5b pop %ebx 8027fa: 5e pop %esi 8027fb: 5f pop %edi 8027fc: 5d pop %ebp 8027fd: c3 ret 008027fe <sys_ipc_recv>: int sys_ipc_recv(void *dstva) { 8027fe: 55 push %ebp 8027ff: 89 e5 mov %esp,%ebp 802801: 57 push %edi 802802: 56 push %esi 802803: 53 push %ebx 802804: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 802807: b9 00 00 00 00 mov $0x0,%ecx 80280c: 8b 55 08 mov 0x8(%ebp),%edx 80280f: b8 0d 00 00 00 mov $0xd,%eax 802814: 89 cb mov %ecx,%ebx 802816: 89 cf mov %ecx,%edi 802818: 89 ce mov %ecx,%esi 80281a: cd 30 int $0x30 if(check && ret > 0) 80281c: 85 c0 test %eax,%eax 80281e: 7f 08 jg 802828 <sys_ipc_recv+0x2a> return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0); } 802820: 8d 65 f4 lea -0xc(%ebp),%esp 802823: 5b pop %ebx 802824: 5e pop %esi 802825: 5f pop %edi 802826: 5d pop %ebp 802827: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 802828: 83 ec 0c sub $0xc,%esp 80282b: 50 push %eax 80282c: 6a 0d push $0xd 80282e: 68 1f 42 80 00 push $0x80421f 802833: 6a 23 push $0x23 802835: 68 3c 42 80 00 push $0x80423c 80283a: e8 1c f3 ff ff call 801b5b <_panic> 0080283f <set_pgfault_handler>: // at UXSTACKTOP), and tell the kernel to call the assembly-language // _pgfault_upcall routine when a page fault occurs. // void set_pgfault_handler(void (*handler)(struct UTrapframe *utf)) { 80283f: 55 push %ebp 802840: 89 e5 mov %esp,%ebp 802842: 83 ec 08 sub $0x8,%esp int r; if (_pgfault_handler == 0) { 802845: 83 3d 10 a0 80 00 00 cmpl $0x0,0x80a010 80284c: 74 0a je 802858 <set_pgfault_handler+0x19> } sys_env_set_pgfault_upcall(0, _pgfault_upcall); //系统调用,设置进程的env_pgfault_upcall属性 } // Save handler pointer for assembly to call. _pgfault_handler = handler; 80284e: 8b 45 08 mov 0x8(%ebp),%eax 802851: a3 10 a0 80 00 mov %eax,0x80a010 } 802856: c9 leave 802857: c3 ret int r = sys_page_alloc(0, (void *)(UXSTACKTOP-PGSIZE), PTE_W | PTE_U | PTE_P); //为当前进程分配异常栈 802858: 83 ec 04 sub $0x4,%esp 80285b: 6a 07 push $0x7 80285d: 68 00 f0 bf ee push $0xeebff000 802862: 6a 00 push $0x0 802864: e8 e5 fd ff ff call 80264e <sys_page_alloc> if (r < 0) { 802869: 83 c4 10 add $0x10,%esp 80286c: 85 c0 test %eax,%eax 80286e: 78 14 js 802884 <set_pgfault_handler+0x45> sys_env_set_pgfault_upcall(0, _pgfault_upcall); //系统调用,设置进程的env_pgfault_upcall属性 802870: 83 ec 08 sub $0x8,%esp 802873: 68 98 28 80 00 push $0x802898 802878: 6a 00 push $0x0 80287a: e8 1a ff ff ff call 802799 <sys_env_set_pgfault_upcall> 80287f: 83 c4 10 add $0x10,%esp 802882: eb ca jmp 80284e <set_pgfault_handler+0xf> panic("set_pgfault_handler:sys_page_alloc failed");; 802884: 83 ec 04 sub $0x4,%esp 802887: 68 4c 42 80 00 push $0x80424c 80288c: 6a 22 push $0x22 80288e: 68 76 42 80 00 push $0x804276 802893: e8 c3 f2 ff ff call 801b5b <_panic> 00802898 <_pgfault_upcall>: .text .globl _pgfault_upcall _pgfault_upcall: // Call the C page fault handler. pushl %esp // function argument: pointer to UTF 802898: 54 push %esp movl _pgfault_handler, %eax 802899: a1 10 a0 80 00 mov 0x80a010,%eax call *%eax //调用页处理函数 80289e: ff d0 call *%eax addl $4, %esp // pop function argument 8028a0: 83 c4 04 add $0x4,%esp // LAB 4: Your code here. // Restore the trap-time registers. After you do this, you // can no longer modify any general-purpose registers. // LAB 4: Your code here. addl $8, %esp //跳过utf_fault_va和utf_err 8028a3: 83 c4 08 add $0x8,%esp movl 40(%esp), %eax //保存中断发生时的esp到eax 8028a6: 8b 44 24 28 mov 0x28(%esp),%eax movl 32(%esp), %ecx //保存终端发生时的eip到ecx 8028aa: 8b 4c 24 20 mov 0x20(%esp),%ecx movl %ecx, -4(%eax) //将中断发生时的esp值亚入到到原来的栈中 8028ae: 89 48 fc mov %ecx,-0x4(%eax) popal 8028b1: 61 popa addl $4, %esp //跳过eip 8028b2: 83 c4 04 add $0x4,%esp // Restore eflags from the stack. After you do this, you can // no longer use arithmetic operations or anything else that // modifies eflags. // LAB 4: Your code here. popfl 8028b5: 9d popf // Switch back to the adjusted trap-time stack. // LAB 4: Your code here. popl %esp 8028b6: 5c pop %esp // Return to re-execute the instruction that faulted. // LAB 4: Your code here. lea -4(%esp), %esp //因为之前压入了eip的值但是没有减esp的值,所以现在需要将esp寄存器中的值减4 8028b7: 8d 64 24 fc lea -0x4(%esp),%esp 8028bb: c3 ret 008028bc <ipc_recv>: // If 'pg' is null, pass sys_ipc_recv a value that it will understand // as meaning "no page". (Zero is not the right value, since that's // a perfectly valid place to map a page.) int32_t ipc_recv(envid_t *from_env_store, void *pg, int *perm_store) { 8028bc: 55 push %ebp 8028bd: 89 e5 mov %esp,%ebp 8028bf: 56 push %esi 8028c0: 53 push %ebx 8028c1: 8b 75 08 mov 0x8(%ebp),%esi 8028c4: 8b 45 0c mov 0xc(%ebp),%eax 8028c7: 8b 5d 10 mov 0x10(%ebp),%ebx // LAB 4: Your code here. if (pg == NULL) { 8028ca: 85 c0 test %eax,%eax pg = (void *)-1; 8028cc: ba ff ff ff ff mov $0xffffffff,%edx 8028d1: 0f 44 c2 cmove %edx,%eax } int r = sys_ipc_recv(pg); 8028d4: 83 ec 0c sub $0xc,%esp 8028d7: 50 push %eax 8028d8: e8 21 ff ff ff call 8027fe <sys_ipc_recv> if (r < 0) { //系统调用失败 8028dd: 83 c4 10 add $0x10,%esp 8028e0: 85 c0 test %eax,%eax 8028e2: 78 2b js 80290f <ipc_recv+0x53> if (from_env_store) *from_env_store = 0; if (perm_store) *perm_store = 0; return r; } if (from_env_store) 8028e4: 85 f6 test %esi,%esi 8028e6: 74 0a je 8028f2 <ipc_recv+0x36> *from_env_store = thisenv->env_ipc_from; 8028e8: a1 0c a0 80 00 mov 0x80a00c,%eax 8028ed: 8b 40 74 mov 0x74(%eax),%eax 8028f0: 89 06 mov %eax,(%esi) if (perm_store) 8028f2: 85 db test %ebx,%ebx 8028f4: 74 0a je 802900 <ipc_recv+0x44> *perm_store = thisenv->env_ipc_perm; 8028f6: a1 0c a0 80 00 mov 0x80a00c,%eax 8028fb: 8b 40 78 mov 0x78(%eax),%eax 8028fe: 89 03 mov %eax,(%ebx) return thisenv->env_ipc_value; 802900: a1 0c a0 80 00 mov 0x80a00c,%eax 802905: 8b 40 70 mov 0x70(%eax),%eax } 802908: 8d 65 f8 lea -0x8(%ebp),%esp 80290b: 5b pop %ebx 80290c: 5e pop %esi 80290d: 5d pop %ebp 80290e: c3 ret if (from_env_store) *from_env_store = 0; 80290f: 85 f6 test %esi,%esi 802911: 74 06 je 802919 <ipc_recv+0x5d> 802913: c7 06 00 00 00 00 movl $0x0,(%esi) if (perm_store) *perm_store = 0; 802919: 85 db test %ebx,%ebx 80291b: 74 eb je 802908 <ipc_recv+0x4c> 80291d: c7 03 00 00 00 00 movl $0x0,(%ebx) 802923: eb e3 jmp 802908 <ipc_recv+0x4c> 00802925 <ipc_send>: // Use sys_yield() to be CPU-friendly. // If 'pg' is null, pass sys_ipc_try_send a value that it will understand // as meaning "no page". (Zero is not the right value.) void ipc_send(envid_t to_env, uint32_t val, void *pg, int perm) { 802925: 55 push %ebp 802926: 89 e5 mov %esp,%ebp 802928: 57 push %edi 802929: 56 push %esi 80292a: 53 push %ebx 80292b: 83 ec 0c sub $0xc,%esp 80292e: 8b 7d 08 mov 0x8(%ebp),%edi 802931: 8b 75 0c mov 0xc(%ebp),%esi 802934: 8b 5d 10 mov 0x10(%ebp),%ebx // LAB 4: Your code here. if (pg == NULL) { 802937: 85 db test %ebx,%ebx pg = (void *)-1; 802939: b8 ff ff ff ff mov $0xffffffff,%eax 80293e: 0f 44 d8 cmove %eax,%ebx } int r; while(1) { r = sys_ipc_try_send(to_env, val, pg, perm); 802941: ff 75 14 pushl 0x14(%ebp) 802944: 53 push %ebx 802945: 56 push %esi 802946: 57 push %edi 802947: e8 8f fe ff ff call 8027db <sys_ipc_try_send> if (r == 0) { //发送成功 80294c: 83 c4 10 add $0x10,%esp 80294f: 85 c0 test %eax,%eax 802951: 74 1e je 802971 <ipc_send+0x4c> return; } else if (r == -E_IPC_NOT_RECV) { //接收进程没有准备好 802953: 83 f8 f9 cmp $0xfffffff9,%eax 802956: 75 07 jne 80295f <ipc_send+0x3a> sys_yield(); 802958: e8 d2 fc ff ff call 80262f <sys_yield> r = sys_ipc_try_send(to_env, val, pg, perm); 80295d: eb e2 jmp 802941 <ipc_send+0x1c> } else { //其它错误 panic("ipc_send():%e", r); 80295f: 50 push %eax 802960: 68 84 42 80 00 push $0x804284 802965: 6a 41 push $0x41 802967: 68 92 42 80 00 push $0x804292 80296c: e8 ea f1 ff ff call 801b5b <_panic> } } } 802971: 8d 65 f4 lea -0xc(%ebp),%esp 802974: 5b pop %ebx 802975: 5e pop %esi 802976: 5f pop %edi 802977: 5d pop %ebp 802978: c3 ret 00802979 <ipc_find_env>: // Find the first environment of the given type. We'll use this to // find special environments. // Returns 0 if no such environment exists. envid_t ipc_find_env(enum EnvType type) { 802979: 55 push %ebp 80297a: 89 e5 mov %esp,%ebp 80297c: 8b 4d 08 mov 0x8(%ebp),%ecx int i; for (i = 0; i < NENV; i++) 80297f: b8 00 00 00 00 mov $0x0,%eax if (envs[i].env_type == type) 802984: 6b d0 7c imul $0x7c,%eax,%edx 802987: 81 c2 00 00 c0 ee add $0xeec00000,%edx 80298d: 8b 52 50 mov 0x50(%edx),%edx 802990: 39 ca cmp %ecx,%edx 802992: 74 11 je 8029a5 <ipc_find_env+0x2c> for (i = 0; i < NENV; i++) 802994: 83 c0 01 add $0x1,%eax 802997: 3d 00 04 00 00 cmp $0x400,%eax 80299c: 75 e6 jne 802984 <ipc_find_env+0xb> return envs[i].env_id; return 0; 80299e: b8 00 00 00 00 mov $0x0,%eax 8029a3: eb 0b jmp 8029b0 <ipc_find_env+0x37> return envs[i].env_id; 8029a5: 6b c0 7c imul $0x7c,%eax,%eax 8029a8: 05 00 00 c0 ee add $0xeec00000,%eax 8029ad: 8b 40 48 mov 0x48(%eax),%eax } 8029b0: 5d pop %ebp 8029b1: c3 ret 008029b2 <fsipc>: // type: request code, passed as the simple integer IPC value. // dstva: virtual address at which to receive reply page, 0 if none. // Returns result from the file server. static int fsipc(unsigned type, void *dstva) { 8029b2: 55 push %ebp 8029b3: 89 e5 mov %esp,%ebp 8029b5: 56 push %esi 8029b6: 53 push %ebx 8029b7: 89 c6 mov %eax,%esi 8029b9: 89 d3 mov %edx,%ebx static envid_t fsenv; if (fsenv == 0) 8029bb: 83 3d 00 a0 80 00 00 cmpl $0x0,0x80a000 8029c2: 74 27 je 8029eb <fsipc+0x39> static_assert(sizeof(fsipcbuf) == PGSIZE); if (debug) cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf); ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U); 8029c4: 6a 07 push $0x7 8029c6: 68 00 b0 80 00 push $0x80b000 8029cb: 56 push %esi 8029cc: ff 35 00 a0 80 00 pushl 0x80a000 8029d2: e8 4e ff ff ff call 802925 <ipc_send> return ipc_recv(NULL, dstva, NULL); 8029d7: 83 c4 0c add $0xc,%esp 8029da: 6a 00 push $0x0 8029dc: 53 push %ebx 8029dd: 6a 00 push $0x0 8029df: e8 d8 fe ff ff call 8028bc <ipc_recv> } 8029e4: 8d 65 f8 lea -0x8(%ebp),%esp 8029e7: 5b pop %ebx 8029e8: 5e pop %esi 8029e9: 5d pop %ebp 8029ea: c3 ret fsenv = ipc_find_env(ENV_TYPE_FS); 8029eb: 83 ec 0c sub $0xc,%esp 8029ee: 6a 01 push $0x1 8029f0: e8 84 ff ff ff call 802979 <ipc_find_env> 8029f5: a3 00 a0 80 00 mov %eax,0x80a000 8029fa: 83 c4 10 add $0x10,%esp 8029fd: eb c5 jmp 8029c4 <fsipc+0x12> 008029ff <devfile_trunc>: } // Truncate or extend an open file to 'size' bytes static int devfile_trunc(struct Fd *fd, off_t newsize) { 8029ff: 55 push %ebp 802a00: 89 e5 mov %esp,%ebp 802a02: 83 ec 08 sub $0x8,%esp fsipcbuf.set_size.req_fileid = fd->fd_file.id; 802a05: 8b 45 08 mov 0x8(%ebp),%eax 802a08: 8b 40 0c mov 0xc(%eax),%eax 802a0b: a3 00 b0 80 00 mov %eax,0x80b000 fsipcbuf.set_size.req_size = newsize; 802a10: 8b 45 0c mov 0xc(%ebp),%eax 802a13: a3 04 b0 80 00 mov %eax,0x80b004 return fsipc(FSREQ_SET_SIZE, NULL); 802a18: ba 00 00 00 00 mov $0x0,%edx 802a1d: b8 02 00 00 00 mov $0x2,%eax 802a22: e8 8b ff ff ff call 8029b2 <fsipc> } 802a27: c9 leave 802a28: c3 ret 00802a29 <devfile_flush>: { 802a29: 55 push %ebp 802a2a: 89 e5 mov %esp,%ebp 802a2c: 83 ec 08 sub $0x8,%esp fsipcbuf.flush.req_fileid = fd->fd_file.id; 802a2f: 8b 45 08 mov 0x8(%ebp),%eax 802a32: 8b 40 0c mov 0xc(%eax),%eax 802a35: a3 00 b0 80 00 mov %eax,0x80b000 return fsipc(FSREQ_FLUSH, NULL); 802a3a: ba 00 00 00 00 mov $0x0,%edx 802a3f: b8 06 00 00 00 mov $0x6,%eax 802a44: e8 69 ff ff ff call 8029b2 <fsipc> } 802a49: c9 leave 802a4a: c3 ret 00802a4b <devfile_stat>: { 802a4b: 55 push %ebp 802a4c: 89 e5 mov %esp,%ebp 802a4e: 53 push %ebx 802a4f: 83 ec 04 sub $0x4,%esp 802a52: 8b 5d 0c mov 0xc(%ebp),%ebx fsipcbuf.stat.req_fileid = fd->fd_file.id; 802a55: 8b 45 08 mov 0x8(%ebp),%eax 802a58: 8b 40 0c mov 0xc(%eax),%eax 802a5b: a3 00 b0 80 00 mov %eax,0x80b000 if ((r = fsipc(FSREQ_STAT, NULL)) < 0) 802a60: ba 00 00 00 00 mov $0x0,%edx 802a65: b8 05 00 00 00 mov $0x5,%eax 802a6a: e8 43 ff ff ff call 8029b2 <fsipc> 802a6f: 85 c0 test %eax,%eax 802a71: 78 2c js 802a9f <devfile_stat+0x54> strcpy(st->st_name, fsipcbuf.statRet.ret_name); 802a73: 83 ec 08 sub $0x8,%esp 802a76: 68 00 b0 80 00 push $0x80b000 802a7b: 53 push %ebx 802a7c: e8 d4 f7 ff ff call 802255 <strcpy> st->st_size = fsipcbuf.statRet.ret_size; 802a81: a1 80 b0 80 00 mov 0x80b080,%eax 802a86: 89 83 80 00 00 00 mov %eax,0x80(%ebx) st->st_isdir = fsipcbuf.statRet.ret_isdir; 802a8c: a1 84 b0 80 00 mov 0x80b084,%eax 802a91: 89 83 84 00 00 00 mov %eax,0x84(%ebx) return 0; 802a97: 83 c4 10 add $0x10,%esp 802a9a: b8 00 00 00 00 mov $0x0,%eax } 802a9f: 8b 5d fc mov -0x4(%ebp),%ebx 802aa2: c9 leave 802aa3: c3 ret 00802aa4 <devfile_write>: { 802aa4: 55 push %ebp 802aa5: 89 e5 mov %esp,%ebp 802aa7: 53 push %ebx 802aa8: 83 ec 08 sub $0x8,%esp 802aab: 8b 5d 10 mov 0x10(%ebp),%ebx n = sizeof(fsipcbuf.write.req_buf) > n ? n : sizeof(fsipcbuf.write.req_buf); 802aae: 81 fb f8 0f 00 00 cmp $0xff8,%ebx 802ab4: b8 f8 0f 00 00 mov $0xff8,%eax 802ab9: 0f 47 d8 cmova %eax,%ebx fsipcbuf.write.req_fileid = fd->fd_file.id; 802abc: 8b 45 08 mov 0x8(%ebp),%eax 802abf: 8b 40 0c mov 0xc(%eax),%eax 802ac2: a3 00 b0 80 00 mov %eax,0x80b000 fsipcbuf.write.req_n = n; 802ac7: 89 1d 04 b0 80 00 mov %ebx,0x80b004 memmove(fsipcbuf.write.req_buf, buf, n); 802acd: 53 push %ebx 802ace: ff 75 0c pushl 0xc(%ebp) 802ad1: 68 08 b0 80 00 push $0x80b008 802ad6: e8 08 f9 ff ff call 8023e3 <memmove> if ((r = fsipc(FSREQ_WRITE, NULL)) < 0) 802adb: ba 00 00 00 00 mov $0x0,%edx 802ae0: b8 04 00 00 00 mov $0x4,%eax 802ae5: e8 c8 fe ff ff call 8029b2 <fsipc> 802aea: 83 c4 10 add $0x10,%esp 802aed: 85 c0 test %eax,%eax 802aef: 78 0b js 802afc <devfile_write+0x58> assert(r <= n); 802af1: 39 d8 cmp %ebx,%eax 802af3: 77 0c ja 802b01 <devfile_write+0x5d> assert(r <= PGSIZE); 802af5: 3d 00 10 00 00 cmp $0x1000,%eax 802afa: 7f 1e jg 802b1a <devfile_write+0x76> } 802afc: 8b 5d fc mov -0x4(%ebp),%ebx 802aff: c9 leave 802b00: c3 ret assert(r <= n); 802b01: 68 9c 42 80 00 push $0x80429c 802b06: 68 7d 39 80 00 push $0x80397d 802b0b: 68 98 00 00 00 push $0x98 802b10: 68 a3 42 80 00 push $0x8042a3 802b15: e8 41 f0 ff ff call 801b5b <_panic> assert(r <= PGSIZE); 802b1a: 68 ae 42 80 00 push $0x8042ae 802b1f: 68 7d 39 80 00 push $0x80397d 802b24: 68 99 00 00 00 push $0x99 802b29: 68 a3 42 80 00 push $0x8042a3 802b2e: e8 28 f0 ff ff call 801b5b <_panic> 00802b33 <devfile_read>: { 802b33: 55 push %ebp 802b34: 89 e5 mov %esp,%ebp 802b36: 56 push %esi 802b37: 53 push %ebx 802b38: 8b 75 10 mov 0x10(%ebp),%esi fsipcbuf.read.req_fileid = fd->fd_file.id; 802b3b: 8b 45 08 mov 0x8(%ebp),%eax 802b3e: 8b 40 0c mov 0xc(%eax),%eax 802b41: a3 00 b0 80 00 mov %eax,0x80b000 fsipcbuf.read.req_n = n; 802b46: 89 35 04 b0 80 00 mov %esi,0x80b004 if ((r = fsipc(FSREQ_READ, NULL)) < 0) 802b4c: ba 00 00 00 00 mov $0x0,%edx 802b51: b8 03 00 00 00 mov $0x3,%eax 802b56: e8 57 fe ff ff call 8029b2 <fsipc> 802b5b: 89 c3 mov %eax,%ebx 802b5d: 85 c0 test %eax,%eax 802b5f: 78 1f js 802b80 <devfile_read+0x4d> assert(r <= n); 802b61: 39 f0 cmp %esi,%eax 802b63: 77 24 ja 802b89 <devfile_read+0x56> assert(r <= PGSIZE); 802b65: 3d 00 10 00 00 cmp $0x1000,%eax 802b6a: 7f 33 jg 802b9f <devfile_read+0x6c> memmove(buf, fsipcbuf.readRet.ret_buf, r); 802b6c: 83 ec 04 sub $0x4,%esp 802b6f: 50 push %eax 802b70: 68 00 b0 80 00 push $0x80b000 802b75: ff 75 0c pushl 0xc(%ebp) 802b78: e8 66 f8 ff ff call 8023e3 <memmove> return r; 802b7d: 83 c4 10 add $0x10,%esp } 802b80: 89 d8 mov %ebx,%eax 802b82: 8d 65 f8 lea -0x8(%ebp),%esp 802b85: 5b pop %ebx 802b86: 5e pop %esi 802b87: 5d pop %ebp 802b88: c3 ret assert(r <= n); 802b89: 68 9c 42 80 00 push $0x80429c 802b8e: 68 7d 39 80 00 push $0x80397d 802b93: 6a 7c push $0x7c 802b95: 68 a3 42 80 00 push $0x8042a3 802b9a: e8 bc ef ff ff call 801b5b <_panic> assert(r <= PGSIZE); 802b9f: 68 ae 42 80 00 push $0x8042ae 802ba4: 68 7d 39 80 00 push $0x80397d 802ba9: 6a 7d push $0x7d 802bab: 68 a3 42 80 00 push $0x8042a3 802bb0: e8 a6 ef ff ff call 801b5b <_panic> 00802bb5 <open>: { 802bb5: 55 push %ebp 802bb6: 89 e5 mov %esp,%ebp 802bb8: 56 push %esi 802bb9: 53 push %ebx 802bba: 83 ec 1c sub $0x1c,%esp 802bbd: 8b 75 08 mov 0x8(%ebp),%esi if (strlen(path) >= MAXPATHLEN) 802bc0: 56 push %esi 802bc1: e8 58 f6 ff ff call 80221e <strlen> 802bc6: 83 c4 10 add $0x10,%esp 802bc9: 3d ff 03 00 00 cmp $0x3ff,%eax 802bce: 7f 6c jg 802c3c <open+0x87> if ((r = fd_alloc(&fd)) < 0) 802bd0: 83 ec 0c sub $0xc,%esp 802bd3: 8d 45 f4 lea -0xc(%ebp),%eax 802bd6: 50 push %eax 802bd7: e8 e0 00 00 00 call 802cbc <fd_alloc> 802bdc: 89 c3 mov %eax,%ebx 802bde: 83 c4 10 add $0x10,%esp 802be1: 85 c0 test %eax,%eax 802be3: 78 3c js 802c21 <open+0x6c> strcpy(fsipcbuf.open.req_path, path); 802be5: 83 ec 08 sub $0x8,%esp 802be8: 56 push %esi 802be9: 68 00 b0 80 00 push $0x80b000 802bee: e8 62 f6 ff ff call 802255 <strcpy> fsipcbuf.open.req_omode = mode; 802bf3: 8b 45 0c mov 0xc(%ebp),%eax 802bf6: a3 00 b4 80 00 mov %eax,0x80b400 if ((r = fsipc(FSREQ_OPEN, fd)) < 0) { 802bfb: 8b 55 f4 mov -0xc(%ebp),%edx 802bfe: b8 01 00 00 00 mov $0x1,%eax 802c03: e8 aa fd ff ff call 8029b2 <fsipc> 802c08: 89 c3 mov %eax,%ebx 802c0a: 83 c4 10 add $0x10,%esp 802c0d: 85 c0 test %eax,%eax 802c0f: 78 19 js 802c2a <open+0x75> return fd2num(fd); 802c11: 83 ec 0c sub $0xc,%esp 802c14: ff 75 f4 pushl -0xc(%ebp) 802c17: e8 79 00 00 00 call 802c95 <fd2num> 802c1c: 89 c3 mov %eax,%ebx 802c1e: 83 c4 10 add $0x10,%esp } 802c21: 89 d8 mov %ebx,%eax 802c23: 8d 65 f8 lea -0x8(%ebp),%esp 802c26: 5b pop %ebx 802c27: 5e pop %esi 802c28: 5d pop %ebp 802c29: c3 ret fd_close(fd, 0); 802c2a: 83 ec 08 sub $0x8,%esp 802c2d: 6a 00 push $0x0 802c2f: ff 75 f4 pushl -0xc(%ebp) 802c32: e8 80 01 00 00 call 802db7 <fd_close> return r; 802c37: 83 c4 10 add $0x10,%esp 802c3a: eb e5 jmp 802c21 <open+0x6c> return -E_BAD_PATH; 802c3c: bb f4 ff ff ff mov $0xfffffff4,%ebx 802c41: eb de jmp 802c21 <open+0x6c> 00802c43 <sync>: // Synchronize disk with buffer cache int sync(void) { 802c43: 55 push %ebp 802c44: 89 e5 mov %esp,%ebp 802c46: 83 ec 08 sub $0x8,%esp // Ask the file server to update the disk // by writing any dirty blocks in the buffer cache. return fsipc(FSREQ_SYNC, NULL); 802c49: ba 00 00 00 00 mov $0x0,%edx 802c4e: b8 08 00 00 00 mov $0x8,%eax 802c53: e8 5a fd ff ff call 8029b2 <fsipc> } 802c58: c9 leave 802c59: c3 ret 00802c5a <pageref>: #include <inc/lib.h> int pageref(void *v) { 802c5a: 55 push %ebp 802c5b: 89 e5 mov %esp,%ebp 802c5d: 8b 55 08 mov 0x8(%ebp),%edx pte_t pte; if (!(uvpd[PDX(v)] & PTE_P)) 802c60: 89 d0 mov %edx,%eax 802c62: c1 e8 16 shr $0x16,%eax 802c65: 8b 0c 85 00 d0 7b ef mov -0x10843000(,%eax,4),%ecx return 0; 802c6c: b8 00 00 00 00 mov $0x0,%eax if (!(uvpd[PDX(v)] & PTE_P)) 802c71: f6 c1 01 test $0x1,%cl 802c74: 74 1d je 802c93 <pageref+0x39> pte = uvpt[PGNUM(v)]; 802c76: c1 ea 0c shr $0xc,%edx 802c79: 8b 14 95 00 00 40 ef mov -0x10c00000(,%edx,4),%edx if (!(pte & PTE_P)) 802c80: f6 c2 01 test $0x1,%dl 802c83: 74 0e je 802c93 <pageref+0x39> return 0; return pages[PGNUM(pte)].pp_ref; 802c85: c1 ea 0c shr $0xc,%edx 802c88: 0f b7 04 d5 04 00 00 movzwl -0x10fffffc(,%edx,8),%eax 802c8f: ef 802c90: 0f b7 c0 movzwl %ax,%eax } 802c93: 5d pop %ebp 802c94: c3 ret 00802c95 <fd2num>: // File descriptor manipulators // -------------------------------------------------------------- int fd2num(struct Fd *fd) { 802c95: 55 push %ebp 802c96: 89 e5 mov %esp,%ebp return ((uintptr_t) fd - FDTABLE) / PGSIZE; 802c98: 8b 45 08 mov 0x8(%ebp),%eax 802c9b: 05 00 00 00 30 add $0x30000000,%eax 802ca0: c1 e8 0c shr $0xc,%eax } 802ca3: 5d pop %ebp 802ca4: c3 ret 00802ca5 <fd2data>: char* fd2data(struct Fd *fd) { 802ca5: 55 push %ebp 802ca6: 89 e5 mov %esp,%ebp return ((uintptr_t) fd - FDTABLE) / PGSIZE; 802ca8: 8b 45 08 mov 0x8(%ebp),%eax 802cab: 05 00 00 00 30 add $0x30000000,%eax return INDEX2DATA(fd2num(fd)); 802cb0: 25 00 f0 ff ff and $0xfffff000,%eax 802cb5: 2d 00 00 fe 2f sub $0x2ffe0000,%eax } 802cba: 5d pop %ebp 802cbb: c3 ret 00802cbc <fd_alloc>: // Returns 0 on success, < 0 on error. Errors are: // -E_MAX_FD: no more file descriptors // On error, *fd_store is set to 0. int fd_alloc(struct Fd **fd_store) { 802cbc: 55 push %ebp 802cbd: 89 e5 mov %esp,%ebp 802cbf: 8b 4d 08 mov 0x8(%ebp),%ecx 802cc2: b8 00 00 00 d0 mov $0xd0000000,%eax int i; struct Fd *fd; for (i = 0; i < MAXFD; i++) { fd = INDEX2FD(i); if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) { 802cc7: 89 c2 mov %eax,%edx 802cc9: c1 ea 16 shr $0x16,%edx 802ccc: 8b 14 95 00 d0 7b ef mov -0x10843000(,%edx,4),%edx 802cd3: f6 c2 01 test $0x1,%dl 802cd6: 74 2a je 802d02 <fd_alloc+0x46> 802cd8: 89 c2 mov %eax,%edx 802cda: c1 ea 0c shr $0xc,%edx 802cdd: 8b 14 95 00 00 40 ef mov -0x10c00000(,%edx,4),%edx 802ce4: f6 c2 01 test $0x1,%dl 802ce7: 74 19 je 802d02 <fd_alloc+0x46> 802ce9: 05 00 10 00 00 add $0x1000,%eax for (i = 0; i < MAXFD; i++) { 802cee: 3d 00 00 02 d0 cmp $0xd0020000,%eax 802cf3: 75 d2 jne 802cc7 <fd_alloc+0xb> *fd_store = fd; return 0; } } *fd_store = 0; 802cf5: c7 01 00 00 00 00 movl $0x0,(%ecx) return -E_MAX_OPEN; 802cfb: b8 f6 ff ff ff mov $0xfffffff6,%eax 802d00: eb 07 jmp 802d09 <fd_alloc+0x4d> *fd_store = fd; 802d02: 89 01 mov %eax,(%ecx) return 0; 802d04: b8 00 00 00 00 mov $0x0,%eax } 802d09: 5d pop %ebp 802d0a: c3 ret 00802d0b <fd_lookup>: // Returns 0 on success (the page is in range and mapped), < 0 on error. // Errors are: // -E_INVAL: fdnum was either not in range or not mapped. int fd_lookup(int fdnum, struct Fd **fd_store) { 802d0b: 55 push %ebp 802d0c: 89 e5 mov %esp,%ebp 802d0e: 8b 45 08 mov 0x8(%ebp),%eax struct Fd *fd; if (fdnum < 0 || fdnum >= MAXFD) { 802d11: 83 f8 1f cmp $0x1f,%eax 802d14: 77 36 ja 802d4c <fd_lookup+0x41> if (debug) cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum); return -E_INVAL; } fd = INDEX2FD(fdnum); 802d16: c1 e0 0c shl $0xc,%eax 802d19: 2d 00 00 00 30 sub $0x30000000,%eax if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) { 802d1e: 89 c2 mov %eax,%edx 802d20: c1 ea 16 shr $0x16,%edx 802d23: 8b 14 95 00 d0 7b ef mov -0x10843000(,%edx,4),%edx 802d2a: f6 c2 01 test $0x1,%dl 802d2d: 74 24 je 802d53 <fd_lookup+0x48> 802d2f: 89 c2 mov %eax,%edx 802d31: c1 ea 0c shr $0xc,%edx 802d34: 8b 14 95 00 00 40 ef mov -0x10c00000(,%edx,4),%edx 802d3b: f6 c2 01 test $0x1,%dl 802d3e: 74 1a je 802d5a <fd_lookup+0x4f> if (debug) cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum); return -E_INVAL; } *fd_store = fd; 802d40: 8b 55 0c mov 0xc(%ebp),%edx 802d43: 89 02 mov %eax,(%edx) return 0; 802d45: b8 00 00 00 00 mov $0x0,%eax } 802d4a: 5d pop %ebp 802d4b: c3 ret return -E_INVAL; 802d4c: b8 fd ff ff ff mov $0xfffffffd,%eax 802d51: eb f7 jmp 802d4a <fd_lookup+0x3f> return -E_INVAL; 802d53: b8 fd ff ff ff mov $0xfffffffd,%eax 802d58: eb f0 jmp 802d4a <fd_lookup+0x3f> 802d5a: b8 fd ff ff ff mov $0xfffffffd,%eax 802d5f: eb e9 jmp 802d4a <fd_lookup+0x3f> 00802d61 <dev_lookup>: 0 }; int dev_lookup(int dev_id, struct Dev **dev) { 802d61: 55 push %ebp 802d62: 89 e5 mov %esp,%ebp 802d64: 83 ec 08 sub $0x8,%esp 802d67: 8b 4d 08 mov 0x8(%ebp),%ecx 802d6a: ba 3c 43 80 00 mov $0x80433c,%edx int i; for (i = 0; devtab[i]; i++) 802d6f: b8 64 90 80 00 mov $0x809064,%eax if (devtab[i]->dev_id == dev_id) { 802d74: 39 08 cmp %ecx,(%eax) 802d76: 74 33 je 802dab <dev_lookup+0x4a> 802d78: 83 c2 04 add $0x4,%edx for (i = 0; devtab[i]; i++) 802d7b: 8b 02 mov (%edx),%eax 802d7d: 85 c0 test %eax,%eax 802d7f: 75 f3 jne 802d74 <dev_lookup+0x13> *dev = devtab[i]; return 0; } cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id); 802d81: a1 0c a0 80 00 mov 0x80a00c,%eax 802d86: 8b 40 48 mov 0x48(%eax),%eax 802d89: 83 ec 04 sub $0x4,%esp 802d8c: 51 push %ecx 802d8d: 50 push %eax 802d8e: 68 bc 42 80 00 push $0x8042bc 802d93: e8 9e ee ff ff call 801c36 <cprintf> *dev = 0; 802d98: 8b 45 0c mov 0xc(%ebp),%eax 802d9b: c7 00 00 00 00 00 movl $0x0,(%eax) return -E_INVAL; 802da1: 83 c4 10 add $0x10,%esp 802da4: b8 fd ff ff ff mov $0xfffffffd,%eax } 802da9: c9 leave 802daa: c3 ret *dev = devtab[i]; 802dab: 8b 4d 0c mov 0xc(%ebp),%ecx 802dae: 89 01 mov %eax,(%ecx) return 0; 802db0: b8 00 00 00 00 mov $0x0,%eax 802db5: eb f2 jmp 802da9 <dev_lookup+0x48> 00802db7 <fd_close>: { 802db7: 55 push %ebp 802db8: 89 e5 mov %esp,%ebp 802dba: 57 push %edi 802dbb: 56 push %esi 802dbc: 53 push %ebx 802dbd: 83 ec 1c sub $0x1c,%esp 802dc0: 8b 75 08 mov 0x8(%ebp),%esi 802dc3: 8b 7d 0c mov 0xc(%ebp),%edi if ((r = fd_lookup(fd2num(fd), &fd2)) < 0 802dc6: 8d 45 e4 lea -0x1c(%ebp),%eax 802dc9: 50 push %eax return ((uintptr_t) fd - FDTABLE) / PGSIZE; 802dca: 8d 86 00 00 00 30 lea 0x30000000(%esi),%eax 802dd0: c1 e8 0c shr $0xc,%eax if ((r = fd_lookup(fd2num(fd), &fd2)) < 0 802dd3: 50 push %eax 802dd4: e8 32 ff ff ff call 802d0b <fd_lookup> 802dd9: 89 c3 mov %eax,%ebx 802ddb: 83 c4 08 add $0x8,%esp 802dde: 85 c0 test %eax,%eax 802de0: 78 05 js 802de7 <fd_close+0x30> || fd != fd2) 802de2: 39 75 e4 cmp %esi,-0x1c(%ebp) 802de5: 74 16 je 802dfd <fd_close+0x46> return (must_exist ? r : 0); 802de7: 89 f8 mov %edi,%eax 802de9: 84 c0 test %al,%al 802deb: b8 00 00 00 00 mov $0x0,%eax 802df0: 0f 44 d8 cmove %eax,%ebx } 802df3: 89 d8 mov %ebx,%eax 802df5: 8d 65 f4 lea -0xc(%ebp),%esp 802df8: 5b pop %ebx 802df9: 5e pop %esi 802dfa: 5f pop %edi 802dfb: 5d pop %ebp 802dfc: c3 ret if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) { 802dfd: 83 ec 08 sub $0x8,%esp 802e00: 8d 45 e0 lea -0x20(%ebp),%eax 802e03: 50 push %eax 802e04: ff 36 pushl (%esi) 802e06: e8 56 ff ff ff call 802d61 <dev_lookup> 802e0b: 89 c3 mov %eax,%ebx 802e0d: 83 c4 10 add $0x10,%esp 802e10: 85 c0 test %eax,%eax 802e12: 78 15 js 802e29 <fd_close+0x72> if (dev->dev_close) 802e14: 8b 45 e0 mov -0x20(%ebp),%eax 802e17: 8b 40 10 mov 0x10(%eax),%eax 802e1a: 85 c0 test %eax,%eax 802e1c: 74 1b je 802e39 <fd_close+0x82> r = (*dev->dev_close)(fd); 802e1e: 83 ec 0c sub $0xc,%esp 802e21: 56 push %esi 802e22: ff d0 call *%eax 802e24: 89 c3 mov %eax,%ebx 802e26: 83 c4 10 add $0x10,%esp (void) sys_page_unmap(0, fd); 802e29: 83 ec 08 sub $0x8,%esp 802e2c: 56 push %esi 802e2d: 6a 00 push $0x0 802e2f: e8 9f f8 ff ff call 8026d3 <sys_page_unmap> return r; 802e34: 83 c4 10 add $0x10,%esp 802e37: eb ba jmp 802df3 <fd_close+0x3c> r = 0; 802e39: bb 00 00 00 00 mov $0x0,%ebx 802e3e: eb e9 jmp 802e29 <fd_close+0x72> 00802e40 <close>: int close(int fdnum) { 802e40: 55 push %ebp 802e41: 89 e5 mov %esp,%ebp 802e43: 83 ec 18 sub $0x18,%esp struct Fd *fd; int r; if ((r = fd_lookup(fdnum, &fd)) < 0) 802e46: 8d 45 f4 lea -0xc(%ebp),%eax 802e49: 50 push %eax 802e4a: ff 75 08 pushl 0x8(%ebp) 802e4d: e8 b9 fe ff ff call 802d0b <fd_lookup> 802e52: 83 c4 08 add $0x8,%esp 802e55: 85 c0 test %eax,%eax 802e57: 78 10 js 802e69 <close+0x29> return r; else return fd_close(fd, 1); 802e59: 83 ec 08 sub $0x8,%esp 802e5c: 6a 01 push $0x1 802e5e: ff 75 f4 pushl -0xc(%ebp) 802e61: e8 51 ff ff ff call 802db7 <fd_close> 802e66: 83 c4 10 add $0x10,%esp } 802e69: c9 leave 802e6a: c3 ret 00802e6b <close_all>: void close_all(void) { 802e6b: 55 push %ebp 802e6c: 89 e5 mov %esp,%ebp 802e6e: 53 push %ebx 802e6f: 83 ec 04 sub $0x4,%esp int i; for (i = 0; i < MAXFD; i++) 802e72: bb 00 00 00 00 mov $0x0,%ebx close(i); 802e77: 83 ec 0c sub $0xc,%esp 802e7a: 53 push %ebx 802e7b: e8 c0 ff ff ff call 802e40 <close> for (i = 0; i < MAXFD; i++) 802e80: 83 c3 01 add $0x1,%ebx 802e83: 83 c4 10 add $0x10,%esp 802e86: 83 fb 20 cmp $0x20,%ebx 802e89: 75 ec jne 802e77 <close_all+0xc> } 802e8b: 8b 5d fc mov -0x4(%ebp),%ebx 802e8e: c9 leave 802e8f: c3 ret 00802e90 <dup>: // file and the file offset of the other. // Closes any previously open file descriptor at 'newfdnum'. // This is implemented using virtual memory tricks (of course!). int dup(int oldfdnum, int newfdnum) { 802e90: 55 push %ebp 802e91: 89 e5 mov %esp,%ebp 802e93: 57 push %edi 802e94: 56 push %esi 802e95: 53 push %ebx 802e96: 83 ec 1c sub $0x1c,%esp int r; char *ova, *nva; pte_t pte; struct Fd *oldfd, *newfd; if ((r = fd_lookup(oldfdnum, &oldfd)) < 0) 802e99: 8d 45 e4 lea -0x1c(%ebp),%eax 802e9c: 50 push %eax 802e9d: ff 75 08 pushl 0x8(%ebp) 802ea0: e8 66 fe ff ff call 802d0b <fd_lookup> 802ea5: 89 c3 mov %eax,%ebx 802ea7: 83 c4 08 add $0x8,%esp 802eaa: 85 c0 test %eax,%eax 802eac: 0f 88 81 00 00 00 js 802f33 <dup+0xa3> return r; close(newfdnum); 802eb2: 83 ec 0c sub $0xc,%esp 802eb5: ff 75 0c pushl 0xc(%ebp) 802eb8: e8 83 ff ff ff call 802e40 <close> newfd = INDEX2FD(newfdnum); 802ebd: 8b 75 0c mov 0xc(%ebp),%esi 802ec0: c1 e6 0c shl $0xc,%esi 802ec3: 81 ee 00 00 00 30 sub $0x30000000,%esi ova = fd2data(oldfd); 802ec9: 83 c4 04 add $0x4,%esp 802ecc: ff 75 e4 pushl -0x1c(%ebp) 802ecf: e8 d1 fd ff ff call 802ca5 <fd2data> 802ed4: 89 c3 mov %eax,%ebx nva = fd2data(newfd); 802ed6: 89 34 24 mov %esi,(%esp) 802ed9: e8 c7 fd ff ff call 802ca5 <fd2data> 802ede: 83 c4 10 add $0x10,%esp 802ee1: 89 c7 mov %eax,%edi if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P)) 802ee3: 89 d8 mov %ebx,%eax 802ee5: c1 e8 16 shr $0x16,%eax 802ee8: 8b 04 85 00 d0 7b ef mov -0x10843000(,%eax,4),%eax 802eef: a8 01 test $0x1,%al 802ef1: 74 11 je 802f04 <dup+0x74> 802ef3: 89 d8 mov %ebx,%eax 802ef5: c1 e8 0c shr $0xc,%eax 802ef8: 8b 14 85 00 00 40 ef mov -0x10c00000(,%eax,4),%edx 802eff: f6 c2 01 test $0x1,%dl 802f02: 75 39 jne 802f3d <dup+0xad> if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0) goto err; if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0) 802f04: 8b 55 e4 mov -0x1c(%ebp),%edx 802f07: 89 d0 mov %edx,%eax 802f09: c1 e8 0c shr $0xc,%eax 802f0c: 8b 04 85 00 00 40 ef mov -0x10c00000(,%eax,4),%eax 802f13: 83 ec 0c sub $0xc,%esp 802f16: 25 07 0e 00 00 and $0xe07,%eax 802f1b: 50 push %eax 802f1c: 56 push %esi 802f1d: 6a 00 push $0x0 802f1f: 52 push %edx 802f20: 6a 00 push $0x0 802f22: e8 6a f7 ff ff call 802691 <sys_page_map> 802f27: 89 c3 mov %eax,%ebx 802f29: 83 c4 20 add $0x20,%esp 802f2c: 85 c0 test %eax,%eax 802f2e: 78 31 js 802f61 <dup+0xd1> goto err; return newfdnum; 802f30: 8b 5d 0c mov 0xc(%ebp),%ebx err: sys_page_unmap(0, newfd); sys_page_unmap(0, nva); return r; } 802f33: 89 d8 mov %ebx,%eax 802f35: 8d 65 f4 lea -0xc(%ebp),%esp 802f38: 5b pop %ebx 802f39: 5e pop %esi 802f3a: 5f pop %edi 802f3b: 5d pop %ebp 802f3c: c3 ret if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0) 802f3d: 8b 04 85 00 00 40 ef mov -0x10c00000(,%eax,4),%eax 802f44: 83 ec 0c sub $0xc,%esp 802f47: 25 07 0e 00 00 and $0xe07,%eax 802f4c: 50 push %eax 802f4d: 57 push %edi 802f4e: 6a 00 push $0x0 802f50: 53 push %ebx 802f51: 6a 00 push $0x0 802f53: e8 39 f7 ff ff call 802691 <sys_page_map> 802f58: 89 c3 mov %eax,%ebx 802f5a: 83 c4 20 add $0x20,%esp 802f5d: 85 c0 test %eax,%eax 802f5f: 79 a3 jns 802f04 <dup+0x74> sys_page_unmap(0, newfd); 802f61: 83 ec 08 sub $0x8,%esp 802f64: 56 push %esi 802f65: 6a 00 push $0x0 802f67: e8 67 f7 ff ff call 8026d3 <sys_page_unmap> sys_page_unmap(0, nva); 802f6c: 83 c4 08 add $0x8,%esp 802f6f: 57 push %edi 802f70: 6a 00 push $0x0 802f72: e8 5c f7 ff ff call 8026d3 <sys_page_unmap> return r; 802f77: 83 c4 10 add $0x10,%esp 802f7a: eb b7 jmp 802f33 <dup+0xa3> 00802f7c <read>: ssize_t read(int fdnum, void *buf, size_t n) { 802f7c: 55 push %ebp 802f7d: 89 e5 mov %esp,%ebp 802f7f: 53 push %ebx 802f80: 83 ec 14 sub $0x14,%esp 802f83: 8b 5d 08 mov 0x8(%ebp),%ebx int r; struct Dev *dev; struct Fd *fd; if ((r = fd_lookup(fdnum, &fd)) < 0 802f86: 8d 45 f0 lea -0x10(%ebp),%eax 802f89: 50 push %eax 802f8a: 53 push %ebx 802f8b: e8 7b fd ff ff call 802d0b <fd_lookup> 802f90: 83 c4 08 add $0x8,%esp 802f93: 85 c0 test %eax,%eax 802f95: 78 3f js 802fd6 <read+0x5a> || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0) 802f97: 83 ec 08 sub $0x8,%esp 802f9a: 8d 45 f4 lea -0xc(%ebp),%eax 802f9d: 50 push %eax 802f9e: 8b 45 f0 mov -0x10(%ebp),%eax 802fa1: ff 30 pushl (%eax) 802fa3: e8 b9 fd ff ff call 802d61 <dev_lookup> 802fa8: 83 c4 10 add $0x10,%esp 802fab: 85 c0 test %eax,%eax 802fad: 78 27 js 802fd6 <read+0x5a> return r; if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) { 802faf: 8b 55 f0 mov -0x10(%ebp),%edx 802fb2: 8b 42 08 mov 0x8(%edx),%eax 802fb5: 83 e0 03 and $0x3,%eax 802fb8: 83 f8 01 cmp $0x1,%eax 802fbb: 74 1e je 802fdb <read+0x5f> cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum); return -E_INVAL; } if (!dev->dev_read) 802fbd: 8b 45 f4 mov -0xc(%ebp),%eax 802fc0: 8b 40 08 mov 0x8(%eax),%eax 802fc3: 85 c0 test %eax,%eax 802fc5: 74 35 je 802ffc <read+0x80> return -E_NOT_SUPP; return (*dev->dev_read)(fd, buf, n); 802fc7: 83 ec 04 sub $0x4,%esp 802fca: ff 75 10 pushl 0x10(%ebp) 802fcd: ff 75 0c pushl 0xc(%ebp) 802fd0: 52 push %edx 802fd1: ff d0 call *%eax 802fd3: 83 c4 10 add $0x10,%esp } 802fd6: 8b 5d fc mov -0x4(%ebp),%ebx 802fd9: c9 leave 802fda: c3 ret cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum); 802fdb: a1 0c a0 80 00 mov 0x80a00c,%eax 802fe0: 8b 40 48 mov 0x48(%eax),%eax 802fe3: 83 ec 04 sub $0x4,%esp 802fe6: 53 push %ebx 802fe7: 50 push %eax 802fe8: 68 00 43 80 00 push $0x804300 802fed: e8 44 ec ff ff call 801c36 <cprintf> return -E_INVAL; 802ff2: 83 c4 10 add $0x10,%esp 802ff5: b8 fd ff ff ff mov $0xfffffffd,%eax 802ffa: eb da jmp 802fd6 <read+0x5a> return -E_NOT_SUPP; 802ffc: b8 f1 ff ff ff mov $0xfffffff1,%eax 803001: eb d3 jmp 802fd6 <read+0x5a> 00803003 <readn>: ssize_t readn(int fdnum, void *buf, size_t n) { 803003: 55 push %ebp 803004: 89 e5 mov %esp,%ebp 803006: 57 push %edi 803007: 56 push %esi 803008: 53 push %ebx 803009: 83 ec 0c sub $0xc,%esp 80300c: 8b 7d 08 mov 0x8(%ebp),%edi 80300f: 8b 75 10 mov 0x10(%ebp),%esi int m, tot; for (tot = 0; tot < n; tot += m) { 803012: bb 00 00 00 00 mov $0x0,%ebx 803017: 39 f3 cmp %esi,%ebx 803019: 73 25 jae 803040 <readn+0x3d> m = read(fdnum, (char*)buf + tot, n - tot); 80301b: 83 ec 04 sub $0x4,%esp 80301e: 89 f0 mov %esi,%eax 803020: 29 d8 sub %ebx,%eax 803022: 50 push %eax 803023: 89 d8 mov %ebx,%eax 803025: 03 45 0c add 0xc(%ebp),%eax 803028: 50 push %eax 803029: 57 push %edi 80302a: e8 4d ff ff ff call 802f7c <read> if (m < 0) 80302f: 83 c4 10 add $0x10,%esp 803032: 85 c0 test %eax,%eax 803034: 78 08 js 80303e <readn+0x3b> return m; if (m == 0) 803036: 85 c0 test %eax,%eax 803038: 74 06 je 803040 <readn+0x3d> for (tot = 0; tot < n; tot += m) { 80303a: 01 c3 add %eax,%ebx 80303c: eb d9 jmp 803017 <readn+0x14> m = read(fdnum, (char*)buf + tot, n - tot); 80303e: 89 c3 mov %eax,%ebx break; } return tot; } 803040: 89 d8 mov %ebx,%eax 803042: 8d 65 f4 lea -0xc(%ebp),%esp 803045: 5b pop %ebx 803046: 5e pop %esi 803047: 5f pop %edi 803048: 5d pop %ebp 803049: c3 ret 0080304a <write>: ssize_t write(int fdnum, const void *buf, size_t n) { 80304a: 55 push %ebp 80304b: 89 e5 mov %esp,%ebp 80304d: 53 push %ebx 80304e: 83 ec 14 sub $0x14,%esp 803051: 8b 5d 08 mov 0x8(%ebp),%ebx int r; struct Dev *dev; struct Fd *fd; if ((r = fd_lookup(fdnum, &fd)) < 0 803054: 8d 45 f0 lea -0x10(%ebp),%eax 803057: 50 push %eax 803058: 53 push %ebx 803059: e8 ad fc ff ff call 802d0b <fd_lookup> 80305e: 83 c4 08 add $0x8,%esp 803061: 85 c0 test %eax,%eax 803063: 78 3a js 80309f <write+0x55> || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0) 803065: 83 ec 08 sub $0x8,%esp 803068: 8d 45 f4 lea -0xc(%ebp),%eax 80306b: 50 push %eax 80306c: 8b 45 f0 mov -0x10(%ebp),%eax 80306f: ff 30 pushl (%eax) 803071: e8 eb fc ff ff call 802d61 <dev_lookup> 803076: 83 c4 10 add $0x10,%esp 803079: 85 c0 test %eax,%eax 80307b: 78 22 js 80309f <write+0x55> return r; if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) { 80307d: 8b 45 f0 mov -0x10(%ebp),%eax 803080: f6 40 08 03 testb $0x3,0x8(%eax) 803084: 74 1e je 8030a4 <write+0x5a> return -E_INVAL; } if (debug) cprintf("write %d %p %d via dev %s\n", fdnum, buf, n, dev->dev_name); if (!dev->dev_write) 803086: 8b 55 f4 mov -0xc(%ebp),%edx 803089: 8b 52 0c mov 0xc(%edx),%edx 80308c: 85 d2 test %edx,%edx 80308e: 74 35 je 8030c5 <write+0x7b> return -E_NOT_SUPP; return (*dev->dev_write)(fd, buf, n); 803090: 83 ec 04 sub $0x4,%esp 803093: ff 75 10 pushl 0x10(%ebp) 803096: ff 75 0c pushl 0xc(%ebp) 803099: 50 push %eax 80309a: ff d2 call *%edx 80309c: 83 c4 10 add $0x10,%esp } 80309f: 8b 5d fc mov -0x4(%ebp),%ebx 8030a2: c9 leave 8030a3: c3 ret cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum); 8030a4: a1 0c a0 80 00 mov 0x80a00c,%eax 8030a9: 8b 40 48 mov 0x48(%eax),%eax 8030ac: 83 ec 04 sub $0x4,%esp 8030af: 53 push %ebx 8030b0: 50 push %eax 8030b1: 68 1c 43 80 00 push $0x80431c 8030b6: e8 7b eb ff ff call 801c36 <cprintf> return -E_INVAL; 8030bb: 83 c4 10 add $0x10,%esp 8030be: b8 fd ff ff ff mov $0xfffffffd,%eax 8030c3: eb da jmp 80309f <write+0x55> return -E_NOT_SUPP; 8030c5: b8 f1 ff ff ff mov $0xfffffff1,%eax 8030ca: eb d3 jmp 80309f <write+0x55> 008030cc <seek>: int seek(int fdnum, off_t offset) { 8030cc: 55 push %ebp 8030cd: 89 e5 mov %esp,%ebp 8030cf: 83 ec 10 sub $0x10,%esp int r; struct Fd *fd; if ((r = fd_lookup(fdnum, &fd)) < 0) 8030d2: 8d 45 fc lea -0x4(%ebp),%eax 8030d5: 50 push %eax 8030d6: ff 75 08 pushl 0x8(%ebp) 8030d9: e8 2d fc ff ff call 802d0b <fd_lookup> 8030de: 83 c4 08 add $0x8,%esp 8030e1: 85 c0 test %eax,%eax 8030e3: 78 0e js 8030f3 <seek+0x27> return r; fd->fd_offset = offset; 8030e5: 8b 55 0c mov 0xc(%ebp),%edx 8030e8: 8b 45 fc mov -0x4(%ebp),%eax 8030eb: 89 50 04 mov %edx,0x4(%eax) return 0; 8030ee: b8 00 00 00 00 mov $0x0,%eax } 8030f3: c9 leave 8030f4: c3 ret 008030f5 <ftruncate>: int ftruncate(int fdnum, off_t newsize) { 8030f5: 55 push %ebp 8030f6: 89 e5 mov %esp,%ebp 8030f8: 53 push %ebx 8030f9: 83 ec 14 sub $0x14,%esp 8030fc: 8b 5d 08 mov 0x8(%ebp),%ebx int r; struct Dev *dev; struct Fd *fd; if ((r = fd_lookup(fdnum, &fd)) < 0 8030ff: 8d 45 f0 lea -0x10(%ebp),%eax 803102: 50 push %eax 803103: 53 push %ebx 803104: e8 02 fc ff ff call 802d0b <fd_lookup> 803109: 83 c4 08 add $0x8,%esp 80310c: 85 c0 test %eax,%eax 80310e: 78 37 js 803147 <ftruncate+0x52> || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0) 803110: 83 ec 08 sub $0x8,%esp 803113: 8d 45 f4 lea -0xc(%ebp),%eax 803116: 50 push %eax 803117: 8b 45 f0 mov -0x10(%ebp),%eax 80311a: ff 30 pushl (%eax) 80311c: e8 40 fc ff ff call 802d61 <dev_lookup> 803121: 83 c4 10 add $0x10,%esp 803124: 85 c0 test %eax,%eax 803126: 78 1f js 803147 <ftruncate+0x52> return r; if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) { 803128: 8b 45 f0 mov -0x10(%ebp),%eax 80312b: f6 40 08 03 testb $0x3,0x8(%eax) 80312f: 74 1b je 80314c <ftruncate+0x57> cprintf("[%08x] ftruncate %d -- bad mode\n", thisenv->env_id, fdnum); return -E_INVAL; } if (!dev->dev_trunc) 803131: 8b 55 f4 mov -0xc(%ebp),%edx 803134: 8b 52 18 mov 0x18(%edx),%edx 803137: 85 d2 test %edx,%edx 803139: 74 32 je 80316d <ftruncate+0x78> return -E_NOT_SUPP; return (*dev->dev_trunc)(fd, newsize); 80313b: 83 ec 08 sub $0x8,%esp 80313e: ff 75 0c pushl 0xc(%ebp) 803141: 50 push %eax 803142: ff d2 call *%edx 803144: 83 c4 10 add $0x10,%esp } 803147: 8b 5d fc mov -0x4(%ebp),%ebx 80314a: c9 leave 80314b: c3 ret thisenv->env_id, fdnum); 80314c: a1 0c a0 80 00 mov 0x80a00c,%eax cprintf("[%08x] ftruncate %d -- bad mode\n", 803151: 8b 40 48 mov 0x48(%eax),%eax 803154: 83 ec 04 sub $0x4,%esp 803157: 53 push %ebx 803158: 50 push %eax 803159: 68 dc 42 80 00 push $0x8042dc 80315e: e8 d3 ea ff ff call 801c36 <cprintf> return -E_INVAL; 803163: 83 c4 10 add $0x10,%esp 803166: b8 fd ff ff ff mov $0xfffffffd,%eax 80316b: eb da jmp 803147 <ftruncate+0x52> return -E_NOT_SUPP; 80316d: b8 f1 ff ff ff mov $0xfffffff1,%eax 803172: eb d3 jmp 803147 <ftruncate+0x52> 00803174 <fstat>: int fstat(int fdnum, struct Stat *stat) { 803174: 55 push %ebp 803175: 89 e5 mov %esp,%ebp 803177: 53 push %ebx 803178: 83 ec 14 sub $0x14,%esp 80317b: 8b 5d 0c mov 0xc(%ebp),%ebx int r; struct Dev *dev; struct Fd *fd; if ((r = fd_lookup(fdnum, &fd)) < 0 80317e: 8d 45 f0 lea -0x10(%ebp),%eax 803181: 50 push %eax 803182: ff 75 08 pushl 0x8(%ebp) 803185: e8 81 fb ff ff call 802d0b <fd_lookup> 80318a: 83 c4 08 add $0x8,%esp 80318d: 85 c0 test %eax,%eax 80318f: 78 4b js 8031dc <fstat+0x68> || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0) 803191: 83 ec 08 sub $0x8,%esp 803194: 8d 45 f4 lea -0xc(%ebp),%eax 803197: 50 push %eax 803198: 8b 45 f0 mov -0x10(%ebp),%eax 80319b: ff 30 pushl (%eax) 80319d: e8 bf fb ff ff call 802d61 <dev_lookup> 8031a2: 83 c4 10 add $0x10,%esp 8031a5: 85 c0 test %eax,%eax 8031a7: 78 33 js 8031dc <fstat+0x68> return r; if (!dev->dev_stat) 8031a9: 8b 45 f4 mov -0xc(%ebp),%eax 8031ac: 83 78 14 00 cmpl $0x0,0x14(%eax) 8031b0: 74 2f je 8031e1 <fstat+0x6d> return -E_NOT_SUPP; stat->st_name[0] = 0; 8031b2: c6 03 00 movb $0x0,(%ebx) stat->st_size = 0; 8031b5: c7 83 80 00 00 00 00 movl $0x0,0x80(%ebx) 8031bc: 00 00 00 stat->st_isdir = 0; 8031bf: c7 83 84 00 00 00 00 movl $0x0,0x84(%ebx) 8031c6: 00 00 00 stat->st_dev = dev; 8031c9: 89 83 88 00 00 00 mov %eax,0x88(%ebx) return (*dev->dev_stat)(fd, stat); 8031cf: 83 ec 08 sub $0x8,%esp 8031d2: 53 push %ebx 8031d3: ff 75 f0 pushl -0x10(%ebp) 8031d6: ff 50 14 call *0x14(%eax) 8031d9: 83 c4 10 add $0x10,%esp } 8031dc: 8b 5d fc mov -0x4(%ebp),%ebx 8031df: c9 leave 8031e0: c3 ret return -E_NOT_SUPP; 8031e1: b8 f1 ff ff ff mov $0xfffffff1,%eax 8031e6: eb f4 jmp 8031dc <fstat+0x68> 008031e8 <stat>: int stat(const char *path, struct Stat *stat) { 8031e8: 55 push %ebp 8031e9: 89 e5 mov %esp,%ebp 8031eb: 56 push %esi 8031ec: 53 push %ebx int fd, r; if ((fd = open(path, O_RDONLY)) < 0) 8031ed: 83 ec 08 sub $0x8,%esp 8031f0: 6a 00 push $0x0 8031f2: ff 75 08 pushl 0x8(%ebp) 8031f5: e8 bb f9 ff ff call 802bb5 <open> 8031fa: 89 c3 mov %eax,%ebx 8031fc: 83 c4 10 add $0x10,%esp 8031ff: 85 c0 test %eax,%eax 803201: 78 1b js 80321e <stat+0x36> return fd; r = fstat(fd, stat); 803203: 83 ec 08 sub $0x8,%esp 803206: ff 75 0c pushl 0xc(%ebp) 803209: 50 push %eax 80320a: e8 65 ff ff ff call 803174 <fstat> 80320f: 89 c6 mov %eax,%esi close(fd); 803211: 89 1c 24 mov %ebx,(%esp) 803214: e8 27 fc ff ff call 802e40 <close> return r; 803219: 83 c4 10 add $0x10,%esp 80321c: 89 f3 mov %esi,%ebx } 80321e: 89 d8 mov %ebx,%eax 803220: 8d 65 f8 lea -0x8(%ebp),%esp 803223: 5b pop %ebx 803224: 5e pop %esi 803225: 5d pop %ebp 803226: c3 ret 00803227 <devpipe_stat>: return i; } static int devpipe_stat(struct Fd *fd, struct Stat *stat) { 803227: 55 push %ebp 803228: 89 e5 mov %esp,%ebp 80322a: 56 push %esi 80322b: 53 push %ebx 80322c: 8b 5d 0c mov 0xc(%ebp),%ebx struct Pipe *p = (struct Pipe*) fd2data(fd); 80322f: 83 ec 0c sub $0xc,%esp 803232: ff 75 08 pushl 0x8(%ebp) 803235: e8 6b fa ff ff call 802ca5 <fd2data> 80323a: 89 c6 mov %eax,%esi strcpy(stat->st_name, "<pipe>"); 80323c: 83 c4 08 add $0x8,%esp 80323f: 68 4c 43 80 00 push $0x80434c 803244: 53 push %ebx 803245: e8 0b f0 ff ff call 802255 <strcpy> stat->st_size = p->p_wpos - p->p_rpos; 80324a: 8b 46 04 mov 0x4(%esi),%eax 80324d: 2b 06 sub (%esi),%eax 80324f: 89 83 80 00 00 00 mov %eax,0x80(%ebx) stat->st_isdir = 0; 803255: c7 83 84 00 00 00 00 movl $0x0,0x84(%ebx) 80325c: 00 00 00 stat->st_dev = &devpipe; 80325f: c7 83 88 00 00 00 80 movl $0x809080,0x88(%ebx) 803266: 90 80 00 return 0; } 803269: b8 00 00 00 00 mov $0x0,%eax 80326e: 8d 65 f8 lea -0x8(%ebp),%esp 803271: 5b pop %ebx 803272: 5e pop %esi 803273: 5d pop %ebp 803274: c3 ret 00803275 <devpipe_close>: static int devpipe_close(struct Fd *fd) { 803275: 55 push %ebp 803276: 89 e5 mov %esp,%ebp 803278: 53 push %ebx 803279: 83 ec 0c sub $0xc,%esp 80327c: 8b 5d 08 mov 0x8(%ebp),%ebx (void) sys_page_unmap(0, fd); 80327f: 53 push %ebx 803280: 6a 00 push $0x0 803282: e8 4c f4 ff ff call 8026d3 <sys_page_unmap> return sys_page_unmap(0, fd2data(fd)); 803287: 89 1c 24 mov %ebx,(%esp) 80328a: e8 16 fa ff ff call 802ca5 <fd2data> 80328f: 83 c4 08 add $0x8,%esp 803292: 50 push %eax 803293: 6a 00 push $0x0 803295: e8 39 f4 ff ff call 8026d3 <sys_page_unmap> } 80329a: 8b 5d fc mov -0x4(%ebp),%ebx 80329d: c9 leave 80329e: c3 ret 0080329f <_pipeisclosed>: { 80329f: 55 push %ebp 8032a0: 89 e5 mov %esp,%ebp 8032a2: 57 push %edi 8032a3: 56 push %esi 8032a4: 53 push %ebx 8032a5: 83 ec 1c sub $0x1c,%esp 8032a8: 89 c7 mov %eax,%edi 8032aa: 89 d6 mov %edx,%esi n = thisenv->env_runs; 8032ac: a1 0c a0 80 00 mov 0x80a00c,%eax 8032b1: 8b 58 58 mov 0x58(%eax),%ebx ret = pageref(fd) == pageref(p); 8032b4: 83 ec 0c sub $0xc,%esp 8032b7: 57 push %edi 8032b8: e8 9d f9 ff ff call 802c5a <pageref> 8032bd: 89 45 e4 mov %eax,-0x1c(%ebp) 8032c0: 89 34 24 mov %esi,(%esp) 8032c3: e8 92 f9 ff ff call 802c5a <pageref> nn = thisenv->env_runs; 8032c8: 8b 15 0c a0 80 00 mov 0x80a00c,%edx 8032ce: 8b 4a 58 mov 0x58(%edx),%ecx if (n == nn) 8032d1: 83 c4 10 add $0x10,%esp 8032d4: 39 cb cmp %ecx,%ebx 8032d6: 74 1b je 8032f3 <_pipeisclosed+0x54> if (n != nn && ret == 1) 8032d8: 39 45 e4 cmp %eax,-0x1c(%ebp) 8032db: 75 cf jne 8032ac <_pipeisclosed+0xd> cprintf("pipe race avoided\n", n, thisenv->env_runs, ret); 8032dd: 8b 42 58 mov 0x58(%edx),%eax 8032e0: 6a 01 push $0x1 8032e2: 50 push %eax 8032e3: 53 push %ebx 8032e4: 68 53 43 80 00 push $0x804353 8032e9: e8 48 e9 ff ff call 801c36 <cprintf> 8032ee: 83 c4 10 add $0x10,%esp 8032f1: eb b9 jmp 8032ac <_pipeisclosed+0xd> ret = pageref(fd) == pageref(p); 8032f3: 39 45 e4 cmp %eax,-0x1c(%ebp) 8032f6: 0f 94 c0 sete %al 8032f9: 0f b6 c0 movzbl %al,%eax } 8032fc: 8d 65 f4 lea -0xc(%ebp),%esp 8032ff: 5b pop %ebx 803300: 5e pop %esi 803301: 5f pop %edi 803302: 5d pop %ebp 803303: c3 ret 00803304 <devpipe_write>: { 803304: 55 push %ebp 803305: 89 e5 mov %esp,%ebp 803307: 57 push %edi 803308: 56 push %esi 803309: 53 push %ebx 80330a: 83 ec 28 sub $0x28,%esp 80330d: 8b 75 08 mov 0x8(%ebp),%esi p = (struct Pipe*) fd2data(fd); 803310: 56 push %esi 803311: e8 8f f9 ff ff call 802ca5 <fd2data> 803316: 89 c3 mov %eax,%ebx for (i = 0; i < n; i++) { 803318: 83 c4 10 add $0x10,%esp 80331b: bf 00 00 00 00 mov $0x0,%edi 803320: 3b 7d 10 cmp 0x10(%ebp),%edi 803323: 74 4f je 803374 <devpipe_write+0x70> while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) { 803325: 8b 43 04 mov 0x4(%ebx),%eax 803328: 8b 0b mov (%ebx),%ecx 80332a: 8d 51 20 lea 0x20(%ecx),%edx 80332d: 39 d0 cmp %edx,%eax 80332f: 72 14 jb 803345 <devpipe_write+0x41> if (_pipeisclosed(fd, p)) 803331: 89 da mov %ebx,%edx 803333: 89 f0 mov %esi,%eax 803335: e8 65 ff ff ff call 80329f <_pipeisclosed> 80333a: 85 c0 test %eax,%eax 80333c: 75 3a jne 803378 <devpipe_write+0x74> sys_yield(); 80333e: e8 ec f2 ff ff call 80262f <sys_yield> 803343: eb e0 jmp 803325 <devpipe_write+0x21> p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i]; 803345: 8b 4d 0c mov 0xc(%ebp),%ecx 803348: 0f b6 0c 39 movzbl (%ecx,%edi,1),%ecx 80334c: 88 4d e7 mov %cl,-0x19(%ebp) 80334f: 89 c2 mov %eax,%edx 803351: c1 fa 1f sar $0x1f,%edx 803354: 89 d1 mov %edx,%ecx 803356: c1 e9 1b shr $0x1b,%ecx 803359: 8d 14 08 lea (%eax,%ecx,1),%edx 80335c: 83 e2 1f and $0x1f,%edx 80335f: 29 ca sub %ecx,%edx 803361: 0f b6 4d e7 movzbl -0x19(%ebp),%ecx 803365: 88 4c 13 08 mov %cl,0x8(%ebx,%edx,1) p->p_wpos++; 803369: 83 c0 01 add $0x1,%eax 80336c: 89 43 04 mov %eax,0x4(%ebx) for (i = 0; i < n; i++) { 80336f: 83 c7 01 add $0x1,%edi 803372: eb ac jmp 803320 <devpipe_write+0x1c> return i; 803374: 89 f8 mov %edi,%eax 803376: eb 05 jmp 80337d <devpipe_write+0x79> return 0; 803378: b8 00 00 00 00 mov $0x0,%eax } 80337d: 8d 65 f4 lea -0xc(%ebp),%esp 803380: 5b pop %ebx 803381: 5e pop %esi 803382: 5f pop %edi 803383: 5d pop %ebp 803384: c3 ret 00803385 <devpipe_read>: { 803385: 55 push %ebp 803386: 89 e5 mov %esp,%ebp 803388: 57 push %edi 803389: 56 push %esi 80338a: 53 push %ebx 80338b: 83 ec 18 sub $0x18,%esp 80338e: 8b 7d 08 mov 0x8(%ebp),%edi p = (struct Pipe*)fd2data(fd); 803391: 57 push %edi 803392: e8 0e f9 ff ff call 802ca5 <fd2data> 803397: 89 c3 mov %eax,%ebx for (i = 0; i < n; i++) { 803399: 83 c4 10 add $0x10,%esp 80339c: be 00 00 00 00 mov $0x0,%esi 8033a1: 3b 75 10 cmp 0x10(%ebp),%esi 8033a4: 74 47 je 8033ed <devpipe_read+0x68> while (p->p_rpos == p->p_wpos) { 8033a6: 8b 03 mov (%ebx),%eax 8033a8: 3b 43 04 cmp 0x4(%ebx),%eax 8033ab: 75 22 jne 8033cf <devpipe_read+0x4a> if (i > 0) 8033ad: 85 f6 test %esi,%esi 8033af: 75 14 jne 8033c5 <devpipe_read+0x40> if (_pipeisclosed(fd, p)) 8033b1: 89 da mov %ebx,%edx 8033b3: 89 f8 mov %edi,%eax 8033b5: e8 e5 fe ff ff call 80329f <_pipeisclosed> 8033ba: 85 c0 test %eax,%eax 8033bc: 75 33 jne 8033f1 <devpipe_read+0x6c> sys_yield(); 8033be: e8 6c f2 ff ff call 80262f <sys_yield> 8033c3: eb e1 jmp 8033a6 <devpipe_read+0x21> return i; 8033c5: 89 f0 mov %esi,%eax } 8033c7: 8d 65 f4 lea -0xc(%ebp),%esp 8033ca: 5b pop %ebx 8033cb: 5e pop %esi 8033cc: 5f pop %edi 8033cd: 5d pop %ebp 8033ce: c3 ret buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ]; 8033cf: 99 cltd 8033d0: c1 ea 1b shr $0x1b,%edx 8033d3: 01 d0 add %edx,%eax 8033d5: 83 e0 1f and $0x1f,%eax 8033d8: 29 d0 sub %edx,%eax 8033da: 0f b6 44 03 08 movzbl 0x8(%ebx,%eax,1),%eax 8033df: 8b 4d 0c mov 0xc(%ebp),%ecx 8033e2: 88 04 31 mov %al,(%ecx,%esi,1) p->p_rpos++; 8033e5: 83 03 01 addl $0x1,(%ebx) for (i = 0; i < n; i++) { 8033e8: 83 c6 01 add $0x1,%esi 8033eb: eb b4 jmp 8033a1 <devpipe_read+0x1c> return i; 8033ed: 89 f0 mov %esi,%eax 8033ef: eb d6 jmp 8033c7 <devpipe_read+0x42> return 0; 8033f1: b8 00 00 00 00 mov $0x0,%eax 8033f6: eb cf jmp 8033c7 <devpipe_read+0x42> 008033f8 <pipe>: { 8033f8: 55 push %ebp 8033f9: 89 e5 mov %esp,%ebp 8033fb: 56 push %esi 8033fc: 53 push %ebx 8033fd: 83 ec 1c sub $0x1c,%esp if ((r = fd_alloc(&fd0)) < 0 803400: 8d 45 f4 lea -0xc(%ebp),%eax 803403: 50 push %eax 803404: e8 b3 f8 ff ff call 802cbc <fd_alloc> 803409: 89 c3 mov %eax,%ebx 80340b: 83 c4 10 add $0x10,%esp 80340e: 85 c0 test %eax,%eax 803410: 78 5b js 80346d <pipe+0x75> || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0) 803412: 83 ec 04 sub $0x4,%esp 803415: 68 07 04 00 00 push $0x407 80341a: ff 75 f4 pushl -0xc(%ebp) 80341d: 6a 00 push $0x0 80341f: e8 2a f2 ff ff call 80264e <sys_page_alloc> 803424: 89 c3 mov %eax,%ebx 803426: 83 c4 10 add $0x10,%esp 803429: 85 c0 test %eax,%eax 80342b: 78 40 js 80346d <pipe+0x75> if ((r = fd_alloc(&fd1)) < 0 80342d: 83 ec 0c sub $0xc,%esp 803430: 8d 45 f0 lea -0x10(%ebp),%eax 803433: 50 push %eax 803434: e8 83 f8 ff ff call 802cbc <fd_alloc> 803439: 89 c3 mov %eax,%ebx 80343b: 83 c4 10 add $0x10,%esp 80343e: 85 c0 test %eax,%eax 803440: 78 1b js 80345d <pipe+0x65> || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0) 803442: 83 ec 04 sub $0x4,%esp 803445: 68 07 04 00 00 push $0x407 80344a: ff 75 f0 pushl -0x10(%ebp) 80344d: 6a 00 push $0x0 80344f: e8 fa f1 ff ff call 80264e <sys_page_alloc> 803454: 89 c3 mov %eax,%ebx 803456: 83 c4 10 add $0x10,%esp 803459: 85 c0 test %eax,%eax 80345b: 79 19 jns 803476 <pipe+0x7e> sys_page_unmap(0, fd0); 80345d: 83 ec 08 sub $0x8,%esp 803460: ff 75 f4 pushl -0xc(%ebp) 803463: 6a 00 push $0x0 803465: e8 69 f2 ff ff call 8026d3 <sys_page_unmap> 80346a: 83 c4 10 add $0x10,%esp } 80346d: 89 d8 mov %ebx,%eax 80346f: 8d 65 f8 lea -0x8(%ebp),%esp 803472: 5b pop %ebx 803473: 5e pop %esi 803474: 5d pop %ebp 803475: c3 ret va = fd2data(fd0); 803476: 83 ec 0c sub $0xc,%esp 803479: ff 75 f4 pushl -0xc(%ebp) 80347c: e8 24 f8 ff ff call 802ca5 <fd2data> 803481: 89 c6 mov %eax,%esi if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0) 803483: 83 c4 0c add $0xc,%esp 803486: 68 07 04 00 00 push $0x407 80348b: 50 push %eax 80348c: 6a 00 push $0x0 80348e: e8 bb f1 ff ff call 80264e <sys_page_alloc> 803493: 89 c3 mov %eax,%ebx 803495: 83 c4 10 add $0x10,%esp 803498: 85 c0 test %eax,%eax 80349a: 0f 88 8c 00 00 00 js 80352c <pipe+0x134> if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0) 8034a0: 83 ec 0c sub $0xc,%esp 8034a3: ff 75 f0 pushl -0x10(%ebp) 8034a6: e8 fa f7 ff ff call 802ca5 <fd2data> 8034ab: c7 04 24 07 04 00 00 movl $0x407,(%esp) 8034b2: 50 push %eax 8034b3: 6a 00 push $0x0 8034b5: 56 push %esi 8034b6: 6a 00 push $0x0 8034b8: e8 d4 f1 ff ff call 802691 <sys_page_map> 8034bd: 89 c3 mov %eax,%ebx 8034bf: 83 c4 20 add $0x20,%esp 8034c2: 85 c0 test %eax,%eax 8034c4: 78 58 js 80351e <pipe+0x126> fd0->fd_dev_id = devpipe.dev_id; 8034c6: 8b 45 f4 mov -0xc(%ebp),%eax 8034c9: 8b 15 80 90 80 00 mov 0x809080,%edx 8034cf: 89 10 mov %edx,(%eax) fd0->fd_omode = O_RDONLY; 8034d1: 8b 45 f4 mov -0xc(%ebp),%eax 8034d4: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) fd1->fd_dev_id = devpipe.dev_id; 8034db: 8b 45 f0 mov -0x10(%ebp),%eax 8034de: 8b 15 80 90 80 00 mov 0x809080,%edx 8034e4: 89 10 mov %edx,(%eax) fd1->fd_omode = O_WRONLY; 8034e6: 8b 45 f0 mov -0x10(%ebp),%eax 8034e9: c7 40 08 01 00 00 00 movl $0x1,0x8(%eax) pfd[0] = fd2num(fd0); 8034f0: 83 ec 0c sub $0xc,%esp 8034f3: ff 75 f4 pushl -0xc(%ebp) 8034f6: e8 9a f7 ff ff call 802c95 <fd2num> 8034fb: 8b 4d 08 mov 0x8(%ebp),%ecx 8034fe: 89 01 mov %eax,(%ecx) pfd[1] = fd2num(fd1); 803500: 83 c4 04 add $0x4,%esp 803503: ff 75 f0 pushl -0x10(%ebp) 803506: e8 8a f7 ff ff call 802c95 <fd2num> 80350b: 8b 4d 08 mov 0x8(%ebp),%ecx 80350e: 89 41 04 mov %eax,0x4(%ecx) return 0; 803511: 83 c4 10 add $0x10,%esp 803514: bb 00 00 00 00 mov $0x0,%ebx 803519: e9 4f ff ff ff jmp 80346d <pipe+0x75> sys_page_unmap(0, va); 80351e: 83 ec 08 sub $0x8,%esp 803521: 56 push %esi 803522: 6a 00 push $0x0 803524: e8 aa f1 ff ff call 8026d3 <sys_page_unmap> 803529: 83 c4 10 add $0x10,%esp sys_page_unmap(0, fd1); 80352c: 83 ec 08 sub $0x8,%esp 80352f: ff 75 f0 pushl -0x10(%ebp) 803532: 6a 00 push $0x0 803534: e8 9a f1 ff ff call 8026d3 <sys_page_unmap> 803539: 83 c4 10 add $0x10,%esp 80353c: e9 1c ff ff ff jmp 80345d <pipe+0x65> 00803541 <pipeisclosed>: { 803541: 55 push %ebp 803542: 89 e5 mov %esp,%ebp 803544: 83 ec 20 sub $0x20,%esp if ((r = fd_lookup(fdnum, &fd)) < 0) 803547: 8d 45 f4 lea -0xc(%ebp),%eax 80354a: 50 push %eax 80354b: ff 75 08 pushl 0x8(%ebp) 80354e: e8 b8 f7 ff ff call 802d0b <fd_lookup> 803553: 83 c4 10 add $0x10,%esp 803556: 85 c0 test %eax,%eax 803558: 78 18 js 803572 <pipeisclosed+0x31> p = (struct Pipe*) fd2data(fd); 80355a: 83 ec 0c sub $0xc,%esp 80355d: ff 75 f4 pushl -0xc(%ebp) 803560: e8 40 f7 ff ff call 802ca5 <fd2data> return _pipeisclosed(fd, p); 803565: 89 c2 mov %eax,%edx 803567: 8b 45 f4 mov -0xc(%ebp),%eax 80356a: e8 30 fd ff ff call 80329f <_pipeisclosed> 80356f: 83 c4 10 add $0x10,%esp } 803572: c9 leave 803573: c3 ret 00803574 <devcons_close>: return tot; } static int devcons_close(struct Fd *fd) { 803574: 55 push %ebp 803575: 89 e5 mov %esp,%ebp USED(fd); return 0; } 803577: b8 00 00 00 00 mov $0x0,%eax 80357c: 5d pop %ebp 80357d: c3 ret 0080357e <devcons_stat>: static int devcons_stat(struct Fd *fd, struct Stat *stat) { 80357e: 55 push %ebp 80357f: 89 e5 mov %esp,%ebp 803581: 83 ec 10 sub $0x10,%esp strcpy(stat->st_name, "<cons>"); 803584: 68 6b 43 80 00 push $0x80436b 803589: ff 75 0c pushl 0xc(%ebp) 80358c: e8 c4 ec ff ff call 802255 <strcpy> return 0; } 803591: b8 00 00 00 00 mov $0x0,%eax 803596: c9 leave 803597: c3 ret 00803598 <devcons_write>: { 803598: 55 push %ebp 803599: 89 e5 mov %esp,%ebp 80359b: 57 push %edi 80359c: 56 push %esi 80359d: 53 push %ebx 80359e: 81 ec 8c 00 00 00 sub $0x8c,%esp for (tot = 0; tot < n; tot += m) { 8035a4: be 00 00 00 00 mov $0x0,%esi memmove(buf, (char*)vbuf + tot, m); 8035a9: 8d bd 68 ff ff ff lea -0x98(%ebp),%edi for (tot = 0; tot < n; tot += m) { 8035af: eb 2f jmp 8035e0 <devcons_write+0x48> m = n - tot; 8035b1: 8b 5d 10 mov 0x10(%ebp),%ebx 8035b4: 29 f3 sub %esi,%ebx 8035b6: 83 fb 7f cmp $0x7f,%ebx 8035b9: b8 7f 00 00 00 mov $0x7f,%eax 8035be: 0f 47 d8 cmova %eax,%ebx memmove(buf, (char*)vbuf + tot, m); 8035c1: 83 ec 04 sub $0x4,%esp 8035c4: 53 push %ebx 8035c5: 89 f0 mov %esi,%eax 8035c7: 03 45 0c add 0xc(%ebp),%eax 8035ca: 50 push %eax 8035cb: 57 push %edi 8035cc: e8 12 ee ff ff call 8023e3 <memmove> sys_cputs(buf, m); 8035d1: 83 c4 08 add $0x8,%esp 8035d4: 53 push %ebx 8035d5: 57 push %edi 8035d6: e8 b7 ef ff ff call 802592 <sys_cputs> for (tot = 0; tot < n; tot += m) { 8035db: 01 de add %ebx,%esi 8035dd: 83 c4 10 add $0x10,%esp 8035e0: 3b 75 10 cmp 0x10(%ebp),%esi 8035e3: 72 cc jb 8035b1 <devcons_write+0x19> } 8035e5: 89 f0 mov %esi,%eax 8035e7: 8d 65 f4 lea -0xc(%ebp),%esp 8035ea: 5b pop %ebx 8035eb: 5e pop %esi 8035ec: 5f pop %edi 8035ed: 5d pop %ebp 8035ee: c3 ret 008035ef <devcons_read>: { 8035ef: 55 push %ebp 8035f0: 89 e5 mov %esp,%ebp 8035f2: 83 ec 08 sub $0x8,%esp 8035f5: b8 00 00 00 00 mov $0x0,%eax if (n == 0) 8035fa: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 8035fe: 75 07 jne 803607 <devcons_read+0x18> } 803600: c9 leave 803601: c3 ret sys_yield(); 803602: e8 28 f0 ff ff call 80262f <sys_yield> while ((c = sys_cgetc()) == 0) 803607: e8 a4 ef ff ff call 8025b0 <sys_cgetc> 80360c: 85 c0 test %eax,%eax 80360e: 74 f2 je 803602 <devcons_read+0x13> if (c < 0) 803610: 85 c0 test %eax,%eax 803612: 78 ec js 803600 <devcons_read+0x11> if (c == 0x04) // ctl-d is eof 803614: 83 f8 04 cmp $0x4,%eax 803617: 74 0c je 803625 <devcons_read+0x36> *(char*)vbuf = c; 803619: 8b 55 0c mov 0xc(%ebp),%edx 80361c: 88 02 mov %al,(%edx) return 1; 80361e: b8 01 00 00 00 mov $0x1,%eax 803623: eb db jmp 803600 <devcons_read+0x11> return 0; 803625: b8 00 00 00 00 mov $0x0,%eax 80362a: eb d4 jmp 803600 <devcons_read+0x11> 0080362c <cputchar>: { 80362c: 55 push %ebp 80362d: 89 e5 mov %esp,%ebp 80362f: 83 ec 20 sub $0x20,%esp char c = ch; 803632: 8b 45 08 mov 0x8(%ebp),%eax 803635: 88 45 f7 mov %al,-0x9(%ebp) sys_cputs(&c, 1); 803638: 6a 01 push $0x1 80363a: 8d 45 f7 lea -0x9(%ebp),%eax 80363d: 50 push %eax 80363e: e8 4f ef ff ff call 802592 <sys_cputs> } 803643: 83 c4 10 add $0x10,%esp 803646: c9 leave 803647: c3 ret 00803648 <getchar>: { 803648: 55 push %ebp 803649: 89 e5 mov %esp,%ebp 80364b: 83 ec 1c sub $0x1c,%esp r = read(0, &c, 1); 80364e: 6a 01 push $0x1 803650: 8d 45 f7 lea -0x9(%ebp),%eax 803653: 50 push %eax 803654: 6a 00 push $0x0 803656: e8 21 f9 ff ff call 802f7c <read> if (r < 0) 80365b: 83 c4 10 add $0x10,%esp 80365e: 85 c0 test %eax,%eax 803660: 78 08 js 80366a <getchar+0x22> if (r < 1) 803662: 85 c0 test %eax,%eax 803664: 7e 06 jle 80366c <getchar+0x24> return c; 803666: 0f b6 45 f7 movzbl -0x9(%ebp),%eax } 80366a: c9 leave 80366b: c3 ret return -E_EOF; 80366c: b8 f8 ff ff ff mov $0xfffffff8,%eax 803671: eb f7 jmp 80366a <getchar+0x22> 00803673 <iscons>: { 803673: 55 push %ebp 803674: 89 e5 mov %esp,%ebp 803676: 83 ec 20 sub $0x20,%esp if ((r = fd_lookup(fdnum, &fd)) < 0) 803679: 8d 45 f4 lea -0xc(%ebp),%eax 80367c: 50 push %eax 80367d: ff 75 08 pushl 0x8(%ebp) 803680: e8 86 f6 ff ff call 802d0b <fd_lookup> 803685: 83 c4 10 add $0x10,%esp 803688: 85 c0 test %eax,%eax 80368a: 78 11 js 80369d <iscons+0x2a> return fd->fd_dev_id == devcons.dev_id; 80368c: 8b 45 f4 mov -0xc(%ebp),%eax 80368f: 8b 15 9c 90 80 00 mov 0x80909c,%edx 803695: 39 10 cmp %edx,(%eax) 803697: 0f 94 c0 sete %al 80369a: 0f b6 c0 movzbl %al,%eax } 80369d: c9 leave 80369e: c3 ret 0080369f <opencons>: { 80369f: 55 push %ebp 8036a0: 89 e5 mov %esp,%ebp 8036a2: 83 ec 24 sub $0x24,%esp if ((r = fd_alloc(&fd)) < 0) 8036a5: 8d 45 f4 lea -0xc(%ebp),%eax 8036a8: 50 push %eax 8036a9: e8 0e f6 ff ff call 802cbc <fd_alloc> 8036ae: 83 c4 10 add $0x10,%esp 8036b1: 85 c0 test %eax,%eax 8036b3: 78 3a js 8036ef <opencons+0x50> if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0) 8036b5: 83 ec 04 sub $0x4,%esp 8036b8: 68 07 04 00 00 push $0x407 8036bd: ff 75 f4 pushl -0xc(%ebp) 8036c0: 6a 00 push $0x0 8036c2: e8 87 ef ff ff call 80264e <sys_page_alloc> 8036c7: 83 c4 10 add $0x10,%esp 8036ca: 85 c0 test %eax,%eax 8036cc: 78 21 js 8036ef <opencons+0x50> fd->fd_dev_id = devcons.dev_id; 8036ce: 8b 45 f4 mov -0xc(%ebp),%eax 8036d1: 8b 15 9c 90 80 00 mov 0x80909c,%edx 8036d7: 89 10 mov %edx,(%eax) fd->fd_omode = O_RDWR; 8036d9: 8b 45 f4 mov -0xc(%ebp),%eax 8036dc: c7 40 08 02 00 00 00 movl $0x2,0x8(%eax) return fd2num(fd); 8036e3: 83 ec 0c sub $0xc,%esp 8036e6: 50 push %eax 8036e7: e8 a9 f5 ff ff call 802c95 <fd2num> 8036ec: 83 c4 10 add $0x10,%esp } 8036ef: c9 leave 8036f0: c3 ret 8036f1: 66 90 xchg %ax,%ax 8036f3: 66 90 xchg %ax,%ax 8036f5: 66 90 xchg %ax,%ax 8036f7: 66 90 xchg %ax,%ax 8036f9: 66 90 xchg %ax,%ax 8036fb: 66 90 xchg %ax,%ax 8036fd: 66 90 xchg %ax,%ax 8036ff: 90 nop 00803700 <__udivdi3>: 803700: 55 push %ebp 803701: 57 push %edi 803702: 56 push %esi 803703: 53 push %ebx 803704: 83 ec 1c sub $0x1c,%esp 803707: 8b 54 24 3c mov 0x3c(%esp),%edx 80370b: 8b 6c 24 30 mov 0x30(%esp),%ebp 80370f: 8b 74 24 34 mov 0x34(%esp),%esi 803713: 8b 5c 24 38 mov 0x38(%esp),%ebx 803717: 85 d2 test %edx,%edx 803719: 75 35 jne 803750 <__udivdi3+0x50> 80371b: 39 f3 cmp %esi,%ebx 80371d: 0f 87 bd 00 00 00 ja 8037e0 <__udivdi3+0xe0> 803723: 85 db test %ebx,%ebx 803725: 89 d9 mov %ebx,%ecx 803727: 75 0b jne 803734 <__udivdi3+0x34> 803729: b8 01 00 00 00 mov $0x1,%eax 80372e: 31 d2 xor %edx,%edx 803730: f7 f3 div %ebx 803732: 89 c1 mov %eax,%ecx 803734: 31 d2 xor %edx,%edx 803736: 89 f0 mov %esi,%eax 803738: f7 f1 div %ecx 80373a: 89 c6 mov %eax,%esi 80373c: 89 e8 mov %ebp,%eax 80373e: 89 f7 mov %esi,%edi 803740: f7 f1 div %ecx 803742: 89 fa mov %edi,%edx 803744: 83 c4 1c add $0x1c,%esp 803747: 5b pop %ebx 803748: 5e pop %esi 803749: 5f pop %edi 80374a: 5d pop %ebp 80374b: c3 ret 80374c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 803750: 39 f2 cmp %esi,%edx 803752: 77 7c ja 8037d0 <__udivdi3+0xd0> 803754: 0f bd fa bsr %edx,%edi 803757: 83 f7 1f xor $0x1f,%edi 80375a: 0f 84 98 00 00 00 je 8037f8 <__udivdi3+0xf8> 803760: 89 f9 mov %edi,%ecx 803762: b8 20 00 00 00 mov $0x20,%eax 803767: 29 f8 sub %edi,%eax 803769: d3 e2 shl %cl,%edx 80376b: 89 54 24 08 mov %edx,0x8(%esp) 80376f: 89 c1 mov %eax,%ecx 803771: 89 da mov %ebx,%edx 803773: d3 ea shr %cl,%edx 803775: 8b 4c 24 08 mov 0x8(%esp),%ecx 803779: 09 d1 or %edx,%ecx 80377b: 89 f2 mov %esi,%edx 80377d: 89 4c 24 08 mov %ecx,0x8(%esp) 803781: 89 f9 mov %edi,%ecx 803783: d3 e3 shl %cl,%ebx 803785: 89 c1 mov %eax,%ecx 803787: d3 ea shr %cl,%edx 803789: 89 f9 mov %edi,%ecx 80378b: 89 5c 24 0c mov %ebx,0xc(%esp) 80378f: d3 e6 shl %cl,%esi 803791: 89 eb mov %ebp,%ebx 803793: 89 c1 mov %eax,%ecx 803795: d3 eb shr %cl,%ebx 803797: 09 de or %ebx,%esi 803799: 89 f0 mov %esi,%eax 80379b: f7 74 24 08 divl 0x8(%esp) 80379f: 89 d6 mov %edx,%esi 8037a1: 89 c3 mov %eax,%ebx 8037a3: f7 64 24 0c mull 0xc(%esp) 8037a7: 39 d6 cmp %edx,%esi 8037a9: 72 0c jb 8037b7 <__udivdi3+0xb7> 8037ab: 89 f9 mov %edi,%ecx 8037ad: d3 e5 shl %cl,%ebp 8037af: 39 c5 cmp %eax,%ebp 8037b1: 73 5d jae 803810 <__udivdi3+0x110> 8037b3: 39 d6 cmp %edx,%esi 8037b5: 75 59 jne 803810 <__udivdi3+0x110> 8037b7: 8d 43 ff lea -0x1(%ebx),%eax 8037ba: 31 ff xor %edi,%edi 8037bc: 89 fa mov %edi,%edx 8037be: 83 c4 1c add $0x1c,%esp 8037c1: 5b pop %ebx 8037c2: 5e pop %esi 8037c3: 5f pop %edi 8037c4: 5d pop %ebp 8037c5: c3 ret 8037c6: 8d 76 00 lea 0x0(%esi),%esi 8037c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 8037d0: 31 ff xor %edi,%edi 8037d2: 31 c0 xor %eax,%eax 8037d4: 89 fa mov %edi,%edx 8037d6: 83 c4 1c add $0x1c,%esp 8037d9: 5b pop %ebx 8037da: 5e pop %esi 8037db: 5f pop %edi 8037dc: 5d pop %ebp 8037dd: c3 ret 8037de: 66 90 xchg %ax,%ax 8037e0: 31 ff xor %edi,%edi 8037e2: 89 e8 mov %ebp,%eax 8037e4: 89 f2 mov %esi,%edx 8037e6: f7 f3 div %ebx 8037e8: 89 fa mov %edi,%edx 8037ea: 83 c4 1c add $0x1c,%esp 8037ed: 5b pop %ebx 8037ee: 5e pop %esi 8037ef: 5f pop %edi 8037f0: 5d pop %ebp 8037f1: c3 ret 8037f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8037f8: 39 f2 cmp %esi,%edx 8037fa: 72 06 jb 803802 <__udivdi3+0x102> 8037fc: 31 c0 xor %eax,%eax 8037fe: 39 eb cmp %ebp,%ebx 803800: 77 d2 ja 8037d4 <__udivdi3+0xd4> 803802: b8 01 00 00 00 mov $0x1,%eax 803807: eb cb jmp 8037d4 <__udivdi3+0xd4> 803809: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 803810: 89 d8 mov %ebx,%eax 803812: 31 ff xor %edi,%edi 803814: eb be jmp 8037d4 <__udivdi3+0xd4> 803816: 66 90 xchg %ax,%ax 803818: 66 90 xchg %ax,%ax 80381a: 66 90 xchg %ax,%ax 80381c: 66 90 xchg %ax,%ax 80381e: 66 90 xchg %ax,%ax 00803820 <__umoddi3>: 803820: 55 push %ebp 803821: 57 push %edi 803822: 56 push %esi 803823: 53 push %ebx 803824: 83 ec 1c sub $0x1c,%esp 803827: 8b 6c 24 3c mov 0x3c(%esp),%ebp 80382b: 8b 74 24 30 mov 0x30(%esp),%esi 80382f: 8b 5c 24 34 mov 0x34(%esp),%ebx 803833: 8b 7c 24 38 mov 0x38(%esp),%edi 803837: 85 ed test %ebp,%ebp 803839: 89 f0 mov %esi,%eax 80383b: 89 da mov %ebx,%edx 80383d: 75 19 jne 803858 <__umoddi3+0x38> 80383f: 39 df cmp %ebx,%edi 803841: 0f 86 b1 00 00 00 jbe 8038f8 <__umoddi3+0xd8> 803847: f7 f7 div %edi 803849: 89 d0 mov %edx,%eax 80384b: 31 d2 xor %edx,%edx 80384d: 83 c4 1c add $0x1c,%esp 803850: 5b pop %ebx 803851: 5e pop %esi 803852: 5f pop %edi 803853: 5d pop %ebp 803854: c3 ret 803855: 8d 76 00 lea 0x0(%esi),%esi 803858: 39 dd cmp %ebx,%ebp 80385a: 77 f1 ja 80384d <__umoddi3+0x2d> 80385c: 0f bd cd bsr %ebp,%ecx 80385f: 83 f1 1f xor $0x1f,%ecx 803862: 89 4c 24 04 mov %ecx,0x4(%esp) 803866: 0f 84 b4 00 00 00 je 803920 <__umoddi3+0x100> 80386c: b8 20 00 00 00 mov $0x20,%eax 803871: 89 c2 mov %eax,%edx 803873: 8b 44 24 04 mov 0x4(%esp),%eax 803877: 29 c2 sub %eax,%edx 803879: 89 c1 mov %eax,%ecx 80387b: 89 f8 mov %edi,%eax 80387d: d3 e5 shl %cl,%ebp 80387f: 89 d1 mov %edx,%ecx 803881: 89 54 24 0c mov %edx,0xc(%esp) 803885: d3 e8 shr %cl,%eax 803887: 09 c5 or %eax,%ebp 803889: 8b 44 24 04 mov 0x4(%esp),%eax 80388d: 89 c1 mov %eax,%ecx 80388f: d3 e7 shl %cl,%edi 803891: 89 d1 mov %edx,%ecx 803893: 89 7c 24 08 mov %edi,0x8(%esp) 803897: 89 df mov %ebx,%edi 803899: d3 ef shr %cl,%edi 80389b: 89 c1 mov %eax,%ecx 80389d: 89 f0 mov %esi,%eax 80389f: d3 e3 shl %cl,%ebx 8038a1: 89 d1 mov %edx,%ecx 8038a3: 89 fa mov %edi,%edx 8038a5: d3 e8 shr %cl,%eax 8038a7: 0f b6 4c 24 04 movzbl 0x4(%esp),%ecx 8038ac: 09 d8 or %ebx,%eax 8038ae: f7 f5 div %ebp 8038b0: d3 e6 shl %cl,%esi 8038b2: 89 d1 mov %edx,%ecx 8038b4: f7 64 24 08 mull 0x8(%esp) 8038b8: 39 d1 cmp %edx,%ecx 8038ba: 89 c3 mov %eax,%ebx 8038bc: 89 d7 mov %edx,%edi 8038be: 72 06 jb 8038c6 <__umoddi3+0xa6> 8038c0: 75 0e jne 8038d0 <__umoddi3+0xb0> 8038c2: 39 c6 cmp %eax,%esi 8038c4: 73 0a jae 8038d0 <__umoddi3+0xb0> 8038c6: 2b 44 24 08 sub 0x8(%esp),%eax 8038ca: 19 ea sbb %ebp,%edx 8038cc: 89 d7 mov %edx,%edi 8038ce: 89 c3 mov %eax,%ebx 8038d0: 89 ca mov %ecx,%edx 8038d2: 0f b6 4c 24 0c movzbl 0xc(%esp),%ecx 8038d7: 29 de sub %ebx,%esi 8038d9: 19 fa sbb %edi,%edx 8038db: 8b 5c 24 04 mov 0x4(%esp),%ebx 8038df: 89 d0 mov %edx,%eax 8038e1: d3 e0 shl %cl,%eax 8038e3: 89 d9 mov %ebx,%ecx 8038e5: d3 ee shr %cl,%esi 8038e7: d3 ea shr %cl,%edx 8038e9: 09 f0 or %esi,%eax 8038eb: 83 c4 1c add $0x1c,%esp 8038ee: 5b pop %ebx 8038ef: 5e pop %esi 8038f0: 5f pop %edi 8038f1: 5d pop %ebp 8038f2: c3 ret 8038f3: 90 nop 8038f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 8038f8: 85 ff test %edi,%edi 8038fa: 89 f9 mov %edi,%ecx 8038fc: 75 0b jne 803909 <__umoddi3+0xe9> 8038fe: b8 01 00 00 00 mov $0x1,%eax 803903: 31 d2 xor %edx,%edx 803905: f7 f7 div %edi 803907: 89 c1 mov %eax,%ecx 803909: 89 d8 mov %ebx,%eax 80390b: 31 d2 xor %edx,%edx 80390d: f7 f1 div %ecx 80390f: 89 f0 mov %esi,%eax 803911: f7 f1 div %ecx 803913: e9 31 ff ff ff jmp 803849 <__umoddi3+0x29> 803918: 90 nop 803919: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 803920: 39 dd cmp %ebx,%ebp 803922: 72 08 jb 80392c <__umoddi3+0x10c> 803924: 39 f7 cmp %esi,%edi 803926: 0f 87 21 ff ff ff ja 80384d <__umoddi3+0x2d> 80392c: 89 da mov %ebx,%edx 80392e: 89 f0 mov %esi,%eax 803930: 29 f8 sub %edi,%eax 803932: 19 ea sbb %ebp,%edx 803934: e9 14 ff ff ff jmp 80384d <__umoddi3+0x2d>
41.807216
93
0.481085
fde2ccf2381d7176cc5ea8ac5dda63983cf24756
792
asm
Assembly
assets/code/save slot text.asm
nleseul/46bys-eden
b07d3bfd971647b0207ee76ad8d7b0921744427a
[ "Unlicense" ]
3
2020-04-10T11:59:18.000Z
2022-01-11T11:57:06.000Z
assets/code/save slot text.asm
nleseul/46bys-eden
b07d3bfd971647b0207ee76ad8d7b0921744427a
[ "Unlicense" ]
null
null
null
assets/code/save slot text.asm
nleseul/46bys-eden
b07d3bfd971647b0207ee76ad8d7b0921744427a
[ "Unlicense" ]
null
null
null
*= $c46f .al LDA $701000,x AND #$00FF STA $44 CLC ADC #$30B6 STA $0846,y LDA $32 STA $46 LDA $34 STA $48 LDA $36 STA $4A PHX PHB REP #$10 SEP #$20 .as LDA #$00 PHA PLB REP #$30 .al LDA $701001,x AND #$00FF STA $32 JSR $B825
26.4
34
0.17803
f66ab4db3341583e143f320082b2028722731452
6,731
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_860.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_860.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_860.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 %rax push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x14a64, %r12 nop nop nop nop and $4011, %rdx mov (%r12), %edi nop nop nop nop and $41332, %rbp lea addresses_D_ht+0xbd54, %rcx nop nop nop nop xor %r14, %r14 mov (%rcx), %rax nop nop xor $25311, %rdi lea addresses_D_ht+0x115ea, %rsi lea addresses_WC_ht+0x6d54, %rdi clflush (%rdi) nop nop nop cmp %r14, %r14 mov $7, %rcx rep movsw nop nop nop cmp $8444, %rdx lea addresses_D_ht+0x1b4f4, %rsi lea addresses_normal_ht+0x17bd4, %rdi clflush (%rsi) nop dec %r12 mov $118, %rcx rep movsl dec %rsi lea addresses_normal_ht+0x3f8c, %rbp nop nop nop inc %rcx movups (%rbp), %xmm2 vpextrq $1, %xmm2, %rdi nop nop nop nop nop cmp $59564, %rbp lea addresses_A_ht+0xcd14, %rsi lea addresses_WC_ht+0x9494, %rdi nop nop nop xor $8256, %rax mov $61, %rcx rep movsb nop nop nop and $61294, %r14 lea addresses_D_ht+0x9dd4, %rcx nop nop and $41694, %rax mov (%rcx), %r12 nop nop add $51353, %rcx lea addresses_A_ht+0x17d54, %rsi lea addresses_WC_ht+0x1c5c6, %rdi nop nop cmp %rdx, %rdx mov $117, %rcx rep movsb nop nop sub %r12, %r12 lea addresses_A_ht+0x1bc68, %rsi lea addresses_WT_ht+0x2ed1, %rdi nop nop nop nop and $37353, %r12 mov $115, %rcx rep movsb nop nop sub $19971, %r14 lea addresses_D_ht+0xbf94, %rsi lea addresses_UC_ht+0x1604e, %rdi add $45422, %rax mov $23, %rcx rep movsl nop and $51960, %rax lea addresses_UC_ht+0x1b954, %rax nop and %rsi, %rsi mov (%rax), %bp nop inc %r12 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r14 pop %r12 ret .global s_faulty_load s_faulty_load: push %r14 push %r8 push %r9 push %rbp // Faulty Load lea addresses_WT+0x954, %r8 clflush (%r8) nop nop nop nop nop cmp %r14, %r14 movb (%r8), %r9b lea oracles, %r8 and $0xff, %r9 shlq $12, %r9 mov (%r8,%r9,1), %r9 pop %rbp pop %r9 pop %r8 pop %r14 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_WT', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'same': True, 'size': 2, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'39': 21829} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
37.394444
2,999
0.658595
60c87aa2e552d60110b9d19c3d4cd1c5f8fb8607
1,125
asm
Assembly
tests/Comprehensive/count_1s.asm
ZubinGou/8086-emulator
5087be61609fa571d16f34280211830746beaef1
[ "MIT" ]
39
2020-09-09T00:04:18.000Z
2022-03-26T13:12:47.000Z
tests/Comprehensive/count_1s.asm
ZubinGou/8086-emulator
5087be61609fa571d16f34280211830746beaef1
[ "MIT" ]
null
null
null
tests/Comprehensive/count_1s.asm
ZubinGou/8086-emulator
5087be61609fa571d16f34280211830746beaef1
[ "MIT" ]
8
2020-05-06T07:35:40.000Z
2021-08-13T14:00:49.000Z
;program to count number of binary 1s NAME Arithmetic TITLE count_1s assume cs:code,ds:data data segment data1 db ? msg1 db 10,13,"enter the number: $" msg3 db 10,13,"number of 1s are: $" data ends code segment start: mov ax,data mov ds,ax sub bl,bl lea dx,msg1 ;load address of msg1 into dx mov ah,9h ;interrupt to display contents of dx int 21h mov ah,1h ;read a character from console int 21h sub al,30h ;converting from ascii into bcd form mov dl,8h ;set up count register again: rol al,1 jnc next ;conditional jump if carry flag is 0 inc bl ;number of 1s next: dec dl jnz again ;short jump if del is not zero lea dx,msg3 ;print msg3 mov ah,9h int 21h mov ah,2h ;print number of 1s add bl,30h mov dl,bl int 21h exit: mov ah,04ch mov al,0 int 21h code ends end start
24.456522
63
0.515556
9c72d86091b4ddaa57faab0601f11de94f7a4681
834
asm
Assembly
oeis/142/A142383.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/142/A142383.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/142/A142383.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A142383: Primes congruent to 32 mod 47. ; Submitted by Simon Strandgaard ; 79,173,643,1019,1301,1489,1583,2053,2617,2711,3181,3463,3557,4027,4591,4967,5437,5531,5813,6659,7129,7411,8069,8539,8821,9103,9479,9949,10513,10607,10889,11171,11923,12487,13709,14461,15307,15401,15683,16529,16811,17093,17657,17939,18127,18503,18691,18973,19819,19913,20101,20477,20759,20947,21323,22639,22921,23203,23297,23767,24049,24989,25741,26399,26681,27527,27809,27997,28279,28843,29501,30253,30347,30817,30911,31193,31663,32321,32603,33073,33637,34483,35141,35423,36269,36457,36551,36739 mov $1,39 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,2 mov $3,$1 mul $3,2 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,47 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,93
34.75
497
0.732614
2c76125f5ae05c5c8e4f70f9751a7b50d4b5aa0e
321
asm
Assembly
programs/oeis/131/A131209.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/131/A131209.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/131/A131209.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A131209: Maximal distance between two signed permutations of n elements. ; 0,1,3,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69 mov $1,$0 lpb $0,1 gcd $0,3 add $1,1 lpe
35.666667
199
0.663551
2d40e0d6ac53a44274607ef78d0614bcb79309c1
820
asm
Assembly
programs/oeis/157/A157622.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/157/A157622.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/157/A157622.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A157622: 31250n - 9100. ; 22150,53400,84650,115900,147150,178400,209650,240900,272150,303400,334650,365900,397150,428400,459650,490900,522150,553400,584650,615900,647150,678400,709650,740900,772150,803400,834650,865900,897150,928400,959650,990900,1022150,1053400,1084650,1115900,1147150,1178400,1209650,1240900,1272150,1303400,1334650,1365900,1397150,1428400,1459650,1490900,1522150,1553400,1584650,1615900,1647150,1678400,1709650,1740900,1772150,1803400,1834650,1865900,1897150,1928400,1959650,1990900,2022150,2053400,2084650,2115900,2147150,2178400,2209650,2240900,2272150,2303400,2334650,2365900,2397150,2428400,2459650,2490900,2522150,2553400,2584650,2615900,2647150,2678400,2709650,2740900,2772150,2803400,2834650,2865900,2897150,2928400,2959650,2990900,3022150,3053400,3084650,3115900 mul $0,31250 add $0,22150
136.666667
766
0.853659
a6de8ddb37282b47aa5eb56a10a86f9e7d19d2b6
650
asm
Assembly
oeis/152/A152257.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/152/A152257.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/152/A152257.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A152257: a(n) = (3^n - 1)^2*(3^n + 1)/16. ; Submitted by Jamie Morken(s3) ; 0,1,40,1183,32800,893101,24180520,653473003,17649155200,476575627801,12867977828200,347439324082423,9380897054183200,253284538196972101,6838685390919695080,184644531291230453443,4985402576490767372800,134605871649898496094001,3634358553309089000373160,98127681108201868300330063,2649447391441158628234420000,71535079582588656608998561501,1931447148852990091231603094440,52149073020138599728256917776283,1408024971553712998047687058460800,38016674232039988195749455796342601 mov $1,1 mov $2,3 pow $2,$0 add $1,$2 mov $3,1 sub $3,$2 mul $1,$3 mul $1,$3 mov $0,$1 div $0,16
43.333333
475
0.832308
f99383a6ed04c49886bb29e0d9c36b7284c5985a
533
asm
Assembly
pwnlib/shellcraft/templates/i386/linux/dir.asm
DrKeineLust/pwntools
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
[ "MIT" ]
8,966
2015-01-02T11:58:14.000Z
2022-03-31T21:19:56.000Z
pwnlib/shellcraft/templates/i386/linux/dir.asm
DrKeineLust/pwntools
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
[ "MIT" ]
1,401
2015-01-01T00:56:22.000Z
2022-03-31T16:19:53.000Z
pwnlib/shellcraft/templates/i386/linux/dir.asm
DrKeineLust/pwntools
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
[ "MIT" ]
1,844
2015-01-07T04:38:06.000Z
2022-03-30T03:54:46.000Z
<% from pwnlib.shellcraft import i386, pretty %> <%page args="in_fd = 'ebp', size = 0x800, allocate_stack = True"/> <%docstring> Reads to the stack from a directory. Args: in_fd (int/str): File descriptor to be read from. size (int): Buffer size. allocate_stack (bool): allocate 'size' bytes on the stack. You can optioanlly shave a few bytes not allocating the stack space. The size read is left in eax. </%docstring> %if allocate_stack: sub esp, ${pretty(size)} %endif ${i386.linux.getdents(in_fd, 'esp', size)}
29.611111
68
0.699812
9d02a7198e6b284407a0c735b74405d789fde159
528
asm
Assembly
oeis/278/A278681.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/278/A278681.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/278/A278681.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A278681: Pisot sequence T(3,16). ; Submitted by Jamie Morken(s4) ; 3,16,85,451,2392,12686,67280,356818,1892376,10036172,53226604,282286052,1497097488,7939821584,42108658448,223322287224,1184384537744,6281355751296,33313023614352,176674843181968,936990907061504,4969309405367264,26354616443092800,139771093164846816,741272730213321216,3931322622695991104 mov $4,2 lpb $4 mov $1,3 mov $2,5 mov $3,8 mov $4,1 lpb $0 sub $0,1 div $3,$2 mov $2,$1 mul $1,5 add $1,$3 mul $3,$1 lpe lpe mov $0,$1
25.142857
288
0.725379
1ea204b9f2ff58e2f426aef49c19a242e970c065
1,316
asm
Assembly
basic/raster.asm
EgonOlsen71/XAM
659cb5a3cbd07c64761f04544364100915ae74b1
[ "Unlicense" ]
2
2020-10-09T10:00:33.000Z
2020-10-26T19:00:59.000Z
basic/raster.asm
EgonOlsen71/XAM
659cb5a3cbd07c64761f04544364100915ae74b1
[ "Unlicense" ]
null
null
null
basic/raster.asm
EgonOlsen71/XAM
659cb5a3cbd07c64761f04544364100915ae74b1
[ "Unlicense" ]
null
null
null
*=832 START=46 END=254 ROM1=$A000 ROM2=$E000 sei lda #<myraster sta $0314 lda #>myraster sta $0315 lda #START sta $d012 lda $d011 and #127 sta $d011 lda $d01a ora #1 sta $d01a cli rts myraster: lda $d019 bmi raster lda $dc0d cli jmp $ea31 raster: sta $d019 lda $d012 cmp #END bcs setstart lda color sta $d020 lda #END sta $d012 jmp exit setstart: lda topcolor sta $d020 lda #START sta $d012 exit: pla tay pla tax pla rti topcolor: .byte 11 color: .byte 0 rasteroff: sei lda $d01a and #14 sta $d01a lda color sta $d020 cli rts rasteron: sei lda $d01a ora #1 sta $d01a cli rts copyrom: lda mapping bne skipstore lda $1 sta mapping skipstore: ldy #$00 lda #<ROM1 sta $61 lda #>ROM1 sta $62 lda #<ROM2 sta $63 lda #>ROM2 sta $64 copy: lda ($61),y sta ($61),y lda ($63),y sta ($63),y iny bne copy inc $62 inc $64 bne copy lda #0 sta 59639 lda mapping and #$fd sta $1 rts resetrom: lda mapping sta 1 rts mapping: .byte 0
11.152542
38
0.492401
7b6b077bd8cae248e224a5b741a0351d716372ae
1,182
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math48/z80/core/mm48__expsgn.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/z80/core/mm48__expsgn.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/z80/core/mm48__expsgn.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
SECTION code_fp_math48 PUBLIC mm48__expsgn, mm48__retzero EXTERN mm48__zero, am48_derror_erange_infxc mm48__expsgn: ; AC' active (AC must be preserved) ;Juster exponent og udregn fortegn. jr c, mm48__exps1 ;Carry => EXPS1 add a,$80 ;Juster exponent jr c, mm48__exps2 ;Carry => EXPS2 ; jr mm48__exps3 ;Underflow mm48__exps3: ; underflow or overflow (carry set) ; popping return address and creating result in jump ; AC' active pop hl ;uster stakken jp c, am48_derror_erange_infxc - 1 ;if overflow mm48__retzero: call mm48__zero ;underflow exx ret mm48__exps1: add a,$80 ;Juster exponent jr c, mm48__exps3 ;carry => Overflow mm48__exps2: ld l,a ;Gem i exponent ex (sp),ix ;Gem IX exx push hl ;Gem AC exponent push bc ;Gem AC fortegn ld a,b ;Udregn nyt fortegn set 7,b exx xor b and $80 push af set 7,b push ix ld ix,0 ;Nulstil IX ret
20.736842
55
0.542301
6c58f34bcad94fb35953e6be71b7777511b3d806
16,856
asm
Assembly
private/ntos/vdm/i386/vdmoprnd.asm
King0987654/windows2000
01f9c2e62c4289194e33244aade34b7d19e7c9b8
[ "MIT" ]
11
2017-09-02T11:27:08.000Z
2022-01-02T15:25:24.000Z
private/ntos/vdm/i386/vdmoprnd.asm
King0987654/windows2000
01f9c2e62c4289194e33244aade34b7d19e7c9b8
[ "MIT" ]
null
null
null
private/ntos/vdm/i386/vdmoprnd.asm
King0987654/windows2000
01f9c2e62c4289194e33244aade34b7d19e7c9b8
[ "MIT" ]
14
2019-01-16T01:01:23.000Z
2022-02-20T15:54:27.000Z
title "Operand Decoding" ;++ ; ;Copyright (c) 1991 Microsoft Corporation ; ;Module Name: ; ; vdmoprnd.asm ; ;Abstract: ; ; This module contains support for decoding 386/486 instruction operands. ; This is used by the opcode 0f emulation. ; ; ;Author: ; ; Dave Hastings (daveh) 20-Feb-1992 ; ;Notes: ; ; The only instruction which uses the operand decodeing (3/10/92) is ; LMSW. This instruction only has 16 bit operands, so only the 16 bit ; operand decode has been tested. The 32 bit decode will be tested ; (or removed?) during clean up, after code freeze. ; ;Revision History: ; ;-- .386p .xlist include ks386.inc include callconv.inc ; calling convention macros include mi386.inc include vdm.inc include vdmtib.inc page ,132 _PAGE SEGMENT DWORD PUBLIC 'CODE' ASSUME DS:NOTHING, ES:NOTHING, SS:NOTHING, FS:NOTHING, GS:NOTHING EXTRNP _Ki386GetSelectorParameters,4 extrn CheckEip:proc _PAGE ENDS _DATA SEGMENT DWORD PUBLIC 'DATA' ; ; This table is used to dispatch base on the mod code for 16 bit address size. ; When these locations are dispatched to, ; edi = linear address of next byte of instruction ; esi = pointer to register info ; ecx = R/M value for the instruction modtab16 dd offset FLAT:do20 ; no displacement dd offset FLAT:do40 ; 8 bit displacement dd offset FLAT:do50 ; 16 bit displacement dd offset FLAT:do60 ; Register operand ; ; This table is used to dispatch based on the RM code for 16 bit address size. ; When these locations are dispatched to, ; edi = pointer to trap frame ; esi = pointer to register info ; ebx = partial linear address of operand rmtab16 dd offset FLAT:do70 ; [bx + si] dd offset FLAT:do80 ; [bx + di] dd offset FLAT:do90 ; [bp + si] dd offset FLAT:do100 ; [bp + di] dd offset FLAT:do95 ; [si] dd offset FLAT:do85 ; [di] dd offset FLAT:do105 ; [bp] dd offset FLAT:do75 ; [bx] ; ; This table is used to dispatch base on the mod code for 32 bit address size. ; When these locations are dispatched to, ; edi = linear address of next byte of instruction ; esi = pointer to register info ; ecx = R/M value for the instruction modtab32 dd offset FLAT:do220 ; no displacement dd offset FLAT:do240 ; 8 bit displacement dd offset FLAT:do250 ; 32 bit displacement dd offset FLAT:do260 ; Register operand ; ; This table is used to pick up register offsets in the trap frame. ; N.B. This table cannot be used to find byte registers!! ; public RegTab RegTab dd TsEax dd TsEcx dd TsEdx dd TsEbx dd TsHardwareEsp dd TsEbp dd TsEsi dd TsEdi _DATA ENDS _PAGE SEGMENT DWORD PUBLIC 'CODE' ASSUME DS:FLAT, ES:NOTHING, SS:FLAT, FS:NOTHING, GS:NOTHING page ,132 subttl "Decode Operands" ;++ ; ; Routine Description: ; ; This routine decodes the operands for 386/486 instructions. It returns ; the linear address of the operand. For register operands, this is ; an address in the stack frame. The read/write flag is used for ; operand verification. ; ; Arguments: ; ; esi = address of reg info ; eax = 1 -- Read of operand ; 0 -- Write of operand ; ; Returns: ; ; eax = True -- operand ok, and reg info operand field filled in ; eax = False -- operand not ok. ; reg info eip updated ; ; Notes: ; ; This routine DOES NOT decode the reg field of the mod r/m byte of the ; opcode. This is not a problem because it will only return one operand ; address anyway. It does not decode byte registers correctly!!. ; ; check grow down ss handling public VdmDecodeOperand VdmDecodeOperand proc SegBase equ [ebp] - 04h SegLimit equ [ebp] - 08h SegFlags equ [ebp] - 0ch SelLookupResult equ [ebp] - 010h ReadWrite equ [ebp] - 014h ModRm equ [ebp] - 018h SIB equ [ebp] - 01ch push ebp mov ebp,esp sub esp,01ch push edi push ecx push ebx mov ReadWrite,eax ; ; Get the info on DS (assumed default selector) ; lea edx,SegLimit push edx lea edx,SegBase push edx lea edx,SegFlags push edx mov edi,[esi].RiTrapFrame push [edi].TsSegDs call VdmSegParams add esp,010h mov SelLookupResult,eax ; check result after override check mov edi,[esi].RiEip add edi,[esi].RiCsBase call CheckEip test al,0fh jz do200 ; Gp fault, report error movzx edx,byte ptr [edi] ; get mod r/m byte inc [esi].RiEip inc edi mov ecx,edx mov ModRm,edx and edx,MI_MODMASK shr edx,MI_MODSHIFT ; form jump table index from mod and ecx,MI_RMMASK ; form index for RM jump table test [esi].RiPrefixFlags,PREFIX_ADDR32 ; 32 bit segments. jnz do210 ; 32 bit instructions have diff form jmp modtab16[edx * 4] do20: ; ; These forms have no displacement, except for the "bp" form, which ; is just a 16 bit immediate displacement ; mov ebx,0 ; assume no displacement cmp ecx,MI_RMBP jne do30 ; dispatch through jmp table call CheckEip test al,0fh jz do200 ; Gp fault, report error movzx ebx,word ptr [edi] ; get displacement inc [esi].RiEip ; update eip inc [esi].RiEip jmp do120 ; go add in seg do30: mov edi,[esi].RiTrapFrame jmp rmtab16[ecx * 4] ; go get register info. do40: ; ; These forms have an 8 bit displacement ; call CheckEip test al,0fh jz do200 ; Gp fault, report error movsx ebx,byte ptr [edi] inc [esi].RiEip mov edi,[esi].RiTrapFrame jmp rmtab16[ecx * 4] do50: ; ; These forms have an 16 bit displacement ; call CheckEip test al,0fh jz do200 ; Gp fault, report error movzx ebx,word ptr [edi] inc [esi].RiEip inc [esi].RiEip mov edi,[esi].RiTrapFrame jmp rmtab16[ecx * 4] do60: ; ; These forms are register operands ; mov ebx,RegTab[ecx * 4] ; get offset into stackframe add ebx,[esi].RiTrapFrame ; form linear address jmp do194 ; return success do70: ; ; This is the [bx + si] operand ; movzx edx,word ptr [edi].TsEsi add ebx,edx do75: ; ; This is the [bx] operand, and a fall through to finish forming [bx + si] ; movzx edx,word ptr [edi].TsEbx add ebx,edx jmp do120 ; go add seg info do80: ; ; This is the [bx + di] operand ; movzx edx,word ptr [edi].TsEbx add ebx,edx do85: ; ; This is the [di] operand, and the fall through to finish [bx + di] ; movzx edx,word ptr [edi].TsEdi add ebx,edx jmp do120 ; go add seg info do90: ; ; This is the [bp + si] operand ; movzx edx,word ptr [edi].TsEbp add ebx,edx ; ; Change default segment to be ss ; lea edx,SegLimit push edx lea edx,SegBase push edx lea edx,SegFlags push edx mov edi,[esi].RiTrapFrame push [edi].TsHardwareSegSs call VdmSegParams add esp,010h mov SelLookupResult,eax do95: ; ; This is the [si] operand, and the fall through for forming [bp + si] ; movzx edx,word ptr [edi].TsEsi add ebx,edx jmp do120 ; go add seg info do100: ; ; This is the [bp + di] operand ; movzx edx,word ptr [edi].TsEdi add ebx,edx do105: ; ; This is the [bp] operand, and the fall through for forming [bp + di] ; movzx edx,word ptr [edi].TsEbp add ebx,edx ; ; Change default segment to be SS ; lea edx,SegLimit push edx lea edx,SegBase push edx lea edx,SegFlags push edx mov edi,[esi].RiTrapFrame push [edi].TsHardwareSegSs call VdmSegParams add esp,010h mov SelLookupResult,eax do120: test [esi].RiPrefixFlags,PREFIX_SEG_ALL ; check for seg prefixes jz do190 ; no prefixes, use default. ; Note: we could use a bsr instruction here, but it has a high ; overhead relative to a test and a jump, and I expect that ; es overrides will be by far the most common mov edi,[esi].RiTrapFrame test [esi].RiPrefixFlags,PREFIX_ES jz do130 movzx edx,word ptr [edi].TsSegEs jmp do180 do130: test [esi].RiPrefixFlags,PREFIX_CS jz do140 movzx edx,word ptr [edi].TsSegCs jmp do180 do140: test [esi].RiPrefixFlags,PREFIX_SS jz do150 movzx edx,word ptr [edi].TsHardwareSegSs jmp do180 do150: test [esi].RiPrefixFlags,PREFIX_DS jz do160 movzx edx,word ptr [edi].TsSegDs jmp do180 do160: test [esi].RiPrefixFlags,PREFIX_FS jz do170 movzx edx,word ptr [edi].TsSegFs jmp do180 do170: ; assert that seg gs bit is set movzx edx,word ptr [edi].TsSegGs ; ; Get information on new default segment ; do180: lea ecx,SegLimit push ecx lea ecx,SegBase push ecx lea ecx,SegFlags push ecx push edx call VdmSegParams add esp,010h mov SelLookupResult,eax test byte ptr SelLookupResult,0fh jz do200 ; return error cmp dword ptr ReadWrite,0 jnz do190 ; we can read all sels test dword ptr SegFlags,SEL_TYPE_WRITE jz do200 ; return error. cmp ebx,SegLimit jae do200 ; gp fault do190: add ebx,SegBase do194: mov [esi].RiOperand,ebx ; update op pointer mov eax,1 do195: pop ebx pop ecx pop edi mov esp,ebp pop ebp ret do200: xor eax,eax jmp do195 ; ; Get the SIB if there is one, and save it for later. ; do210: cmp ecx,MI_RMSIB jne do215 ; no Sib, dispatch for displacement call CheckEip test al,0fh jz do200 ; report GP fault movzx eax,byte ptr [edi] mov Sib,eax inc edi inc [esi].RiEip do215: jmp modtab32[edx * 4] do220: ; ; These forms have no displacement, except for the "bp" form, which ; is just a 32 bit immediate displacement ; mov ebx,0 ; assume no displacement cmp ecx,MI_RMBP jne do270 call CheckEip test al,0fh jz do200 ; Gp fault, report error mov ebx,[edi] ; get displacement add [esi].RiEip,4 ; update eip jmp do120 ; go add in seg do240: ; ; These forms have an 8 bit displacement ; call CheckEip test al,0fh jz do200 ; Gp fault, report error movsx ebx,byte ptr [edi] inc [esi].RiEip jmp do270 do250: ; ; These forms have an 32 bit displacement ; call CheckEip test al,0fh jz do200 ; Gp fault, report error mov ebx, [edi] add [esi].RiEip,4 jmp do270 do260: ; ; These forms are register operands ; mov ebx,RegTab[ecx * 4] ; get offset into stackframe add ebx,[esi].RiTrapFrame ; form linear address jmp do195 ; return success do270: ; ; Add in the RM portion of the effective address. ; cmp ecx,MI_RMSIB je do290 ; handle SIB specially mov edi,[esi].RiTrapFrame mov edx,RegTab[ecx * 4] ; get offset of register add ebx,[edx+edi] ; add register to displacement cmp ecx,MI_RMBP ; bp is base? je do280 ; set up ss as default jmp do120 ; get segment info. do280: ; ; Change default segment to be SS ; lea edx,SegLimit push edx lea edx,SegBase push edx lea edx,SegFlags push edx mov edi,[esi].RiTrapFrame push [edi].TsHardwareSegSs call VdmSegParams add esp,010h mov SelLookupResult,eax jmp do120 do290: ; ; Decode the Sib ; mov edx,Sib mov edi,[esi].RiTrapFrame and edx,MI_SIB_BASEMASK ; isolate base cmp edx,MI_SIB_BASENONE ; no base je do300 mov eax,RegTab[edx * 4] add ebx,[edi+eax] ; get register contents, and add do300: mov edx,Sib and ecx,MI_SIB_INDEXMASK shr ecx,MI_SIB_INDEXSHIFT ; make index out of "index" field cmp ecx,MI_SIB_INDEXNONE je do310 ; no index mov eax,RegTab[ecx * 4] mov eax,[eax+edi] ; get reg contents for multiply. mov ecx,Sib and ecx,MI_SIB_SSMASK shr ecx,MI_SIB_SSSHIFT ; for shift count shl eax,cl add ebx,eax do310: cmp edx,MI_SIB_BASENONE jne do120 ; ; If mod != 0, then we have to add in EBP, and make ss the default seg ; mov edx,ModRm and edx,MI_MODMASK shr edx,MI_MODSHIFT cmp edx,MI_MODNONE jne do120 ; ; Add in Ebp, and change default segment to ss ; add ebx,[edi].TsEbp lea edx,SegLimit push edx lea edx,SegBase push edx lea edx,SegFlags push edx mov edi,[esi].RiTrapFrame push [edi].TsHardwareSegSs call VdmSegParams add esp,010h mov SelLookupResult,eax jmp do120 ; add in segment info VdmDecodeOperand endp public VdmSegParams VdmSegParams proc push edi mov edi,[esi].RiTrapFrame test dword ptr [edi].TsEFlags,EFLAGS_V86_MASK jz vsp20 Segmt equ word ptr [ebp + 8] SegFlags equ [ebp + 0Ch] SegBase equ [ebp + 010h] SegLimit equ [ebp + 014h] pop edi push ebp mov ebp,esp push edi movzx eax,Segmt shl eax,4 mov edi,SegBase mov [edi],eax mov edi,SegLimit mov dword ptr [edi],0FFFFh mov edi,SegFlags mov [edi],dword ptr SEL_TYPE_WRITE mov eax,1 pop edi mov esp,ebp pop ebp ret vsp20: pop edi IFDEF STD_CALL jmp _Ki386GetSelectorParameters@16 ELSE jmp _Ki386GetSelectorParameters ENDIF VdmSegParams endp _PAGE ENDS end
27.497553
80
0.513408
46051ee3d90db82c06fb7ad462ae6ac3cfa69a37
20,240
asm
Assembly
lib/x86_64/poly1305.asm
jkivilin/intel-ipsec-mb
6e3f4777f41cd788c9d51bf19c79a409ad97ef69
[ "BSD-3-Clause" ]
1
2022-03-26T12:31:12.000Z
2022-03-26T12:31:12.000Z
lib/x86_64/poly1305.asm
jkivilin/intel-ipsec-mb
6e3f4777f41cd788c9d51bf19c79a409ad97ef69
[ "BSD-3-Clause" ]
null
null
null
lib/x86_64/poly1305.asm
jkivilin/intel-ipsec-mb
6e3f4777f41cd788c9d51bf19c79a409ad97ef69
[ "BSD-3-Clause" ]
null
null
null
;; ;; Copyright (c) 2020-2022, Intel Corporation ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions are met: ;; ;; * Redistributions of source code must retain the above copyright notice, ;; this list of conditions and the following disclaimer. ;; * Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; * Neither the name of Intel Corporation nor the names of its contributors ;; may be used to endorse or promote products derived from this software ;; without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; ;; Useful links for understanding Poly1305: ;; "ChaCha20 and Poly1305 for IETF Protocols" ;; https://tools.ietf.org/html/rfc7539 ;; "A GO IMPLEMENTATION OF POLY1305 THAT MAKES SENSE" ;; https://blog.filippo.io/a-literate-go-implementation-of-poly1305/ ;; "The design of Poly1305" ;; http://loup-vaillant.fr/tutorials/poly1305-design %include "include/os.asm" %include "include/reg_sizes.asm" %include "include/memcpy.asm" %include "include/imb_job.asm" %include "include/clear_regs.asm" [bits 64] default rel %ifdef LINUX %define arg1 rdi %define arg2 rsi %define arg3 rdx %define arg4 rcx %define job arg1 %define gp1 rsi %define gp2 rcx %else %define arg1 rcx %define arg2 rdx %define arg3 r8 %define arg4 r9 %define job rdi %define gp1 rcx ;; 'arg1' copied to 'job' at start %define gp2 rsi %endif ;; don't use rdx and rax - they are needed for multiply operation %define gp3 rbp %define gp4 r8 %define gp5 r9 %define gp6 r10 %define gp7 r11 %define gp8 r12 %define gp9 r13 %define gp10 r14 %define gp11 r15 %xdefine len gp11 %xdefine msg gp10 %define POLY1305_BLOCK_SIZE 16 struc STACKFRAME _gpr_save: resq 8 endstruc mksection .text ;; ============================================================================= ;; ============================================================================= ;; Initializes POLY1305 context structure ;; ============================================================================= %macro POLY1305_INIT 6 %define %%KEY %1 ; [in] pointer to 32-byte key %define %%A0 %2 ; [out] GPR with accumulator bits 63..0 %define %%A1 %3 ; [out] GPR with accumulator bits 127..64 %define %%A2 %4 ; [out] GPR with accumulator bits 195..128 %define %%R0 %5 ; [out] GPR with R constant bits 63..0 %define %%R1 %6 ; [out] GPR with R constant bits 127..64 ;; R = KEY[0..15] & 0xffffffc0ffffffc0ffffffc0fffffff mov %%R0, 0x0ffffffc0fffffff and %%R0, [%%KEY + (0 * 8)] mov %%R1, 0x0ffffffc0ffffffc and %%R1, [%%KEY + (1 * 8)] ;; set accumulator to 0 xor %%A0, %%A0 xor %%A1, %%A1 xor %%A2, %%A2 %endmacro ;; ============================================================================= ;; ============================================================================= ;; Computes hash for message length being multiple of block size ;; ============================================================================= %macro POLY1305_MUL_REDUCE 11 %define %%A0 %1 ; [in/out] GPR with accumulator bits 63:0 %define %%A1 %2 ; [in/out] GPR with accumulator bits 127:64 %define %%A2 %3 ; [in/out] GPR with accumulator bits 195:128 %define %%R0 %4 ; [in] GPR with R constant bits 63:0 %define %%R1 %5 ; [in] GPR with R constant bits 127:64 %define %%C1 %6 ; [in] C1 = R1 + (R1 >> 2) %define %%T1 %7 ; [clobbered] GPR register %define %%T2 %8 ; [clobbered] GPR register %define %%T3 %9 ; [clobbered] GPR register %define %%GP_RAX %10 ; [clobbered] RAX register %define %%GP_RDX %11 ; [clobbered] RDX register ;; Combining 64-bit x 64-bit multiplication with reduction steps ;; ;; NOTES: ;; 1) A2 here is only two bits so anything above is subject of reduction. ;; Constant C1 = R1 + (R1 >> 2) simplifies multiply with less operations ;; 2) Magic 5x comes from mod 2^130-5 property and incorporating ;; reduction into multiply phase. ;; See "Cheating at modular arithmetic" and "Poly1305's prime: 2^130 - 5" ;; paragraphs at https://loup-vaillant.fr/tutorials/poly1305-design for more details. ;; ;; Flow of the code below is as follows: ;; ;; A2 A1 A0 ;; x R1 R0 ;; ----------------------------- ;; A2×R0 A1×R0 A0×R0 ;; + A0×R1 ;; + 5xA2xR1 5xA1xR1 ;; ----------------------------- ;; [0|L2L] [L1H|L1L] [L0H|L0L] ;; ;; Registers: T3:T2 T1:A0 ;; ;; Completing the multiply and adding (with carry) 3x128-bit limbs into ;; 192-bits again (3x64-bits): ;; A0 = L0L ;; A1 = L0H + L1L ;; T3 = L1H + L2L mov %%GP_RAX, %%R1 mul %%A0 mov %%T2, %%GP_RAX mov %%GP_RAX, %%R0 mov %%T3, %%GP_RDX ;; T1:A0 = (A0 * R0) mul %%A0 mov %%A0, %%GP_RAX ;; A0 not used in other operations mov %%GP_RAX, %%R0 mov %%T1, %%GP_RDX ;; T3:T2 += (A1 * R0) mul %%A1 add %%T2, %%GP_RAX mov %%GP_RAX, %%C1 adc %%T3, %%GP_RDX ;; T1:A0 += (A1 * R1x5) mul %%A1 mov %%A1, %%A2 ;; use A1 for A2 add %%A0, %%GP_RAX adc %%T1, %%GP_RDX ;; NOTE: A2 is clamped to 2-bits, ;; R1/R0 is clamped to 60-bits, ;; their product is less than 2^64. ;; T3:T2 += (A2 * R1x5) imul %%A1, %%C1 add %%T2, %%A1 mov %%A1, %%T1 ;; T1:A0 => A1:A0 adc %%T3, 0 ;; T3:A1 += (A2 * R0) imul %%A2, %%R0 add %%A1, %%T2 adc %%T3, %%A2 ;; At this point, 3 64-bit limbs are in T3:A1:A0 ;; T3 can span over more than 2 bits so final partial reduction step is needed. ;; ;; Partial reduction (just to fit into 130 bits) ;; A2 = T3 & 3 ;; k = (T3 & ~3) + (T3 >> 2) ;; Y x4 + Y x1 ;; A2:A1:A0 += k ;; ;; Result will be in A2:A1:A0 mov %%T1, %%T3 mov DWORD(%%A2), DWORD(%%T3) and %%T1, ~3 shr %%T3, 2 and DWORD(%%A2), 3 add %%T1, %%T3 ;; A2:A1:A0 += k (kept in T1) add %%A0, %%T1 adc %%A1, 0 adc DWORD(%%A2), 0 %endmacro ;; ============================================================================= ;; ============================================================================= ;; Computes hash for message length being multiple of block size ;; ============================================================================= %macro POLY1305_BLOCKS 13 %define %%MSG %1 ; [in/out] GPR pointer to input message (updated) %define %%LEN %2 ; [in/out] GPR in: length in bytes / out: length mod 16 %define %%A0 %3 ; [in/out] accumulator bits 63..0 %define %%A1 %4 ; [in/out] accumulator bits 127..64 %define %%A2 %5 ; [in/out] accumulator bits 195..128 %define %%R0 %6 ; [in] R constant bits 63..0 %define %%R1 %7 ; [in] R constant bits 127..64 %define %%T0 %8 ; [clobbered] GPR register %define %%T1 %9 ; [clobbered] GPR register %define %%T2 %10 ; [clobbered] GPR register %define %%T3 %11 ; [clobbered] GPR register %define %%GP_RAX %12 ; [clobbered] RAX register %define %%GP_RDX %13 ; [clobbered] RDX register mov %%T0, %%R1 shr %%T0, 2 add %%T0, %%R1 ;; T0 = R1 + (R1 >> 2) %%_poly1305_blocks_loop: cmp %%LEN, POLY1305_BLOCK_SIZE jb %%_poly1305_blocks_loop_end ;; A += MSG[i] add %%A0, [%%MSG + (0 * 8)] adc %%A1, [%%MSG + (1 * 8)] adc %%A2, 1 ;; padding bit POLY1305_MUL_REDUCE %%A0, %%A1, %%A2, %%R0, %%R1, \ %%T0, %%T1, %%T2, %%T3, %%GP_RAX, %%GP_RDX add %%MSG, POLY1305_BLOCK_SIZE sub %%LEN, POLY1305_BLOCK_SIZE jmp %%_poly1305_blocks_loop %%_poly1305_blocks_loop_end: %endmacro ;; ============================================================================= ;; ============================================================================= ;; Computes hash for the final partial block ;; ============================================================================= %macro POLY1305_PARTIAL_BLOCK 15 %define %%BUF %1 ; [in/clobbered] pointer to 16 byte scratch buffer %define %%MSG %2 ; [in] GPR pointer to input message %define %%LEN %3 ; [in] GPR message length %define %%A0 %4 ; [in/out] accumulator bits 63..0 %define %%A1 %5 ; [in/out] accumulator bits 127..64 %define %%A2 %6 ; [in/out] accumulator bits 195..128 %define %%R0 %7 ; [in] R constant bits 63..0 %define %%R1 %8 ; [in] R constant bits 127..64 %define %%T0 %9 ; [clobbered] GPR register %define %%T1 %10 ; [clobbered] GPR register %define %%T2 %11 ; [clobbered] GPR register %define %%T3 %12 ; [clobbered] GPR register %define %%GP_RAX %13 ; [clobbered] RAX register %define %%GP_RDX %14 ; [clobbered] RDX register %define %%PAD_16 %15 ; [in] text "pad_to_16" or "no_padding" ;; clear the scratch buffer xor %%T1, %%T1 mov [%%BUF + 0], %%T1 mov [%%BUF + 8], %%T1 ;; copy message bytes into the scratch buffer memcpy_sse_16_1 %%BUF, %%MSG, %%LEN, %%T1, %%T2 %ifnidn %%PAD_16,pad_to_16 ;; pad the message in the scratch buffer mov byte [%%BUF + %%LEN], 0x01 %endif ;; A += MSG[i] add %%A0, [%%BUF + 0] adc %%A1, [%%BUF + 8] %ifnidn %%PAD_16,pad_to_16 adc %%A2, 0 ;; no padding bit %else adc %%A2, 1 ;; padding bit please %endif mov %%T0, %%R1 shr %%T0, 2 add %%T0, %%R1 ;; T0 = R1 + (R1 >> 2) POLY1305_MUL_REDUCE %%A0, %%A1, %%A2, %%R0, %%R1, \ %%T0, %%T1, %%T2, %%T3, %%GP_RAX, %%GP_RDX %ifdef SAFE_DATA ;; clear the scratch buffer xor %%T1, %%T1 mov [%%BUF + 0], %%T1 mov [%%BUF + 8], %%T1 %endif %endmacro ;; ============================================================================= ;; ============================================================================= ;; Finalizes Poly1305 hash calculation on a message ;; ============================================================================= %macro POLY1305_FINALIZE 8 %define %%KEY %1 ; [in] pointer to 32 byte key %define %%MAC %2 ; [in/out] pointer to store MAC value into (16 bytes) %define %%A0 %3 ; [in/out] accumulator bits 63..0 %define %%A1 %4 ; [in/out] accumulator bits 127..64 %define %%A2 %5 ; [in/out] accumulator bits 195..128 %define %%T0 %6 ; [clobbered] GPR register %define %%T1 %7 ; [clobbered] GPR register %define %%T2 %8 ; [clobbered] GPR register ;; T = A - P, where P = 2^130 - 5 ;; P[63..0] = 0xFFFFFFFFFFFFFFFB ;; P[127..64] = 0xFFFFFFFFFFFFFFFF ;; P[195..128] = 0x0000000000000003 mov %%T0, %%A0 mov %%T1, %%A1 mov %%T2, %%A2 sub %%T0, -5 ;; 0xFFFFFFFFFFFFFFFB sbb %%T1, -1 ;; 0xFFFFFFFFFFFFFFFF sbb %%T2, 0x3 ;; if A > (2^130 - 5) then A = T ;; - here, if borrow/CF == false then A = T cmovnc %%A0, %%T0 cmovnc %%A1, %%T1 ;; MAC = (A + S) mod 2^128 (S = key[16..31]) add %%A0, [%%KEY + (2 * 8)] adc %%A1, [%%KEY + (3 * 8)] ;; store MAC mov [%%MAC + (0 * 8)], %%A0 mov [%%MAC + (1 * 8)], %%A1 %endmacro ;; ============================================================================= ;; ============================================================================= ;; Creates stack frame and saves registers ;; ============================================================================= %macro FUNC_ENTRY 0 sub rsp, STACKFRAME_size mov [rsp + _gpr_save + 8*0], rbx mov [rsp + _gpr_save + 8*1], rbp mov [rsp + _gpr_save + 8*2], r12 mov [rsp + _gpr_save + 8*3], r13 mov [rsp + _gpr_save + 8*4], r14 mov [rsp + _gpr_save + 8*5], r15 %ifndef LINUX mov [rsp + _gpr_save + 8*6], rsi mov [rsp + _gpr_save + 8*7], rdi %endif %endmacro ; FUNC_ENTRY ;; ============================================================================= ;; ============================================================================= ;; Restores registers and removes the stack frame ;; ============================================================================= %macro FUNC_EXIT 0 mov rbx, [rsp + _gpr_save + 8*0] mov rbp, [rsp + _gpr_save + 8*1] mov r12, [rsp + _gpr_save + 8*2] mov r13, [rsp + _gpr_save + 8*3] mov r14, [rsp + _gpr_save + 8*4] mov r15, [rsp + _gpr_save + 8*5] %ifndef LINUX mov rsi, [rsp + _gpr_save + 8*6] mov rdi, [rsp + _gpr_save + 8*7] %endif add rsp, STACKFRAME_size %ifdef SAFE_DATA clear_scratch_gps_asm %endif ;; SAFE_DATA %endmacro ;; ============================================================================= ;; ============================================================================= ;; void poly1305_mac_scalar(IMB_JOB *job) ;; arg1 - job structure align 32 MKGLOBAL(poly1305_mac_scalar,function,internal) poly1305_mac_scalar: FUNC_ENTRY %ifndef LINUX mov job, arg1 %endif %ifdef SAFE_PARAM or job, job jz .poly1305_mac_exit %endif %xdefine _a0 gp1 %xdefine _a1 gp2 %xdefine _a2 gp3 %xdefine _r0 gp4 %xdefine _r1 gp5 mov gp6, [job + _poly1305_key] POLY1305_INIT gp6, _a0, _a1, _a2, _r0, _r1 mov msg, [job + _src] add msg, [job + _hash_start_src_offset_in_bytes] mov len, [job + _msg_len_to_hash] POLY1305_BLOCKS msg, len, _a0, _a1, _a2, _r0, _r1, \ gp6, gp7, gp8, gp9, rax, rdx or len, len jz .poly1305_no_partial_block ;; create stack frame for the partial block scratch buffer sub rsp, 16 POLY1305_PARTIAL_BLOCK rsp, msg, len, _a0, _a1, _a2, _r0, _r1, \ gp6, gp7, gp8, gp9, rax, rdx, no_padding ;; remove the stack frame (memory is cleared as part of the macro) add rsp, 16 .poly1305_no_partial_block: mov rax, [job + _poly1305_key] mov rdx, [job + _auth_tag_output] POLY1305_FINALIZE rax, rdx, _a0, _a1, _a2, gp6, gp7, gp8 .poly1305_mac_exit: FUNC_EXIT ret ;; ============================================================================= ;; ============================================================================= ;; void poly1305_aead_update_scalar(const void *msg, const uint64_t msg_len, ;; void *hash, const void *key) ;; arg1 - message pointer ;; arg2 - message length in bytes ;; arg3 - pointer to current hash value (size 24 bytes) ;; arg4 - key pointer (size 32 bytes) align 32 MKGLOBAL(poly1305_aead_update_scalar,function,internal) poly1305_aead_update_scalar: %ifdef SAFE_PARAM or arg1, arg1 jz .poly1305_update_exit or arg3, arg3 jz .poly1305_update_exit or arg4, arg4 jz .poly1305_update_exit %endif FUNC_ENTRY %ifdef LINUX %xdefine _a0 gp3 %xdefine _a1 gp4 %xdefine _a2 gp5 %xdefine _r0 gp6 %xdefine _r1 gp7 %xdefine _len arg2 %xdefine _arg3 arg4 ; use rcx, arg3 = rdx %else %xdefine _a0 gp3 %xdefine _a1 rdi %xdefine _a2 gp5 ; = arg4 / r9 %xdefine _r0 gp6 %xdefine _r1 gp7 %xdefine _len gp2 ; rsi %xdefine _arg3 arg3 ; arg %endif ;; load R mov _r0, [arg4 + 0 * 8] mov _r1, [arg4 + 1 * 8] ;; load accumulator / current hash value ;; note: arg4 can't be used beyond this point %ifdef LINUX mov _arg3, arg3 ; note: _arg3 = arg4 (linux) %endif mov _a0, [_arg3 + 0 * 8] mov _a1, [_arg3 + 1 * 8] mov _a2, [_arg3 + 2 * 8] ; note: _a2 = arg4 (win) %ifndef LINUX mov _len, arg2 ;; arg2 = rdx on Windows %endif POLY1305_BLOCKS arg1, _len, _a0, _a1, _a2, _r0, _r1, \ gp10, gp11, gp8, gp9, rax, rdx or _len, _len jz .poly1305_update_no_partial_block ;; create stack frame for the partial block scratch buffer sub rsp, 16 POLY1305_PARTIAL_BLOCK rsp, arg1, _len, _a0, _a1, _a2, _r0, _r1, \ gp10, gp11, gp8, gp9, rax, rdx, pad_to_16 ;; remove the stack frame (memory is cleared as part of the macro) add rsp, 16 .poly1305_update_no_partial_block: ;; save accumulator back mov [_arg3 + 0 * 8], _a0 mov [_arg3 + 1 * 8], _a1 mov [_arg3 + 2 * 8], _a2 FUNC_EXIT .poly1305_update_exit: ret ;; ============================================================================= ;; ============================================================================= ;; void poly1305_aead_complete_scalar(const void *hash, const void *key, void *tag) ;; arg1 - pointer to current hash value (size 24 bytes) ;; arg2 - key pointer (size 32 bytes) ;; arg3 - pointer to store computed authentication tag (16 bytes) align 32 MKGLOBAL(poly1305_aead_complete_scalar,function,internal) poly1305_aead_complete_scalar: %ifdef SAFE_PARAM or arg1, arg1 jz .poly1305_complete_exit or arg2, arg2 jz .poly1305_complete_exit or arg3, arg3 jz .poly1305_complete_exit %endif FUNC_ENTRY %xdefine _a0 gp6 %xdefine _a1 gp7 %xdefine _a2 gp8 ;; load accumulator / current hash value mov _a0, [arg1 + 0 * 8] mov _a1, [arg1 + 1 * 8] mov _a2, [arg1 + 2 * 8] POLY1305_FINALIZE arg2, arg3, _a0, _a1, _a2, gp9, gp10, gp11 ;; clear Poly key %ifdef SAFE_DATA xor rax, rax mov [arg2], rax mov [arg2 + 8], rax mov [arg2 + 16], rax mov [arg2 + 24], rax %endif FUNC_EXIT .poly1305_complete_exit: ret mksection stack-noexec
34.363328
98
0.489921
9ff5a76db70150e4ff817f36612a344213943e5c
722
asm
Assembly
src/cpu/registers_asm.asm
AlexandreArduino/mykernel
488a947c87457b11471a06f3fd0544d6145806d7
[ "BSD-3-Clause" ]
9
2022-01-30T12:54:58.000Z
2022-01-30T16:51:45.000Z
src/cpu/registers_asm.asm
AlexandreArduino/mykernel
488a947c87457b11471a06f3fd0544d6145806d7
[ "BSD-3-Clause" ]
null
null
null
src/cpu/registers_asm.asm
AlexandreArduino/mykernel
488a947c87457b11471a06f3fd0544d6145806d7
[ "BSD-3-Clause" ]
null
null
null
[BITS 64] GLOBAL dump_registers_asm GLOBAL registers_saved GLOBAL number_registers REGISTERS_COUNT equ 13 number_registers: dw REGISTERS_COUNT registers_saved: resb 8 * REGISTERS_COUNT dump_registers_asm: mov [registers_saved], rax mov [registers_saved + 8], rbx mov [registers_saved + 16], rcx mov [registers_saved + 24], rdx mov [registers_saved + 32], rsi mov [registers_saved + 40], rdi mov [registers_saved + 48], r8 mov [registers_saved + 56], r9 mov [registers_saved + 64], r10 mov [registers_saved + 72], r11 mov [registers_saved + 80], r12 mov [registers_saved + 88], r13 mov [registers_saved + 96], r14 mov [registers_saved + 104], r15 ret
24.066667
36
0.692521
11893ab2edc61359edf77c36c7ed060350a984a1
340
asm
Assembly
programs/oeis/212/A212685.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/212/A212685.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/212/A212685.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A212685: Number of (w,x,y,z) with all terms in {1,...,n} and |w-x|=w+|y-z|. ; 0,0,2,7,18,36,64,103,156,224,310,415,542,692,868,1071,1304,1568,1866,2199,2570,2980,3432,3927,4468,5056,5694,6383,7126,7924,8780,9695,10672,11712,12818,13991,15234,16548,17936,19399,20940,22560 mul $0,4 mov $1,$0 bin $0,3 add $0,$1 div $0,8 mul $0,2 div $0,8
30.909091
195
0.676471
cae0ff1ed262c8bbf038f749599bcfe3bdf21f1f
628
asm
Assembly
programs/oeis/026/A026355.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/026/A026355.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/026/A026355.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A026355: a(n) = least k such that s(k) = n+1, where s = A026354. ; 1,2,3,5,6,8,10,11,13,14,16,18,19,21,23,24,26,27,29,31,32,34,35,37,39,40,42,44,45,47,48,50,52,53,55,57,58,60,61,63,65,66,68,69,71,73,74,76,78,79,81,82,84,86,87,89,90,92,94,95,97,99,100,102,103,105,107,108,110 mov $4,$0 add $4,1 mov $7,$0 lpb $4 mov $0,$7 sub $4,1 sub $0,$4 mov $2,2 mov $8,$0 lpb $2 mov $0,$8 sub $2,1 add $0,$2 sub $0,2 mul $0,21 div $0,34 mov $5,$0 mov $6,$2 lpb $6 mov $3,$5 sub $6,1 lpe lpe lpb $8 sub $3,$5 mov $8,0 lpe mov $5,$3 add $5,1 add $1,$5 lpe
17.942857
209
0.515924
1bce5ade70653419f78793fe55a9988b2a60c650
514
asm
Assembly
programs/oeis/006/A006463.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/006/A006463.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/006/A006463.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A006463: Convolve natural numbers with characteristic function of triangular numbers. ; 0,0,1,2,4,6,8,11,14,17,20,24,28,32,36,40,45,50,55,60,65,70,76,82,88,94,100,106,112,119,126,133,140,147,154,161,168,176,184,192,200,208,216,224,232,240,249,258,267,276,285,294,303,312,321,330,340,350,360,370,380,390,400,410,420,430,440,451,462,473,484,495,506,517,528,539,550,561,572,584,596,608,620,632,644,656,668,680,692,704,716,728,741,754,767,780,793,806,819,832 lpb $0 add $2,1 sub $0,$2 add $1,$0 lpe mov $0,$1
51.4
368
0.715953
df5ac089825299c12b59d7c9b8d880f97eb1ea81
681
asm
Assembly
oeis/023/A023947.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/023/A023947.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/023/A023947.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A023947: Expansion of 1/((1-x)(1-5x)(1-10x)(1-12x)). ; Submitted by Jon Maiga ; 1,28,527,8390,122121,1683768,22407907,291019450,3713967341,46787388908,583658682087,7226065372110,88934701511761,1089437114484448,13295459966641067,161767703674942370,1963434475586667381,23783434975587914388,287623437160905612847,3473703444311231666230,41906663434747712666201,505102182843148326462728,6083448413359769901005427,73223603167638299840439690,880905460159376014338260221,10593087743762205364435153468,127339275145506041446213106807,1530293523958981493830624718750 add $0,2 lpb $0 sub $0,1 add $2,2 mul $2,5 sub $2,9 mul $3,10 add $3,$1 mul $1,12 add $1,$2 lpe mov $0,$3
40.058824
477
0.819383
2a4578330d9ef063c707ed35d44b9f75e8fe4351
555
asm
Assembly
oeis/071/A071053.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/071/A071053.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/071/A071053.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A071053: Number of ON cells at n-th generation of 1-D CA defined by Rule 150, starting with a single ON cell at generation 0. ; Submitted by Jamie Morken(s4) ; 1,3,3,5,3,9,5,11,3,9,9,15,5,15,11,21,3,9,9,15,9,27,15,33,5,15,15,25,11,33,21,43,3,9,9,15,9,27,15,33,9,27,27,45,15,45,33,63,5,15,15,25,15,45,25,55,11,33,33,55,21,63,43,85,3,9,9,15,9,27,15,33,9,27,27,45,15,45,33,63,9,27,27,45,27,81,45,99,15,45,45,75,33,99,63,129,5,15,15,25 mul $0,2 mov $2,1 lpb $0 div $0,2 mov $4,$2 add $2,$3 add $3,$0 mod $3,2 mul $4,2 mul $3,$4 lpe mov $0,$2
32.647059
273
0.630631
9d93cb2e619c7c22634276c02cab621a46cf5e5b
7,603
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2166.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2166.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2166.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r14 push %r8 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x1e1bc, %r11 nop cmp $55479, %rdx mov (%r11), %edi nop nop nop nop cmp $2766, %r8 lea addresses_WT_ht+0x19f72, %r14 nop nop add %r9, %r9 movups (%r14), %xmm7 vpextrq $0, %xmm7, %rax nop xor %rdi, %rdi lea addresses_A_ht+0x3050, %r9 nop nop nop nop xor %r11, %r11 movw $0x6162, (%r9) nop nop nop sub $7695, %rdi lea addresses_WT_ht+0x10a5c, %rsi lea addresses_WC_ht+0xd3bc, %rdi nop and $20090, %r14 mov $103, %rcx rep movsb nop nop nop nop nop dec %rax lea addresses_normal_ht+0x4948, %rdx clflush (%rdx) nop nop nop nop nop add $56853, %r8 movl $0x61626364, (%rdx) nop nop nop nop sub %r14, %r14 lea addresses_normal_ht+0x39c, %rcx nop nop nop and %rax, %rax movups (%rcx), %xmm1 vpextrq $0, %xmm1, %rdx nop and %rcx, %rcx lea addresses_WT_ht+0x48bc, %rsi lea addresses_UC_ht+0x9384, %rdi and %r8, %r8 mov $115, %rcx rep movsw nop and $50748, %rcx lea addresses_D_ht+0x4f7c, %rsi lea addresses_normal_ht+0x1a8fc, %rdi nop nop nop nop cmp $38247, %r14 mov $48, %rcx rep movsb xor %r9, %r9 lea addresses_D_ht+0x3e9c, %r9 nop nop nop nop cmp %rax, %rax mov $0x6162636465666768, %rsi movq %rsi, (%r9) nop nop nop nop cmp %rsi, %rsi lea addresses_D_ht+0xd5bc, %rsi lea addresses_UC_ht+0xd9bc, %rdi nop nop sub %r11, %r11 mov $92, %rcx rep movsw nop add $14284, %rdx lea addresses_UC_ht+0x2cfc, %rsi lea addresses_WC_ht+0x617c, %rdi clflush (%rsi) cmp %r9, %r9 mov $15, %rcx rep movsb nop nop nop nop nop and %r8, %r8 lea addresses_A_ht+0x527c, %r14 nop nop sub $59865, %rsi mov $0x6162636465666768, %rax movq %rax, %xmm2 vmovups %ymm2, (%r14) nop nop nop nop nop dec %rdx lea addresses_normal_ht+0x1c5bc, %rsi lea addresses_D_ht+0x1457c, %rdi nop nop nop nop nop lfence mov $106, %rcx rep movsb nop nop xor $37067, %r14 lea addresses_A_ht+0x7c80, %r9 nop xor %rax, %rax mov (%r9), %esi nop nop nop nop sub $30664, %r14 pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r14 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %r9 push %rbp push %rdi push %rsi // Faulty Load lea addresses_WC+0xdbc, %r12 nop nop nop nop and %r9, %r9 movb (%r12), %r15b lea oracles, %rdi and $0xff, %r15 shlq $12, %r15 mov (%rdi,%r15,1), %r15 pop %rsi pop %rdi pop %rbp pop %r9 pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': True}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 5, 'size': 32, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': True, 'NT': 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 */
33.791111
2,999
0.658424
59d2133fd0fd38651094490000707eda19db4332
476
asm
Assembly
programs/oeis/143/A143988.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/143/A143988.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/143/A143988.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A143988: Numbers congruent to {5, 13} mod 18. ; 5,13,23,31,41,49,59,67,77,85,95,103,113,121,131,139,149,157,167,175,185,193,203,211,221,229,239,247,257,265,275,283,293,301,311,319,329,337,347,355,365,373,383,391,401,409,419,427,437,445,455,463,473,481,491,499,509,517,527,535,545,553,563,571,581,589,599,607,617,625,635,643,653,661,671,679,689,697,707,715,725,733,743,751,761,769,779,787,797,805,815,823,833,841,851,859,869,877,887,895 mul $0,18 div $0,4 mul $0,2 add $0,5
59.5
389
0.718487
2a4cdf6db666000e2dff4a55f400e4c2b14296a1
734
asm
Assembly
libsrc/_DEVELOPMENT/arch/zx/display/z80/asm_zx_py2aaddr.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/zx/display/z80/asm_zx_py2aaddr.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/zx/display/z80/asm_zx_py2aaddr.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; =============================================================== ; Jun 2007 ; =============================================================== ; ; void *zx_py2aaddr(uchar y) ; ; Attribute address corresponding to pixel coordinate x = 0, y. ; =============================================================== INCLUDE "config_private.inc" SECTION code_clib SECTION code_arch PUBLIC asm_zx_py2aaddr asm_zx_py2aaddr: ; enter : l = valid pixel y coordinate ; ; exit : hl = attribute address containing pixel at x = 0, y. ; ; uses : af, hl ld a,l rlca rlca ld h,a and $e0 ld l,a ld a,h and $03 IF __USE_SPECTRUM_128_SECOND_DFILE or $d8 ELSE or $58 ENDIF ld h,a ret
16.311111
65
0.459128
5fcce940935451e08ca9f5b0a200becb50d07b93
537
asm
Assembly
oeis/245/A245194.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/245/A245194.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/245/A245194.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A245194: G.f.: Sum_{k>=0} t^3/((1+t)*(1+t^2)), where t=x^(2^k). ; Submitted by Jon Maiga ; 0,0,0,1,-1,0,1,1,-2,0,0,1,0,0,1,1,-3,0,0,1,-1,0,1,1,-1,0,0,1,0,0,1,1,-4,0,0,1,-1,0,1,1,-2,0,0,1,0,0,1,1,-2,0,0,1,-1,0,1,1,-1,0,0,1,0,0,1,1,-5,0,0,1,-1,0,1,1,-2,0,0,1,0,0,1,1,-3,0,0,1,-1,0,1,1,-1,0,0,1,0,0,1 mov $3,2 mov $5,$0 lpb $3 mov $0,$5 sub $3,1 add $0,$3 trn $0,1 seq $0,14081 ; a(n) is the number of occurrences of '11' in binary expansion of n. mov $2,$3 mul $2,$0 add $4,$2 lpe min $5,1 mul $5,$0 mov $0,$4 sub $0,$5
25.571429
208
0.513966
1e6c5fd053d16b3478568222485947204e6896fb
412
asm
Assembly
programs/oeis/133/A133037.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/133/A133037.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/133/A133037.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A133037: Squares of members of the Padovan sequence A000931. ; 1,0,0,1,0,1,1,1,4,4,9,16,25,49,81,144,256,441,784,1369,2401,4225,7396,12996,22801,40000,70225,123201,216225,379456,665856,1168561,2050624,3598609,6315169,11082241,19448100,34128964,59892121,105103504,184443561,323676081 cal $0,931 ; Padovan sequence (or Padovan numbers): a(n) = a(n-2) + a(n-3) with a(0) = 1, a(1) = a(2) = 0. pow $0,2 mov $1,$0
58.857143
221
0.718447